@yabgu_gm/tensionscript 0.13.0 → 0.13.2

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.
@@ -4,17 +4,17 @@
4
4
  * Copyright 2026 Daniel Wirtz / The AssemblyScript Authors
5
5
  * SPDX-License-Identifier: Apache-2.0
6
6
  */
7
- var Mu=Object.defineProperty;var H_=Object.getOwnPropertyDescriptor;var kE=Object.getOwnPropertyNames;var FE=Object.prototype.hasOwnProperty;var zu=(n,r)=>{for(var e in r)Mu(n,e,{get:r[e],enumerable:!0})},K_=(n,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of kE(r))!FE.call(n,i)&&i!==e&&Mu(n,i,{get:()=>r[i],enumerable:!(t=H_(r,i))||t.enumerable});return n},Du=(n,r,e)=>(K_(n,r,"default"),e&&K_(e,r,"default"));var j_=(n,r,e,t)=>{for(var i=t>1?void 0:t?H_(r,e):r,s=n.length-1,a;s>=0;s--)(a=n[s])&&(i=(t?a(r,e,i):a(i))||i);return t&&i&&Mu(r,e,i),i};var q_={};zu(q_,{ASTBuilder:()=>O_,ArrayLiteralExpression:()=>Yr,ArrowKind:()=>$t,AssertionExpression:()=>vl,AssertionKind:()=>Xt,AsyncLowerTransform:()=>wa,AtomicRMWOp:()=>sf,AwaitExpression:()=>Yl,BinaryExpression:()=>Il,BinaryModule:()=>Lo,BinaryOp:()=>ti,BindResult:()=>zs,BlockStatement:()=>ro,BrOnOp:()=>Hb,BreakStatement:()=>no,CallExpression:()=>kl,Class:()=>Ar,ClassDeclaration:()=>cs,ClassExpression:()=>Fl,ClassPrototype:()=>qs,ClosureLowerTransform:()=>ga,CommaExpression:()=>wl,CommentKind:()=>ef,CommentNode:()=>Sl,CommonFlags:()=>ze,CommonNames:()=>B,CompiledExpression:()=>eo,Compiler:()=>fa,ConditionKind:()=>Tf,ConstantValueKind:()=>wf,Constraints:()=>d_,ConstructorExpression:()=>Rl,ContinueStatement:()=>io,DEFAULT_STACK_SIZE:()=>gF,DeclarationStatement:()=>nt,DeclaredElement:()=>Tr,DecoratorFlags:()=>Lt,DecoratorKind:()=>Ct,DecoratorNode:()=>Tl,DiagnosticCategory:()=>ls,DiagnosticCode:()=>Xe,DiagnosticEmitter:()=>tt,DiagnosticMessage:()=>ml,DoStatement:()=>so,DynamicArrayTypeNode:()=>El,Element:()=>Gs,ElementAccessExpression:()=>Cl,ElementKind:()=>Et,EmptyStatement:()=>ao,Enum:()=>tu,EnumDeclaration:()=>lo,EnumValue:()=>ru,EnumValueDeclaration:()=>oo,EnvAnalysisRecord:()=>gu,ExportDefaultStatement:()=>fo,ExportImportStatement:()=>uo,ExportMember:()=>co,ExportNames:()=>ca,ExportStatement:()=>po,Expression:()=>xe,ExpressionId:()=>en,ExpressionRunnerFlags:()=>zo,ExpressionStatement:()=>_o,ExternalKind:()=>nf,FEATURES_ALL:()=>zF,FEATURES_DEFAULT:()=>DF,FEATURE_BULK_MEMORY:()=>SF,FEATURE_EXCEPTION_HANDLING:()=>kF,FEATURE_EXTENDED_CONST:()=>BF,FEATURE_GC:()=>CF,FEATURE_MEMORY64:()=>PF,FEATURE_MULTI_VALUE:()=>RF,FEATURE_MUTABLE_GLOBALS:()=>AF,FEATURE_NONTRAPPING_F2I:()=>TF,FEATURE_REFERENCE_TYPES:()=>wF,FEATURE_RELAXED_SIMD:()=>NF,FEATURE_SHARED_EVERYTHING:()=>MF,FEATURE_SIGN_EXTENSION:()=>EF,FEATURE_SIMD:()=>vF,FEATURE_STRINGREF:()=>LF,FEATURE_TAIL_CALLS:()=>FF,FEATURE_THREADS:()=>IF,FalseExpression:()=>Xl,Feature:()=>Ft,FeatureFlags:()=>Mo,FieldDeclaration:()=>ho,FieldFlags:()=>Af,File:()=>Vs,FixedArrayTypeNode:()=>bl,FloatLiteralExpression:()=>Pl,Flow:()=>er,FlowFlags:()=>Ho,ForOfStatement:()=>yo,ForStatement:()=>mo,Function:()=>Mt,FunctionDeclaration:()=>ps,FunctionExpression:()=>Nl,FunctionPrototype:()=>ot,FunctionTypeNode:()=>Zr,GETTER_PREFIX:()=>nl,Global:()=>tn,HeapTypeRef:()=>Ie,INDEX_SUFFIX:()=>Qe,INNER_DELIMITER:()=>zp,INSTANCE_DELIMITER:()=>Mp,IdentifierExpression:()=>rt,IdentifierHandling:()=>Yp,IfStatement:()=>go,ImportDeclaration:()=>bo,ImportNames:()=>gi,ImportStatement:()=>fs,IndexSignature:()=>Ps,IndexSignatureNode:()=>to,InstanceOfExpression:()=>Bl,IntegerLiteralExpression:()=>Ll,Interface:()=>Ns,InterfaceDeclaration:()=>xo,InterfacePrototype:()=>nu,JSBuilder:()=>_i,LIBRARY_PREFIX:()=>wt,LIBRARY_SUBST:()=>Rb,LazyExpression:()=>Jl,LiteralExpression:()=>Rt,LiteralKind:()=>ft,Local:()=>ce,LocalFlags:()=>ws,MemoryModel:()=>_s,MemoryModelCode:()=>ii,MemoryOrder:()=>Ob,MemorySegment:()=>ei,MethodDeclaration:()=>Jr,Module:()=>Jt,ModuleDeclaration:()=>ko,NamedTypeNode:()=>$r,Namespace:()=>Os,NamespaceDeclaration:()=>Eo,NewExpression:()=>Ml,Node:()=>y,NodeKind:()=>Ze,NullExpression:()=>zl,ObjectLiteralExpression:()=>Dl,OmittedExpression:()=>Gl,OperatorKind:()=>Me,Options:()=>pa,PARENT_SUBST:()=>GE,PATH_DELIMITER:()=>mt,PackedType:()=>ms,Parameter:()=>If,ParameterKind:()=>Qt,ParameterNode:()=>Zn,ParenthesizedExpression:()=>Ul,Parser:()=>Ms,Precedence:()=>nx,Program:()=>Ds,Property:()=>Cs,PropertyAccessExpression:()=>Vl,PropertyPrototype:()=>ai,Range:()=>ue,RefAsOp:()=>qb,RegexpLiteralExpression:()=>Ol,Relooper:()=>Bo,ReportMode:()=>Zo,Resolver:()=>Rs,ReturnStatement:()=>Ao,Runtime:()=>tl,RuntimeFeatures:()=>h_,SETTER_PREFIX:()=>il,SIMDExtractOp:()=>af,SIMDLoadOp:()=>uf,SIMDLoadStoreLaneOp:()=>cf,SIMDReplaceOp:()=>lf,SIMDShiftOp:()=>of,SIMDTernaryOp:()=>pf,STATIC_DELIMITER:()=>es,STUB_DELIMITER:()=>Dp,SideEffects:()=>Ef,Signature:()=>fe,Source:()=>Te,SourceKind:()=>Jn,State:()=>yl,Statement:()=>ye,StringEncodeOp:()=>Xb,StringEqOp:()=>$b,StringLiteralExpression:()=>Wl,StringMeasureOp:()=>Qb,StringNewOp:()=>jb,SuperExpression:()=>Kl,SwitchBuilder:()=>ys,SwitchCase:()=>To,SwitchStatement:()=>So,TSDBuilder:()=>bi,Target:()=>Un,TemplateLiteralExpression:()=>Hl,TernaryExpression:()=>ql,ThisExpression:()=>jl,ThrowStatement:()=>vo,Token:()=>bt,Tokenizer:()=>os,TrueExpression:()=>Ql,TryStatement:()=>Io,TupleTypeNode:()=>gl,Type:()=>p,TypeBuilderErrorReason:()=>rf,TypeDeclaration:()=>Fo,TypeDefinition:()=>lt,TypeFlags:()=>Bt,TypeKind:()=>Er,TypeName:()=>$n,TypeNode:()=>jt,TypeParameterNode:()=>Al,TypeRef:()=>P,TypedElement:()=>nr,Typeinfo:()=>Vn,TypeinfoFlags:()=>rl,UnaryExpression:()=>us,UnaryOp:()=>gs,UnaryPostfixExpression:()=>$l,UnaryPrefixExpression:()=>Zl,UncheckedBehavior:()=>jo,UnmanagedArrayTypeNode:()=>xl,VariableDeclaration:()=>wo,VariableLikeDeclarationStatement:()=>Yn,VariableLikeElement:()=>rn,VariableStatement:()=>Ro,VoidStatement:()=>Co,WhileStatement:()=>Po,WideIntAddSubOp:()=>Wb,WideIntMulOp:()=>Kb,addGlobalAlias:()=>fF,allocPtrArray:()=>Ee,applyInTreeTransforms:()=>$x,buildJS:()=>fw,buildTSD:()=>pw,compile:()=>cw,createType:()=>it,defaultFeatures:()=>pu,diagnosticCategoryToColor:()=>Db,diagnosticCategoryToString:()=>$p,diagnosticCodeToString:()=>al,ensureType:()=>Fs,expandType:()=>ff,featureToString:()=>Gn,findDecorator:()=>Zt,formatDiagnostic:()=>Gb,formatDiagnosticMessage:()=>Gb,getBinaryLeft:()=>at,getBinaryOp:()=>ri,getBinaryRight:()=>We,getBinaryenModuleRef:()=>_w,getBlockChildAt:()=>Ss,getBlockChildCount:()=>Ts,getBlockName:()=>As,getBreakCondition:()=>x1,getBreakName:()=>b1,getCallOperandAt:()=>Je,getCallOperandCount:()=>Nt,getCallTarget:()=>Is,getConstValueF32:()=>Ce,getConstValueF64:()=>Pe,getConstValueI32:()=>ae,getConstValueI64High:()=>Ge,getConstValueI64Low:()=>Ne,getConstValueInteger:()=>_f,getConstValueV128:()=>df,getDefaultParameterName:()=>lx,getDependee:()=>ow,getDiagnosticCategory:()=>XF,getDiagnosticCode:()=>QF,getDiagnosticMessage:()=>$F,getDiagnosticRange:()=>ZF,getDiagnosticRelatedRange:()=>YF,getDropValue:()=>A1,getExpressionId:()=>re,getExpressionType:()=>pe,getFunctionBody:()=>v1,getFunctionName:()=>bf,getFunctionParams:()=>I1,getFunctionResults:()=>k1,getFunctionVars:()=>F1,getGlobalGetName:()=>xs,getGlobalInit:()=>C1,getGlobalName:()=>w1,getGlobalType:()=>R1,getIfCondition:()=>qo,getIfFalse:()=>ni,getIfTrue:()=>vs,getLoadBytes:()=>hf,getLoadOffset:()=>p1,getLoadPtr:()=>f1,getLocalGetIndex:()=>Pt,getLocalSetIndex:()=>Uo,getLocalSetValue:()=>Vo,getLoopBody:()=>g1,getLoopName:()=>y1,getMemoryGrowDelta:()=>S1,getRangeEnd:()=>ew,getRangeSource:()=>tw,getRangeStart:()=>JF,getReturnValue:()=>T1,getSelectCondition:()=>E1,getSelectElse:()=>gf,getSelectThen:()=>yf,getSideEffects:()=>ks,getSource:()=>jF,getSourceNormalizedPath:()=>rw,getStoreBytes:()=>_1,getStoreOffset:()=>d1,getStorePtr:()=>h1,getStoreValue:()=>m1,getTagName:()=>P1,getTagParams:()=>N1,getTagResults:()=>B1,getUnaryOp:()=>Es,getUnaryValue:()=>Oo,initializeProgram:()=>uw,isConstExpressionNaN:()=>Go,isConstNaN:()=>c1,isConstNegZero:()=>Do,isConstNonZero:()=>xt,isConstZero:()=>st,isDeclaredElement:()=>Us,isError:()=>sw,isGlobalMutable:()=>xf,isIllegalVariableIdentifier:()=>Jp,isInfo:()=>nw,isLoadSigned:()=>mf,isLocalTee:()=>bs,isNullableType:()=>Zb,isTypeOmitted:()=>De,isTypedElement:()=>Xo,isWarning:()=>iw,mangleInternalName:()=>Ke,mangleInternalPath:()=>ds,mustPreserveSideEffects:()=>Wo,newOptions:()=>Zk,newProgram:()=>KF,nextDiagnostic:()=>HF,nextFile:()=>lw,operatorTokenToString:()=>Le,optimize:()=>hw,parse:()=>aw,readString:()=>Ye,removeGlobalAlias:()=>_F,runtimeFunctions:()=>di,runtimeGlobals:()=>hi,setBasenameHint:()=>VF,setBindingsHint:()=>OF,setBundleVersion:()=>xF,setDebugInfo:()=>WF,setExportMemory:()=>tF,setExportRuntime:()=>yF,setExportStart:()=>dF,setExportTable:()=>lF,setFeature:()=>GF,setImportMemory:()=>rF,setImportTable:()=>aF,setInitialMemory:()=>nF,setLowMemoryLimit:()=>mF,setMaximumMemory:()=>iF,setMemoryBase:()=>cF,setNoAssert:()=>eF,setNoUnsafe:()=>hF,setOptimizeLevelHints:()=>UF,setPedantic:()=>qF,setRuntime:()=>Jk,setSharedMemory:()=>sF,setSourceMap:()=>oF,setStackSize:()=>bF,setTableBase:()=>pF,setTarget:()=>Yk,setUncheckedBehavior:()=>uF,tokenFromKeyword:()=>Ub,tokenIsAlsoIdentifier:()=>Vb,typesToRefs:()=>$1,typesToString:()=>$o,util:()=>Xp,validate:()=>dw});var ee=typeof window<"u"&&window||typeof global<"u"&&global||self;if(typeof ee.ASC_TARGET>"u"){let e=function(){Error.captureStackTrace?Error.captureStackTrace(this,e):this.stack=this.name+": "+this.message+`
7
+ var Mu=Object.defineProperty;var H_=Object.getOwnPropertyDescriptor;var kE=Object.getOwnPropertyNames;var FE=Object.prototype.hasOwnProperty;var zu=(n,r)=>{for(var e in r)Mu(n,e,{get:r[e],enumerable:!0})},K_=(n,r,e,t)=>{if(r&&typeof r=="object"||typeof r=="function")for(let i of kE(r))!FE.call(n,i)&&i!==e&&Mu(n,i,{get:()=>r[i],enumerable:!(t=H_(r,i))||t.enumerable});return n},Du=(n,r,e)=>(K_(n,r,"default"),e&&K_(e,r,"default"));var j_=(n,r,e,t)=>{for(var i=t>1?void 0:t?H_(r,e):r,s=n.length-1,a;s>=0;s--)(a=n[s])&&(i=(t?a(r,e,i):a(i))||i);return t&&i&&Mu(r,e,i),i};var q_={};zu(q_,{ASTBuilder:()=>O_,ArrayLiteralExpression:()=>Yr,ArrowKind:()=>Zt,AssertionExpression:()=>vl,AssertionKind:()=>Xt,AsyncLowerTransform:()=>wa,AtomicRMWOp:()=>sf,AwaitExpression:()=>Yl,BinaryExpression:()=>Il,BinaryModule:()=>Bo,BinaryOp:()=>ti,BindResult:()=>zs,BlockStatement:()=>ro,BrOnOp:()=>Hb,BreakStatement:()=>no,CallExpression:()=>kl,Class:()=>Ar,ClassDeclaration:()=>cs,ClassExpression:()=>Fl,ClassPrototype:()=>qs,ClosureLowerTransform:()=>ga,CommaExpression:()=>wl,CommentKind:()=>ef,CommentNode:()=>Sl,CommonFlags:()=>ze,CommonNames:()=>L,CompiledExpression:()=>eo,Compiler:()=>fa,ConditionKind:()=>Tf,ConstantValueKind:()=>wf,Constraints:()=>d_,ConstructorExpression:()=>Rl,ContinueStatement:()=>io,DEFAULT_STACK_SIZE:()=>gF,DeclarationStatement:()=>nt,DeclaredElement:()=>Tr,DecoratorFlags:()=>Bt,DecoratorKind:()=>Ct,DecoratorNode:()=>Tl,DiagnosticCategory:()=>ls,DiagnosticCode:()=>Xe,DiagnosticEmitter:()=>tt,DiagnosticMessage:()=>ml,DoStatement:()=>so,DynamicArrayTypeNode:()=>El,Element:()=>Gs,ElementAccessExpression:()=>Cl,ElementKind:()=>Et,EmptyStatement:()=>ao,Enum:()=>tu,EnumDeclaration:()=>lo,EnumValue:()=>ru,EnumValueDeclaration:()=>oo,EnvAnalysisRecord:()=>gu,ExportDefaultStatement:()=>fo,ExportImportStatement:()=>uo,ExportMember:()=>co,ExportNames:()=>ca,ExportStatement:()=>po,Expression:()=>xe,ExpressionId:()=>en,ExpressionRunnerFlags:()=>zo,ExpressionStatement:()=>_o,ExternalKind:()=>nf,FEATURES_ALL:()=>zF,FEATURES_DEFAULT:()=>DF,FEATURE_BULK_MEMORY:()=>SF,FEATURE_EXCEPTION_HANDLING:()=>kF,FEATURE_EXTENDED_CONST:()=>LF,FEATURE_GC:()=>CF,FEATURE_MEMORY64:()=>PF,FEATURE_MULTI_VALUE:()=>RF,FEATURE_MUTABLE_GLOBALS:()=>AF,FEATURE_NONTRAPPING_F2I:()=>TF,FEATURE_REFERENCE_TYPES:()=>wF,FEATURE_RELAXED_SIMD:()=>NF,FEATURE_SHARED_EVERYTHING:()=>MF,FEATURE_SIGN_EXTENSION:()=>EF,FEATURE_SIMD:()=>vF,FEATURE_STRINGREF:()=>BF,FEATURE_TAIL_CALLS:()=>FF,FEATURE_THREADS:()=>IF,FalseExpression:()=>Xl,Feature:()=>Ft,FeatureFlags:()=>Mo,FieldDeclaration:()=>ho,FieldFlags:()=>Af,File:()=>Vs,FixedArrayTypeNode:()=>bl,FloatLiteralExpression:()=>Pl,Flow:()=>er,FlowFlags:()=>Ho,ForOfStatement:()=>yo,ForStatement:()=>mo,Function:()=>Mt,FunctionDeclaration:()=>ps,FunctionExpression:()=>Nl,FunctionPrototype:()=>ot,FunctionTypeNode:()=>$r,GETTER_PREFIX:()=>nl,Global:()=>tn,HeapTypeRef:()=>Ie,INDEX_SUFFIX:()=>Qe,INNER_DELIMITER:()=>zp,INSTANCE_DELIMITER:()=>Mp,IdentifierExpression:()=>rt,IdentifierHandling:()=>Yp,IfStatement:()=>go,ImportDeclaration:()=>bo,ImportNames:()=>gi,ImportStatement:()=>fs,IndexSignature:()=>Ps,IndexSignatureNode:()=>to,InstanceOfExpression:()=>Ll,IntegerLiteralExpression:()=>Bl,Interface:()=>Ns,InterfaceDeclaration:()=>xo,InterfacePrototype:()=>nu,JSBuilder:()=>_i,LIBRARY_PREFIX:()=>wt,LIBRARY_SUBST:()=>Rb,LazyExpression:()=>Jl,LiteralExpression:()=>Rt,LiteralKind:()=>ft,Local:()=>pe,LocalFlags:()=>ws,MemoryModel:()=>_s,MemoryModelCode:()=>ii,MemoryOrder:()=>Ob,MemorySegment:()=>ei,MethodDeclaration:()=>Jr,Module:()=>Jt,ModuleDeclaration:()=>ko,NamedTypeNode:()=>Zr,Namespace:()=>Os,NamespaceDeclaration:()=>Eo,NewExpression:()=>Ml,Node:()=>y,NodeKind:()=>$e,NullExpression:()=>zl,ObjectLiteralExpression:()=>Dl,OmittedExpression:()=>Gl,OperatorKind:()=>Me,Options:()=>pa,PARENT_SUBST:()=>GE,PATH_DELIMITER:()=>mt,PackedType:()=>ms,Parameter:()=>If,ParameterKind:()=>Qt,ParameterNode:()=>$n,ParenthesizedExpression:()=>Ul,Parser:()=>Ms,Precedence:()=>nx,Program:()=>Ds,Property:()=>Cs,PropertyAccessExpression:()=>Vl,PropertyPrototype:()=>ai,Range:()=>ce,RefAsOp:()=>qb,RegexpLiteralExpression:()=>Ol,Relooper:()=>Lo,ReportMode:()=>$o,Resolver:()=>Rs,ReturnStatement:()=>Ao,Runtime:()=>tl,RuntimeFeatures:()=>h_,SETTER_PREFIX:()=>il,SIMDExtractOp:()=>af,SIMDLoadOp:()=>uf,SIMDLoadStoreLaneOp:()=>cf,SIMDReplaceOp:()=>lf,SIMDShiftOp:()=>of,SIMDTernaryOp:()=>pf,STATIC_DELIMITER:()=>es,STUB_DELIMITER:()=>Dp,SideEffects:()=>Ef,Signature:()=>oe,Source:()=>Te,SourceKind:()=>Jn,State:()=>yl,Statement:()=>ye,StringEncodeOp:()=>Xb,StringEqOp:()=>Zb,StringLiteralExpression:()=>Wl,StringMeasureOp:()=>Qb,StringNewOp:()=>jb,SuperExpression:()=>Kl,SwitchBuilder:()=>ys,SwitchCase:()=>To,SwitchStatement:()=>So,TSDBuilder:()=>bi,Target:()=>Un,TemplateLiteralExpression:()=>Hl,TernaryExpression:()=>ql,ThisExpression:()=>jl,ThrowStatement:()=>vo,Token:()=>bt,Tokenizer:()=>os,TrueExpression:()=>Ql,TryStatement:()=>Io,TupleTypeNode:()=>gl,Type:()=>p,TypeBuilderErrorReason:()=>rf,TypeDeclaration:()=>Fo,TypeDefinition:()=>lt,TypeFlags:()=>Lt,TypeKind:()=>Er,TypeName:()=>Zn,TypeNode:()=>jt,TypeParameterNode:()=>Al,TypeRef:()=>P,TypedElement:()=>nr,Typeinfo:()=>Vn,TypeinfoFlags:()=>rl,UnaryExpression:()=>us,UnaryOp:()=>gs,UnaryPostfixExpression:()=>Zl,UnaryPrefixExpression:()=>$l,UncheckedBehavior:()=>jo,UnmanagedArrayTypeNode:()=>xl,VariableDeclaration:()=>wo,VariableLikeDeclarationStatement:()=>Yn,VariableLikeElement:()=>rn,VariableStatement:()=>Ro,VoidStatement:()=>Co,WhileStatement:()=>Po,WideIntAddSubOp:()=>Wb,WideIntMulOp:()=>Kb,addGlobalAlias:()=>fF,allocPtrArray:()=>Ee,applyInTreeTransforms:()=>Zx,buildJS:()=>fw,buildTSD:()=>pw,compile:()=>cw,createType:()=>it,defaultFeatures:()=>pu,diagnosticCategoryToColor:()=>Db,diagnosticCategoryToString:()=>Zp,diagnosticCodeToString:()=>al,ensureType:()=>Fs,expandType:()=>ff,featureToString:()=>Gn,findDecorator:()=>$t,formatDiagnostic:()=>Gb,formatDiagnosticMessage:()=>Gb,getBinaryLeft:()=>at,getBinaryOp:()=>ri,getBinaryRight:()=>We,getBinaryenModuleRef:()=>_w,getBlockChildAt:()=>Ss,getBlockChildCount:()=>Ts,getBlockName:()=>As,getBreakCondition:()=>x1,getBreakName:()=>b1,getCallOperandAt:()=>Je,getCallOperandCount:()=>Nt,getCallTarget:()=>Is,getConstValueF32:()=>Ce,getConstValueF64:()=>Pe,getConstValueI32:()=>ae,getConstValueI64High:()=>Ge,getConstValueI64Low:()=>Ne,getConstValueInteger:()=>_f,getConstValueV128:()=>df,getDefaultParameterName:()=>lx,getDependee:()=>ow,getDiagnosticCategory:()=>XF,getDiagnosticCode:()=>QF,getDiagnosticMessage:()=>ZF,getDiagnosticRange:()=>$F,getDiagnosticRelatedRange:()=>YF,getDropValue:()=>A1,getExpressionId:()=>re,getExpressionType:()=>fe,getFunctionBody:()=>v1,getFunctionName:()=>bf,getFunctionParams:()=>I1,getFunctionResults:()=>k1,getFunctionVars:()=>F1,getGlobalGetName:()=>xs,getGlobalInit:()=>C1,getGlobalName:()=>w1,getGlobalType:()=>R1,getIfCondition:()=>qo,getIfFalse:()=>ni,getIfTrue:()=>vs,getLoadBytes:()=>hf,getLoadOffset:()=>p1,getLoadPtr:()=>f1,getLocalGetIndex:()=>Pt,getLocalSetIndex:()=>Uo,getLocalSetValue:()=>Vo,getLoopBody:()=>g1,getLoopName:()=>y1,getMemoryGrowDelta:()=>S1,getRangeEnd:()=>ew,getRangeSource:()=>tw,getRangeStart:()=>JF,getReturnValue:()=>T1,getSelectCondition:()=>E1,getSelectElse:()=>gf,getSelectThen:()=>yf,getSideEffects:()=>ks,getSource:()=>jF,getSourceNormalizedPath:()=>rw,getStoreBytes:()=>_1,getStoreOffset:()=>d1,getStorePtr:()=>h1,getStoreValue:()=>m1,getTagName:()=>P1,getTagParams:()=>N1,getTagResults:()=>L1,getUnaryOp:()=>Es,getUnaryValue:()=>Oo,initializeProgram:()=>uw,isConstExpressionNaN:()=>Go,isConstNaN:()=>c1,isConstNegZero:()=>Do,isConstNonZero:()=>xt,isConstZero:()=>st,isDeclaredElement:()=>Us,isError:()=>sw,isGlobalMutable:()=>xf,isIllegalVariableIdentifier:()=>Jp,isInfo:()=>nw,isLoadSigned:()=>mf,isLocalTee:()=>bs,isNullableType:()=>$b,isTypeOmitted:()=>De,isTypedElement:()=>Xo,isWarning:()=>iw,mangleInternalName:()=>Ke,mangleInternalPath:()=>ds,mustPreserveSideEffects:()=>Wo,newOptions:()=>$3,newProgram:()=>KF,nextDiagnostic:()=>HF,nextFile:()=>lw,operatorTokenToString:()=>Be,optimize:()=>hw,parse:()=>aw,readString:()=>Ye,removeGlobalAlias:()=>_F,runtimeFunctions:()=>di,runtimeGlobals:()=>hi,setBasenameHint:()=>VF,setBindingsHint:()=>OF,setBundleVersion:()=>xF,setDebugInfo:()=>WF,setExportMemory:()=>tF,setExportRuntime:()=>yF,setExportStart:()=>dF,setExportTable:()=>lF,setFeature:()=>GF,setImportMemory:()=>rF,setImportTable:()=>aF,setInitialMemory:()=>nF,setLowMemoryLimit:()=>mF,setMaximumMemory:()=>iF,setMemoryBase:()=>cF,setNoAssert:()=>eF,setNoUnsafe:()=>hF,setOptimizeLevelHints:()=>UF,setPedantic:()=>qF,setRuntime:()=>J3,setSharedMemory:()=>sF,setSourceMap:()=>oF,setStackSize:()=>bF,setTableBase:()=>pF,setTarget:()=>Y3,setUncheckedBehavior:()=>uF,tokenFromKeyword:()=>Ub,tokenIsAlsoIdentifier:()=>Vb,typesToRefs:()=>Z1,typesToString:()=>Zo,util:()=>Xp,validate:()=>dw});var ee=typeof window<"u"&&window||typeof global<"u"&&global||self;if(typeof ee.ASC_TARGET>"u"){let e=function(){Error.captureStackTrace?Error.captureStackTrace(this,e):this.stack=this.name+": "+this.message+`
8
8
  `+new Error().stack},t=function(a){this.message=a||"assertion failed",Error.captureStackTrace?Error.captureStackTrace(this,t):this.stack=this.name+": "+this.message+`
9
- `+new Error().stack},i=function(a,l){if(a==l){if(a!=0)return 0;a=1/a,l=1/l}else{let o=a!=a,u=l!=l;if(o|u)return o-u;a==null&&(a=String(a)),l==null&&(l=String(l))}return a>l?1:-1};wE=e,RE=t,CE=i,ee.ASC_TARGET=0,ee.ASC_RUNTIME=0,ee.ASC_NO_ASSERT=!1,ee.ASC_MEMORY_BASE=0,ee.ASC_OPTIMIZE_LEVEL=3,ee.ASC_SHRINK_LEVEL=0,ee.ASC_FEATURE_MUTABLE_GLOBAL=!1,ee.ASC_FEATURE_SIGN_EXTENSION=!1,ee.ASC_FEATURE_BULK_MEMORY=!1,ee.ASC_FEATURE_SIMD=!1,ee.ASC_FEATURE_THREADS=!1;let n=new Float64Array(1),r=new Uint32Array(n.buffer);Object.defineProperties(ee.i8=function(l){return l<<24>>24},{MIN_VALUE:{value:-128},MAX_VALUE:{value:127},parse(a,l){return parseInt(a,l)<<24>>24}}),Object.defineProperties(ee.i16=function(l){return l<<16>>16},{MIN_VALUE:{value:-32768},MAX_VALUE:{value:32767},parse(a,l){return parseInt(a,l)<<16>>16}}),Object.defineProperties(ee.i32=ee.isize=function(l){return l|0},{MIN_VALUE:{value:-2147483648},MAX_VALUE:{value:2147483647},parse(a,l){return parseInt(a,l)|0}}),Object.defineProperties(ee.u8=function(l){return l&255},{MIN_VALUE:{value:0},MAX_VALUE:{value:255},parse(a,l){return parseInt(a,l)&255}}),Object.defineProperties(ee.u16=function(l){return l&65535},{MIN_VALUE:{value:0},MAX_VALUE:{value:65535},parse(a,l){return parseInt(a,l)&65535}}),Object.defineProperties(ee.u32=ee.usize=function(l){return l>>>0},{MIN_VALUE:{value:0},MAX_VALUE:{value:4294967295},parse(a,l){return parseInt(a,l)>>>0}}),Object.defineProperties(ee.bool=function(l){return!!l},{MIN_VALUE:{value:!1},MAX_VALUE:{value:!0},parse(a){return a.trim()==="true"}}),Object.defineProperties(ee.f32=function(l){return Math.fround(l)},{EPSILON:{value:11920928955078125e-23},MIN_VALUE:{value:1401298464324817e-60},MAX_VALUE:{value:34028234663852886e22},MIN_NORMAL_VALUE:{value:11754943508222875e-54},MIN_SAFE_INTEGER:{value:-16777215},MAX_SAFE_INTEGER:{value:16777215},POSITIVE_INFINITY:{value:1/0},NEGATIVE_INFINITY:{value:-1/0},NaN:{value:NaN},parse(a){return Math.fround(parseFloat(a))}}),Object.defineProperties(ee.f64=function(l){return+l},{EPSILON:{value:2220446049250313e-31},MIN_VALUE:{value:5e-324},MAX_VALUE:{value:17976931348623157e292},MIN_NORMAL_VALUE:{value:22250738585072014e-324},MIN_SAFE_INTEGER:{value:-9007199254740991},MAX_SAFE_INTEGER:{value:9007199254740991},POSITIVE_INFINITY:{value:1/0},NEGATIVE_INFINITY:{value:-1/0},NaN:{value:NaN},parse(a){return parseFloat(a)}}),ee.clz=Math.clz32,ee.ctz=function(l){return 32-Math.clz32(~l&l-1)},ee.popcnt=function(l){return l-=l>>>1&1431655765,l=(l&858993459)+(l>>>2&858993459),(l+(l>>>4)&252645135)*16843009>>>24},ee.rotl=function(l,o){return o&=31,l<<o|l>>>32-o},ee.rotr=function(l,o){return o&=31,l>>>o|l<<32-o},ee.abs=Math.abs,ee.max=Math.max,ee.min=Math.min,ee.ceil=Math.ceil,ee.floor=Math.floor,ee.nearest=function(l){let u=Math.abs(l);return u<4503599627370496?(u+4503599627370496-4503599627370496)*Math.sign(l):l},ee.select=function(l,o,u){return u?l:o},ee.sqrt=Math.sqrt,ee.trunc=Math.trunc,ee.copysign=function(l,o){return o?Math.abs(l)*Math.sign(o):(n[0]=o,r[1]>>>31?-1:1)},ee.bswap=function(l){let o=l>>8&16711935,u=(l&16711935)<<8;return l=o|u,o=l>>16&65535,u=(l&65535)<<16,o|u},e.prototype=Object.create(Error.prototype),e.prototype.name="UnreachableError",e.prototype.message="unreachable",ee.unreachable=function(){throw new e},t.prototype=Object.create(Error.prototype),t.prototype.name="AssertionError",ee.assert=function(l,o){if(l)return l;throw new t(o)},ee.changetype=function(l){return l},String.fromCharCodes=function(l){let u=l.length;if(u<=8192)return String.fromCharCode.apply(String,l);let c=0,f="";for(;c<u;)f+=String.fromCharCode.apply(String,l.slice(c,Math.min(c+8192,u))),c+=8192;return f},String.fromCodePoints=function(l){let u=l.length;if(u<=8192)return String.fromCodePoint.apply(String,l);let c=0,f="";for(;c<u;)f+=String.fromCodePoint.apply(String,l.slice(c,Math.min(c+8192,u))),c+=8192;return f},String.prototype.at||Object.defineProperty(String.prototype,"at",{value:function(l){return this.charAt(l>=0?l:l+this.length)},configurable:!0}),String.prototype.replaceAll||Object.defineProperty(String.prototype,"replaceAll",{value:function(l,o){let u=this.split(l).join(o);return l.length||(u=o+u+o),u},configurable:!0});let s=Array.prototype.sort;Array.prototype.sort=function(l){return s.call(this,l||i)},[Array,Uint8ClampedArray,Uint8Array,Int8Array,Uint16Array,Int16Array,Uint32Array,Int32Array,Float32Array,Float64Array].forEach(a=>{a.prototype.at||Object.defineProperty(a.prototype,"at",{value:function(o){return this[o>=0?o:o+this.length]},configurable:!0}),a.prototype.findLastIndex||Object.defineProperty(a.prototype,"findLastIndex",{value:function(o){for(let u=this.length-1;u>=0;--u)if(o(this[u],u,this))return u;return-1},configurable:!0}),a!=Array&&Object.defineProperty(a,"wrap",{value:function(o,u,c){return new a(o,u,c)},configurable:!0})}),ee.isInteger=Number.isInteger,ee.isFloat=function(l){return typeof l=="number"},ee.isNullable=function(l){return!0},ee.isReference=function(l){return typeof l=="object"||typeof l=="string"},ee.isFunction=function(l){return typeof l=="function"},ee.isString=function(l){return typeof l=="string"||l instanceof String},ee.isArray=Array.isArray,ee.isArrayLike=function(l){return l&&typeof l=="object"&&typeof l.length=="number"&&l.length>=0&&Math.trunc(l.length)===l.length},ee.isDefined=function(l){return typeof l<"u"},ee.isConstant=function(l){return!1},ee.unchecked=function(l){return l},ee.fmod=function(l,o){return l%o},ee.fmodf=function(l,o){return Math.fround(l%o)},ee.JSMath=Math,Object.defineProperties(ee.JSMath,{sincos_sin:{value:0,writable:!0},sincos_cos:{value:0,writable:!0},signbit:{value:function(l){return n[0]=l,!!(r[1]>>>31)}},sincos:{value:function(l){this.sincos_sin=Math.sin(l),this.sincos_cos=Math.cos(l)}},exp2:{value:function(l){return Math.pow(2,l)}}}),ee.unmanaged=function(){},ee.trace=function(a,l){l&&(a+=Array.prototype.slice.call(arguments,2,2+l)),console.error("trace: "+a)}}var wE,RE,CE;var Ri={};zu(Ri,{default:()=>Ci});Du(Ri,OM);import*as OM from"binaryen";import{default as Ci}from"binaryen";import PE from"long";var{_BinaryenTypeCreate:Q_,_BinaryenTypeArity:X_,_BinaryenTypeExpand:$_,_BinaryenTypeGetHeapType:_r,_BinaryenTypeFromHeapType:Ae,_BinaryenTypeIsNullable:Z_,_BinaryenTypeFuncref:Y_,_BinaryenTypeExternref:J_,_BinaryenTypeAnyref:ed,_BinaryenTypeEqref:td,_BinaryenTypeI31ref:rd,_BinaryenTypeStructref:nd,_BinaryenTypeArrayref:id,_BinaryenTypeStringref:sd,_BinaryenTypeNullref:ad,_BinaryenTypeNullExternref:ld,_BinaryenTypeNullFuncref:od,_BinaryenHeapTypeFunc:HM,_BinaryenHeapTypeExt:jM,_BinaryenHeapTypeAny:QM,_BinaryenHeapTypeEq:XM,_BinaryenHeapTypeI31:$M,_BinaryenHeapTypeStruct:ZM,_BinaryenHeapTypeArray:YM,_BinaryenHeapTypeString:JM,_BinaryenHeapTypeNone:e7,_BinaryenHeapTypeNoext:t7,_BinaryenHeapTypeNofunc:r7,_BinaryenHeapTypeIsBasic:n7,_BinaryenHeapTypeIsSignature:i7,_BinaryenHeapTypeIsStruct:s7,_BinaryenHeapTypeIsArray:a7,_BinaryenHeapTypeIsBottom:ud,_BinaryenHeapTypeGetBottom:cd,_BinaryenHeapTypeIsSubType:pd,_BinaryenStructTypeGetNumFields:fd,_BinaryenStructTypeGetFieldType:l7,_BinaryenStructTypeGetFieldPackedType:o7,_BinaryenStructTypeIsFieldMutable:u7,_BinaryenArrayTypeGetElementType:c7,_BinaryenArrayTypeGetElementPackedType:p7,_BinaryenArrayTypeIsElementMutable:f7,_BinaryenSignatureTypeGetParams:_7,_BinaryenSignatureTypeGetResults:d7,_BinaryenModuleCreate:_d,_BinaryenModuleDispose:dd,_BinaryenSizeofLiteral:Gu,_BinaryenLiteralInt32:hd,_BinaryenLiteralFloat32:md,_BinaryenLiteralFloat64:yd,_BinaryenLiteralVec128:gd,_BinaryenLiteralFloat32Bits:h7,_BinaryenExpressionGetId:Kt,_BinaryenExpressionGetType:dr,_BinaryenExpressionSetType:m7,_BinaryenExpressionPrint:y7,_BinaryenExpressionCopy:bd,_BinaryenExpressionFinalize:xd,_BinaryenBlock:Ed,_BinaryenBlockGetName:Pa,_BinaryenBlockSetName:g7,_BinaryenBlockGetNumChildren:Pi,_BinaryenBlockGetChildAt:Ni,_BinaryenBlockSetChildAt:Ad,_BinaryenBlockAppendChild:b7,_BinaryenBlockInsertChildAt:x7,_BinaryenBlockRemoveChildAt:E7,_BinaryenIf:Td,_BinaryenIfGetCondition:Bi,_BinaryenIfSetCondition:Sd,_BinaryenIfGetIfTrue:Li,_BinaryenIfSetIfTrue:vd,_BinaryenIfGetIfFalse:Mi,_BinaryenIfSetIfFalse:Id,_BinaryenLoop:kd,_BinaryenLoopGetName:Na,_BinaryenLoopSetName:A7,_BinaryenLoopGetBody:zi,_BinaryenLoopSetBody:Fd,_BinaryenBreak:wd,_BinaryenBreakGetName:Ba,_BinaryenBreakSetName:T7,_BinaryenBreakGetCondition:Di,_BinaryenBreakSetCondition:Rd,_BinaryenBreakGetValue:Uu,_BinaryenBreakSetValue:Cd,_BinaryenSwitch:Pd,_BinaryenSwitchGetNumNames:Nd,_BinaryenSwitchGetNameAt:Bd,_BinaryenSwitchSetNameAt:S7,_BinaryenSwitchAppendName:v7,_BinaryenSwitchInsertNameAt:I7,_BinaryenSwitchRemoveNameAt:k7,_BinaryenSwitchGetDefaultName:Ld,_BinaryenSwitchSetDefaultName:F7,_BinaryenSwitchGetCondition:Vu,_BinaryenSwitchSetCondition:Md,_BinaryenSwitchGetValue:Ou,_BinaryenSwitchSetValue:zd,_BinaryenCall:Dd,_BinaryenCallGetTarget:Cn,_BinaryenCallSetTarget:w7,_BinaryenCallGetNumOperands:hr,_BinaryenCallGetOperandAt:mr,_BinaryenCallSetOperandAt:La,_BinaryenCallAppendOperand:R7,_BinaryenCallInsertOperandAt:C7,_BinaryenCallRemoveOperandAt:P7,_BinaryenCallIsReturn:N7,_BinaryenCallSetReturn:B7,_BinaryenReturnCall:Gd,_BinaryenCallIndirect:Ud,_BinaryenCallIndirectGetTable:L7,_BinaryenCallIndirectSetTable:M7,_BinaryenCallIndirectGetTarget:qu,_BinaryenCallIndirectSetTarget:Vd,_BinaryenCallIndirectGetNumOperands:Gi,_BinaryenCallIndirectGetOperandAt:Ui,_BinaryenCallIndirectSetOperandAt:Ma,_BinaryenCallIndirectAppendOperand:z7,_BinaryenCallIndirectInsertOperandAt:D7,_BinaryenCallIndirectRemoveOperandAt:G7,_BinaryenCallIndirectIsReturn:U7,_BinaryenCallIndirectSetReturn:V7,_BinaryenReturnCallIndirect:Od,_BinaryenLocalGet:qd,_BinaryenLocalGetGetIndex:za,_BinaryenLocalGetSetIndex:O7,_BinaryenLocalSet:Wd,_BinaryenLocalSetIsTee:Da,_BinaryenLocalSetGetIndex:Pn,_BinaryenLocalSetSetIndex:q7,_BinaryenLocalSetGetValue:Gr,_BinaryenLocalSetSetValue:Ga,_BinaryenLocalTee:Kd,_BinaryenGlobalGet:Hd,_BinaryenGlobalGetGetName:Ua,_BinaryenGlobalGetSetName:W7,_BinaryenGlobalSet:jd,_BinaryenGlobalSetGetName:Qd,_BinaryenGlobalSetSetName:K7,_BinaryenGlobalSetGetValue:Wu,_BinaryenGlobalSetSetValue:Xd,_BinaryenMemorySize:$d,_BinaryenMemoryGrow:Zd,_BinaryenMemoryGrowGetDelta:Vi,_BinaryenMemoryGrowSetDelta:Yd,_BinaryenLoad:Jd,_BinaryenLoadIsAtomic:H7,_BinaryenLoadSetAtomic:j7,_BinaryenLoadIsSigned:eh,_BinaryenLoadSetSigned:Q7,_BinaryenLoadGetOffset:th,_BinaryenLoadSetOffset:X7,_BinaryenLoadGetBytes:rh,_BinaryenLoadSetBytes:$7,_BinaryenLoadGetAlign:Z7,_BinaryenLoadSetAlign:Y7,_BinaryenLoadGetPtr:Oi,_BinaryenLoadSetPtr:nh,_BinaryenAtomicLoad:ih,_BinaryenStore:sh,_BinaryenStoreIsAtomic:J7,_BinaryenStoreSetAtomic:ez,_BinaryenStoreGetBytes:Va,_BinaryenStoreSetBytes:tz,_BinaryenStoreGetOffset:Oa,_BinaryenStoreSetOffset:rz,_BinaryenStoreGetAlign:nz,_BinaryenStoreSetAlign:iz,_BinaryenStoreGetPtr:Ur,_BinaryenStoreSetPtr:qa,_BinaryenStoreGetValue:qi,_BinaryenStoreSetValue:ah,_BinaryenStoreGetValueType:sz,_BinaryenStoreSetValueType:az,_BinaryenAtomicStore:lh,_BinaryenConst:Nn,_BinaryenConstGetValueI32:oh,_BinaryenConstSetValueI32:lz,_BinaryenConstGetValueF32:uh,_BinaryenConstSetValueF32:oz,_BinaryenConstGetValueF64:ch,_BinaryenConstSetValueF64:uz,_BinaryenConstGetValueV128:ph,_BinaryenConstSetValueV128:cz,_BinaryenUnary:fh,_BinaryenUnaryGetOp:_h,_BinaryenUnarySetOp:pz,_BinaryenUnaryGetValue:Wi,_BinaryenUnarySetValue:dh,_BinaryenWideIntAddSub:hh,_BinaryenWideIntMul:mh,_BinaryenBinary:yh,_BinaryenBinaryGetOp:gh,_BinaryenBinarySetOp:fz,_BinaryenBinaryGetLeft:Ki,_BinaryenBinarySetLeft:bh,_BinaryenBinaryGetRight:Hi,_BinaryenBinarySetRight:xh,_BinaryenSelect:Eh,_BinaryenSelectGetIfTrue:ji,_BinaryenSelectSetIfTrue:Ah,_BinaryenSelectGetIfFalse:Qi,_BinaryenSelectSetIfFalse:Th,_BinaryenSelectGetCondition:Xi,_BinaryenSelectSetCondition:Sh,_BinaryenDrop:Ku,_BinaryenDropGetValue:$i,_BinaryenDropSetValue:vh,_BinaryenReturn:Ih,_BinaryenReturnGetValue:Vr,_BinaryenReturnSetValue:Wa,_BinaryenNop:kh,_BinaryenUnreachable:Fh,_BinaryenAtomicRMW:wh,_BinaryenAtomicRMWGetOp:_z,_BinaryenAtomicRMWSetOp:dz,_BinaryenAtomicRMWGetBytes:hz,_BinaryenAtomicRMWSetBytes:mz,_BinaryenAtomicRMWGetOffset:yz,_BinaryenAtomicRMWSetOffset:gz,_BinaryenAtomicRMWGetPtr:Hu,_BinaryenAtomicRMWSetPtr:Rh,_BinaryenAtomicRMWGetValue:ju,_BinaryenAtomicRMWSetValue:Ch,_BinaryenAtomicCmpxchg:Ph,_BinaryenAtomicCmpxchgGetBytes:bz,_BinaryenAtomicCmpxchgSetBytes:xz,_BinaryenAtomicCmpxchgGetOffset:Ez,_BinaryenAtomicCmpxchgSetOffset:Az,_BinaryenAtomicCmpxchgGetPtr:Qu,_BinaryenAtomicCmpxchgSetPtr:Nh,_BinaryenAtomicCmpxchgGetExpected:Xu,_BinaryenAtomicCmpxchgSetExpected:Bh,_BinaryenAtomicCmpxchgGetReplacement:$u,_BinaryenAtomicCmpxchgSetReplacement:Lh,_BinaryenAtomicWait:Mh,_BinaryenAtomicWaitGetPtr:Zu,_BinaryenAtomicWaitSetPtr:zh,_BinaryenAtomicWaitGetExpected:Yu,_BinaryenAtomicWaitSetExpected:Dh,_BinaryenAtomicWaitGetTimeout:Ju,_BinaryenAtomicWaitSetTimeout:Gh,_BinaryenAtomicWaitGetExpectedType:Tz,_BinaryenAtomicWaitSetExpectedType:Sz,_BinaryenAtomicNotify:Uh,_BinaryenAtomicNotifyGetPtr:ec,_BinaryenAtomicNotifySetPtr:Vh,_BinaryenAtomicNotifyGetNotifyCount:tc,_BinaryenAtomicNotifySetNotifyCount:Oh,_BinaryenAtomicFence:qh,_BinaryenAtomicFenceGetOrder:vz,_BinaryenAtomicFenceSetOrder:Iz,_BinaryenSIMDExtract:Wh,_BinaryenSIMDExtractGetOp:kz,_BinaryenSIMDExtractSetOp:Fz,_BinaryenSIMDExtractGetVec:rc,_BinaryenSIMDExtractSetVec:Kh,_BinaryenSIMDExtractGetIndex:wz,_BinaryenSIMDExtractSetIndex:Rz,_BinaryenSIMDReplace:Hh,_BinaryenSIMDReplaceGetOp:Cz,_BinaryenSIMDReplaceSetOp:Pz,_BinaryenSIMDReplaceGetVec:nc,_BinaryenSIMDReplaceSetVec:jh,_BinaryenSIMDReplaceGetIndex:Nz,_BinaryenSIMDReplaceSetIndex:Bz,_BinaryenSIMDReplaceGetValue:ic,_BinaryenSIMDReplaceSetValue:Qh,_BinaryenSIMDShuffle:Xh,_BinaryenSIMDShuffleGetLeft:sc,_BinaryenSIMDShuffleSetLeft:$h,_BinaryenSIMDShuffleGetRight:ac,_BinaryenSIMDShuffleSetRight:Zh,_BinaryenSIMDShuffleGetMask:Lz,_BinaryenSIMDShuffleSetMask:Mz,_BinaryenSIMDTernary:Yh,_BinaryenSIMDTernaryGetOp:zz,_BinaryenSIMDTernarySetOp:Dz,_BinaryenSIMDTernaryGetA:lc,_BinaryenSIMDTernarySetA:Jh,_BinaryenSIMDTernaryGetB:oc,_BinaryenSIMDTernarySetB:em,_BinaryenSIMDTernaryGetC:uc,_BinaryenSIMDTernarySetC:tm,_BinaryenSIMDShift:rm,_BinaryenSIMDShiftGetOp:Gz,_BinaryenSIMDShiftSetOp:Uz,_BinaryenSIMDShiftGetVec:cc,_BinaryenSIMDShiftSetVec:nm,_BinaryenSIMDShiftGetShift:pc,_BinaryenSIMDShiftSetShift:im,_BinaryenSIMDLoad:sm,_BinaryenSIMDLoadGetOp:Vz,_BinaryenSIMDLoadSetOp:Oz,_BinaryenSIMDLoadGetOffset:qz,_BinaryenSIMDLoadSetOffset:Wz,_BinaryenSIMDLoadGetAlign:Kz,_BinaryenSIMDLoadSetAlign:Hz,_BinaryenSIMDLoadGetPtr:fc,_BinaryenSIMDLoadSetPtr:am,_BinaryenSIMDLoadStoreLane:lm,_BinaryenSIMDLoadStoreLaneGetOp:jz,_BinaryenSIMDLoadStoreLaneSetOp:Qz,_BinaryenSIMDLoadStoreLaneGetOffset:Xz,_BinaryenSIMDLoadStoreLaneSetOffset:$z,_BinaryenSIMDLoadStoreLaneGetAlign:Zz,_BinaryenSIMDLoadStoreLaneSetAlign:Yz,_BinaryenSIMDLoadStoreLaneGetIndex:Jz,_BinaryenSIMDLoadStoreLaneSetIndex:eD,_BinaryenSIMDLoadStoreLaneGetPtr:_c,_BinaryenSIMDLoadStoreLaneSetPtr:om,_BinaryenSIMDLoadStoreLaneGetVec:dc,_BinaryenSIMDLoadStoreLaneSetVec:um,_BinaryenSIMDLoadStoreLaneIsStore:tD,_BinaryenMemoryInit:rD,_BinaryenMemoryInitGetSegment:nD,_BinaryenMemoryInitSetSegment:iD,_BinaryenMemoryInitGetDest:hc,_BinaryenMemoryInitSetDest:cm,_BinaryenMemoryInitGetOffset:mc,_BinaryenMemoryInitSetOffset:pm,_BinaryenMemoryInitGetSize:yc,_BinaryenMemoryInitSetSize:fm,_BinaryenDataDrop:sD,_BinaryenDataDropGetSegment:aD,_BinaryenDataDropSetSegment:lD,_BinaryenMemoryCopy:_m,_BinaryenMemoryCopyGetDest:gc,_BinaryenMemoryCopySetDest:dm,_BinaryenMemoryCopyGetSource:bc,_BinaryenMemoryCopySetSource:hm,_BinaryenMemoryCopyGetSize:xc,_BinaryenMemoryCopySetSize:mm,_BinaryenMemoryFill:ym,_BinaryenMemoryFillGetDest:Ec,_BinaryenMemoryFillSetDest:gm,_BinaryenMemoryFillGetValue:Ac,_BinaryenMemoryFillSetValue:bm,_BinaryenMemoryFillGetSize:Tc,_BinaryenMemoryFillSetSize:xm,_BinaryenRefNull:Em,_BinaryenRefIsNull:Am,_BinaryenRefIsNullGetValue:Sc,_BinaryenRefIsNullSetValue:Tm,_BinaryenRefAs:vc,_BinaryenRefAsGetOp:oD,_BinaryenRefAsSetOp:uD,_BinaryenRefAsGetValue:Ic,_BinaryenRefAsSetValue:Sm,_BinaryenRefFunc:vm,_BinaryenRefFuncGetFunc:Im,_BinaryenRefFuncSetFunc:cD,_BinaryenRefEq:km,_BinaryenRefEqGetLeft:kc,_BinaryenRefEqSetLeft:Fm,_BinaryenRefEqGetRight:Fc,_BinaryenRefEqSetRight:wm,_BinaryenTableGet:Rm,_BinaryenTableGetGetTable:pD,_BinaryenTableGetSetTable:fD,_BinaryenTableGetGetIndex:_D,_BinaryenTableGetSetIndex:dD,_BinaryenTableSet:Cm,_BinaryenTableSetGetTable:hD,_BinaryenTableSetSetTable:mD,_BinaryenTableSetGetIndex:yD,_BinaryenTableSetSetIndex:gD,_BinaryenTableSetGetValue:bD,_BinaryenTableSetSetValue:xD,_BinaryenTableSize:Pm,_BinaryenTableSizeGetTable:ED,_BinaryenTableSizeSetTable:AD,_BinaryenTableGrow:Nm,_BinaryenTableGrowGetTable:TD,_BinaryenTableGrowSetTable:SD,_BinaryenTableGrowGetValue:vD,_BinaryenTableGrowSetValue:ID,_BinaryenTableGrowGetDelta:kD,_BinaryenTableGrowSetDelta:FD,_BinaryenTry:Bm,_BinaryenTryGetName:wD,_BinaryenTrySetName:RD,_BinaryenTryGetBody:wc,_BinaryenTrySetBody:Lm,_BinaryenTryGetNumCatchTags:CD,_BinaryenTryGetNumCatchBodies:Rc,_BinaryenTryGetCatchTagAt:PD,_BinaryenTrySetCatchTagAt:ND,_BinaryenTryAppendCatchTag:BD,_BinaryenTryInsertCatchTagAt:LD,_BinaryenTryRemoveCatchTagAt:MD,_BinaryenTryGetCatchBodyAt:Cc,_BinaryenTrySetCatchBodyAt:Mm,_BinaryenTryAppendCatchBody:zD,_BinaryenTryInsertCatchBodyAt:DD,_BinaryenTryRemoveCatchBodyAt:GD,_BinaryenTryHasCatchAll:UD,_BinaryenTryGetDelegateTarget:VD,_BinaryenTrySetDelegateTarget:OD,_BinaryenTryIsDelegate:qD,_BinaryenThrow:zm,_BinaryenThrowGetTag:Dm,_BinaryenThrowSetTag:WD,_BinaryenThrowGetNumOperands:Pc,_BinaryenThrowGetOperandAt:Nc,_BinaryenThrowSetOperandAt:Gm,_BinaryenThrowAppendOperand:KD,_BinaryenThrowInsertOperandAt:HD,_BinaryenThrowRemoveOperandAt:jD,_BinaryenRethrow:Um,_BinaryenRethrowGetTarget:QD,_BinaryenRethrowSetDepth:XD,_BinaryenTupleMake:Vm,_BinaryenTupleMakeGetNumOperands:Bc,_BinaryenTupleMakeGetOperandAt:Lc,_BinaryenTupleMakeSetOperandAt:Om,_BinaryenTupleMakeAppendOperand:$D,_BinaryenTupleMakeInsertOperandAt:ZD,_BinaryenTupleMakeRemoveOperandAt:YD,_BinaryenTupleExtract:qm,_BinaryenTupleExtractGetTuple:Mc,_BinaryenTupleExtractSetTuple:Wm,_BinaryenTupleExtractGetIndex:JD,_BinaryenTupleExtractSetIndex:eG,_BinaryenPop:Km,_BinaryenRefI31:Hm,_BinaryenRefI31GetValue:zc,_BinaryenRefI31SetValue:jm,_BinaryenI31Get:Qm,_BinaryenI31GetGetI31:Dc,_BinaryenI31GetSetI31:Xm,_BinaryenI31GetIsSigned:tG,_BinaryenI31GetSetSigned:rG,_BinaryenCallRef:nG,_BinaryenCallRefGetNumOperands:Gc,_BinaryenCallRefGetOperandAt:Uc,_BinaryenCallRefSetOperandAt:$m,_BinaryenCallRefAppendOperand:iG,_BinaryenCallRefInsertOperandAt:sG,_BinaryenCallRefRemoveOperandAt:aG,_BinaryenCallRefGetTarget:Vc,_BinaryenCallRefSetTarget:Zm,_BinaryenCallRefIsReturn:lG,_BinaryenCallRefSetReturn:oG,_BinaryenRefTest:uG,_BinaryenRefTestGetRef:Oc,_BinaryenRefTestSetRef:Ym,_BinaryenRefTestGetCastType:cG,_BinaryenRefTestSetCastType:pG,_BinaryenRefCast:fG,_BinaryenRefCastGetRef:qc,_BinaryenRefCastSetRef:Jm,_BinaryenBrOn:_G,_BinaryenBrOnGetOp:dG,_BinaryenBrOnSetOp:hG,_BinaryenBrOnGetName:ey,_BinaryenBrOnSetName:mG,_BinaryenBrOnGetRef:Wc,_BinaryenBrOnSetRef:ty,_BinaryenBrOnGetCastType:yG,_BinaryenBrOnSetCastType:gG,_BinaryenStructNew:bG,_BinaryenStructNewGetNumOperands:Kc,_BinaryenStructNewGetOperandAt:Hc,_BinaryenStructNewSetOperandAt:ry,_BinaryenStructNewAppendOperand:xG,_BinaryenStructNewInsertOperandAt:EG,_BinaryenStructNewRemoveOperandAt:AG,_BinaryenStructGet:TG,_BinaryenStructGetGetIndex:ny,_BinaryenStructGetSetIndex:SG,_BinaryenStructGetGetRef:jc,_BinaryenStructGetSetRef:iy,_BinaryenStructGetIsSigned:vG,_BinaryenStructGetSetSigned:IG,_BinaryenStructSet:kG,_BinaryenStructSetGetIndex:sy,_BinaryenStructSetSetIndex:FG,_BinaryenStructSetGetRef:Qc,_BinaryenStructSetSetRef:ay,_BinaryenStructSetGetValue:Xc,_BinaryenStructSetSetValue:ly,_BinaryenArrayNew:wG,_BinaryenArrayNewGetInit:$c,_BinaryenArrayNewSetInit:oy,_BinaryenArrayNewGetSize:Zc,_BinaryenArrayNewSetSize:uy,_BinaryenArrayNewFixed:RG,_BinaryenArrayNewFixedGetNumValues:Yc,_BinaryenArrayNewFixedGetValueAt:Jc,_BinaryenArrayNewFixedSetValueAt:cy,_BinaryenArrayNewFixedAppendValue:CG,_BinaryenArrayNewFixedInsertValueAt:PG,_BinaryenArrayNewFixedRemoveValueAt:NG,_BinaryenArrayNewData:BG,_BinaryenArrayNewDataGetSegment:LG,_BinaryenArrayNewDataSetSegment:MG,_BinaryenArrayNewDataGetOffset:zG,_BinaryenArrayNewDataSetOffset:DG,_BinaryenArrayNewDataGetSize:GG,_BinaryenArrayNewDataSetSize:UG,_BinaryenArrayNewElem:VG,_BinaryenArrayNewElemGetSegment:OG,_BinaryenArrayNewElemSetSegment:qG,_BinaryenArrayNewElemGetOffset:WG,_BinaryenArrayNewElemSetOffset:KG,_BinaryenArrayNewElemGetSize:HG,_BinaryenArrayNewElemSetSize:jG,_BinaryenArrayGet:QG,_BinaryenArrayGetGetRef:ep,_BinaryenArrayGetSetRef:py,_BinaryenArrayGetGetIndex:tp,_BinaryenArrayGetSetIndex:fy,_BinaryenArrayGetIsSigned:XG,_BinaryenArrayGetSetSigned:$G,_BinaryenArraySet:ZG,_BinaryenArraySetGetRef:rp,_BinaryenArraySetSetRef:_y,_BinaryenArraySetGetIndex:np,_BinaryenArraySetSetIndex:dy,_BinaryenArraySetGetValue:ip,_BinaryenArraySetSetValue:hy,_BinaryenArrayLen:YG,_BinaryenArrayLenGetRef:sp,_BinaryenArrayLenSetRef:my,_BinaryenArrayFill:JG,_BinaryenArrayFillGetRef:e9,_BinaryenArrayFillSetRef:t9,_BinaryenArrayFillGetIndex:r9,_BinaryenArrayFillSetIndex:n9,_BinaryenArrayFillGetValue:i9,_BinaryenArrayFillSetValue:s9,_BinaryenArrayFillGetSize:a9,_BinaryenArrayFillSetSize:l9,_BinaryenArrayCopy:o9,_BinaryenArrayCopyGetDestRef:ap,_BinaryenArrayCopySetDestRef:yy,_BinaryenArrayCopyGetDestIndex:lp,_BinaryenArrayCopySetDestIndex:gy,_BinaryenArrayCopyGetSrcRef:op,_BinaryenArrayCopySetSrcRef:by,_BinaryenArrayCopyGetSrcIndex:up,_BinaryenArrayCopySetSrcIndex:xy,_BinaryenArrayCopyGetLength:cp,_BinaryenArrayCopySetLength:Ey,_BinaryenArrayInitData:u9,_BinaryenArrayInitDataGetSegment:c9,_BinaryenArrayInitDataSetSegment:p9,_BinaryenArrayInitDataGetRef:f9,_BinaryenArrayInitDataSetRef:_9,_BinaryenArrayInitDataGetIndex:d9,_BinaryenArrayInitDataSetIndex:h9,_BinaryenArrayInitDataGetOffset:m9,_BinaryenArrayInitDataSetOffset:y9,_BinaryenArrayInitDataGetSize:g9,_BinaryenArrayInitDataSetSize:b9,_BinaryenArrayInitElem:x9,_BinaryenArrayInitElemGetSegment:E9,_BinaryenArrayInitElemSetSegment:A9,_BinaryenArrayInitElemGetRef:T9,_BinaryenArrayInitElemSetRef:S9,_BinaryenArrayInitElemGetIndex:v9,_BinaryenArrayInitElemSetIndex:I9,_BinaryenArrayInitElemGetOffset:k9,_BinaryenArrayInitElemSetOffset:F9,_BinaryenArrayInitElemGetSize:w9,_BinaryenArrayInitElemSetSize:R9,_BinaryenStringNew:C9,_BinaryenStringNewGetOp:P9,_BinaryenStringNewSetOp:N9,_BinaryenStringNewGetRef:pp,_BinaryenStringNewSetRef:Ay,_BinaryenStringNewGetStart:fp,_BinaryenStringNewSetStart:Ty,_BinaryenStringNewGetEnd:_p,_BinaryenStringNewSetEnd:Sy,_BinaryenStringConst:B9,_BinaryenStringConstGetString:L9,_BinaryenStringConstSetString:M9,_BinaryenStringMeasure:z9,_BinaryenStringMeasureGetOp:D9,_BinaryenStringMeasureSetOp:G9,_BinaryenStringMeasureGetRef:dp,_BinaryenStringMeasureSetRef:vy,_BinaryenStringEncode:U9,_BinaryenStringEncodeGetOp:V9,_BinaryenStringEncodeSetOp:O9,_BinaryenStringEncodeGetStr:hp,_BinaryenStringEncodeSetStr:Iy,_BinaryenStringEncodeGetArray:mp,_BinaryenStringEncodeSetArray:ky,_BinaryenStringEncodeGetStart:yp,_BinaryenStringEncodeSetStart:Fy,_BinaryenStringConcat:q9,_BinaryenStringConcatGetLeft:gp,_BinaryenStringConcatSetLeft:wy,_BinaryenStringConcatGetRight:bp,_BinaryenStringConcatSetRight:Ry,_BinaryenStringEq:xp,_BinaryenStringEqGetOp:W9,_BinaryenStringEqSetOp:K9,_BinaryenStringEqGetLeft:Ep,_BinaryenStringEqSetLeft:Cy,_BinaryenStringEqGetRight:Ap,_BinaryenStringEqSetRight:Py,_BinaryenStringWTF16Get:H9,_BinaryenStringWTF16GetGetRef:Tp,_BinaryenStringWTF16GetSetRef:Ny,_BinaryenStringWTF16GetGetPos:Sp,_BinaryenStringWTF16GetSetPos:By,_BinaryenStringSliceWTF:j9,_BinaryenStringSliceWTFGetRef:vp,_BinaryenStringSliceWTFSetRef:Ly,_BinaryenStringSliceWTFGetStart:Ip,_BinaryenStringSliceWTFSetStart:My,_BinaryenStringSliceWTFGetEnd:kp,_BinaryenStringSliceWTFSetEnd:zy,_BinaryenAddFunction:Bn,_BinaryenGetFunction:Ln,_BinaryenRemoveFunction:Zi,_BinaryenGetNumFunctions:Dy,_BinaryenGetFunctionByIndex:Gy,_BinaryenFunctionGetName:Mn,_BinaryenFunctionGetParams:Yi,_BinaryenFunctionGetResults:Ji,_BinaryenFunctionGetNumVars:Ka,_BinaryenFunctionGetVar:Ha,_BinaryenFunctionAddVar:Q9,_BinaryenFunctionGetNumLocals:Fp,_BinaryenFunctionHasLocalName:X9,_BinaryenFunctionGetLocalName:$9,_BinaryenFunctionSetLocalName:Uy,_BinaryenFunctionGetBody:yr,_BinaryenFunctionSetBody:ja,_BinaryenFunctionGetType:Z9,_BinaryenFunctionSetType:Y9,_BinaryenFunctionOptimize:J9,_BinaryenFunctionRunPasses:Vy,_BinaryenFunctionSetDebugLocation:Oy,_BinaryenAddFunctionImport:qy,_BinaryenAddTableImport:Wy,_BinaryenAddMemoryImport:Ky,_BinaryenAddGlobalImport:Hy,_BinaryenAddTagImport:jy,_BinaryenAddFunctionExport:Qa,_BinaryenAddTableExport:Qy,_BinaryenAddMemoryExport:Xy,_BinaryenAddGlobalExport:$y,_BinaryenAddTagExport:Zy,_BinaryenGetExport:Xa,_BinaryenRemoveExport:$a,_BinaryenGetNumExports:e5,_BinaryenGetExportByIndex:t5,_BinaryenExportGetKind:Yy,_BinaryenExportGetName:Jy,_BinaryenExportGetValue:eg,_BinaryenAddGlobal:tg,_BinaryenGetGlobal:wp,_BinaryenRemoveGlobal:rg,_BinaryenGetNumGlobals:ng,_BinaryenGetGlobalByIndex:ig,_BinaryenGlobalGetName:sg,_BinaryenGlobalGetType:ag,_BinaryenGlobalIsMutable:lg,_BinaryenGlobalGetInitExpr:Za,_BinaryenAddTag:og,_BinaryenGetTag:ug,_BinaryenRemoveTag:cg,_BinaryenTagGetName:pg,_BinaryenTagGetParams:fg,_BinaryenTagGetResults:_g,_BinaryenAddTable:Rp,_BinaryenRemoveTable:r5,_BinaryenGetNumTables:n5,_BinaryenGetTable:Cp,_BinaryenGetTableByIndex:i5,_BinaryenTableGetName:s5,_BinaryenTableSetName:a5,_BinaryenTableGetInitial:l5,_BinaryenTableSetInitial:dg,_BinaryenTableHasMax:o5,_BinaryenTableGetMax:u5,_BinaryenTableSetMax:hg,_BinaryenTableGetType:c5,_BinaryenTableSetType:p5,_BinaryenAddActiveElementSegment:mg,_BinaryenAddPassiveElementSegment:f5,_BinaryenRemoveElementSegment:_5,_BinaryenGetNumElementSegments:d5,_BinaryenGetElementSegment:h5,_BinaryenGetElementSegmentByIndex:m5,_BinaryenSetMemory:yg,_BinaryenGetNumMemorySegments:y5,_BinaryenGetMemorySegmentByteOffset:g5,_BinaryenGetMemorySegmentByteLength:b5,_BinaryenCopyMemorySegmentData:x5,_BinaryenAddDataSegment:E5,_BinaryenSetStart:gg,_BinaryenGetStart:A5,_BinaryenModuleParse:T5,_BinaryenModulePrint:S5,_BinaryenModulePrintAsmjs:v5,_BinaryenModuleValidate:bg,_BinaryenModuleOptimize:I5,_BinaryenModuleRunPasses:xg,_BinaryenSizeofAllocateAndWriteResult:Eg,_BinaryenModuleAllocateAndWrite:Ag,_BinaryenModuleAllocateAndWriteText:Tg,_BinaryenModuleAllocateAndWriteStackIR:Sg,_BinaryenModuleRead:vg,_BinaryenModuleReadWithFeatures:k5,_BinaryenModuleInterpret:Ig,_BinaryenModuleAddDebugInfoFileName:kg,_BinaryenModuleGetDebugInfoFileName:Fg,_BinaryenModuleGetFeatures:wg,_BinaryenModuleSetFeatures:Rg,_BinaryenAddCustomSection:Cg,_BinaryenExpressionGetSideEffects:Pg,_RelooperCreate:Ng,_RelooperAddBlock:Bg,_RelooperAddBranch:Lg,_RelooperAddBlockWithSwitch:Mg,_RelooperAddBranchForSwitch:zg,_RelooperRenderAndDispose:Dg,_ExpressionRunnerCreate:Gg,_ExpressionRunnerSetLocalValue:F5,_ExpressionRunnerSetGlobalValue:w5,_ExpressionRunnerRunAndDispose:Ug,_TypeBuilderCreate:Vg,_TypeBuilderGrow:Pp,_TypeBuilderGetSize:Ya,_TypeBuilderSetSignatureType:Og,_TypeBuilderSetStructType:qg,_TypeBuilderSetArrayType:R5,_TypeBuilderGetTempHeapType:Np,_TypeBuilderGetTempTupleType:Bp,_TypeBuilderGetTempRefType:zn,_TypeBuilderSetSubType:Wg,_TypeBuilderSetOpen:C5,_TypeBuilderCreateRecGroup:P5,_TypeBuilderBuildAndDispose:Kg,_BinaryenModuleSetTypeName:Hg,_BinaryenModuleSetFieldName:jg,_BinaryenGetOptimizeLevel:Qg,_BinaryenSetOptimizeLevel:Xg,_BinaryenGetShrinkLevel:$g,_BinaryenSetShrinkLevel:Zg,_BinaryenGetDebugInfo:Yg,_BinaryenSetDebugInfo:Jg,_BinaryenGetTrapsNeverHappen:eb,_BinaryenSetTrapsNeverHappen:tb,_BinaryenGetClosedWorld:rb,_BinaryenSetClosedWorld:nb,_BinaryenGetLowMemoryUnused:ib,_BinaryenSetLowMemoryUnused:sb,_BinaryenGetZeroFilledMemory:ab,_BinaryenSetZeroFilledMemory:lb,_BinaryenGetFastMath:ob,_BinaryenSetFastMath:ub,_BinaryenGetGenerateStackIR:cb,_BinaryenSetGenerateStackIR:pb,_BinaryenGetOptimizeStackIR:fb,_BinaryenSetOptimizeStackIR:_b,_BinaryenGetPassArgument:db,_BinaryenSetPassArgument:hb,_BinaryenClearPassArguments:mb,_BinaryenHasPassToSkip:N5,_BinaryenAddPassToSkip:B5,_BinaryenClearPassesToSkip:L5,_BinaryenGetAlwaysInlineMaxSize:yb,_BinaryenSetAlwaysInlineMaxSize:gb,_BinaryenGetFlexibleInlineMaxSize:bb,_BinaryenSetFlexibleInlineMaxSize:xb,_BinaryenGetOneCallerInlineMaxSize:Eb,_BinaryenSetOneCallerInlineMaxSize:Ab,_BinaryenGetAllowInliningFunctionsWithLoops:Tb,_BinaryenSetAllowInliningFunctionsWithLoops:Sb,_malloc:kt,_free:ie,__i32_store8:qe,__i32_store16:M5,__i32_store:Ja,__f32_store:z5,__f64_store:D5,__i32_load8_s:G5,__i32_load8_u:Or,__i32_load16_s:U5,__i32_load16_u:V5,__i32_load:gr,__f32_load:O5,__f64_load:q5}=Ci;function NE(n){return BigInt(n.high|0)<<32n|BigInt(n.low>>>0)}function BE(n){return PE.fromBits(Number(n&0xFFFFFFFFn)|0,Number(n>>32n)|0)}function vb(n,r){return Ci._BinaryenLiteralInt64(n,NE(r))}function Lp(n){return BE(Ci._BinaryenConstGetValueI64(n))}var kb="data:application/wasm;base64,AGFzbQEAAAABBwFgAnx8AXwDAgEABQMBAAEGDQF8AUQAAAAAAAAAAAsHCwEHZjY0X3BvdwAADAKCAQr2DAHzDAMFfgN/CXwCfCABmUQAAAAAAAAAQGUEQCAAIACiIAFEAAAAAAAAAEBhDQEaIACfmUQAAAAAAADwfyAARAAAAAAAAPD/YhsgAUQAAAAAAADgP2ENARpEAAAAAAAA8D8gAKMgAUQAAAAAAADwv2ENARogACABRAAAAAAAAPA/YQ0BGkQAAAAAAADwPyABRAAAAAAAAAAAYQ0BGgsCfCABvSIFQjSIIQQgAL0iAkI0iCIDQgF9Qv4PWgR/QQEFIARC/w+DQr4HfUKAAVoLBEAgBUIBhiIGQgF9Qv////////9vWgRARAAAAAAAAPA/IAZQDQIaRAAAAAAAAPh/IAJCgICAgICAgPg/UQ0CGiAAIAGgIAZCgICAgICAgHBWIAJCAYYiAkKAgICAgICAcFZyDQIaRAAAAAAAAPh/IAJCgICAgICAgPD/AFENAhpEAAAAAAAAAAAgBUI/iFAgAkKAgICAgICA8P8AVEYNAhogASABogwCCyACQgGGQgF9Qv////////9vWgRARAAAAAAAAPA/IAAgAKIiAJogACACQj+IpwR/An9BACAFQjSIQv8PgyICQv8HVA0AGkECIAJCswhWDQAaQQAgBUIBQrMIIAJ9hiICQgF9g0IAUg0AGkEBIAIgBYNCAFINABpBAgtBAUYFQQALGyIAoyAAIAVCAFMbDAILIAJCAFMEQAJ/QQAgBUI0iEL/D4MiBkL/B1QNABpBAiAGQrMIVg0AGkEAIAVCAUKzCCAGfYYiBkIBfYNCAFINABpBASAFIAaDQgBSDQAaQQILIgdFBEAgACAAoSIAIACjDAMLIANC/w+DIQNBgIAQQQAgB0EBRhshCCACQv///////////wCDIQILIARC/w+DIgZCvgd9QoABWgRARAAAAAAAAPA/IAJCgICAgICAgPg/UQ0CGkQAAAAAAADwPyAGQr4HVA0CGkQAAAAAAADwf0QAAAAAAAAAACAEQoAQVCACQoCAgICAgID4P1ZGGwwCCyADUARAIABEAAAAAAAAMEOivUL///////////8Ag0KAgICAgICAoAN9IQILCyACIAJCgICAgNCqpfM/fSICQoCAgICAgIB4g30iA0KAgICACHxCgICAgHCDvyIKIAJCLYhC/wCDp0EFdEGACGoiBysDACILokQAAAAAAADwv6AhDSACQjSHuSIARAA4+v5CLuY/oiAHKwMQoCIOIA0gA78gCqEgC6IiD6AiCqAhCyAKIApEAAAAAAAA4L+iIhCiIQwgCyANIA1EAAAAAAAA4L+iIhGiIhKgIg0gDSAARDBnx5NX8y49oiAHKwMYoCAOIAuhIAqgoCAPIBAgEaCioCALIA2hIBKgoCAKIAyiIApEBgAAAAAA4D+iRGBVVVVVVeW/oCAMIApEeqQpVVVV5b+iRE5VWZmZmek/oCAMIApEwz8miysA8D+iROlFSJtbSfK/oKKgoqCioCIAoCIKoSAAoCQAAnwgBUKAgIBAg78iACAKvUKAgIBAg78iC6IiDL0iAkI0iKdB/w9xIgdByQdrIglBP08EQEQAAAAAAADwv0QAAAAAAADwPyAIGyAJQYCAgIB4Tw0BGkQAAAAAAAAAgEQAAAAAAAAAACAIG0QAAAAAAADw/0QAAAAAAADwfyAIGyACQgBTGyAHQYkITw0BGkEAIQcLIAxE/oIrZUcVZ0CiRAAAAAAAADhDoCINvSICQv8Ag0IBhqdBA3RBgChqIgkpAwggAiAIrXxCLYZ8IQMgDCANRAAAAAAAADjDoCIMRAAA+v5CLna/oqAgDEQ6O568mvcMvaKgIAEgAKEgC6IgASAKIAuhIwCgoqCgIgAgAKIhASAJKwMAIACgIAEgAEQ8VFVVVVXFP6JEvf3/////3z+goqAgASABoiAARBfQpGcREYE/okSRKxfPVVWlP6CioCEAIAdFBEACfCACQoCAgIAIg1AEQCADQoCAgICAgICIP32/IgEgASAAoqBEAAAAAAAAAH+iDAELIANCgICAgICAgPA/fCICvyIBIACiIQAgASAAoCIKmUQAAAAAAADwP2MEfCACQoCAgICAgICAgH+Dv0QAAAAAAADwPyAKpiILIAqgIgwgCyAMoSAKoCABIAqhIACgoKAgC6EiACAARAAAAAAAAAAAYRsFIAoLRAAAAAAAABAAogsMAQsgA78iASABIACioAsLCwsLxSyCAQBBhQgLA6D2PwBBkQgLF8i58oIs1r+AVjcoJLT6PAAAAAAAgPY/AEGxCAsXCFi/vdHVvyD34NgIpRy9AAAAAABg9j8AQdEICxdYRRd3dtW/bVC21aRiI70AAAAAAED2PwBB8QgLF/gth60a1b/VZ7Ce5ITmvAAAAAAAIPY/AEGRCQsXeHeVX77Uv+A+KZNpGwS9AAAAAAAA9j8AQbEJCxdgHMKLYdS/zIRMSC/YEz0AAAAAAOD1PwBB0QkLF6iGhjAE1L86C4Lt80LcPAAAAAAAwPU/AEHxCQsXSGlVTKbTv2CUUYbGsSA9AAAAAACg9T8AQZEKCxeAmJrdR9O/koDF1E1ZJT0AAAAAAID1PwBBsQoLFyDhuuLo0r/YK7eZHnsmPQAAAAAAYPU/AEHRCgsXiN4TWonSvz+wz7YUyhU9AAAAAABg9T8AQfEKCxeI3hNaidK/P7DPthTKFT0AAAAAAED1PwBBkQsLF3jP+0Ep0r922lMoJFoWvQAAAAAAIPU/AEGxCwsXmGnBmMjRvwRU52i8rx+9AAAAAAAA9T8AQdELCxeoq6tcZ9G/8KiCM8YfHz0AAAAAAOD0PwBB8QsLF0iu+YsF0b9mWgX9xKgmvQAAAAAAwPQ/AEGRDAsXkHPiJKPQvw4D9H7uawy9AAAAAACg9D8AQbEMCxfQtJQlQNC/fy30nrg28LwAAAAAAKD0PwBB0QwLF9C0lCVA0L9/LfSeuDbwvAAAAAAAgPQ/AEHxDAsXQF5tGLnPv4c8masqVw09AAAAAABg9D8AQZENCxdg3Mut8M6/JK+GnLcmKz0AAAAAAED0PwBBsQ0LF/Aqbgcnzr8Q/z9UTy8XvQAAAAAAIPQ/AEHRDQsXwE9rIVzNvxtoyruRuiE9AAAAAAAA9D8AQfENCxegmsf3j8y/NISfaE95Jz0AAAAAAAD0PwBBkQ4LF6Cax/ePzL80hJ9oT3knPQAAAAAA4PM/AEGxDgsXkC10hsLLv4+3izGwThk9AAAAAADA8z8AQdEOCxfAgE7J88q/ZpDNP2NOujwAAAAAAKDzPwBB8Q4LF7DiH7wjyr/qwUbcZIwlvQAAAAAAoPM/AEGRDwsXsOIfvCPKv+rBRtxkjCW9AAAAAACA8z8AQbEPCxdQ9JxaUsm/49TBBNnRKr0AAAAAAGDzPwBB0Q8LF9AgZaB/yL8J+tt/v70rPQAAAAAAQPM/AEHxDwsX4BACiavHv1hKU3KQ2ys9AAAAAABA8z8AQZEQCxfgEAKJq8e/WEpTcpDbKz0AAAAAACDzPwBBsRALF9AZ5w/Wxr9m4rKjauQQvQAAAAAAAPM/AEHREAsXkKdwMP/FvzlQEJ9Dnh69AAAAAAAA8z8AQfEQCxeQp3Aw/8W/OVAQn0OeHr0AAAAAAODyPwBBkRELF7Ch4+Umxb+PWweQi94gvQAAAAAAwPI/AEGxEQsXgMtsK03Evzx4NWHBDBc9AAAAAADA8j8AQdERCxeAy2wrTcS/PHg1YcEMFz0AAAAAAKDyPwBB8RELF5AeIPxxw786VCdNhnjxPAAAAAAAgPI/AEGREgsX8B/4UpXCvwjEcRcwjSS9AAAAAABg8j8AQbESCxdgL9Uqt8G/lqMRGKSALr0AAAAAAGDyPwBB0RILF2Av1Sq3wb+WoxEYpIAuvQAAAAAAQPI/AEHxEgsXkNB8ftfAv/Rb6IiWaQo9AAAAAABA8j8AQZETCxeQ0Hx+18C/9FvoiJZpCj0AAAAAACDyPwBBsRMLF+DbMZHsv7/yM6NcVHUlvQAAAAAAAPI/AEHSEwsWK24HJ76/PADwKiw0Kj0AAAAAAADyPwBB8hMLFituBye+vzwA8CosNCo9AAAAAADg8T8AQZEUCxfAW49UXry/Br5fWFcMHb0AAAAAAMDxPwBBsRQLF+BKOm2Sur/IqlvoNTklPQAAAAAAwPE/AEHRFAsX4Eo6bZK6v8iqW+g1OSU9AAAAAACg8T8AQfEUCxegMdZFw7i/aFYvTSl8Ez0AAAAAAKDxPwBBkRULF6Ax1kXDuL9oVi9NKXwTPQAAAAAAgPE/AEGxFQsXYOWK0vC2v9pzM8k3lya9AAAAAABg8T8AQdEVCxcgBj8HG7W/V17GYVsCHz0AAAAAAGDxPwBB8RULFyAGPwcbtb9XXsZhWwIfPQAAAAAAQPE/AEGRFgsX4BuW10Gzv98T+czaXiw9AAAAAABA8T8AQbEWCxfgG5bXQbO/3xP5zNpeLD0AAAAAACDxPwBB0RYLF4Cj7jZlsb8Jo492XnwUPQAAAAAAAPE/AEHxFgsXgBHAMAqvv5GONoOeWS09AAAAAAAA8T8AQZEXCxeAEcAwCq+/kY42g55ZLT0AAAAAAODwPwBBsRcLF4AZcd1Cq79McNbleoIcPQAAAAAA4PA/AEHRFwsXgBlx3UKrv0xw1uV6ghw9AAAAAADA8D8AQfEXCxfAMvZYdKe/7qHyNEb8LL0AAAAAAMDwPwBBkRgLF8Ay9lh0p7/uofI0RvwsvQAAAAAAoPA/AEGxGAsXwP65h56jv6r+JvW3AvU8AAAAAACg8D8AQdEYCxfA/rmHnqO/qv4m9bcC9TwAAAAAAIDwPwBB8hgLFngOm4Kfv+QJfnwmgCm9AAAAAACA8D8AQZIZCxZ4DpuCn7/kCX58JoApvQAAAAAAYPA/AEGxGQsXgNUHG7mXvzmm+pNUjSi9AAAAAABA8D8AQdIZCxb8sKjAj7+cptP2fB7fvAAAAAAAQPA/AEHyGQsW/LCowI+/nKbT9nwe37wAAAAAACDwPwBBkhoLFhBrKuB/v+RA2g0/4hm9AAAAAAAg8D8AQbIaCxYQayrgf7/kQNoNP+IZvQAAAAAAAPA/AEHmGgsC8D8AQYUbCwPA7z8AQZIbCxaJdRUQgD/oK52Za8cQvQAAAAAAgO8/AEGxGwsXgJNYViCQP9L34gZb3CO9AAAAAABA7z8AQdIbCxbJKCVJmD80DFoyuqAqvQAAAAAAAO8/AEHxGwsXQOeJXUGgP1PX8VzAEQE9AAAAAADA7j8AQZIcCxYu1K5mpD8o/b11cxYsvQAAAAAAgO4/AEGxHAsXwJ8UqpSoP30mWtCVeRm9AAAAAABA7j8AQdEcCxfA3c1zy6w/ByjYR/JoGr0AAAAAACDuPwBB8RwLF8AGwDHqrj97O8lPPhEOvQAAAAAA4O0/AEGRHQsXYEbRO5exP5ueDVZdMiW9AAAAAACg7T8AQbEdCxfg0af1vbM/107bpV7ILD0AAAAAAGDtPwBB0R0LF6CXTVrptT8eHV08BmksvQAAAAAAQO0/AEHxHQsXwOoK0wC3PzLtnamNHuw8AAAAAAAA7T8AQZEeCxdAWV1eM7k/2ke9OlwRIz0AAAAAAMDsPwBBsR4LF2Ctjchquz/laPcrgJATvQAAAAAAoOw/AEHRHgsXQLwBWIi8P9OsWsbRRiY9AAAAAABg7D8AQfEeCxcgCoM5x74/4EXmr2jALb0AAAAAAEDsPwBBkR8LF+DbOZHovz/9CqFP1jQlvQAAAAAAAOw/AEGxHwsX4CeCjhfBP/IHLc547yE9AAAAAADg6z8AQdEfCxfwI34rqsE/NJk4RI6nLD0AAAAAAKDrPwBB8R8LF4CGDGHRwj+htIHLbJ0DPQAAAAAAgOs/AEGRIAsXkBWw/GXDP4lySyOoL8Y8AAAAAABA6z8AQbEgCxewM4M9kcQ/eLb9VHmDJT0AAAAAACDrPwBB0SALF7Ch5OUnxT/HfWnl6DMmPQAAAAAA4Oo/AEHxIAsXEIy+TlfGP3guPCyLzxk9AAAAAADA6j8AQZEhCxdwdYsS8MY/4SGc5Y0RJb0AAAAAAKDqPwBBsSELF1BEhY2Jxz8FQ5FwEGYcvQAAAAAAYOo/AEHSIQsWOeuvvsg/0SzpqlQ9B70AAAAAAEDqPwBB8iELFvfcWlrJP2//oFgo8gc9AAAAAAAA6j8AQZEiCxfgijztk8o/aSFWUENyKL0AAAAAAODpPwBBsSILF9BbV9gxyz+q4axOjTUMvQAAAAAAwOk/AEHRIgsX4Ds4h9DLP7YSVFnESy29AAAAAACg6T8AQfEiCxcQ8Mb7b8w/0iuWxXLs8bwAAAAAAGDpPwBBkSMLF5DUsD2xzT81sBX3Kv8qvQAAAAAAQOk/AEGxIwsXEOf/DlPOPzD0QWAnEsI8AAAAAAAg6T8AQdIjCxbd5K31zj8RjrtlFSHKvAAAAAAAAOk/AEHxIwsXsLNsHJnPPzDfDMrsyxs9AAAAAADA6D8AQZEkCxdYTWA4cdA/kU7tFtuc+DwAAAAAAKDoPwBBsSQLF2BhZy3E0D/p6jwWixgnPQAAAAAAgOg/AEHRJAsX6CeCjhfRPxzwpWMOISy9AAAAAABg6D8AQfEkCxf4rMtca9E/gRal982aKz0AAAAAAEDoPwBBkSULF2haY5m/0T+3vUdR7aYsPQAAAAAAIOg/AEGxJQsXuA5tRRTSP+q6Rrrehwo9AAAAAADg5z8AQdElCxeQ3HzwvtI/9ARQSvqcKj0AAAAAAMDnPwBB8SULF2DT4fEU0z+4PCHTeuIovQAAAAAAoOc/AEGRJgsXEL52Z2vTP8h38bDNbhE9AAAAAACA5z8AQbEmCxcwM3dSwtM/XL0GtlQ7GD0AAAAAAGDnPwBB0SYLF+jVI7QZ1D+d4JDsNuQIPQAAAAAAQOc/AEHxJgsXyHHCjXHUP3XWZwnOJy+9AAAAAAAg5z8AQZEnCxcwF57gydQ/pNgKG4kgLr0AAAAAAADnPwBBsScLF6A4B64i1T9Zx2SBcL4uPQAAAAAA4OY/AEHRJwsX0MhT93vVP+9AXe7trR89AAAAAADA5j8AQfEnCw9gWd+91dU/3GWkCCoLCr0AQY4oC/IP8D9uv4gaTzubPDUz+6k99u8/XdzYnBNgcbxhgHc+muzvP9FmhxB6XpC8hX9u6BXj7z8T9mc1UtKMPHSFFdOw2e8/+o75I4DOi7ze9t0pa9DvP2HI5mFO92A8yJt1GEXH7z+Z0zNb5KOQPIPzxso+vu8/bXuDXaaalzwPiflsWLXvP/zv/ZIatY4890dyK5Ks7z/RnC9wPb4+PKLR0zLso+8/C26QiTQDarwb0/6vZpvvPw69LypSVpW8UVsS0AGT7z9V6k6M74BQvMwxbMC9iu8/FvTVuSPJkbzgLamumoLvP69VXOnj04A8UY6lyJh67z9Ik6XqFRuAvHtRfTy4cu8/PTLeVfAfj7zqjYw4+WrvP79TEz+MiYs8dctv61tj7z8m6xF2nNmWvNRcBITgW+8/YC86PvfsmjyquWgxh1TvP504hsuC54+8Hdn8IlBN7z+Nw6ZEQW+KPNaMYog7Ru8/fQTksAV6gDyW3H2RST/vP5SoqOP9jpY8OGJ1bno47z99SHTyGF6HPD+msk/OMe8/8ucfmCtHgDzdfOJlRSvvP14IcT97uJa8gWP14d8k7z8xqwlt4feCPOHeH/WdHu8/+r9vGpshPbyQ2drQfxjvP7QKDHKCN4s8CwPkpoUS7z+Py86JkhRuPFYvPqmvDO8/tquwTXVNgzwVtzEK/gbvP0x0rOIBQoY8MdhM/HAB7z9K+NNdOd2PPP8WZLII/O4/BFuOO4Cjhrzxn5JfxfbuP2hQS8ztSpK8y6k6N6fx7j+OLVEb+AeZvGbYBW2u7O4/0jaUPujRcbz3n+U02+fuPxUbzrMZGZm85agTwy3j7j9tTCqnSJ+FPCI0Ekym3u4/imkoemASk7wcgKwERdruP1uJF0iPp1i8Ki73IQrW7j8bmklnmyx8vJeoUNn10e4/EazCYO1jQzwtiWFgCM7uP+9kBjsJZpY8VwAd7UHK7j95A6Ha4cxuPNA8wbWixu4/MBIPP47/kzze09fwKsPuP7CvervOkHY8Jyo21dq/7j934FTrvR2TPA3d/ZmyvO4/jqNxADSUj7ynLJ12srnuP0mjk9zM3oe8QmbPotq27j9fOA+9xt54vIJPnVYrtO4/9lx77EYShrwPkl3KpLHuP47X/RgFNZM82ie1Nkev7j8Fm4ovt5h7PP3Hl9QSre4/CVQc4uFjkDwpVEjdB6vuP+rGGVCFxzQ8t0ZZiiap7j81wGQr5jKUPEghrRVvp+4/n3aZYUrkjLwJ3Ha54aXuP6hN7zvFM4y8hVU6sH6k7j+u6SuJeFOEvCDDzDRGo+4/WFhWeN3Ok7wlIlWCOKLuP2QZfoCqEFc8c6lM1FWh7j8oIl6/77OTvM07f2aeoO4/grk0h60Sary/2gt1EqDuP+6pbbjvZ2O8LxplPLKf7j9RiOBUPdyAvISUUfl9n+4/zz5afmQfeLx0X+zodZ/uP7B9i8BK7oa8dIGlSJqf7j+K5lUeMhmGvMlnQlbrn+4/09QJXsuckDw/Xd5PaaDuPx2lTbncMnu8hwHrcxSh7j9rwGdU/eyUPDLBMAHtoe4/VWzWq+HrZTxiTs8286LuP0LPsy/FoYi8Eho+VCek7j80NzvxtmmTvBPOTJmJpe4/Hv8ZOoRegLytxyNGGqfuP25XcthQ1JS87ZJEm9mo7j8Aig5bZ62QPJlmitnHqu4/tOrwwS+3jTzboCpC5azuP//nxZxgtmW8jES1FjKv7j9EX/NZg/Z7PDZ3FZmuse4/gz0epx8Jk7zG/5ELW7TuPykebIu4qV285cXNsDe37j9ZuZB8+SNsvA9SyMtEuu4/qvn0IkNDkrxQTt6fgr3uP0uOZtdsyoW8ugfKcPHA7j8nzpEr/K9xPJDwo4KRxO4/u3MK4TXSbTwjI+MZY8juP2MiYiIExYe8ZeVde2bM7j/VMeLjhhyLPDMtSuyb0O4/Fbu809G7kbxdJT6yA9XuP9Ix7pwxzJA8WLMwE57Z7j+zWnNuhGmEPL/9eVVr3u4/tJ2Ol83fgrx689O/a+PuP4czy5J3Gow8rdNamZ/o7j/62dFKj3uQvGa2jSkH7u4/uq7cVtnDVbz7FU+4ovPuP0D2pj0OpJC8OlnljXL57j80k6049NZovEde+/J2/+4/NYpYa+LukbxKBqEwsAXvP83dXwrX/3Q80sFLkB4M7z+smJL6+72RvAke11vCEu8/swyvMK5uczycUoXdmxnvP5T9n1wy4448etD/X6sg7z+sWQnRj+CEPEvRVy7xJ+8/ZxpOOK/NYzy15waUbS/vP2gZkmwsa2c8aZDv3CA37z/StcyDGIqAvPrDXVULP+8/b/r/P12tj7x8iQdKLUfvP0mpdTiuDZC88okNCIdP7z+nBz2mhaN0PIek+9wYWO8/DyJAIJ6RgryYg8kW42DvP6ySwdVQWo48hTLbA+Zp7z9LawGsWTqEPGC0AfMhc+8/Hz60ByHVgrxfm3szl3zvP8kNRzu5Kom8KaH1FEaG7z/TiDpgBLZ0PPY/i+cukO8/cXKdUezFgzyDTMf7UZrvP/CR048S94+82pCkoq+k7z99dCPimK6NvPFnji1Ir+8/CCCqQbzDjjwnWmHuG7rvPzLrqcOUK4Q8l7prNyvF7z/uhdExqWSKPEBFblt20O8/7eM75Lo3jrwUvpyt/dvvP53NkU07iXc82JCegcHn7z+JzGBBwQVTPPFxjyvC8+8/";var{f64_pow:Fb}=(await WebAssembly.instantiateStreaming(fetch(kb))).instance.exports;var el=new Float64Array(1),wb=new Float32Array(el.buffer),Dn=new Int32Array(el.buffer);globalThis.f32_as_i32=function(r){return wb[0]=r,Dn[0]};globalThis.i32_as_f32=function(r){return Dn[0]=r,wb[0]};globalThis.f64_as_i64=function(r){return el[0]=r,i64_new(Dn[0],Dn[1])};globalThis.i64_as_f64=function(r){return Dn[0]=i64_low(r),Dn[1]=i64_high(r),el[0]};globalThis.f64_pow=Fb;import we from"long";globalThis.i64_zero=we.ZERO;globalThis.i64_one=we.ONE;globalThis.i64_neg_one=we.fromInt(-1);globalThis.i64_minimum=we.MIN_VALUE;globalThis.i64_maximum=we.MAX_VALUE;globalThis.i64_is=function(r){return we.isLong(r)};globalThis.i64_new=function(r,e){return we.fromBits(r,e)};globalThis.i64_low=function(r){return r.low};globalThis.i64_high=function(r){return r.high};globalThis.i64_not=function(r){return r.not()};globalThis.i64_neg=function(r){return r.neg()};globalThis.i64_clz=function(r){return r.clz()};globalThis.i64_ctz=function(r){return r.ctz()};globalThis.i64_add=function(r,e){return r.add(e)};globalThis.i64_sub=function(r,e){return r.sub(e)};globalThis.i64_mul=function(r,e){return r.mul(e)};globalThis.i64_pow=function(r,e){let t=e.low,i=e.high;if(i<=0){if(i<0)return r.eq(globalThis.i64_neg_one)?t&1?r:we.ONE:r.eq(we.ONE)?r:we.ZERO;if(t==0)return we.ONE;if(t==1)return r;if(t==2)return r.mul(r)}let s=we.ONE;for(;t|i;)t&1&&(s=s.mul(r)),e=e.shru(1),r=r.mul(r),t=e.low,i=e.high;return s};globalThis.i64_div=function(r,e){return r.div(e)};globalThis.i64_div_u=function(r,e){return r.toUnsigned().div(e.toUnsigned()).toSigned()};globalThis.i64_rem=function(r,e){return r.mod(e)};globalThis.i64_rem_u=function(r,e){return r.toUnsigned().mod(e.toUnsigned()).toSigned()};globalThis.i64_and=function(r,e){return r.and(e)};globalThis.i64_or=function(r,e){return r.or(e)};globalThis.i64_xor=function(r,e){return r.xor(e)};globalThis.i64_shl=function(r,e){return r.shl(e)};globalThis.i64_shr=function(r,e){return r.shr(e)};globalThis.i64_shr_u=function(r,e){return r.shru(e)};globalThis.i64_eq=function(r,e){return r.eq(e)};globalThis.i64_ne=function(r,e){return r.ne(e)};globalThis.i64_ge=function(r,e){return r.ge(e)};globalThis.i64_ge_u=function(r,e){return r.toUnsigned().ge(e.toUnsigned())};globalThis.i64_gt=function(r,e){return r.gt(e)};globalThis.i64_gt_u=function(r,e){return r.toUnsigned().gt(e.toUnsigned())};globalThis.i64_le=function(r,e){return r.le(e)};globalThis.i64_le_u=function(r,e){return r.toUnsigned().le(e.toUnsigned())};globalThis.i64_lt=function(r,e){return r.lt(e)};globalThis.i64_lt_u=function(r,e){return r.toUnsigned().lt(e.toUnsigned())};globalThis.i64_align=function(r,e){assert(e&&(e&e-1)==0);let t=we.fromInt(e-1);return r.add(t).and(t.not())};globalThis.i64_signbit=function(r){return!!(r.high>>>31)};globalThis.i64_is_i8=function(r){return r.high===0&&r.low>=0&&r.low<=i8.MAX_VALUE||r.high===-1&&r.low>=i8.MIN_VALUE&&r.low<0};globalThis.i64_is_i16=function(r){return r.high===0&&r.low>=0&&r.low<=i16.MAX_VALUE||r.high===-1&&r.low>=i16.MIN_VALUE&&r.low<0};globalThis.i64_is_i32=function(r){return r.high===0&&r.low>=0||r.high===-1&&r.low<0};globalThis.i64_is_u8=function(r){return r.high===0&&r.low>>>0<=u8.MAX_VALUE};globalThis.i64_is_u16=function(r){return r.high===0&&r.low>>>0<=u16.MAX_VALUE};globalThis.i64_is_u32=function(r){return r.high===0};globalThis.i64_is_bool=function(r){return(r.high|r.low&-2)===0};var LE=we.fromNumber(f32.MIN_SAFE_INTEGER),ME=we.fromNumber(f32.MAX_SAFE_INTEGER);globalThis.i64_is_f32=function(r){return r.gte(LE)&&r.lte(ME)};var zE=we.fromNumber(f64.MIN_SAFE_INTEGER),DE=we.fromNumber(f64.MAX_SAFE_INTEGER);globalThis.i64_is_f64=function(r){return r.gte(zE)&&r.lte(DE)};globalThis.i64_to_f32=function(r){return globalThis.Math.fround(r.toNumber())};globalThis.i64_to_f64=function(r){return r.toNumber()};globalThis.i64_to_string=function(r,e){return e?r.toUnsigned().toString():r.toString()};globalThis.i64_clone=function(r){return we.fromBits(r.low,r.high,r.unsigned)};globalThis.Map_keys=function(r){return Array.from(r.keys())};globalThis.Map_values=function(r){return Array.from(r.values())};globalThis.Set_values=function(r){return Array.from(r.values())};var Ft=(S=>(S[S.None=0]="None",S[S.SignExtension=1]="SignExtension",S[S.MutableGlobals=2]="MutableGlobals",S[S.NontrappingF2I=4]="NontrappingF2I",S[S.BulkMemory=8]="BulkMemory",S[S.Simd=16]="Simd",S[S.Threads=32]="Threads",S[S.ExceptionHandling=64]="ExceptionHandling",S[S.TailCalls=128]="TailCalls",S[S.ReferenceTypes=256]="ReferenceTypes",S[S.MultiValue=512]="MultiValue",S[S.GC=1024]="GC",S[S.Memory64=2048]="Memory64",S[S.RelaxedSimd=4096]="RelaxedSimd",S[S.ExtendedConst=8192]="ExtendedConst",S[S.Strings=16384]="Strings",S[S.SharedEverything=32768]="SharedEverything",S[S.All=65535]="All",S))(Ft||{});function Gn(n){switch(n){case 1:return"sign-extension";case 2:return"mutable-globals";case 4:return"nontrapping-f2i";case 8:return"bulk-memory";case 16:return"simd";case 32:return"threads";case 64:return"exception-handling";case 128:return"tail-calls";case 256:return"reference-types";case 512:return"multi-value";case 1024:return"gc";case 2048:return"memory64";case 4096:return"relaxed-simd";case 8192:return"extended-const";case 16384:return"stringref";case 32768:return"shared-everything"}return assert(!1),""}var Un=(t=>(t[t.Js=0]="Js",t[t.Wasm32=1]="Wasm32",t[t.Wasm64=2]="Wasm64",t))(Un||{});var tl=(t=>(t[t.Stub=0]="Stub",t[t.Minimal=1]="Minimal",t[t.Incremental=2]="Incremental",t))(tl||{});var Vn=class{constructor(){this.flags=0}};Vn=j_([unmanaged],Vn);var rl=(D=>(D[D.NONE=0]="NONE",D[D.ARRAYBUFFERVIEW=1]="ARRAYBUFFERVIEW",D[D.ARRAY=2]="ARRAY",D[D.STATICARRAY=4]="STATICARRAY",D[D.SET=8]="SET",D[D.MAP=16]="MAP",D[D.POINTERFREE=32]="POINTERFREE",D[D.VALUE_ALIGN_0=64]="VALUE_ALIGN_0",D[D.VALUE_ALIGN_1=128]="VALUE_ALIGN_1",D[D.VALUE_ALIGN_2=256]="VALUE_ALIGN_2",D[D.VALUE_ALIGN_3=512]="VALUE_ALIGN_3",D[D.VALUE_ALIGN_4=1024]="VALUE_ALIGN_4",D[D.VALUE_SIGNED=2048]="VALUE_SIGNED",D[D.VALUE_FLOAT=4096]="VALUE_FLOAT",D[D.VALUE_NULLABLE=8192]="VALUE_NULLABLE",D[D.VALUE_MANAGED=16384]="VALUE_MANAGED",D[D.KEY_ALIGN_0=32768]="KEY_ALIGN_0",D[D.KEY_ALIGN_1=65536]="KEY_ALIGN_1",D[D.KEY_ALIGN_2=131072]="KEY_ALIGN_2",D[D.KEY_ALIGN_3=262144]="KEY_ALIGN_3",D[D.KEY_ALIGN_4=524288]="KEY_ALIGN_4",D[D.KEY_SIGNED=1048576]="KEY_SIGNED",D[D.KEY_FLOAT=2097152]="KEY_FLOAT",D[D.KEY_NULLABLE=4194304]="KEY_NULLABLE",D[D.KEY_MANAGED=8388608]="KEY_MANAGED",D))(rl||{});var ze=(j=>(j[j.None=0]="None",j[j.Import=1]="Import",j[j.Export=2]="Export",j[j.Declare=4]="Declare",j[j.Const=8]="Const",j[j.Let=16]="Let",j[j.Static=32]="Static",j[j.Readonly=64]="Readonly",j[j.Abstract=128]="Abstract",j[j.Public=256]="Public",j[j.Private=512]="Private",j[j.Protected=1024]="Protected",j[j.Get=2048]="Get",j[j.Set=4096]="Set",j[j.Override=8192]="Override",j[j.DefinitelyAssigned=16384]="DefinitelyAssigned",j[j.Ambient=32768]="Ambient",j[j.Generic=65536]="Generic",j[j.GenericContext=131072]="GenericContext",j[j.Instance=262144]="Instance",j[j.Constructor=524288]="Constructor",j[j.ModuleExport=1048576]="ModuleExport",j[j.ModuleImport=2097152]="ModuleImport",j[j.Resolved=4194304]="Resolved",j[j.Compiled=8388608]="Compiled",j[j.Errored=16777216]="Errored",j[j.Inlined=33554432]="Inlined",j[j.Scoped=67108864]="Scoped",j[j.Stub=134217728]="Stub",j[j.Overridden=268435456]="Overridden",j[j.Closure=536870912]="Closure",j[j.Quoted=1073741824]="Quoted",j[j.InternallyNullable=-2147483648]="InternallyNullable",j))(ze||{}),mt="/",GE="..",nl="get:",il="set:",Mp="#",es=".",zp="~",Rb="~lib",wt=Rb+mt,Qe=mt+"index",Dp="@",B;(z=>(z.Empty="",z.i8="i8",z.i16="i16",z.i32="i32",z.i64="i64",z.isize="isize",z.u8="u8",z.u16="u16",z.u32="u32",z.u64="u64",z.usize="usize",z.bool="bool",z.f32="f32",z.f64="f64",z.v128="v128",z.ref_func="ref_func",z.ref_extern="ref_extern",z.ref_any="ref_any",z.ref_eq="ref_eq",z.ref_struct="ref_struct",z.ref_array="ref_array",z.ref_i31="ref_i31",z.ref_string="ref_string",z.ref_stringview_wtf8="ref_stringview_wtf8",z.ref_stringview_wtf16="ref_stringview_wtf16",z.ref_stringview_iter="ref_stringview_iter",z.i8x16="i8x16",z.u8x16="u8x16",z.i16x8="i16x8",z.u16x8="u16x8",z.i32x4="i32x4",z.u32x4="u32x4",z.i64x2="i64x2",z.u64x2="u64x2",z.f32x4="f32x4",z.f64x2="f64x2",z.void_="void",z.number="number",z.boolean="boolean",z.string="string",z.native="native",z.indexof="indexof",z.valueof="valueof",z.returnof="returnof",z.thisof="thisof",z.nonnull="nonnull",z.null_="null",z.true_="true",z.false_="false",z.this_="this",z.super_="super",z.constructor="constructor",z.COPY_STRUCT="~lib/util/bytes/COPY_STRUCT",z.ASC_TARGET="ASC_TARGET",z.ASC_RUNTIME="ASC_RUNTIME",z.ASC_NO_ASSERT="ASC_NO_ASSERT",z.ASC_MEMORY_BASE="ASC_MEMORY_BASE",z.ASC_TABLE_BASE="ASC_TABLE_BASE",z.ASC_OPTIMIZE_LEVEL="ASC_OPTIMIZE_LEVEL",z.ASC_SHRINK_LEVEL="ASC_SHRINK_LEVEL",z.ASC_LOW_MEMORY_LIMIT="ASC_LOW_MEMORY_LIMIT",z.ASC_EXPORT_RUNTIME="ASC_EXPORT_RUNTIME",z.ASC_FEATURE_SIGN_EXTENSION="ASC_FEATURE_SIGN_EXTENSION",z.ASC_FEATURE_MUTABLE_GLOBALS="ASC_FEATURE_MUTABLE_GLOBALS",z.ASC_FEATURE_NONTRAPPING_F2I="ASC_FEATURE_NONTRAPPING_F2I",z.ASC_FEATURE_BULK_MEMORY="ASC_FEATURE_BULK_MEMORY",z.ASC_FEATURE_SIMD="ASC_FEATURE_SIMD",z.ASC_FEATURE_THREADS="ASC_FEATURE_THREADS",z.ASC_FEATURE_EXCEPTION_HANDLING="ASC_FEATURE_EXCEPTION_HANDLING",z.ASC_FEATURE_TAIL_CALLS="ASC_FEATURE_TAIL_CALLS",z.ASC_FEATURE_REFERENCE_TYPES="ASC_FEATURE_REFERENCE_TYPES",z.ASC_FEATURE_MULTI_VALUE="ASC_FEATURE_MULTI_VALUE",z.ASC_FEATURE_GC="ASC_FEATURE_GC",z.ASC_FEATURE_MEMORY64="ASC_FEATURE_MEMORY64",z.ASC_FEATURE_RELAXED_SIMD="ASC_FEATURE_RELAXED_SIMD",z.ASC_FEATURE_EXTENDED_CONST="ASC_FEATURE_EXTENDED_CONST",z.ASC_FEATURE_STRINGREF="ASC_FEATURE_STRINGREF",z.ASC_FEATURE_SHARED_EVERYTHING="ASC_FEATURE_SHARED_EVERYTHING",z.ASC_VERSION_MAJOR="ASC_VERSION_MAJOR",z.ASC_VERSION_MINOR="ASC_VERSION_MINOR",z.ASC_VERSION_PATCH="ASC_VERSION_PATCH",z.EnumToString="__enum_to_string",z.I8="I8",z.I16="I16",z.I32="I32",z.I64="I64",z.Isize="Isize",z.U8="U8",z.U16="U16",z.U32="U32",z.U64="U64",z.Usize="Usize",z.Bool="Bool",z.F32="F32",z.F64="F64",z.V128="V128",z.RefFunc="RefFunc",z.RefExtern="RefExtern",z.RefAny="RefAny",z.RefEq="RefEq",z.RefStruct="RefStruct",z.RefArray="RefArray",z.RefI31="RefI31",z.RefString="RefString",z.String="String",z.RegExp="RegExp",z.Object="Object",z.Array="Array",z.StaticArray="StaticArray",z.DynamicArray="DynamicArray",z.Set="Set",z.Map="Map",z.Function="Function",z.Task="Task",z.ArrayBufferView="ArrayBufferView",z.ArrayBuffer="ArrayBuffer",z.Math="Math",z.Mathf="Mathf",z.NativeMath="NativeMath",z.NativeMathf="NativeMathf",z.Int8Array="Int8Array",z.Int16Array="Int16Array",z.Int32Array="Int32Array",z.Int64Array="Int64Array",z.Uint8Array="Uint8Array",z.Uint8ClampedArray="Uint8ClampedArray",z.Uint16Array="Uint16Array",z.Uint32Array="Uint32Array",z.Uint64Array="Uint64Array",z.Float32Array="Float32Array",z.Float64Array="Float64Array",z.TemplateStringsArray="TemplateStringsArray",z.Error="Error",z.abort="abort",z.trace="trace",z.seed="seed",z.pow="pow",z.ipow32="ipow32",z.ipow64="ipow64",z.mod="mod",z.alloc="__alloc",z.realloc="__realloc",z.free="__free",z.new_="__new",z.renew="__renew",z.link="__link",z.collect="__collect",z.visit="__visit",z.newBuffer="__newBuffer",z.newArray="__newArray",z.BLOCK="~lib/rt/common/BLOCK",z.OBJECT="~lib/rt/common/OBJECT",z.DefaultMemory="0",z.DefaultTable="0"))(B||={});var ts=class{constructor(r=0,e=null,t=!1,i=!1,s=null,a=!1){this.kind=r;this.envClass=e;this.ownEnv=t;this.receivesEnv=i;this.parentClass=s;this.hasThis=a}},sl=new Map,Cb=null;function On(){let n=Cb;return n==null&&(Cb=n=new Map),n}var Pb=null;function qr(){let n=Pb;return n==null&&(Pb=n=new Map),n}var Xe=(v=>(v[v.Not_implemented_0=100]="Not_implemented_0",v[v.Operation_is_unsafe=101]="Operation_is_unsafe",v[v.User_defined_0=102]="User_defined_0",v[v.Feature_0_is_not_enabled=103]="Feature_0_is_not_enabled",v[v.Low_memory_limit_exceeded_by_static_data_0_1=104]="Low_memory_limit_exceeded_by_static_data_0_1",v[v.Module_requires_at_least_0_pages_of_initial_memory=105]="Module_requires_at_least_0_pages_of_initial_memory",v[v.Module_requires_at_least_0_pages_of_maximum_memory=106]="Module_requires_at_least_0_pages_of_maximum_memory",v[v.Shared_memory_requires_maximum_memory_to_be_defined=107]="Shared_memory_requires_maximum_memory_to_be_defined",v[v.Shared_memory_requires_feature_threads_to_be_enabled=108]="Shared_memory_requires_feature_threads_to_be_enabled",v[v.Transform_0_1=109]="Transform_0_1",v[v.Start_function_name_0_is_invalid_or_conflicts_with_another_export=110]="Start_function_name_0_is_invalid_or_conflicts_with_another_export",v[v.Element_0_not_found=111]="Element_0_not_found",v[v.Exchange_of_0_values_is_not_supported_by_all_embeddings=112]="Exchange_of_0_values_is_not_supported_by_all_embeddings",v[v.Conversion_from_type_0_to_1_requires_an_explicit_cast=200]="Conversion_from_type_0_to_1_requires_an_explicit_cast",v[v.Conversion_from_type_0_to_1_will_require_an_explicit_cast_when_switching_between_32_64_bit=201]="Conversion_from_type_0_to_1_will_require_an_explicit_cast_when_switching_between_32_64_bit",v[v.Type_0_cannot_be_changed_to_type_1=202]="Type_0_cannot_be_changed_to_type_1",v[v.Operation_0_cannot_be_applied_to_type_1=203]="Operation_0_cannot_be_applied_to_type_1",v[v.Type_0_cannot_be_nullable=204]="Type_0_cannot_be_nullable",v[v.Mutable_value_cannot_be_inlined=206]="Mutable_value_cannot_be_inlined",v[v.Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa=207]="Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa",v[v.Unmanaged_classes_cannot_implement_interfaces=208]="Unmanaged_classes_cannot_implement_interfaces",v[v.Invalid_regular_expression_flags=209]="Invalid_regular_expression_flags",v[v.Expression_is_never_null=210]="Expression_is_never_null",v[v.Class_0_is_final_and_cannot_be_extended=211]="Class_0_is_final_and_cannot_be_extended",v[v.Decorator_0_is_not_valid_here=212]="Decorator_0_is_not_valid_here",v[v.Duplicate_decorator=213]="Duplicate_decorator",v[v.Type_0_is_illegal_in_this_context=214]="Type_0_is_illegal_in_this_context",v[v.Optional_parameter_must_have_an_initializer=215]="Optional_parameter_must_have_an_initializer",v[v.Class_0_cannot_declare_a_constructor_when_instantiated_from_an_object_literal=216]="Class_0_cannot_declare_a_constructor_when_instantiated_from_an_object_literal",v[v.Function_0_cannot_be_inlined_into_itself=217]="Function_0_cannot_be_inlined_into_itself",v[v.Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set=218]="Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set",v[v.Optional_properties_are_not_supported=219]="Optional_properties_are_not_supported",v[v.Expression_must_be_a_compile_time_constant=220]="Expression_must_be_a_compile_time_constant",v[v.Type_0_is_not_a_function_index_or_function_reference=221]="Type_0_is_not_a_function_index_or_function_reference",v[v._0_must_be_a_value_between_1_and_2_inclusive=222]="_0_must_be_a_value_between_1_and_2_inclusive",v[v._0_must_be_a_power_of_two=223]="_0_must_be_a_power_of_two",v[v._0_is_not_a_valid_operator=224]="_0_is_not_a_valid_operator",v[v.Expression_cannot_be_represented_by_a_type=225]="Expression_cannot_be_represented_by_a_type",v[v.Expression_resolves_to_unusual_type_0=226]="Expression_resolves_to_unusual_type_0",v[v.Array_literal_expected=227]="Array_literal_expected",v[v.Function_0_is_virtual_and_will_not_be_inlined=228]="Function_0_is_virtual_and_will_not_be_inlined",v[v.Property_0_only_has_a_setter_and_is_missing_a_getter=229]="Property_0_only_has_a_setter_and_is_missing_a_getter",v[v._0_keyword_cannot_be_used_here=230]="_0_keyword_cannot_be_used_here",v[v.A_class_with_a_constructor_explicitly_returning_something_else_than_this_must_be_final=231]="A_class_with_a_constructor_explicitly_returning_something_else_than_this_must_be_final",v[v.Property_0_is_always_assigned_before_being_used=233]="Property_0_is_always_assigned_before_being_used",v[v.Expression_does_not_compile_to_a_value_at_runtime=234]="Expression_does_not_compile_to_a_value_at_runtime",v[v.Only_variables_functions_and_enums_become_WebAssembly_module_exports=235]="Only_variables_functions_and_enums_become_WebAssembly_module_exports",v[v.Literal_0_does_not_fit_into_i64_or_u64_types=236]="Literal_0_does_not_fit_into_i64_or_u64_types",v[v.Index_signature_accessors_in_type_0_differ_in_types=237]="Index_signature_accessors_in_type_0_differ_in_types",v[v.Initializer_definitive_assignment_or_nullable_type_expected=238]="Initializer_definitive_assignment_or_nullable_type_expected",v[v.Definitive_assignment_has_no_effect_on_local_variables=239]="Definitive_assignment_has_no_effect_on_local_variables",v[v.Ambiguous_operator_overload_0_conflicting_overloads_1_and_2=240]="Ambiguous_operator_overload_0_conflicting_overloads_1_and_2",v[v.An_interface_or_abstract_method_0_cannot_have_type_parameters=241]="An_interface_or_abstract_method_0_cannot_have_type_parameters",v[v.Cannot_override_generic_method_0_with_a_non_generic_method_or_vice_versa=242]="Cannot_override_generic_method_0_with_a_non_generic_method_or_vice_versa",v[v.Importing_the_table_disables_some_indirect_call_optimizations=901]="Importing_the_table_disables_some_indirect_call_optimizations",v[v.Exporting_the_table_disables_some_indirect_call_optimizations=902]="Exporting_the_table_disables_some_indirect_call_optimizations",v[v.Expression_compiles_to_a_dynamic_check_at_runtime=903]="Expression_compiles_to_a_dynamic_check_at_runtime",v[v.Indexed_access_may_involve_bounds_checking=904]="Indexed_access_may_involve_bounds_checking",v[v.Explicitly_returning_constructor_drops_this_allocation=905]="Explicitly_returning_constructor_drops_this_allocation",v[v.Unnecessary_definite_assignment=906]="Unnecessary_definite_assignment",v[v._NaN_does_not_compare_equal_to_any_other_value_including_itself_Use_isNaN_x_instead=907]="_NaN_does_not_compare_equal_to_any_other_value_including_itself_Use_isNaN_x_instead",v[v.Comparison_with_0_0_is_sign_insensitive_Use_Object_is_x_0_0_if_the_sign_matters=908]="Comparison_with_0_0_is_sign_insensitive_Use_Object_is_x_0_0_if_the_sign_matters",v[v.Unterminated_string_literal=1002]="Unterminated_string_literal",v[v.Identifier_expected=1003]="Identifier_expected",v[v._0_expected=1005]="_0_expected",v[v.A_file_cannot_have_a_reference_to_itself=1006]="A_file_cannot_have_a_reference_to_itself",v[v.Trailing_comma_not_allowed=1009]="Trailing_comma_not_allowed",v[v.Unexpected_token=1012]="Unexpected_token",v[v.A_rest_parameter_must_be_last_in_a_parameter_list=1014]="A_rest_parameter_must_be_last_in_a_parameter_list",v[v.Parameter_cannot_have_question_mark_and_initializer=1015]="Parameter_cannot_have_question_mark_and_initializer",v[v.A_required_parameter_cannot_follow_an_optional_parameter=1016]="A_required_parameter_cannot_follow_an_optional_parameter",v[v._0_modifier_cannot_appear_on_class_elements_of_this_kind=1031]="_0_modifier_cannot_appear_on_class_elements_of_this_kind",v[v.Statements_are_not_allowed_in_ambient_contexts=1036]="Statements_are_not_allowed_in_ambient_contexts",v[v.Initializers_are_not_allowed_in_ambient_contexts=1039]="Initializers_are_not_allowed_in_ambient_contexts",v[v._0_modifier_cannot_be_used_here=1042]="_0_modifier_cannot_be_used_here",v[v.A_rest_parameter_cannot_be_optional=1047]="A_rest_parameter_cannot_be_optional",v[v.A_rest_parameter_cannot_have_an_initializer=1048]="A_rest_parameter_cannot_have_an_initializer",v[v.A_set_accessor_must_have_exactly_one_parameter=1049]="A_set_accessor_must_have_exactly_one_parameter",v[v.A_set_accessor_parameter_cannot_have_an_initializer=1052]="A_set_accessor_parameter_cannot_have_an_initializer",v[v.A_get_accessor_cannot_have_parameters=1054]="A_get_accessor_cannot_have_parameters",v[v.Enum_member_must_have_initializer=1061]="Enum_member_must_have_initializer",v[v.Type_parameters_cannot_appear_on_a_constructor_declaration=1092]="Type_parameters_cannot_appear_on_a_constructor_declaration",v[v.Type_annotation_cannot_appear_on_a_constructor_declaration=1093]="Type_annotation_cannot_appear_on_a_constructor_declaration",v[v.An_accessor_cannot_have_type_parameters=1094]="An_accessor_cannot_have_type_parameters",v[v.A_set_accessor_cannot_have_a_return_type_annotation=1095]="A_set_accessor_cannot_have_a_return_type_annotation",v[v.Type_parameter_list_cannot_be_empty=1098]="Type_parameter_list_cannot_be_empty",v[v.Type_argument_list_cannot_be_empty=1099]="Type_argument_list_cannot_be_empty",v[v.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement=1104]="A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement",v[v.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement=1105]="A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement",v[v.A_return_statement_can_only_be_used_within_a_function_body=1108]="A_return_statement_can_only_be_used_within_a_function_body",v[v.Expression_expected=1109]="Expression_expected",v[v.Type_expected=1110]="Type_expected",v[v.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement=1113]="A_default_clause_cannot_appear_more_than_once_in_a_switch_statement",v[v.Duplicate_label_0=1114]="Duplicate_label_0",v[v.An_export_assignment_cannot_have_modifiers=1120]="An_export_assignment_cannot_have_modifiers",v[v.Octal_literals_are_not_allowed_in_strict_mode=1121]="Octal_literals_are_not_allowed_in_strict_mode",v[v.Digit_expected=1124]="Digit_expected",v[v.Hexadecimal_digit_expected=1125]="Hexadecimal_digit_expected",v[v.Unexpected_end_of_text=1126]="Unexpected_end_of_text",v[v.Invalid_character=1127]="Invalid_character",v[v._case_or_default_expected=1130]="_case_or_default_expected",v[v._super_must_be_followed_by_an_argument_list_or_member_access=1034]="_super_must_be_followed_by_an_argument_list_or_member_access",v[v.A_declare_modifier_cannot_be_used_in_an_already_ambient_context=1038]="A_declare_modifier_cannot_be_used_in_an_already_ambient_context",v[v.Type_argument_expected=1140]="Type_argument_expected",v[v.String_literal_expected=1141]="String_literal_expected",v[v.Line_break_not_permitted_here=1142]="Line_break_not_permitted_here",v[v.Declaration_expected=1146]="Declaration_expected",v[v._const_declarations_must_be_initialized=1155]="_const_declarations_must_be_initialized",v[v.Unterminated_regular_expression_literal=1161]="Unterminated_regular_expression_literal",v[v.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions=1263]="Declarations_with_initializers_cannot_also_have_definite_assignment_assertions",v[v.Interface_declaration_cannot_have_implements_clause=1176]="Interface_declaration_cannot_have_implements_clause",v[v.Binary_digit_expected=1177]="Binary_digit_expected",v[v.Octal_digit_expected=1178]="Octal_digit_expected",v[v.An_implementation_cannot_be_declared_in_ambient_contexts=1183]="An_implementation_cannot_be_declared_in_ambient_contexts",v[v.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer=1190]="The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer",v[v.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive=1198]="An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive",v[v.Unterminated_Unicode_escape_sequence=1199]="Unterminated_Unicode_escape_sequence",v[v.Decorators_are_not_valid_here=1206]="Decorators_are_not_valid_here",v[v._abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration=1242]="_abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration",v[v.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract=1245]="Method_0_cannot_have_an_implementation_because_it_is_marked_abstract",v[v.An_interface_property_cannot_have_an_initializer=1246]="An_interface_property_cannot_have_an_initializer",v[v.A_definite_assignment_assertion_is_not_permitted_in_this_context=1255]="A_definite_assignment_assertion_is_not_permitted_in_this_context",v[v._await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules=1308]="_await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules",v[v.A_class_may_only_extend_another_class=1311]="A_class_may_only_extend_another_class",v[v.A_parameter_property_cannot_be_declared_using_a_rest_parameter=1317]="A_parameter_property_cannot_be_declared_using_a_rest_parameter",v[v.A_default_export_can_only_be_used_in_a_module=1319]="A_default_export_can_only_be_used_in_a_module",v[v.An_expression_of_type_0_cannot_be_tested_for_truthiness=1345]="An_expression_of_type_0_cannot_be_tested_for_truthiness",v[v.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal=1351]="An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal",v[v.Duplicate_identifier_0=2300]="Duplicate_identifier_0",v[v.Cannot_find_name_0=2304]="Cannot_find_name_0",v[v.Module_0_has_no_exported_member_1=2305]="Module_0_has_no_exported_member_1",v[v.An_interface_can_only_extend_an_interface=2312]="An_interface_can_only_extend_an_interface",v[v.Generic_type_0_requires_1_type_argument_s=2314]="Generic_type_0_requires_1_type_argument_s",v[v.Type_0_is_not_generic=2315]="Type_0_is_not_generic",v[v.Type_0_is_not_assignable_to_type_1=2322]="Type_0_is_not_assignable_to_type_1",v[v.Property_0_is_private_in_type_1_but_not_in_type_2=2325]="Property_0_is_private_in_type_1_but_not_in_type_2",v[v.Index_signature_is_missing_in_type_0=2329]="Index_signature_is_missing_in_type_0",v[v._this_cannot_be_referenced_in_current_location=2332]="_this_cannot_be_referenced_in_current_location",v[v._this_cannot_be_referenced_in_constructor_arguments=2333]="_this_cannot_be_referenced_in_constructor_arguments",v[v._super_can_only_be_referenced_in_a_derived_class=2335]="_super_can_only_be_referenced_in_a_derived_class",v[v._super_cannot_be_referenced_in_constructor_arguments=2336]="_super_cannot_be_referenced_in_constructor_arguments",v[v.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors=2337]="Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors",v[v.Property_0_does_not_exist_on_type_1=2339]="Property_0_does_not_exist_on_type_1",v[v.Property_0_is_private_and_only_accessible_within_class_1=2341]="Property_0_is_private_and_only_accessible_within_class_1",v[v.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures=2349]="Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures",v[v.This_expression_is_not_constructable=2351]="This_expression_is_not_constructable",v[v.A_function_whose_declared_type_is_not_void_must_return_a_value=2355]="A_function_whose_declared_type_is_not_void_must_return_a_value",v[v.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access=2357]="The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access",v[v.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access=2364]="The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access",v[v.Operator_0_cannot_be_applied_to_types_1_and_2=2365]="Operator_0_cannot_be_applied_to_types_1_and_2",v[v.A_super_call_must_be_the_first_statement_in_the_constructor=2376]="A_super_call_must_be_the_first_statement_in_the_constructor",v[v.Constructors_for_derived_classes_must_contain_a_super_call=2377]="Constructors_for_derived_classes_must_contain_a_super_call",v[v._get_and_set_accessor_must_have_the_same_type=2380]="_get_and_set_accessor_must_have_the_same_type",v[v.Overload_signatures_must_all_be_public_private_or_protected=2385]="Overload_signatures_must_all_be_public_private_or_protected",v[v.Constructor_implementation_is_missing=2390]="Constructor_implementation_is_missing",v[v.Function_implementation_is_missing_or_not_immediately_following_the_declaration=2391]="Function_implementation_is_missing_or_not_immediately_following_the_declaration",v[v.Multiple_constructor_implementations_are_not_allowed=2392]="Multiple_constructor_implementations_are_not_allowed",v[v.Duplicate_function_implementation=2393]="Duplicate_function_implementation",v[v.This_overload_signature_is_not_compatible_with_its_implementation_signature=2394]="This_overload_signature_is_not_compatible_with_its_implementation_signature",v[v.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local=2395]="Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local",v[v.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2=2416]="Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2",v[v.A_class_can_only_implement_an_interface=2422]="A_class_can_only_implement_an_interface",v[v.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged=2434]="A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged",v[v.Types_have_separate_declarations_of_a_private_property_0=2442]="Types_have_separate_declarations_of_a_private_property_0",v[v.Property_0_is_protected_in_type_1_but_public_in_type_2=2444]="Property_0_is_protected_in_type_1_but_public_in_type_2",v[v.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses=2445]="Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses",v[v.Variable_0_used_before_its_declaration=2448]="Variable_0_used_before_its_declaration",v[v.Cannot_redeclare_block_scoped_variable_0=2451]="Cannot_redeclare_block_scoped_variable_0",v[v.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly=2453]="The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly",v[v.Variable_0_is_used_before_being_assigned=2454]="Variable_0_is_used_before_being_assigned",v[v.Type_alias_0_circularly_references_itself=2456]="Type_alias_0_circularly_references_itself",v[v.Type_0_has_no_property_1=2460]="Type_0_has_no_property_1",v[v.The_0_operator_cannot_be_applied_to_type_1=2469]="The_0_operator_cannot_be_applied_to_type_1",v[v.In_const_enum_declarations_member_initializer_must_be_constant_expression=2474]="In_const_enum_declarations_member_initializer_must_be_constant_expression",v[v.A_const_enum_member_can_only_be_accessed_using_a_string_literal=2476]="A_const_enum_member_can_only_be_accessed_using_a_string_literal",v[v.Export_declaration_conflicts_with_exported_declaration_of_0=2484]="Export_declaration_conflicts_with_exported_declaration_of_0",v[v._0_is_referenced_directly_or_indirectly_in_its_own_base_expression=2506]="_0_is_referenced_directly_or_indirectly_in_its_own_base_expression",v[v.Cannot_create_an_instance_of_an_abstract_class=2511]="Cannot_create_an_instance_of_an_abstract_class",v[v.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_2=2515]="Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_2",v[v.Object_is_possibly_null=2531]="Object_is_possibly_null",v[v.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property=2540]="Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property",v[v.The_target_of_an_assignment_must_be_a_variable_or_a_property_access=2541]="The_target_of_an_assignment_must_be_a_variable_or_a_property_access",v[v.Index_signature_in_type_0_only_permits_reading=2542]="Index_signature_in_type_0_only_permits_reading",v[v.Expected_0_arguments_but_got_1=2554]="Expected_0_arguments_but_got_1",v[v.Expected_at_least_0_arguments_but_got_1=2555]="Expected_at_least_0_arguments_but_got_1",v[v.Expected_0_type_arguments_but_got_1=2558]="Expected_0_type_arguments_but_got_1",v[v.Property_0_has_no_initializer_and_is_not_assigned_in_the_constructor_before_this_is_used_or_returned=2564]="Property_0_has_no_initializer_and_is_not_assigned_in_the_constructor_before_this_is_used_or_returned",v[v.Property_0_is_used_before_being_assigned=2565]="Property_0_is_used_before_being_assigned",v[v._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property=2610]="_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property",v[v._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor=2611]="_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor",v[v.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums=2651]="A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums",v[v.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration=2673]="Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration",v[v.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration=2674]="Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration",v[v.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private=2675]="Cannot_extend_a_class_0_Class_constructor_is_marked_as_private",v[v.The_this_types_of_each_signature_are_incompatible=2685]="The_this_types_of_each_signature_are_incompatible",v[v.Namespace_0_has_no_exported_member_1=2694]="Namespace_0_has_no_exported_member_1",v[v.Namespace_can_only_have_declarations=2695]="Namespace_can_only_have_declarations",v[v.Required_type_parameters_may_not_follow_optional_type_parameters=2706]="Required_type_parameters_may_not_follow_optional_type_parameters",v[v.Duplicate_property_0=2718]="Duplicate_property_0",v[v.Property_0_is_missing_in_type_1_but_required_in_type_2=2741]="Property_0_is_missing_in_type_1_but_required_in_type_2",v[v.Type_0_has_no_call_signatures=2757]="Type_0_has_no_call_signatures",v[v.Get_accessor_0_must_be_at_least_as_accessible_as_the_setter=2808]="Get_accessor_0_must_be_at_least_as_accessible_as_the_setter",v[v.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0=4117]="This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0",v[v.File_0_not_found=6054]="File_0_not_found",v[v.Numeric_separators_are_not_allowed_here=6188]="Numeric_separators_are_not_allowed_here",v[v.Multiple_consecutive_numeric_separators_are_not_permitted=6189]="Multiple_consecutive_numeric_separators_are_not_permitted",v[v.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without=6234]="This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without",v[v._super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class=17009]="_super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class",v[v._super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class=17011]="_super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class",v[v.A_struct_cannot_be_both_managed_and_unmanaged=6390]="A_struct_cannot_be_both_managed_and_unmanaged",v[v.A_struct_cannot_be_both_inline_and_managed=6391]="A_struct_cannot_be_both_inline_and_managed",v[v.A_memory_model_decorator_must_precede_the_type_it_applies_to_0=6392]="A_memory_model_decorator_must_precede_the_type_it_applies_to_0",v[v.Only_one_memory_model_decorator_may_apply_to_a_use=6393]="Only_one_memory_model_decorator_may_apply_to_a_use",v[v.Type_0_has_no_GC_header_so_a_use_cannot_make_it_managed_declare_the_record_managed_instead=6394]="Type_0_has_no_GC_header_so_a_use_cannot_make_it_managed_declare_the_record_managed_instead",v[v.Type_0_is_a_value_with_no_address_so_a_use_cannot_view_it_as_1_use_the_value_or_keep_it_inline=6395]="Type_0_is_a_value_with_no_address_so_a_use_cannot_view_it_as_1_use_the_value_or_keep_it_inline",v[v.A_lazy_decorator_must_precede_the_expression_it_defers_not_follow_a_type=6396]="A_lazy_decorator_must_precede_the_expression_it_defers_not_follow_a_type",v[v._lazy_expressions_must_be_the_initializer_of_a_variable_declaration=6397]="_lazy_expressions_must_be_the_initializer_of_a_variable_declaration",v[v.A_lazy_expression_in_this_position_is_not_lowered_it_is_evaluated_eagerly=6398]="A_lazy_expression_in_this_position_is_not_lowered_it_is_evaluated_eagerly",v[v.A_lazy_await_binding_needs_a_declared_type_the_memo_cells_are_lifted_into_the_task_s_state_struct_and_a_state_field_needs_a_syntactic_type_0=6399]="A_lazy_await_binding_needs_a_declared_type_the_memo_cells_are_lifted_into_the_task_s_state_struct_and_a_state_field_needs_a_syntactic_type_0",v[v.A_lazy_await_binding_cannot_be_read_from_a_nested_function_a_capture_moves_the_storage_and_the_memo_cell_is_a_state_field_0=6400]="A_lazy_await_binding_cannot_be_read_from_a_nested_function_a_capture_moves_the_storage_and_the_memo_cell_is_a_state_field_0",v[v.A_spawn_produces_a_Task_this_one_is_never_awaited_so_the_task_s_result_is_discarded=6401]="A_spawn_produces_a_Task_this_one_is_never_awaited_so_the_task_s_result_is_discarded",v[v.An_await_forces_an_immediate_read_of_lazy_so_the_deferral_is_nullified_drop_the_lazy_or_remove_the_await=6402]="An_await_forces_an_immediate_read_of_lazy_so_the_deferral_is_nullified_drop_the_lazy_or_remove_the_await",v[v.An_enum_underlying_type_must_be_one_of_i8_u8_i16_u16_i32_or_u32_not_0=6403]="An_enum_underlying_type_must_be_one_of_i8_u8_i16_u16_i32_or_u32_not_0",v[v.Enum_member_0_does_not_fit_the_underlying_type_1=6404]="Enum_member_0_does_not_fit_the_underlying_type_1",v[v._abi_align_requires_a_single_integer_literal_argument_the_alignment_is_a_compile_time_constant_so_a_computed_value_cannot_be_read_where_the_layout_is_decided=6405]="_abi_align_requires_a_single_integer_literal_argument_the_alignment_is_a_compile_time_constant_so_a_computed_value_cannot_be_read_where_the_layout_is_decided",v[v._abi_align_0_the_alignment_must_be_at_least_1=6406]="_abi_align_0_the_alignment_must_be_at_least_1",v[v._abi_align_0_the_alignment_must_be_a_power_of_two=6407]="_abi_align_0_the_alignment_must_be_a_power_of_two",v[v._abi_align_0_is_less_than_the_field_type_s_natural_alignment_1_asking_for_less_is_a_lie_so_it_is_refused_rather_than_silently_ignored=6408]="_abi_align_0_is_less_than_the_field_type_s_natural_alignment_1_asking_for_less_is_a_lie_so_it_is_refused_rather_than_silently_ignored",v[v._abi_align_0_is_too_large_the_maximum_is_1=6409]="_abi_align_0_is_too_large_the_maximum_is_1",v[v.Alignment_is_a_property_of_the_field_not_its_type_Place_abi_align_N_on_the_field_declaration=6410]="Alignment_is_a_property_of_the_field_not_its_type_Place_abi_align_N_on_the_field_declaration",v[v.A_view_parameter_unmanaged_0_over_an_inline_type_cannot_appear_in_a_host_visible_signature_an_external_or_exported_parameter_is_supplied_by_the_host_and_a_view_is_an_address_this_compiler_did_not_materialise=6411]="A_view_parameter_unmanaged_0_over_an_inline_type_cannot_appear_in_a_host_visible_signature_an_external_or_exported_parameter_is_supplied_by_the_host_and_a_view_is_an_address_this_compiler_did_not_materialise",v[v.Call_to_0_emits_1_operands_but_its_signature_declares_2=6412]="Call_to_0_emits_1_operands_but_its_signature_declares_2",v))(Xe||{});function al(n){switch(n){case 100:return"Not implemented: {0}";case 101:return"Operation is unsafe.";case 102:return"User-defined: {0}";case 103:return"Feature '{0}' is not enabled.";case 104:return"Low memory limit exceeded by static data: {0} > {1}";case 105:return"Module requires at least '{0}' pages of initial memory.";case 106:return"Module requires at least '{0}' pages of maximum memory.";case 107:return"Shared memory requires maximum memory to be defined.";case 108:return"Shared memory requires feature 'threads' to be enabled.";case 109:return"Transform '{0}': {1}";case 110:return"Start function name '{0}' is invalid or conflicts with another export.";case 111:return"Element '{0}' not found.";case 112:return"Exchange of '{0}' values is not supported by all embeddings";case 200:return"Conversion from type '{0}' to '{1}' requires an explicit cast.";case 201:return"Conversion from type '{0}' to '{1}' will require an explicit cast when switching between 32/64-bit.";case 202:return"Type '{0}' cannot be changed to type '{1}'.";case 203:return"Operation '{0}' cannot be applied to type '{1}'.";case 204:return"Type '{0}' cannot be nullable.";case 206:return"Mutable value cannot be inlined.";case 207:return"Unmanaged classes cannot extend managed classes and vice-versa.";case 208:return"Unmanaged classes cannot implement interfaces.";case 209:return"Invalid regular expression flags.";case 210:return"Expression is never 'null'.";case 211:return"Class '{0}' is final and cannot be extended.";case 212:return"Decorator '{0}' is not valid here.";case 213:return"Duplicate decorator.";case 214:return"Type '{0}' is illegal in this context.";case 215:return"Optional parameter must have an initializer.";case 216:return"Class '{0}' cannot declare a constructor when instantiated from an object literal.";case 217:return"Function '{0}' cannot be inlined into itself.";case 218:return"Cannot access method '{0}' without calling it as it requires 'this' to be set.";case 219:return"Optional properties are not supported.";case 220:return"Expression must be a compile-time constant.";case 221:return"Type '{0}' is not a function index or function reference.";case 222:return"'{0}' must be a value between '{1}' and '{2}' inclusive.";case 223:return"'{0}' must be a power of two.";case 224:return"'{0}' is not a valid operator.";case 225:return"Expression cannot be represented by a type.";case 226:return"Expression resolves to unusual type '{0}'.";case 227:return"Array literal expected.";case 228:return"Function '{0}' is virtual and will not be inlined.";case 229:return"Property '{0}' only has a setter and is missing a getter.";case 230:return"'{0}' keyword cannot be used here.";case 231:return"A class with a constructor explicitly returning something else than 'this' must be '@final'.";case 233:return"Property '{0}' is always assigned before being used.";case 234:return"Expression does not compile to a value at runtime.";case 235:return"Only variables, functions and enums become WebAssembly module exports.";case 236:return"Literal '{0}' does not fit into 'i64' or 'u64' types.";case 237:return"Index signature accessors in type '{0}' differ in types.";case 238:return"Initializer, definitive assignment or nullable type expected.";case 239:return"Definitive assignment has no effect on local variables.";case 240:return"Ambiguous operator overload '{0}' (conflicting overloads '{1}' and '{2}').";case 241:return"An interface or abstract method '{0}' cannot have type parameters.";case 242:return"Cannot override generic method '{0}' with a non-generic method or vice versa.";case 901:return"Importing the table disables some indirect call optimizations.";case 902:return"Exporting the table disables some indirect call optimizations.";case 903:return"Expression compiles to a dynamic check at runtime.";case 904:return"Indexed access may involve bounds checking.";case 905:return"Explicitly returning constructor drops 'this' allocation.";case 906:return"Unnecessary definite assignment.";case 907:return"'NaN' does not compare equal to any other value including itself. Use isNaN(x) instead.";case 908:return"Comparison with -0.0 is sign insensitive. Use Object.is(x, -0.0) if the sign matters.";case 1002:return"Unterminated string literal.";case 1003:return"Identifier expected.";case 1005:return"'{0}' expected.";case 1006:return"A file cannot have a reference to itself.";case 1009:return"Trailing comma not allowed.";case 1012:return"Unexpected token.";case 1014:return"A rest parameter must be last in a parameter list.";case 1015:return"Parameter cannot have question mark and initializer.";case 1016:return"A required parameter cannot follow an optional parameter.";case 1031:return"'{0}' modifier cannot appear on class elements of this kind.";case 1036:return"Statements are not allowed in ambient contexts.";case 1039:return"Initializers are not allowed in ambient contexts.";case 1042:return"'{0}' modifier cannot be used here.";case 1047:return"A rest parameter cannot be optional.";case 1048:return"A rest parameter cannot have an initializer.";case 1049:return"A 'set' accessor must have exactly one parameter.";case 1052:return"A 'set' accessor parameter cannot have an initializer.";case 1054:return"A 'get' accessor cannot have parameters.";case 1061:return"Enum member must have initializer.";case 1092:return"Type parameters cannot appear on a constructor declaration.";case 1093:return"Type annotation cannot appear on a constructor declaration.";case 1094:return"An accessor cannot have type parameters.";case 1095:return"A 'set' accessor cannot have a return type annotation.";case 1098:return"Type parameter list cannot be empty.";case 1099:return"Type argument list cannot be empty.";case 1104:return"A 'continue' statement can only be used within an enclosing iteration statement.";case 1105:return"A 'break' statement can only be used within an enclosing iteration or switch statement.";case 1108:return"A 'return' statement can only be used within a function body.";case 1109:return"Expression expected.";case 1110:return"Type expected.";case 1113:return"A 'default' clause cannot appear more than once in a 'switch' statement.";case 1114:return"Duplicate label '{0}'.";case 1120:return"An export assignment cannot have modifiers.";case 1121:return"Octal literals are not allowed in strict mode.";case 1124:return"Digit expected.";case 1125:return"Hexadecimal digit expected.";case 1126:return"Unexpected end of text.";case 1127:return"Invalid character.";case 1130:return"'case' or 'default' expected.";case 1034:return"'super' must be followed by an argument list or member access.";case 1038:return"A 'declare' modifier cannot be used in an already ambient context.";case 1140:return"Type argument expected.";case 1141:return"String literal expected.";case 1142:return"Line break not permitted here.";case 1146:return"Declaration expected.";case 1155:return"'const' declarations must be initialized.";case 1161:return"Unterminated regular expression literal.";case 1263:return"Declarations with initializers cannot also have definite assignment assertions.";case 1176:return"Interface declaration cannot have 'implements' clause.";case 1177:return"Binary digit expected.";case 1178:return"Octal digit expected.";case 1183:return"An implementation cannot be declared in ambient contexts.";case 1190:return"The variable declaration of a 'for...of' statement cannot have an initializer.";case 1198:return"An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.";case 1199:return"Unterminated Unicode escape sequence.";case 1206:return"Decorators are not valid here.";case 1242:return"'abstract' modifier can only appear on a class, method, or property declaration.";case 1245:return"Method '{0}' cannot have an implementation because it is marked abstract.";case 1246:return"An interface property cannot have an initializer.";case 1255:return"A definite assignment assertion '!' is not permitted in this context.";case 1308:return"'await' expressions are only allowed within async functions and at the top levels of modules.";case 1311:return"A class may only extend another class.";case 1317:return"A parameter property cannot be declared using a rest parameter.";case 1319:return"A default export can only be used in a module.";case 1345:return"An expression of type '{0}' cannot be tested for truthiness.";case 1351:return"An identifier or keyword cannot immediately follow a numeric literal.";case 2300:return"Duplicate identifier '{0}'.";case 2304:return"Cannot find name '{0}'.";case 2305:return"Module '{0}' has no exported member '{1}'.";case 2312:return"An interface can only extend an interface.";case 2314:return"Generic type '{0}' requires {1} type argument(s).";case 2315:return"Type '{0}' is not generic.";case 2322:return"Type '{0}' is not assignable to type '{1}'.";case 2325:return"Property '{0}' is private in type '{1}' but not in type '{2}'.";case 2329:return"Index signature is missing in type '{0}'.";case 2332:return"'this' cannot be referenced in current location.";case 2333:return"'this' cannot be referenced in constructor arguments.";case 2335:return"'super' can only be referenced in a derived class.";case 2336:return"'super' cannot be referenced in constructor arguments.";case 2337:return"Super calls are not permitted outside constructors or in nested functions inside constructors.";case 2339:return"Property '{0}' does not exist on type '{1}'.";case 2341:return"Property '{0}' is private and only accessible within class '{1}'.";case 2349:return"Cannot invoke an expression whose type lacks a call signature. Type '{0}' has no compatible call signatures.";case 2351:return"This expression is not constructable.";case 2355:return"A function whose declared type is not 'void' must return a value.";case 2357:return"The operand of an increment or decrement operator must be a variable or a property access.";case 2364:return"The left-hand side of an assignment expression must be a variable or a property access.";case 2365:return"Operator '{0}' cannot be applied to types '{1}' and '{2}'.";case 2376:return"A 'super' call must be the first statement in the constructor.";case 2377:return"Constructors for derived classes must contain a 'super' call.";case 2380:return"'get' and 'set' accessor must have the same type.";case 2385:return"Overload signatures must all be public, private or protected.";case 2390:return"Constructor implementation is missing.";case 2391:return"Function implementation is missing or not immediately following the declaration.";case 2392:return"Multiple constructor implementations are not allowed.";case 2393:return"Duplicate function implementation.";case 2394:return"This overload signature is not compatible with its implementation signature.";case 2395:return"Individual declarations in merged declaration '{0}' must be all exported or all local.";case 2416:return"Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'.";case 2422:return"A class can only implement an interface.";case 2434:return"A namespace declaration cannot be located prior to a class or function with which it is merged.";case 2442:return"Types have separate declarations of a private property '{0}'.";case 2444:return"Property '{0}' is protected in type '{1}' but public in type '{2}'.";case 2445:return"Property '{0}' is protected and only accessible within class '{1}' and its subclasses.";case 2448:return"Variable '{0}' used before its declaration.";case 2451:return"Cannot redeclare block-scoped variable '{0}'";case 2453:return"The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly.";case 2454:return"Variable '{0}' is used before being assigned.";case 2456:return"Type alias '{0}' circularly references itself.";case 2460:return"Type '{0}' has no property '{1}'.";case 2469:return"The '{0}' operator cannot be applied to type '{1}'.";case 2474:return"In 'const' enum declarations member initializer must be constant expression.";case 2476:return"A const enum member can only be accessed using a string literal.";case 2484:return"Export declaration conflicts with exported declaration of '{0}'.";case 2506:return"'{0}' is referenced directly or indirectly in its own base expression.";case 2511:return"Cannot create an instance of an abstract class.";case 2515:return"Non-abstract class '{0}' does not implement inherited abstract member '{1}' from '{2}'.";case 2531:return"Object is possibly 'null'.";case 2540:return"Cannot assign to '{0}' because it is a constant or a read-only property.";case 2541:return"The target of an assignment must be a variable or a property access.";case 2542:return"Index signature in type '{0}' only permits reading.";case 2554:return"Expected {0} arguments, but got {1}.";case 2555:return"Expected at least {0} arguments, but got {1}.";case 2558:return"Expected {0} type arguments, but got {1}.";case 2564:return"Property '{0}' has no initializer and is not assigned in the constructor before 'this' is used or returned.";case 2565:return"Property '{0}' is used before being assigned.";case 2610:return"'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property.";case 2611:return"'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor.";case 2651:return"A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums.";case 2673:return"Constructor of class '{0}' is private and only accessible within the class declaration.";case 2674:return"Constructor of class '{0}' is protected and only accessible within the class declaration.";case 2675:return"Cannot extend a class '{0}'. Class constructor is marked as private.";case 2685:return"The 'this' types of each signature are incompatible.";case 2694:return"Namespace '{0}' has no exported member '{1}'.";case 2695:return"Namespace can only have declarations.";case 2706:return"Required type parameters may not follow optional type parameters.";case 2718:return"Duplicate property '{0}'.";case 2741:return"Property '{0}' is missing in type '{1}' but required in type '{2}'.";case 2757:return"Type '{0}' has no call signatures.";case 2808:return"Get accessor '{0}' must be at least as accessible as the setter.";case 4117:return"This member cannot have an 'override' modifier because it is not declared in the base class '{0}'.";case 6054:return"File '{0}' not found.";case 6188:return"Numeric separators are not allowed here.";case 6189:return"Multiple consecutive numeric separators are not permitted.";case 6234:return"This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?";case 17009:return"'super' must be called before accessing 'this' in the constructor of a derived class.";case 17011:return"'super' must be called before accessing a property of 'super' in the constructor of a derived class.";case 6390:return"A struct cannot be both '@managed' and '@unmanaged'.";case 6391:return"A struct cannot be both '@inline' and '@managed'.";case 6392:return"A memory-model decorator must precede the type it applies to: '{0}'.";case 6393:return"Only one memory-model decorator may apply to a use.";case 6394:return"Type '{0}' has no GC header, so a use cannot make it '@managed'; declare the record '@managed' instead.";case 6395:return"Type '{0}' is a value with no address, so a use cannot view it as '{1}'; use the value, or keep it '@inline'.";case 6396:return"A '@lazy' decorator must precede the expression it defers, not follow a type.";case 6397:return"'@lazy' expressions must be the initializer of a variable declaration.";case 6398:return"A '@lazy' expression in this position is not lowered; it is evaluated eagerly.";case 6399:return"A '@lazy await' binding needs a declared type: the memo cells are lifted into the task's state struct, and a state field needs a syntactic type ('{0}').";case 6400:return"A '@lazy await' binding cannot be read from a nested function: a capture moves the storage, and the memo cell is a state field ('{0}').";case 6401:return"A 'spawn' produces a Task; this one is never awaited, so the task's result is discarded.";case 6402:return"An 'await' forces an immediate read of '@lazy', so the deferral is nullified; drop the '@lazy', or remove the 'await'.";case 6403:return"An enum underlying type must be one of i8, u8, i16, u16, i32 or u32, not '{0}'.";case 6404:return"Enum member '{0}' does not fit the underlying type '{1}'.";case 6405:return"'@abi.align' requires a single integer literal argument; the alignment is a compile-time constant, so a computed value cannot be read where the layout is decided.";case 6406:return"'@abi.align({0})': the alignment must be at least 1.";case 6407:return"'@abi.align({0})': the alignment must be a power of two.";case 6408:return"'@abi.align({0})' is less than the field type's natural alignment ({1}); asking for less is a lie, so it is refused rather than silently ignored.";case 6409:return"'@abi.align({0})' is too large; the maximum is {1}.";case 6410:return"Alignment is a property of the field, not its type. Place '@abi.align(N)' on the field declaration.";case 6411:return"A view parameter ('@unmanaged {0}' over an inline type) cannot appear in a host-visible signature: an '@external' or exported parameter is supplied by the host, and a view is an address this compiler did not materialise.";case 6412:return"Call to '{0}' emits {1} operands but its signature declares {2}.";default:return""}}var Xp={};zu(Xp,{BitSet:()=>Vp,COLOR_BLUE:()=>l1,COLOR_CYAN:()=>Hp,COLOR_GRAY:()=>s1,COLOR_GREEN:()=>a1,COLOR_MAGENTA:()=>Kp,COLOR_RED:()=>dl,COLOR_RESET:()=>as,COLOR_WHITE:()=>o1,COLOR_YELLOW:()=>Wp,CharCode:()=>yt,SURROGATE_HIGH:()=>ns,SURROGATE_LOW:()=>Kn,accuratePow64:()=>ol,cloneMap:()=>me,colorize:()=>u1,combineSurrogates:()=>is,dirname:()=>Mb,escapeString:()=>Re,getMapEntry:()=>J,indent:()=>W,isAlpha:()=>qp,isAlphaOrDecimal:()=>Bb,isColorsEnabled:()=>Xn,isDecimal:()=>gt,isHexBase:()=>ss,isHexOrDecimal:()=>XE,isHighSurrogate:()=>Hn,isIdentifier:()=>$e,isIdentifierPart:()=>Qn,isIdentifierStart:()=>jn,isLineBreak:()=>Ht,isLowSurrogate:()=>cl,isOctal:()=>pl,isPowerOf2:()=>Hr,isSurrogate:()=>HE,isSurrogateHigh:()=>jE,isSurrogateLow:()=>QE,isWhiteSpace:()=>rs,mergeMaps:()=>KE,normalizePath:()=>Xr,numCodeUnits:()=>jr,readF32:()=>OE,readF64:()=>qE,readI16:()=>VE,readI32:()=>qn,readI64:()=>Nb,readI8:()=>UE,readV128:()=>WE,resolvePath:()=>fl,setColorsEnabled:()=>hl,v128_ones:()=>Qp,v128_zero:()=>jp,writeF32:()=>Wr,writeF64:()=>Kr,writeI16:()=>br,writeI32:()=>Se,writeI32AsI64:()=>ll,writeI64:()=>Wn,writeI64AsI32:()=>Gp,writeI8:()=>be,writeV128:()=>Up});function UE(n,r){return n[r]}function be(n,r,e){r[e]=n}function VE(n,r){return i32(n[r])|i32(n[r+1])<<8}function br(n,r,e){r[e]=n,r[e+1]=n>>>8}function qn(n,r){return i32(n[r])|i32(n[r+1])<<8|i32(n[r+2])<<16|i32(n[r+3])<<24}function Se(n,r,e){r[e]=n,r[e+1]=n>>>8,r[e+2]=n>>>16,r[e+3]=n>>>24}function ll(n,r,e,t=!1){Se(n,r,e),Se(t||n>=0?0:-1,r,e+4)}function Nb(n,r){let e=qn(n,r),t=qn(n,r+4);return i64_new(e,t)}function Wn(n,r,e){Se(i64_low(n),r,e),Se(i64_high(n),r,e+4)}function Gp(n,r,e,t=!1){assert(t?i64_is_u32(n):i64_is_i32(n)),Se(i64_low(n),r,e)}function OE(n,r){return i32_as_f32(qn(n,r))}function Wr(n,r,e){Se(f32_as_i32(n),r,e)}function qE(n,r){return i64_as_f64(Nb(n,r))}function Kr(n,r,e){let t=f64_as_i64(n);Se(i64_low(t),r,e),Se(i64_high(t),r,e+4)}function WE(n,r){return n.slice(r,r+16)}function Up(n,r,e){assert(n.length==16),r.set(n,e)}function J(n,r){return n.has(r)?n.get(r):null}function me(n){if(ASC_TARGET){let r=new Map;if(n)for(let e=Map_keys(n),t=0,i=e.length;t<i;++t){let s=unchecked(e[t]),a=assert(n.get(s));r.set(s,a)}return r}else return new Map(n)}function KE(n,r){if(ASC_TARGET){let e=new Map;for(let t=Map_keys(n),i=0,s=t.length;i<s;++i){let a=unchecked(t[i]),l=assert(n.get(a));e.set(a,l)}for(let t=Map_keys(r),i=0,s=t.length;i<s;++i){let a=unchecked(t[i]),l=assert(r.get(a));e.set(a,l)}return e}else{let e=new Map(n);return r.forEach((t,i)=>e.set(i,t)),e}}var Vp=class{constructor(){this.clear()}get size(){let r=0,e=this.words;for(let t=0,i=e.length;t<i;t++){let s=unchecked(e[t]);s&&(r+=popcnt(s))}return r}add(r){let e=r>>>5,t=this.words;return e>=t.length&&(this.words=new Uint32Array(e+16),this.words.set(t),t=this.words),unchecked(t[e]|=1<<r),this}delete(r){let e=r>>>5,t=this.words;e>=t.length||unchecked(t[e]&=~(1<<r))}has(r){let e=r>>>5,t=this.words;return e>=t.length?!1:(unchecked(t[r>>>5])&1<<r)!==0}clear(){this.words=new Uint32Array(16)}toArray(){let r=new Array(this.size);for(let e=0,t=0,i=this.words.length;e<i;++e){let s=unchecked(this.words[e]);for(;s;){let a=s&-s;unchecked(r[t++]=(e<<5)+popcnt(a-1)),s^=a}}return r}toString(){return`BitSet { ${this.toArray()} }`}};function Hr(n){return n!=0&&(n&n-1)==0}function ol(n,r){return ASC_TARGET?Math.pow(n,r):f64_pow(n,r)}var yt=(T=>(T[T.Null=0]="Null",T[T.LineFeed=10]="LineFeed",T[T.CarriageReturn=13]="CarriageReturn",T[T.LineSeparator=8232]="LineSeparator",T[T.ParagraphSeparator=8233]="ParagraphSeparator",T[T.NextLine=133]="NextLine",T[T.Space=32]="Space",T[T.NonBreakingSpace=160]="NonBreakingSpace",T[T.EnQuad=8192]="EnQuad",T[T.EmQuad=8193]="EmQuad",T[T.EnSpace=8194]="EnSpace",T[T.EmSpace=8195]="EmSpace",T[T.ThreePerEmSpace=8196]="ThreePerEmSpace",T[T.FourPerEmSpace=8197]="FourPerEmSpace",T[T.SixPerEmSpace=8198]="SixPerEmSpace",T[T.FigureSpace=8199]="FigureSpace",T[T.PunctuationSpace=8200]="PunctuationSpace",T[T.ThinSpace=8201]="ThinSpace",T[T.HairSpace=8202]="HairSpace",T[T.ZeroWidthSpace=8203]="ZeroWidthSpace",T[T.NarrowNoBreakSpace=8239]="NarrowNoBreakSpace",T[T.IdeographicSpace=12288]="IdeographicSpace",T[T.MathematicalSpace=8287]="MathematicalSpace",T[T.Ogham=5760]="Ogham",T[T._=95]="_",T[T._0=48]="_0",T[T._1=49]="_1",T[T._2=50]="_2",T[T._3=51]="_3",T[T._4=52]="_4",T[T._5=53]="_5",T[T._6=54]="_6",T[T._7=55]="_7",T[T._8=56]="_8",T[T._9=57]="_9",T[T.a=97]="a",T[T.b=98]="b",T[T.c=99]="c",T[T.d=100]="d",T[T.e=101]="e",T[T.f=102]="f",T[T.g=103]="g",T[T.h=104]="h",T[T.i=105]="i",T[T.j=106]="j",T[T.k=107]="k",T[T.l=108]="l",T[T.m=109]="m",T[T.n=110]="n",T[T.o=111]="o",T[T.p=112]="p",T[T.q=113]="q",T[T.r=114]="r",T[T.s=115]="s",T[T.t=116]="t",T[T.u=117]="u",T[T.v=118]="v",T[T.w=119]="w",T[T.x=120]="x",T[T.y=121]="y",T[T.z=122]="z",T[T.A=65]="A",T[T.B=66]="B",T[T.C=67]="C",T[T.D=68]="D",T[T.E=69]="E",T[T.F=70]="F",T[T.G=71]="G",T[T.H=72]="H",T[T.I=73]="I",T[T.J=74]="J",T[T.K=75]="K",T[T.L=76]="L",T[T.M=77]="M",T[T.N=78]="N",T[T.O=79]="O",T[T.P=80]="P",T[T.Q=81]="Q",T[T.R=82]="R",T[T.S=83]="S",T[T.T=84]="T",T[T.U=85]="U",T[T.V=86]="V",T[T.W=87]="W",T[T.X=88]="X",T[T.Y=89]="Y",T[T.Z=90]="Z",T[T.Ampersand=38]="Ampersand",T[T.Asterisk=42]="Asterisk",T[T.At=64]="At",T[T.Backslash=92]="Backslash",T[T.Backtick=96]="Backtick",T[T.Bar=124]="Bar",T[T.Caret=94]="Caret",T[T.CloseBrace=125]="CloseBrace",T[T.CloseBracket=93]="CloseBracket",T[T.CloseParen=41]="CloseParen",T[T.Colon=58]="Colon",T[T.Comma=44]="Comma",T[T.Dollar=36]="Dollar",T[T.Dot=46]="Dot",T[T.DoubleQuote=34]="DoubleQuote",T[T.Equals=61]="Equals",T[T.Exclamation=33]="Exclamation",T[T.GreaterThan=62]="GreaterThan",T[T.Hash=35]="Hash",T[T.LessThan=60]="LessThan",T[T.Minus=45]="Minus",T[T.OpenBrace=123]="OpenBrace",T[T.OpenBracket=91]="OpenBracket",T[T.OpenParen=40]="OpenParen",T[T.Percent=37]="Percent",T[T.Plus=43]="Plus",T[T.Question=63]="Question",T[T.Semicolon=59]="Semicolon",T[T.SingleQuote=39]="SingleQuote",T[T.Slash=47]="Slash",T[T.Tilde=126]="Tilde",T[T.Backspace=8]="Backspace",T[T.FormFeed=12]="FormFeed",T[T.ByteOrderMark=65279]="ByteOrderMark",T[T.Tab=9]="Tab",T[T.VerticalTab=11]="VerticalTab",T))(yt||{});function Ht(n){switch(n){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function rs(n){switch(n){case 32:case 9:case 11:case 12:case 160:case 133:case 5760:case 8239:case 8287:case 12288:case 65279:return!0;default:return n>=8192&&n<=8203}}var ns=55296,Kn=56320;function HE(n){return(n&63488)==ns}function jE(n){return n<Kn}function QE(n){return n>=Kn}function Hn(n){return(n&64512)==ns}function cl(n){return(n&64512)==Kn}function is(n,r){return 65536+((n&1023)<<10)|r&1023}function jr(n){return 1+i32(n>65535)}function qp(n){let r=n|32;return r>=97&&r<=122}function gt(n){return n>=48&&n<=57}function pl(n){return n>=48&&n<=55}function ss(n){let r=n|32;return r>=97&&r<=102}function XE(n){return gt(n)||ss(n)}function Bb(n){return qp(n)||gt(n)}function jn(n){return qp(n)||n==95||n==36||n>=ZE&&n<=YE&&Lb(n,$E)}function Qn(n){return Bb(n)||n==95||n==36||n>=e1&&n<=t1&&Lb(n,JE)}function $e(n){let r=n.length;if(!r)return!1;let e=n.codePointAt(0);if(!jn(e))return!1;let t=jr(e);for(;t<r;){if(e=n.codePointAt(t),!Qn(e))return!1;t+=jr(e)}return!0}var $E=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,895,895,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1327,1329,1366,1369,1369,1376,1416,1488,1514,1519,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2144,2154,2160,2183,2185,2191,2208,2249,2308,2361,2365,2365,2384,2384,2392,2401,2417,2432,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2556,2556,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2809,2809,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3129,3133,3133,3160,3162,3164,3165,3168,3169,3200,3200,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3292,3294,3296,3297,3313,3314,3332,3340,3342,3344,3346,3386,3389,3389,3406,3406,3412,3414,3423,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5905,5919,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6264,6272,6312,6314,6314,6320,6389,6400,6430,6480,6509,6512,6516,6528,6571,6576,6601,6656,6678,6688,6740,6823,6823,6917,6963,6981,6988,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7296,7306,7312,7354,7357,7359,7401,7404,7406,7411,7413,7414,7418,7418,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12443,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12735,12784,12799,13312,19903,19968,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42653,42656,42735,42775,42783,42786,42888,42891,42972,42993,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43261,43262,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43488,43492,43494,43503,43514,43518,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43646,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43881,43888,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66176,66204,66208,66256,66304,66335,66349,66378,66384,66421,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66736,66771,66776,66811,66816,66855,66864,66915,66928,66938,66940,66954,66956,66962,66964,66965,66967,66977,66979,66993,66995,67001,67003,67004,67008,67059,67072,67382,67392,67413,67424,67431,67456,67461,67463,67504,67506,67514,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67904,67929,67968,68023,68030,68031,68096,68096,68112,68115,68117,68119,68121,68149,68192,68220,68224,68252,68288,68295,68297,68324,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68899,68938,68965,68975,68997,69248,69289,69296,69297,69314,69319,69376,69404,69415,69415,69424,69445,69488,69505,69552,69572,69600,69622,69635,69687,69745,69746,69749,69749,69763,69807,69840,69864,69891,69926,69956,69956,69959,69959,69968,70002,70006,70006,70019,70066,70081,70084,70106,70106,70108,70108,70144,70161,70163,70187,70207,70208,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70366,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70461,70461,70480,70480,70493,70497,70528,70537,70539,70539,70542,70542,70544,70581,70583,70583,70609,70609,70611,70611,70656,70708,70727,70730,70751,70753,70784,70831,70852,70853,70855,70855,71040,71086,71128,71131,71168,71215,71236,71236,71296,71338,71352,71352,71424,71450,71488,71494,71680,71723,71840,71903,71935,71942,71945,71945,71948,71955,71957,71958,71960,71983,71999,71999,72001,72001,72096,72103,72106,72144,72161,72161,72163,72163,72192,72192,72203,72242,72250,72250,72272,72272,72284,72329,72349,72349,72368,72440,72640,72672,72704,72712,72714,72750,72768,72768,72818,72847,72960,72966,72968,72969,72971,73008,73030,73030,73056,73061,73063,73064,73066,73097,73112,73112,73136,73179,73440,73458,73474,73474,73476,73488,73490,73523,73648,73648,73728,74649,74752,74862,74880,75075,77712,77808,77824,78895,78913,78918,78944,82938,82944,83526,90368,90397,92160,92728,92736,92766,92784,92862,92880,92909,92928,92975,92992,92995,93027,93047,93053,93071,93504,93548,93760,93823,93856,93880,93883,93907,93952,94026,94032,94032,94099,94111,94176,94177,94179,94179,94194,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,122624,122654,122661,122666,122928,122989,123136,123180,123191,123197,123214,123214,123536,123565,123584,123627,124112,124139,124368,124397,124400,124400,124608,124638,124640,124642,124644,124645,124647,124653,124656,124660,124670,124671,124896,124902,124904,124907,124909,124910,124912,124926,124928,125124,125184,125251,125259,125259,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173791,173824,178205,178208,183981,183984,191456,191472,192093,194560,195101,196608,201546,201552,210041],ZE=170,YE=210041,JE=[170,170,181,181,183,183,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,895,895,902,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1327,1329,1366,1369,1369,1376,1416,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1519,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2045,2045,2048,2093,2112,2139,2144,2154,2160,2183,2185,2191,2199,2273,2275,2403,2406,2415,2417,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2556,2556,2558,2558,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2809,2815,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2901,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3072,3084,3086,3088,3090,3112,3114,3129,3132,3140,3142,3144,3146,3149,3157,3158,3160,3162,3164,3165,3168,3171,3174,3183,3200,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3292,3294,3296,3299,3302,3311,3313,3315,3328,3340,3342,3344,3346,3396,3398,3400,3402,3406,3412,3415,3423,3427,3430,3439,3450,3455,3457,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3558,3567,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3773,3776,3780,3782,3782,3784,3790,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4969,4977,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5909,5919,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6159,6169,6176,6264,6272,6314,6320,6389,6400,6430,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6618,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6832,6845,6847,6877,6880,6891,6912,6988,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7296,7306,7312,7354,7357,7359,7376,7378,7380,7418,7424,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12447,12449,12543,12549,12591,12593,12686,12704,12735,12784,12799,13312,19903,19968,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42737,42775,42783,42786,42888,42891,42972,42993,43047,43052,43052,43072,43123,43136,43205,43216,43225,43232,43255,43259,43259,43261,43309,43312,43347,43360,43388,43392,43456,43471,43481,43488,43518,43520,43574,43584,43597,43600,43609,43616,43638,43642,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43881,43888,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65071,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65381,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66045,66045,66176,66204,66208,66256,66272,66272,66304,66335,66349,66378,66384,66426,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66720,66729,66736,66771,66776,66811,66816,66855,66864,66915,66928,66938,66940,66954,66956,66962,66964,66965,66967,66977,66979,66993,66995,67001,67003,67004,67008,67059,67072,67382,67392,67413,67424,67431,67456,67461,67463,67504,67506,67514,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67904,67929,67968,68023,68030,68031,68096,68099,68101,68102,68108,68115,68117,68119,68121,68149,68152,68154,68159,68159,68192,68220,68224,68252,68288,68295,68297,68326,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68903,68912,68921,68928,68965,68969,68973,68975,68997,69248,69289,69291,69292,69296,69297,69314,69319,69370,69404,69415,69415,69424,69456,69488,69509,69552,69572,69600,69622,69632,69702,69734,69749,69759,69818,69826,69826,69840,69864,69872,69881,69888,69940,69942,69951,69956,69959,69968,70003,70006,70006,70016,70084,70089,70092,70094,70106,70108,70108,70144,70161,70163,70199,70206,70209,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70378,70384,70393,70400,70403,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70459,70468,70471,70472,70475,70477,70480,70480,70487,70487,70493,70499,70502,70508,70512,70516,70528,70537,70539,70539,70542,70542,70544,70581,70583,70592,70594,70594,70597,70597,70599,70602,70604,70611,70625,70626,70656,70730,70736,70745,70750,70753,70784,70853,70855,70855,70864,70873,71040,71093,71096,71104,71128,71133,71168,71232,71236,71236,71248,71257,71296,71352,71360,71369,71376,71395,71424,71450,71453,71467,71472,71481,71488,71494,71680,71738,71840,71913,71935,71942,71945,71945,71948,71955,71957,71958,71960,71989,71991,71992,71995,72003,72016,72025,72096,72103,72106,72151,72154,72161,72163,72164,72192,72254,72263,72263,72272,72345,72349,72349,72368,72440,72544,72551,72640,72672,72688,72697,72704,72712,72714,72758,72760,72768,72784,72793,72818,72847,72850,72871,72873,72886,72960,72966,72968,72969,72971,73014,73018,73018,73020,73021,73023,73031,73040,73049,73056,73061,73063,73064,73066,73102,73104,73105,73107,73112,73120,73129,73136,73179,73184,73193,73440,73462,73472,73488,73490,73530,73534,73538,73552,73562,73648,73648,73728,74649,74752,74862,74880,75075,77712,77808,77824,78895,78912,78933,78944,82938,82944,83526,90368,90425,92160,92728,92736,92766,92768,92777,92784,92862,92864,92873,92880,92909,92912,92916,92928,92982,92992,92995,93008,93017,93027,93047,93053,93071,93504,93548,93552,93561,93760,93823,93856,93880,93883,93907,93952,94026,94031,94087,94095,94111,94176,94177,94179,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,113821,113822,118e3,118009,118528,118573,118576,118598,119141,119145,119149,119154,119163,119170,119173,119179,119210,119213,119362,119364,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,120782,120831,121344,121398,121403,121452,121461,121461,121476,121476,121499,121503,121505,121519,122624,122654,122661,122666,122880,122886,122888,122904,122907,122913,122915,122916,122918,122922,122928,122989,123023,123023,123136,123180,123184,123197,123200,123209,123214,123214,123536,123566,123584,123641,124112,124153,124368,124410,124608,124638,124640,124661,124670,124671,124896,124902,124904,124907,124909,124910,124912,124926,124928,125124,125136,125142,125184,125259,125264,125273,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,130032,130041,131072,173791,173824,178205,178208,183981,183984,191456,191472,192093,194560,195101,196608,201546,201552,210041,917760,917999],e1=170,t1=917999;function Lb(n,r){let e=0,t=r.length;for(;e+1<t;){let i=e+(t-e>>>1);i-=i&1;let s=r[i];if(s<=n&&n<=r[i+1])return!0;n<s?t=i:e=i+2}return!1}var Op=" ",r1=" ",n1=" ",i1=" ",ul=new Map;function W(n,r){if(r<=4)switch(r){case 1:n.push(Op);break;case 2:n.push(r1);break;case 3:n.push(n1);break;case 4:n.push(i1);break}else{let e;ul.size<=1024?ul.has(r)?e=assert(ul.get(r)):ul.set(r,e=Op.repeat(r)):e=Op.repeat(r),n.push(e)}}function Re(n,r){let e=new Array,t=0,i=0;for(let s=n.length;i<s;)switch(n.charCodeAt(i)){case 0:{i>t&&e.push(n.substring(t,t=i+1)),e.push("\\0"),t=++i;break}case 8:{i>t&&e.push(n.substring(t,i)),t=++i,e.push("\\b");break}case 9:{i>t&&e.push(n.substring(t,i)),t=++i,e.push("\\t");break}case 10:{i>t&&e.push(n.substring(t,i)),t=++i,e.push("\\n");break}case 11:{i>t&&e.push(n.substring(t,i)),t=++i,e.push("\\v");break}case 12:{i>t&&e.push(n.substring(t,i)),t=++i,e.push("\\f");break}case 13:{i>t&&e.push(n.substring(t,i)),e.push("\\r"),t=++i;break}case 34:{r==34?(i>t&&e.push(n.substring(t,i)),e.push('\\"'),t=++i):++i;break}case 39:{r==39?(i>t&&e.push(n.substring(t,i)),e.push("\\'"),t=++i):++i;break}case 92:{i>t&&e.push(n.substring(t,i)),e.push("\\\\"),t=++i;break}case 96:{r==96?(i>t&&e.push(n.substring(t,i)),e.push("\\`"),t=++i):++i;break}default:{++i;break}}return i>t&&e.push(n.substring(t,i)),e.join("")}var Qr=47;function Xr(n){let r=0,e=n.length;for(;r+1<e&&n.charCodeAt(r)==46&&n.charCodeAt(r+1)==Qr;)r+=2;(r>0||e<n.length)&&(n=n.substring(r,e),e-=r,r=0);let t;for(;r+1<e;){if(t=!1,n.charCodeAt(r)==Qr&&n.charCodeAt(r+1)==46){if(t=r+2==e,t||r+2<e&&n.charCodeAt(r+2)==Qr){n=t?n.substring(0,r):n.substring(0,r)+n.substring(r+2),e-=2;continue}if(t=r+3==e,t&&n.charCodeAt(r+2)==46||r+3<e&&n.charCodeAt(r+2)==46&&n.charCodeAt(r+3)==Qr){let i=r;for(;--i>=0;)if(n.charCodeAt(i)==Qr){(r-i!=3||n.charCodeAt(i+1)!=46||n.charCodeAt(i+2)!=46)&&(n=t?n.substring(0,i):n.substring(0,i)+n.substring(r+3),e-=r+3-i,r=i-1);break}if(i<0&&r>0&&(r!=2||n.charCodeAt(0)!=46||n.charCodeAt(1)!=46)){n=n.substring(r+4),e=n.length;continue}}}r++}return e>0?n:"."}function fl(n,r){return n.startsWith("std/")?n:Xr(Mb(r)+mt+n)}function Mb(n){let r=n.length;if(r<=1){if(r==0)return".";if(n.charCodeAt(0)==Qr)return n}for(;--r>0;)if(n.charCodeAt(r)==Qr)return n.substring(0,r);return"."}var s1="\x1B[90m",dl="\x1B[91m",a1="\x1B[92m",Wp="\x1B[93m",l1="\x1B[94m",Kp="\x1B[95m",Hp="\x1B[96m",o1="\x1B[97m",as="\x1B[0m",_l=!0;function Xn(){return _l}function hl(n){let r=_l;return _l=n,r}function u1(n,r){return _l?r+n+as:n}var jp=new Uint8Array(16),Qp=new Uint8Array(16).fill(255);var ls=(i=>(i[i.Pedantic=0]="Pedantic",i[i.Info=1]="Info",i[i.Warning=2]="Warning",i[i.Error=3]="Error",i))(ls||{}),ue=class n{constructor(r,e){this.start=r;this.end=e}static join(r,e){if(r.source!=e.source)throw new Error("source mismatch");let t=new n(r.start<e.start?r.start:e.start,r.end>e.end?r.end:e.end);return t.source=r.source,t}equals(r){return this.source==r.source&&this.start==r.start&&this.end==r.end}get atStart(){let r=new n(this.start,this.start);return r.source=this.source,r}get atEnd(){let r=new n(this.end,this.end);return r.source=this.source,r}toString(){return this.source.text.substring(this.start,this.end)}};function $p(n){switch(n){case 0:return"PEDANTIC";case 1:return"INFO";case 2:return"WARNING";case 3:return"ERROR";default:return assert(!1),""}}function Db(n){switch(n){case 0:return Kp;case 1:return Hp;case 2:return Wp;case 3:return dl;default:return assert(!1),""}}var ml=class n{constructor(r,e,t){this.range=null;this.relatedRange=null;this.code=r,this.category=e,this.message=t}static create(r,e,t=null,i=null,s=null){let a=al(r);return t!=null&&(a=a.replace("{0}",t)),i!=null&&(a=a.replace("{1}",i)),s!=null&&(a=a.replace("{2}",s)),new n(r,e,a)}equals(r){if(this.code!=r.code)return!1;let e=this.range,t=r.range;if(e){if(!t||!e.equals(t))return!1}else if(t)return!1;let i=this.relatedRange,s=r.relatedRange;if(i){if(!s||!i.equals(s))return!1}else if(s)return!1;return this.message==r.message}withRange(r){return this.range=r,this}withRelatedRange(r){return this.relatedRange=r,this}toString(){let r=$p(this.category),e=this.range,t=this.code,i=this.message;if(e){let s=e.source,a=s.normalizedPath,l=s.lineAt(e.start),o=s.columnAt(),u=e.end-e.start;return`${r} ${t}: "${i}" in ${a}(${l},${o}+${u})`}return`${r} ${t}: ${i}`}};function Gb(n,r=!1,e=!1){let t=hl(r),i=[];Xn()&&i.push(Db(n.category)),i.push($p(n.category)),Xn()&&i.push(as),i.push(n.code<1e3?" AS":" TS"),i.push(n.code.toString()),i.push(": "),i.push(n.message);let s=n.range;if(s){let a=s.source,l=n.relatedRange,o=0;if(l&&(o=max(a.lineAt(s.start),l.source.lineAt(l.start))),e?(i.push(`
9
+ `+new Error().stack},i=function(a,l){if(a==l){if(a!=0)return 0;a=1/a,l=1/l}else{let o=a!=a,u=l!=l;if(o|u)return o-u;a==null&&(a=String(a)),l==null&&(l=String(l))}return a>l?1:-1};wE=e,RE=t,CE=i,ee.ASC_TARGET=0,ee.ASC_RUNTIME=0,ee.ASC_NO_ASSERT=!1,ee.ASC_MEMORY_BASE=0,ee.ASC_OPTIMIZE_LEVEL=3,ee.ASC_SHRINK_LEVEL=0,ee.ASC_FEATURE_MUTABLE_GLOBAL=!1,ee.ASC_FEATURE_SIGN_EXTENSION=!1,ee.ASC_FEATURE_BULK_MEMORY=!1,ee.ASC_FEATURE_SIMD=!1,ee.ASC_FEATURE_THREADS=!1;let n=new Float64Array(1),r=new Uint32Array(n.buffer);Object.defineProperties(ee.i8=function(l){return l<<24>>24},{MIN_VALUE:{value:-128},MAX_VALUE:{value:127},parse(a,l){return parseInt(a,l)<<24>>24}}),Object.defineProperties(ee.i16=function(l){return l<<16>>16},{MIN_VALUE:{value:-32768},MAX_VALUE:{value:32767},parse(a,l){return parseInt(a,l)<<16>>16}}),Object.defineProperties(ee.i32=ee.isize=function(l){return l|0},{MIN_VALUE:{value:-2147483648},MAX_VALUE:{value:2147483647},parse(a,l){return parseInt(a,l)|0}}),Object.defineProperties(ee.u8=function(l){return l&255},{MIN_VALUE:{value:0},MAX_VALUE:{value:255},parse(a,l){return parseInt(a,l)&255}}),Object.defineProperties(ee.u16=function(l){return l&65535},{MIN_VALUE:{value:0},MAX_VALUE:{value:65535},parse(a,l){return parseInt(a,l)&65535}}),Object.defineProperties(ee.u32=ee.usize=function(l){return l>>>0},{MIN_VALUE:{value:0},MAX_VALUE:{value:4294967295},parse(a,l){return parseInt(a,l)>>>0}}),Object.defineProperties(ee.bool=function(l){return!!l},{MIN_VALUE:{value:!1},MAX_VALUE:{value:!0},parse(a){return a.trim()==="true"}}),Object.defineProperties(ee.f32=function(l){return Math.fround(l)},{EPSILON:{value:11920928955078125e-23},MIN_VALUE:{value:1401298464324817e-60},MAX_VALUE:{value:34028234663852886e22},MIN_NORMAL_VALUE:{value:11754943508222875e-54},MIN_SAFE_INTEGER:{value:-16777215},MAX_SAFE_INTEGER:{value:16777215},POSITIVE_INFINITY:{value:1/0},NEGATIVE_INFINITY:{value:-1/0},NaN:{value:NaN},parse(a){return Math.fround(parseFloat(a))}}),Object.defineProperties(ee.f64=function(l){return+l},{EPSILON:{value:2220446049250313e-31},MIN_VALUE:{value:5e-324},MAX_VALUE:{value:17976931348623157e292},MIN_NORMAL_VALUE:{value:22250738585072014e-324},MIN_SAFE_INTEGER:{value:-9007199254740991},MAX_SAFE_INTEGER:{value:9007199254740991},POSITIVE_INFINITY:{value:1/0},NEGATIVE_INFINITY:{value:-1/0},NaN:{value:NaN},parse(a){return parseFloat(a)}}),ee.clz=Math.clz32,ee.ctz=function(l){return 32-Math.clz32(~l&l-1)},ee.popcnt=function(l){return l-=l>>>1&1431655765,l=(l&858993459)+(l>>>2&858993459),(l+(l>>>4)&252645135)*16843009>>>24},ee.rotl=function(l,o){return o&=31,l<<o|l>>>32-o},ee.rotr=function(l,o){return o&=31,l>>>o|l<<32-o},ee.abs=Math.abs,ee.max=Math.max,ee.min=Math.min,ee.ceil=Math.ceil,ee.floor=Math.floor,ee.nearest=function(l){let u=Math.abs(l);return u<4503599627370496?(u+4503599627370496-4503599627370496)*Math.sign(l):l},ee.select=function(l,o,u){return u?l:o},ee.sqrt=Math.sqrt,ee.trunc=Math.trunc,ee.copysign=function(l,o){return o?Math.abs(l)*Math.sign(o):(n[0]=o,r[1]>>>31?-1:1)},ee.bswap=function(l){let o=l>>8&16711935,u=(l&16711935)<<8;return l=o|u,o=l>>16&65535,u=(l&65535)<<16,o|u},e.prototype=Object.create(Error.prototype),e.prototype.name="UnreachableError",e.prototype.message="unreachable",ee.unreachable=function(){throw new e},t.prototype=Object.create(Error.prototype),t.prototype.name="AssertionError",ee.assert=function(l,o){if(l)return l;throw new t(o)},ee.changetype=function(l){return l},String.fromCharCodes=function(l){let u=l.length;if(u<=8192)return String.fromCharCode.apply(String,l);let c=0,f="";for(;c<u;)f+=String.fromCharCode.apply(String,l.slice(c,Math.min(c+8192,u))),c+=8192;return f},String.fromCodePoints=function(l){let u=l.length;if(u<=8192)return String.fromCodePoint.apply(String,l);let c=0,f="";for(;c<u;)f+=String.fromCodePoint.apply(String,l.slice(c,Math.min(c+8192,u))),c+=8192;return f},String.prototype.at||Object.defineProperty(String.prototype,"at",{value:function(l){return this.charAt(l>=0?l:l+this.length)},configurable:!0}),String.prototype.replaceAll||Object.defineProperty(String.prototype,"replaceAll",{value:function(l,o){let u=this.split(l).join(o);return l.length||(u=o+u+o),u},configurable:!0});let s=Array.prototype.sort;Array.prototype.sort=function(l){return s.call(this,l||i)},[Array,Uint8ClampedArray,Uint8Array,Int8Array,Uint16Array,Int16Array,Uint32Array,Int32Array,Float32Array,Float64Array].forEach(a=>{a.prototype.at||Object.defineProperty(a.prototype,"at",{value:function(o){return this[o>=0?o:o+this.length]},configurable:!0}),a.prototype.findLastIndex||Object.defineProperty(a.prototype,"findLastIndex",{value:function(o){for(let u=this.length-1;u>=0;--u)if(o(this[u],u,this))return u;return-1},configurable:!0}),a!=Array&&Object.defineProperty(a,"wrap",{value:function(o,u,c){return new a(o,u,c)},configurable:!0})}),ee.isInteger=Number.isInteger,ee.isFloat=function(l){return typeof l=="number"},ee.isNullable=function(l){return!0},ee.isReference=function(l){return typeof l=="object"||typeof l=="string"},ee.isFunction=function(l){return typeof l=="function"},ee.isString=function(l){return typeof l=="string"||l instanceof String},ee.isArray=Array.isArray,ee.isArrayLike=function(l){return l&&typeof l=="object"&&typeof l.length=="number"&&l.length>=0&&Math.trunc(l.length)===l.length},ee.isDefined=function(l){return typeof l<"u"},ee.isConstant=function(l){return!1},ee.unchecked=function(l){return l},ee.fmod=function(l,o){return l%o},ee.fmodf=function(l,o){return Math.fround(l%o)},ee.JSMath=Math,Object.defineProperties(ee.JSMath,{sincos_sin:{value:0,writable:!0},sincos_cos:{value:0,writable:!0},signbit:{value:function(l){return n[0]=l,!!(r[1]>>>31)}},sincos:{value:function(l){this.sincos_sin=Math.sin(l),this.sincos_cos=Math.cos(l)}},exp2:{value:function(l){return Math.pow(2,l)}}}),ee.unmanaged=function(){},ee.trace=function(a,l){l&&(a+=Array.prototype.slice.call(arguments,2,2+l)),console.error("trace: "+a)}}var wE,RE,CE;var Ri={};zu(Ri,{default:()=>Ci});Du(Ri,OM);import*as OM from"binaryen";import{default as Ci}from"binaryen";import PE from"long";var{_BinaryenTypeCreate:Q_,_BinaryenTypeArity:X_,_BinaryenTypeExpand:Z_,_BinaryenTypeGetHeapType:_r,_BinaryenTypeFromHeapType:Ae,_BinaryenTypeIsNullable:$_,_BinaryenTypeFuncref:Y_,_BinaryenTypeExternref:J_,_BinaryenTypeAnyref:ed,_BinaryenTypeEqref:td,_BinaryenTypeI31ref:rd,_BinaryenTypeStructref:nd,_BinaryenTypeArrayref:id,_BinaryenTypeStringref:sd,_BinaryenTypeNullref:ad,_BinaryenTypeNullExternref:ld,_BinaryenTypeNullFuncref:od,_BinaryenHeapTypeFunc:HM,_BinaryenHeapTypeExt:jM,_BinaryenHeapTypeAny:QM,_BinaryenHeapTypeEq:XM,_BinaryenHeapTypeI31:ZM,_BinaryenHeapTypeStruct:$M,_BinaryenHeapTypeArray:YM,_BinaryenHeapTypeString:JM,_BinaryenHeapTypeNone:e7,_BinaryenHeapTypeNoext:t7,_BinaryenHeapTypeNofunc:r7,_BinaryenHeapTypeIsBasic:n7,_BinaryenHeapTypeIsSignature:i7,_BinaryenHeapTypeIsStruct:s7,_BinaryenHeapTypeIsArray:a7,_BinaryenHeapTypeIsBottom:ud,_BinaryenHeapTypeGetBottom:cd,_BinaryenHeapTypeIsSubType:pd,_BinaryenStructTypeGetNumFields:fd,_BinaryenStructTypeGetFieldType:l7,_BinaryenStructTypeGetFieldPackedType:o7,_BinaryenStructTypeIsFieldMutable:u7,_BinaryenArrayTypeGetElementType:c7,_BinaryenArrayTypeGetElementPackedType:p7,_BinaryenArrayTypeIsElementMutable:f7,_BinaryenSignatureTypeGetParams:_7,_BinaryenSignatureTypeGetResults:d7,_BinaryenModuleCreate:_d,_BinaryenModuleDispose:dd,_BinaryenSizeofLiteral:Gu,_BinaryenLiteralInt32:hd,_BinaryenLiteralFloat32:md,_BinaryenLiteralFloat64:yd,_BinaryenLiteralVec128:gd,_BinaryenLiteralFloat32Bits:h7,_BinaryenExpressionGetId:Kt,_BinaryenExpressionGetType:dr,_BinaryenExpressionSetType:m7,_BinaryenExpressionPrint:y7,_BinaryenExpressionCopy:bd,_BinaryenExpressionFinalize:xd,_BinaryenBlock:Ed,_BinaryenBlockGetName:Pa,_BinaryenBlockSetName:g7,_BinaryenBlockGetNumChildren:Pi,_BinaryenBlockGetChildAt:Ni,_BinaryenBlockSetChildAt:Ad,_BinaryenBlockAppendChild:b7,_BinaryenBlockInsertChildAt:x7,_BinaryenBlockRemoveChildAt:E7,_BinaryenIf:Td,_BinaryenIfGetCondition:Li,_BinaryenIfSetCondition:Sd,_BinaryenIfGetIfTrue:Bi,_BinaryenIfSetIfTrue:vd,_BinaryenIfGetIfFalse:Mi,_BinaryenIfSetIfFalse:Id,_BinaryenLoop:kd,_BinaryenLoopGetName:Na,_BinaryenLoopSetName:A7,_BinaryenLoopGetBody:zi,_BinaryenLoopSetBody:Fd,_BinaryenBreak:wd,_BinaryenBreakGetName:La,_BinaryenBreakSetName:T7,_BinaryenBreakGetCondition:Di,_BinaryenBreakSetCondition:Rd,_BinaryenBreakGetValue:Uu,_BinaryenBreakSetValue:Cd,_BinaryenSwitch:Pd,_BinaryenSwitchGetNumNames:Nd,_BinaryenSwitchGetNameAt:Ld,_BinaryenSwitchSetNameAt:S7,_BinaryenSwitchAppendName:v7,_BinaryenSwitchInsertNameAt:I7,_BinaryenSwitchRemoveNameAt:k7,_BinaryenSwitchGetDefaultName:Bd,_BinaryenSwitchSetDefaultName:F7,_BinaryenSwitchGetCondition:Vu,_BinaryenSwitchSetCondition:Md,_BinaryenSwitchGetValue:Ou,_BinaryenSwitchSetValue:zd,_BinaryenCall:Dd,_BinaryenCallGetTarget:Cn,_BinaryenCallSetTarget:w7,_BinaryenCallGetNumOperands:hr,_BinaryenCallGetOperandAt:mr,_BinaryenCallSetOperandAt:Ba,_BinaryenCallAppendOperand:R7,_BinaryenCallInsertOperandAt:C7,_BinaryenCallRemoveOperandAt:P7,_BinaryenCallIsReturn:N7,_BinaryenCallSetReturn:L7,_BinaryenReturnCall:Gd,_BinaryenCallIndirect:Ud,_BinaryenCallIndirectGetTable:B7,_BinaryenCallIndirectSetTable:M7,_BinaryenCallIndirectGetTarget:qu,_BinaryenCallIndirectSetTarget:Vd,_BinaryenCallIndirectGetNumOperands:Gi,_BinaryenCallIndirectGetOperandAt:Ui,_BinaryenCallIndirectSetOperandAt:Ma,_BinaryenCallIndirectAppendOperand:z7,_BinaryenCallIndirectInsertOperandAt:D7,_BinaryenCallIndirectRemoveOperandAt:G7,_BinaryenCallIndirectIsReturn:U7,_BinaryenCallIndirectSetReturn:V7,_BinaryenReturnCallIndirect:Od,_BinaryenLocalGet:qd,_BinaryenLocalGetGetIndex:za,_BinaryenLocalGetSetIndex:O7,_BinaryenLocalSet:Wd,_BinaryenLocalSetIsTee:Da,_BinaryenLocalSetGetIndex:Pn,_BinaryenLocalSetSetIndex:q7,_BinaryenLocalSetGetValue:Gr,_BinaryenLocalSetSetValue:Ga,_BinaryenLocalTee:Kd,_BinaryenGlobalGet:Hd,_BinaryenGlobalGetGetName:Ua,_BinaryenGlobalGetSetName:W7,_BinaryenGlobalSet:jd,_BinaryenGlobalSetGetName:Qd,_BinaryenGlobalSetSetName:K7,_BinaryenGlobalSetGetValue:Wu,_BinaryenGlobalSetSetValue:Xd,_BinaryenMemorySize:Zd,_BinaryenMemoryGrow:$d,_BinaryenMemoryGrowGetDelta:Vi,_BinaryenMemoryGrowSetDelta:Yd,_BinaryenLoad:Jd,_BinaryenLoadIsAtomic:H7,_BinaryenLoadSetAtomic:j7,_BinaryenLoadIsSigned:eh,_BinaryenLoadSetSigned:Q7,_BinaryenLoadGetOffset:th,_BinaryenLoadSetOffset:X7,_BinaryenLoadGetBytes:rh,_BinaryenLoadSetBytes:Z7,_BinaryenLoadGetAlign:$7,_BinaryenLoadSetAlign:Y7,_BinaryenLoadGetPtr:Oi,_BinaryenLoadSetPtr:nh,_BinaryenAtomicLoad:ih,_BinaryenStore:sh,_BinaryenStoreIsAtomic:J7,_BinaryenStoreSetAtomic:ez,_BinaryenStoreGetBytes:Va,_BinaryenStoreSetBytes:tz,_BinaryenStoreGetOffset:Oa,_BinaryenStoreSetOffset:rz,_BinaryenStoreGetAlign:nz,_BinaryenStoreSetAlign:iz,_BinaryenStoreGetPtr:Ur,_BinaryenStoreSetPtr:qa,_BinaryenStoreGetValue:qi,_BinaryenStoreSetValue:ah,_BinaryenStoreGetValueType:sz,_BinaryenStoreSetValueType:az,_BinaryenAtomicStore:lh,_BinaryenConst:Nn,_BinaryenConstGetValueI32:oh,_BinaryenConstSetValueI32:lz,_BinaryenConstGetValueF32:uh,_BinaryenConstSetValueF32:oz,_BinaryenConstGetValueF64:ch,_BinaryenConstSetValueF64:uz,_BinaryenConstGetValueV128:ph,_BinaryenConstSetValueV128:cz,_BinaryenUnary:fh,_BinaryenUnaryGetOp:_h,_BinaryenUnarySetOp:pz,_BinaryenUnaryGetValue:Wi,_BinaryenUnarySetValue:dh,_BinaryenWideIntAddSub:hh,_BinaryenWideIntMul:mh,_BinaryenBinary:yh,_BinaryenBinaryGetOp:gh,_BinaryenBinarySetOp:fz,_BinaryenBinaryGetLeft:Ki,_BinaryenBinarySetLeft:bh,_BinaryenBinaryGetRight:Hi,_BinaryenBinarySetRight:xh,_BinaryenSelect:Eh,_BinaryenSelectGetIfTrue:ji,_BinaryenSelectSetIfTrue:Ah,_BinaryenSelectGetIfFalse:Qi,_BinaryenSelectSetIfFalse:Th,_BinaryenSelectGetCondition:Xi,_BinaryenSelectSetCondition:Sh,_BinaryenDrop:Ku,_BinaryenDropGetValue:Zi,_BinaryenDropSetValue:vh,_BinaryenReturn:Ih,_BinaryenReturnGetValue:Vr,_BinaryenReturnSetValue:Wa,_BinaryenNop:kh,_BinaryenUnreachable:Fh,_BinaryenAtomicRMW:wh,_BinaryenAtomicRMWGetOp:_z,_BinaryenAtomicRMWSetOp:dz,_BinaryenAtomicRMWGetBytes:hz,_BinaryenAtomicRMWSetBytes:mz,_BinaryenAtomicRMWGetOffset:yz,_BinaryenAtomicRMWSetOffset:gz,_BinaryenAtomicRMWGetPtr:Hu,_BinaryenAtomicRMWSetPtr:Rh,_BinaryenAtomicRMWGetValue:ju,_BinaryenAtomicRMWSetValue:Ch,_BinaryenAtomicCmpxchg:Ph,_BinaryenAtomicCmpxchgGetBytes:bz,_BinaryenAtomicCmpxchgSetBytes:xz,_BinaryenAtomicCmpxchgGetOffset:Ez,_BinaryenAtomicCmpxchgSetOffset:Az,_BinaryenAtomicCmpxchgGetPtr:Qu,_BinaryenAtomicCmpxchgSetPtr:Nh,_BinaryenAtomicCmpxchgGetExpected:Xu,_BinaryenAtomicCmpxchgSetExpected:Lh,_BinaryenAtomicCmpxchgGetReplacement:Zu,_BinaryenAtomicCmpxchgSetReplacement:Bh,_BinaryenAtomicWait:Mh,_BinaryenAtomicWaitGetPtr:$u,_BinaryenAtomicWaitSetPtr:zh,_BinaryenAtomicWaitGetExpected:Yu,_BinaryenAtomicWaitSetExpected:Dh,_BinaryenAtomicWaitGetTimeout:Ju,_BinaryenAtomicWaitSetTimeout:Gh,_BinaryenAtomicWaitGetExpectedType:Tz,_BinaryenAtomicWaitSetExpectedType:Sz,_BinaryenAtomicNotify:Uh,_BinaryenAtomicNotifyGetPtr:ec,_BinaryenAtomicNotifySetPtr:Vh,_BinaryenAtomicNotifyGetNotifyCount:tc,_BinaryenAtomicNotifySetNotifyCount:Oh,_BinaryenAtomicFence:qh,_BinaryenAtomicFenceGetOrder:vz,_BinaryenAtomicFenceSetOrder:Iz,_BinaryenSIMDExtract:Wh,_BinaryenSIMDExtractGetOp:kz,_BinaryenSIMDExtractSetOp:Fz,_BinaryenSIMDExtractGetVec:rc,_BinaryenSIMDExtractSetVec:Kh,_BinaryenSIMDExtractGetIndex:wz,_BinaryenSIMDExtractSetIndex:Rz,_BinaryenSIMDReplace:Hh,_BinaryenSIMDReplaceGetOp:Cz,_BinaryenSIMDReplaceSetOp:Pz,_BinaryenSIMDReplaceGetVec:nc,_BinaryenSIMDReplaceSetVec:jh,_BinaryenSIMDReplaceGetIndex:Nz,_BinaryenSIMDReplaceSetIndex:Lz,_BinaryenSIMDReplaceGetValue:ic,_BinaryenSIMDReplaceSetValue:Qh,_BinaryenSIMDShuffle:Xh,_BinaryenSIMDShuffleGetLeft:sc,_BinaryenSIMDShuffleSetLeft:Zh,_BinaryenSIMDShuffleGetRight:ac,_BinaryenSIMDShuffleSetRight:$h,_BinaryenSIMDShuffleGetMask:Bz,_BinaryenSIMDShuffleSetMask:Mz,_BinaryenSIMDTernary:Yh,_BinaryenSIMDTernaryGetOp:zz,_BinaryenSIMDTernarySetOp:Dz,_BinaryenSIMDTernaryGetA:lc,_BinaryenSIMDTernarySetA:Jh,_BinaryenSIMDTernaryGetB:oc,_BinaryenSIMDTernarySetB:em,_BinaryenSIMDTernaryGetC:uc,_BinaryenSIMDTernarySetC:tm,_BinaryenSIMDShift:rm,_BinaryenSIMDShiftGetOp:Gz,_BinaryenSIMDShiftSetOp:Uz,_BinaryenSIMDShiftGetVec:cc,_BinaryenSIMDShiftSetVec:nm,_BinaryenSIMDShiftGetShift:pc,_BinaryenSIMDShiftSetShift:im,_BinaryenSIMDLoad:sm,_BinaryenSIMDLoadGetOp:Vz,_BinaryenSIMDLoadSetOp:Oz,_BinaryenSIMDLoadGetOffset:qz,_BinaryenSIMDLoadSetOffset:Wz,_BinaryenSIMDLoadGetAlign:Kz,_BinaryenSIMDLoadSetAlign:Hz,_BinaryenSIMDLoadGetPtr:fc,_BinaryenSIMDLoadSetPtr:am,_BinaryenSIMDLoadStoreLane:lm,_BinaryenSIMDLoadStoreLaneGetOp:jz,_BinaryenSIMDLoadStoreLaneSetOp:Qz,_BinaryenSIMDLoadStoreLaneGetOffset:Xz,_BinaryenSIMDLoadStoreLaneSetOffset:Zz,_BinaryenSIMDLoadStoreLaneGetAlign:$z,_BinaryenSIMDLoadStoreLaneSetAlign:Yz,_BinaryenSIMDLoadStoreLaneGetIndex:Jz,_BinaryenSIMDLoadStoreLaneSetIndex:eD,_BinaryenSIMDLoadStoreLaneGetPtr:_c,_BinaryenSIMDLoadStoreLaneSetPtr:om,_BinaryenSIMDLoadStoreLaneGetVec:dc,_BinaryenSIMDLoadStoreLaneSetVec:um,_BinaryenSIMDLoadStoreLaneIsStore:tD,_BinaryenMemoryInit:rD,_BinaryenMemoryInitGetSegment:nD,_BinaryenMemoryInitSetSegment:iD,_BinaryenMemoryInitGetDest:hc,_BinaryenMemoryInitSetDest:cm,_BinaryenMemoryInitGetOffset:mc,_BinaryenMemoryInitSetOffset:pm,_BinaryenMemoryInitGetSize:yc,_BinaryenMemoryInitSetSize:fm,_BinaryenDataDrop:sD,_BinaryenDataDropGetSegment:aD,_BinaryenDataDropSetSegment:lD,_BinaryenMemoryCopy:_m,_BinaryenMemoryCopyGetDest:gc,_BinaryenMemoryCopySetDest:dm,_BinaryenMemoryCopyGetSource:bc,_BinaryenMemoryCopySetSource:hm,_BinaryenMemoryCopyGetSize:xc,_BinaryenMemoryCopySetSize:mm,_BinaryenMemoryFill:ym,_BinaryenMemoryFillGetDest:Ec,_BinaryenMemoryFillSetDest:gm,_BinaryenMemoryFillGetValue:Ac,_BinaryenMemoryFillSetValue:bm,_BinaryenMemoryFillGetSize:Tc,_BinaryenMemoryFillSetSize:xm,_BinaryenRefNull:Em,_BinaryenRefIsNull:Am,_BinaryenRefIsNullGetValue:Sc,_BinaryenRefIsNullSetValue:Tm,_BinaryenRefAs:vc,_BinaryenRefAsGetOp:oD,_BinaryenRefAsSetOp:uD,_BinaryenRefAsGetValue:Ic,_BinaryenRefAsSetValue:Sm,_BinaryenRefFunc:vm,_BinaryenRefFuncGetFunc:Im,_BinaryenRefFuncSetFunc:cD,_BinaryenRefEq:km,_BinaryenRefEqGetLeft:kc,_BinaryenRefEqSetLeft:Fm,_BinaryenRefEqGetRight:Fc,_BinaryenRefEqSetRight:wm,_BinaryenTableGet:Rm,_BinaryenTableGetGetTable:pD,_BinaryenTableGetSetTable:fD,_BinaryenTableGetGetIndex:_D,_BinaryenTableGetSetIndex:dD,_BinaryenTableSet:Cm,_BinaryenTableSetGetTable:hD,_BinaryenTableSetSetTable:mD,_BinaryenTableSetGetIndex:yD,_BinaryenTableSetSetIndex:gD,_BinaryenTableSetGetValue:bD,_BinaryenTableSetSetValue:xD,_BinaryenTableSize:Pm,_BinaryenTableSizeGetTable:ED,_BinaryenTableSizeSetTable:AD,_BinaryenTableGrow:Nm,_BinaryenTableGrowGetTable:TD,_BinaryenTableGrowSetTable:SD,_BinaryenTableGrowGetValue:vD,_BinaryenTableGrowSetValue:ID,_BinaryenTableGrowGetDelta:kD,_BinaryenTableGrowSetDelta:FD,_BinaryenTry:Lm,_BinaryenTryGetName:wD,_BinaryenTrySetName:RD,_BinaryenTryGetBody:wc,_BinaryenTrySetBody:Bm,_BinaryenTryGetNumCatchTags:CD,_BinaryenTryGetNumCatchBodies:Rc,_BinaryenTryGetCatchTagAt:PD,_BinaryenTrySetCatchTagAt:ND,_BinaryenTryAppendCatchTag:LD,_BinaryenTryInsertCatchTagAt:BD,_BinaryenTryRemoveCatchTagAt:MD,_BinaryenTryGetCatchBodyAt:Cc,_BinaryenTrySetCatchBodyAt:Mm,_BinaryenTryAppendCatchBody:zD,_BinaryenTryInsertCatchBodyAt:DD,_BinaryenTryRemoveCatchBodyAt:GD,_BinaryenTryHasCatchAll:UD,_BinaryenTryGetDelegateTarget:VD,_BinaryenTrySetDelegateTarget:OD,_BinaryenTryIsDelegate:qD,_BinaryenThrow:zm,_BinaryenThrowGetTag:Dm,_BinaryenThrowSetTag:WD,_BinaryenThrowGetNumOperands:Pc,_BinaryenThrowGetOperandAt:Nc,_BinaryenThrowSetOperandAt:Gm,_BinaryenThrowAppendOperand:KD,_BinaryenThrowInsertOperandAt:HD,_BinaryenThrowRemoveOperandAt:jD,_BinaryenRethrow:Um,_BinaryenRethrowGetTarget:QD,_BinaryenRethrowSetDepth:XD,_BinaryenTupleMake:Vm,_BinaryenTupleMakeGetNumOperands:Lc,_BinaryenTupleMakeGetOperandAt:Bc,_BinaryenTupleMakeSetOperandAt:Om,_BinaryenTupleMakeAppendOperand:ZD,_BinaryenTupleMakeInsertOperandAt:$D,_BinaryenTupleMakeRemoveOperandAt:YD,_BinaryenTupleExtract:qm,_BinaryenTupleExtractGetTuple:Mc,_BinaryenTupleExtractSetTuple:Wm,_BinaryenTupleExtractGetIndex:JD,_BinaryenTupleExtractSetIndex:eG,_BinaryenPop:Km,_BinaryenRefI31:Hm,_BinaryenRefI31GetValue:zc,_BinaryenRefI31SetValue:jm,_BinaryenI31Get:Qm,_BinaryenI31GetGetI31:Dc,_BinaryenI31GetSetI31:Xm,_BinaryenI31GetIsSigned:tG,_BinaryenI31GetSetSigned:rG,_BinaryenCallRef:nG,_BinaryenCallRefGetNumOperands:Gc,_BinaryenCallRefGetOperandAt:Uc,_BinaryenCallRefSetOperandAt:Zm,_BinaryenCallRefAppendOperand:iG,_BinaryenCallRefInsertOperandAt:sG,_BinaryenCallRefRemoveOperandAt:aG,_BinaryenCallRefGetTarget:Vc,_BinaryenCallRefSetTarget:$m,_BinaryenCallRefIsReturn:lG,_BinaryenCallRefSetReturn:oG,_BinaryenRefTest:uG,_BinaryenRefTestGetRef:Oc,_BinaryenRefTestSetRef:Ym,_BinaryenRefTestGetCastType:cG,_BinaryenRefTestSetCastType:pG,_BinaryenRefCast:fG,_BinaryenRefCastGetRef:qc,_BinaryenRefCastSetRef:Jm,_BinaryenBrOn:_G,_BinaryenBrOnGetOp:dG,_BinaryenBrOnSetOp:hG,_BinaryenBrOnGetName:ey,_BinaryenBrOnSetName:mG,_BinaryenBrOnGetRef:Wc,_BinaryenBrOnSetRef:ty,_BinaryenBrOnGetCastType:yG,_BinaryenBrOnSetCastType:gG,_BinaryenStructNew:bG,_BinaryenStructNewGetNumOperands:Kc,_BinaryenStructNewGetOperandAt:Hc,_BinaryenStructNewSetOperandAt:ry,_BinaryenStructNewAppendOperand:xG,_BinaryenStructNewInsertOperandAt:EG,_BinaryenStructNewRemoveOperandAt:AG,_BinaryenStructGet:TG,_BinaryenStructGetGetIndex:ny,_BinaryenStructGetSetIndex:SG,_BinaryenStructGetGetRef:jc,_BinaryenStructGetSetRef:iy,_BinaryenStructGetIsSigned:vG,_BinaryenStructGetSetSigned:IG,_BinaryenStructSet:kG,_BinaryenStructSetGetIndex:sy,_BinaryenStructSetSetIndex:FG,_BinaryenStructSetGetRef:Qc,_BinaryenStructSetSetRef:ay,_BinaryenStructSetGetValue:Xc,_BinaryenStructSetSetValue:ly,_BinaryenArrayNew:wG,_BinaryenArrayNewGetInit:Zc,_BinaryenArrayNewSetInit:oy,_BinaryenArrayNewGetSize:$c,_BinaryenArrayNewSetSize:uy,_BinaryenArrayNewFixed:RG,_BinaryenArrayNewFixedGetNumValues:Yc,_BinaryenArrayNewFixedGetValueAt:Jc,_BinaryenArrayNewFixedSetValueAt:cy,_BinaryenArrayNewFixedAppendValue:CG,_BinaryenArrayNewFixedInsertValueAt:PG,_BinaryenArrayNewFixedRemoveValueAt:NG,_BinaryenArrayNewData:LG,_BinaryenArrayNewDataGetSegment:BG,_BinaryenArrayNewDataSetSegment:MG,_BinaryenArrayNewDataGetOffset:zG,_BinaryenArrayNewDataSetOffset:DG,_BinaryenArrayNewDataGetSize:GG,_BinaryenArrayNewDataSetSize:UG,_BinaryenArrayNewElem:VG,_BinaryenArrayNewElemGetSegment:OG,_BinaryenArrayNewElemSetSegment:qG,_BinaryenArrayNewElemGetOffset:WG,_BinaryenArrayNewElemSetOffset:KG,_BinaryenArrayNewElemGetSize:HG,_BinaryenArrayNewElemSetSize:jG,_BinaryenArrayGet:QG,_BinaryenArrayGetGetRef:ep,_BinaryenArrayGetSetRef:py,_BinaryenArrayGetGetIndex:tp,_BinaryenArrayGetSetIndex:fy,_BinaryenArrayGetIsSigned:XG,_BinaryenArrayGetSetSigned:ZG,_BinaryenArraySet:$G,_BinaryenArraySetGetRef:rp,_BinaryenArraySetSetRef:_y,_BinaryenArraySetGetIndex:np,_BinaryenArraySetSetIndex:dy,_BinaryenArraySetGetValue:ip,_BinaryenArraySetSetValue:hy,_BinaryenArrayLen:YG,_BinaryenArrayLenGetRef:sp,_BinaryenArrayLenSetRef:my,_BinaryenArrayFill:JG,_BinaryenArrayFillGetRef:e9,_BinaryenArrayFillSetRef:t9,_BinaryenArrayFillGetIndex:r9,_BinaryenArrayFillSetIndex:n9,_BinaryenArrayFillGetValue:i9,_BinaryenArrayFillSetValue:s9,_BinaryenArrayFillGetSize:a9,_BinaryenArrayFillSetSize:l9,_BinaryenArrayCopy:o9,_BinaryenArrayCopyGetDestRef:ap,_BinaryenArrayCopySetDestRef:yy,_BinaryenArrayCopyGetDestIndex:lp,_BinaryenArrayCopySetDestIndex:gy,_BinaryenArrayCopyGetSrcRef:op,_BinaryenArrayCopySetSrcRef:by,_BinaryenArrayCopyGetSrcIndex:up,_BinaryenArrayCopySetSrcIndex:xy,_BinaryenArrayCopyGetLength:cp,_BinaryenArrayCopySetLength:Ey,_BinaryenArrayInitData:u9,_BinaryenArrayInitDataGetSegment:c9,_BinaryenArrayInitDataSetSegment:p9,_BinaryenArrayInitDataGetRef:f9,_BinaryenArrayInitDataSetRef:_9,_BinaryenArrayInitDataGetIndex:d9,_BinaryenArrayInitDataSetIndex:h9,_BinaryenArrayInitDataGetOffset:m9,_BinaryenArrayInitDataSetOffset:y9,_BinaryenArrayInitDataGetSize:g9,_BinaryenArrayInitDataSetSize:b9,_BinaryenArrayInitElem:x9,_BinaryenArrayInitElemGetSegment:E9,_BinaryenArrayInitElemSetSegment:A9,_BinaryenArrayInitElemGetRef:T9,_BinaryenArrayInitElemSetRef:S9,_BinaryenArrayInitElemGetIndex:v9,_BinaryenArrayInitElemSetIndex:I9,_BinaryenArrayInitElemGetOffset:k9,_BinaryenArrayInitElemSetOffset:F9,_BinaryenArrayInitElemGetSize:w9,_BinaryenArrayInitElemSetSize:R9,_BinaryenStringNew:C9,_BinaryenStringNewGetOp:P9,_BinaryenStringNewSetOp:N9,_BinaryenStringNewGetRef:pp,_BinaryenStringNewSetRef:Ay,_BinaryenStringNewGetStart:fp,_BinaryenStringNewSetStart:Ty,_BinaryenStringNewGetEnd:_p,_BinaryenStringNewSetEnd:Sy,_BinaryenStringConst:L9,_BinaryenStringConstGetString:B9,_BinaryenStringConstSetString:M9,_BinaryenStringMeasure:z9,_BinaryenStringMeasureGetOp:D9,_BinaryenStringMeasureSetOp:G9,_BinaryenStringMeasureGetRef:dp,_BinaryenStringMeasureSetRef:vy,_BinaryenStringEncode:U9,_BinaryenStringEncodeGetOp:V9,_BinaryenStringEncodeSetOp:O9,_BinaryenStringEncodeGetStr:hp,_BinaryenStringEncodeSetStr:Iy,_BinaryenStringEncodeGetArray:mp,_BinaryenStringEncodeSetArray:ky,_BinaryenStringEncodeGetStart:yp,_BinaryenStringEncodeSetStart:Fy,_BinaryenStringConcat:q9,_BinaryenStringConcatGetLeft:gp,_BinaryenStringConcatSetLeft:wy,_BinaryenStringConcatGetRight:bp,_BinaryenStringConcatSetRight:Ry,_BinaryenStringEq:xp,_BinaryenStringEqGetOp:W9,_BinaryenStringEqSetOp:K9,_BinaryenStringEqGetLeft:Ep,_BinaryenStringEqSetLeft:Cy,_BinaryenStringEqGetRight:Ap,_BinaryenStringEqSetRight:Py,_BinaryenStringWTF16Get:H9,_BinaryenStringWTF16GetGetRef:Tp,_BinaryenStringWTF16GetSetRef:Ny,_BinaryenStringWTF16GetGetPos:Sp,_BinaryenStringWTF16GetSetPos:Ly,_BinaryenStringSliceWTF:j9,_BinaryenStringSliceWTFGetRef:vp,_BinaryenStringSliceWTFSetRef:By,_BinaryenStringSliceWTFGetStart:Ip,_BinaryenStringSliceWTFSetStart:My,_BinaryenStringSliceWTFGetEnd:kp,_BinaryenStringSliceWTFSetEnd:zy,_BinaryenAddFunction:Ln,_BinaryenGetFunction:Bn,_BinaryenRemoveFunction:$i,_BinaryenGetNumFunctions:Dy,_BinaryenGetFunctionByIndex:Gy,_BinaryenFunctionGetName:Mn,_BinaryenFunctionGetParams:Yi,_BinaryenFunctionGetResults:Ji,_BinaryenFunctionGetNumVars:Ka,_BinaryenFunctionGetVar:Ha,_BinaryenFunctionAddVar:Q9,_BinaryenFunctionGetNumLocals:Fp,_BinaryenFunctionHasLocalName:X9,_BinaryenFunctionGetLocalName:Z9,_BinaryenFunctionSetLocalName:Uy,_BinaryenFunctionGetBody:yr,_BinaryenFunctionSetBody:ja,_BinaryenFunctionGetType:$9,_BinaryenFunctionSetType:Y9,_BinaryenFunctionOptimize:J9,_BinaryenFunctionRunPasses:Vy,_BinaryenFunctionSetDebugLocation:Oy,_BinaryenAddFunctionImport:qy,_BinaryenAddTableImport:Wy,_BinaryenAddMemoryImport:Ky,_BinaryenAddGlobalImport:Hy,_BinaryenAddTagImport:jy,_BinaryenAddFunctionExport:Qa,_BinaryenAddTableExport:Qy,_BinaryenAddMemoryExport:Xy,_BinaryenAddGlobalExport:Zy,_BinaryenAddTagExport:$y,_BinaryenGetExport:Xa,_BinaryenRemoveExport:Za,_BinaryenGetNumExports:eU,_BinaryenGetExportByIndex:tU,_BinaryenExportGetKind:Yy,_BinaryenExportGetName:Jy,_BinaryenExportGetValue:eg,_BinaryenAddGlobal:tg,_BinaryenGetGlobal:wp,_BinaryenRemoveGlobal:rg,_BinaryenGetNumGlobals:ng,_BinaryenGetGlobalByIndex:ig,_BinaryenGlobalGetName:sg,_BinaryenGlobalGetType:ag,_BinaryenGlobalIsMutable:lg,_BinaryenGlobalGetInitExpr:$a,_BinaryenAddTag:og,_BinaryenGetTag:ug,_BinaryenRemoveTag:cg,_BinaryenTagGetName:pg,_BinaryenTagGetParams:fg,_BinaryenTagGetResults:_g,_BinaryenAddTable:Rp,_BinaryenRemoveTable:rU,_BinaryenGetNumTables:nU,_BinaryenGetTable:Cp,_BinaryenGetTableByIndex:iU,_BinaryenTableGetName:sU,_BinaryenTableSetName:aU,_BinaryenTableGetInitial:lU,_BinaryenTableSetInitial:dg,_BinaryenTableHasMax:oU,_BinaryenTableGetMax:uU,_BinaryenTableSetMax:hg,_BinaryenTableGetType:cU,_BinaryenTableSetType:pU,_BinaryenAddActiveElementSegment:mg,_BinaryenAddPassiveElementSegment:fU,_BinaryenRemoveElementSegment:_U,_BinaryenGetNumElementSegments:dU,_BinaryenGetElementSegment:hU,_BinaryenGetElementSegmentByIndex:mU,_BinaryenSetMemory:yg,_BinaryenGetNumMemorySegments:yU,_BinaryenGetMemorySegmentByteOffset:gU,_BinaryenGetMemorySegmentByteLength:bU,_BinaryenCopyMemorySegmentData:xU,_BinaryenAddDataSegment:EU,_BinaryenSetStart:gg,_BinaryenGetStart:AU,_BinaryenModuleParse:TU,_BinaryenModulePrint:SU,_BinaryenModulePrintAsmjs:vU,_BinaryenModuleValidate:bg,_BinaryenModuleOptimize:IU,_BinaryenModuleRunPasses:xg,_BinaryenSizeofAllocateAndWriteResult:Eg,_BinaryenModuleAllocateAndWrite:Ag,_BinaryenModuleAllocateAndWriteText:Tg,_BinaryenModuleAllocateAndWriteStackIR:Sg,_BinaryenModuleRead:vg,_BinaryenModuleReadWithFeatures:kU,_BinaryenModuleInterpret:Ig,_BinaryenModuleAddDebugInfoFileName:kg,_BinaryenModuleGetDebugInfoFileName:Fg,_BinaryenModuleGetFeatures:wg,_BinaryenModuleSetFeatures:Rg,_BinaryenAddCustomSection:Cg,_BinaryenExpressionGetSideEffects:Pg,_RelooperCreate:Ng,_RelooperAddBlock:Lg,_RelooperAddBranch:Bg,_RelooperAddBlockWithSwitch:Mg,_RelooperAddBranchForSwitch:zg,_RelooperRenderAndDispose:Dg,_ExpressionRunnerCreate:Gg,_ExpressionRunnerSetLocalValue:FU,_ExpressionRunnerSetGlobalValue:wU,_ExpressionRunnerRunAndDispose:Ug,_TypeBuilderCreate:Vg,_TypeBuilderGrow:Pp,_TypeBuilderGetSize:Ya,_TypeBuilderSetSignatureType:Og,_TypeBuilderSetStructType:qg,_TypeBuilderSetArrayType:RU,_TypeBuilderGetTempHeapType:Np,_TypeBuilderGetTempTupleType:Lp,_TypeBuilderGetTempRefType:zn,_TypeBuilderSetSubType:Wg,_TypeBuilderSetOpen:CU,_TypeBuilderCreateRecGroup:PU,_TypeBuilderBuildAndDispose:Kg,_BinaryenModuleSetTypeName:Hg,_BinaryenModuleSetFieldName:jg,_BinaryenGetOptimizeLevel:Qg,_BinaryenSetOptimizeLevel:Xg,_BinaryenGetShrinkLevel:Zg,_BinaryenSetShrinkLevel:$g,_BinaryenGetDebugInfo:Yg,_BinaryenSetDebugInfo:Jg,_BinaryenGetTrapsNeverHappen:eb,_BinaryenSetTrapsNeverHappen:tb,_BinaryenGetClosedWorld:rb,_BinaryenSetClosedWorld:nb,_BinaryenGetLowMemoryUnused:ib,_BinaryenSetLowMemoryUnused:sb,_BinaryenGetZeroFilledMemory:ab,_BinaryenSetZeroFilledMemory:lb,_BinaryenGetFastMath:ob,_BinaryenSetFastMath:ub,_BinaryenGetGenerateStackIR:cb,_BinaryenSetGenerateStackIR:pb,_BinaryenGetOptimizeStackIR:fb,_BinaryenSetOptimizeStackIR:_b,_BinaryenGetPassArgument:db,_BinaryenSetPassArgument:hb,_BinaryenClearPassArguments:mb,_BinaryenHasPassToSkip:NU,_BinaryenAddPassToSkip:LU,_BinaryenClearPassesToSkip:BU,_BinaryenGetAlwaysInlineMaxSize:yb,_BinaryenSetAlwaysInlineMaxSize:gb,_BinaryenGetFlexibleInlineMaxSize:bb,_BinaryenSetFlexibleInlineMaxSize:xb,_BinaryenGetOneCallerInlineMaxSize:Eb,_BinaryenSetOneCallerInlineMaxSize:Ab,_BinaryenGetAllowInliningFunctionsWithLoops:Tb,_BinaryenSetAllowInliningFunctionsWithLoops:Sb,_malloc:kt,_free:ie,__i32_store8:qe,__i32_store16:MU,__i32_store:Ja,__f32_store:zU,__f64_store:DU,__i32_load8_s:GU,__i32_load8_u:Or,__i32_load16_s:UU,__i32_load16_u:VU,__i32_load:gr,__f32_load:OU,__f64_load:qU}=Ci;function NE(n){return BigInt(n.high|0)<<32n|BigInt(n.low>>>0)}function LE(n){return PE.fromBits(Number(n&0xFFFFFFFFn)|0,Number(n>>32n)|0)}function vb(n,r){return Ci._BinaryenLiteralInt64(n,NE(r))}function Bp(n){return LE(Ci._BinaryenConstGetValueI64(n))}var kb="data:application/wasm;base64,AGFzbQEAAAABBwFgAnx8AXwDAgEABQMBAAEGDQF8AUQAAAAAAAAAAAsHCwEHZjY0X3BvdwAADAKCAQr2DAHzDAMFfgN/CXwCfCABmUQAAAAAAAAAQGUEQCAAIACiIAFEAAAAAAAAAEBhDQEaIACfmUQAAAAAAADwfyAARAAAAAAAAPD/YhsgAUQAAAAAAADgP2ENARpEAAAAAAAA8D8gAKMgAUQAAAAAAADwv2ENARogACABRAAAAAAAAPA/YQ0BGkQAAAAAAADwPyABRAAAAAAAAAAAYQ0BGgsCfCABvSIFQjSIIQQgAL0iAkI0iCIDQgF9Qv4PWgR/QQEFIARC/w+DQr4HfUKAAVoLBEAgBUIBhiIGQgF9Qv////////9vWgRARAAAAAAAAPA/IAZQDQIaRAAAAAAAAPh/IAJCgICAgICAgPg/UQ0CGiAAIAGgIAZCgICAgICAgHBWIAJCAYYiAkKAgICAgICAcFZyDQIaRAAAAAAAAPh/IAJCgICAgICAgPD/AFENAhpEAAAAAAAAAAAgBUI/iFAgAkKAgICAgICA8P8AVEYNAhogASABogwCCyACQgGGQgF9Qv////////9vWgRARAAAAAAAAPA/IAAgAKIiAJogACACQj+IpwR/An9BACAFQjSIQv8PgyICQv8HVA0AGkECIAJCswhWDQAaQQAgBUIBQrMIIAJ9hiICQgF9g0IAUg0AGkEBIAIgBYNCAFINABpBAgtBAUYFQQALGyIAoyAAIAVCAFMbDAILIAJCAFMEQAJ/QQAgBUI0iEL/D4MiBkL/B1QNABpBAiAGQrMIVg0AGkEAIAVCAUKzCCAGfYYiBkIBfYNCAFINABpBASAFIAaDQgBSDQAaQQILIgdFBEAgACAAoSIAIACjDAMLIANC/w+DIQNBgIAQQQAgB0EBRhshCCACQv///////////wCDIQILIARC/w+DIgZCvgd9QoABWgRARAAAAAAAAPA/IAJCgICAgICAgPg/UQ0CGkQAAAAAAADwPyAGQr4HVA0CGkQAAAAAAADwf0QAAAAAAAAAACAEQoAQVCACQoCAgICAgID4P1ZGGwwCCyADUARAIABEAAAAAAAAMEOivUL///////////8Ag0KAgICAgICAoAN9IQILCyACIAJCgICAgNCqpfM/fSICQoCAgICAgIB4g30iA0KAgICACHxCgICAgHCDvyIKIAJCLYhC/wCDp0EFdEGACGoiBysDACILokQAAAAAAADwv6AhDSACQjSHuSIARAA4+v5CLuY/oiAHKwMQoCIOIA0gA78gCqEgC6IiD6AiCqAhCyAKIApEAAAAAAAA4L+iIhCiIQwgCyANIA1EAAAAAAAA4L+iIhGiIhKgIg0gDSAARDBnx5NX8y49oiAHKwMYoCAOIAuhIAqgoCAPIBAgEaCioCALIA2hIBKgoCAKIAyiIApEBgAAAAAA4D+iRGBVVVVVVeW/oCAMIApEeqQpVVVV5b+iRE5VWZmZmek/oCAMIApEwz8miysA8D+iROlFSJtbSfK/oKKgoqCioCIAoCIKoSAAoCQAAnwgBUKAgIBAg78iACAKvUKAgIBAg78iC6IiDL0iAkI0iKdB/w9xIgdByQdrIglBP08EQEQAAAAAAADwv0QAAAAAAADwPyAIGyAJQYCAgIB4Tw0BGkQAAAAAAAAAgEQAAAAAAAAAACAIG0QAAAAAAADw/0QAAAAAAADwfyAIGyACQgBTGyAHQYkITw0BGkEAIQcLIAxE/oIrZUcVZ0CiRAAAAAAAADhDoCINvSICQv8Ag0IBhqdBA3RBgChqIgkpAwggAiAIrXxCLYZ8IQMgDCANRAAAAAAAADjDoCIMRAAA+v5CLna/oqAgDEQ6O568mvcMvaKgIAEgAKEgC6IgASAKIAuhIwCgoqCgIgAgAKIhASAJKwMAIACgIAEgAEQ8VFVVVVXFP6JEvf3/////3z+goqAgASABoiAARBfQpGcREYE/okSRKxfPVVWlP6CioCEAIAdFBEACfCACQoCAgIAIg1AEQCADQoCAgICAgICIP32/IgEgASAAoqBEAAAAAAAAAH+iDAELIANCgICAgICAgPA/fCICvyIBIACiIQAgASAAoCIKmUQAAAAAAADwP2MEfCACQoCAgICAgICAgH+Dv0QAAAAAAADwPyAKpiILIAqgIgwgCyAMoSAKoCABIAqhIACgoKAgC6EiACAARAAAAAAAAAAAYRsFIAoLRAAAAAAAABAAogsMAQsgA78iASABIACioAsLCwsLxSyCAQBBhQgLA6D2PwBBkQgLF8i58oIs1r+AVjcoJLT6PAAAAAAAgPY/AEGxCAsXCFi/vdHVvyD34NgIpRy9AAAAAABg9j8AQdEICxdYRRd3dtW/bVC21aRiI70AAAAAAED2PwBB8QgLF/gth60a1b/VZ7Ce5ITmvAAAAAAAIPY/AEGRCQsXeHeVX77Uv+A+KZNpGwS9AAAAAAAA9j8AQbEJCxdgHMKLYdS/zIRMSC/YEz0AAAAAAOD1PwBB0QkLF6iGhjAE1L86C4Lt80LcPAAAAAAAwPU/AEHxCQsXSGlVTKbTv2CUUYbGsSA9AAAAAACg9T8AQZEKCxeAmJrdR9O/koDF1E1ZJT0AAAAAAID1PwBBsQoLFyDhuuLo0r/YK7eZHnsmPQAAAAAAYPU/AEHRCgsXiN4TWonSvz+wz7YUyhU9AAAAAABg9T8AQfEKCxeI3hNaidK/P7DPthTKFT0AAAAAAED1PwBBkQsLF3jP+0Ep0r922lMoJFoWvQAAAAAAIPU/AEGxCwsXmGnBmMjRvwRU52i8rx+9AAAAAAAA9T8AQdELCxeoq6tcZ9G/8KiCM8YfHz0AAAAAAOD0PwBB8QsLF0iu+YsF0b9mWgX9xKgmvQAAAAAAwPQ/AEGRDAsXkHPiJKPQvw4D9H7uawy9AAAAAACg9D8AQbEMCxfQtJQlQNC/fy30nrg28LwAAAAAAKD0PwBB0QwLF9C0lCVA0L9/LfSeuDbwvAAAAAAAgPQ/AEHxDAsXQF5tGLnPv4c8masqVw09AAAAAABg9D8AQZENCxdg3Mut8M6/JK+GnLcmKz0AAAAAAED0PwBBsQ0LF/Aqbgcnzr8Q/z9UTy8XvQAAAAAAIPQ/AEHRDQsXwE9rIVzNvxtoyruRuiE9AAAAAAAA9D8AQfENCxegmsf3j8y/NISfaE95Jz0AAAAAAAD0PwBBkQ4LF6Cax/ePzL80hJ9oT3knPQAAAAAA4PM/AEGxDgsXkC10hsLLv4+3izGwThk9AAAAAADA8z8AQdEOCxfAgE7J88q/ZpDNP2NOujwAAAAAAKDzPwBB8Q4LF7DiH7wjyr/qwUbcZIwlvQAAAAAAoPM/AEGRDwsXsOIfvCPKv+rBRtxkjCW9AAAAAACA8z8AQbEPCxdQ9JxaUsm/49TBBNnRKr0AAAAAAGDzPwBB0Q8LF9AgZaB/yL8J+tt/v70rPQAAAAAAQPM/AEHxDwsX4BACiavHv1hKU3KQ2ys9AAAAAABA8z8AQZEQCxfgEAKJq8e/WEpTcpDbKz0AAAAAACDzPwBBsRALF9AZ5w/Wxr9m4rKjauQQvQAAAAAAAPM/AEHREAsXkKdwMP/FvzlQEJ9Dnh69AAAAAAAA8z8AQfEQCxeQp3Aw/8W/OVAQn0OeHr0AAAAAAODyPwBBkRELF7Ch4+Umxb+PWweQi94gvQAAAAAAwPI/AEGxEQsXgMtsK03Evzx4NWHBDBc9AAAAAADA8j8AQdERCxeAy2wrTcS/PHg1YcEMFz0AAAAAAKDyPwBB8RELF5AeIPxxw786VCdNhnjxPAAAAAAAgPI/AEGREgsX8B/4UpXCvwjEcRcwjSS9AAAAAABg8j8AQbESCxdgL9Uqt8G/lqMRGKSALr0AAAAAAGDyPwBB0RILF2Av1Sq3wb+WoxEYpIAuvQAAAAAAQPI/AEHxEgsXkNB8ftfAv/Rb6IiWaQo9AAAAAABA8j8AQZETCxeQ0Hx+18C/9FvoiJZpCj0AAAAAACDyPwBBsRMLF+DbMZHsv7/yM6NcVHUlvQAAAAAAAPI/AEHSEwsWK24HJ76/PADwKiw0Kj0AAAAAAADyPwBB8hMLFituBye+vzwA8CosNCo9AAAAAADg8T8AQZEUCxfAW49UXry/Br5fWFcMHb0AAAAAAMDxPwBBsRQLF+BKOm2Sur/IqlvoNTklPQAAAAAAwPE/AEHRFAsX4Eo6bZK6v8iqW+g1OSU9AAAAAACg8T8AQfEUCxegMdZFw7i/aFYvTSl8Ez0AAAAAAKDxPwBBkRULF6Ax1kXDuL9oVi9NKXwTPQAAAAAAgPE/AEGxFQsXYOWK0vC2v9pzM8k3lya9AAAAAABg8T8AQdEVCxcgBj8HG7W/V17GYVsCHz0AAAAAAGDxPwBB8RULFyAGPwcbtb9XXsZhWwIfPQAAAAAAQPE/AEGRFgsX4BuW10Gzv98T+czaXiw9AAAAAABA8T8AQbEWCxfgG5bXQbO/3xP5zNpeLD0AAAAAACDxPwBB0RYLF4Cj7jZlsb8Jo492XnwUPQAAAAAAAPE/AEHxFgsXgBHAMAqvv5GONoOeWS09AAAAAAAA8T8AQZEXCxeAEcAwCq+/kY42g55ZLT0AAAAAAODwPwBBsRcLF4AZcd1Cq79McNbleoIcPQAAAAAA4PA/AEHRFwsXgBlx3UKrv0xw1uV6ghw9AAAAAADA8D8AQfEXCxfAMvZYdKe/7qHyNEb8LL0AAAAAAMDwPwBBkRgLF8Ay9lh0p7/uofI0RvwsvQAAAAAAoPA/AEGxGAsXwP65h56jv6r+JvW3AvU8AAAAAACg8D8AQdEYCxfA/rmHnqO/qv4m9bcC9TwAAAAAAIDwPwBB8hgLFngOm4Kfv+QJfnwmgCm9AAAAAACA8D8AQZIZCxZ4DpuCn7/kCX58JoApvQAAAAAAYPA/AEGxGQsXgNUHG7mXvzmm+pNUjSi9AAAAAABA8D8AQdIZCxb8sKjAj7+cptP2fB7fvAAAAAAAQPA/AEHyGQsW/LCowI+/nKbT9nwe37wAAAAAACDwPwBBkhoLFhBrKuB/v+RA2g0/4hm9AAAAAAAg8D8AQbIaCxYQayrgf7/kQNoNP+IZvQAAAAAAAPA/AEHmGgsC8D8AQYUbCwPA7z8AQZIbCxaJdRUQgD/oK52Za8cQvQAAAAAAgO8/AEGxGwsXgJNYViCQP9L34gZb3CO9AAAAAABA7z8AQdIbCxbJKCVJmD80DFoyuqAqvQAAAAAAAO8/AEHxGwsXQOeJXUGgP1PX8VzAEQE9AAAAAADA7j8AQZIcCxYu1K5mpD8o/b11cxYsvQAAAAAAgO4/AEGxHAsXwJ8UqpSoP30mWtCVeRm9AAAAAABA7j8AQdEcCxfA3c1zy6w/ByjYR/JoGr0AAAAAACDuPwBB8RwLF8AGwDHqrj97O8lPPhEOvQAAAAAA4O0/AEGRHQsXYEbRO5exP5ueDVZdMiW9AAAAAACg7T8AQbEdCxfg0af1vbM/107bpV7ILD0AAAAAAGDtPwBB0R0LF6CXTVrptT8eHV08BmksvQAAAAAAQO0/AEHxHQsXwOoK0wC3PzLtnamNHuw8AAAAAAAA7T8AQZEeCxdAWV1eM7k/2ke9OlwRIz0AAAAAAMDsPwBBsR4LF2Ctjchquz/laPcrgJATvQAAAAAAoOw/AEHRHgsXQLwBWIi8P9OsWsbRRiY9AAAAAABg7D8AQfEeCxcgCoM5x74/4EXmr2jALb0AAAAAAEDsPwBBkR8LF+DbOZHovz/9CqFP1jQlvQAAAAAAAOw/AEGxHwsX4CeCjhfBP/IHLc547yE9AAAAAADg6z8AQdEfCxfwI34rqsE/NJk4RI6nLD0AAAAAAKDrPwBB8R8LF4CGDGHRwj+htIHLbJ0DPQAAAAAAgOs/AEGRIAsXkBWw/GXDP4lySyOoL8Y8AAAAAABA6z8AQbEgCxewM4M9kcQ/eLb9VHmDJT0AAAAAACDrPwBB0SALF7Ch5OUnxT/HfWnl6DMmPQAAAAAA4Oo/AEHxIAsXEIy+TlfGP3guPCyLzxk9AAAAAADA6j8AQZEhCxdwdYsS8MY/4SGc5Y0RJb0AAAAAAKDqPwBBsSELF1BEhY2Jxz8FQ5FwEGYcvQAAAAAAYOo/AEHSIQsWOeuvvsg/0SzpqlQ9B70AAAAAAEDqPwBB8iELFvfcWlrJP2//oFgo8gc9AAAAAAAA6j8AQZEiCxfgijztk8o/aSFWUENyKL0AAAAAAODpPwBBsSILF9BbV9gxyz+q4axOjTUMvQAAAAAAwOk/AEHRIgsX4Ds4h9DLP7YSVFnESy29AAAAAACg6T8AQfEiCxcQ8Mb7b8w/0iuWxXLs8bwAAAAAAGDpPwBBkSMLF5DUsD2xzT81sBX3Kv8qvQAAAAAAQOk/AEGxIwsXEOf/DlPOPzD0QWAnEsI8AAAAAAAg6T8AQdIjCxbd5K31zj8RjrtlFSHKvAAAAAAAAOk/AEHxIwsXsLNsHJnPPzDfDMrsyxs9AAAAAADA6D8AQZEkCxdYTWA4cdA/kU7tFtuc+DwAAAAAAKDoPwBBsSQLF2BhZy3E0D/p6jwWixgnPQAAAAAAgOg/AEHRJAsX6CeCjhfRPxzwpWMOISy9AAAAAABg6D8AQfEkCxf4rMtca9E/gRal982aKz0AAAAAAEDoPwBBkSULF2haY5m/0T+3vUdR7aYsPQAAAAAAIOg/AEGxJQsXuA5tRRTSP+q6Rrrehwo9AAAAAADg5z8AQdElCxeQ3HzwvtI/9ARQSvqcKj0AAAAAAMDnPwBB8SULF2DT4fEU0z+4PCHTeuIovQAAAAAAoOc/AEGRJgsXEL52Z2vTP8h38bDNbhE9AAAAAACA5z8AQbEmCxcwM3dSwtM/XL0GtlQ7GD0AAAAAAGDnPwBB0SYLF+jVI7QZ1D+d4JDsNuQIPQAAAAAAQOc/AEHxJgsXyHHCjXHUP3XWZwnOJy+9AAAAAAAg5z8AQZEnCxcwF57gydQ/pNgKG4kgLr0AAAAAAADnPwBBsScLF6A4B64i1T9Zx2SBcL4uPQAAAAAA4OY/AEHRJwsX0MhT93vVP+9AXe7trR89AAAAAADA5j8AQfEnCw9gWd+91dU/3GWkCCoLCr0AQY4oC/IP8D9uv4gaTzubPDUz+6k99u8/XdzYnBNgcbxhgHc+muzvP9FmhxB6XpC8hX9u6BXj7z8T9mc1UtKMPHSFFdOw2e8/+o75I4DOi7ze9t0pa9DvP2HI5mFO92A8yJt1GEXH7z+Z0zNb5KOQPIPzxso+vu8/bXuDXaaalzwPiflsWLXvP/zv/ZIatY4890dyK5Ks7z/RnC9wPb4+PKLR0zLso+8/C26QiTQDarwb0/6vZpvvPw69LypSVpW8UVsS0AGT7z9V6k6M74BQvMwxbMC9iu8/FvTVuSPJkbzgLamumoLvP69VXOnj04A8UY6lyJh67z9Ik6XqFRuAvHtRfTy4cu8/PTLeVfAfj7zqjYw4+WrvP79TEz+MiYs8dctv61tj7z8m6xF2nNmWvNRcBITgW+8/YC86PvfsmjyquWgxh1TvP504hsuC54+8Hdn8IlBN7z+Nw6ZEQW+KPNaMYog7Ru8/fQTksAV6gDyW3H2RST/vP5SoqOP9jpY8OGJ1bno47z99SHTyGF6HPD+msk/OMe8/8ucfmCtHgDzdfOJlRSvvP14IcT97uJa8gWP14d8k7z8xqwlt4feCPOHeH/WdHu8/+r9vGpshPbyQ2drQfxjvP7QKDHKCN4s8CwPkpoUS7z+Py86JkhRuPFYvPqmvDO8/tquwTXVNgzwVtzEK/gbvP0x0rOIBQoY8MdhM/HAB7z9K+NNdOd2PPP8WZLII/O4/BFuOO4Cjhrzxn5JfxfbuP2hQS8ztSpK8y6k6N6fx7j+OLVEb+AeZvGbYBW2u7O4/0jaUPujRcbz3n+U02+fuPxUbzrMZGZm85agTwy3j7j9tTCqnSJ+FPCI0Ekym3u4/imkoemASk7wcgKwERdruP1uJF0iPp1i8Ki73IQrW7j8bmklnmyx8vJeoUNn10e4/EazCYO1jQzwtiWFgCM7uP+9kBjsJZpY8VwAd7UHK7j95A6Ha4cxuPNA8wbWixu4/MBIPP47/kzze09fwKsPuP7CvervOkHY8Jyo21dq/7j934FTrvR2TPA3d/ZmyvO4/jqNxADSUj7ynLJ12srnuP0mjk9zM3oe8QmbPotq27j9fOA+9xt54vIJPnVYrtO4/9lx77EYShrwPkl3KpLHuP47X/RgFNZM82ie1Nkev7j8Fm4ovt5h7PP3Hl9QSre4/CVQc4uFjkDwpVEjdB6vuP+rGGVCFxzQ8t0ZZiiap7j81wGQr5jKUPEghrRVvp+4/n3aZYUrkjLwJ3Ha54aXuP6hN7zvFM4y8hVU6sH6k7j+u6SuJeFOEvCDDzDRGo+4/WFhWeN3Ok7wlIlWCOKLuP2QZfoCqEFc8c6lM1FWh7j8oIl6/77OTvM07f2aeoO4/grk0h60Sary/2gt1EqDuP+6pbbjvZ2O8LxplPLKf7j9RiOBUPdyAvISUUfl9n+4/zz5afmQfeLx0X+zodZ/uP7B9i8BK7oa8dIGlSJqf7j+K5lUeMhmGvMlnQlbrn+4/09QJXsuckDw/Xd5PaaDuPx2lTbncMnu8hwHrcxSh7j9rwGdU/eyUPDLBMAHtoe4/VWzWq+HrZTxiTs8286LuP0LPsy/FoYi8Eho+VCek7j80NzvxtmmTvBPOTJmJpe4/Hv8ZOoRegLytxyNGGqfuP25XcthQ1JS87ZJEm9mo7j8Aig5bZ62QPJlmitnHqu4/tOrwwS+3jTzboCpC5azuP//nxZxgtmW8jES1FjKv7j9EX/NZg/Z7PDZ3FZmuse4/gz0epx8Jk7zG/5ELW7TuPykebIu4qV285cXNsDe37j9ZuZB8+SNsvA9SyMtEuu4/qvn0IkNDkrxQTt6fgr3uP0uOZtdsyoW8ugfKcPHA7j8nzpEr/K9xPJDwo4KRxO4/u3MK4TXSbTwjI+MZY8juP2MiYiIExYe8ZeVde2bM7j/VMeLjhhyLPDMtSuyb0O4/Fbu809G7kbxdJT6yA9XuP9Ix7pwxzJA8WLMwE57Z7j+zWnNuhGmEPL/9eVVr3u4/tJ2Ol83fgrx689O/a+PuP4czy5J3Gow8rdNamZ/o7j/62dFKj3uQvGa2jSkH7u4/uq7cVtnDVbz7FU+4ovPuP0D2pj0OpJC8OlnljXL57j80k6049NZovEde+/J2/+4/NYpYa+LukbxKBqEwsAXvP83dXwrX/3Q80sFLkB4M7z+smJL6+72RvAke11vCEu8/swyvMK5uczycUoXdmxnvP5T9n1wy4448etD/X6sg7z+sWQnRj+CEPEvRVy7xJ+8/ZxpOOK/NYzy15waUbS/vP2gZkmwsa2c8aZDv3CA37z/StcyDGIqAvPrDXVULP+8/b/r/P12tj7x8iQdKLUfvP0mpdTiuDZC88okNCIdP7z+nBz2mhaN0PIek+9wYWO8/DyJAIJ6RgryYg8kW42DvP6ySwdVQWo48hTLbA+Zp7z9LawGsWTqEPGC0AfMhc+8/Hz60ByHVgrxfm3szl3zvP8kNRzu5Kom8KaH1FEaG7z/TiDpgBLZ0PPY/i+cukO8/cXKdUezFgzyDTMf7UZrvP/CR048S94+82pCkoq+k7z99dCPimK6NvPFnji1Ir+8/CCCqQbzDjjwnWmHuG7rvPzLrqcOUK4Q8l7prNyvF7z/uhdExqWSKPEBFblt20O8/7eM75Lo3jrwUvpyt/dvvP53NkU07iXc82JCegcHn7z+JzGBBwQVTPPFxjyvC8+8/";var{f64_pow:Fb}=(await WebAssembly.instantiateStreaming(fetch(kb))).instance.exports;var el=new Float64Array(1),wb=new Float32Array(el.buffer),Dn=new Int32Array(el.buffer);globalThis.f32_as_i32=function(r){return wb[0]=r,Dn[0]};globalThis.i32_as_f32=function(r){return Dn[0]=r,wb[0]};globalThis.f64_as_i64=function(r){return el[0]=r,i64_new(Dn[0],Dn[1])};globalThis.i64_as_f64=function(r){return Dn[0]=i64_low(r),Dn[1]=i64_high(r),el[0]};globalThis.f64_pow=Fb;import we from"long";globalThis.i64_zero=we.ZERO;globalThis.i64_one=we.ONE;globalThis.i64_neg_one=we.fromInt(-1);globalThis.i64_minimum=we.MIN_VALUE;globalThis.i64_maximum=we.MAX_VALUE;globalThis.i64_is=function(r){return we.isLong(r)};globalThis.i64_new=function(r,e){return we.fromBits(r,e)};globalThis.i64_low=function(r){return r.low};globalThis.i64_high=function(r){return r.high};globalThis.i64_not=function(r){return r.not()};globalThis.i64_neg=function(r){return r.neg()};globalThis.i64_clz=function(r){return r.clz()};globalThis.i64_ctz=function(r){return r.ctz()};globalThis.i64_add=function(r,e){return r.add(e)};globalThis.i64_sub=function(r,e){return r.sub(e)};globalThis.i64_mul=function(r,e){return r.mul(e)};globalThis.i64_pow=function(r,e){let t=e.low,i=e.high;if(i<=0){if(i<0)return r.eq(globalThis.i64_neg_one)?t&1?r:we.ONE:r.eq(we.ONE)?r:we.ZERO;if(t==0)return we.ONE;if(t==1)return r;if(t==2)return r.mul(r)}let s=we.ONE;for(;t|i;)t&1&&(s=s.mul(r)),e=e.shru(1),r=r.mul(r),t=e.low,i=e.high;return s};globalThis.i64_div=function(r,e){return r.div(e)};globalThis.i64_div_u=function(r,e){return r.toUnsigned().div(e.toUnsigned()).toSigned()};globalThis.i64_rem=function(r,e){return r.mod(e)};globalThis.i64_rem_u=function(r,e){return r.toUnsigned().mod(e.toUnsigned()).toSigned()};globalThis.i64_and=function(r,e){return r.and(e)};globalThis.i64_or=function(r,e){return r.or(e)};globalThis.i64_xor=function(r,e){return r.xor(e)};globalThis.i64_shl=function(r,e){return r.shl(e)};globalThis.i64_shr=function(r,e){return r.shr(e)};globalThis.i64_shr_u=function(r,e){return r.shru(e)};globalThis.i64_eq=function(r,e){return r.eq(e)};globalThis.i64_ne=function(r,e){return r.ne(e)};globalThis.i64_ge=function(r,e){return r.ge(e)};globalThis.i64_ge_u=function(r,e){return r.toUnsigned().ge(e.toUnsigned())};globalThis.i64_gt=function(r,e){return r.gt(e)};globalThis.i64_gt_u=function(r,e){return r.toUnsigned().gt(e.toUnsigned())};globalThis.i64_le=function(r,e){return r.le(e)};globalThis.i64_le_u=function(r,e){return r.toUnsigned().le(e.toUnsigned())};globalThis.i64_lt=function(r,e){return r.lt(e)};globalThis.i64_lt_u=function(r,e){return r.toUnsigned().lt(e.toUnsigned())};globalThis.i64_align=function(r,e){assert(e&&(e&e-1)==0);let t=we.fromInt(e-1);return r.add(t).and(t.not())};globalThis.i64_signbit=function(r){return!!(r.high>>>31)};globalThis.i64_is_i8=function(r){return r.high===0&&r.low>=0&&r.low<=i8.MAX_VALUE||r.high===-1&&r.low>=i8.MIN_VALUE&&r.low<0};globalThis.i64_is_i16=function(r){return r.high===0&&r.low>=0&&r.low<=i16.MAX_VALUE||r.high===-1&&r.low>=i16.MIN_VALUE&&r.low<0};globalThis.i64_is_i32=function(r){return r.high===0&&r.low>=0||r.high===-1&&r.low<0};globalThis.i64_is_u8=function(r){return r.high===0&&r.low>>>0<=u8.MAX_VALUE};globalThis.i64_is_u16=function(r){return r.high===0&&r.low>>>0<=u16.MAX_VALUE};globalThis.i64_is_u32=function(r){return r.high===0};globalThis.i64_is_bool=function(r){return(r.high|r.low&-2)===0};var BE=we.fromNumber(f32.MIN_SAFE_INTEGER),ME=we.fromNumber(f32.MAX_SAFE_INTEGER);globalThis.i64_is_f32=function(r){return r.gte(BE)&&r.lte(ME)};var zE=we.fromNumber(f64.MIN_SAFE_INTEGER),DE=we.fromNumber(f64.MAX_SAFE_INTEGER);globalThis.i64_is_f64=function(r){return r.gte(zE)&&r.lte(DE)};globalThis.i64_to_f32=function(r){return globalThis.Math.fround(r.toNumber())};globalThis.i64_to_f64=function(r){return r.toNumber()};globalThis.i64_to_string=function(r,e){return e?r.toUnsigned().toString():r.toString()};globalThis.i64_clone=function(r){return we.fromBits(r.low,r.high,r.unsigned)};globalThis.Map_keys=function(r){return Array.from(r.keys())};globalThis.Map_values=function(r){return Array.from(r.values())};globalThis.Set_values=function(r){return Array.from(r.values())};var Ft=(S=>(S[S.None=0]="None",S[S.SignExtension=1]="SignExtension",S[S.MutableGlobals=2]="MutableGlobals",S[S.NontrappingF2I=4]="NontrappingF2I",S[S.BulkMemory=8]="BulkMemory",S[S.Simd=16]="Simd",S[S.Threads=32]="Threads",S[S.ExceptionHandling=64]="ExceptionHandling",S[S.TailCalls=128]="TailCalls",S[S.ReferenceTypes=256]="ReferenceTypes",S[S.MultiValue=512]="MultiValue",S[S.GC=1024]="GC",S[S.Memory64=2048]="Memory64",S[S.RelaxedSimd=4096]="RelaxedSimd",S[S.ExtendedConst=8192]="ExtendedConst",S[S.Strings=16384]="Strings",S[S.SharedEverything=32768]="SharedEverything",S[S.All=65535]="All",S))(Ft||{});function Gn(n){switch(n){case 1:return"sign-extension";case 2:return"mutable-globals";case 4:return"nontrapping-f2i";case 8:return"bulk-memory";case 16:return"simd";case 32:return"threads";case 64:return"exception-handling";case 128:return"tail-calls";case 256:return"reference-types";case 512:return"multi-value";case 1024:return"gc";case 2048:return"memory64";case 4096:return"relaxed-simd";case 8192:return"extended-const";case 16384:return"stringref";case 32768:return"shared-everything"}return assert(!1),""}var Un=(t=>(t[t.Js=0]="Js",t[t.Wasm32=1]="Wasm32",t[t.Wasm64=2]="Wasm64",t))(Un||{});var tl=(t=>(t[t.Stub=0]="Stub",t[t.Minimal=1]="Minimal",t[t.Incremental=2]="Incremental",t))(tl||{});var Vn=class{constructor(){this.flags=0}};Vn=j_([unmanaged],Vn);var rl=(D=>(D[D.NONE=0]="NONE",D[D.ARRAYBUFFERVIEW=1]="ARRAYBUFFERVIEW",D[D.ARRAY=2]="ARRAY",D[D.STATICARRAY=4]="STATICARRAY",D[D.SET=8]="SET",D[D.MAP=16]="MAP",D[D.POINTERFREE=32]="POINTERFREE",D[D.VALUE_ALIGN_0=64]="VALUE_ALIGN_0",D[D.VALUE_ALIGN_1=128]="VALUE_ALIGN_1",D[D.VALUE_ALIGN_2=256]="VALUE_ALIGN_2",D[D.VALUE_ALIGN_3=512]="VALUE_ALIGN_3",D[D.VALUE_ALIGN_4=1024]="VALUE_ALIGN_4",D[D.VALUE_SIGNED=2048]="VALUE_SIGNED",D[D.VALUE_FLOAT=4096]="VALUE_FLOAT",D[D.VALUE_NULLABLE=8192]="VALUE_NULLABLE",D[D.VALUE_MANAGED=16384]="VALUE_MANAGED",D[D.KEY_ALIGN_0=32768]="KEY_ALIGN_0",D[D.KEY_ALIGN_1=65536]="KEY_ALIGN_1",D[D.KEY_ALIGN_2=131072]="KEY_ALIGN_2",D[D.KEY_ALIGN_3=262144]="KEY_ALIGN_3",D[D.KEY_ALIGN_4=524288]="KEY_ALIGN_4",D[D.KEY_SIGNED=1048576]="KEY_SIGNED",D[D.KEY_FLOAT=2097152]="KEY_FLOAT",D[D.KEY_NULLABLE=4194304]="KEY_NULLABLE",D[D.KEY_MANAGED=8388608]="KEY_MANAGED",D))(rl||{});var ze=(j=>(j[j.None=0]="None",j[j.Import=1]="Import",j[j.Export=2]="Export",j[j.Declare=4]="Declare",j[j.Const=8]="Const",j[j.Let=16]="Let",j[j.Static=32]="Static",j[j.Readonly=64]="Readonly",j[j.Abstract=128]="Abstract",j[j.Public=256]="Public",j[j.Private=512]="Private",j[j.Protected=1024]="Protected",j[j.Get=2048]="Get",j[j.Set=4096]="Set",j[j.Override=8192]="Override",j[j.DefinitelyAssigned=16384]="DefinitelyAssigned",j[j.Ambient=32768]="Ambient",j[j.Generic=65536]="Generic",j[j.GenericContext=131072]="GenericContext",j[j.Instance=262144]="Instance",j[j.Constructor=524288]="Constructor",j[j.ModuleExport=1048576]="ModuleExport",j[j.ModuleImport=2097152]="ModuleImport",j[j.Resolved=4194304]="Resolved",j[j.Compiled=8388608]="Compiled",j[j.Errored=16777216]="Errored",j[j.Inlined=33554432]="Inlined",j[j.Scoped=67108864]="Scoped",j[j.Stub=134217728]="Stub",j[j.Overridden=268435456]="Overridden",j[j.Closure=536870912]="Closure",j[j.Quoted=1073741824]="Quoted",j[j.InternallyNullable=-2147483648]="InternallyNullable",j))(ze||{}),mt="/",GE="..",nl="get:",il="set:",Mp="#",es=".",zp="~",Rb="~lib",wt=Rb+mt,Qe=mt+"index",Dp="@",L;(z=>(z.Empty="",z.i8="i8",z.i16="i16",z.i32="i32",z.i64="i64",z.isize="isize",z.u8="u8",z.u16="u16",z.u32="u32",z.u64="u64",z.usize="usize",z.bool="bool",z.f32="f32",z.f64="f64",z.v128="v128",z.ref_func="ref_func",z.ref_extern="ref_extern",z.ref_any="ref_any",z.ref_eq="ref_eq",z.ref_struct="ref_struct",z.ref_array="ref_array",z.ref_i31="ref_i31",z.ref_string="ref_string",z.ref_stringview_wtf8="ref_stringview_wtf8",z.ref_stringview_wtf16="ref_stringview_wtf16",z.ref_stringview_iter="ref_stringview_iter",z.i8x16="i8x16",z.u8x16="u8x16",z.i16x8="i16x8",z.u16x8="u16x8",z.i32x4="i32x4",z.u32x4="u32x4",z.i64x2="i64x2",z.u64x2="u64x2",z.f32x4="f32x4",z.f64x2="f64x2",z.void_="void",z.number="number",z.boolean="boolean",z.string="string",z.native="native",z.indexof="indexof",z.valueof="valueof",z.returnof="returnof",z.thisof="thisof",z.nonnull="nonnull",z.null_="null",z.true_="true",z.false_="false",z.this_="this",z.super_="super",z.constructor="constructor",z.COPY_STRUCT="~lib/util/bytes/COPY_STRUCT",z.ASC_TARGET="ASC_TARGET",z.ASC_RUNTIME="ASC_RUNTIME",z.ASC_NO_ASSERT="ASC_NO_ASSERT",z.ASC_MEMORY_BASE="ASC_MEMORY_BASE",z.ASC_TABLE_BASE="ASC_TABLE_BASE",z.ASC_OPTIMIZE_LEVEL="ASC_OPTIMIZE_LEVEL",z.ASC_SHRINK_LEVEL="ASC_SHRINK_LEVEL",z.ASC_LOW_MEMORY_LIMIT="ASC_LOW_MEMORY_LIMIT",z.ASC_EXPORT_RUNTIME="ASC_EXPORT_RUNTIME",z.ASC_FEATURE_SIGN_EXTENSION="ASC_FEATURE_SIGN_EXTENSION",z.ASC_FEATURE_MUTABLE_GLOBALS="ASC_FEATURE_MUTABLE_GLOBALS",z.ASC_FEATURE_NONTRAPPING_F2I="ASC_FEATURE_NONTRAPPING_F2I",z.ASC_FEATURE_BULK_MEMORY="ASC_FEATURE_BULK_MEMORY",z.ASC_FEATURE_SIMD="ASC_FEATURE_SIMD",z.ASC_FEATURE_THREADS="ASC_FEATURE_THREADS",z.ASC_FEATURE_EXCEPTION_HANDLING="ASC_FEATURE_EXCEPTION_HANDLING",z.ASC_FEATURE_TAIL_CALLS="ASC_FEATURE_TAIL_CALLS",z.ASC_FEATURE_REFERENCE_TYPES="ASC_FEATURE_REFERENCE_TYPES",z.ASC_FEATURE_MULTI_VALUE="ASC_FEATURE_MULTI_VALUE",z.ASC_FEATURE_GC="ASC_FEATURE_GC",z.ASC_FEATURE_MEMORY64="ASC_FEATURE_MEMORY64",z.ASC_FEATURE_RELAXED_SIMD="ASC_FEATURE_RELAXED_SIMD",z.ASC_FEATURE_EXTENDED_CONST="ASC_FEATURE_EXTENDED_CONST",z.ASC_FEATURE_STRINGREF="ASC_FEATURE_STRINGREF",z.ASC_FEATURE_SHARED_EVERYTHING="ASC_FEATURE_SHARED_EVERYTHING",z.ASC_VERSION_MAJOR="ASC_VERSION_MAJOR",z.ASC_VERSION_MINOR="ASC_VERSION_MINOR",z.ASC_VERSION_PATCH="ASC_VERSION_PATCH",z.EnumToString="__enum_to_string",z.I8="I8",z.I16="I16",z.I32="I32",z.I64="I64",z.Isize="Isize",z.U8="U8",z.U16="U16",z.U32="U32",z.U64="U64",z.Usize="Usize",z.Bool="Bool",z.F32="F32",z.F64="F64",z.V128="V128",z.RefFunc="RefFunc",z.RefExtern="RefExtern",z.RefAny="RefAny",z.RefEq="RefEq",z.RefStruct="RefStruct",z.RefArray="RefArray",z.RefI31="RefI31",z.RefString="RefString",z.String="String",z.RegExp="RegExp",z.Object="Object",z.Array="Array",z.StaticArray="StaticArray",z.DynamicArray="DynamicArray",z.Set="Set",z.Map="Map",z.Function="Function",z.Task="Task",z.ArrayBufferView="ArrayBufferView",z.ArrayBuffer="ArrayBuffer",z.Math="Math",z.Mathf="Mathf",z.NativeMath="NativeMath",z.NativeMathf="NativeMathf",z.Int8Array="Int8Array",z.Int16Array="Int16Array",z.Int32Array="Int32Array",z.Int64Array="Int64Array",z.Uint8Array="Uint8Array",z.Uint8ClampedArray="Uint8ClampedArray",z.Uint16Array="Uint16Array",z.Uint32Array="Uint32Array",z.Uint64Array="Uint64Array",z.Float32Array="Float32Array",z.Float64Array="Float64Array",z.TemplateStringsArray="TemplateStringsArray",z.Error="Error",z.abort="abort",z.trace="trace",z.seed="seed",z.pow="pow",z.ipow32="ipow32",z.ipow64="ipow64",z.mod="mod",z.alloc="__alloc",z.realloc="__realloc",z.free="__free",z.new_="__new",z.renew="__renew",z.link="__link",z.collect="__collect",z.visit="__visit",z.newBuffer="__newBuffer",z.newArray="__newArray",z.BLOCK="~lib/rt/common/BLOCK",z.OBJECT="~lib/rt/common/OBJECT",z.DefaultMemory="0",z.DefaultTable="0"))(L||={});var ts=class{constructor(r=0,e=null,t=!1,i=!1,s=null,a=!1){this.kind=r;this.envClass=e;this.ownEnv=t;this.receivesEnv=i;this.parentClass=s;this.hasThis=a}},sl=new Map,Cb=null;function On(){let n=Cb;return n==null&&(Cb=n=new Map),n}var Pb=null;function qr(){let n=Pb;return n==null&&(Pb=n=new Map),n}var Xe=(v=>(v[v.Not_implemented_0=100]="Not_implemented_0",v[v.Operation_is_unsafe=101]="Operation_is_unsafe",v[v.User_defined_0=102]="User_defined_0",v[v.Feature_0_is_not_enabled=103]="Feature_0_is_not_enabled",v[v.Low_memory_limit_exceeded_by_static_data_0_1=104]="Low_memory_limit_exceeded_by_static_data_0_1",v[v.Module_requires_at_least_0_pages_of_initial_memory=105]="Module_requires_at_least_0_pages_of_initial_memory",v[v.Module_requires_at_least_0_pages_of_maximum_memory=106]="Module_requires_at_least_0_pages_of_maximum_memory",v[v.Shared_memory_requires_maximum_memory_to_be_defined=107]="Shared_memory_requires_maximum_memory_to_be_defined",v[v.Shared_memory_requires_feature_threads_to_be_enabled=108]="Shared_memory_requires_feature_threads_to_be_enabled",v[v.Transform_0_1=109]="Transform_0_1",v[v.Start_function_name_0_is_invalid_or_conflicts_with_another_export=110]="Start_function_name_0_is_invalid_or_conflicts_with_another_export",v[v.Element_0_not_found=111]="Element_0_not_found",v[v.Exchange_of_0_values_is_not_supported_by_all_embeddings=112]="Exchange_of_0_values_is_not_supported_by_all_embeddings",v[v.Conversion_from_type_0_to_1_requires_an_explicit_cast=200]="Conversion_from_type_0_to_1_requires_an_explicit_cast",v[v.Conversion_from_type_0_to_1_will_require_an_explicit_cast_when_switching_between_32_64_bit=201]="Conversion_from_type_0_to_1_will_require_an_explicit_cast_when_switching_between_32_64_bit",v[v.Type_0_cannot_be_changed_to_type_1=202]="Type_0_cannot_be_changed_to_type_1",v[v.Operation_0_cannot_be_applied_to_type_1=203]="Operation_0_cannot_be_applied_to_type_1",v[v.Type_0_cannot_be_nullable=204]="Type_0_cannot_be_nullable",v[v.Mutable_value_cannot_be_inlined=206]="Mutable_value_cannot_be_inlined",v[v.Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa=207]="Unmanaged_classes_cannot_extend_managed_classes_and_vice_versa",v[v.Unmanaged_classes_cannot_implement_interfaces=208]="Unmanaged_classes_cannot_implement_interfaces",v[v.Invalid_regular_expression_flags=209]="Invalid_regular_expression_flags",v[v.Expression_is_never_null=210]="Expression_is_never_null",v[v.Class_0_is_final_and_cannot_be_extended=211]="Class_0_is_final_and_cannot_be_extended",v[v.Decorator_0_is_not_valid_here=212]="Decorator_0_is_not_valid_here",v[v.Duplicate_decorator=213]="Duplicate_decorator",v[v.Type_0_is_illegal_in_this_context=214]="Type_0_is_illegal_in_this_context",v[v.Optional_parameter_must_have_an_initializer=215]="Optional_parameter_must_have_an_initializer",v[v.Class_0_cannot_declare_a_constructor_when_instantiated_from_an_object_literal=216]="Class_0_cannot_declare_a_constructor_when_instantiated_from_an_object_literal",v[v.Function_0_cannot_be_inlined_into_itself=217]="Function_0_cannot_be_inlined_into_itself",v[v.Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set=218]="Cannot_access_method_0_without_calling_it_as_it_requires_this_to_be_set",v[v.Optional_properties_are_not_supported=219]="Optional_properties_are_not_supported",v[v.Expression_must_be_a_compile_time_constant=220]="Expression_must_be_a_compile_time_constant",v[v.Type_0_is_not_a_function_index_or_function_reference=221]="Type_0_is_not_a_function_index_or_function_reference",v[v._0_must_be_a_value_between_1_and_2_inclusive=222]="_0_must_be_a_value_between_1_and_2_inclusive",v[v._0_must_be_a_power_of_two=223]="_0_must_be_a_power_of_two",v[v._0_is_not_a_valid_operator=224]="_0_is_not_a_valid_operator",v[v.Expression_cannot_be_represented_by_a_type=225]="Expression_cannot_be_represented_by_a_type",v[v.Expression_resolves_to_unusual_type_0=226]="Expression_resolves_to_unusual_type_0",v[v.Array_literal_expected=227]="Array_literal_expected",v[v.Function_0_is_virtual_and_will_not_be_inlined=228]="Function_0_is_virtual_and_will_not_be_inlined",v[v.Property_0_only_has_a_setter_and_is_missing_a_getter=229]="Property_0_only_has_a_setter_and_is_missing_a_getter",v[v._0_keyword_cannot_be_used_here=230]="_0_keyword_cannot_be_used_here",v[v.A_class_with_a_constructor_explicitly_returning_something_else_than_this_must_be_final=231]="A_class_with_a_constructor_explicitly_returning_something_else_than_this_must_be_final",v[v.Property_0_is_always_assigned_before_being_used=233]="Property_0_is_always_assigned_before_being_used",v[v.Expression_does_not_compile_to_a_value_at_runtime=234]="Expression_does_not_compile_to_a_value_at_runtime",v[v.Only_variables_functions_and_enums_become_WebAssembly_module_exports=235]="Only_variables_functions_and_enums_become_WebAssembly_module_exports",v[v.Literal_0_does_not_fit_into_i64_or_u64_types=236]="Literal_0_does_not_fit_into_i64_or_u64_types",v[v.Index_signature_accessors_in_type_0_differ_in_types=237]="Index_signature_accessors_in_type_0_differ_in_types",v[v.Initializer_definitive_assignment_or_nullable_type_expected=238]="Initializer_definitive_assignment_or_nullable_type_expected",v[v.Definitive_assignment_has_no_effect_on_local_variables=239]="Definitive_assignment_has_no_effect_on_local_variables",v[v.Ambiguous_operator_overload_0_conflicting_overloads_1_and_2=240]="Ambiguous_operator_overload_0_conflicting_overloads_1_and_2",v[v.An_interface_or_abstract_method_0_cannot_have_type_parameters=241]="An_interface_or_abstract_method_0_cannot_have_type_parameters",v[v.Cannot_override_generic_method_0_with_a_non_generic_method_or_vice_versa=242]="Cannot_override_generic_method_0_with_a_non_generic_method_or_vice_versa",v[v.Importing_the_table_disables_some_indirect_call_optimizations=901]="Importing_the_table_disables_some_indirect_call_optimizations",v[v.Exporting_the_table_disables_some_indirect_call_optimizations=902]="Exporting_the_table_disables_some_indirect_call_optimizations",v[v.Expression_compiles_to_a_dynamic_check_at_runtime=903]="Expression_compiles_to_a_dynamic_check_at_runtime",v[v.Indexed_access_may_involve_bounds_checking=904]="Indexed_access_may_involve_bounds_checking",v[v.Explicitly_returning_constructor_drops_this_allocation=905]="Explicitly_returning_constructor_drops_this_allocation",v[v.Unnecessary_definite_assignment=906]="Unnecessary_definite_assignment",v[v._NaN_does_not_compare_equal_to_any_other_value_including_itself_Use_isNaN_x_instead=907]="_NaN_does_not_compare_equal_to_any_other_value_including_itself_Use_isNaN_x_instead",v[v.Comparison_with_0_0_is_sign_insensitive_Use_Object_is_x_0_0_if_the_sign_matters=908]="Comparison_with_0_0_is_sign_insensitive_Use_Object_is_x_0_0_if_the_sign_matters",v[v.Unterminated_string_literal=1002]="Unterminated_string_literal",v[v.Identifier_expected=1003]="Identifier_expected",v[v._0_expected=1005]="_0_expected",v[v.A_file_cannot_have_a_reference_to_itself=1006]="A_file_cannot_have_a_reference_to_itself",v[v.Trailing_comma_not_allowed=1009]="Trailing_comma_not_allowed",v[v.Unexpected_token=1012]="Unexpected_token",v[v.A_rest_parameter_must_be_last_in_a_parameter_list=1014]="A_rest_parameter_must_be_last_in_a_parameter_list",v[v.Parameter_cannot_have_question_mark_and_initializer=1015]="Parameter_cannot_have_question_mark_and_initializer",v[v.A_required_parameter_cannot_follow_an_optional_parameter=1016]="A_required_parameter_cannot_follow_an_optional_parameter",v[v._0_modifier_cannot_appear_on_class_elements_of_this_kind=1031]="_0_modifier_cannot_appear_on_class_elements_of_this_kind",v[v.Statements_are_not_allowed_in_ambient_contexts=1036]="Statements_are_not_allowed_in_ambient_contexts",v[v.Initializers_are_not_allowed_in_ambient_contexts=1039]="Initializers_are_not_allowed_in_ambient_contexts",v[v._0_modifier_cannot_be_used_here=1042]="_0_modifier_cannot_be_used_here",v[v.A_rest_parameter_cannot_be_optional=1047]="A_rest_parameter_cannot_be_optional",v[v.A_rest_parameter_cannot_have_an_initializer=1048]="A_rest_parameter_cannot_have_an_initializer",v[v.A_set_accessor_must_have_exactly_one_parameter=1049]="A_set_accessor_must_have_exactly_one_parameter",v[v.A_set_accessor_parameter_cannot_have_an_initializer=1052]="A_set_accessor_parameter_cannot_have_an_initializer",v[v.A_get_accessor_cannot_have_parameters=1054]="A_get_accessor_cannot_have_parameters",v[v.Enum_member_must_have_initializer=1061]="Enum_member_must_have_initializer",v[v.Type_parameters_cannot_appear_on_a_constructor_declaration=1092]="Type_parameters_cannot_appear_on_a_constructor_declaration",v[v.Type_annotation_cannot_appear_on_a_constructor_declaration=1093]="Type_annotation_cannot_appear_on_a_constructor_declaration",v[v.An_accessor_cannot_have_type_parameters=1094]="An_accessor_cannot_have_type_parameters",v[v.A_set_accessor_cannot_have_a_return_type_annotation=1095]="A_set_accessor_cannot_have_a_return_type_annotation",v[v.Type_parameter_list_cannot_be_empty=1098]="Type_parameter_list_cannot_be_empty",v[v.Type_argument_list_cannot_be_empty=1099]="Type_argument_list_cannot_be_empty",v[v.A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement=1104]="A_continue_statement_can_only_be_used_within_an_enclosing_iteration_statement",v[v.A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement=1105]="A_break_statement_can_only_be_used_within_an_enclosing_iteration_or_switch_statement",v[v.A_return_statement_can_only_be_used_within_a_function_body=1108]="A_return_statement_can_only_be_used_within_a_function_body",v[v.Expression_expected=1109]="Expression_expected",v[v.Type_expected=1110]="Type_expected",v[v.A_default_clause_cannot_appear_more_than_once_in_a_switch_statement=1113]="A_default_clause_cannot_appear_more_than_once_in_a_switch_statement",v[v.Duplicate_label_0=1114]="Duplicate_label_0",v[v.An_export_assignment_cannot_have_modifiers=1120]="An_export_assignment_cannot_have_modifiers",v[v.Octal_literals_are_not_allowed_in_strict_mode=1121]="Octal_literals_are_not_allowed_in_strict_mode",v[v.Digit_expected=1124]="Digit_expected",v[v.Hexadecimal_digit_expected=1125]="Hexadecimal_digit_expected",v[v.Unexpected_end_of_text=1126]="Unexpected_end_of_text",v[v.Invalid_character=1127]="Invalid_character",v[v._case_or_default_expected=1130]="_case_or_default_expected",v[v._super_must_be_followed_by_an_argument_list_or_member_access=1034]="_super_must_be_followed_by_an_argument_list_or_member_access",v[v.A_declare_modifier_cannot_be_used_in_an_already_ambient_context=1038]="A_declare_modifier_cannot_be_used_in_an_already_ambient_context",v[v.Type_argument_expected=1140]="Type_argument_expected",v[v.String_literal_expected=1141]="String_literal_expected",v[v.Line_break_not_permitted_here=1142]="Line_break_not_permitted_here",v[v.Declaration_expected=1146]="Declaration_expected",v[v._const_declarations_must_be_initialized=1155]="_const_declarations_must_be_initialized",v[v.Unterminated_regular_expression_literal=1161]="Unterminated_regular_expression_literal",v[v.Declarations_with_initializers_cannot_also_have_definite_assignment_assertions=1263]="Declarations_with_initializers_cannot_also_have_definite_assignment_assertions",v[v.Interface_declaration_cannot_have_implements_clause=1176]="Interface_declaration_cannot_have_implements_clause",v[v.Binary_digit_expected=1177]="Binary_digit_expected",v[v.Octal_digit_expected=1178]="Octal_digit_expected",v[v.An_implementation_cannot_be_declared_in_ambient_contexts=1183]="An_implementation_cannot_be_declared_in_ambient_contexts",v[v.The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer=1190]="The_variable_declaration_of_a_for_of_statement_cannot_have_an_initializer",v[v.An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive=1198]="An_extended_Unicode_escape_value_must_be_between_0x0_and_0x10FFFF_inclusive",v[v.Unterminated_Unicode_escape_sequence=1199]="Unterminated_Unicode_escape_sequence",v[v.Decorators_are_not_valid_here=1206]="Decorators_are_not_valid_here",v[v._abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration=1242]="_abstract_modifier_can_only_appear_on_a_class_method_or_property_declaration",v[v.Method_0_cannot_have_an_implementation_because_it_is_marked_abstract=1245]="Method_0_cannot_have_an_implementation_because_it_is_marked_abstract",v[v.An_interface_property_cannot_have_an_initializer=1246]="An_interface_property_cannot_have_an_initializer",v[v.A_definite_assignment_assertion_is_not_permitted_in_this_context=1255]="A_definite_assignment_assertion_is_not_permitted_in_this_context",v[v._await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules=1308]="_await_expressions_are_only_allowed_within_async_functions_and_at_the_top_levels_of_modules",v[v.A_class_may_only_extend_another_class=1311]="A_class_may_only_extend_another_class",v[v.A_parameter_property_cannot_be_declared_using_a_rest_parameter=1317]="A_parameter_property_cannot_be_declared_using_a_rest_parameter",v[v.A_default_export_can_only_be_used_in_a_module=1319]="A_default_export_can_only_be_used_in_a_module",v[v.An_expression_of_type_0_cannot_be_tested_for_truthiness=1345]="An_expression_of_type_0_cannot_be_tested_for_truthiness",v[v.An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal=1351]="An_identifier_or_keyword_cannot_immediately_follow_a_numeric_literal",v[v.Duplicate_identifier_0=2300]="Duplicate_identifier_0",v[v.Cannot_find_name_0=2304]="Cannot_find_name_0",v[v.Module_0_has_no_exported_member_1=2305]="Module_0_has_no_exported_member_1",v[v.An_interface_can_only_extend_an_interface=2312]="An_interface_can_only_extend_an_interface",v[v.Generic_type_0_requires_1_type_argument_s=2314]="Generic_type_0_requires_1_type_argument_s",v[v.Type_0_is_not_generic=2315]="Type_0_is_not_generic",v[v.Type_0_is_not_assignable_to_type_1=2322]="Type_0_is_not_assignable_to_type_1",v[v.Property_0_is_private_in_type_1_but_not_in_type_2=2325]="Property_0_is_private_in_type_1_but_not_in_type_2",v[v.Index_signature_is_missing_in_type_0=2329]="Index_signature_is_missing_in_type_0",v[v._this_cannot_be_referenced_in_current_location=2332]="_this_cannot_be_referenced_in_current_location",v[v._this_cannot_be_referenced_in_constructor_arguments=2333]="_this_cannot_be_referenced_in_constructor_arguments",v[v._super_can_only_be_referenced_in_a_derived_class=2335]="_super_can_only_be_referenced_in_a_derived_class",v[v._super_cannot_be_referenced_in_constructor_arguments=2336]="_super_cannot_be_referenced_in_constructor_arguments",v[v.Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors=2337]="Super_calls_are_not_permitted_outside_constructors_or_in_nested_functions_inside_constructors",v[v.Property_0_does_not_exist_on_type_1=2339]="Property_0_does_not_exist_on_type_1",v[v.Property_0_is_private_and_only_accessible_within_class_1=2341]="Property_0_is_private_and_only_accessible_within_class_1",v[v.Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures=2349]="Cannot_invoke_an_expression_whose_type_lacks_a_call_signature_Type_0_has_no_compatible_call_signatures",v[v.This_expression_is_not_constructable=2351]="This_expression_is_not_constructable",v[v.A_function_whose_declared_type_is_not_void_must_return_a_value=2355]="A_function_whose_declared_type_is_not_void_must_return_a_value",v[v.The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access=2357]="The_operand_of_an_increment_or_decrement_operator_must_be_a_variable_or_a_property_access",v[v.The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access=2364]="The_left_hand_side_of_an_assignment_expression_must_be_a_variable_or_a_property_access",v[v.Operator_0_cannot_be_applied_to_types_1_and_2=2365]="Operator_0_cannot_be_applied_to_types_1_and_2",v[v.A_super_call_must_be_the_first_statement_in_the_constructor=2376]="A_super_call_must_be_the_first_statement_in_the_constructor",v[v.Constructors_for_derived_classes_must_contain_a_super_call=2377]="Constructors_for_derived_classes_must_contain_a_super_call",v[v._get_and_set_accessor_must_have_the_same_type=2380]="_get_and_set_accessor_must_have_the_same_type",v[v.Overload_signatures_must_all_be_public_private_or_protected=2385]="Overload_signatures_must_all_be_public_private_or_protected",v[v.Constructor_implementation_is_missing=2390]="Constructor_implementation_is_missing",v[v.Function_implementation_is_missing_or_not_immediately_following_the_declaration=2391]="Function_implementation_is_missing_or_not_immediately_following_the_declaration",v[v.Multiple_constructor_implementations_are_not_allowed=2392]="Multiple_constructor_implementations_are_not_allowed",v[v.Duplicate_function_implementation=2393]="Duplicate_function_implementation",v[v.This_overload_signature_is_not_compatible_with_its_implementation_signature=2394]="This_overload_signature_is_not_compatible_with_its_implementation_signature",v[v.Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local=2395]="Individual_declarations_in_merged_declaration_0_must_be_all_exported_or_all_local",v[v.Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2=2416]="Property_0_in_type_1_is_not_assignable_to_the_same_property_in_base_type_2",v[v.A_class_can_only_implement_an_interface=2422]="A_class_can_only_implement_an_interface",v[v.A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged=2434]="A_namespace_declaration_cannot_be_located_prior_to_a_class_or_function_with_which_it_is_merged",v[v.Types_have_separate_declarations_of_a_private_property_0=2442]="Types_have_separate_declarations_of_a_private_property_0",v[v.Property_0_is_protected_in_type_1_but_public_in_type_2=2444]="Property_0_is_protected_in_type_1_but_public_in_type_2",v[v.Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses=2445]="Property_0_is_protected_and_only_accessible_within_class_1_and_its_subclasses",v[v.Variable_0_used_before_its_declaration=2448]="Variable_0_used_before_its_declaration",v[v.Cannot_redeclare_block_scoped_variable_0=2451]="Cannot_redeclare_block_scoped_variable_0",v[v.The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly=2453]="The_type_argument_for_type_parameter_0_cannot_be_inferred_from_the_usage_Consider_specifying_the_type_arguments_explicitly",v[v.Variable_0_is_used_before_being_assigned=2454]="Variable_0_is_used_before_being_assigned",v[v.Type_alias_0_circularly_references_itself=2456]="Type_alias_0_circularly_references_itself",v[v.Type_0_has_no_property_1=2460]="Type_0_has_no_property_1",v[v.The_0_operator_cannot_be_applied_to_type_1=2469]="The_0_operator_cannot_be_applied_to_type_1",v[v.In_const_enum_declarations_member_initializer_must_be_constant_expression=2474]="In_const_enum_declarations_member_initializer_must_be_constant_expression",v[v.A_const_enum_member_can_only_be_accessed_using_a_string_literal=2476]="A_const_enum_member_can_only_be_accessed_using_a_string_literal",v[v.Export_declaration_conflicts_with_exported_declaration_of_0=2484]="Export_declaration_conflicts_with_exported_declaration_of_0",v[v._0_is_referenced_directly_or_indirectly_in_its_own_base_expression=2506]="_0_is_referenced_directly_or_indirectly_in_its_own_base_expression",v[v.Cannot_create_an_instance_of_an_abstract_class=2511]="Cannot_create_an_instance_of_an_abstract_class",v[v.Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_2=2515]="Non_abstract_class_0_does_not_implement_inherited_abstract_member_1_from_2",v[v.Object_is_possibly_null=2531]="Object_is_possibly_null",v[v.Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property=2540]="Cannot_assign_to_0_because_it_is_a_constant_or_a_read_only_property",v[v.The_target_of_an_assignment_must_be_a_variable_or_a_property_access=2541]="The_target_of_an_assignment_must_be_a_variable_or_a_property_access",v[v.Index_signature_in_type_0_only_permits_reading=2542]="Index_signature_in_type_0_only_permits_reading",v[v.Expected_0_arguments_but_got_1=2554]="Expected_0_arguments_but_got_1",v[v.Expected_at_least_0_arguments_but_got_1=2555]="Expected_at_least_0_arguments_but_got_1",v[v.Expected_0_type_arguments_but_got_1=2558]="Expected_0_type_arguments_but_got_1",v[v.Property_0_has_no_initializer_and_is_not_assigned_in_the_constructor_before_this_is_used_or_returned=2564]="Property_0_has_no_initializer_and_is_not_assigned_in_the_constructor_before_this_is_used_or_returned",v[v.Property_0_is_used_before_being_assigned=2565]="Property_0_is_used_before_being_assigned",v[v._0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property=2610]="_0_is_defined_as_an_accessor_in_class_1_but_is_overridden_here_in_2_as_an_instance_property",v[v._0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor=2611]="_0_is_defined_as_a_property_in_class_1_but_is_overridden_here_in_2_as_an_accessor",v[v.A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums=2651]="A_member_initializer_in_a_enum_declaration_cannot_reference_members_declared_after_it_including_members_defined_in_other_enums",v[v.Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration=2673]="Constructor_of_class_0_is_private_and_only_accessible_within_the_class_declaration",v[v.Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration=2674]="Constructor_of_class_0_is_protected_and_only_accessible_within_the_class_declaration",v[v.Cannot_extend_a_class_0_Class_constructor_is_marked_as_private=2675]="Cannot_extend_a_class_0_Class_constructor_is_marked_as_private",v[v.The_this_types_of_each_signature_are_incompatible=2685]="The_this_types_of_each_signature_are_incompatible",v[v.Namespace_0_has_no_exported_member_1=2694]="Namespace_0_has_no_exported_member_1",v[v.Namespace_can_only_have_declarations=2695]="Namespace_can_only_have_declarations",v[v.Required_type_parameters_may_not_follow_optional_type_parameters=2706]="Required_type_parameters_may_not_follow_optional_type_parameters",v[v.Duplicate_property_0=2718]="Duplicate_property_0",v[v.Property_0_is_missing_in_type_1_but_required_in_type_2=2741]="Property_0_is_missing_in_type_1_but_required_in_type_2",v[v.Type_0_has_no_call_signatures=2757]="Type_0_has_no_call_signatures",v[v.Get_accessor_0_must_be_at_least_as_accessible_as_the_setter=2808]="Get_accessor_0_must_be_at_least_as_accessible_as_the_setter",v[v.This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0=4117]="This_member_cannot_have_an_override_modifier_because_it_is_not_declared_in_the_base_class_0",v[v.File_0_not_found=6054]="File_0_not_found",v[v.Numeric_separators_are_not_allowed_here=6188]="Numeric_separators_are_not_allowed_here",v[v.Multiple_consecutive_numeric_separators_are_not_permitted=6189]="Multiple_consecutive_numeric_separators_are_not_permitted",v[v.This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without=6234]="This_expression_is_not_callable_because_it_is_a_get_accessor_Did_you_mean_to_use_it_without",v[v._super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class=17009]="_super_must_be_called_before_accessing_this_in_the_constructor_of_a_derived_class",v[v._super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class=17011]="_super_must_be_called_before_accessing_a_property_of_super_in_the_constructor_of_a_derived_class",v[v.A_struct_cannot_be_both_managed_and_unmanaged=6390]="A_struct_cannot_be_both_managed_and_unmanaged",v[v.A_struct_cannot_be_both_inline_and_managed=6391]="A_struct_cannot_be_both_inline_and_managed",v[v.A_memory_model_decorator_must_precede_the_type_it_applies_to_0=6392]="A_memory_model_decorator_must_precede_the_type_it_applies_to_0",v[v.Only_one_memory_model_decorator_may_apply_to_a_use=6393]="Only_one_memory_model_decorator_may_apply_to_a_use",v[v.Type_0_has_no_GC_header_so_a_use_cannot_make_it_managed_declare_the_record_managed_instead=6394]="Type_0_has_no_GC_header_so_a_use_cannot_make_it_managed_declare_the_record_managed_instead",v[v.Type_0_is_a_value_with_no_address_so_a_use_cannot_view_it_as_1_use_the_value_or_keep_it_inline=6395]="Type_0_is_a_value_with_no_address_so_a_use_cannot_view_it_as_1_use_the_value_or_keep_it_inline",v[v.A_lazy_decorator_must_precede_the_expression_it_defers_not_follow_a_type=6396]="A_lazy_decorator_must_precede_the_expression_it_defers_not_follow_a_type",v[v._lazy_expressions_must_be_the_initializer_of_a_variable_declaration=6397]="_lazy_expressions_must_be_the_initializer_of_a_variable_declaration",v[v.A_lazy_expression_in_this_position_is_not_lowered_it_is_evaluated_eagerly=6398]="A_lazy_expression_in_this_position_is_not_lowered_it_is_evaluated_eagerly",v[v.A_lazy_await_binding_needs_a_declared_type_the_memo_cells_are_lifted_into_the_task_s_state_struct_and_a_state_field_needs_a_syntactic_type_0=6399]="A_lazy_await_binding_needs_a_declared_type_the_memo_cells_are_lifted_into_the_task_s_state_struct_and_a_state_field_needs_a_syntactic_type_0",v[v.A_lazy_await_binding_cannot_be_read_from_a_nested_function_a_capture_moves_the_storage_and_the_memo_cell_is_a_state_field_0=6400]="A_lazy_await_binding_cannot_be_read_from_a_nested_function_a_capture_moves_the_storage_and_the_memo_cell_is_a_state_field_0",v[v.A_spawn_produces_a_Task_this_one_is_never_awaited_so_the_task_s_result_is_discarded=6401]="A_spawn_produces_a_Task_this_one_is_never_awaited_so_the_task_s_result_is_discarded",v[v.An_await_forces_an_immediate_read_of_lazy_so_the_deferral_is_nullified_drop_the_lazy_or_remove_the_await=6402]="An_await_forces_an_immediate_read_of_lazy_so_the_deferral_is_nullified_drop_the_lazy_or_remove_the_await",v[v.An_enum_underlying_type_must_be_one_of_i8_u8_i16_u16_i32_or_u32_not_0=6403]="An_enum_underlying_type_must_be_one_of_i8_u8_i16_u16_i32_or_u32_not_0",v[v.Enum_member_0_does_not_fit_the_underlying_type_1=6404]="Enum_member_0_does_not_fit_the_underlying_type_1",v[v._abi_align_requires_a_single_integer_literal_argument_the_alignment_is_a_compile_time_constant_so_a_computed_value_cannot_be_read_where_the_layout_is_decided=6405]="_abi_align_requires_a_single_integer_literal_argument_the_alignment_is_a_compile_time_constant_so_a_computed_value_cannot_be_read_where_the_layout_is_decided",v[v._abi_align_0_the_alignment_must_be_at_least_1=6406]="_abi_align_0_the_alignment_must_be_at_least_1",v[v._abi_align_0_the_alignment_must_be_a_power_of_two=6407]="_abi_align_0_the_alignment_must_be_a_power_of_two",v[v._abi_align_0_is_less_than_the_field_type_s_natural_alignment_1_asking_for_less_is_a_lie_so_it_is_refused_rather_than_silently_ignored=6408]="_abi_align_0_is_less_than_the_field_type_s_natural_alignment_1_asking_for_less_is_a_lie_so_it_is_refused_rather_than_silently_ignored",v[v._abi_align_0_is_too_large_the_maximum_is_1=6409]="_abi_align_0_is_too_large_the_maximum_is_1",v[v.Alignment_is_a_property_of_the_field_not_its_type_Place_abi_align_N_on_the_field_declaration=6410]="Alignment_is_a_property_of_the_field_not_its_type_Place_abi_align_N_on_the_field_declaration",v[v.A_view_parameter_unmanaged_0_over_an_inline_type_cannot_appear_in_a_host_visible_signature_an_external_or_exported_parameter_is_supplied_by_the_host_and_a_view_is_an_address_this_compiler_did_not_materialise=6411]="A_view_parameter_unmanaged_0_over_an_inline_type_cannot_appear_in_a_host_visible_signature_an_external_or_exported_parameter_is_supplied_by_the_host_and_a_view_is_an_address_this_compiler_did_not_materialise",v[v.Call_to_0_emits_1_operands_but_its_signature_declares_2=6412]="Call_to_0_emits_1_operands_but_its_signature_declares_2",v))(Xe||{});function al(n){switch(n){case 100:return"Not implemented: {0}";case 101:return"Operation is unsafe.";case 102:return"User-defined: {0}";case 103:return"Feature '{0}' is not enabled.";case 104:return"Low memory limit exceeded by static data: {0} > {1}";case 105:return"Module requires at least '{0}' pages of initial memory.";case 106:return"Module requires at least '{0}' pages of maximum memory.";case 107:return"Shared memory requires maximum memory to be defined.";case 108:return"Shared memory requires feature 'threads' to be enabled.";case 109:return"Transform '{0}': {1}";case 110:return"Start function name '{0}' is invalid or conflicts with another export.";case 111:return"Element '{0}' not found.";case 112:return"Exchange of '{0}' values is not supported by all embeddings";case 200:return"Conversion from type '{0}' to '{1}' requires an explicit cast.";case 201:return"Conversion from type '{0}' to '{1}' will require an explicit cast when switching between 32/64-bit.";case 202:return"Type '{0}' cannot be changed to type '{1}'.";case 203:return"Operation '{0}' cannot be applied to type '{1}'.";case 204:return"Type '{0}' cannot be nullable.";case 206:return"Mutable value cannot be inlined.";case 207:return"Unmanaged classes cannot extend managed classes and vice-versa.";case 208:return"Unmanaged classes cannot implement interfaces.";case 209:return"Invalid regular expression flags.";case 210:return"Expression is never 'null'.";case 211:return"Class '{0}' is final and cannot be extended.";case 212:return"Decorator '{0}' is not valid here.";case 213:return"Duplicate decorator.";case 214:return"Type '{0}' is illegal in this context.";case 215:return"Optional parameter must have an initializer.";case 216:return"Class '{0}' cannot declare a constructor when instantiated from an object literal.";case 217:return"Function '{0}' cannot be inlined into itself.";case 218:return"Cannot access method '{0}' without calling it as it requires 'this' to be set.";case 219:return"Optional properties are not supported.";case 220:return"Expression must be a compile-time constant.";case 221:return"Type '{0}' is not a function index or function reference.";case 222:return"'{0}' must be a value between '{1}' and '{2}' inclusive.";case 223:return"'{0}' must be a power of two.";case 224:return"'{0}' is not a valid operator.";case 225:return"Expression cannot be represented by a type.";case 226:return"Expression resolves to unusual type '{0}'.";case 227:return"Array literal expected.";case 228:return"Function '{0}' is virtual and will not be inlined.";case 229:return"Property '{0}' only has a setter and is missing a getter.";case 230:return"'{0}' keyword cannot be used here.";case 231:return"A class with a constructor explicitly returning something else than 'this' must be '@final'.";case 233:return"Property '{0}' is always assigned before being used.";case 234:return"Expression does not compile to a value at runtime.";case 235:return"Only variables, functions and enums become WebAssembly module exports.";case 236:return"Literal '{0}' does not fit into 'i64' or 'u64' types.";case 237:return"Index signature accessors in type '{0}' differ in types.";case 238:return"Initializer, definitive assignment or nullable type expected.";case 239:return"Definitive assignment has no effect on local variables.";case 240:return"Ambiguous operator overload '{0}' (conflicting overloads '{1}' and '{2}').";case 241:return"An interface or abstract method '{0}' cannot have type parameters.";case 242:return"Cannot override generic method '{0}' with a non-generic method or vice versa.";case 901:return"Importing the table disables some indirect call optimizations.";case 902:return"Exporting the table disables some indirect call optimizations.";case 903:return"Expression compiles to a dynamic check at runtime.";case 904:return"Indexed access may involve bounds checking.";case 905:return"Explicitly returning constructor drops 'this' allocation.";case 906:return"Unnecessary definite assignment.";case 907:return"'NaN' does not compare equal to any other value including itself. Use isNaN(x) instead.";case 908:return"Comparison with -0.0 is sign insensitive. Use Object.is(x, -0.0) if the sign matters.";case 1002:return"Unterminated string literal.";case 1003:return"Identifier expected.";case 1005:return"'{0}' expected.";case 1006:return"A file cannot have a reference to itself.";case 1009:return"Trailing comma not allowed.";case 1012:return"Unexpected token.";case 1014:return"A rest parameter must be last in a parameter list.";case 1015:return"Parameter cannot have question mark and initializer.";case 1016:return"A required parameter cannot follow an optional parameter.";case 1031:return"'{0}' modifier cannot appear on class elements of this kind.";case 1036:return"Statements are not allowed in ambient contexts.";case 1039:return"Initializers are not allowed in ambient contexts.";case 1042:return"'{0}' modifier cannot be used here.";case 1047:return"A rest parameter cannot be optional.";case 1048:return"A rest parameter cannot have an initializer.";case 1049:return"A 'set' accessor must have exactly one parameter.";case 1052:return"A 'set' accessor parameter cannot have an initializer.";case 1054:return"A 'get' accessor cannot have parameters.";case 1061:return"Enum member must have initializer.";case 1092:return"Type parameters cannot appear on a constructor declaration.";case 1093:return"Type annotation cannot appear on a constructor declaration.";case 1094:return"An accessor cannot have type parameters.";case 1095:return"A 'set' accessor cannot have a return type annotation.";case 1098:return"Type parameter list cannot be empty.";case 1099:return"Type argument list cannot be empty.";case 1104:return"A 'continue' statement can only be used within an enclosing iteration statement.";case 1105:return"A 'break' statement can only be used within an enclosing iteration or switch statement.";case 1108:return"A 'return' statement can only be used within a function body.";case 1109:return"Expression expected.";case 1110:return"Type expected.";case 1113:return"A 'default' clause cannot appear more than once in a 'switch' statement.";case 1114:return"Duplicate label '{0}'.";case 1120:return"An export assignment cannot have modifiers.";case 1121:return"Octal literals are not allowed in strict mode.";case 1124:return"Digit expected.";case 1125:return"Hexadecimal digit expected.";case 1126:return"Unexpected end of text.";case 1127:return"Invalid character.";case 1130:return"'case' or 'default' expected.";case 1034:return"'super' must be followed by an argument list or member access.";case 1038:return"A 'declare' modifier cannot be used in an already ambient context.";case 1140:return"Type argument expected.";case 1141:return"String literal expected.";case 1142:return"Line break not permitted here.";case 1146:return"Declaration expected.";case 1155:return"'const' declarations must be initialized.";case 1161:return"Unterminated regular expression literal.";case 1263:return"Declarations with initializers cannot also have definite assignment assertions.";case 1176:return"Interface declaration cannot have 'implements' clause.";case 1177:return"Binary digit expected.";case 1178:return"Octal digit expected.";case 1183:return"An implementation cannot be declared in ambient contexts.";case 1190:return"The variable declaration of a 'for...of' statement cannot have an initializer.";case 1198:return"An extended Unicode escape value must be between 0x0 and 0x10FFFF inclusive.";case 1199:return"Unterminated Unicode escape sequence.";case 1206:return"Decorators are not valid here.";case 1242:return"'abstract' modifier can only appear on a class, method, or property declaration.";case 1245:return"Method '{0}' cannot have an implementation because it is marked abstract.";case 1246:return"An interface property cannot have an initializer.";case 1255:return"A definite assignment assertion '!' is not permitted in this context.";case 1308:return"'await' expressions are only allowed within async functions and at the top levels of modules.";case 1311:return"A class may only extend another class.";case 1317:return"A parameter property cannot be declared using a rest parameter.";case 1319:return"A default export can only be used in a module.";case 1345:return"An expression of type '{0}' cannot be tested for truthiness.";case 1351:return"An identifier or keyword cannot immediately follow a numeric literal.";case 2300:return"Duplicate identifier '{0}'.";case 2304:return"Cannot find name '{0}'.";case 2305:return"Module '{0}' has no exported member '{1}'.";case 2312:return"An interface can only extend an interface.";case 2314:return"Generic type '{0}' requires {1} type argument(s).";case 2315:return"Type '{0}' is not generic.";case 2322:return"Type '{0}' is not assignable to type '{1}'.";case 2325:return"Property '{0}' is private in type '{1}' but not in type '{2}'.";case 2329:return"Index signature is missing in type '{0}'.";case 2332:return"'this' cannot be referenced in current location.";case 2333:return"'this' cannot be referenced in constructor arguments.";case 2335:return"'super' can only be referenced in a derived class.";case 2336:return"'super' cannot be referenced in constructor arguments.";case 2337:return"Super calls are not permitted outside constructors or in nested functions inside constructors.";case 2339:return"Property '{0}' does not exist on type '{1}'.";case 2341:return"Property '{0}' is private and only accessible within class '{1}'.";case 2349:return"Cannot invoke an expression whose type lacks a call signature. Type '{0}' has no compatible call signatures.";case 2351:return"This expression is not constructable.";case 2355:return"A function whose declared type is not 'void' must return a value.";case 2357:return"The operand of an increment or decrement operator must be a variable or a property access.";case 2364:return"The left-hand side of an assignment expression must be a variable or a property access.";case 2365:return"Operator '{0}' cannot be applied to types '{1}' and '{2}'.";case 2376:return"A 'super' call must be the first statement in the constructor.";case 2377:return"Constructors for derived classes must contain a 'super' call.";case 2380:return"'get' and 'set' accessor must have the same type.";case 2385:return"Overload signatures must all be public, private or protected.";case 2390:return"Constructor implementation is missing.";case 2391:return"Function implementation is missing or not immediately following the declaration.";case 2392:return"Multiple constructor implementations are not allowed.";case 2393:return"Duplicate function implementation.";case 2394:return"This overload signature is not compatible with its implementation signature.";case 2395:return"Individual declarations in merged declaration '{0}' must be all exported or all local.";case 2416:return"Property '{0}' in type '{1}' is not assignable to the same property in base type '{2}'.";case 2422:return"A class can only implement an interface.";case 2434:return"A namespace declaration cannot be located prior to a class or function with which it is merged.";case 2442:return"Types have separate declarations of a private property '{0}'.";case 2444:return"Property '{0}' is protected in type '{1}' but public in type '{2}'.";case 2445:return"Property '{0}' is protected and only accessible within class '{1}' and its subclasses.";case 2448:return"Variable '{0}' used before its declaration.";case 2451:return"Cannot redeclare block-scoped variable '{0}'";case 2453:return"The type argument for type parameter '{0}' cannot be inferred from the usage. Consider specifying the type arguments explicitly.";case 2454:return"Variable '{0}' is used before being assigned.";case 2456:return"Type alias '{0}' circularly references itself.";case 2460:return"Type '{0}' has no property '{1}'.";case 2469:return"The '{0}' operator cannot be applied to type '{1}'.";case 2474:return"In 'const' enum declarations member initializer must be constant expression.";case 2476:return"A const enum member can only be accessed using a string literal.";case 2484:return"Export declaration conflicts with exported declaration of '{0}'.";case 2506:return"'{0}' is referenced directly or indirectly in its own base expression.";case 2511:return"Cannot create an instance of an abstract class.";case 2515:return"Non-abstract class '{0}' does not implement inherited abstract member '{1}' from '{2}'.";case 2531:return"Object is possibly 'null'.";case 2540:return"Cannot assign to '{0}' because it is a constant or a read-only property.";case 2541:return"The target of an assignment must be a variable or a property access.";case 2542:return"Index signature in type '{0}' only permits reading.";case 2554:return"Expected {0} arguments, but got {1}.";case 2555:return"Expected at least {0} arguments, but got {1}.";case 2558:return"Expected {0} type arguments, but got {1}.";case 2564:return"Property '{0}' has no initializer and is not assigned in the constructor before 'this' is used or returned.";case 2565:return"Property '{0}' is used before being assigned.";case 2610:return"'{0}' is defined as an accessor in class '{1}', but is overridden here in '{2}' as an instance property.";case 2611:return"'{0}' is defined as a property in class '{1}', but is overridden here in '{2}' as an accessor.";case 2651:return"A member initializer in a enum declaration cannot reference members declared after it, including members defined in other enums.";case 2673:return"Constructor of class '{0}' is private and only accessible within the class declaration.";case 2674:return"Constructor of class '{0}' is protected and only accessible within the class declaration.";case 2675:return"Cannot extend a class '{0}'. Class constructor is marked as private.";case 2685:return"The 'this' types of each signature are incompatible.";case 2694:return"Namespace '{0}' has no exported member '{1}'.";case 2695:return"Namespace can only have declarations.";case 2706:return"Required type parameters may not follow optional type parameters.";case 2718:return"Duplicate property '{0}'.";case 2741:return"Property '{0}' is missing in type '{1}' but required in type '{2}'.";case 2757:return"Type '{0}' has no call signatures.";case 2808:return"Get accessor '{0}' must be at least as accessible as the setter.";case 4117:return"This member cannot have an 'override' modifier because it is not declared in the base class '{0}'.";case 6054:return"File '{0}' not found.";case 6188:return"Numeric separators are not allowed here.";case 6189:return"Multiple consecutive numeric separators are not permitted.";case 6234:return"This expression is not callable because it is a 'get' accessor. Did you mean to use it without '()'?";case 17009:return"'super' must be called before accessing 'this' in the constructor of a derived class.";case 17011:return"'super' must be called before accessing a property of 'super' in the constructor of a derived class.";case 6390:return"A struct cannot be both '@managed' and '@unmanaged'.";case 6391:return"A struct cannot be both '@inline' and '@managed'.";case 6392:return"A memory-model decorator must precede the type it applies to: '{0}'.";case 6393:return"Only one memory-model decorator may apply to a use.";case 6394:return"Type '{0}' has no GC header, so a use cannot make it '@managed'; declare the record '@managed' instead.";case 6395:return"Type '{0}' is a value with no address, so a use cannot view it as '{1}'; use the value, or keep it '@inline'.";case 6396:return"A '@lazy' decorator must precede the expression it defers, not follow a type.";case 6397:return"'@lazy' expressions must be the initializer of a variable declaration.";case 6398:return"A '@lazy' expression in this position is not lowered; it is evaluated eagerly.";case 6399:return"A '@lazy await' binding needs a declared type: the memo cells are lifted into the task's state struct, and a state field needs a syntactic type ('{0}').";case 6400:return"A '@lazy await' binding cannot be read from a nested function: a capture moves the storage, and the memo cell is a state field ('{0}').";case 6401:return"A 'spawn' produces a Task; this one is never awaited, so the task's result is discarded.";case 6402:return"An 'await' forces an immediate read of '@lazy', so the deferral is nullified; drop the '@lazy', or remove the 'await'.";case 6403:return"An enum underlying type must be one of i8, u8, i16, u16, i32 or u32, not '{0}'.";case 6404:return"Enum member '{0}' does not fit the underlying type '{1}'.";case 6405:return"'@abi.align' requires a single integer literal argument; the alignment is a compile-time constant, so a computed value cannot be read where the layout is decided.";case 6406:return"'@abi.align({0})': the alignment must be at least 1.";case 6407:return"'@abi.align({0})': the alignment must be a power of two.";case 6408:return"'@abi.align({0})' is less than the field type's natural alignment ({1}); asking for less is a lie, so it is refused rather than silently ignored.";case 6409:return"'@abi.align({0})' is too large; the maximum is {1}.";case 6410:return"Alignment is a property of the field, not its type. Place '@abi.align(N)' on the field declaration.";case 6411:return"A view parameter ('@unmanaged {0}' over an inline type) cannot appear in a host-visible signature: an '@external' or exported parameter is supplied by the host, and a view is an address this compiler did not materialise.";case 6412:return"Call to '{0}' emits {1} operands but its signature declares {2}.";default:return""}}var Xp={};zu(Xp,{BitSet:()=>Vp,COLOR_BLUE:()=>l1,COLOR_CYAN:()=>Hp,COLOR_GRAY:()=>s1,COLOR_GREEN:()=>a1,COLOR_MAGENTA:()=>Kp,COLOR_RED:()=>dl,COLOR_RESET:()=>as,COLOR_WHITE:()=>o1,COLOR_YELLOW:()=>Wp,CharCode:()=>yt,SURROGATE_HIGH:()=>ns,SURROGATE_LOW:()=>Kn,accuratePow64:()=>ol,cloneMap:()=>me,colorize:()=>u1,combineSurrogates:()=>is,dirname:()=>Mb,escapeString:()=>Re,getMapEntry:()=>J,indent:()=>W,isAlpha:()=>qp,isAlphaOrDecimal:()=>Lb,isColorsEnabled:()=>Xn,isDecimal:()=>gt,isHexBase:()=>ss,isHexOrDecimal:()=>XE,isHighSurrogate:()=>Hn,isIdentifier:()=>Ze,isIdentifierPart:()=>Qn,isIdentifierStart:()=>jn,isLineBreak:()=>Ht,isLowSurrogate:()=>cl,isOctal:()=>pl,isPowerOf2:()=>Hr,isSurrogate:()=>HE,isSurrogateHigh:()=>jE,isSurrogateLow:()=>QE,isWhiteSpace:()=>rs,mergeMaps:()=>KE,normalizePath:()=>Xr,numCodeUnits:()=>jr,readF32:()=>OE,readF64:()=>qE,readI16:()=>VE,readI32:()=>qn,readI64:()=>Nb,readI8:()=>UE,readV128:()=>WE,resolvePath:()=>fl,setColorsEnabled:()=>hl,v128_ones:()=>Qp,v128_zero:()=>jp,writeF32:()=>Wr,writeF64:()=>Kr,writeI16:()=>br,writeI32:()=>Se,writeI32AsI64:()=>ll,writeI64:()=>Wn,writeI64AsI32:()=>Gp,writeI8:()=>be,writeV128:()=>Up});function UE(n,r){return n[r]}function be(n,r,e){r[e]=n}function VE(n,r){return i32(n[r])|i32(n[r+1])<<8}function br(n,r,e){r[e]=n,r[e+1]=n>>>8}function qn(n,r){return i32(n[r])|i32(n[r+1])<<8|i32(n[r+2])<<16|i32(n[r+3])<<24}function Se(n,r,e){r[e]=n,r[e+1]=n>>>8,r[e+2]=n>>>16,r[e+3]=n>>>24}function ll(n,r,e,t=!1){Se(n,r,e),Se(t||n>=0?0:-1,r,e+4)}function Nb(n,r){let e=qn(n,r),t=qn(n,r+4);return i64_new(e,t)}function Wn(n,r,e){Se(i64_low(n),r,e),Se(i64_high(n),r,e+4)}function Gp(n,r,e,t=!1){assert(t?i64_is_u32(n):i64_is_i32(n)),Se(i64_low(n),r,e)}function OE(n,r){return i32_as_f32(qn(n,r))}function Wr(n,r,e){Se(f32_as_i32(n),r,e)}function qE(n,r){return i64_as_f64(Nb(n,r))}function Kr(n,r,e){let t=f64_as_i64(n);Se(i64_low(t),r,e),Se(i64_high(t),r,e+4)}function WE(n,r){return n.slice(r,r+16)}function Up(n,r,e){assert(n.length==16),r.set(n,e)}function J(n,r){return n.has(r)?n.get(r):null}function me(n){if(ASC_TARGET){let r=new Map;if(n)for(let e=Map_keys(n),t=0,i=e.length;t<i;++t){let s=unchecked(e[t]),a=assert(n.get(s));r.set(s,a)}return r}else return new Map(n)}function KE(n,r){if(ASC_TARGET){let e=new Map;for(let t=Map_keys(n),i=0,s=t.length;i<s;++i){let a=unchecked(t[i]),l=assert(n.get(a));e.set(a,l)}for(let t=Map_keys(r),i=0,s=t.length;i<s;++i){let a=unchecked(t[i]),l=assert(r.get(a));e.set(a,l)}return e}else{let e=new Map(n);return r.forEach((t,i)=>e.set(i,t)),e}}var Vp=class{constructor(){this.clear()}get size(){let r=0,e=this.words;for(let t=0,i=e.length;t<i;t++){let s=unchecked(e[t]);s&&(r+=popcnt(s))}return r}add(r){let e=r>>>5,t=this.words;return e>=t.length&&(this.words=new Uint32Array(e+16),this.words.set(t),t=this.words),unchecked(t[e]|=1<<r),this}delete(r){let e=r>>>5,t=this.words;e>=t.length||unchecked(t[e]&=~(1<<r))}has(r){let e=r>>>5,t=this.words;return e>=t.length?!1:(unchecked(t[r>>>5])&1<<r)!==0}clear(){this.words=new Uint32Array(16)}toArray(){let r=new Array(this.size);for(let e=0,t=0,i=this.words.length;e<i;++e){let s=unchecked(this.words[e]);for(;s;){let a=s&-s;unchecked(r[t++]=(e<<5)+popcnt(a-1)),s^=a}}return r}toString(){return`BitSet { ${this.toArray()} }`}};function Hr(n){return n!=0&&(n&n-1)==0}function ol(n,r){return ASC_TARGET?Math.pow(n,r):f64_pow(n,r)}var yt=(T=>(T[T.Null=0]="Null",T[T.LineFeed=10]="LineFeed",T[T.CarriageReturn=13]="CarriageReturn",T[T.LineSeparator=8232]="LineSeparator",T[T.ParagraphSeparator=8233]="ParagraphSeparator",T[T.NextLine=133]="NextLine",T[T.Space=32]="Space",T[T.NonBreakingSpace=160]="NonBreakingSpace",T[T.EnQuad=8192]="EnQuad",T[T.EmQuad=8193]="EmQuad",T[T.EnSpace=8194]="EnSpace",T[T.EmSpace=8195]="EmSpace",T[T.ThreePerEmSpace=8196]="ThreePerEmSpace",T[T.FourPerEmSpace=8197]="FourPerEmSpace",T[T.SixPerEmSpace=8198]="SixPerEmSpace",T[T.FigureSpace=8199]="FigureSpace",T[T.PunctuationSpace=8200]="PunctuationSpace",T[T.ThinSpace=8201]="ThinSpace",T[T.HairSpace=8202]="HairSpace",T[T.ZeroWidthSpace=8203]="ZeroWidthSpace",T[T.NarrowNoBreakSpace=8239]="NarrowNoBreakSpace",T[T.IdeographicSpace=12288]="IdeographicSpace",T[T.MathematicalSpace=8287]="MathematicalSpace",T[T.Ogham=5760]="Ogham",T[T._=95]="_",T[T._0=48]="_0",T[T._1=49]="_1",T[T._2=50]="_2",T[T._3=51]="_3",T[T._4=52]="_4",T[T._5=53]="_5",T[T._6=54]="_6",T[T._7=55]="_7",T[T._8=56]="_8",T[T._9=57]="_9",T[T.a=97]="a",T[T.b=98]="b",T[T.c=99]="c",T[T.d=100]="d",T[T.e=101]="e",T[T.f=102]="f",T[T.g=103]="g",T[T.h=104]="h",T[T.i=105]="i",T[T.j=106]="j",T[T.k=107]="k",T[T.l=108]="l",T[T.m=109]="m",T[T.n=110]="n",T[T.o=111]="o",T[T.p=112]="p",T[T.q=113]="q",T[T.r=114]="r",T[T.s=115]="s",T[T.t=116]="t",T[T.u=117]="u",T[T.v=118]="v",T[T.w=119]="w",T[T.x=120]="x",T[T.y=121]="y",T[T.z=122]="z",T[T.A=65]="A",T[T.B=66]="B",T[T.C=67]="C",T[T.D=68]="D",T[T.E=69]="E",T[T.F=70]="F",T[T.G=71]="G",T[T.H=72]="H",T[T.I=73]="I",T[T.J=74]="J",T[T.K=75]="K",T[T.L=76]="L",T[T.M=77]="M",T[T.N=78]="N",T[T.O=79]="O",T[T.P=80]="P",T[T.Q=81]="Q",T[T.R=82]="R",T[T.S=83]="S",T[T.T=84]="T",T[T.U=85]="U",T[T.V=86]="V",T[T.W=87]="W",T[T.X=88]="X",T[T.Y=89]="Y",T[T.Z=90]="Z",T[T.Ampersand=38]="Ampersand",T[T.Asterisk=42]="Asterisk",T[T.At=64]="At",T[T.Backslash=92]="Backslash",T[T.Backtick=96]="Backtick",T[T.Bar=124]="Bar",T[T.Caret=94]="Caret",T[T.CloseBrace=125]="CloseBrace",T[T.CloseBracket=93]="CloseBracket",T[T.CloseParen=41]="CloseParen",T[T.Colon=58]="Colon",T[T.Comma=44]="Comma",T[T.Dollar=36]="Dollar",T[T.Dot=46]="Dot",T[T.DoubleQuote=34]="DoubleQuote",T[T.Equals=61]="Equals",T[T.Exclamation=33]="Exclamation",T[T.GreaterThan=62]="GreaterThan",T[T.Hash=35]="Hash",T[T.LessThan=60]="LessThan",T[T.Minus=45]="Minus",T[T.OpenBrace=123]="OpenBrace",T[T.OpenBracket=91]="OpenBracket",T[T.OpenParen=40]="OpenParen",T[T.Percent=37]="Percent",T[T.Plus=43]="Plus",T[T.Question=63]="Question",T[T.Semicolon=59]="Semicolon",T[T.SingleQuote=39]="SingleQuote",T[T.Slash=47]="Slash",T[T.Tilde=126]="Tilde",T[T.Backspace=8]="Backspace",T[T.FormFeed=12]="FormFeed",T[T.ByteOrderMark=65279]="ByteOrderMark",T[T.Tab=9]="Tab",T[T.VerticalTab=11]="VerticalTab",T))(yt||{});function Ht(n){switch(n){case 10:case 13:case 8232:case 8233:return!0;default:return!1}}function rs(n){switch(n){case 32:case 9:case 11:case 12:case 160:case 133:case 5760:case 8239:case 8287:case 12288:case 65279:return!0;default:return n>=8192&&n<=8203}}var ns=55296,Kn=56320;function HE(n){return(n&63488)==ns}function jE(n){return n<Kn}function QE(n){return n>=Kn}function Hn(n){return(n&64512)==ns}function cl(n){return(n&64512)==Kn}function is(n,r){return 65536+((n&1023)<<10)|r&1023}function jr(n){return 1+i32(n>65535)}function qp(n){let r=n|32;return r>=97&&r<=122}function gt(n){return n>=48&&n<=57}function pl(n){return n>=48&&n<=55}function ss(n){let r=n|32;return r>=97&&r<=102}function XE(n){return gt(n)||ss(n)}function Lb(n){return qp(n)||gt(n)}function jn(n){return qp(n)||n==95||n==36||n>=$E&&n<=YE&&Bb(n,ZE)}function Qn(n){return Lb(n)||n==95||n==36||n>=e1&&n<=t1&&Bb(n,JE)}function Ze(n){let r=n.length;if(!r)return!1;let e=n.codePointAt(0);if(!jn(e))return!1;let t=jr(e);for(;t<r;){if(e=n.codePointAt(t),!Qn(e))return!1;t+=jr(e)}return!0}var ZE=[170,170,181,181,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,880,884,886,887,890,893,895,895,902,902,904,906,908,908,910,929,931,1013,1015,1153,1162,1327,1329,1366,1369,1369,1376,1416,1488,1514,1519,1522,1568,1610,1646,1647,1649,1747,1749,1749,1765,1766,1774,1775,1786,1788,1791,1791,1808,1808,1810,1839,1869,1957,1969,1969,1994,2026,2036,2037,2042,2042,2048,2069,2074,2074,2084,2084,2088,2088,2112,2136,2144,2154,2160,2183,2185,2191,2208,2249,2308,2361,2365,2365,2384,2384,2392,2401,2417,2432,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2493,2493,2510,2510,2524,2525,2527,2529,2544,2545,2556,2556,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2649,2652,2654,2654,2674,2676,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2749,2749,2768,2768,2784,2785,2809,2809,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2877,2877,2908,2909,2911,2913,2929,2929,2947,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3024,3024,3077,3084,3086,3088,3090,3112,3114,3129,3133,3133,3160,3162,3164,3165,3168,3169,3200,3200,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3261,3261,3292,3294,3296,3297,3313,3314,3332,3340,3342,3344,3346,3386,3389,3389,3406,3406,3412,3414,3423,3425,3450,3455,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3585,3632,3634,3635,3648,3654,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3760,3762,3763,3773,3773,3776,3780,3782,3782,3804,3807,3840,3840,3904,3911,3913,3948,3976,3980,4096,4138,4159,4159,4176,4181,4186,4189,4193,4193,4197,4198,4206,4208,4213,4225,4238,4238,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5905,5919,5937,5952,5969,5984,5996,5998,6e3,6016,6067,6103,6103,6108,6108,6176,6264,6272,6312,6314,6314,6320,6389,6400,6430,6480,6509,6512,6516,6528,6571,6576,6601,6656,6678,6688,6740,6823,6823,6917,6963,6981,6988,7043,7072,7086,7087,7098,7141,7168,7203,7245,7247,7258,7293,7296,7306,7312,7354,7357,7359,7401,7404,7406,7411,7413,7414,7418,7418,7424,7615,7680,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8305,8305,8319,8319,8336,8348,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11492,11499,11502,11506,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11648,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,12293,12295,12321,12329,12337,12341,12344,12348,12353,12438,12443,12447,12449,12538,12540,12543,12549,12591,12593,12686,12704,12735,12784,12799,13312,19903,19968,42124,42192,42237,42240,42508,42512,42527,42538,42539,42560,42606,42623,42653,42656,42735,42775,42783,42786,42888,42891,42972,42993,43009,43011,43013,43015,43018,43020,43042,43072,43123,43138,43187,43250,43255,43259,43259,43261,43262,43274,43301,43312,43334,43360,43388,43396,43442,43471,43471,43488,43492,43494,43503,43514,43518,43520,43560,43584,43586,43588,43595,43616,43638,43642,43642,43646,43695,43697,43697,43701,43702,43705,43709,43712,43712,43714,43714,43739,43741,43744,43754,43762,43764,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43881,43888,44002,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64285,64287,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65136,65140,65142,65276,65313,65338,65345,65370,65382,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66176,66204,66208,66256,66304,66335,66349,66378,66384,66421,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66736,66771,66776,66811,66816,66855,66864,66915,66928,66938,66940,66954,66956,66962,66964,66965,66967,66977,66979,66993,66995,67001,67003,67004,67008,67059,67072,67382,67392,67413,67424,67431,67456,67461,67463,67504,67506,67514,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67904,67929,67968,68023,68030,68031,68096,68096,68112,68115,68117,68119,68121,68149,68192,68220,68224,68252,68288,68295,68297,68324,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68899,68938,68965,68975,68997,69248,69289,69296,69297,69314,69319,69376,69404,69415,69415,69424,69445,69488,69505,69552,69572,69600,69622,69635,69687,69745,69746,69749,69749,69763,69807,69840,69864,69891,69926,69956,69956,69959,69959,69968,70002,70006,70006,70019,70066,70081,70084,70106,70106,70108,70108,70144,70161,70163,70187,70207,70208,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70366,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70461,70461,70480,70480,70493,70497,70528,70537,70539,70539,70542,70542,70544,70581,70583,70583,70609,70609,70611,70611,70656,70708,70727,70730,70751,70753,70784,70831,70852,70853,70855,70855,71040,71086,71128,71131,71168,71215,71236,71236,71296,71338,71352,71352,71424,71450,71488,71494,71680,71723,71840,71903,71935,71942,71945,71945,71948,71955,71957,71958,71960,71983,71999,71999,72001,72001,72096,72103,72106,72144,72161,72161,72163,72163,72192,72192,72203,72242,72250,72250,72272,72272,72284,72329,72349,72349,72368,72440,72640,72672,72704,72712,72714,72750,72768,72768,72818,72847,72960,72966,72968,72969,72971,73008,73030,73030,73056,73061,73063,73064,73066,73097,73112,73112,73136,73179,73440,73458,73474,73474,73476,73488,73490,73523,73648,73648,73728,74649,74752,74862,74880,75075,77712,77808,77824,78895,78913,78918,78944,82938,82944,83526,90368,90397,92160,92728,92736,92766,92784,92862,92880,92909,92928,92975,92992,92995,93027,93047,93053,93071,93504,93548,93760,93823,93856,93880,93883,93907,93952,94026,94032,94032,94099,94111,94176,94177,94179,94179,94194,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,122624,122654,122661,122666,122928,122989,123136,123180,123191,123197,123214,123214,123536,123565,123584,123627,124112,124139,124368,124397,124400,124400,124608,124638,124640,124642,124644,124645,124647,124653,124656,124660,124670,124671,124896,124902,124904,124907,124909,124910,124912,124926,124928,125124,125184,125251,125259,125259,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,131072,173791,173824,178205,178208,183981,183984,191456,191472,192093,194560,195101,196608,201546,201552,210041],$E=170,YE=210041,JE=[170,170,181,181,183,183,186,186,192,214,216,246,248,705,710,721,736,740,748,748,750,750,768,884,886,887,890,893,895,895,902,906,908,908,910,929,931,1013,1015,1153,1155,1159,1162,1327,1329,1366,1369,1369,1376,1416,1425,1469,1471,1471,1473,1474,1476,1477,1479,1479,1488,1514,1519,1522,1552,1562,1568,1641,1646,1747,1749,1756,1759,1768,1770,1788,1791,1791,1808,1866,1869,1969,1984,2037,2042,2042,2045,2045,2048,2093,2112,2139,2144,2154,2160,2183,2185,2191,2199,2273,2275,2403,2406,2415,2417,2435,2437,2444,2447,2448,2451,2472,2474,2480,2482,2482,2486,2489,2492,2500,2503,2504,2507,2510,2519,2519,2524,2525,2527,2531,2534,2545,2556,2556,2558,2558,2561,2563,2565,2570,2575,2576,2579,2600,2602,2608,2610,2611,2613,2614,2616,2617,2620,2620,2622,2626,2631,2632,2635,2637,2641,2641,2649,2652,2654,2654,2662,2677,2689,2691,2693,2701,2703,2705,2707,2728,2730,2736,2738,2739,2741,2745,2748,2757,2759,2761,2763,2765,2768,2768,2784,2787,2790,2799,2809,2815,2817,2819,2821,2828,2831,2832,2835,2856,2858,2864,2866,2867,2869,2873,2876,2884,2887,2888,2891,2893,2901,2903,2908,2909,2911,2915,2918,2927,2929,2929,2946,2947,2949,2954,2958,2960,2962,2965,2969,2970,2972,2972,2974,2975,2979,2980,2984,2986,2990,3001,3006,3010,3014,3016,3018,3021,3024,3024,3031,3031,3046,3055,3072,3084,3086,3088,3090,3112,3114,3129,3132,3140,3142,3144,3146,3149,3157,3158,3160,3162,3164,3165,3168,3171,3174,3183,3200,3203,3205,3212,3214,3216,3218,3240,3242,3251,3253,3257,3260,3268,3270,3272,3274,3277,3285,3286,3292,3294,3296,3299,3302,3311,3313,3315,3328,3340,3342,3344,3346,3396,3398,3400,3402,3406,3412,3415,3423,3427,3430,3439,3450,3455,3457,3459,3461,3478,3482,3505,3507,3515,3517,3517,3520,3526,3530,3530,3535,3540,3542,3542,3544,3551,3558,3567,3570,3571,3585,3642,3648,3662,3664,3673,3713,3714,3716,3716,3718,3722,3724,3747,3749,3749,3751,3773,3776,3780,3782,3782,3784,3790,3792,3801,3804,3807,3840,3840,3864,3865,3872,3881,3893,3893,3895,3895,3897,3897,3902,3911,3913,3948,3953,3972,3974,3991,3993,4028,4038,4038,4096,4169,4176,4253,4256,4293,4295,4295,4301,4301,4304,4346,4348,4680,4682,4685,4688,4694,4696,4696,4698,4701,4704,4744,4746,4749,4752,4784,4786,4789,4792,4798,4800,4800,4802,4805,4808,4822,4824,4880,4882,4885,4888,4954,4957,4959,4969,4977,4992,5007,5024,5109,5112,5117,5121,5740,5743,5759,5761,5786,5792,5866,5870,5880,5888,5909,5919,5940,5952,5971,5984,5996,5998,6e3,6002,6003,6016,6099,6103,6103,6108,6109,6112,6121,6155,6157,6159,6169,6176,6264,6272,6314,6320,6389,6400,6430,6432,6443,6448,6459,6470,6509,6512,6516,6528,6571,6576,6601,6608,6618,6656,6683,6688,6750,6752,6780,6783,6793,6800,6809,6823,6823,6832,6845,6847,6877,6880,6891,6912,6988,6992,7001,7019,7027,7040,7155,7168,7223,7232,7241,7245,7293,7296,7306,7312,7354,7357,7359,7376,7378,7380,7418,7424,7957,7960,7965,7968,8005,8008,8013,8016,8023,8025,8025,8027,8027,8029,8029,8031,8061,8064,8116,8118,8124,8126,8126,8130,8132,8134,8140,8144,8147,8150,8155,8160,8172,8178,8180,8182,8188,8204,8205,8255,8256,8276,8276,8305,8305,8319,8319,8336,8348,8400,8412,8417,8417,8421,8432,8450,8450,8455,8455,8458,8467,8469,8469,8472,8477,8484,8484,8486,8486,8488,8488,8490,8505,8508,8511,8517,8521,8526,8526,8544,8584,11264,11492,11499,11507,11520,11557,11559,11559,11565,11565,11568,11623,11631,11631,11647,11670,11680,11686,11688,11694,11696,11702,11704,11710,11712,11718,11720,11726,11728,11734,11736,11742,11744,11775,12293,12295,12321,12335,12337,12341,12344,12348,12353,12438,12441,12447,12449,12543,12549,12591,12593,12686,12704,12735,12784,12799,13312,19903,19968,42124,42192,42237,42240,42508,42512,42539,42560,42607,42612,42621,42623,42737,42775,42783,42786,42888,42891,42972,42993,43047,43052,43052,43072,43123,43136,43205,43216,43225,43232,43255,43259,43259,43261,43309,43312,43347,43360,43388,43392,43456,43471,43481,43488,43518,43520,43574,43584,43597,43600,43609,43616,43638,43642,43714,43739,43741,43744,43759,43762,43766,43777,43782,43785,43790,43793,43798,43808,43814,43816,43822,43824,43866,43868,43881,43888,44010,44012,44013,44016,44025,44032,55203,55216,55238,55243,55291,63744,64109,64112,64217,64256,64262,64275,64279,64285,64296,64298,64310,64312,64316,64318,64318,64320,64321,64323,64324,64326,64433,64467,64829,64848,64911,64914,64967,65008,65019,65024,65039,65056,65071,65075,65076,65101,65103,65136,65140,65142,65276,65296,65305,65313,65338,65343,65343,65345,65370,65381,65470,65474,65479,65482,65487,65490,65495,65498,65500,65536,65547,65549,65574,65576,65594,65596,65597,65599,65613,65616,65629,65664,65786,65856,65908,66045,66045,66176,66204,66208,66256,66272,66272,66304,66335,66349,66378,66384,66426,66432,66461,66464,66499,66504,66511,66513,66517,66560,66717,66720,66729,66736,66771,66776,66811,66816,66855,66864,66915,66928,66938,66940,66954,66956,66962,66964,66965,66967,66977,66979,66993,66995,67001,67003,67004,67008,67059,67072,67382,67392,67413,67424,67431,67456,67461,67463,67504,67506,67514,67584,67589,67592,67592,67594,67637,67639,67640,67644,67644,67647,67669,67680,67702,67712,67742,67808,67826,67828,67829,67840,67861,67872,67897,67904,67929,67968,68023,68030,68031,68096,68099,68101,68102,68108,68115,68117,68119,68121,68149,68152,68154,68159,68159,68192,68220,68224,68252,68288,68295,68297,68326,68352,68405,68416,68437,68448,68466,68480,68497,68608,68680,68736,68786,68800,68850,68864,68903,68912,68921,68928,68965,68969,68973,68975,68997,69248,69289,69291,69292,69296,69297,69314,69319,69370,69404,69415,69415,69424,69456,69488,69509,69552,69572,69600,69622,69632,69702,69734,69749,69759,69818,69826,69826,69840,69864,69872,69881,69888,69940,69942,69951,69956,69959,69968,70003,70006,70006,70016,70084,70089,70092,70094,70106,70108,70108,70144,70161,70163,70199,70206,70209,70272,70278,70280,70280,70282,70285,70287,70301,70303,70312,70320,70378,70384,70393,70400,70403,70405,70412,70415,70416,70419,70440,70442,70448,70450,70451,70453,70457,70459,70468,70471,70472,70475,70477,70480,70480,70487,70487,70493,70499,70502,70508,70512,70516,70528,70537,70539,70539,70542,70542,70544,70581,70583,70592,70594,70594,70597,70597,70599,70602,70604,70611,70625,70626,70656,70730,70736,70745,70750,70753,70784,70853,70855,70855,70864,70873,71040,71093,71096,71104,71128,71133,71168,71232,71236,71236,71248,71257,71296,71352,71360,71369,71376,71395,71424,71450,71453,71467,71472,71481,71488,71494,71680,71738,71840,71913,71935,71942,71945,71945,71948,71955,71957,71958,71960,71989,71991,71992,71995,72003,72016,72025,72096,72103,72106,72151,72154,72161,72163,72164,72192,72254,72263,72263,72272,72345,72349,72349,72368,72440,72544,72551,72640,72672,72688,72697,72704,72712,72714,72758,72760,72768,72784,72793,72818,72847,72850,72871,72873,72886,72960,72966,72968,72969,72971,73014,73018,73018,73020,73021,73023,73031,73040,73049,73056,73061,73063,73064,73066,73102,73104,73105,73107,73112,73120,73129,73136,73179,73184,73193,73440,73462,73472,73488,73490,73530,73534,73538,73552,73562,73648,73648,73728,74649,74752,74862,74880,75075,77712,77808,77824,78895,78912,78933,78944,82938,82944,83526,90368,90425,92160,92728,92736,92766,92768,92777,92784,92862,92864,92873,92880,92909,92912,92916,92928,92982,92992,92995,93008,93017,93027,93047,93053,93071,93504,93548,93552,93561,93760,93823,93856,93880,93883,93907,93952,94026,94031,94087,94095,94111,94176,94177,94179,94180,94192,94198,94208,101589,101631,101662,101760,101874,110576,110579,110581,110587,110589,110590,110592,110882,110898,110898,110928,110930,110933,110933,110948,110951,110960,111355,113664,113770,113776,113788,113792,113800,113808,113817,113821,113822,118e3,118009,118528,118573,118576,118598,119141,119145,119149,119154,119163,119170,119173,119179,119210,119213,119362,119364,119808,119892,119894,119964,119966,119967,119970,119970,119973,119974,119977,119980,119982,119993,119995,119995,119997,120003,120005,120069,120071,120074,120077,120084,120086,120092,120094,120121,120123,120126,120128,120132,120134,120134,120138,120144,120146,120485,120488,120512,120514,120538,120540,120570,120572,120596,120598,120628,120630,120654,120656,120686,120688,120712,120714,120744,120746,120770,120772,120779,120782,120831,121344,121398,121403,121452,121461,121461,121476,121476,121499,121503,121505,121519,122624,122654,122661,122666,122880,122886,122888,122904,122907,122913,122915,122916,122918,122922,122928,122989,123023,123023,123136,123180,123184,123197,123200,123209,123214,123214,123536,123566,123584,123641,124112,124153,124368,124410,124608,124638,124640,124661,124670,124671,124896,124902,124904,124907,124909,124910,124912,124926,124928,125124,125136,125142,125184,125259,125264,125273,126464,126467,126469,126495,126497,126498,126500,126500,126503,126503,126505,126514,126516,126519,126521,126521,126523,126523,126530,126530,126535,126535,126537,126537,126539,126539,126541,126543,126545,126546,126548,126548,126551,126551,126553,126553,126555,126555,126557,126557,126559,126559,126561,126562,126564,126564,126567,126570,126572,126578,126580,126583,126585,126588,126590,126590,126592,126601,126603,126619,126625,126627,126629,126633,126635,126651,130032,130041,131072,173791,173824,178205,178208,183981,183984,191456,191472,192093,194560,195101,196608,201546,201552,210041,917760,917999],e1=170,t1=917999;function Bb(n,r){let e=0,t=r.length;for(;e+1<t;){let i=e+(t-e>>>1);i-=i&1;let s=r[i];if(s<=n&&n<=r[i+1])return!0;n<s?t=i:e=i+2}return!1}var Op=" ",r1=" ",n1=" ",i1=" ",ul=new Map;function W(n,r){if(r<=4)switch(r){case 1:n.push(Op);break;case 2:n.push(r1);break;case 3:n.push(n1);break;case 4:n.push(i1);break}else{let e;ul.size<=1024?ul.has(r)?e=assert(ul.get(r)):ul.set(r,e=Op.repeat(r)):e=Op.repeat(r),n.push(e)}}function Re(n,r){let e=new Array,t=0,i=0;for(let s=n.length;i<s;)switch(n.charCodeAt(i)){case 0:{i>t&&e.push(n.substring(t,t=i+1)),e.push("\\0"),t=++i;break}case 8:{i>t&&e.push(n.substring(t,i)),t=++i,e.push("\\b");break}case 9:{i>t&&e.push(n.substring(t,i)),t=++i,e.push("\\t");break}case 10:{i>t&&e.push(n.substring(t,i)),t=++i,e.push("\\n");break}case 11:{i>t&&e.push(n.substring(t,i)),t=++i,e.push("\\v");break}case 12:{i>t&&e.push(n.substring(t,i)),t=++i,e.push("\\f");break}case 13:{i>t&&e.push(n.substring(t,i)),e.push("\\r"),t=++i;break}case 34:{r==34?(i>t&&e.push(n.substring(t,i)),e.push('\\"'),t=++i):++i;break}case 39:{r==39?(i>t&&e.push(n.substring(t,i)),e.push("\\'"),t=++i):++i;break}case 92:{i>t&&e.push(n.substring(t,i)),e.push("\\\\"),t=++i;break}case 96:{r==96?(i>t&&e.push(n.substring(t,i)),e.push("\\`"),t=++i):++i;break}default:{++i;break}}return i>t&&e.push(n.substring(t,i)),e.join("")}var Qr=47;function Xr(n){let r=0,e=n.length;for(;r+1<e&&n.charCodeAt(r)==46&&n.charCodeAt(r+1)==Qr;)r+=2;(r>0||e<n.length)&&(n=n.substring(r,e),e-=r,r=0);let t;for(;r+1<e;){if(t=!1,n.charCodeAt(r)==Qr&&n.charCodeAt(r+1)==46){if(t=r+2==e,t||r+2<e&&n.charCodeAt(r+2)==Qr){n=t?n.substring(0,r):n.substring(0,r)+n.substring(r+2),e-=2;continue}if(t=r+3==e,t&&n.charCodeAt(r+2)==46||r+3<e&&n.charCodeAt(r+2)==46&&n.charCodeAt(r+3)==Qr){let i=r;for(;--i>=0;)if(n.charCodeAt(i)==Qr){(r-i!=3||n.charCodeAt(i+1)!=46||n.charCodeAt(i+2)!=46)&&(n=t?n.substring(0,i):n.substring(0,i)+n.substring(r+3),e-=r+3-i,r=i-1);break}if(i<0&&r>0&&(r!=2||n.charCodeAt(0)!=46||n.charCodeAt(1)!=46)){n=n.substring(r+4),e=n.length;continue}}}r++}return e>0?n:"."}function fl(n,r){return n.startsWith("std/")?n:Xr(Mb(r)+mt+n)}function Mb(n){let r=n.length;if(r<=1){if(r==0)return".";if(n.charCodeAt(0)==Qr)return n}for(;--r>0;)if(n.charCodeAt(r)==Qr)return n.substring(0,r);return"."}var s1="\x1B[90m",dl="\x1B[91m",a1="\x1B[92m",Wp="\x1B[93m",l1="\x1B[94m",Kp="\x1B[95m",Hp="\x1B[96m",o1="\x1B[97m",as="\x1B[0m",_l=!0;function Xn(){return _l}function hl(n){let r=_l;return _l=n,r}function u1(n,r){return _l?r+n+as:n}var jp=new Uint8Array(16),Qp=new Uint8Array(16).fill(255);var ls=(i=>(i[i.Pedantic=0]="Pedantic",i[i.Info=1]="Info",i[i.Warning=2]="Warning",i[i.Error=3]="Error",i))(ls||{}),ce=class n{constructor(r,e){this.start=r;this.end=e}static join(r,e){if(r.source!=e.source)throw new Error("source mismatch");let t=new n(r.start<e.start?r.start:e.start,r.end>e.end?r.end:e.end);return t.source=r.source,t}equals(r){return this.source==r.source&&this.start==r.start&&this.end==r.end}get atStart(){let r=new n(this.start,this.start);return r.source=this.source,r}get atEnd(){let r=new n(this.end,this.end);return r.source=this.source,r}toString(){return this.source.text.substring(this.start,this.end)}};function Zp(n){switch(n){case 0:return"PEDANTIC";case 1:return"INFO";case 2:return"WARNING";case 3:return"ERROR";default:return assert(!1),""}}function Db(n){switch(n){case 0:return Kp;case 1:return Hp;case 2:return Wp;case 3:return dl;default:return assert(!1),""}}var ml=class n{constructor(r,e,t){this.range=null;this.relatedRange=null;this.code=r,this.category=e,this.message=t}static create(r,e,t=null,i=null,s=null){let a=al(r);return t!=null&&(a=a.replace("{0}",t)),i!=null&&(a=a.replace("{1}",i)),s!=null&&(a=a.replace("{2}",s)),new n(r,e,a)}equals(r){if(this.code!=r.code)return!1;let e=this.range,t=r.range;if(e){if(!t||!e.equals(t))return!1}else if(t)return!1;let i=this.relatedRange,s=r.relatedRange;if(i){if(!s||!i.equals(s))return!1}else if(s)return!1;return this.message==r.message}withRange(r){return this.range=r,this}withRelatedRange(r){return this.relatedRange=r,this}toString(){let r=Zp(this.category),e=this.range,t=this.code,i=this.message;if(e){let s=e.source,a=s.normalizedPath,l=s.lineAt(e.start),o=s.columnAt(),u=e.end-e.start;return`${r} ${t}: "${i}" in ${a}(${l},${o}+${u})`}return`${r} ${t}: ${i}`}};function Gb(n,r=!1,e=!1){let t=hl(r),i=[];Xn()&&i.push(Db(n.category)),i.push(Zp(n.category)),Xn()&&i.push(as),i.push(n.code<1e3?" AS":" TS"),i.push(n.code.toString()),i.push(": "),i.push(n.message);let s=n.range;if(s){let a=s.source,l=n.relatedRange,o=0;if(l&&(o=max(a.lineAt(s.start),l.source.lineAt(l.start))),e?(i.push(`
10
10
  `),i.push(zb(s,o))):(i.push(`
11
11
  in `),i.push(a.normalizedPath)),i.push("("),i.push(a.lineAt(s.start).toString()),i.push(","),i.push(a.columnAt().toString()),i.push(")"),l){let u=l.source;e?(i.push(`
12
12
  `),i.push(zb(l,o))):(i.push(`
13
13
  in `),i.push(u.normalizedPath)),i.push("("),i.push(u.lineAt(l.start).toString()),i.push(","),i.push(u.columnAt().toString()),i.push(")")}}return hl(t),i.join("")}function zb(n,r=0){let e=n.source,t=e.text,i=t.length,s=n.start,a=s,l=e.lineAt(s).toString(),o=r?max(r.toString().length,l.length):l.length,u=" ".repeat(o);for(;s>0&&!Ht(t.charCodeAt(s-1));)s--;for(;s<i&&rs(t.charCodeAt(s));)s++;for(;a<i&&!Ht(t.charCodeAt(a));)a++;let c=[u,` :
14
14
  `," ".repeat(o-l.length),l," \u2502 ",t.substring(s,a).replaceAll(" "," "),`
15
15
  `,u," \u2502 "];for(;s<n.start;)t.charCodeAt(s)==9?(c.push(" "),s+=2):(c.push(" "),s++);if(Xn()&&c.push(dl),n.start==n.end)c.push("^");else for(;s++<n.end;){let f=t.charCodeAt(s);if(f==9)c.push("~~");else if(Ht(f)){c.push(s==n.start+1?"^":"~");break}else c.push("~")}return Xn()&&c.push(as),c.push(`
16
- `),c.push(u),c.push(" \u2514\u2500 in "),c.push(e.normalizedPath),c.join("")}var tt=class{constructor(r=null){this.seen=new Map;r||(r=[]),this.diagnostics=r}emitDiagnostic(r,e,t,i,s=null,a=null,l=null){let o=ml.create(r,e,s,a,l);if(t&&(o=o.withRange(t)),i&&(o.relatedRange=i),t){let u=this.seen;if(u.has(t.source)){let c=assert(u.get(t.source));if(c.has(t.start)){let f=assert(c.get(t.start));for(let _=0,d=f.length;_<d;++_)if(f[_].equals(o))return;f.push(o)}else c.set(t.start,[o])}else{let c=new Map;c.set(t.start,[o]),u.set(t.source,c)}}this.diagnostics.push(o)}pedantic(r,e,t=null,i=null,s=null){this.emitDiagnostic(r,0,e,null,t,i,s)}pedanticRelated(r,e,t,i=null,s=null,a=null){this.emitDiagnostic(r,0,e,t,i,s,a)}info(r,e,t=null,i=null,s=null){this.emitDiagnostic(r,1,e,null,t,i,s)}infoRelated(r,e,t,i=null,s=null,a=null){this.emitDiagnostic(r,1,e,t,i,s,a)}warning(r,e,t=null,i=null,s=null){this.emitDiagnostic(r,2,e,null,t,i,s)}warningRelated(r,e,t,i=null,s=null,a=null){this.emitDiagnostic(r,2,e,t,i,s,a)}error(r,e,t=null,i=null,s=null){this.emitDiagnostic(r,3,e,null,t,i,s)}errorRelated(r,e,t,i=null,s=null,a=null){this.emitDiagnostic(r,3,e,t,i,s,a)}};var bt=(T=>(T[T.Abstract=0]="Abstract",T[T.As=1]="As",T[T.Async=2]="Async",T[T.Await=3]="Await",T[T.Break=4]="Break",T[T.Case=5]="Case",T[T.Catch=6]="Catch",T[T.Class=7]="Class",T[T.Const=8]="Const",T[T.Continue=9]="Continue",T[T.Constructor=10]="Constructor",T[T.Debugger=11]="Debugger",T[T.Declare=12]="Declare",T[T.Default=13]="Default",T[T.Delete=14]="Delete",T[T.Do=15]="Do",T[T.Else=16]="Else",T[T.Enum=17]="Enum",T[T.Export=18]="Export",T[T.Extends=19]="Extends",T[T.False=20]="False",T[T.Finally=21]="Finally",T[T.For=22]="For",T[T.From=23]="From",T[T.Function=24]="Function",T[T.Get=25]="Get",T[T.If=26]="If",T[T.Implements=27]="Implements",T[T.Import=28]="Import",T[T.In=29]="In",T[T.InstanceOf=30]="InstanceOf",T[T.Interface=31]="Interface",T[T.Is=32]="Is",T[T.KeyOf=33]="KeyOf",T[T.Let=34]="Let",T[T.Module=35]="Module",T[T.Namespace=36]="Namespace",T[T.New=37]="New",T[T.Null=38]="Null",T[T.Of=39]="Of",T[T.Override=40]="Override",T[T.Package=41]="Package",T[T.Private=42]="Private",T[T.Protected=43]="Protected",T[T.Public=44]="Public",T[T.Readonly=45]="Readonly",T[T.Return=46]="Return",T[T.Set=47]="Set",T[T.Static=48]="Static",T[T.Struct=49]="Struct",T[T.Super=50]="Super",T[T.Switch=51]="Switch",T[T.This=52]="This",T[T.Throw=53]="Throw",T[T.True=54]="True",T[T.Try=55]="Try",T[T.Type=56]="Type",T[T.TypeOf=57]="TypeOf",T[T.Var=58]="Var",T[T.Void=59]="Void",T[T.While=60]="While",T[T.With=61]="With",T[T.Yield=62]="Yield",T[T.OpenBrace=63]="OpenBrace",T[T.CloseBrace=64]="CloseBrace",T[T.OpenParen=65]="OpenParen",T[T.CloseParen=66]="CloseParen",T[T.OpenBracket=67]="OpenBracket",T[T.CloseBracket=68]="CloseBracket",T[T.Dot=69]="Dot",T[T.Dot_Dot_Dot=70]="Dot_Dot_Dot",T[T.Semicolon=71]="Semicolon",T[T.Comma=72]="Comma",T[T.LessThan=73]="LessThan",T[T.GreaterThan=74]="GreaterThan",T[T.LessThan_Equals=75]="LessThan_Equals",T[T.GreaterThan_Equals=76]="GreaterThan_Equals",T[T.Equals_Equals=77]="Equals_Equals",T[T.Exclamation_Equals=78]="Exclamation_Equals",T[T.Equals_Equals_Equals=79]="Equals_Equals_Equals",T[T.Exclamation_Equals_Equals=80]="Exclamation_Equals_Equals",T[T.Equals_GreaterThan=81]="Equals_GreaterThan",T[T.Plus=82]="Plus",T[T.Minus=83]="Minus",T[T.Asterisk_Asterisk=84]="Asterisk_Asterisk",T[T.Asterisk=85]="Asterisk",T[T.Slash=86]="Slash",T[T.Percent=87]="Percent",T[T.Plus_Plus=88]="Plus_Plus",T[T.Minus_Minus=89]="Minus_Minus",T[T.LessThan_LessThan=90]="LessThan_LessThan",T[T.GreaterThan_GreaterThan=91]="GreaterThan_GreaterThan",T[T.GreaterThan_GreaterThan_GreaterThan=92]="GreaterThan_GreaterThan_GreaterThan",T[T.Ampersand=93]="Ampersand",T[T.Bar=94]="Bar",T[T.Caret=95]="Caret",T[T.Exclamation=96]="Exclamation",T[T.Tilde=97]="Tilde",T[T.Ampersand_Ampersand=98]="Ampersand_Ampersand",T[T.Bar_Bar=99]="Bar_Bar",T[T.Question=100]="Question",T[T.Colon=101]="Colon",T[T.Equals=102]="Equals",T[T.Plus_Equals=103]="Plus_Equals",T[T.Minus_Equals=104]="Minus_Equals",T[T.Asterisk_Equals=105]="Asterisk_Equals",T[T.Asterisk_Asterisk_Equals=106]="Asterisk_Asterisk_Equals",T[T.Slash_Equals=107]="Slash_Equals",T[T.Percent_Equals=108]="Percent_Equals",T[T.LessThan_LessThan_Equals=109]="LessThan_LessThan_Equals",T[T.GreaterThan_GreaterThan_Equals=110]="GreaterThan_GreaterThan_Equals",T[T.GreaterThan_GreaterThan_GreaterThan_Equals=111]="GreaterThan_GreaterThan_GreaterThan_Equals",T[T.Ampersand_Equals=112]="Ampersand_Equals",T[T.Bar_Equals=113]="Bar_Equals",T[T.Caret_Equals=114]="Caret_Equals",T[T.At=115]="At",T[T.Identifier=116]="Identifier",T[T.StringLiteral=117]="StringLiteral",T[T.IntegerLiteral=118]="IntegerLiteral",T[T.FloatLiteral=119]="FloatLiteral",T[T.TemplateLiteral=120]="TemplateLiteral",T[T.Invalid=121]="Invalid",T[T.EndOfFile=122]="EndOfFile",T))(bt||{}),Yp=(t=>(t[t.Default=0]="Default",t[t.Prefer=1]="Prefer",t[t.Always=2]="Always",t))(Yp||{});function Ub(n){let r=n.length;switch(assert(r),n.charCodeAt(0)){case 97:{if(r==5){if(n=="async")return 2;if(n=="await")return 3;break}if(n=="as")return 1;if(n=="abstract")return 0;break}case 98:{if(n=="break")return 4;break}case 99:{if(r==5){if(n=="const")return 8;if(n=="class")return 7;if(n=="catch")return 6;break}if(n=="case")return 5;if(n=="continue")return 9;if(n=="constructor")return 10;break}case 100:{if(r==7){if(n=="default")return 13;if(n=="declare")return 12;break}if(n=="do")return 15;if(n=="delete")return 14;if(n=="debugger")return 11;break}case 101:{if(r==4){if(n=="else")return 16;if(n=="enum")return 17;break}if(n=="export")return 18;if(n=="extends")return 19;break}case 102:{if(r<=5){if(n=="false")return 20;if(n=="for")return 22;if(n=="from")return 23;break}if(n=="function")return 24;if(n=="finally")return 21;break}case 103:{if(n=="get")return 25;break}case 105:{if(r==2){if(n=="if")return 26;if(n=="in")return 29;if(n=="is")return 32;break}switch(n.charCodeAt(3)){case 108:{if(n=="implements")return 27;break}case 111:{if(n=="import")return 28;break}case 116:{if(n=="instanceof")return 30;break}case 101:{if(n=="interface")return 31;break}}break}case 107:{if(n=="keyof")return 33;break}case 108:{if(n=="let")return 34;break}case 109:{if(n=="module")return 35;break}case 110:{if(n=="new")return 37;if(n=="null")return 38;if(n=="namespace")return 36;break}case 111:{if(n=="of")return 39;if(n=="override")return 40;break}case 112:{if(r==7){if(n=="private")return 42;if(n=="package")return 41;break}if(n=="public")return 44;if(n=="protected")return 43;break}case 114:{if(n=="return")return 46;if(n=="readonly")return 45;break}case 115:{if(r==6){if(n=="switch")return 51;if(n=="static")return 48;if(n=="struct")return 49;break}if(n=="set")return 47;if(n=="super")return 50;break}case 116:{if(r==4){if(n=="true")return 54;if(n=="this")return 52;if(n=="type")return 56;break}if(n=="try")return 55;if(n=="throw")return 53;if(n=="typeof")return 57;break}case 118:{if(n=="var")return 58;if(n=="void")return 59;break}case 119:{if(n=="while")return 60;if(n=="with")return 61;break}case 121:{if(n=="yield")return 62;break}}return 121}function Vb(n){switch(n){case 0:case 1:case 10:case 12:case 14:case 23:case 22:case 25:case 30:case 32:case 33:case 35:case 36:case 38:case 45:case 47:case 56:case 59:return!0;default:return!1}}function Jp(n){switch(assert(n.length),n.charCodeAt(0)){case 100:return n=="delete";case 102:return n=="for";case 105:return n=="instanceof";case 110:return n=="null";case 118:return n=="void"}return!1}function Le(n){switch(n){case 14:return"delete";case 29:return"in";case 30:return"instanceof";case 37:return"new";case 57:return"typeof";case 59:return"void";case 62:return"yield";case 70:return"...";case 72:return",";case 73:return"<";case 74:return">";case 75:return"<=";case 76:return">=";case 77:return"==";case 78:return"!=";case 79:return"===";case 80:return"!==";case 82:return"+";case 83:return"-";case 84:return"**";case 85:return"*";case 86:return"/";case 87:return"%";case 88:return"++";case 89:return"--";case 90:return"<<";case 91:return">>";case 92:return">>>";case 93:return"&";case 94:return"|";case 95:return"^";case 96:return"!";case 97:return"~";case 98:return"&&";case 99:return"||";case 102:return"=";case 103:return"+=";case 104:return"-=";case 105:return"*=";case 106:return"**=";case 107:return"/=";case 108:return"%=";case 109:return"<<=";case 110:return">>=";case 111:return">>>=";case 112:return"&=";case 113:return"|=";case 114:return"^=";default:return assert(!1),""}}var os=class extends tt{constructor(e,t=null){super(t);this.end=0;this.pos=0;this.token=-1;this.tokenPos=0;this.nextToken=-1;this.nextTokenPos=0;this.nextTokenOnNewLine=2;this.onComment=null;this.readingTemplateString=!1;this.readStringStart=0;this.readStringEnd=0;t||(t=[]),this.diagnostics=t,this.source=e;let i=e.text,s=i.length,a=0;if(a<s&&i.charCodeAt(a)==65279&&++a,a+1<s&&i.charCodeAt(a)==35&&i.charCodeAt(a+1)==33)for(a+=2;a<s&&i.charCodeAt(a)!=10;)++a;this.pos=a,this.end=s}next(e=0){this.clearNextToken();let t;do t=this.unsafeNext(e);while(t==121);return this.token=t,t}unsafeNext(e=0,t=i32.MAX_VALUE){let i=this.source.text,s=this.end,a=this.pos;for(;a<s;){this.tokenPos=a;let l=i.charCodeAt(a);switch(l){case 13:if(!(++a<s&&i.charCodeAt(a)==10))break;case 10:case 9:case 11:case 12:case 32:{++a;break}case 33:return++a,t>1&&a<s&&i.charCodeAt(a)==61?(++a,t>2&&a<s&&i.charCodeAt(a)==61?(this.pos=a+1,80):(this.pos=a,78)):(this.pos=a,96);case 34:case 39:return this.pos=a,117;case 96:return this.pos=a,120;case 37:return++a,t>1&&a<s&&i.charCodeAt(a)==61?(this.pos=a+1,108):(this.pos=a,87);case 38:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(o==38)return this.pos=a+1,98;if(o==61)return this.pos=a+1,112}return this.pos=a,93}case 40:return this.pos=a+1,65;case 41:return this.pos=a+1,66;case 42:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(o==61)return this.pos=a+1,105;if(o==42)return++a,t>2&&a<s&&i.charCodeAt(a)==61?(this.pos=a+1,106):(this.pos=a,84)}return this.pos=a,85}case 43:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(o==43)return this.pos=a+1,88;if(o==61)return this.pos=a+1,103}return this.pos=a,82}case 44:return this.pos=a+1,72;case 45:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(o==45)return this.pos=a+1,89;if(o==61)return this.pos=a+1,104}return this.pos=a,83}case 46:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(gt(o))return this.pos=a-1,119;if(t>2&&a+1<s&&o==46&&i.charCodeAt(a+1)==46)return this.pos=a+2,70}return this.pos=a,69}case 47:{let o=a;if(++a,t>1&&a<s){let u=i.charCodeAt(a);if(u==47){let c=0;for(a+1<s&&i.charCodeAt(a+1)==47&&(++a,c=1);++a<s;)if(i.charCodeAt(a)==10){++a;break}this.onComment&&this.onComment(c,i.substring(o,a),this.range(o,a));break}if(u==42){let c=!1;for(;++a<s;)if(l=i.charCodeAt(a),l==42&&a+1<s&&i.charCodeAt(a+1)==47){a+=2,c=!0;break}c?this.onComment&&this.onComment(2,i.substring(o,a),this.range(o,a)):this.error(1005,this.range(a),"*/");break}if(u==61)return this.pos=a+1,107}return this.pos=a,86}case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.pos=a,this.testInteger()?118:119;case 58:return this.pos=a+1,101;case 59:return this.pos=a+1,71;case 60:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(o==60)return++a,t>2&&a<s&&i.charCodeAt(a)==61?(this.pos=a+1,109):(this.pos=a,90);if(o==61)return this.pos=a+1,75}return this.pos=a,73}case 61:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(o==61)return++a,t>2&&a<s&&i.charCodeAt(a)==61?(this.pos=a+1,79):(this.pos=a,77);if(o==62)return this.pos=a+1,81}return this.pos=a,102}case 62:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(o==62){if(++a,t>2&&a<s){if(o=i.charCodeAt(a),o==62)return++a,t>3&&a<s&&i.charCodeAt(a)==61?(this.pos=a+1,111):(this.pos=a,92);if(o==61)return this.pos=a+1,110}return this.pos=a,91}if(o==61)return this.pos=a+1,76}return this.pos=a,74}case 63:return this.pos=a+1,100;case 91:return this.pos=a+1,67;case 93:return this.pos=a+1,68;case 94:return++a,t>1&&a<s&&i.charCodeAt(a)==61?(this.pos=a+1,114):(this.pos=a,95);case 123:return this.pos=a+1,63;case 124:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(o==124)return this.pos=a+1,99;if(o==61)return this.pos=a+1,113}return this.pos=a,94}case 125:return this.pos=a+1,64;case 126:return this.pos=a+1,97;case 64:return this.pos=a+1,115;default:{if(Hn(l)&&a+1<s&&(l=is(l,i.charCodeAt(a+1))),jn(l)){let u=a;for(;(a+=jr(l))<s&&Qn(l=i.codePointAt(a)););if(e!=2){let c=Ub(i.substring(u,a));if(c!=121&&!(e==1&&Vb(c)))return this.pos=a,c}return this.pos=u,116}else if(rs(l)){++a;break}let o=a;return a+=jr(l),this.error(1127,this.range(o,a)),this.pos=a,121}}}return this.pos=a,122}peek(e=0,t=i32.MAX_VALUE){let i=this.nextToken;if(i<0){let s=this.pos,a=this.token,l=this.tokenPos;do i=this.unsafeNext(e,t);while(i==121);this.nextToken=i,this.nextTokenPos=this.tokenPos,this.nextTokenOnNewLine=2,this.pos=s,this.token=a,this.tokenPos=l}return i}peekOnNewLine(){switch(this.nextTokenOnNewLine){case 0:return!1;case 1:return!0}this.peek();let e=this.source.text;for(let t=this.pos,i=this.nextTokenPos;t<i;++t)if(Ht(e.charCodeAt(t)))return this.nextTokenOnNewLine=1,!0;return this.nextTokenOnNewLine=0,!1}skipIdentifier(e=1){return this.skip(116,e)}skip(e,t=0){let i=this.pos,s=this.token,a=this.tokenPos,l=i32.MAX_VALUE;e==74&&(l=1);let o;do o=this.unsafeNext(t,l);while(o==121);return o==e?(this.token=e,this.clearNextToken(),!0):(this.pos=i,this.token=s,this.tokenPos=a,!1)}mark(){let e=Zp;return e?(Zp=null,e.pos=this.pos,e.token=this.token,e.tokenPos=this.tokenPos):e=new yl(this.pos,this.token,this.tokenPos),e}discard(e){Zp=e}reset(e){this.pos=e.pos,this.token=e.token,this.tokenPos=e.tokenPos,this.clearNextToken()}clearNextToken(){this.nextToken=-1,this.nextTokenPos=0,this.nextTokenOnNewLine=2}range(e=-1,t=-1){e<0?(e=this.tokenPos,t=this.pos):t<0&&(t=e);let i=new ue(e,t);return i.source=this.source,i}readIdentifier(){let e=this.source.text,t=this.end,i=this.pos,s=i,a=e.codePointAt(i);for(assert(jn(a));(i+=jr(a))<t&&Qn(a=e.codePointAt(i)););return this.pos=i,e.substring(s,i)}readString(e=0,t=!1){let i=this.source.text,s=this.end,a=this.pos;e||(e=i.charCodeAt(a++));let l=a;this.readStringStart=l;let o="";for(;;){if(a>=s){o+=i.substring(l,a),this.error(1002,this.range(l-1,s)),this.readStringEnd=s;break}let u=i.charCodeAt(a);if(u==e){this.readStringEnd=a,o+=i.substring(l,a++);break}if(u==92){o+=i.substring(l,a),this.pos=a,o+=this.readEscapeSequence(t),a=this.pos,l=a;continue}if(e==96){if(u==36&&a+1<s&&i.charCodeAt(a+1)==123)return o+=i.substring(l,a),this.readStringEnd=a,this.pos=a+2,this.readingTemplateString=!0,o}else if(Ht(u)){o+=i.substring(l,a),this.error(1002,this.range(l-1,a)),this.readStringEnd=a;break}++a}return this.pos=a,this.readingTemplateString=!1,o}readEscapeSequence(e=!1){let t=this.pos,i=this.end;if(++this.pos>=i)return this.error(1126,this.range(i)),"";let s=this.source.text,a=s.charCodeAt(this.pos++);switch(a){case 48:return e&&this.pos<i&&gt(s.charCodeAt(this.pos))?(++this.pos,s.substring(t,this.pos)):"\0";case 98:return"\b";case 116:return" ";case 110:return`
17
- `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 39:return"'";case 34:return'"';case 117:return this.pos<i&&s.charCodeAt(this.pos)==123?(++this.pos,this.readExtendedUnicodeEscape(e?t:-1)):this.readUnicodeEscape(e?t:-1);case 120:return this.readHexadecimalEscape(2,e?t:-1);case 13:this.pos<i&&s.charCodeAt(this.pos)==10&&++this.pos;case 10:case 8232:case 8233:return"";default:return String.fromCodePoint(a)}}readRegexpPattern(){let e=this.source.text,t=this.pos,i=this.end,s=!1;for(;;){if(this.pos>=i){this.error(1161,this.range(t,i));break}if(e.charCodeAt(this.pos)==92){++this.pos,s=!0;continue}let a=e.charCodeAt(this.pos);if(!s&&a==47)break;if(Ht(a)){this.error(1161,this.range(t,this.pos));break}++this.pos,s=!1}return e.substring(t,this.pos)}readRegexpFlags(){let e=this.source.text,t=this.pos,i=this.end,s=0;for(;this.pos<i;){let a=e.charCodeAt(this.pos);if(!Qn(a))break;switch(++this.pos,a){case 103:{s|=s&1?-1:1;break}case 105:{s|=s&2?-1:2;break}case 109:{s|=s&4?-1:4;break}default:{s=-1;break}}}return s==-1&&this.error(209,this.range(t,this.pos)),e.substring(t,this.pos)}testInteger(){let e=this.source.text,t=this.pos,i=this.end;if(t+1<i&&e.charCodeAt(t)==48)switch(e.charCodeAt(t+2)|32){case 120:case 98:case 111:return!0}for(;t<i;){let s=e.charCodeAt(t);if(s==46||(s|32)==101)return!1;if(s!=95&&(s<48||s>57))break;t++}return!0}readInteger(){let e=this.source.text,t=this.pos;if(t+2<this.end&&e.charCodeAt(t)==48){switch(e.charCodeAt(t+1)|32){case 120:return this.pos=t+2,this.readHexInteger();case 98:return this.pos=t+2,this.readBinaryInteger();case 111:return this.pos=t+2,this.readOctalInteger()}if(pl(e.charCodeAt(t+1))){let i=t;this.pos=t+1;let s=this.readOctalInteger();return this.error(1121,this.range(i,this.pos)),s}}return this.readDecimalInteger()}readHexInteger(){let e=this.source.text,t=this.pos,i=this.end,s=t,a=s,l=i64_zero,o=i64_new(4),u=l,c=!1;for(;t<i;){let f=e.charCodeAt(t);if(gt(f))u=i64_add(i64_shl(l,o),i64_new(f-48));else if(ss(f))u=i64_add(i64_shl(l,o),i64_new((f|32)+-87));else if(f==95)a==t&&this.error(a==s?6188:6189,this.range(t)),a=t+1;else break;i64_gt_u(l,u)&&(c=!0),l=u,++t}return t==s?this.error(1125,this.range(s)):a==t&&this.error(6188,this.range(a-1)),c&&this.error(236,this.range(s-2,t),this.source.text.substring(s-2,t)),this.pos=t,l}readDecimalInteger(){let e=this.source.text,t=this.pos,i=this.end,s=t,a=s,l=i64_zero,o=i64_new(10),u=l,c=!1;for(;t<i;){let f=e.charCodeAt(t);if(gt(f))u=i64_add(i64_mul(l,o),i64_new(f-48));else if(f==95)a==t?this.error(a==s?6188:6189,this.range(t)):t-1==s&&e.charCodeAt(t-1)==48&&this.error(6188,this.range(t)),a=t+1;else break;i64_gt_u(l,u)&&(c=!0),l=u,++t}return t==s?this.error(1124,this.range(s)):a==t?this.error(6188,this.range(a-1)):c&&this.error(236,this.range(s,t),this.source.text.substring(s,t)),this.pos=t,l}readOctalInteger(){let e=this.source.text,t=this.pos,i=this.end,s=t,a=s,l=i64_zero,o=i64_new(3),u=l,c=!1;for(;t<i;){let f=e.charCodeAt(t);if(pl(f))u=i64_add(i64_shl(l,o),i64_new(f-48));else if(f==95)a==t&&this.error(a==s?6188:6189,this.range(t)),a=t+1;else break;i64_gt_u(l,u)&&(c=!0),l=u,++t}return t==s?this.error(1178,this.range(s)):a==t?this.error(6188,this.range(a-1)):c&&this.error(236,this.range(s-2,t),this.source.text.substring(s-2,t)),this.pos=t,l}readBinaryInteger(){let e=this.source.text,t=this.pos,i=this.end,s=t,a=s,l=i64_zero,o=l,u=!1;for(;t<i;){let c=e.charCodeAt(t);if(c==48)o=i64_shl(l,i64_one);else if(c==49)o=i64_or(i64_shl(l,i64_one),i64_one);else if(c==95)a==t&&this.error(a==s?6188:6189,this.range(t)),a=t+1;else break;i64_gt(l,o)&&(u=!0),l=o,++t}return t==s?this.error(1177,this.range(s)):a==t?this.error(6188,this.range(a-1)):u&&this.error(236,this.range(s-2,t),this.source.text.substring(s-2,t)),this.pos=t,l}readFloat(){return this.readDecimalFloat()}readDecimalFloat(){let e=this.source.text,t=this.end,i=this.pos,s=this.readDecimalFloatPartial(!1);if(this.pos<t&&e.charCodeAt(this.pos)==46&&(++this.pos,s+=this.readDecimalFloatPartial()),this.pos<t){let l=e.charCodeAt(this.pos);(l|32)==101&&((++this.pos<t&&(l=e.charCodeAt(this.pos))==45||l==43&&gt(e.charCodeAt(this.pos+1)))&&++this.pos,s+=this.readDecimalFloatPartial())}let a=e.substring(i,this.pos);return s&&(a=a.replaceAll("_","")),parseFloat(a)}readDecimalFloatPartial(e=!0){let t=this.source.text,i=this.pos,s=i,a=this.end,l=s,o=0;for(;i<a;){let u=t.charCodeAt(i);if(u==95)l==i?this.error(l==s?6188:6189,this.range(i)):!e&&i-1==s&&t.charCodeAt(i-1)==48&&this.error(6188,this.range(i)),l=i+1,++o;else if(!gt(u))break;++i}return i!=s&&l==i&&this.error(6188,this.range(l-1)),this.pos=i,o}readHexFloat(){throw new Error("not implemented")}readHexadecimalEscape(e=2,t=-1){let i=0,s=this.source.text,a=this.pos,l=this.end;for(;a<l;){let o=s.charCodeAt(a++);if(gt(o))i=(i<<4)+o-48;else if(ss(o))i=(i<<4)+(o|32)+-87;else return~t?(this.pos=--a,s.substring(t,a)):(this.pos=a,this.error(1125,this.range(a-1,a)),"");if(--e==0)break}return e?(this.pos=a,~t?s.substring(t,a):(this.error(1126,this.range(a)),"")):(this.pos=a,String.fromCodePoint(i))}checkForIdentifierStartAfterNumericLiteral(){let e=this.pos;e<this.end&&jn(this.source.text.charCodeAt(e))&&this.error(1351,this.range(e))}readUnicodeEscape(e=-1){return this.readHexadecimalEscape(4,e)}readExtendedUnicodeEscape(e=-1){let t=this.pos,i=this.readHexInteger(),s=i64_low(i),a=!1;assert(!i64_high(i)),s>1114111&&(e==-1&&this.error(1198,this.range(t,this.pos)),a=!0);let l=this.end,o=this.source.text;return this.pos>=l?(e==-1&&this.error(1126,this.range(t,l)),a=!0):o.charCodeAt(this.pos)==125?++this.pos:(e==-1&&this.error(1199,this.range(t,this.pos)),a=!0),a?~e?o.substring(e,this.pos):"":String.fromCodePoint(s)}},yl=class{constructor(r,e,t){this.pos=r;this.token=e;this.tokenPos=t}},Zp=null;var Ze=(G=>(G[G.Source=0]="Source",G[G.NamedType=1]="NamedType",G[G.FunctionType=2]="FunctionType",G[G.TupleType=3]="TupleType",G[G.FixedArrayType=4]="FixedArrayType",G[G.TypeName=5]="TypeName",G[G.TypeParameter=6]="TypeParameter",G[G.Parameter=7]="Parameter",G[G.Identifier=8]="Identifier",G[G.Assertion=9]="Assertion",G[G.Binary=10]="Binary",G[G.Call=11]="Call",G[G.Class=12]="Class",G[G.Comma=13]="Comma",G[G.ElementAccess=14]="ElementAccess",G[G.False=15]="False",G[G.Function=16]="Function",G[G.InstanceOf=17]="InstanceOf",G[G.Literal=18]="Literal",G[G.New=19]="New",G[G.Null=20]="Null",G[G.Omitted=21]="Omitted",G[G.Parenthesized=22]="Parenthesized",G[G.PropertyAccess=23]="PropertyAccess",G[G.Ternary=24]="Ternary",G[G.Super=25]="Super",G[G.This=26]="This",G[G.True=27]="True",G[G.Constructor=28]="Constructor",G[G.UnaryPostfix=29]="UnaryPostfix",G[G.UnaryPrefix=30]="UnaryPrefix",G[G.Await=31]="Await",G[G.Lazy=32]="Lazy",G[G.Compiled=33]="Compiled",G[G.Block=34]="Block",G[G.Break=35]="Break",G[G.Continue=36]="Continue",G[G.Do=37]="Do",G[G.Empty=38]="Empty",G[G.Export=39]="Export",G[G.ExportDefault=40]="ExportDefault",G[G.ExportImport=41]="ExportImport",G[G.Expression=42]="Expression",G[G.For=43]="For",G[G.ForOf=44]="ForOf",G[G.If=45]="If",G[G.Import=46]="Import",G[G.Return=47]="Return",G[G.Switch=48]="Switch",G[G.Throw=49]="Throw",G[G.Try=50]="Try",G[G.Variable=51]="Variable",G[G.Void=52]="Void",G[G.While=53]="While",G[G.Module=54]="Module",G[G.ClassDeclaration=55]="ClassDeclaration",G[G.EnumDeclaration=56]="EnumDeclaration",G[G.EnumValueDeclaration=57]="EnumValueDeclaration",G[G.FieldDeclaration=58]="FieldDeclaration",G[G.FunctionDeclaration=59]="FunctionDeclaration",G[G.ImportDeclaration=60]="ImportDeclaration",G[G.InterfaceDeclaration=61]="InterfaceDeclaration",G[G.MethodDeclaration=62]="MethodDeclaration",G[G.NamespaceDeclaration=63]="NamespaceDeclaration",G[G.TypeDeclaration=64]="TypeDeclaration",G[G.VariableDeclaration=65]="VariableDeclaration",G[G.Decorator=66]="Decorator",G[G.ExportMember=67]="ExportMember",G[G.SwitchCase=68]="SwitchCase",G[G.IndexSignature=69]="IndexSignature",G[G.Comment=70]="Comment",G[G.UnmanagedArrayType=71]="UnmanagedArrayType",G[G.DynamicArrayType=72]="DynamicArrayType",G))(Ze||{}),y=class n{constructor(r,e){this.kind=r;this.range=e}static createSimpleTypeName(r,e){return new $n(n.createIdentifierExpression(r,e),null,e)}static createNamedType(r,e,t,i){return new $r(r,e,t,i)}static createFunctionType(r,e,t,i,s){return new Zr(r,e,t,i,s)}static createTupleType(r,e,t,i){return new gl(r,e,t,i)}static createFixedArrayType(r,e,t){return new bl(r,e,t)}static createUnmanagedArrayType(r,e){return new xl(r,e)}static createDynamicArrayType(r,e,t,i){return new El(r,e,t,i)}static createOmittedType(r){return new $r(n.createSimpleTypeName("",r),null,!1,r)}static createTypeParameter(r,e,t,i){return new Al(r,e,t,i)}static createParameter(r,e,t,i,s){return new Zn(r,e,t,i,s)}static createDecorator(r,e,t){return new Tl(Ct.fromNode(r),r,e,t)}static createComment(r,e,t){return new Sl(r,e,t)}static createIdentifierExpression(r,e,t=!1){return new rt(r,t,e)}static createEmptyIdentifierExpression(r){return new rt("",!1,r)}static createArrayLiteralExpression(r,e){return new Yr(r,e)}static createAssertionExpression(r,e,t,i){return new vl(r,e,t,i)}static createBinaryExpression(r,e,t,i){return new Il(r,e,t,i)}static createCallExpression(r,e,t,i){return new kl(r,e,t,i)}static createClassExpression(r){return new Fl(r)}static createCommaExpression(r,e){return new wl(r,e)}static createConstructorExpression(r){return new Rl(r)}static createElementAccessExpression(r,e,t){return new Cl(r,e,t)}static createFalseExpression(r){return new Xl(r)}static createFloatLiteralExpression(r,e){return new Pl(r,e)}static createFunctionExpression(r){return new Nl(r)}static createInstanceOfExpression(r,e,t){return new Bl(r,e,t)}static createIntegerLiteralExpression(r,e){return new Ll(r,e)}static createNewExpression(r,e,t,i){return new Ml(r,e,t,i)}static createNullExpression(r){return new zl(r)}static createObjectLiteralExpression(r,e,t){return new Dl(r,e,t)}static createOmittedExpression(r){return new Gl(r)}static createParenthesizedExpression(r,e){return new Ul(r,e)}static createPropertyAccessExpression(r,e,t){return new Vl(r,e,t)}static createRegexpLiteralExpression(r,e,t){return new Ol(r,e,t)}static createTernaryExpression(r,e,t,i){return new ql(r,e,t,i)}static createStringLiteralExpression(r,e){return new Wl(r,e)}static createSuperExpression(r){return new Kl(r)}static createTemplateLiteralExpression(r,e,t,i,s){return new Hl(r,e,t,i,s)}static createThisExpression(r){return new jl(r)}static createTrueExpression(r){return new Ql(r)}static createUnaryPostfixExpression(r,e,t){return new $l(r,e,t)}static createUnaryPrefixExpression(r,e,t){return new Zl(r,e,t)}static createAwaitExpression(r,e){return new Yl(r,e)}static createLazyExpression(r,e){return new Jl(r,e)}static createCompiledExpression(r,e,t){return new eo(r,e,t)}static createBlockStatement(r,e){return new ro(r,e)}static createBreakStatement(r,e){return new no(r,e)}static createClassDeclaration(r,e,t,i,s,a,l,o){return new cs(r,e,t,i,s,a,l,o)}static createContinueStatement(r,e){return new io(r,e)}static createDoStatement(r,e,t){return new so(r,e,t)}static createEmptyStatement(r){return new ao(r)}static createEnumDeclaration(r,e,t,i,s,a){return new lo(r,e,t,i,s,a)}static createEnumValueDeclaration(r,e,t,i){return new oo(r,e,t,i)}static createExportStatement(r,e,t,i){return new po(r,e,t,i)}static createExportDefaultStatement(r,e){return new fo(r,e)}static createExportImportStatement(r,e,t){return new uo(r,e,t)}static createExportMember(r,e,t){return e||(e=r),new co(r,e,t)}static createExpressionStatement(r){return new _o(r)}static createIfStatement(r,e,t,i){return new go(r,e,t,i)}static createImportStatement(r,e,t){return new fs(r,null,e,t)}static createWildcardImportStatement(r,e,t){return new fs(null,r,e,t)}static createImportDeclaration(r,e,t){return e||(e=r),new bo(e,r,t)}static createInterfaceDeclaration(r,e,t,i,s,a,l,o){return new xo(r,e,t,i,s,a,l,o)}static createFieldDeclaration(r,e,t,i,s,a){return new ho(r,e,t,i,s,-1,a)}static createForStatement(r,e,t,i,s){return new mo(r,e,t,i,s)}static createForOfStatement(r,e,t,i){return new yo(r,e,t,i)}static createFunctionDeclaration(r,e,t,i,s,a,l,o,u=!1){return new ps(r,e,t,i,s,a,l,o,u)}static createIndexSignature(r,e,t,i){return new to(r,e,t,i)}static createMethodDeclaration(r,e,t,i,s,a,l,o=!1){return new Jr(r,e,t,i,s,a,l,o)}static createNamespaceDeclaration(r,e,t,i,s){return new Eo(r,e,t,i,s)}static createReturnStatement(r,e){return new Ao(r,e)}static createSwitchStatement(r,e,t){return new So(r,e,t)}static createSwitchCase(r,e,t){return new To(r,e,t)}static createThrowStatement(r,e){return new vo(r,e)}static createTryStatement(r,e,t,i,s){return new Io(r,e,t,i,s)}static createTypeDeclaration(r,e,t,i,s,a){return new Fo(r,e,t,i,s,a)}static createModuleDeclaration(r,e,t){return new ko(r,e,t)}static createVariableStatement(r,e,t){return new Ro(r,e,t)}static createVariableDeclaration(r,e,t,i,s,a){return new wo(r,e,t,i,s,a)}static createVoidStatement(r,e){return new Co(r,e)}static createWhileStatement(r,e,t){return new Po(r,e,t)}isLiteralKind(r){return this.kind==18&&changetype(this).literalKind==r}get isNumericLiteral(){if(this.kind==18)switch(changetype(this).literalKind){case 0:case 1:return!0}return!1}get compilesToConst(){switch(this.kind){case 18:{switch(changetype(this).literalKind){case 0:case 1:case 2:return!0}break}case 20:case 27:case 15:return!0}return!1}get evaluatesToConst(){switch(this.kind){case 9:return changetype(this).expression.evaluatesToConst;case 30:{let r=changetype(this),e=r.operator;if(e==82||e==83)return r.operand.evaluatesToConst;break}}return this.compilesToConst}isAccessOn(r){let e=changetype(this);return e.kind==11&&(e=e.expression),e.kind==23&&e.expression.kind==r}get isAccessOnThis(){return this.isAccessOn(26)}get isAccessOnSuper(){return this.isAccessOn(25)}get isEmpty(){return this.kind==38}},jt=class extends y{constructor(e,t,i){super(e,i);this.isNullable=t;this.currentlyResolving=!1;this.memoryModel=0;this.attributes=null}hasGenericComponent(e){if(this.kind==1){let t=changetype(this);if(!t.name.next){let i=t.typeArguments;if(i&&i.length>0){for(let s=0,a=i.length;s<a;++s)if(i[s].hasGenericComponent(e))return!0}else{let s=t.name.identifier.text;for(let a=0,l=e.length;a<l;++a)if(e[a].name.text==s)return!0}}}else if(this.kind==2){let t=changetype(this),i=t.parameters;for(let a=0,l=i.length;a<l;++a)if(i[a].type.hasGenericComponent(e))return!0;if(t.returnType.hasGenericComponent(e))return!0;let s=t.explicitThisType;if(s&&s.hasGenericComponent(e))return!0}else if(this.kind==3){let i=changetype(this).elements;for(let s=0,a=i.length;s<a;++s)if(i[s].hasGenericComponent(e))return!0}else assert(!1);return!1}},$n=class extends y{constructor(e,t,i){super(5,i);this.identifier=e;this.next=t}},$r=class extends jt{constructor(e,t,i,s){super(1,i,s);this.name=e;this.typeArguments=t}get hasTypeArguments(){let e=this.typeArguments;return e!=null&&e.length>0}get isNull(){return this.name.identifier.text=="null"}},Zr=class extends jt{constructor(e,t,i,s,a){super(2,s,a);this.parameters=e;this.returnType=t;this.explicitThisType=i}},gl=class extends jt{constructor(e,t,i,s){super(3,i,s);this.elements=e;this.elementNames=t}},bl=class extends jt{constructor(e,t,i){super(4,!1,i);this.elementType=e;this.length=t}},xl=class extends jt{constructor(e,t){super(71,!1,t);this.elementType=e}},El=class extends jt{constructor(e,t,i,s){super(72,!1,s);this.elementType=e;this.lengthName=t;this.dynamicMemoryModel=i}},Al=class extends y{constructor(e,t,i,s){super(6,s);this.name=e;this.extendsType=t;this.defaultType=i}},Qt=(t=>(t[t.Default=0]="Default",t[t.Optional=1]="Optional",t[t.Rest=2]="Rest",t))(Qt||{}),Zn=class extends y{constructor(e,t,i,s,a){super(7,a);this.parameterKind=e;this.name=t;this.type=i;this.initializer=s;this.implicitFieldDeclaration=null;this.flags=0}is(e){return(this.flags&e)==e}isAny(e){return(this.flags&e)!=0}set(e){this.flags|=e}},_s=(i=>(i[i.Any=0]="Any",i[i.Inline=1]="Inline",i[i.Managed=2]="Managed",i[i.Unmanaged=3]="Unmanaged",i))(_s||{}),Ct=(h=>(h[h.Custom=0]="Custom",h[h.Global=1]="Global",h[h.Operator=2]="Operator",h[h.OperatorBinary=3]="OperatorBinary",h[h.OperatorPrefix=4]="OperatorPrefix",h[h.OperatorPostfix=5]="OperatorPostfix",h[h.Unmanaged=6]="Unmanaged",h[h.Managed=7]="Managed",h[h.Final=8]="Final",h[h.Inline=9]="Inline",h[h.External=10]="External",h[h.ExternalJs=11]="ExternalJs",h[h.Builtin=12]="Builtin",h[h.Lazy=13]="Lazy",h[h.Unsafe=14]="Unsafe",h))(Ct||{});(r=>{function n(e){if(e.kind==8){let t=e.text;switch(assert(t.length),t.charCodeAt(0)){case 98:{if(t=="builtin")return 12;break}case 101:{if(t=="external")return 10;break}case 102:{if(t=="final")return 8;break}case 103:{if(t=="global")return 1;break}case 105:{if(t=="inline")return 9;break}case 108:{if(t=="lazy")return 13;break}case 109:{if(t=="managed")return 7;break}case 111:{if(t=="operator")return 2;break}case 117:{if(t=="unmanaged")return 6;if(t=="unsafe")return 14;break}}}else if(e.kind==23){let t=e,i=t.expression;if(i.kind==8){let s=i.text;assert(s.length);let a=t.property.text;if(assert(a.length),s=="operator")switch(a.charCodeAt(0)){case 98:{if(a=="binary")return 3;break}case 112:{if(a=="prefix")return 4;if(a=="postfix")return 5;break}}else if(s=="external")switch(a.charCodeAt(0)){case 106:{if(a=="js")return 11;break}}}}return 0}r.fromNode=n})(Ct||={});var Tl=class extends y{constructor(e,t,i,s){super(66,s);this.decoratorKind=e;this.name=t;this.args=i}},ef=(t=>(t[t.Line=0]="Line",t[t.Triple=1]="Triple",t[t.Block=2]="Block",t))(ef||{}),Sl=class extends y{constructor(e,t,i){super(70,i);this.commentKind=e;this.text=t}},xe=class extends y{},rt=class extends xe{constructor(e,t,i){super(8,i);this.text=e;this.isQuoted=t}},ft=(l=>(l[l.Float=0]="Float",l[l.Integer=1]="Integer",l[l.String=2]="String",l[l.Template=3]="Template",l[l.RegExp=4]="RegExp",l[l.Array=5]="Array",l[l.Object=6]="Object",l))(ft||{}),Rt=class extends xe{constructor(e,t){super(18,t);this.literalKind=e}},Yr=class extends Rt{constructor(e,t){super(5,t);this.elementExpressions=e}},Xt=(i=>(i[i.Prefix=0]="Prefix",i[i.As=1]="As",i[i.NonNull=2]="NonNull",i[i.Const=3]="Const",i))(Xt||{}),vl=class extends xe{constructor(e,t,i,s){super(9,s);this.assertionKind=e;this.expression=t;this.toType=i}},Il=class extends xe{constructor(e,t,i,s){super(10,s);this.operator=e;this.left=t;this.right=i}},kl=class extends xe{constructor(e,t,i,s){super(11,s);this.expression=e;this.typeArguments=t;this.args=i}get typeArgumentsRange(){let e=this.typeArguments,t;return e&&(t=e.length)?ue.join(e[0].range,e[t-1].range):this.expression.range}get argumentsRange(){let e=this.args,t=e.length;return t?ue.join(e[0].range,e[t-1].range):this.expression.range}},Fl=class extends xe{constructor(e){super(12,e.range);this.declaration=e}},wl=class extends xe{constructor(e,t){super(13,t);this.expressions=e}},Rl=class extends rt{constructor(r){super("constructor",!1,r),this.kind=28}},Cl=class extends xe{constructor(e,t,i){super(14,i);this.expression=e;this.elementExpression=t}},Pl=class extends Rt{constructor(e,t){super(0,t);this.value=e}},Nl=class extends xe{constructor(e){super(16,e.range);this.declaration=e}},Bl=class extends xe{constructor(e,t,i){super(17,i);this.expression=e;this.isType=t}},Ll=class extends Rt{constructor(e,t){super(1,t);this.value=e}},Ml=class extends xe{constructor(e,t,i,s){super(19,s);this.typeName=e;this.typeArguments=t;this.args=i}get typeArgumentsRange(){let e=this.typeArguments,t;return e&&(t=e.length)>0?ue.join(e[0].range,e[t-1].range):this.typeName.range}get argumentsRange(){let e=this.args,t=e.length;return t?ue.join(e[0].range,e[t-1].range):this.typeName.range}},zl=class extends rt{constructor(r){super("null",!1,r),this.kind=20}},Dl=class extends Rt{constructor(e,t,i){super(6,i);this.names=e;this.values=t}},Gl=class extends xe{constructor(r){super(21,r)}},Ul=class extends xe{constructor(e,t){super(22,t);this.expression=e}},Vl=class extends xe{constructor(e,t,i){super(23,i);this.expression=e;this.property=t}},Ol=class extends Rt{constructor(e,t,i){super(4,i);this.pattern=e;this.patternFlags=t}},ql=class extends xe{constructor(e,t,i,s){super(24,s);this.condition=e;this.ifThen=t;this.ifElse=i}},Wl=class extends Rt{constructor(e,t){super(2,t);this.value=e}},Kl=class extends rt{constructor(r){super("super",!1,r),this.kind=25}},Hl=class extends Rt{constructor(e,t,i,s,a){super(3,a);this.tag=e;this.parts=t;this.rawParts=i;this.expressions=s}},jl=class extends rt{constructor(r){super("this",!1,r),this.kind=26}},Ql=class extends rt{constructor(r){super("true",!1,r),this.kind=27}},Xl=class extends rt{constructor(r){super("false",!1,r),this.kind=15}},us=class extends xe{constructor(e,t,i,s){super(e,s);this.operator=t;this.operand=i}},$l=class extends us{constructor(r,e,t){super(29,r,e,t)}},Zl=class extends us{constructor(r,e,t){super(30,r,e,t)}},Yl=class extends xe{constructor(e,t){super(31,t);this.operand=e}},Jl=class extends xe{constructor(e,t){super(32,t);this.expression=e}},eo=class extends xe{constructor(e,t,i){super(33,i);this.expr=e;this.type=t}},ye=class extends y{},Jn=(i=>(i[i.User=0]="User",i[i.UserEntry=1]="UserEntry",i[i.Library=2]="Library",i[i.LibraryEntry=3]="LibraryEntry",i))(Jn||{}),Te=class n extends y{constructor(e,t,i){super(0,new ue(0,i.length));this.sourceKind=e;this.normalizedPath=t;this.text=i;this.statements=new Array;this.debugInfoIndex=-1;this.exportPaths=null;this.lineCache=null;this.lineColumn=1;let s=ds(t);this.internalPath=s;let a=s.lastIndexOf(mt);this.simplePath=a>=0?s.substring(a+1):s,this.range.source=this}static get native(){let e=n._native;return e||(n._native=e=new n(3,wt+"native.ts","[native code]")),e}static{this._native=null}get isNative(){return this==n._native}get isLibrary(){let e=this.sourceKind;return e==2||e==3}lineAt(e){assert(e>=0&&e<2147483647);let t=this.lineCache;if(!t){this.lineCache=t=[0];let a=this.text,l=0,o=a.length;for(;l<o;)a.charCodeAt(l++)==10&&t.push(l);t.push(2147483647)}let i=0,s=t.length-1;for(;i<s;){let a=i+(s-i>>1),l=unchecked(t[a]);if(e<l)s=a;else{if(e<unchecked(t[a+1]))return this.lineColumn=e-l+1,a+1;i=a+1}}return assert(0)}columnAt(){return this.lineColumn}},nt=class extends ye{constructor(e,t,i,s,a){super(e,a);this.name=t;this.decorators=i;this.flags=s;this.overriddenModuleName=null}is(e){return(this.flags&e)==e}isAny(e){return(this.flags&e)!=0}set(e){this.flags|=e}},to=class extends y{constructor(e,t,i,s){super(69,s);this.keyType=e;this.valueType=t;this.flags=i}},Yn=class extends nt{constructor(e,t,i,s,a,l,o){super(e,t,i,s,o);this.type=a;this.initializer=l}},ro=class extends ye{constructor(e,t){super(34,t);this.statements=e}},no=class extends ye{constructor(e,t){super(35,t);this.label=e}},cs=class extends nt{constructor(e,t,i,s,a,l,o,u){super(55,e,t,i,u);this.typeParameters=s;this.extendsType=a;this.implementsTypes=l;this.members=o;this.indexSignature=null;this.declaredAsStruct=!1;this.declaredAsManagedStruct=!1}get isGeneric(){let e=this.typeParameters;return e!=null&&e.length>0}},io=class extends ye{constructor(e,t){super(36,t);this.label=e}},so=class extends ye{constructor(e,t,i){super(37,i);this.body=e;this.condition=t}},ao=class extends ye{constructor(r){super(38,r)}},lo=class extends nt{constructor(e,t,i,s,a,l){super(56,e,t,i,l);this.values=s;this.underlyingTypeNode=a}},oo=class extends Yn{constructor(r,e,t,i){super(57,r,null,e,null,t,i)}},uo=class extends ye{constructor(e,t,i){super(41,i);this.name=e;this.externalName=t}},co=class extends y{constructor(e,t,i){super(67,i);this.localName=e;this.exportedName=t}},po=class extends ye{constructor(e,t,i,s){super(39,s);this.members=e;this.path=t;this.isDeclare=i;if(t){let a=Xr(t.value);t.value.startsWith(".")?a=fl(a,s.source.internalPath):a.startsWith(wt)||(a=wt+a),this.internalPath=a}else this.internalPath=null}},fo=class extends ye{constructor(e,t){super(40,t);this.declaration=e}},_o=class extends ye{constructor(e){super(42,e.range);this.expression=e}},ho=class extends Yn{constructor(e,t,i,s,a,l,o){super(58,e,t,i,s,a,o);this.parameterIndex=l}},mo=class extends ye{constructor(e,t,i,s,a){super(43,a);this.initializer=e;this.condition=t;this.incrementor=i;this.body=s}},yo=class extends ye{constructor(e,t,i,s){super(44,s);this.variable=e;this.iterable=t;this.body=i}},$t=(t=>(t[t.None=0]="None",t[t.Parenthesized=1]="Parenthesized",t[t.Single=2]="Single",t))($t||{}),ps=class n extends nt{constructor(e,t,i,s,a,l,o,u,c=!1){super(59,e,t,i,u);this.typeParameters=s;this.signature=a;this.body=l;this.arrowKind=o;this.isAsync=c}get isGeneric(){let e=this.typeParameters;return e!=null&&e.length>0}clone(){return new n(this.name,this.decorators,this.flags,this.typeParameters,this.signature,this.body,this.arrowKind,this.range,this.isAsync)}},go=class extends ye{constructor(e,t,i,s){super(45,s);this.condition=e;this.ifTrue=t;this.ifFalse=i}},bo=class extends nt{constructor(e,t,i){super(60,e,null,0,i);this.foreignName=t}},fs=class extends ye{constructor(e,t,i,s){super(46,s);this.declarations=e;this.namespaceName=t;this.path=i;let a=Xr(i.value);i.value.startsWith(".")?a=fl(a,s.source.internalPath):a.startsWith(wt)||(a=wt+a),this.internalPath=ds(a)}},xo=class extends cs{constructor(r,e,t,i,s,a,l,o){super(r,e,t,i,s,a,l,o),this.kind=61}},Jr=class extends ps{constructor(r,e,t,i,s,a,l,o=!1){super(r,e,t,i,s,a,0,l,o),this.kind=62}},Eo=class extends nt{constructor(e,t,i,s,a){super(63,e,t,i,a);this.members=s}},Ao=class extends ye{constructor(e,t){super(47,t);this.value=e}},To=class extends y{constructor(e,t,i){super(68,i);this.label=e;this.statements=t}get isDefault(){return this.label==null}},So=class extends ye{constructor(e,t,i){super(48,i);this.condition=e;this.cases=t}},vo=class extends ye{constructor(e,t){super(49,t);this.value=e}},Io=class extends ye{constructor(e,t,i,s,a){super(50,a);this.bodyStatements=e;this.catchVariable=t;this.catchStatements=i;this.finallyStatements=s}},ko=class extends ye{constructor(e,t,i){super(54,i);this.moduleName=e;this.flags=t}},Fo=class extends nt{constructor(e,t,i,s,a,l){super(64,e,t,i,l);this.typeParameters=s;this.type=a}},wo=class extends Yn{constructor(r,e,t,i,s,a){super(65,r,e,t,i,s,a)}},Ro=class extends ye{constructor(e,t,i){super(51,i);this.decorators=e;this.declarations=t}},Co=class extends ye{constructor(e,t){super(52,t);this.expression=e}},Po=class extends ye{constructor(e,t,i){super(53,i);this.condition=e;this.body=t}};function Zt(n,r){if(r)for(let e=0,t=r.length;e<t;++e){let i=r[e];if(i.decoratorKind==n)return i}return null}function ds(n){return n.endsWith("/")?n+="index":n.endsWith(".ts")&&(n=n.substring(0,n.length-3)),n}function De(n){if(n.kind==1){let r=n.name;return!(r.next||r.identifier.text.length>0)}return!1}var P;(S=>{S.None=0,S.Unreachable=1,S.I32=2,S.I64=3,S.F32=4,S.F64=5,S.V128=6;function l(){return Y_()}S.funcref=l,S.Externref=J_(),S.Anyref=ed(),S.Eqref=td(),S.Structref=nd(),S.Arrayref=id(),S.I31ref=rd(),S.Stringref=sd(),S.Noneref=ad(),S.Nofuncref=od(),S.Noexternref=ld()})(P||={});var Ie;(b=>{b.Extern=8,b.Func=16,b.Any=32,b.Eq=40,b.I31=48,b.Struct=56,b.Array=64,b.Exn=7,b.String=80,b.None=88,b.Noextern=96,b.Nofunc=104;function _(A){return ud(A)}b.isBottom=_;function d(A){return cd(A)}b.getBottom=d;function m(A,S){return pd(A,S)}b.isSubtype=m;function h(A,S){if(A==S)return A;if(d(A)!=d(S))return-1;if(_(A))return S;if(_(S))return A;if(A>S){let k=A;A=S,S=k}switch(A){case b.Extern:return S==b.String?A:-1;case b.Func:return-1;case b.Any:return A;case b.Eq:return S==b.I31||S==b.Struct||S==b.Array?b.Eq:b.Any;case b.I31:return S==b.Struct||S==b.Array?b.Eq:b.Any;case b.Struct:return S==b.Array?b.Eq:b.Any;case b.Array:return b.Any}return assert(!1),-1}b.leastUpperBound=h})(Ie||={});var ms;(t=>(t.NotPacked=0,t.I8=1,t.I16=2))(ms||={});var rf;(s=>{s.SelfSupertype=0,s.InvalidSupertype=1,s.ForwardSupertypeReference=2,s.ForwardChildReference=3;function i(a){switch(a){case 0:return"SelfSupertype";case 1:return"InvalidSupertype";case 2:return"ForwardSupertypeReference";case 3:return"ForwardChildReference"}return assert(!1),""}s.toString=i})(rf||={});var Mo=(U=>(U[U.MVP=0]="MVP",U[U.Atomics=1]="Atomics",U[U.MutableGlobals=2]="MutableGlobals",U[U.TruncSat=4]="TruncSat",U[U.SIMD=8]="SIMD",U[U.BulkMemory=16]="BulkMemory",U[U.SignExt=32]="SignExt",U[U.ExceptionHandling=64]="ExceptionHandling",U[U.TailCall=128]="TailCall",U[U.ReferenceTypes=256]="ReferenceTypes",U[U.MultiValue=512]="MultiValue",U[U.GC=1024]="GC",U[U.Memory64=2048]="Memory64",U[U.RelaxedSIMD=4096]="RelaxedSIMD",U[U.ExtendedConst=8192]="ExtendedConst",U[U.Strings=16384]="Strings",U[U.MultiMemory=32768]="MultiMemory",U[U.StackSwitching=65536]="StackSwitching",U[U.SharedEverything=131072]="SharedEverything",U[U.FP16=262144]="FP16",U[U.BulkMemoryOpt=524288]="BulkMemoryOpt",U[U.CallIndirectOverlong=1048576]="CallIndirectOverlong",U[U.RelaxedAtomics=4194304]="RelaxedAtomics",U[U.CustomPageSizes=8388608]="CustomPageSizes",U[U.Multibyte=16777216]="Multibyte",U[U.WideArithmetic=33554432]="WideArithmetic",U[U.CompactImports=67108864]="CompactImports",U[U.All=134217727]="All",U))(Mo||{}),en=(L=>(L[L.Invalid=0]="Invalid",L[L.Block=1]="Block",L[L.If=2]="If",L[L.Loop=3]="Loop",L[L.Break=4]="Break",L[L.Switch=5]="Switch",L[L.Call=6]="Call",L[L.CallIndirect=7]="CallIndirect",L[L.LocalGet=8]="LocalGet",L[L.LocalSet=9]="LocalSet",L[L.GlobalGet=10]="GlobalGet",L[L.GlobalSet=11]="GlobalSet",L[L.Load=12]="Load",L[L.Store=13]="Store",L[L.Const=14]="Const",L[L.Unary=15]="Unary",L[L.Binary=16]="Binary",L[L.Select=17]="Select",L[L.Drop=18]="Drop",L[L.Return=19]="Return",L[L.MemorySize=20]="MemorySize",L[L.MemoryGrow=21]="MemoryGrow",L[L.Nop=22]="Nop",L[L.Unreachable=23]="Unreachable",L[L.AtomicRMW=24]="AtomicRMW",L[L.AtomicCmpxchg=25]="AtomicCmpxchg",L[L.AtomicWait=26]="AtomicWait",L[L.AtomicNotify=27]="AtomicNotify",L[L.AtomicFence=28]="AtomicFence",L[L.Pause=29]="Pause",L[L.SIMDExtract=30]="SIMDExtract",L[L.SIMDReplace=31]="SIMDReplace",L[L.SIMDShuffle=32]="SIMDShuffle",L[L.SIMDTernary=33]="SIMDTernary",L[L.SIMDShift=34]="SIMDShift",L[L.SIMDLoad=35]="SIMDLoad",L[L.SIMDLoadStoreLane=36]="SIMDLoadStoreLane",L[L.MemoryInit=37]="MemoryInit",L[L.DataDrop=38]="DataDrop",L[L.MemoryCopy=39]="MemoryCopy",L[L.MemoryFill=40]="MemoryFill",L[L.Pop=41]="Pop",L[L.RefNull=42]="RefNull",L[L.RefIsNull=43]="RefIsNull",L[L.RefFunc=44]="RefFunc",L[L.RefEq=45]="RefEq",L[L.TableGet=46]="TableGet",L[L.TableSet=47]="TableSet",L[L.TableSize=48]="TableSize",L[L.TableGrow=49]="TableGrow",L[L.TableFill=50]="TableFill",L[L.TableCopy=51]="TableCopy",L[L.TableInit=52]="TableInit",L[L.ElemDrop=53]="ElemDrop",L[L.Try=54]="Try",L[L.TryTable=55]="TryTable",L[L.Throw=56]="Throw",L[L.Rethrow=57]="Rethrow",L[L.ThrowRef=58]="ThrowRef",L[L.TupleMake=59]="TupleMake",L[L.TupleExtract=60]="TupleExtract",L[L.RefI31=61]="RefI31",L[L.I31Get=62]="I31Get",L[L.CallRef=63]="CallRef",L[L.RefTest=64]="RefTest",L[L.RefCast=65]="RefCast",L[L.RefGetDesc=66]="RefGetDesc",L[L.BrOn=67]="BrOn",L[L.StructNew=68]="StructNew",L[L.StructGet=69]="StructGet",L[L.StructSet=70]="StructSet",L[L.StructRMW=71]="StructRMW",L[L.StructCmpxchg=72]="StructCmpxchg",L[L.ArrayNew=73]="ArrayNew",L[L.ArrayNewData=74]="ArrayNewData",L[L.ArrayNewElem=75]="ArrayNewElem",L[L.ArrayNewFixed=76]="ArrayNewFixed",L[L.ArrayGet=77]="ArrayGet",L[L.ArraySet=78]="ArraySet",L[L.ArrayLoad=79]="ArrayLoad",L[L.ArrayStore=80]="ArrayStore",L[L.ArrayLen=81]="ArrayLen",L[L.ArrayCopy=82]="ArrayCopy",L[L.ArrayFill=83]="ArrayFill",L[L.ArrayInitData=84]="ArrayInitData",L[L.ArrayInitElem=85]="ArrayInitElem",L[L.ArrayRMW=86]="ArrayRMW",L[L.ArrayCmpxchg=87]="ArrayCmpxchg",L[L.RefAs=88]="RefAs",L[L.StringNew=89]="StringNew",L[L.StringConst=90]="StringConst",L[L.StringMeasure=91]="StringMeasure",L[L.StringEncode=92]="StringEncode",L[L.StringConcat=93]="StringConcat",L[L.StringEq=94]="StringEq",L[L.StringTest=95]="StringTest",L[L.StringWTF16Get=96]="StringWTF16Get",L[L.StringSliceWTF=97]="StringSliceWTF",L[L.ContNew=98]="ContNew",L[L.ContBind=99]="ContBind",L[L.Suspend=100]="Suspend",L[L.Resume=101]="Resume",L[L.ResumeThrow=102]="ResumeThrow",L[L.StackSwitch=103]="StackSwitch",L[L.StructWait=104]="StructWait",L[L.StructNotify=105]="StructNotify",L[L.WideIntAddSub=106]="WideIntAddSub",L[L.WideIntMul=107]="WideIntMul",L))(en||{}),nf=(s=>(s[s.Function=0]="Function",s[s.Table=1]="Table",s[s.Memory=2]="Memory",s[s.Global=3]="Global",s[s.Tag=4]="Tag",s))(nf||{}),Ob=(t=>(t[t.Unordered=0]="Unordered",t[t.SeqCst=1]="SeqCst",t[t.AcqRel=2]="AcqRel",t))(Ob||{}),gs=(N=>(N[N.ClzI32=0]="ClzI32",N[N.ClzI64=1]="ClzI64",N[N.CtzI32=2]="CtzI32",N[N.CtzI64=3]="CtzI64",N[N.PopcntI32=4]="PopcntI32",N[N.PopcntI64=5]="PopcntI64",N[N.NegF32=6]="NegF32",N[N.NegF64=7]="NegF64",N[N.AbsF32=8]="AbsF32",N[N.AbsF64=9]="AbsF64",N[N.CeilF32=10]="CeilF32",N[N.CeilF64=11]="CeilF64",N[N.FloorF32=12]="FloorF32",N[N.FloorF64=13]="FloorF64",N[N.TruncF32=14]="TruncF32",N[N.TruncF64=15]="TruncF64",N[N.NearestF32=16]="NearestF32",N[N.NearestF64=17]="NearestF64",N[N.SqrtF32=18]="SqrtF32",N[N.SqrtF64=19]="SqrtF64",N[N.EqzI32=20]="EqzI32",N[N.EqzI64=21]="EqzI64",N[N.ExtendI32ToI64=22]="ExtendI32ToI64",N[N.ExtendU32ToU64=23]="ExtendU32ToU64",N[N.WrapI64ToI32=24]="WrapI64ToI32",N[N.TruncF32ToI32=25]="TruncF32ToI32",N[N.TruncF32ToI64=26]="TruncF32ToI64",N[N.TruncF32ToU32=27]="TruncF32ToU32",N[N.TruncF32ToU64=28]="TruncF32ToU64",N[N.TruncF64ToI32=29]="TruncF64ToI32",N[N.TruncF64ToI64=30]="TruncF64ToI64",N[N.TruncF64ToU32=31]="TruncF64ToU32",N[N.TruncF64ToU64=32]="TruncF64ToU64",N[N.ReinterpretF32ToI32=33]="ReinterpretF32ToI32",N[N.ReinterpretF64ToI64=34]="ReinterpretF64ToI64",N[N.ConvertI32ToF32=35]="ConvertI32ToF32",N[N.ConvertI32ToF64=36]="ConvertI32ToF64",N[N.ConvertU32ToF32=37]="ConvertU32ToF32",N[N.ConvertU32ToF64=38]="ConvertU32ToF64",N[N.ConvertI64ToF32=39]="ConvertI64ToF32",N[N.ConvertI64ToF64=40]="ConvertI64ToF64",N[N.ConvertU64ToF32=41]="ConvertU64ToF32",N[N.ConvertU64ToF64=42]="ConvertU64ToF64",N[N.PromoteF32ToF64=43]="PromoteF32ToF64",N[N.DemoteF64ToF32=44]="DemoteF64ToF32",N[N.ReinterpretI32ToF32=45]="ReinterpretI32ToF32",N[N.ReinterpretI64ToF64=46]="ReinterpretI64ToF64",N[N.Extend8I32=47]="Extend8I32",N[N.Extend16I32=48]="Extend16I32",N[N.Extend8I64=49]="Extend8I64",N[N.Extend16I64=50]="Extend16I64",N[N.Extend32I64=51]="Extend32I64",N[N.TruncSatF32ToI32=52]="TruncSatF32ToI32",N[N.TruncSatF32ToU32=53]="TruncSatF32ToU32",N[N.TruncSatF64ToI32=54]="TruncSatF64ToI32",N[N.TruncSatF64ToU32=55]="TruncSatF64ToU32",N[N.TruncSatF32ToI64=56]="TruncSatF32ToI64",N[N.TruncSatF32ToU64=57]="TruncSatF32ToU64",N[N.TruncSatF64ToI64=58]="TruncSatF64ToI64",N[N.TruncSatF64ToU64=59]="TruncSatF64ToU64",N[N.SplatI8x16=60]="SplatI8x16",N[N.SplatI16x8=61]="SplatI16x8",N[N.SplatI32x4=62]="SplatI32x4",N[N.SplatI64x2=63]="SplatI64x2",N[N.SplatF32x4=64]="SplatF32x4",N[N.SplatF64x2=65]="SplatF64x2",N[N.NotV128=66]="NotV128",N[N.AnyTrueV128=67]="AnyTrueV128",N[N.AbsI8x16=68]="AbsI8x16",N[N.NegI8x16=69]="NegI8x16",N[N.AllTrueI8x16=70]="AllTrueI8x16",N[N.BitmaskI8x16=71]="BitmaskI8x16",N[N.PopcntI8x16=72]="PopcntI8x16",N[N.AbsI16x8=73]="AbsI16x8",N[N.NegI16x8=74]="NegI16x8",N[N.AllTrueI16x8=75]="AllTrueI16x8",N[N.BitmaskI16x8=76]="BitmaskI16x8",N[N.AbsI32x4=77]="AbsI32x4",N[N.NegI32x4=78]="NegI32x4",N[N.AllTrueI32x4=79]="AllTrueI32x4",N[N.BitmaskI32x4=80]="BitmaskI32x4",N[N.AbsI64x2=81]="AbsI64x2",N[N.NegI64x2=82]="NegI64x2",N[N.AllTrueI64x2=83]="AllTrueI64x2",N[N.BitmaskI64x2=84]="BitmaskI64x2",N[N.AbsF32x4=92]="AbsF32x4",N[N.NegF32x4=93]="NegF32x4",N[N.SqrtF32x4=94]="SqrtF32x4",N[N.CeilF32x4=95]="CeilF32x4",N[N.FloorF32x4=96]="FloorF32x4",N[N.TruncF32x4=97]="TruncF32x4",N[N.NearestF32x4=98]="NearestF32x4",N[N.AbsF64x2=99]="AbsF64x2",N[N.NegF64x2=100]="NegF64x2",N[N.SqrtF64x2=101]="SqrtF64x2",N[N.CeilF64x2=102]="CeilF64x2",N[N.FloorF64x2=103]="FloorF64x2",N[N.TruncF64x2=104]="TruncF64x2",N[N.NearestF64x2=105]="NearestF64x2",N[N.ExtaddPairwiseI8x16ToI16x8=106]="ExtaddPairwiseI8x16ToI16x8",N[N.ExtaddPairwiseU8x16ToU16x8=107]="ExtaddPairwiseU8x16ToU16x8",N[N.ExtaddPairwiseI16x8ToI32x4=108]="ExtaddPairwiseI16x8ToI32x4",N[N.ExtaddPairwiseU16x8ToU32x4=109]="ExtaddPairwiseU16x8ToU32x4",N[N.TruncSatF32x4ToI32x4=110]="TruncSatF32x4ToI32x4",N[N.TruncSatF32x4ToU32x4=111]="TruncSatF32x4ToU32x4",N[N.ConvertI32x4ToF32x4=112]="ConvertI32x4ToF32x4",N[N.ConvertU32x4ToF32x4=113]="ConvertU32x4ToF32x4",N[N.ExtendLowI8x16ToI16x8=114]="ExtendLowI8x16ToI16x8",N[N.ExtendHighI8x16ToI16x8=115]="ExtendHighI8x16ToI16x8",N[N.ExtendLowU8x16ToU16x8=116]="ExtendLowU8x16ToU16x8",N[N.ExtendHighU8x16ToU16x8=117]="ExtendHighU8x16ToU16x8",N[N.ExtendLowI16x8ToI32x4=118]="ExtendLowI16x8ToI32x4",N[N.ExtendHighI16x8ToI32x4=119]="ExtendHighI16x8ToI32x4",N[N.ExtendLowU16x8ToU32x4=120]="ExtendLowU16x8ToU32x4",N[N.ExtendHighU16x8ToU32x4=121]="ExtendHighU16x8ToU32x4",N[N.ExtendLowI32x4ToI64x2=122]="ExtendLowI32x4ToI64x2",N[N.ExtendHighI32x4ToI64x2=123]="ExtendHighI32x4ToI64x2",N[N.ExtendLowU32x4ToU64x2=124]="ExtendLowU32x4ToU64x2",N[N.ExtendHighU32x4ToU64x2=125]="ExtendHighU32x4ToU64x2",N[N.ConvertLowI32x4ToF64x2=126]="ConvertLowI32x4ToF64x2",N[N.ConvertLowU32x4ToF64x2=127]="ConvertLowU32x4ToF64x2",N[N.TruncSatF64x2ToI32x4Zero=128]="TruncSatF64x2ToI32x4Zero",N[N.TruncSatF64x2ToU32x4Zero=129]="TruncSatF64x2ToU32x4Zero",N[N.DemoteZeroF64x2ToF32x4=130]="DemoteZeroF64x2ToF32x4",N[N.PromoteLowF32x4ToF64x2=131]="PromoteLowF32x4ToF64x2",N[N.RelaxedTruncF32x4ToI32x4=132]="RelaxedTruncF32x4ToI32x4",N[N.RelaxedTruncF32x4ToU32x4=133]="RelaxedTruncF32x4ToU32x4",N[N.RelaxedTruncF64x2ToI32x4Zero=134]="RelaxedTruncF64x2ToI32x4Zero",N[N.RelaxedTruncF64x2ToU32x4Zero=135]="RelaxedTruncF64x2ToU32x4Zero",N[N.PromoteLowF16x8ToF32x4=141]="PromoteLowF16x8ToF32x4",N[N._last=141]="_last",N[N.ClzSize=142]="ClzSize",N[N.CtzSize=143]="CtzSize",N[N.PopcntSize=144]="PopcntSize",N[N.EqzSize=145]="EqzSize",N))(gs||{}),ti=(I=>(I[I.AddI32=0]="AddI32",I[I.SubI32=1]="SubI32",I[I.MulI32=2]="MulI32",I[I.DivI32=3]="DivI32",I[I.DivU32=4]="DivU32",I[I.RemI32=5]="RemI32",I[I.RemU32=6]="RemU32",I[I.AndI32=7]="AndI32",I[I.OrI32=8]="OrI32",I[I.XorI32=9]="XorI32",I[I.ShlI32=10]="ShlI32",I[I.ShrI32=11]="ShrI32",I[I.ShrU32=12]="ShrU32",I[I.RotlI32=13]="RotlI32",I[I.RotrI32=14]="RotrI32",I[I.EqI32=15]="EqI32",I[I.NeI32=16]="NeI32",I[I.LtI32=17]="LtI32",I[I.LtU32=18]="LtU32",I[I.LeI32=19]="LeI32",I[I.LeU32=20]="LeU32",I[I.GtI32=21]="GtI32",I[I.GtU32=22]="GtU32",I[I.GeI32=23]="GeI32",I[I.GeU32=24]="GeU32",I[I.AddI64=25]="AddI64",I[I.SubI64=26]="SubI64",I[I.MulI64=27]="MulI64",I[I.DivI64=28]="DivI64",I[I.DivU64=29]="DivU64",I[I.RemI64=30]="RemI64",I[I.RemU64=31]="RemU64",I[I.AndI64=32]="AndI64",I[I.OrI64=33]="OrI64",I[I.XorI64=34]="XorI64",I[I.ShlI64=35]="ShlI64",I[I.ShrI64=36]="ShrI64",I[I.ShrU64=37]="ShrU64",I[I.RotlI64=38]="RotlI64",I[I.RotrI64=39]="RotrI64",I[I.EqI64=40]="EqI64",I[I.NeI64=41]="NeI64",I[I.LtI64=42]="LtI64",I[I.LtU64=43]="LtU64",I[I.LeI64=44]="LeI64",I[I.LeU64=45]="LeU64",I[I.GtI64=46]="GtI64",I[I.GtU64=47]="GtU64",I[I.GeI64=48]="GeI64",I[I.GeU64=49]="GeU64",I[I.AddF32=50]="AddF32",I[I.SubF32=51]="SubF32",I[I.MulF32=52]="MulF32",I[I.DivF32=53]="DivF32",I[I.CopysignF32=54]="CopysignF32",I[I.MinF32=55]="MinF32",I[I.MaxF32=56]="MaxF32",I[I.EqF32=57]="EqF32",I[I.NeF32=58]="NeF32",I[I.LtF32=59]="LtF32",I[I.LeF32=60]="LeF32",I[I.GtF32=61]="GtF32",I[I.GeF32=62]="GeF32",I[I.AddF64=63]="AddF64",I[I.SubF64=64]="SubF64",I[I.MulF64=65]="MulF64",I[I.DivF64=66]="DivF64",I[I.CopysignF64=67]="CopysignF64",I[I.MinF64=68]="MinF64",I[I.MaxF64=69]="MaxF64",I[I.EqF64=70]="EqF64",I[I.NeF64=71]="NeF64",I[I.LtF64=72]="LtF64",I[I.LeF64=73]="LeF64",I[I.GtF64=74]="GtF64",I[I.GeF64=75]="GeF64",I[I.EqI8x16=76]="EqI8x16",I[I.NeI8x16=77]="NeI8x16",I[I.LtI8x16=78]="LtI8x16",I[I.LtU8x16=79]="LtU8x16",I[I.GtI8x16=80]="GtI8x16",I[I.GtU8x16=81]="GtU8x16",I[I.LeI8x16=82]="LeI8x16",I[I.LeU8x16=83]="LeU8x16",I[I.GeI8x16=84]="GeI8x16",I[I.GeU8x16=85]="GeU8x16",I[I.EqI16x8=86]="EqI16x8",I[I.NeI16x8=87]="NeI16x8",I[I.LtI16x8=88]="LtI16x8",I[I.LtU16x8=89]="LtU16x8",I[I.GtI16x8=90]="GtI16x8",I[I.GtU16x8=91]="GtU16x8",I[I.LeI16x8=92]="LeI16x8",I[I.LeU16x8=93]="LeU16x8",I[I.GeI16x8=94]="GeI16x8",I[I.GeU16x8=95]="GeU16x8",I[I.EqI32x4=96]="EqI32x4",I[I.NeI32x4=97]="NeI32x4",I[I.LtI32x4=98]="LtI32x4",I[I.LtU32x4=99]="LtU32x4",I[I.GtI32x4=100]="GtI32x4",I[I.GtU32x4=101]="GtU32x4",I[I.LeI32x4=102]="LeI32x4",I[I.LeU32x4=103]="LeU32x4",I[I.GeI32x4=104]="GeI32x4",I[I.GeU32x4=105]="GeU32x4",I[I.EqI64x2=106]="EqI64x2",I[I.NeI64x2=107]="NeI64x2",I[I.LtI64x2=108]="LtI64x2",I[I.GtI64x2=109]="GtI64x2",I[I.LeI64x2=110]="LeI64x2",I[I.GeI64x2=111]="GeI64x2",I[I.EqF32x4=118]="EqF32x4",I[I.NeF32x4=119]="NeF32x4",I[I.LtF32x4=120]="LtF32x4",I[I.GtF32x4=121]="GtF32x4",I[I.LeF32x4=122]="LeF32x4",I[I.GeF32x4=123]="GeF32x4",I[I.EqF64x2=124]="EqF64x2",I[I.NeF64x2=125]="NeF64x2",I[I.LtF64x2=126]="LtF64x2",I[I.GtF64x2=127]="GtF64x2",I[I.LeF64x2=128]="LeF64x2",I[I.GeF64x2=129]="GeF64x2",I[I.AndV128=130]="AndV128",I[I.OrV128=131]="OrV128",I[I.XorV128=132]="XorV128",I[I.AndnotV128=133]="AndnotV128",I[I.AddI8x16=134]="AddI8x16",I[I.AddSatI8x16=135]="AddSatI8x16",I[I.AddSatU8x16=136]="AddSatU8x16",I[I.SubI8x16=137]="SubI8x16",I[I.SubSatI8x16=138]="SubSatI8x16",I[I.SubSatU8x16=139]="SubSatU8x16",I[I.MinI8x16=140]="MinI8x16",I[I.MinU8x16=141]="MinU8x16",I[I.MaxI8x16=142]="MaxI8x16",I[I.MaxU8x16=143]="MaxU8x16",I[I.AvgrU8x16=144]="AvgrU8x16",I[I.AddI16x8=145]="AddI16x8",I[I.AddSatI16x8=146]="AddSatI16x8",I[I.AddSatU16x8=147]="AddSatU16x8",I[I.SubI16x8=148]="SubI16x8",I[I.SubSatI16x8=149]="SubSatI16x8",I[I.SubSatU16x8=150]="SubSatU16x8",I[I.MulI16x8=151]="MulI16x8",I[I.MinI16x8=152]="MinI16x8",I[I.MinU16x8=153]="MinU16x8",I[I.MaxI16x8=154]="MaxI16x8",I[I.MaxU16x8=155]="MaxU16x8",I[I.AvgrU16x8=156]="AvgrU16x8",I[I.Q15mulrSatI16x8=157]="Q15mulrSatI16x8",I[I.ExtmulLowI16x8=158]="ExtmulLowI16x8",I[I.ExtmulHighI16x8=159]="ExtmulHighI16x8",I[I.ExtmulLowU16x8=160]="ExtmulLowU16x8",I[I.ExtmulHighU16x8=161]="ExtmulHighU16x8",I[I.AddI32x4=162]="AddI32x4",I[I.SubI32x4=163]="SubI32x4",I[I.MulI32x4=164]="MulI32x4",I[I.MinI32x4=165]="MinI32x4",I[I.MinU32x4=166]="MinU32x4",I[I.MaxI32x4=167]="MaxI32x4",I[I.MaxU32x4=168]="MaxU32x4",I[I.DotI16x8=169]="DotI16x8",I[I.ExtmulLowI32x4=170]="ExtmulLowI32x4",I[I.ExtmulHighI32x4=171]="ExtmulHighI32x4",I[I.ExtmulLowU32x4=172]="ExtmulLowU32x4",I[I.ExtmulHighU32x4=173]="ExtmulHighU32x4",I[I.AddI64x2=174]="AddI64x2",I[I.SubI64x2=175]="SubI64x2",I[I.MulI64x2=176]="MulI64x2",I[I.ExtmulLowI64x2=177]="ExtmulLowI64x2",I[I.ExtmulHighI64x2=178]="ExtmulHighI64x2",I[I.ExtmulLowU64x2=179]="ExtmulLowU64x2",I[I.ExtmulHighU64x2=180]="ExtmulHighU64x2",I[I.AddF32x4=189]="AddF32x4",I[I.SubF32x4=190]="SubF32x4",I[I.MulF32x4=191]="MulF32x4",I[I.DivF32x4=192]="DivF32x4",I[I.MinF32x4=193]="MinF32x4",I[I.MaxF32x4=194]="MaxF32x4",I[I.PminF32x4=195]="PminF32x4",I[I.PmaxF32x4=196]="PmaxF32x4",I[I.AddF64x2=197]="AddF64x2",I[I.SubF64x2=198]="SubF64x2",I[I.MulF64x2=199]="MulF64x2",I[I.DivF64x2=200]="DivF64x2",I[I.MinF64x2=201]="MinF64x2",I[I.MaxF64x2=202]="MaxF64x2",I[I.PminF64x2=203]="PminF64x2",I[I.PmaxF64x2=204]="PmaxF64x2",I[I.NarrowI16x8ToI8x16=205]="NarrowI16x8ToI8x16",I[I.NarrowU16x8ToU8x16=206]="NarrowU16x8ToU8x16",I[I.NarrowI32x4ToI16x8=207]="NarrowI32x4ToI16x8",I[I.NarrowU32x4ToU16x8=208]="NarrowU32x4ToU16x8",I[I.SwizzleI8x16=209]="SwizzleI8x16",I[I.RelaxedSwizzleI8x16=210]="RelaxedSwizzleI8x16",I[I.RelaxedMinF32x4=211]="RelaxedMinF32x4",I[I.RelaxedMaxF32x4=212]="RelaxedMaxF32x4",I[I.RelaxedMinF64x2=213]="RelaxedMinF64x2",I[I.RelaxedMaxF64x2=214]="RelaxedMaxF64x2",I[I.RelaxedQ15MulrI16x8=215]="RelaxedQ15MulrI16x8",I[I.RelaxedDotI8x16I7x16ToI16x8=216]="RelaxedDotI8x16I7x16ToI16x8",I[I._last=216]="_last",I[I.AddSize=217]="AddSize",I[I.SubSize=218]="SubSize",I[I.MulSize=219]="MulSize",I[I.DivISize=220]="DivISize",I[I.DivUSize=221]="DivUSize",I[I.RemISize=222]="RemISize",I[I.RemUSize=223]="RemUSize",I[I.AndSize=224]="AndSize",I[I.OrSize=225]="OrSize",I[I.XorSize=226]="XorSize",I[I.ShlSize=227]="ShlSize",I[I.ShrISize=228]="ShrISize",I[I.ShrUSize=229]="ShrUSize",I[I.RotlSize=230]="RotlSize",I[I.RotrSize=231]="RotrSize",I[I.EqSize=232]="EqSize",I[I.NeSize=233]="NeSize",I[I.LtISize=234]="LtISize",I[I.LtUSize=235]="LtUSize",I[I.LeISize=236]="LeISize",I[I.LeUSize=237]="LeUSize",I[I.GtISize=238]="GtISize",I[I.GtUSize=239]="GtUSize",I[I.GeISize=240]="GeISize",I[I.GeUSize=241]="GeUSize",I))(ti||{}),sf=(a=>(a[a.Add=0]="Add",a[a.Sub=1]="Sub",a[a.And=2]="And",a[a.Or=3]="Or",a[a.Xor=4]="Xor",a[a.Xchg=5]="Xchg",a))(sf||{}),af=(o=>(o[o.ExtractLaneI8x16=0]="ExtractLaneI8x16",o[o.ExtractLaneU8x16=1]="ExtractLaneU8x16",o[o.ExtractLaneI16x8=2]="ExtractLaneI16x8",o[o.ExtractLaneU16x8=3]="ExtractLaneU16x8",o[o.ExtractLaneI32x4=4]="ExtractLaneI32x4",o[o.ExtractLaneI64x2=5]="ExtractLaneI64x2",o[o.ExtractLaneF32x4=7]="ExtractLaneF32x4",o[o.ExtractLaneF64x2=8]="ExtractLaneF64x2",o))(af||{}),lf=(a=>(a[a.ReplaceLaneI8x16=0]="ReplaceLaneI8x16",a[a.ReplaceLaneI16x8=1]="ReplaceLaneI16x8",a[a.ReplaceLaneI32x4=2]="ReplaceLaneI32x4",a[a.ReplaceLaneI64x2=3]="ReplaceLaneI64x2",a[a.ReplaceLaneF32x4=5]="ReplaceLaneF32x4",a[a.ReplaceLaneF64x2=6]="ReplaceLaneF64x2",a))(lf||{}),of=(_=>(_[_.ShlI8x16=0]="ShlI8x16",_[_.ShrI8x16=1]="ShrI8x16",_[_.ShrU8x16=2]="ShrU8x16",_[_.ShlI16x8=3]="ShlI16x8",_[_.ShrI16x8=4]="ShrI16x8",_[_.ShrU16x8=5]="ShrU16x8",_[_.ShlI32x4=6]="ShlI32x4",_[_.ShrI32x4=7]="ShrI32x4",_[_.ShrU32x4=8]="ShrU32x4",_[_.ShlI64x2=9]="ShlI64x2",_[_.ShrI64x2=10]="ShrI64x2",_[_.ShrU64x2=11]="ShrU64x2",_))(of||{}),uf=(_=>(_[_.Load8Splat=0]="Load8Splat",_[_.Load16Splat=1]="Load16Splat",_[_.Load32Splat=2]="Load32Splat",_[_.Load64Splat=3]="Load64Splat",_[_.Load8x8S=4]="Load8x8S",_[_.Load8x8U=5]="Load8x8U",_[_.Load16x4S=6]="Load16x4S",_[_.Load16x4U=7]="Load16x4U",_[_.Load32x2S=8]="Load32x2S",_[_.Load32x2U=9]="Load32x2U",_[_.Load32Zero=10]="Load32Zero",_[_.Load64Zero=11]="Load64Zero",_))(uf||{}),cf=(o=>(o[o.Load8Lane=0]="Load8Lane",o[o.Load16Lane=1]="Load16Lane",o[o.Load32Lane=2]="Load32Lane",o[o.Load64Lane=3]="Load64Lane",o[o.Store8Lane=4]="Store8Lane",o[o.Store16Lane=5]="Store16Lane",o[o.Store32Lane=6]="Store32Lane",o[o.Store64Lane=7]="Store64Lane",o))(cf||{}),pf=(c=>(c[c.Bitselect=0]="Bitselect",c[c.RelaxedMaddF32x4=1]="RelaxedMaddF32x4",c[c.RelaxedNmaddF32x4=2]="RelaxedNmaddF32x4",c[c.RelaxedMaddF64x2=3]="RelaxedMaddF64x2",c[c.RelaxedNmaddF64x2=4]="RelaxedNmaddF64x2",c[c.RelaxedLaneselectI8x16=5]="RelaxedLaneselectI8x16",c[c.RelaxedLaneselectI16x8=6]="RelaxedLaneselectI16x8",c[c.RelaxedLaneselectI32x4=7]="RelaxedLaneselectI32x4",c[c.RelaxedLaneselectI64x2=8]="RelaxedLaneselectI64x2",c[c.RelaxedDotI8x16I7x16AddToI32x4=9]="RelaxedDotI8x16I7x16AddToI32x4",c))(pf||{}),qb=(t=>(t[t.NonNull=0]="NonNull",t[t.AnyConvertExtern=1]="AnyConvertExtern",t[t.ExternConvertAny=2]="ExternConvertAny",t))(qb||{}),Wb=(e=>(e[e.Add=0]="Add",e[e.Sub=1]="Sub",e))(Wb||{}),Kb=(e=>(e[e.SignedI64=0]="SignedI64",e[e.UnsignedI64=1]="UnsignedI64",e))(Kb||{}),Hb=(i=>(i[i.Null=0]="Null",i[i.NonNull=1]="NonNull",i[i.Cast=2]="Cast",i[i.CastFail=3]="CastFail",i))(Hb||{}),jb=(t=>(t[t.LossyUTF8Array=0]="LossyUTF8Array",t[t.WTF16Array=1]="WTF16Array",t[t.FromCodePoint=2]="FromCodePoint",t))(jb||{}),Qb=(e=>(e[e.UTF8=0]="UTF8",e[e.WTF16=1]="WTF16",e))(Qb||{}),Xb=(e=>(e[e.LossyUTF8Array=0]="LossyUTF8Array",e[e.WTF16Array=1]="WTF16Array",e))(Xb||{}),$b=(e=>(e[e.Equal=0]="Equal",e[e.Compare=1]="Compare",e))($b||{}),zo=(e=>(e[e.Default=0]="Default",e[e.PreserveSideeffects=1]="PreserveSideeffects",e))(zo||{}),ei=class{constructor(r,e){this.buffer=r;this.offset=e}},Jt=class n{constructor(r,e,t){this.ref=r;this.useShadowStack=e;this.sizeType=t;this.hasTemporaryFunction=!1;this.cachedStringsToPointers=new Map;this.cachedPointersToStrings=new Map;assert(t==P.I32||t==P.I64),this.lit=kt(Gu())}static create(r,e){return new n(_d(),r,e)}static createFrom(r,e,t){let i=hs(r),s=new n(vg(i,r.length),e,t);return ie(changetype(i)),s}i32(r){let e=this.lit;return hd(e,r),Nn(this.ref,e)}i64(r,e=0){let t=this.lit;return vb(t,i64_new(r,e)),Nn(this.ref,t)}usize(r){return i64_is(r)?this.sizeType==P.I64?this.i64(i64_low(r),i64_high(r)):(assert(i64_is_u32(r)),this.i32(i64_low(r))):this.sizeType==P.I64?this.i64(i32(r)):this.i32(i32(r))}f32(r){let e=this.lit;return md(e,r),Nn(this.ref,e)}f64(r){let e=this.lit;return yd(e,r),Nn(this.ref,e)}v128(r){assert(r.length==16);let e=this.lit;for(let t=0;t<16;++t)qe(e+t,unchecked(r[t]));return gd(e,e),Nn(this.ref,e)}ref_null(r){return Em(this.ref,r)}ref_eq(r,e){return km(this.ref,r,e)}string_eq(r,e){return xp(this.ref,0,r,e)}string_compare(r,e){return xp(this.ref,1,r,e)}unary(r,e){if(r>141){let t=this.sizeType==P.I64;switch(r){case 142:r=t?1:0;break;case 143:r=t?3:2;break;case 144:r=t?5:4;break;case 145:r=t?21:20;break;default:assert(!1)}}return fh(this.ref,r,e)}binary(r,e,t){if(r>216){let i=this.sizeType==P.I64;switch(r){case 217:r=i?25:0;break;case 218:r=i?26:1;break;case 219:r=i?27:2;break;case 220:r=i?28:3;break;case 221:r=i?29:4;break;case 222:r=i?30:5;break;case 223:r=i?31:6;break;case 224:r=i?32:7;break;case 225:r=i?33:8;break;case 226:r=i?34:9;break;case 227:r=i?35:10;break;case 228:r=i?36:11;break;case 229:r=i?37:12;break;case 230:r=i?38:13;break;case 231:r=i?39:14;break;case 232:r=i?40:15;break;case 233:r=i?41:16;break;case 234:r=i?42:17;break;case 235:r=i?43:18;break;case 236:r=i?44:19;break;case 237:r=i?45:20;break;case 238:r=i?46:21;break;case 239:r=i?47:22;break;case 240:r=i?48:23;break;case 241:r=i?49:24;break;default:assert(!1)}}return yh(this.ref,r,e,t)}wide_int_add_sub(r,e,t,i,s){return hh(this.ref,r,e,t,i,s)}wide_int_mul(r,e,t){return mh(this.ref,r,e,t)}memory_size(r=B.DefaultMemory,e=!1){let t=this.allocStringCached(r);return $d(this.ref,t,e)}memory_grow(r,e=B.DefaultMemory,t=!1){let i=this.allocStringCached(e);return Zd(this.ref,r,i,t)}table_size(r){let e=this.allocStringCached(r);return Pm(this.ref,e)}table_grow(r,e,t=0){let i=this.allocStringCached(r);return Nm(this.ref,i,t,e)}local_get(r,e){return qd(this.ref,r,e)}tostack(r){if(this.useShadowStack){let e=dr(r);return assert(e==P.I32||e==P.Unreachable),this.call(g.tostack,[r],e)}return r}local_tee(r,e,t,i=-1){return i==-1&&(i=dr(e)),t&&this.useShadowStack&&(e=this.tostack(e)),Kd(this.ref,r,e,i)}global_get(r,e){let t=this.allocStringCached(r);return Hd(this.ref,t,e)}table_get(r,e,t){let i=this.allocStringCached(r);return Rm(this.ref,i,e,t)}load(r,e,t,i,s=0,a=r,l=B.DefaultMemory){let o=this.allocStringCached(l);return Jd(this.ref,r,e,s,a,i,t,o)}store(r,e,t,i,s=0,a=r,l=B.DefaultMemory){let o=this.allocStringCached(l);return sh(this.ref,r,s,a,e,t,i,o)}atomic_load(r,e,t,i=0,s=B.DefaultMemory,a=1){let l=this.allocStringCached(s);return ih(this.ref,r,i,t,e,l,a)}atomic_store(r,e,t,i,s=0,a=B.DefaultMemory,l=1){let o=this.allocStringCached(a);return lh(this.ref,r,s,e,t,i,o,l)}atomic_rmw(r,e,t,i,s,a,l=B.DefaultMemory,o=1){let u=this.allocStringCached(l);return wh(this.ref,r,e,t,i,s,a,u,o)}atomic_cmpxchg(r,e,t,i,s,a,l=B.DefaultMemory,o=1){let u=this.allocStringCached(l);return Ph(this.ref,r,e,t,i,s,a,u,o)}atomic_wait(r,e,t,i,s=B.DefaultMemory){let a=this.allocStringCached(s);return Mh(this.ref,r,e,t,i,a)}atomic_notify(r,e,t=B.DefaultMemory){let i=this.allocStringCached(t);return Uh(this.ref,r,e,i)}atomic_fence(r=null){let e=this.allocStringCached(r);return qh(this.ref,e)}local_set(r,e,t){return t&&this.useShadowStack&&(e=this.tostack(e)),Wd(this.ref,r,e)}global_set(r,e){let t=this.allocStringCached(r);return jd(this.ref,t,e)}table_set(r,e,t){let i=this.allocStringCached(r);return Cm(this.ref,i,e,t)}block(r,e,t=P.None){let i=this.allocStringCached(r),s=Ee(e),a=Ed(this.ref,i,s,e.length,t);return ie(s),a}flatten(r,e=P.None){let t=r.length;if(t==0)return this.nop();if(t==1){let i=r[0];switch(re(i)){case 19:case 56:case 23:return i}let s=pe(i);return s!=P.Unreachable&&s!=e?this.unreachable():i}return this.block(null,r,e)}br(r,e=0,t=0){let i=this.allocStringCached(r);return wd(this.ref,i,e,t)}drop(r){return Ku(this.ref,r)}maybeDrop(r){let e=dr(r);return e!=P.None&&e!=P.Unreachable?Ku(this.ref,r):r}maybeDropCondition(r,e){return(ks(r,this.ref)&-21)!=0?this.block(null,[this.drop(r),e],pe(e)):e}loop(r,e){let t=this.allocStringCached(r);return kd(this.ref,t,e)}if(r,e,t=0){return Td(this.ref,r,e,t)}nop(){return kh(this.ref)}return(r=0){return Ih(this.ref,r)}select(r,e,t){return Eh(this.ref,t,r,e)}switch(r,e,t,i=0){let s=r.length,a=new Array(s);for(let c=0;c<s;++c)unchecked(a[c]=this.allocStringCached(r[c]));let l=Ee(a),o=this.allocStringCached(e),u=Pd(this.ref,l,s,o,t,i);return ie(l),u}call(r,e,t,i=!1){let s=this.allocStringCached(r),a=Ee(e),l=i?Gd(this.ref,s,a,e?e.length:0,t):Dd(this.ref,s,a,e?e.length:0,t);return ie(a),l}return_call(r,e,t){return this.call(r,e,t,!0)}call_indirect(r,e,t,i,s,a=!1){let l=this.allocStringCached(r??B.DefaultTable),o=Ee(t),u=a?Od(this.ref,l,e,o,t?t.length:0,i,s):Ud(this.ref,l,e,o,t?t.length:0,i,s);return ie(o),u}return_call_indirect(r,e,t,i,s){return this.call_indirect(r,e,t,i,s,!0)}unreachable(){return Fh(this.ref)}memory_copy(r,e,t,i=B.DefaultMemory,s=B.DefaultMemory){let a=this.allocStringCached(i),l=this.allocStringCached(s);return _m(this.ref,r,e,t,a,l)}memory_fill(r,e,t,i=B.DefaultMemory){let s=this.allocStringCached(i);return ym(this.ref,r,e,t,s)}try(r,e,t,i,s=null){let a=t.length,l=new Array(a);for(let d=0;d<a;++d)l[d]=this.allocStringCached(t[d]);let o=Ee(l),u=Ee(i),c=this.allocStringCached(r),f=this.allocStringCached(s),_=Bm(this.ref,c,e,o,a,u,i.length,f);return ie(u),ie(o),_}throw(r,e){let t=this.allocStringCached(r),i=Ee(e),s=zm(this.ref,t,i,e.length);return ie(i),s}rethrow(r){let e=this.allocStringCached(r);return Um(this.ref,e)}pop(r){return Km(this.ref,r)}tuple_make(r){let e=Ee(r),t=Vm(this.ref,e,r.length);return ie(e),t}tuple_extract(r,e){return qm(this.ref,r,e)}simd_extract(r,e,t){return Wh(this.ref,r,e,t)}simd_replace(r,e,t,i){return Hh(this.ref,r,e,t,i)}simd_shuffle(r,e,t){assert(t.length==16);let i=hs(t),s=Xh(this.ref,r,e,i);return ie(i),s}simd_ternary(r,e,t,i){return Yh(this.ref,r,e,t,i)}simd_shift(r,e,t){return rm(this.ref,r,e,t)}simd_load(r,e,t,i,s=B.DefaultMemory){let a=this.allocStringCached(s);return sm(this.ref,r,t,i,e,a)}simd_loadstorelane(r,e,t,i,s,a,l=B.DefaultMemory){let o=this.allocStringCached(l);return lm(this.ref,r,t,i,s,e,a,o)}ref_is_null(r){return Am(this.ref,r)}ref_as(r,e){return vc(this.ref,r,e)}ref_as_nonnull(r){return Zb(pe(r))?vc(this.ref,0,r):r}ref_func(r,e){let t=this.allocStringCached(r);return vm(this.ref,t,_r(e))}i31_new(r){return Hm(this.ref,r)}i31_get(r,e){return Qm(this.ref,r,e)}addGlobal(r,e,t,i){let s=this.allocStringCached(r);return tg(this.ref,s,e,t,i)}getGlobal(r){let e=this.allocStringCached(r);return wp(this.ref,e)}removeGlobal(r){let e=this.allocStringCached(r);return wp(this.ref,e)?(rg(this.ref,e),!0):!1}addTag(r,e,t){let i=this.allocStringCached(r);return og(this.ref,i,e,t)}getTag(r){let e=this.allocStringCached(r);return ug(this.ref,e)}removeTag(r){let e=this.allocStringCached(r);cg(this.ref,e)}addFunction(r,e,t,i,s){let a=this.allocStringCached(r),l=Ee(i),o=Bn(this.ref,a,e,t,l,i?i.length:0,s);return ie(l),o}setLocalName(r,e,t){Uy(r,e,this.allocStringCached(t))}getFunction(r){let e=this.allocStringCached(r);return Ln(this.ref,e)}removeFunction(r){let e=this.allocStringCached(r);Zi(this.ref,e)}hasFunction(r){let e=this.allocStringCached(r);return Ln(this.ref,e)!=0}addTemporaryFunction(r,e,t){this.hasTemporaryFunction=assert(!this.hasTemporaryFunction);let i=this.allocStringCached(""),s=Ee(e),a=Bn(this.ref,i,it(e),r,0,0,t);return ie(s),a}removeTemporaryFunction(){this.hasTemporaryFunction=!assert(this.hasTemporaryFunction);let r=this.allocStringCached("");Zi(this.ref,r)}setStart(r){gg(this.ref,r)}addFunctionExport(r,e){let t=this.allocStringCached(r),i=this.allocStringCached(e);return Qa(this.ref,t,i)}addTableExport(r,e){let t=this.allocStringCached(r),i=this.allocStringCached(e);return Qy(this.ref,t,i)}addMemoryExport(r,e){let t=this.allocStringCached(r),i=this.allocStringCached(e);return Xy(this.ref,t,i)}addGlobalExport(r,e){let t=this.allocStringCached(r),i=this.allocStringCached(e);return $y(this.ref,t,i)}addTagExport(r,e){let t=this.allocStringCached(r),i=this.allocStringCached(e);return Zy(this.ref,t,i)}removeExport(r){let e=this.allocStringCached(r);$a(this.ref,e)}hasExport(r){let e=this.allocStringCached(r);return Xa(this.ref,e)!=0}addFunctionImport(r,e,t,i,s){let a=this.allocStringCached(r),l=this.allocStringCached(e),o=this.allocStringCached(t);qy(this.ref,a,l,o,i,s)}addTableImport(r,e,t){let i=this.allocStringCached(r),s=this.allocStringCached(e),a=this.allocStringCached(t);Wy(this.ref,i,s,a)}addMemoryImport(r,e,t,i=!1){let s=this.allocStringCached(r),a=this.allocStringCached(e),l=this.allocStringCached(t);Ky(this.ref,s,a,l,i)}addGlobalImport(r,e,t,i,s=!1){let a=this.allocStringCached(r),l=this.allocStringCached(e),o=this.allocStringCached(t);Hy(this.ref,a,l,o,i,s)}addTagImport(r,e,t,i,s){let a=this.allocStringCached(r),l=this.allocStringCached(e),o=this.allocStringCached(t);jy(this.ref,a,l,o,i,s)}static{this.UNLIMITED_MEMORY=-1}setMemory(r,e,t,i,s=null,a=B.DefaultMemory,l=!1){let o=this.allocStringCached(s),u=this.allocStringCached(a),c=t.length,f=new Array(c),_=new Uint8Array(c),d=new Array(c),m=new Array(c);for(let k=0;k<c;++k){let w=unchecked(t[k]),R=w.buffer,C=w.offset;unchecked(f[k]=hs(R)),unchecked(_[k]=0),unchecked(d[k]=i==2?this.i64(i64_low(C),i64_high(C)):this.i32(i64_low(C))),unchecked(m[k]=R.length)}let h=Ee(f),b=hs(_),A=Ee(d),S=tf(m);yg(this.ref,r,e,o,0,h,b,A,S,c,l,!1,u),ie(S),ie(A),ie(b),ie(h);for(let k=c-1;k>=0;--k)ie(unchecked(f[k]))}static{this.UNLIMITED_TABLE=-1}addFunctionTable(r,e,t,i,s){let a=this.allocStringCached(r),l=i.length,o=new Array(l);for(let f=0;f<l;++f)unchecked(o[f]=this.allocStringCached(i[f]));let u=Ee(o),c=Cp(this.ref,a);c?(dg(c,e),hg(c,t)):c=Rp(this.ref,a,e,t,P.funcref()),mg(this.ref,a,a,u,l,s),ie(u)}ensureFunctionTable(r){let e=this.allocStringCached(r);Cp(this.ref,e)||Rp(this.ref,e,0,n.UNLIMITED_TABLE,P.funcref())}addCustomSection(r,e){let t=this.allocStringCached(r),i=hs(e);Cg(this.ref,t,i,e.length),ie(i)}getOptimizeLevel(){return Qg()}setOptimizeLevel(r){Xg(r)}getShrinkLevel(){return $g()}setShrinkLevel(r){Zg(r)}getDebugInfo(){return Yg()}setDebugInfo(r){Jg(r)}getTrapsNeverHappen(){return eb()}setTrapsNeverHappen(r){tb(r)}getClosedWorld(){return rb()}setClosedWorld(r){nb(r)}getLowMemoryUnused(){return ib()}setLowMemoryUnused(r){sb(r)}getZeroFilledMemory(){return ab()}setZeroFilledMemory(r){lb(r)}getFastMath(){return ob()}setFastMath(r){ub(r)}getGenerateStackIR(){return cb()}setGenerateStackIR(r){pb(r)}getOptimizeStackIR(){return fb()}setOptimizeStackIR(r){_b(r)}getPassArgument(r){let e=this.allocStringCached(r),t=db(e);return t?Ye(t):null}setPassArgument(r,e){let t=this.allocStringCached(r),i=this.allocStringCached(e);hb(t,i)}clearPassArguments(){mb()}getAlwaysInlineMaxSize(){return yb()}setAlwaysInlineMaxSize(r){gb(r)}getFlexibleInlineMaxSize(){return bb()}setFlexibleInlineMaxSize(r){xb(r)}getOneCallerInlineMaxSize(){return Eb()}setOneCallerInlineMaxSize(r){Ab(r)}getAllowInliningFunctionsWithLoops(){return Tb()}setAllowInliningFunctionsWithLoops(r){Sb(r)}setPartialInliningIfs(r){this.setPassArgument("partial-inlining-ifs",r.toString())}getFeatures(){return wg(this.ref)}setFeatures(r){r&16&&(r|=524288),Rg(this.ref,r)}runPasses(r,e=0){let t=r.length,i=new Array(t);for(let a=0;a<t;++a)i[a]=No(r[a]);let s=Ee(i);e?Vy(e,this.ref,s,t):xg(this.ref,s,t),ie(s);for(let a=t-1;a>=0;--a)ie(i[a])}optimize(r,e,t=!1,i=!1){(r>=3||e>=2)&&(r=4),this.clearPassArguments(),this.setOptimizeLevel(r),this.setShrinkLevel(e),this.setDebugInfo(t),this.setZeroFilledMemory(i),this.setFastMath(!0);let s=r>=2||e>=1;if(this.setGenerateStackIR(s),this.setOptimizeStackIR(s),r>=2&&e==0?(this.setAlwaysInlineMaxSize(12),this.setFlexibleInlineMaxSize(70),this.setOneCallerInlineMaxSize(200),this.setAllowInliningFunctionsWithLoops(!0)):(this.setAlwaysInlineMaxSize(r<=1||e>=2?2:6),this.setFlexibleInlineMaxSize(65),this.setOneCallerInlineMaxSize(80),this.setAllowInliningFunctionsWithLoops(!1)),this.setPartialInliningIfs(r>=2?4:0),r>0||e>0){let a=new Array;a.push("duplicate-function-elimination"),a.push("remove-unused-module-elements"),r>=2&&a.push("once-reduction"),(r>=2||e>=1)&&(a.push("inlining"),a.push("simplify-globals-optimizing"),a.push("generate-global-effects")),(r>=3||e>=1)&&(a.push("rse"),a.push("vacuum"),a.push("code-folding"),a.push("ssa-nomerge"),a.push("local-cse"),a.push("remove-unused-brs"),a.push("remove-unused-names"),a.push("merge-blocks"),a.push("precompute-propagate"),a.push("simplify-globals-optimizing"),a.push("dae-optimizing")),r>=3&&(a.push("simplify-locals-nostructure"),a.push("flatten"),a.push("vacuum"),a.push("simplify-locals-notee-nostructure"),a.push("vacuum"),a.push("local-cse"),a.push("licm"),a.push("merge-locals"),a.push("reorder-locals")),a.push("optimize-instructions"),r>=2&&a.push("avoid-reinterprets"),a.push("dce"),a.push("remove-unused-brs"),a.push("remove-unused-names"),a.push("merge-blocks"),this.getFeatures()&512&&a.push("tuple-optimization"),r>=3||e>=2?(a.push("inlining"),a.push("precompute-propagate"),a.push("simplify-globals-optimizing")):r>=2||e>=1?a.push("precompute-propagate"):a.push("precompute"),(r>=2||e>=1)&&a.push("pick-load-signs"),a.push("simplify-locals-notee-nostructure"),a.push("vacuum"),(r>=2||e>=1)&&a.push("local-cse"),a.push("reorder-locals"),a.push("coalesce-locals"),a.push("simplify-locals"),a.push("coalesce-locals"),a.push("reorder-locals"),a.push("vacuum"),(r>=2||e>=1)&&(a.push("rse"),a.push("vacuum")),e>=1&&(a.push("merge-locals"),a.push("vacuum")),(r>=2||e>=1)&&(a.push("simplify-globals-optimizing"),a.push("simplify-globals-optimizing")),a.push("remove-unused-brs"),a.push("remove-unused-names"),a.push("merge-blocks"),r>=3&&a.push("optimize-instructions"),(r>=2||e>=1)&&(a.push("simplify-globals-optimizing"),a.push("dae-optimizing")),(r>=2||e>=2)&&a.push("inlining-optimizing"),this.getLowMemoryUnused()&&(r>=3||e>=1?a.push("optimize-added-constants-propagate"):a.push("optimize-added-constants")),a.push("duplicate-import-elimination"),r>=2||e>=2?a.push("simplify-globals-optimizing"):(a.push("simplify-globals"),a.push("vacuum")),r>=2&&(this.getFeatures()&1024)!=0&&(a.push("heap2local"),a.push("merge-locals"),a.push("local-subtyping")),r>=2||e>=1?(a.push("precompute-propagate"),a.push("simplify-globals-optimizing"),a.push("simplify-globals-optimizing")):a.push("precompute"),a.push("directize"),a.push("dae-optimizing"),(r>=3||e>=1)&&a.push("gufa-optimizing"),a.push("inlining-optimizing"),(r>=2||e>=1)&&(a.push("code-folding"),a.push("ssa-nomerge"),a.push("rse"),a.push("code-pushing"),r>=3&&(a.push("simplify-globals"),a.push("vacuum"),a.push("precompute-propagate"),a.push("inlining-optimizing"),a.push("directize"),a.push("dae-optimizing"),a.push("local-cse"),a.push("merge-locals"),a.push("coalesce-locals"),a.push("simplify-locals"),a.push("vacuum"),a.push("inlining"),a.push("precompute-propagate"),a.push("rse"),a.push("vacuum"),a.push("ssa-nomerge"),a.push("simplify-locals"),a.push("coalesce-locals")),a.push("optimize-instructions"),a.push("remove-unused-brs"),a.push("remove-unused-names"),a.push("merge-blocks"),a.push("vacuum"),this.getFeatures()&16384&&a.push("string-gathering"),a.push("simplify-globals-optimizing"),a.push("remove-unused-brs"),a.push("optimize-instructions"),a.push("vacuum")),a.push("reorder-globals"),a.push("reorder-functions"),(r>=2||e>=1)&&a.push("duplicate-function-elimination"),e>=2&&a.push("merge-similar-functions"),a.push("memory-packing"),a.push("remove-unused-module-elements"),(r>=2||e>=1)&&a.push("discard-global-effects"),this.runPasses(a)}}validate(){return bg(this.ref)==1}interpret(){Ig(this.ref)}toBinary(r=null){assert(Gu()>=Eg());let e=this.lit,t=No(r);Ag(e,this.ref,t);let i=gr(e+0),s=gr(e+4),a=gr(e+8),l=new Lo(z1(assert(i),s),Ye(a));return t&&ie(t),a&&ie(a),ie(i),l}toText(r=!0){let e=r?Sg(this.ref):Tg(this.ref),t=Ye(e);return e&&ie(e),t||""}allocStringCached(r){if(r==null)return 0;let e=this.cachedStringsToPointers;if(e.has(r))return changetype(e.get(r));let t=No(r);return e.set(r,t),t}readStringCached(r){if(r==0)return null;let e=this.cachedPointersToStrings;if(e.has(r))return changetype(e.get(r));let t=Ye(r);return e.set(r,t),t}dispose(){assert(this.ref);for(let r=Map_values(this.cachedStringsToPointers),e=0,t=r.length;e<t;++e){let i=unchecked(r[e]);ie(i)}this.cachedStringsToPointers.clear(),this.cachedPointersToStrings.clear(),ie(this.lit),dd(this.ref),this.ref=0}createRelooper(){return Bo.create(this)}tryCopyTrivialExpression(r){return this.isTrivialExpression(r)?this.copyExpression(r):0}isTrivialExpression(r){switch(Kt(r)){case 8:case 10:case 14:case 20:case 22:case 23:case 38:case 42:return!0}return!1}copyExpression(r){return bd(r,this.ref)}runExpression(r,e,t=50,i=1){let s=Gg(this.ref,e,t,i),a=Ug(s,r);if(a){if(!this.isConstExpression(a))return 0;assert(pe(a)==pe(r))}return a}isConstExpression(r){switch(re(r)){case 14:case 42:case 44:case 61:return!0;case 16:{if(this.getFeatures()&8192)switch(ri(r)){case 0:case 1:case 2:case 25:case 26:case 27:return this.isConstExpression(at(r))&&this.isConstExpression(We(r))}break}}return!1}addDebugInfoFile(r){let e=No(r),t=kg(this.ref,e);return ie(e),t}getDebugInfoFile(r){return Ye(Fg(this.ref,r))}setDebugLocation(r,e,t,i,s){Oy(r,e,t,i,s)}};function it(n){if(!n)return P.None;switch(n.length){case 0:return P.None;case 1:return n[0]}let r=Ee(n),e=Q_(r,n.length);return ie(r),e}function ff(n){let r=X_(n),e=kt(r<<2);$_(n,e);let t=new Array(r);for(let i=0;i<r;++i)unchecked(t[i]=gr(e+(i<<2)));return ie(e),t}function Zb(n){return Z_(n)}function re(n){return Kt(n)}function pe(n){return dr(n)}function ae(n){return oh(n)}function Ne(n){return i64_low(Lp(n))}function Ge(n){return i64_high(Lp(n))}function _f(n,r){let e=0,t=0;return r?(e=Ne(n),t=Ge(n)):e=ae(n),i64_new(e,t)}function Ce(n){return uh(n)}function Pe(n){return ch(n)}function df(n){let r=kt(16);ph(n,r);let e=new Uint8Array(16);for(let t=0;t<16;++t)e[t]=Or(r+t);return ie(r),e}function st(n){if(re(n)!=14)return!1;let r=pe(n);return r==P.I32?ae(n)==0:r==P.I64?(Ne(n)|Ge(n))==0:r==P.F32?Ce(n)==0:r==P.F64?Pe(n)==0:!1}function xt(n){if(re(n)!=14)return!1;let r=pe(n);return r==P.I32?ae(n)!=0:r==P.I64?(Ne(n)|Ge(n))!=0:r==P.F32?Ce(n)!=0:r==P.F64?Pe(n)!=0:!1}function Do(n){if(re(n)!=14)return!1;let r=pe(n);if(r==P.F32){let e=Ce(n);return e==0&&f32_as_i32(e)<0}if(r==P.F64){let e=Pe(n);return e==0&&i64_signbit(f64_as_i64(e))}return!1}function c1(n){if(re(n)!=14)return!1;let r=pe(n);return r==P.F32?isNaN(Ce(n)):r==P.F64?isNaN(Pe(n)):!1}function Go(n,r){let e=re(r),t=pe(r);if(t==P.F32||t==P.F64){if(e==14)return isNaN(t==P.F32?Ce(r):Pe(r));if(e==10){let i=n.runExpression(r,0,8);if(i)return isNaN(t==P.F32?Ce(i):Pe(i))}}return!1}function Pt(n){return za(n)}function Uo(n){return Pn(n)}function Vo(n){return Gr(n)}function bs(n){return Da(n)}function xs(n){return Ye(Ua(n))}function ri(n){return gh(n)}function at(n){return Ki(n)}function We(n){return Hi(n)}function Es(n){return _h(n)}function Oo(n){return Wi(n)}function hf(n){return rh(n)}function p1(n){return th(n)}function f1(n){return Oi(n)}function mf(n){return eh(n)}function _1(n){return Va(n)}function d1(n){return Oa(n)}function h1(n){return Ur(n)}function m1(n){return qi(n)}function As(n){return Ye(Pa(n))}function Ts(n){return Pi(n)}function Ss(n,r){return Ni(n,r)}function qo(n){return Bi(n)}function vs(n){return Li(n)}function ni(n){return Mi(n)}function y1(n){return Ye(Na(n))}function g1(n){return zi(n)}function b1(n){return Ye(Ba(n))}function x1(n){return Di(n)}function yf(n){return ji(n)}function gf(n){return Qi(n)}function E1(n){return Xi(n)}function A1(n){return $i(n)}function T1(n){return Vr(n)}function Is(n){return Ye(Cn(n))}function Nt(n){return hr(n)}function Je(n,r){return mr(n,r)}function S1(n){return Vi(n)}function v1(n){return yr(n)}function bf(n){return Ye(Mn(n))}function I1(n){return Yi(n)}function k1(n){return Ji(n)}function F1(n){let r=Ka(n),e=new Array(r);for(let t=0;t<r;++t)unchecked(e[t]=Ha(n,t));return e}function w1(n){return Ye(sg(n))}function R1(n){return ag(n)}function xf(n){return lg(n)}function C1(n){return Za(n)}function P1(n){return Ye(pg(n))}function N1(n){return fg(n)}function B1(n){return _g(n)}var Bo=class n{constructor(r,e){this.module=r;this.ref=e}static create(r){return new n(r,Ng(r.ref))}addBlock(r){return Bg(this.ref,r)}addBranch(r,e,t=0,i=0){Lg(r,e,t,i)}addBlockWithSwitch(r,e){return Mg(this.ref,r,e)}addBranchForSwitch(r,e,t,i=0){let s=L1(t);zg(r,e,s,t.length,i),ie(s)}renderAndDispose(r,e){return Dg(this.ref,r,e)}},ys=class{constructor(r,e){this.values=new Array;this.indexes=new Array;this.cases=new Array;this.defaultIndex=-1;this.module=r,this.condition=e}addOrReplaceCase(r,e){let t=this.values.indexOf(r),i=this.addCode(e);t>=0?this.indexes[t]=i:(this.values.push(r),this.indexes.push(i))}addCase(r,e){this.values.push(r),this.indexes.push(this.addCode(e))}addCode(r){let e=this.cases,t=e.indexOf(r);return t<0&&(t=e.length,e.push(r)),t}addDefault(r){assert(this.defaultIndex==-1);let e=this.cases;this.defaultIndex=e.length,e.push(r)}render(r,e=""){let t=this.module,i=this.cases,s=i.length;if(!s)return t.drop(this.condition);let a=this.values,l=a.length,o=this.indexes,u=new Array(1+l+1),c=new Array(s);for(let h=0;h<s;++h)unchecked(c[h]=`case${h}${e}`);u[0]=t.local_set(r,this.condition,!1);for(let h=0;h<l;++h){let b=unchecked(o[h]);unchecked(u[1+h]=t.br(c[b],t.binary(15,t.local_get(r,P.I32),t.i32(a[h]))))}let f=this.defaultIndex,_=`default${e}`;u[1+l]=t.br(~f?c[f]:_);let d=t.block(c[0],u);for(let h=1;h<s;++h){let b=i[h-1];b.unshift(d),d=t.block(unchecked(c[h]),b)}let m=i[s-1];return m.unshift(d),t.block(~f?null:_,m)}},Ef=(A=>(A[A.None=0]="None",A[A.Branches=1]="Branches",A[A.Calls=2]="Calls",A[A.ReadsLocal=4]="ReadsLocal",A[A.WritesLocal=8]="WritesLocal",A[A.ReadsGlobal=16]="ReadsGlobal",A[A.WritesGlobal=32]="WritesGlobal",A[A.ReadsMemory=64]="ReadsMemory",A[A.WritesMemory=128]="WritesMemory",A[A.ReadsTable=256]="ReadsTable",A[A.WritesTable=512]="WritesTable",A[A.ImplicitTrap=1024]="ImplicitTrap",A[A.IsAtomic=2048]="IsAtomic",A[A.Throws=4096]="Throws",A[A.DanglingPop=8192]="DanglingPop",A[A.TrapsNeverHappen=16384]="TrapsNeverHappen",A[A.Any=32767]="Any",A))(Ef||{});function ks(n,r){return Pg(n,r)}function Wo(n,r){return(ks(n,r)&-21)!=0}function hs(n){if(!n)return 0;let r=n.length,e=kt(r);for(let t=0;t<r;++t)qe(e+t,unchecked(n[t]));return e}function L1(n){if(!n)return 0;let r=n.length,e=kt(r<<2),t=e;for(let i=0;i<r;++i){let s=unchecked(n[i]);Ja(t,s),t+=4}return e}function tf(n){if(!n)return 0;let r=n.length,e=kt(r<<2),t=e;for(let i=0;i<r;++i){let s=unchecked(n[i]);Ja(t,s),t+=4}return e}function Ee(n){if(!n)return 0;assert(ASC_TARGET!=2);let r=n.length,e=kt(r<<2),t=e;for(let i=0,s=r;i<s;++i){let a=unchecked(n[i]);Ja(t,a),t+=4}return e}function M1(n){let r=0;for(let e=0,t=n.length;e<t;++e){let i=n.charCodeAt(e)>>>0;i<=127?r+=1:i<=2047?r+=2:Hn(i)&&e+1<t&&cl(n.charCodeAt(e+1))?(e++,r+=4):r+=3}return r}function No(n){if(n==null)return 0;let r=M1(n),e=kt(r+1)>>>0,t=e;if(r==n.length)for(let i=0,s=n.length;i<s;++i){let a=n.charCodeAt(i)>>>0;qe(t++,a)}else for(let i=0,s=n.length;i<s;++i){let a=n.charCodeAt(i)>>>0,l;a<=127?qe(t++,a):a<=2047?(qe(t++,192|a>>>6),qe(t++,128|a&63)):Hn(a)&&i+1<s&&cl(l=n.charCodeAt(i+1))?(a=is(a,l),++i,qe(t++,240|a>>>18),qe(t++,128|a>>>12&63),qe(t++,128|a>>>6&63),qe(t++,128|a&63)):(qe(t++,224|a>>>12),qe(t++,128|a>>>6&63),qe(t++,128|a&63))}return qe(t,0),e}function z1(n,r){let e=new Uint8Array(r);for(let t=0;t<r;++t)unchecked(e[t]=Or(n+t));return e}function Ye(n){if(!n)return null;let r=new Array,e,t,i,s;for(;e=Or(n++);){if(!(e&128)){r.push(e);continue}if(t=Or(n++)&63,(e&224)==192){r.push((e&31)<<6|t);continue}if(i=Or(n++)&63,(e&240)==224?e=(e&15)<<12|t<<6|i:(s=Or(n++)&63,(e&248)==240?e=(e&7)<<18|t<<12|i<<6|s:assert(!1,"Invalid UTF8 sequence during readString")),e<65536)r.push(e);else{let a=e-65536;r.push(ns|a>>>10),r.push(Kn|a&1023)}}return String.fromCharCodes(r)}var Lo=class{constructor(r,e){this.output=r;this.sourceMap=e}},Yt=!1;function Fs(n){if(n==p.void)return P.None;let r=Yb(n);if(r)return r;let e=n;if(n=n.nonNullableType,r=n.ref)return Ae(_r(r),e.is(512));ASC_TARGET&&assert(sizeof()==4);let t=Vg(0),i=new Map;xr(t,i,n);let s=Ya(t),a=kt(max(4*s,8));if(!Kg(t,a,a,a+4)){let l=gr(a),o=gr(a+4);throw ie(a),new Error(`type builder error at index ${l}: ${rf.toString(o)}`)}for(let l=Map_keys(i),o=0,u=l.length;o<u;++o){let c=l[o];assert(!c.is(512));let f=gr(a+4*o),_=Ae(f,!1);assert(!c.ref),c.ref=_,Yt&&console.log(` set ${c.toString()}`);let d=c.getClass();if(d){let m=d.program.module;Hg(m.ref,f,m.allocStringCached(d.internalName));let h=d.members;if(h){let b=fd(f),A=0;for(let S=Map_values(h),k=0,w=S.length;k<w;++k){let R=S[k];if(R.kind!=10)continue;let C=R.instance;!C||!C.isField||jg(m.ref,f,A++,m.allocStringCached(C.name))}assert(b==A)}}}return ie(a),Yt&&console.log(` finalize ${n.toString()}`),r=assert(n.ref),Ae(_r(r),e.is(512))}function Yb(n){switch(n.kind){case 0:case 1:case 6:case 2:case 7:case 3:case 8:return P.I32;case 4:case 9:return P.I64;case 5:case 10:{if(n.isInternalReference)break;return n.size==64?P.I64:P.I32}case 11:return P.F32;case 12:return P.F64;case 13:return P.V128;case 16:return Ae(Ie.Func,n.is(512));case 15:return Ae(Ie.Extern,n.is(512));case 17:return Ae(Ie.Any,n.is(512));case 18:return Ae(Ie.Eq,n.is(512));case 19:return Ae(Ie.Struct,n.is(512));case 20:return Ae(Ie.Array,n.is(512));case 21:return Ae(Ie.I31,n.is(512));case 22:return Ae(Ie.String,n.is(512));case 26:assert(!1)}return 0}function D1(n){switch(n.kind){case 0:case 1:case 6:return ms.I8;case 2:case 7:return ms.I16}return ms.NotPacked}function xr(n,r,e){if(e==p.void)return P.None;let t=Yb(e);if(t||(assert(!e.is(512)),t=e.ref))return t;if(r.has(e))return Yt&&console.log(` prepare ${e.toString()} (seen)`),changetype(r.get(e));Yt&&console.log(`prepare ${e.toString()}`);let i=e.getClass();if(i){let a=i.base,l=0;a&&(l=xr(n,r,a.type));let o=Ya(n);Pp(n,1),Yt&&console.log(` block [${o}]: ${e.toString()}`);let u=Np(n,o);t=zn(n,u,!1),r.set(e,t);let c=new Array,f=new Array,_=new Array,d=i.members;if(d)for(let A=Map_values(d),S=0,k=A.length;S<k;++S){let w=A[S];if(w.kind!=10)continue;let R=w.instance;if(!R||!R.isField)continue;let C=R.type;Yt&&console.log(` field ${C.toString()}`),C.is(512)?c.push(zn(n,_r(xr(n,r,C.nonNullableType)),!0)):c.push(xr(n,r,C)),f.push(D1(C)),_.push(1)}let m=Ee(c),h=tf(f),b=tf(_);return Yt&&console.log(` concretize [${o}]: ${e.toString()}`),qg(n,o,m,h,b,c.length),a&&(Yt&&console.log(` set super [${o}]: ${e.toString()} <: ${a.type.toString()} ${l==a.type.ref?" (known)":""}`),Wg(n,o,_r(l))),ie(b),ie(h),ie(m),t}let s=e.getSignature();if(s){let a=Ya(n);Pp(n,1);let l=zn(n,Np(n,a),!1);r.set(e,l);let o=new Array,u=new Array,c=s.parameterTypes;for(let m=0,h=c.length;m<h;++m){let b=c[m];b.is(512)?o.push(zn(n,_r(xr(n,r,b.nonNullableType)),!0)):o.push(xr(n,r,b))}let f=s.returnType;u.push(f==p.void?P.None:f.is(512)?zn(n,_r(xr(n,r,f.nonNullableType)),!0):xr(n,r,f));let _;if(o.length>1){let m=Ee(o);_=Bp(n,m,o.length),ie(m)}else _=o.length?o[0]:P.None;let d;if(u.length>1){let m=Ee(u);d=Bp(n,m,u.length),ie(m)}else d=u[0];return Yt&&console.log(` concretize [${a}]: ${e.toString()}`),Og(n,a,_,d),l}throw new Error(`unexpected complex type: ${e.toString()}`)}var Ho=(R=>(R[R.None=0]="None",R[R.Returns=1]="Returns",R[R.ReturnsWrapped=2]="ReturnsWrapped",R[R.ReturnsNonNull=4]="ReturnsNonNull",R[R.Throws=8]="Throws",R[R.Breaks=16]="Breaks",R[R.Continues=32]="Continues",R[R.AccessesThis=64]="AccessesThis",R[R.CallsSuper=128]="CallsSuper",R[R.Terminates=256]="Terminates",R[R.ConditionallyReturns=512]="ConditionallyReturns",R[R.ConditionallyThrows=1024]="ConditionallyThrows",R[R.ConditionallyBreaks=2048]="ConditionallyBreaks",R[R.ConditionallyContinues=4096]="ConditionallyContinues",R[R.ConditionallyAccessesThis=8192]="ConditionallyAccessesThis",R[R.MayReturnNonThis=16384]="MayReturnNonThis",R[R.UncheckedContext=32768]="UncheckedContext",R[R.CtorParamContext=65536]="CtorParamContext",R[R.InlineContext=131072]="InlineContext",R[R.AnyCategorical=511]="AnyCategorical",R[R.AnyConditional=15872]="AnyConditional",R))(Ho||{}),ws=(s=>(s[s.None=0]="None",s[s.Constant=1]="Constant",s[s.Wrapped=2]="Wrapped",s[s.NonNull=4]="NonNull",s[s.Initialized=8]="Initialized",s))(ws||{}),Af=(e=>(e[e.None=0]="None",e[e.Initialized=1]="Initialized",e))(Af||{}),Tf=(t=>(t[t.Unknown=0]="Unknown",t[t.True=1]="True",t[t.False=2]="False",t))(Tf||{}),er=class n{constructor(r,e=null){this.targetFunction=r;this.inlineFunction=e;this.parent=null;this.outer=null;this.flags=0;this.continueLabel=null;this.breakLabel=null;this.scopedLocals=null;this.scopedTypeAlias=null;this.localFlags=[];this.thisFieldFlags=null;this.inlineReturnLabel=null;this.trueFlows=null;this.falseFlows=null}static createDefault(r){let e=new n(r);return r.is(524288)&&e.initThisFieldFlags(),r.program.options.uncheckedBehavior===2&&e.set(32768),e}static createInline(r,e){let t=new n(r,e);return t.inlineReturnLabel=`${e.internalName}|inlined.${e.nextInlineId++}`,e.is(524288)&&t.initThisFieldFlags(),r.program.options.uncheckedBehavior===2&&t.set(32768),t}get isInline(){return this.inlineFunction!=null}get sourceFunction(){let r=this.inlineFunction;return r||this.targetFunction}get program(){return this.targetFunction.program}get returnType(){return this.sourceFunction.signature.returnType}get contextualTypeArguments(){return this.sourceFunction.contextualTypeArguments}is(r){return(this.flags&r)==r}isAny(r){return(this.flags&r)!=0}set(r){this.flags|=r}unset(r){this.flags&=~r}deriveConditionalFlags(){let r=this.flags&15872;return this.is(1)&&(r|=512),this.is(8)&&(r|=1024),this.is(16)&&(r|=2048),this.is(32)&&(r|=4096),this.is(64)&&(r|=8192),r}fork(r=!1,e=r){let t=new n(this.targetFunction,this.inlineFunction);if(t.parent=this,t.flags=this.flags,t.outer=this.outer,r?t.flags&=-2065:t.breakLabel=this.breakLabel,e?t.flags&=-4129:t.continueLabel=this.continueLabel,t.localFlags=this.localFlags.slice(),this.sourceFunction.is(524288)){let i=assert(this.thisFieldFlags);t.thisFieldFlags=me(i)}else assert(!this.thisFieldFlags);return t.inlineReturnLabel=this.inlineReturnLabel,t}forkThen(r,e=!1,t=e){let i=this.fork(e,t),s=this.trueFlows;return s&&s.has(r)&&i.inherit(changetype(s.get(r))),i.inheritNonnullIfTrue(r),i}noteThen(r,e){let t=this.trueFlows;t||(this.trueFlows=t=new Map),t.set(r,e)}forkElse(r){let e=this.fork(),t=this.falseFlows;return t&&t.has(r)&&e.inherit(changetype(t.get(r))),e.inheritNonnullIfFalse(r),e}noteElse(r,e){let t=this.falseFlows;t||(this.falseFlows=t=new Map),t.set(r,e)}addScopedTypeAlias(r,e){let t=this.scopedTypeAlias;t||(this.scopedTypeAlias=t=new Map),t.set(r,e)}lookupScopedTypeAlias(r){let e=this;do{let t=e.scopedTypeAlias;if(t&&t.has(r))return assert(t.get(r));e=e.parent}while(e);return null}lookupTypeAlias(r){let e=null;if(e=this.lookupScopedTypeAlias(r))return e;let t=this.sourceFunction.parent;return t.kind==5?t.flow.lookupTypeAlias(r):null}getTempLocal(r){let e=this.targetFunction.addLocal(r);return this.unsetLocalFlag(e.index,-1),e}getScopedLocal(r){let e=this.scopedLocals;return e&&e.has(r)?assert(e.get(r)):null}addScopedLocal(r,e){let t=this.getTempLocal(e);t.name=r,t.internalName=Ke(r,t.parent,!1);let i=this.scopedLocals;return i?assert(!i.has(r)):this.scopedLocals=i=new Map,t.set(67108864),i.set(r,t),t}addScopedDummyLocal(r,e,t){let i=new ce(r,-1,e,this.targetFunction),s=this.scopedLocals;return s?s.has(r)&&this.program.error(2451,t.range,r):this.scopedLocals=s=new Map,i.set(67108864),s.set(r,i),i}addScopedAlias(r,e,t,i=null){let s=this.scopedLocals;if(!s)this.scopedLocals=s=new Map;else if(s.has(r)){let l=assert(s.get(r));return i&&(l.declaration.range.source.isNative?this.program.error(2300,i.range,r):this.program.errorRelated(2300,i.range,l.declaration.name.range,r)),l}assert(t<this.targetFunction.localsByIndex.length);let a=new ce(r,t,e,this.targetFunction);return a.set(67108864),s.set(r,a),a}freeScopedDummyLocal(r){let e=assert(this.scopedLocals);assert(e.has(r));let t=assert(e.get(r));assert(t.index==-1),e.delete(r)}lookupLocal(r){let e=this;do{let t=e.scopedLocals;if(t&&t.has(r))return assert(t.get(r));e=e.parent}while(e);return null}lookup(r){let e=this.lookupLocal(r);return e||this.sourceFunction.lookup(r)}isLocalFlag(r,e,t=!0){if(r<0)return t;let i=this.localFlags;return r<i.length&&(unchecked(i[r])&e)==e}isAnyLocalFlag(r,e,t=!0){if(r<0)return t;let i=this.localFlags;return r<i.length&&(unchecked(i[r])&e)!=0}setLocalFlag(r,e){if(r<0)return;let t=this.localFlags,i=r<t.length?unchecked(t[r]):0;t[r]=i|e}unsetLocalFlag(r,e){if(r<0)return;let t=this.localFlags,i=r<t.length?unchecked(t[r]):0;t[r]=i&~e}initThisFieldFlags(){let r=this.sourceFunction;assert(r.is(524288));let e=r.parent;assert(e.kind==7);let t=e;this.thisFieldFlags=new Map;let i=t.members;if(i)for(let s=Map_values(i),a=0,l=s.length;a<l;++a){let o=s[a];if(o.kind!=10)continue;let u=o.instance;!u||!u.isField||(u.prototype.parent!=t||u.initializerNode||u.prototype.parameterIndex!=-1||u.type.isAny(640)||u.type.kind==27)&&this.setThisFieldFlag(u,1)}}isThisFieldFlag(r,e){let t=this.thisFieldFlags;return t!=null&&t.has(r)?(changetype(t.get(r))&e)==e:!1}setThisFieldFlag(r,e){let t=this.thisFieldFlags;if(t)if(assert(this.sourceFunction.is(524288)),t.has(r)){let i=changetype(t.get(r));t.set(r,i|e)}else t.set(r,e);else assert(!this.sourceFunction.is(524288))}pushControlFlowLabel(){let r=this.targetFunction,e=r.nextBreakId++,t=r.breakStack;return t?t.push(e):r.breakStack=[e],e}popControlFlowLabel(r){let e=this.targetFunction,t=assert(e.breakStack);assert(t.length),assert(t.pop()==r)}inherit(r){assert(r.targetFunction==this.targetFunction);let e=r.flags;this.breakLabel!=r.breakLabel&&(e&2064&&(e&=-257),e&=-2065),this.continueLabel!=r.continueLabel&&(e&=-4129),this.flags=this.flags|e,this.localFlags=r.localFlags,this.thisFieldFlags=r.thisFieldFlags}mergeSideEffects(r){assert(r.targetFunction==this.targetFunction);let e=this.flags,t=r.flags,i=0;e&1?i|=1:t&1?i|=512:i|=(e|t)&512,i|=e&t&2,i|=e&t&4,e&8?i|=8:t&8?i|=1024:i|=(e|t)&1024,e&16?i|=16:r.breakLabel==this.breakLabel?t&16?i|=2048:i|=(e|t)&2048:i|=e&2048,e&32?i|=32:r.continueLabel==this.continueLabel?t&32?i|=4096:i|=(e|t)&4096:i|=e&4096,e&64?t&64?i|=64:i|=8192:t&64&&(i|=8192),i|=(e|t)&16384,i|=e&t&128,e&256&&(i|=256),this.flags=i|e&98304}mergeBranch(r){this.mergeSideEffects(r);let e=this.localFlags,t=e.length,i=r.localFlags,s=i.length,a=max(t,s);for(let l=0;l<a;++l){let o=l<t?e[l]:0,u=l<s?i[l]:0;e[l]=o&u&15}}inheritAlternatives(r,e){assert(r.targetFunction==e.targetFunction),assert(r.targetFunction==this.targetFunction);let t=r.flags,i=e.flags,s=0;t&1?i&1?s|=1:s|=512:i&1?s|=512:s|=(t|i)&512,t&2&&i&2&&(s|=2),t&4&&i&4&&(s|=4),t&8?i&8?s|=8:s|=1024:i&8?s|=1024:s|=(t|i)&1024,t&16?i&16?s|=16:s|=2048:i&16?s|=2048:s|=(t|i)&2048,t&32?i&32?s|=32:s|=4096:i&32?s|=4096:s|=(t|i)&4096,t&64?i&64?s|=64:s|=8192:i&64?s|=8192:s|=(t|i)&8192,s|=(t|i)&16384,t&128&&i&128&&(s|=128),t&256&&i&256&&(s|=256),this.flags=s|this.flags&98304;let a=this.localFlags;if(t&256){if(!(i&256)){let o=e.localFlags;for(let u=0,c=o.length;u<c;++u)a[u]=o[u]}}else if(i&256){let o=r.localFlags;for(let u=0,c=o.length;u<c;++u)a[u]=o[u]}else{let o=r.localFlags,u=o.length,c=e.localFlags,f=c.length,_=max(u,f);for(let d=0;d<_;++d){let m=d<u?o[d]:0,h=d<f?c[d]:0;a[d]=m&h&15}}let l=r.thisFieldFlags;if(l){let o=new Map,u=assert(e.thisFieldFlags);for(let c=Map_keys(l),f=0,_=c.length;f<_;++f){let d=c[f];(changetype(l.get(d))&1)!=0&&u.has(d)&&changetype(u.get(d))&1&&o.set(d,1)}this.thisFieldFlags=o}else assert(!e.thisFieldFlags)}resetIfNeedsRecompile(r,e){let t=this.localFlags.length,i=r.localFlags.length,s=this.targetFunction;assert(s==r.targetFunction);let a=s.localsByIndex;assert(a==r.targetFunction.localsByIndex);let l=!1;for(let o=0,u=min(t,i);o<u;++o){let f=a[o].type;f.isShortIntegerValue&&this.isLocalFlag(o,2)&&!r.isLocalFlag(o,2)&&(this.unsetLocalFlag(o,2),l=!0),f.isNullableReference&&this.isLocalFlag(o,4)&&!r.isLocalFlag(o,4)&&(this.unsetLocalFlag(o,4),l=!0)}return l&&(assert(a.length>=e),a.length=e,this.localFlags.length>e&&(this.localFlags.length=e)),l}isNonnull(r,e){if(!e.isNullableReference)return!0;switch(re(r)){case 9:{if(!bs(r))break;let t=this.targetFunction.localsByIndex[Uo(r)];return!t.type.isNullableReference||this.isLocalFlag(t.index,4,!1)}case 8:{let t=this.targetFunction.localsByIndex[Pt(r)];return!t.type.isNullableReference||this.isLocalFlag(t.index,4,!1)}}return!1}inheritNonnullIfTrue(r,e=null){switch(re(r)){case 9:{if(!bs(r))break;let t=this.targetFunction.localsByIndex[Uo(r)];(!e||e.isLocalFlag(t.index,4))&&this.setLocalFlag(t.index,4),this.inheritNonnullIfTrue(Vo(r),e);break}case 8:{let t=this.targetFunction.localsByIndex[Pt(r)];(!e||e.isLocalFlag(t.index,4))&&this.setLocalFlag(t.index,4);break}case 2:{let t=ni(r);t&&st(t)&&(this.inheritNonnullIfTrue(qo(r),e),this.inheritNonnullIfTrue(vs(r),e));break}case 15:{switch(Es(r)){case 20:case 21:{this.inheritNonnullIfFalse(Oo(r),e);break}}break}case 16:{switch(ri(r)){case 15:case 40:{let t=at(r),i=We(r);xt(t)?this.inheritNonnullIfTrue(i,e):xt(i)&&this.inheritNonnullIfTrue(t,e);break}case 16:case 41:{let t=at(r),i=We(r);st(t)?this.inheritNonnullIfTrue(i,e):st(i)&&this.inheritNonnullIfTrue(t,e);break}}break}case 6:{let t=Is(r);if(t==g.String_eq){assert(Nt(r)==2);let i=Je(r,0),s=Je(r,1);xt(i)?this.inheritNonnullIfTrue(s,e):xt(s)&&this.inheritNonnullIfTrue(i,e)}else if(t==g.String_ne){assert(Nt(r)==2);let i=Je(r,0),s=Je(r,1);st(i)?this.inheritNonnullIfTrue(s,e):st(s)&&this.inheritNonnullIfTrue(i,e)}else t==g.String_not?(assert(Nt(r)==1),this.inheritNonnullIfFalse(Je(r,0),e)):t==g.tostack&&(assert(Nt(r)==1),this.inheritNonnullIfTrue(Je(r,0),e));break}}}inheritNonnullIfFalse(r,e=null){switch(re(r)){case 15:{switch(Es(r)){case 20:case 21:{this.inheritNonnullIfTrue(Oo(r),e);break}}break}case 2:{let t=vs(r);ni(r)&&xt(t)&&(this.inheritNonnullIfFalse(qo(r),e),this.inheritNonnullIfFalse(ni(r),e));break}case 16:{switch(ri(r)){case 15:case 40:{let t=at(r),i=We(r);st(t)?this.inheritNonnullIfTrue(i,e):st(i)&&this.inheritNonnullIfTrue(t,e);break}case 16:case 41:{let t=at(r),i=We(r);xt(t)?this.inheritNonnullIfTrue(i,e):xt(i)&&this.inheritNonnullIfTrue(t,e);break}}break}case 6:{let t=Is(r);if(t==g.String_eq){assert(Nt(r)==2);let i=Je(r,0),s=Je(r,1);st(i)?this.inheritNonnullIfTrue(s,e):st(s)&&this.inheritNonnullIfTrue(i,e)}else if(t==g.String_ne){assert(Nt(r)==2);let i=Je(r,0),s=Je(r,1);xt(i)?this.inheritNonnullIfTrue(s,e):xt(s)&&this.inheritNonnullIfTrue(i,e)}else t==g.String_not?(assert(Nt(r)==1),this.inheritNonnullIfTrue(Je(r,0),e)):t==g.tostack&&(assert(Nt(r)==1),this.inheritNonnullIfFalse(Je(r,0),e));break}}}canOverflow(r,e){if(!e.isShortIntegerValue)return!1;let t;switch(re(r)){case 8:{let i=this.targetFunction.localsByIndex[Pt(r)];return!this.isLocalFlag(i.index,2,!0)||Ko(i.type,e)}case 9:return assert(bs(r)),this.canOverflow(Vo(r),e);case 10:{let i=assert(this.program.elementsByName.get(assert(xs(r))));return assert(i.kind==0||i.kind==3),Ko(i.type,e)}case 16:{switch(ri(r)){case 15:case 40:case 57:case 70:case 16:case 41:case 58:case 71:case 17:case 18:case 42:case 43:case 59:case 72:case 19:case 20:case 44:case 45:case 60:case 73:case 21:case 22:case 46:case 47:case 61:case 74:case 23:case 24:case 48:case 49:case 62:case 75:return!1;case 2:return!(re(t=at(r))==14&&(ae(t)==0||ae(t)==1&&!this.canOverflow(We(r),e))||re(t=We(r))==14&&(ae(t)==0||ae(t)==1&&!this.canOverflow(at(r),e)));case 7:return!(re(t=at(r))==14&&ae(t)<=e.computeSmallIntegerMask(p.i32)||!this.canOverflow(t,e)||re(t=We(r))==14&&ae(t)<=e.computeSmallIntegerMask(p.i32)||!this.canOverflow(t,e));case 10:{let i=32-e.size;return re(t=We(r))!=14||ae(t)<i}case 11:{let i=32-e.size;return this.canOverflow(at(r),e)&&(re(t=We(r))!=14||ae(t)<i)}case 12:{let i=32-e.size;return e.isSignedIntegerValue?!(re(t=We(r))==14&&ae(t)>i):this.canOverflow(at(r),e)&&!(re(t=We(r))==14&&ae(t)>=i)}case 4:case 5:case 6:return this.canOverflow(at(r),e)||this.canOverflow(We(r),e)}break}case 15:{switch(Es(r)){case 20:case 21:return!1;case 0:case 2:case 4:return e.size<7;case 47:return e.size<(e.isUnsignedIntegerValue?32:8);case 49:return e.size<(e.isUnsignedIntegerValue?64:8);case 48:return e.size<(e.isUnsignedIntegerValue?32:16);case 50:return e.size<(e.isUnsignedIntegerValue?64:16);case 51:return e.size<(e.isUnsignedIntegerValue?64:32)}break}case 14:{let i=0;switch(pe(r)){case P.I32:{i=ae(r);break}case P.I64:{i=Ne(r);break}case P.F32:{i=i32(Ce(r));break}case P.F64:{i=i32(Pe(r));break}case P.V128:return!1;default:assert(!1)}switch(e.kind){case 0:return(i&-2)!=0;case 1:return i<i8.MIN_VALUE||i>i8.MAX_VALUE;case 2:return i<i16.MIN_VALUE||i>i16.MAX_VALUE;case 6:return i<0||i>u8.MAX_VALUE;case 7:return i<0||i>u16.MAX_VALUE}break}case 12:{let i,s=mf(r);switch(hf(r)){case 1:{i=s?p.i8:p.u8;break}case 2:{i=s?p.i16:p.u16;break}default:{i=s?p.i32:p.u32;break}}return Ko(i,e)}case 1:{if(!As(r)){let i=assert(Ts(r)),s=Ss(r,i-1);return this.canOverflow(s,e)}break}case 2:return this.canOverflow(vs(r),e)||this.canOverflow(assert(ni(r)),e);case 17:return this.canOverflow(yf(r),e)||this.canOverflow(gf(r),e);case 6:{let s=this.program.instancesByName,a=assert(Is(r));if(s.has(a)){let l=assert(s.get(a));assert(l.kind==5);let o=l,u=o.signature.returnType;return!o.flow.is(2)||Ko(u,e)}return!1}case 23:return!1}return!0}toString(){let r=0,e=this.parent;for(;e;)e=e.parent,++r;let t=new Array;return this.is(1)&&t.push("RETURNS"),this.is(2)&&t.push("RETURNS_WRAPPED"),this.is(4)&&t.push("RETURNS_NONNULL"),this.is(8)&&t.push("THROWS"),this.is(16)&&t.push("BREAKS"),this.is(32)&&t.push("CONTINUES"),this.is(64)&&t.push("ACCESSES_THIS"),this.is(128)&&t.push("CALLS_SUPER"),this.is(256)&&t.push("TERMINATES"),this.is(512)&&t.push("CONDITIONALLY_RETURNS"),this.is(1024)&&t.push("CONDITIONALLY_THROWS"),this.is(2048)&&t.push("CONDITIONALLY_BREAKS"),this.is(4096)&&t.push("CONDITIONALLY_CONTINUES"),this.is(8192)&&t.push("CONDITIONALLY_ACCESSES_THIS"),this.is(16384)&&t.push("MAY_RETURN_NONTHIS"),`Flow(${this.sourceFunction})[${r}] ${t.join(" ")}`}};function Ko(n,r){return r.isShortIntegerValue&&(!n.isIntegerValue||n.size>r.size||n.isSignedIntegerValue!=r.isSignedIntegerValue)}var Zo=(e=>(e[e.Report=0]="Report",e[e.Swallow=1]="Swallow",e))(Zo||{});function G1(n){let r=n.name;if(r.kind!=23)return!1;let e=r,t=e.expression;return t.kind!=8?!1:t.text=="abi"&&e.property.text=="align"}function U1(n){if(!n)return null;for(let r=0,e=n.length;r<e;++r){let t=n[r];if(G1(t))return t}return null}function V1(n){switch(n.kind){case 1:case 6:case 2:case 7:case 3:case 8:return!0;default:return!1}}var Rs=class extends tt{constructor(e){super(e.diagnostics);this.currentThisExpression=null;this.currentElementExpression=null;this.discoveredOverride=!1;this.allowInlineView=!1;this.allowInlineViewParam=!1;this.viewCalls=null;this.resolvingExpressions=new Set;this.resolveClassPending=new Set;this.program=e}markViewCall(e){let t=this.viewCalls;t==null&&(this.viewCalls=t=new Set),t.add(e)}isViewCall(e){let t=this.viewCalls;return t!=null&&t.has(e)}resolveType(e,t,i,s=null,a=0){if(e.currentlyResolving)return this.error(100,e.range,"Recursive types"),null;e.currentlyResolving=!0;let l=null;switch(e.kind){case 1:{l=this.resolveNamedType(e,t,i,s,a);break}case 2:{l=this.resolveFunctionType(e,t,i,s,a);break}case 3:{l=this.resolveTupleType(e,t,i,s,a);break}case 4:{l=this.resolveFixedArrayType(e,t,i,s,a);break}case 71:{l=this.resolveUnmanagedArrayType(e,t,i,s,a);break}case 72:{l=this.resolveDynamicArrayType(e,t,i,s,a);break}default:assert(!1)}return e.currentlyResolving=!1,l!=null&&e.memoryModel!=0&&(l=this.checkMemoryModelOverride(e,l,a)),l}checkMemoryModelOverride(e,t,i){let s=e.memoryModel,a=Qo(t);return a==0||s==a?t:s==2&&a==3?(i==0&&this.error(6394,e.range,t.toString()),null):(s==3||s==2)&&a==1?s==3&&(this.allowInlineView||this.allowInlineViewParam)?t:(i==0&&this.error(6395,e.range,t.toString(),O1(s)),null):t}resolveNamedType(e,t,i,s=null,a=0){let l=e.name,o=e.typeArguments,u=!l.next;if(u){let _=l.identifier.text;if(s&&s.has(_)){let d=assert(s.get(_));if(o&&o.length>0&&a==0&&this.error(2315,e.range,d.toString()),e.isNullable){if(d.isReference)return d.asNullable();a==0&&this.error(204,e.range,d.toString())}return d}}let c=this.resolveTypeName(l,t,i,a);if(!c)return null;let f=c.shadowType;if(f)c=f;else{if(c.kind==2){o&&o.length>0&&a==0&&this.error(2315,e.range,c.internalName);let _=this.resolveEnumType(c,a);return e.isNullable&&a==0&&this.error(204,e.range,`${c.name}/${_.toString()}`),_}if(c.kind==6||c.kind==8){let _=this.resolveClassInclTypeArguments(c,o,t,i,me(s),e,a);return _?e.isNullable?_.type.asNullable():_.type:null}}if(c.kind==14){let _=c;if(c.is(4194304)){o&&o.length>0&&a==0&&this.error(2315,e.range,c.internalName);let b=_.type;if(e.isNullable){if(b.isReference)return b.asNullable();a==0&&this.error(204,l.range,l.identifier.text)}return b}if(u){let b=l.identifier.text;if(tr.has(b)){let A=assert(tr.get(b)),S=new Yo(this,e,i,s,a);return A(S)}}let d=_.typeParameterNodes,m=null;if(d){if(m=this.resolveTypeArguments(d,o,t,i,s=me(s),e,a),!m)return null}else o&&o.length>0&&this.error(2315,e.range,l.identifier.text);let h=this.resolveType(_.typeNode,t,c,s,a);if(!h)return null;if(e.isNullable){if(h.isReference)return h.asNullable();a==0&&this.error(204,l.range,l.identifier.text)}return h}return a==0&&this.error(2304,l.range,l.identifier.text),null}resolveEnumType(e,t=0){if(e.underlyingTypeResolved)return e.type;let i=e.declaration.underlyingTypeNode;if(!i)return e.underlyingTypeResolved=!0,e.type;if(e.underlyingTypeResolving)return p.i32;e.underlyingTypeResolving=!0;let s=this.resolveType(i,null,e.parent,null,t);if(e.underlyingTypeResolving=!1,!s)return p.i32;if(!V1(s))return t==0&&this.error(6403,i.range,s.toString()),p.i32;e.refineType(s);let a=e.members;if(a)for(let l=Map_values(a),o=0,u=l.length;o<u;++o){let c=unchecked(l[o]);c.kind==3&&c.refineType(s)}return e.underlyingTypeResolved=!0,s}resolveFunctionType(e,t,i,s=null,a=0){let l=e.explicitThisType,o=null;if(l&&(o=this.resolveType(l,t,i,s,a),!o))return null;let u=e.parameters,c=u.length,f=new Array(c),_=0,d=!1,m=this.allowInlineViewParam;this.allowInlineViewParam=!0;for(let S=0;S<c;++S){let k=u[S];switch(k.parameterKind){case 0:{_=S+1;break}case 2:{assert(S==c-1),d=!0;break}}let w=k.type;if(De(w))return a==0&&this.error(1110,w.range),null;let R=this.resolveType(w,t,i,s,a);if(!R)return null;if(R==p.void)return a==0&&this.error(214,w.range,R.toString()),null;f[S]=R}this.allowInlineViewParam=m;let h=e.returnType,b;if(De(h))a==0&&this.error(1110,h.range),b=p.void;else{if(b=this.resolveType(h,t,i,s,a),!b)return null;this.isValueFormFixedArray(b)&&this.enableMultiValueForArrayReturn()}let A=fe.create(this.program,f,b,o,_,d);return e.isNullable?A.type.asNullable():A.type}enableMultiValueForArrayReturn(){let e=this.program.options;if(e.hasFeature(512))return;e.features|=512;let t=this.program.module;t.setFeatures(t.getFeatures()|512)}isValueFormFixedArray(e){return e.kind!=14?!1:e.fixedMemoryModel==0||e.fixedMemoryModel==1}resolveFixedArrayType(e,t,i,s=null,a=0){let l=e.memoryModel,o=l==0||l==1,u=this.resolveType(e.elementType,t,i,s,a);if(!u)return null;if(o){if(u.classReference!=null&&assert(u.classReference).hasDecorator(4096))return a==0&&this.error(100,e.elementType.range,"an inline array (T[N]) of an @inline struct (elements by value are a later phase)"),null;let f=u.classReference;if(f!=null&&f.hasDecorator(2048))return a==0&&this.error(100,e.elementType.range,"an inline array (T[N]) of a @managed record (the elements would be GC references with nowhere for the collector to find their headers; use Array<T>, or @unmanaged records for a C-layout block)"),null;if(f!=null&&f.hasDecorator(16)&&this.resolveClassPending.has(f))return a==0&&this.error(100,e.elementType.range,"a recursive record: '"+f.name+"' would have an infinite size (it contains itself by value, directly or through another record)"),null}if(!u.isMemory)return a==0&&this.error(203,e.elementType.range,"a fixed-size array of",u.toString()),null;let c=l==0?0:l==1?1:l==2?2:3;return p.fixedArray(u,e.length,c,this.program.options.usizeType.size)}resolveUnmanagedArrayType(e,t,i,s=null,a=0){let l=this.resolveType(e.elementType,t,i,s,a);return l?l.byteSize?l.isManaged?(a==0&&this.error(100,e.elementType.range,"an unmanaged array cannot hold GC references ([T *] where T is @managed); a GC reference in an unscanned buffer will dangle. Use a scalar, an @unmanaged struct, or an @inline struct element"),null):p.unmanagedArray(l,this.program.options.usizeType.size):(a==0&&this.error(203,e.elementType.range,"an unmanaged array of",l.toString()),null):null}resolveDynamicArrayType(e,t,i,s=null,a=0){let l=e.dynamicMemoryModel;if(l==2){let u=this.resolveType(e.elementType,t,i,s,a);if(!u)return null;if(!u.byteSize)return a==0&&this.error(203,e.elementType.range,"a dynamic array of",u.toString()),null;if(u.isManaged)return a==0&&this.error(100,e.elementType.range,"a dynamic array cannot hold GC references (its buffer is not scanned); use a scalar, an @unmanaged struct, or an @inline struct element"),null;let c=this.resolveClass(this.program.dynamicArrayPrototype,[u],new Map,a);return c!=null?c.type:null}if(l==0||l!=3)return a==0&&this.error(100,e.range,"inline runtime-length arrays have no WASM representation; use @unmanaged @dynamic (C-compatible) or @managed @dynamic (GC-managed)"),null;let o=this.resolveType(e.elementType,t,i,s,a);return o?o.byteSize?o.isManaged?(a==0&&this.error(100,e.elementType.range,"a dynamic array cannot hold GC references (its buffer is not scanned); use a scalar, an @unmanaged struct, or an @inline struct element"),null):p.dynamicArray(o,3,this.program.options.usizeType.size):(a==0&&this.error(203,e.elementType.range,"a dynamic array of",o.toString()),null):null}resolveTupleType(e,t,i,s=null,a=0){let l=e.elements;for(let o=0,u=l.length;o<u;++o)if(!this.resolveType(l[o],t,i,s,a))return null;return a==0&&this.error(100,e.range,"Tuple types"),null}resolveBuiltinNotNullableType(e,t,i=null,s=0){let a=this.ensureOneTypeArgument(e,s);if(!a)return null;let l=this.resolveType(a,null,t,i,s);return l?l.isNullableReference?l.nonNullableType:l:null}resolveTypeName(e,t,i,s=0){let a=null;if(t&&(a=t.lookupTypeAlias(e.identifier.text)),a||(a=i.lookup(e.identifier.text,!0)),!a)return s==0&&this.error(2304,e.range,e.identifier.text),null;let l=e,o=e.next;for(;o;){if(!(a=a.getMember(o.identifier.text)))return s==0&&this.error(2339,o.range,o.identifier.text,l.identifier.text),null;l=o,o=o.next}return a}resolveTypeArguments(e,t,i,s,a=new Map,l=null,o=0){let u=0,c=0;for(let m=0,h=e.length;m<h;++m)e[m].defaultType||++u,++c;let f=t?t.length:0;if(f<u||f>c)return o==0&&this.error(2558,f?ue.join(t[0].range,t[f-1].range):l.range,(f<u?u:c).toString(),f.toString()),null;let _=new Array(c),d=me(a);a.clear();for(let m=0;m<c;++m){let h=m<f?this.resolveType(t[m],i,s,d,o):this.resolveType(assert(e[m].defaultType),i,s,me(a),o);if(!h)return null;a.set(e[m].name.text,h),_[m]=h}return _}maybeInferCall(e,t,i,s=0){let a=e.typeArguments;if(a){if(!t.is(65536))return s==0&&this.error(2315,e.expression.range,t.internalName),null;let l=t.internalName==g.changetype;if(l&&a.length==1&&a[0].memoryModel==3){let u=this.viewCalls;u==null&&(this.viewCalls=u=new Set),u.add(e)}l&&(this.allowInlineView=!0);let o=this.resolveFunctionInclTypeArguments(t,a,i.sourceFunction,me(i.contextualTypeArguments),e,s);return l&&(this.allowInlineView=!1),o}if(t.is(65536)){let l=this.inferGenericTypeArguments(e,t,t.typeParameterNodes,i,s);return l?this.resolveFunction(t,l,me(i.contextualTypeArguments),s):null}return this.resolveFunction(t,null,new Map,s)}inferGenericTypeArguments(e,t,i,s,a=0){if(!i)return null;let l=me(s.contextualTypeArguments),o=i.length,u=new Set;for(let b=0;b<o;++b){let A=i[b].name.text;l.set(A,p.auto),u.add(A)}let c=t.functionTypeNode.parameters,f=c.length,_,d;switch(e.kind){case 11:{let b=e;_=b.args,d=b.argumentsRange;break}case 19:{let b=e;_=b.args,d=b.argumentsRange;break}default:return assert(!1),null}let m=_.length;for(let b=0;b<f;++b){let A=b<m?_[b]:c[b].initializer;if(!A){if(c[b].parameterKind==1)continue;return a==0&&(c[b].parameterKind==2?this.error(1140,d.atEnd):this.error(2554,e.range,f.toString(),m.toString())),null}let S=c[b].type;if(c[b].parameterKind==2&&(S=S.typeArguments[0]),S.hasGenericComponent(i)){let k=this.resolveExpression(A,s,p.auto,1);k&&this.propagateInferredGenericTypes(S,k,t,l,u)}}let h=new Array(o);for(let b=0;b<o;++b){let A=i[b],S=A.name.text;if(l.has(S)){let k=assert(l.get(S));if(k!=p.auto){h[b]=k;continue}let w=A.defaultType;if(w){let R=t.parent,C=null;(R.kind==7||R.kind==5)&&(C=R.contextualTypeArguments);let M=this.resolveType(w,null,t,C,a);if(!M)return null;h[b]=M;continue}}if(a==0){let k;switch(e.kind){case 11:k=e.expression.range;break;case 19:k=e.typeName.range;break;default:return assert(!1),null}this.error(1140,k.atEnd)}return null}return h}propagateInferredGenericTypes(e,t,i,s,a){if(e.kind==1){let l=e,o=l.typeArguments;if(o&&o.length>0){let u=t.classReference;if(u){let c=this.resolveTypeName(l.name,null,i);if(!c||c.kind!=6)return;if(u.prototype==c){let f=u.typeArguments;if(f&&f.length==o.length){for(let _=0,d=f.length;_<d;++_)this.propagateInferredGenericTypes(o[_],f[_],i,s,a);return}}}}else{let u=l.name.identifier.text;if(s.has(u)){let c=assert(s.get(u));(c==p.auto||a.has(u)&&c.isAssignableTo(t))&&s.set(u,t)}}}else if(e.kind==2){let l=e,o=l.parameters,u=t.signatureReference;if(u){let c=u.parameterTypes;for(let m=0,h=min(c.length,o.length);m<h;++m)this.propagateInferredGenericTypes(o[m].type,c[m],i,s,a);let f=u.returnType;f!=p.void&&this.propagateInferredGenericTypes(l.returnType,f,i,s,a);let _=u.thisType,d=l.explicitThisType;_&&d&&this.propagateInferredGenericTypes(d,_,i,s,a);return}}}getTypeOfElement(e){let t=e.kind;if(t==0&&!this.ensureResolvedLazyGlobal(e,1))return null;if(Xo(t)){let i=e.type,s=i.getClassOrWrapper(this.program);if(s){let a=s.wrappedType;a&&(i=a)}return i}return null}getElementOfType(e){let t=e.getClassOrWrapper(this.program);return t||null}lookupExpression(e,t,i=p.auto,s=0){for(;e.kind==22;)e=e.expression;switch(e.kind){case 9:return this.lookupAssertionExpression(e,t,i,s);case 10:return this.lookupBinaryExpression(e,t,i,s);case 11:return this.lookupCallExpression(e,t,i,s);case 13:return this.lookupCommaExpression(e,t,i,s);case 14:return this.lookupElementAccessExpression(e,t,i,s);case 16:return this.lookupFunctionExpression(e,t,i,s);case 8:case 15:case 20:case 27:return this.lookupIdentifierExpression(e,t,t.sourceFunction,s);case 26:return this.lookupThisExpression(e,t,i,s);case 25:return this.lookupSuperExpression(e,t,i,s);case 17:return this.lookupInstanceOfExpression(e,t,i,s);case 18:return this.lookupLiteralExpression(e,t,i,s);case 19:return this.lookupNewExpression(e,t,i,s);case 23:return this.lookupPropertyAccessExpression(e,t,i,s);case 24:return this.lookupTernaryExpression(e,t,i,s);case 29:return this.lookupUnaryPostfixExpression(e,t,i,s);case 30:return this.lookupUnaryPrefixExpression(e,t,i,s);case 31:{let a=this.resolveAwaitExpression(e,t,s);return a?this.getElementOfType(a):null}}return assert(!1),null}resolveExpression(e,t,i=p.auto,s=0){let a=this.resolvingExpressions;if(a.has(e))return null;a.add(e);let l=this.doResolveExpression(e,t,i,s);return a.delete(e),l}doResolveExpression(e,t,i=p.auto,s=0){for(;e.kind==22;)e=e.expression;switch(e.kind){case 9:return this.resolveAssertionExpression(e,t,i,s);case 10:return this.resolveBinaryExpression(e,t,i,s);case 11:return this.resolveCallExpression(e,t,i,s);case 13:return this.resolveCommaExpression(e,t,i,s);case 14:return this.resolveElementAccessExpression(e,t,i,s);case 16:return this.resolveFunctionExpression(e,t,i,s);case 8:case 15:case 20:case 27:return this.resolveIdentifierExpression(e,t,i,t.sourceFunction,s);case 26:return this.resolveThisExpression(e,t,i,s);case 25:return this.resolveSuperExpression(e,t,i,s);case 17:return this.resolveInstanceOfExpression(e,t,i,s);case 18:return this.resolveLiteralExpression(e,t,i,s);case 19:return this.resolveNewExpression(e,t,i,s);case 23:return this.resolvePropertyAccessExpression(e,t,i,s);case 24:return this.resolveTernaryExpression(e,t,i,s);case 29:return this.resolveUnaryPostfixExpression(e,t,i,s);case 30:return this.resolveUnaryPrefixExpression(e,t,i,s);case 31:return this.resolveAwaitExpression(e,t,s)}return assert(!1),null}resolveAwaitExpression(e,t,i=0){let s=this.resolveExpression(e.operand,t,p.auto,i);if(!s)return null;let a=this.resolveTaskValueType(s);return a??s}resolveTaskValueType(e){let t=e.getClass();if(!t)return null;let i=this.program.taskPrototype;if(!i)return null;let s=t.getTypeArgumentsTo(i);return!s||s.length!=1?null:s[0]}lookupIdentifierExpression(e,t,i=t.sourceFunction,s=0){switch(e.kind){case 27:case 15:case 20:{let u=this.resolveIdentifierExpression(e,t,p.auto,i,s);return u?this.getElementOfType(u):null}}let a=e.text,l;if(l=t.lookup(a))return this.currentThisExpression=null,this.currentElementExpression=null,l;let o=t.outer;return o&&(l=o.lookup(a))?(this.currentThisExpression=null,this.currentElementExpression=null,l):(l=i.lookup(a))?(this.currentThisExpression=null,this.currentElementExpression=null,l):(l=this.program.lookup(a))?(this.currentThisExpression=null,this.currentElementExpression=null,l):(s==0&&this.error(2304,e.range,a),null)}resolveIdentifierExpression(e,t,i=p.auto,s=t.sourceFunction,a=0){switch(e.kind){case 27:case 15:return p.bool;case 20:{let u=i.getClass();if(u)return u.type.asNullable();{let c=i.getSignature();if(c)return c.type.asNullable();if(i.isExternalReference)return i}return this.program.options.usizeType}}let l=this.lookupIdentifierExpression(e,t,s,a);if(!l)return null;if(l.kind==4){let u=this.resolveFunction(l,null,new Map,a);if(!u)return null;l=u}let o=this.getTypeOfElement(l);return o||a==0&&this.error(225,e.range),o}ensureResolvedLazyGlobal(e,t=0){if(e.is(4194304))return!0;let i=e.typeNode,s=i?this.resolveType(i,null,e.parent,null,t):this.resolveExpression(assert(e.initializerNode),e.file.startFunction.flow,p.auto,t);return s?(e.setType(s),!0):!1}lookupPropertyAccessExpression(e,t,i,s=0){let a=e.expression,l=this.lookupExpression(a,t,i,s);if(!l)return null;let o=e.property.text;switch(l.kind){case 0:if(!this.ensureResolvedLazyGlobal(l,s))return null;case 3:case 1:{let u=l,c=u.type;if(c==p.void)return null;let f=c.getClassOrWrapper(this.program);if(!f)return s==0&&this.error(2339,e.property.range,o,u.type.toString()),null;l=f;break}case 10:{let u=this.resolveProperty(l,s);if(!u)return null;l=u}case 11:{let u=l,c=u.getterInstance;if(!c){let d=assert(u.setterInstance);return this.errorRelated(229,a.range,d.declaration.range,u.name),null}let f=c.signature.returnType,_=f.getClassOrWrapper(this.program);if(!_)return s==0&&this.error(2339,e.property.range,o,f.toString()),null;l=_;break}case 15:{let c=l.parent;assert(c.kind==7);let f=c,_=assert(this.currentElementExpression),d=f.lookupOverload(1);if(!d)return s==0&&this.error(2329,_.range,c.internalName),null;let m=d.signature.returnType,h=m.getClassOrWrapper(this.program);if(!h)return s==0&&this.error(2339,e.property.range,o,m.toString()),null;l=h;break}case 4:{let u=l.shadowType;if(u){if(!u.is(4194304)){let f=this.resolveType(u.typeNode,null,u.parent,null,s);f&&u.setType(f)}let c=u.type.classReference;c&&(l=c.prototype);break}else if(!l.is(65536)&&!l.getMember(o)){let f=this.resolveFunction(l,null,new Map,1);if(f){let _=f.type.getClassOrWrapper(this.program);_&&(l=_)}}break}}switch(l.kind){case 6:case 8:case 7:case 9:{let u=l,c=!1;do{let f=u.getMember(o);if(f){if(f.kind==10){let _=this.resolveProperty(f,s);if(!_)return null;f=_,_.is(32)?this.currentThisExpression=null:this.currentThisExpression=a}else this.currentThisExpression=a;return this.currentElementExpression=null,f}switch(c=!1,u.kind){case 6:case 8:{let d=u.basePrototype;d&&(c=!0,u=d);break}case 7:case 9:{let d=u.base;d&&(c=!0,u=d);break}}}while(c);break}default:{let u=l.getMember(o);if(u)return this.currentThisExpression=a,this.currentElementExpression=null,u;break}}return s==0&&this.error(2339,e.property.range,o,l.internalName),null}resolvePropertyAccessExpression(e,t,i,s=0){let a=null;if(e.expression.kind==8){let u=t.lookupLocal(e.expression.text);u!=null&&(a=u.type)}if(a!=null&&a.kind==28){let u=e.property.text;return u=="length"?p.i32:(s==0&&this.error(2339,e.property.range,u,a.toString()),null)}let l=this.lookupPropertyAccessExpression(e,t,i,s);if(!l)return null;let o=this.getTypeOfElement(l);return o||s==0&&this.error(225,e.range),o}arrayKindElementType(e){switch(e.kind){case 27:return e.unmanagedArrayElementType;case 28:return e.dynamicElementType;case 14:return e.fixedElementType}let t=e.classReference;if(t!=null&&this.isManagedDynamicArrayClass(t)){let i=t.typeArguments;if(i!=null&&i.length>0)return unchecked(i[0])}return null}isManagedDynamicArrayClass(e){return e.prototype.internalName==this.program.dynamicArrayPrototype.internalName}lookupElementAccessExpression(e,t,i,s=0){let a=e.expression,l=this.resolveExpression(a,t,i,s);if(!l)return null;let o=l.getClassOrWrapper(this.program);if(o)do{let c=o.indexSignature;if(c)return this.currentThisExpression=a,this.currentElementExpression=e.elementExpression,c;o=o.base}while(o);let u=this.arrayKindElementType(l);if(u!=null){let c=u.getClassOrWrapper(this.program);if(c!=null)return this.currentThisExpression=a,this.currentElementExpression=e.elementExpression,c}return s==0&&this.error(2329,a.range,l.toString()),null}resolveElementAccessExpression(e,t,i,s=0){let a=this.resolveExpression(e.expression,t,i,1);if(a!=null){let u=this.arrayKindElementType(a);if(u!=null)return u}let l=this.lookupElementAccessExpression(e,t,i,s);if(!l)return null;let o=this.getTypeOfElement(l);return o||s==0&&this.error(225,e.range),o}determineIntegerLiteralType(e,t,i){let s=e.value;if(t){if(i64_gt(i64_add(s,i64_minimum),i64_zero)){let a=e.range;this.error(236,a,a.source.text.substring(a.start-1,a.end))}else if(i64_eq(s,i64_zero)){if(i.isFloatValue)return i.kind==11?p.f32:p.f64;if(!i.isIntegerValue)return p.f64}s=i64_neg(s)}if(i.isValue)switch(i.kind){case 0:{if(i64_is_bool(s))return p.bool;break}case 1:{if(i64_is_i8(s))return p.i8;break}case 6:{if(i64_is_u8(s))return p.u8;break}case 2:{if(i64_is_i16(s))return p.i16;break}case 7:{if(i64_is_u16(s))return p.u16;break}case 3:{if(i64_is_i32(s))return p.i32;break}case 8:{if(i64_is_u32(s))return p.u32;break}case 5:{if(!this.program.options.isWasm64){if(i64_is_i32(s))return p.isize32;break}return p.isize64}case 10:{if(!this.program.options.isWasm64){if(i64_is_u32(s))return p.usize32;break}return p.usize64}case 4:return p.i64;case 9:return p.u64;case 11:return p.f32;case 12:return p.f64}return i64_is_i32(s)?p.i32:i64_is_u32(s)?p.u32:p.i64}lookupAssertionExpression(e,t,i=p.auto,s=0){switch(e.assertionKind){case 1:case 0:{let a=this.resolveType(assert(e.toType),null,t.sourceFunction,t.contextualTypeArguments,s);if(!a)return null;let l=this.getElementOfType(a);return l||(s==0&&this.error(214,e.range,a.toString()),this.currentThisExpression=null,this.currentElementExpression=null,null)}case 2:return this.lookupExpression(e.expression,t,i,s);case 3:return this.error(100,e.range,"Const assertion"),null}return assert(!1),null}resolveAssertionExpression(e,t,i=p.auto,s=0){switch(e.assertionKind){case 1:case 0:return this.resolveType(assert(e.toType),null,t.sourceFunction,t.contextualTypeArguments,s);case 2:{let a=this.resolveExpression(e.expression,t,i,s);return a?a.nonNullableType:null}case 3:{let a=this.lookupExpression(e,t,i,s);if(!a)return null;let l=this.getTypeOfElement(a);return l||s==0&&this.error(225,e.range),l}default:assert(!1)}return null}lookupUnaryPrefixExpression(e,t,i=p.auto,s=0){let a=this.resolveUnaryPrefixExpression(e,t,i,s);if(!a)return null;let l=this.getElementOfType(a);return l||s==0&&this.error(2469,e.range,Le(e.operator),a.toString()),l}resolveUnaryPrefixExpression(e,t,i=p.auto,s=0){let a=e.operand,l=e.operator;switch(l){case 83:if(a.isLiteralKind(1))return this.determineIntegerLiteralType(a,!0,i);case 82:case 88:case 89:{let o=this.resolveExpression(a,t,i,s);if(!o)return null;let u=o.getClassOrWrapper(this.program);if(u){let c=u.lookupOverload(Me.fromUnaryPrefixToken(l));if(c)return c.signature.returnType}return o.isNumericValue?o:(s==0&&this.error(2469,e.range,Le(l),o.toString()),null)}case 96:{let o=this.resolveExpression(a,t,i,s);if(!o)return null;let u=o.getClassOrWrapper(this.program);if(u){let c=u.lookupOverload(25);if(c)return c.signature.returnType}return p.bool}case 97:{let o=this.resolveExpression(a,t,i,s);if(!o)return null;let u=o.getClassOrWrapper(this.program);if(u){let c=u.lookupOverload(26);if(c)return c.signature.returnType}return o.isNumericValue?o.intType:(s==0&&this.error(2469,e.range,"~",o.toString()),null)}case 70:return s==0&&this.error(100,e.range,"Spread operator"),null;case 57:return this.program.stringInstance.type;default:assert(!1)}return null}lookupUnaryPostfixExpression(e,t,i=p.auto,s=0){let a=this.resolveUnaryPostfixExpression(e,t,i,s);if(!a)return null;let l=this.getElementOfType(a);return l||s==0&&this.error(2469,e.range,Le(e.operator),a.toString()),l}resolveUnaryPostfixExpression(e,t,i=p.auto,s=0){let a=e.operator;switch(a){case 88:case 89:{let l=this.resolveExpression(e.operand,t,i,s);if(!l)return null;let o=l.getClassOrWrapper(this.program);if(o){let u=o.lookupOverload(Me.fromUnaryPostfixToken(a));if(u)return u.signature.returnType}return l.isNumericValue?l:(s==0&&this.error(2469,e.range,Le(a),l.toString()),null)}}return assert(!1),null}lookupBinaryExpression(e,t,i=p.auto,s=0){let a=this.resolveBinaryExpression(e,t,i,s);if(!a)return null;let l=this.getElementOfType(a);return l||(s==0&&this.error(214,e.range,a.toString()),null)}resolveBinaryExpression(e,t,i=p.auto,s=0){let a=e.left,l=e.right,o=e.operator;switch(o){case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:return this.resolveExpression(a,t,i,s);case 73:case 74:case 75:case 76:{let u=this.resolveExpression(a,t,i,s);if(!u)return null;let c=u.getClassOrWrapper(this.program);if(c){let f=c.lookupOverload(Me.fromBinaryToken(o));if(f)return f.signature.returnType}return u.isNumericValue?p.bool:(s==0&&this.error(2469,e.range,Le(o),u.toString()),null)}case 77:case 78:{let u=this.resolveExpression(a,t,i,s);if(!u)return null;let c=u.getClassOrWrapper(this.program);if(c){let f=c.lookupOverload(Me.fromBinaryToken(o));if(f)return f.signature.returnType}return p.bool}case 79:case 80:return p.bool;case 29:return p.bool;case 82:case 83:case 85:case 86:case 87:case 84:{let u=this.resolveExpression(a,t,i,s);if(!u)return null;let c=u.getClassOrWrapper(this.program);if(c){let d=c.lookupOverload(Me.fromBinaryToken(o));if(d)return d.signature.returnType}let f=this.resolveExpression(l,t,u,s);if(!f)return null;let _=p.commonType(u,f,i);return _||s==0&&this.error(2365,e.range,Le(o),u.toString(),f.toString()),_}case 90:case 91:case 92:{let u=this.resolveExpression(a,t,i,s);if(!u)return null;let c=u.getClassOrWrapper(this.program);if(c){let f=c.lookupOverload(Me.fromBinaryToken(o));if(f)return f.signature.returnType}return u.isIntegerValue?u:(s==0&&this.error(2469,e.range,Le(o),u.toString()),null)}case 93:case 94:case 95:{let u=this.resolveExpression(a,t,i,s);if(!u)return null;let c=u.getClassOrWrapper(this.program);if(c){let d=c.lookupOverload(Me.fromBinaryToken(o));if(d)return d.signature.returnType}let f=this.resolveExpression(l,t,i,s);if(!f)return null;let _=p.commonType(u,f,i);return(!_||!_.isIntegerValue)&&s==0&&this.error(2365,e.range,Le(o),u.toString(),f.toString()),_}case 98:{let u=this.resolveExpression(a,t,i,s);if(!u)return null;let c=this.resolveExpression(l,t,u,s);if(!c)return null;let f=p.commonType(u,c,i);return f||s==0&&this.error(2365,e.range,"&&",u.toString(),c.toString()),f}case 99:{let u=this.resolveExpression(a,t,i,s);if(!u)return null;let c=this.resolveExpression(l,t,u,s);if(!c)return null;let f=p.commonType(u,c,i);return f?u.is(512)&&c.is(512)?f:f.nonNullableType:(s==0&&this.error(2365,e.range,"||",u.toString(),c.toString()),null)}}return assert(!1),null}markCapturingArrows(e,t){for(let i=0,s=e.length;i<s;++i){let a=e[i];a.prototype.capturesThis||(a.prototype.capturesThis=!0,assert(!a.signature.thisType),a.addLocal(t,B.this_))}}lookupThisExpression(e,t,i=p.auto,s=0){if(t.isInline){let o=t.lookupLocal(B.this_);if(o)return this.currentThisExpression=null,this.currentElementExpression=null,o}let a=t.sourceFunction,l=null;for(;a!=null&&a.prototype.arrowKind!=0;){l||(l=new Array),l.push(a);let o=a.parent;a=o!=null&&o.kind==5?o:null}if(a!=null){let o=a.parent;if(o!=null&&o.kind==7)return l&&this.markCapturingArrows(l,o.type),this.currentThisExpression=null,this.currentElementExpression=null,o;if(o!=null&&o.kind==6)return this.currentThisExpression=null,this.currentElementExpression=null,o;let u=a.flow.scopedLocals,c=u?J(u,B.this_):null;if(c)return l&&this.markCapturingArrows(l,c.type),this.currentThisExpression=null,this.currentElementExpression=null,c}return s==0&&this.error(2332,e.range),null}resolveThisExpression(e,t,i=p.auto,s=0){let a=this.lookupThisExpression(e,t,i,s);if(!a)return null;let l=this.getTypeOfElement(a);return l||s==0&&this.error(225,e.range),l}lookupSuperExpression(e,t,i=p.auto,s=0){if(t.isInline){let l=t.lookupLocal(B.super_);if(l)return this.currentThisExpression=null,this.currentElementExpression=null,l}let a=t.sourceFunction.parent;if(a&&a.kind==7){let l=a.base;if(l)return this.currentThisExpression=null,this.currentElementExpression=null,l}return s==0&&this.error(2335,e.range),null}resolveSuperExpression(e,t,i=p.auto,s=0){let a=this.lookupSuperExpression(e,t,i,s);if(!a)return null;let l=this.getTypeOfElement(a);return l||s==0&&this.error(225,e.range),l}lookupLiteralExpression(e,t,i=p.auto,s=0){switch(this.currentThisExpression=e,this.currentElementExpression=null,e.literalKind){case 1:{let a=this.determineIntegerLiteralType(e,!1,i);return assert(a.getClassOrWrapper(this.program))}case 0:{let a=i==p.f32?p.f32:p.f64;return assert(a.getClassOrWrapper(this.program))}case 2:case 3:return this.program.stringInstance;case 4:return this.program.regexpInstance;case 5:{let a=i.getClass();if(a&&a.prototype==this.program.arrayPrototype)return this.getElementOfType(i);let l=e.elementExpressions,o=l.length,u=p.auto,c=0;for(let f=0,_=o;f<_;++f){let d=l[f];if(d)if(d.kind==20&&o>1)++c;else{let m=this.resolveExpression(d,t,u);if(!m)return null;if(u==p.auto)u=m;else if(m!=u){let h=p.commonType(u,m,u);h&&(u=h)}}}if(u==p.auto)if(c==o)u=this.program.options.usizeType;else return s==0&&this.error(2453,e.range,"T"),null;return c>0&&u.isInternalReference&&(u=u.asNullable()),assert(this.resolveClass(this.program.arrayPrototype,[u]))}case 6:return i.isClass?i.classReference:(s==0&&this.error(225,e.range),null)}return assert(!1),null}resolveLiteralExpression(e,t,i=p.auto,s=0){if(e.literalKind==5&&i.kind==14&&(i.fixedMemoryModel==0||i.fixedMemoryModel==1))return i;let a=this.lookupLiteralExpression(e,t,i,s);if(!a)return null;let l=this.getTypeOfElement(a);return l||s==0&&this.error(225,e.range),l}lookupCallExpression(e,t,i=p.void,s=0){let a=this.resolveCallExpression(e,t,i,s);if(!a)return null;let l=this.getElementOfType(a);return l||s==0&&this.error(214,e.range,a.toString()),l}resolveCallExpression(e,t,i=p.void,s=0){let a=e.expression,l=this.lookupExpression(a,t,i,s);if(!l)return null;switch(l.kind){case 4:{let o=l;if(o.internalName==g.unchecked&&e.args.length>0)return this.resolveExpression(e.args[0],t,i,s);let u=this.maybeInferCall(e,o,t,s);if(!u)return null;l=u}case 5:{let o=l;if(o.prototype.isAsync){let u=this.resolveAsyncCallType(o,s);if(u)return u}return o.signature.returnType}case 10:{let o=this.resolveProperty(l,s);if(!o)return null;l=o}default:{if(!Xo(l.kind))break;let o=this.getElementOfType(l.type);if(!o||o.kind!=7)break;l=o}case 7:{let o=l.getTypeArgumentsTo(this.program.functionPrototype);if(!(o&&o.length))break;return assert(o[0].getSignature()).returnType}}return s==0&&this.error(2349,a.range,l.internalName),null}resolveAsyncCallType(e,t=0){let i=this.program.taskPrototype;if(!i)return null;let s=this.resolveClass(i,[e.signature.returnType],new Map,t);return s?s.type:null}lookupCommaExpression(e,t,i=p.auto,s=0){let a=e.expressions;return this.lookupExpression(a[assert(a.length)-1],t,i,s)}resolveCommaExpression(e,t,i=p.auto,s=0){let a=e.expressions;return this.resolveExpression(a[assert(a.length)-1],t,i,s)}lookupInstanceOfExpression(e,t,i=p.auto,s=0){return assert(p.bool.getClassOrWrapper(this.program))}resolveInstanceOfExpression(e,t,i=p.auto,s=0){return p.bool}lookupTernaryExpression(e,t,i,s=0){let a=this.resolveTernaryExpression(e,t,i,s);if(!a)return null;let l=this.getElementOfType(a);return l||s==0&&this.error(214,e.range,a.toString()),l}resolveTernaryExpression(e,t,i,s=0){let a=this.resolveExpression(e.ifThen,t,i,s);if(!a)return null;let l=this.resolveExpression(e.ifElse,t,a,s);if(!l)return null;let o=p.commonType(a,l,i);return o||s==0&&this.error(2365,e.range,"?:",a.toString(),l.toString()),o}lookupNewExpression(e,t,i,s=0){let a=this.resolveTypeName(e.typeName,t,t.sourceFunction,s);return a?a.kind==6?this.resolveClassInclTypeArguments(a,e.typeArguments,t,t.sourceFunction,me(t.contextualTypeArguments),e,s):(s==0&&this.error(2351,e.range),null):null}resolveNewExpression(e,t,i,s=0){let a=this.lookupNewExpression(e,t,i,s);if(!a)return null;let l=this.getTypeOfElement(a);return l||s==0&&this.error(225,e.range),l}lookupFunctionExpression(e,t,i,s=0){let a=this.resolveFunctionExpression(e,t,i,s);if(!a)return null;let l=this.getElementOfType(a);return l||s==0&&this.error(214,e.range,a.toString()),l}resolveFunctionExpression(e,t,i,s=0){let a=e.declaration,l=a.signature,o=a.body,u=this.resolveType(l,null,t.sourceFunction,t.contextualTypeArguments,s);if(u&&a.arrowKind!=0&&o&&o.kind==42&&De(l.returnType)){let c=o.expression,f=assert(u.getSignature()),_=er.createDefault(t.sourceFunction),d=l.parameters;assert(f.parameterTypes.length==d.length);for(let h=0,b=d.length;h<b;h++){let A=d[h],S=f.parameterTypes[h];_.addScopedDummyLocal(A.name.text,S,A)}let m=this.resolveExpression(c,_,i,s);m&&(u.signatureReference=fe.create(this.program,f.parameterTypes,m,f.thisType,f.requiredParameters,f.hasRest))}return u}resolveFunction(e,t,i=new Map,s=0){let a=null,l=t?$o(t):"";if(e.is(262144)){a=assert(e.getBoundClassOrInterface());let H=e.getResolvedInstance(l);if(H)return H;let U=a.typeArguments;if(U){let V=assert(a.prototype.typeParameterNodes),Y=V.length;assert(Y==V.length);for(let q=0;q<Y;++q){let ne=V[q].name.text;i.set(ne,U[q])}}}else{assert(!e.isBound);let H=e.getResolvedInstance(l);if(H)return H}let o=e.functionTypeNode,u=e.typeParameterNodes,c;if(t&&(c=t.length)>0){assert(u&&c==u.length);for(let H=0;H<c;++H)i.set(u[H].name.text,t[H])}else assert(!u||u.length==0);let f=null,_=o.explicitThisType;if(_){if(f=this.resolveType(_,null,e.parent,i,s),!f)return null;i.set(B.this_,f)}else a&&(f=a.type,i.set(B.this_,f));let d=o.parameters,m=d.length,h=new Array(m),b=null,A=0,S=!1,k=this.allowInlineViewParam;this.allowInlineViewParam=!0;for(let H=0;H<m;++H){let U=d[H];U.parameterKind==0?A=H+1:U.parameterKind==2&&(S=!0);let V=U.type;if(De(V))return s==0&&this.error(1110,V.range),null;let Y=this.resolveType(V,null,e.parent,i,s);if(!Y)return null;if(Y==p.void)return s==0&&this.error(1110,V.range),null;h[H]=Y;let q=V.memoryModel;if(q!=0){if(b==null){b=new Array(m);for(let ne=0;ne<m;++ne)unchecked(b[ne]=0)}unchecked(b[H]=q)}}this.allowInlineViewParam=k;let w;if(e.is(4096))w=p.void;else if(e.is(524288))w=a.type;else{let H=o.returnType;if(De(H))return s==0&&this.error(1110,H.range),null;let U=this.resolveType(H,null,e.parent,i,s);if(!U)return null;w=U,this.isValueFormFixedArray(w)&&this.enableMultiValueForArrayReturn()}let R=e.is(524288)&&w.classReference!=null&&assert(w.classReference).hasDecorator(4096),C=e.hasAnyDecorator(384)&&Jb(h,b),M=e.is(1048576)&&!e.hasAnyDecorator(384)&&Jb(h,b);if(b!=null&&(e.hasAnyDecorator(384)||e.is(1048576))){for(let H=0;H<m;++H)if(unchecked(b[H])==3&&fe.isInlineStructRef(unchecked(h[H])))return s==0&&this.error(6411,d[H].type.range,unchecked(h[H]).toString()),null}if(b!=null&&(e.hasAnyDecorator(384)||e.is(1048576))){for(let H=0;H<m;++H)if(unchecked(b[H])==3&&fe.isInlineStructRef(unchecked(h[H])))return s==0&&this.error(6411,d[H].type.range,unchecked(h[H]).toString()),null}let O=fe.create(this.program,h,w,f,A,S,R,C,M,b),D=e.name;l.length&&(D+=`<${l}>`);let Q=new Mt(D,e,t,O,i);if(e.setResolvedInstance(l,Q),a){let H=Q.declaration.name.text,U=a.base;if(U){let V=U.getMember(H);if(V){this.discoveredOverride=!0;let Y=!0;if(Q.isAny(6144)){if(V.kind==10){let q=this.resolveProperty(V,s);if(q)if(Q.is(2048)){let ne=q.getterInstance;ne&&Q.signature.isAssignableTo(ne.signature,!0)&&(Y=!1)}else{assert(Q.is(4096));let ne=q.setterInstance;ne&&Q.signature.isAssignableTo(ne.signature,!0)&&(Y=!1)}}}else if(Q.is(524288))Y=!1;else if(V.kind==4){let q=V,ne=q.typeParameterNodes,j=ne!=null&&ne.length>0,ge=t!=null&&t.length>0;if(j!=ge)this.errorRelated(242,Q.identifierAndSignatureRange,V.identifierAndSignatureRange,H),Y=!1;else{let oe=this.resolveFunction(q,t,new Map,1);oe&&Q.signature.isAssignableTo(oe.signature,!0)&&(Y=!1)}}Y&&this.errorRelated(2394,Q.identifierAndSignatureRange,V.identifierAndSignatureRange)}}}return Q}resolveFunctionInclTypeArguments(e,t,i,s,a,l=0){let o=null;if(e.is(65536)){if(e.is(262144)){let u=assert(e.getBoundClassOrInterface()),c=u.typeArguments;if(c){let f=assert(u.prototype.typeParameterNodes),_=c.length;assert(_==f.length);for(let d=0;d<_;++d)s.set(f[d].name.text,c[d])}}if(o=this.resolveTypeArguments(assert(e.typeParameterNodes),t,null,i,s,a,l),!o)return null}else if(t&&t.length>0)return l==0&&this.error(2315,a.range,e.internalName),null;return this.resolveFunction(e,o,s,l)}resolveOverrides(e){let t=e.prototype.unboundOverrides;if(!t)return null;let i=assert(e.getBoundClassOrInterface()),s=new Set;for(let a=Set_values(t),l=0,o=a.length;l<o;++l){let u=a[l];assert(!u.isBound);let c=u.parent,f;if(assert(c.kind==6||c.kind==8),f=c.instances,!!f)for(let _=Map_values(f),d=0,m=_.length;d<m;++d){let h=_[d];if(!h.isAssignableTo(i))continue;let b=null;if(e.isAny(6144)){let A=e.declaration.name.text,S=assert(h.getMember(A));assert(S.kind==10);let k=this.resolveProperty(S);if(!k)continue;e.is(2048)?b=k.getterInstance:(assert(e.is(4096)),b=k.setterInstance)}else{let A=h.getMember(u.name);if(A){assert(A.kind==4);let S=A;S.is(65536)==e.is(65536)&&(b=this.resolveFunction(S,e.typeArguments))}}b&&s.add(b)}}return Set_values(s)}findManagedLeaf(e,t){let i=e.classReference;if(i==null||t.has(i))return null;t.add(i);let s=i.members;if(!s)return null;for(let a=Map_values(s),l=0,o=a.length;l<o;++l){let u=unchecked(a[l]);if(u.kind!=10)continue;let c=u.instance;if(c==null||!c.isField)continue;let f=c.type;if(f.isManaged)return c;if(f.kind==14){let _=f.fixedElementType;if(_!=null&&_.isManaged)return c}else if(Qo(f)==1){let _=this.findManagedLeaf(f,t);if(_!=null)return _}}return null}resolveClass(e,t,i=new Map,s=0){let a=t?$o(t):"",l=e.getResolvedInstance(a);if(l)return l;let o=e.name;a.length&&(o+=`<${a}>`),e.kind==8?l=new Ns(o,e,t):l=new Ar(o,e,t),e.setResolvedInstance(a,l);let u=this.resolveClassPending;if(u.add(l),t){let d=assert(e.typeParameterNodes),m=d.length,h=t.length;assert(h==m);for(let b=0;b<h;++b)i.set(d[b].name.text,t[b])}else{let d=e.typeParameterNodes;assert(!(d&&d.length>0))}l.contextualTypeArguments=i;let c=!1,f=e.basePrototype;if(f){let d=f;do{if(d==e)return this.error(2506,e.identifierNode.range,e.internalName),null;d=d.basePrototype}while(d);let m=assert(e.extendsNode),h=this.resolveClassInclTypeArguments(f,m.typeArguments,null,e.parent,me(i),m,s);if(!h)return null;l.setBase(h),u.has(h)&&(c=!0)}else e.implicitlyExtendsObject&&l.setBase(this.program.objectInstance);let _=e.interfacePrototypes;if(_)for(let d=0,m=_.length;d<m;++d){let h=_[d],b=h;do{if(b==e)return this.error(2506,e.identifierNode.range,e.internalName),null;b=b.basePrototype}while(b);let A=assert(e.implementsNodes[d]),S=this.resolveClassInclTypeArguments(h,A.typeArguments,null,e.parent,me(i),A,s);if(!S)return null;assert(S.kind==9),l.addInterface(S),u.has(S)&&(c=!0)}return c||this.finishResolveClass(l,s),l}checkOverrideVisibility(e,t,i,s,a,l){let o=!1;return t.is(524288)?(assert(s.is(524288)),s.is(512)&&(l==0&&this.errorRelated(2675,t.identifierNode.range,s.identifierNode.range,a.internalName),o=!0)):t.is(512)?s.is(512)?(l==0&&this.errorRelated(2442,t.identifierNode.range,s.identifierNode.range,e),o=!0):(l==0&&this.errorRelated(2325,t.identifierNode.range,s.identifierNode.range,e,i.internalName,a.internalName),o=!0):t.is(1024)?s.is(512)?(l==0&&this.errorRelated(2325,t.identifierNode.range,s.identifierNode.range,e,a.internalName,i.internalName),o=!0):s.isPublic?(l==0&&this.errorRelated(2444,t.identifierNode.range,s.identifierNode.range,e,i.internalName,a.internalName),o=!0):assert(s.is(1024)):t.isPublic&&(s.is(512)?(l==0&&this.errorRelated(2325,t.identifierNode.range,s.identifierNode.range,e,a.internalName,i.internalName),o=!0):s.is(1024)?(l==0&&this.errorRelated(2444,t.identifierNode.range,s.identifierNode.range,e,a.internalName,i.internalName),o=!0):assert(s.isPublic)),!o}finishResolveClass(e,t){let i=e.members;i||(e.members=i=new Map);let s=this.resolveClassPending,a=new Map,l=e.interfaces;if(l)for(let m=Set_values(l),h=0,b=m.length;h<b;++h){let A=m[h];assert(!s.has(A));let S=A.members;if(S)for(let k=Map_keys(S),w=0,R=k.length;w<R;++w){let C=unchecked(k[w]),M=assert(S.get(C)),O=e.getMember(C);O&&!this.checkOverrideVisibility(C,O,e,M,A,t)||(i.set(C,M),a.set(C,M))}}let o=0,u=0,c=e.base;if(c){let m=e.prototype.implicitlyExtendsObject;assert(!s.has(c));let h=c.members;if(h)for(let b=Map_keys(h),A=0,S=b.length;A<S;++A){let k=unchecked(b[A]),w=assert(h.get(k));if(m&&w.is(32))continue;let R=e.getMember(k);R&&!this.checkOverrideVisibility(k,R,e,w,c,t)||(i.set(k,w),w.is(128)?a.set(k,w):a.delete(k))}o=c.nextMemoryOffset,u=c.alignLog2}let f=e.prototype,_=f.instanceMembers;if(_)for(let m=Map_values(_),h=0,b=m.length;h<b;++h){let A=unchecked(m[h]),S=A.name;if(c){let k=c.getMember(S);k&&this.checkOverrideVisibility(S,A,e,k,c,t)}switch(A.kind){case 4:{let k=A.toBound(e);e.add(k.name,k);break}case 10:{let k=A.toBound(e);if(k.isField){let w=this.resolveProperty(k,t);if(w){let R=w.type;if(R==p.void)break;if(R.kind==14&&R.fixedMemoryModel==2){this.error(100,assert(k.typeNode).range,"heap fixed-extent is Landing 5c (GC block, N in type, no length field). Use `@managed @dynamic [T * n]` for a runtime-length heap array (available now)");break}if(R.isExternalReference){this.error(100,assert(k.typeNode).range,"Reference typed fields");break}let C=!0;if(c){let O=c.getMember(k.name);if(O&&O.kind==10){let D=O,Q=this.resolveProperty(D,t);if(Q&&Q.isField){if(Q.type!=w.type){this.errorRelated(2416,w.identifierNode.range,Q.identifierNode.range,w.name,e.internalName,c.internalName);break}w.memoryOffset=Q.memoryOffset,C=!1}}}if(C){let O=null;if(Qo(R)==1){let Y=R.classReference;if(Y!=null){O=Y;let q=assert(k.fieldDeclaration).type;if(s.has(Y)){this.error(100,q.range,"a recursive @inline struct: '"+Y.name+"' would have an infinite size (it contains itself, directly or through another @inline struct, by value)");break}let ne=this.findManagedLeaf(Y.type,new Set);if(ne!=null){this.error(100,q.range,"an @inline struct field '"+ne.name+"' of '"+Y.name+"' is a GC reference, and"+(e.hasDecorator(2048)?" the __visit pass walks the outer's fields -- an inline field's GC pointer is invisible to it, so the collector would not trace it":" an inline field's GC pointer is invisible to the collector -- the field looks safe but is not; the escape hatch is a hand-written byte layout, not an @inline field"));break}}}let D=O!=null?O.nextMemoryOffset:R.byteSize;if(e.hasDecorator(2048)&&R.kind==14){let Y=R.fixedElementType;this.error(100,assert(k.fieldDeclaration).type.range,Y!=null&&Y.isManaged?"an inline array of GC references on an @managed struct (the collector cannot trace its elements)":"an inline array (T[N]) on an @managed struct (field initialization cannot fill an extent yet; see compiler.ts makeZero)");break}let Q=O!=null?O.alignLog2:R.alignLog2,H=Q,U=U1(assert(k.fieldDeclaration).decorators);if(U){let Y=U.args,q=i64_zero,ne=!1;if(Y&&Y.length==1&&Y[0].isLiteralKind(1)&&(q=Y[0].value,ne=!0),!ne)this.error(6405,U.range);else if(i64_lt(q,i64_one))this.error(6406,U.range,q.toString());else if(i64_gt(q,i64_new(1073741824,0)))this.error(6409,U.range,q.toString(),"1073741824");else{let j=i64_low(q);if((j&j-1)!=0)this.error(6407,U.range,q.toString());else{let ge=1<<Q;if(j<ge)this.error(6408,U.range,q.toString(),ge.toString());else{let oe=0,_e=j;for(;_e>1;)_e>>=1,++oe;H=oe}}}}assert(H>=0),H>u&&(u=H);let V=(1<<H)-1;o&V&&(o=(o|V)+1),w.memoryOffset=o,o+=D}k.instance=w,e.add(k.name,k);let M=assert(k.fieldDeclaration).type;M&&(Qo(R)==1&&(e.hasDecorator(4096)||!e.hasDecorator(16)&&!e.hasDecorator(2048)&&this.error(100,M.range,"an @inline struct as a class field (a class field is a pointer slot; inline-in-heap is a separate, deferred case -- use an @unmanaged or @managed record field)")),this.program.checkTypeSupported(R,M))}}else e.add(k.name,k);break}default:assert(!1)}!A.is(128)&&!A.is(65536)&&a.delete(S)}if(e.kind!=9){if(!e.is(128)&&a.size>0)for(let m=Map_keys(a),h=0,b=m.length;h<b;++h){let A=m[h],S=assert(a.get(A));this.errorRelated(2515,e.identifierNode.range,S.identifierNode.range,e.internalName,A,S.parent.internalName)}if(e.hasDecorator(16)||e.hasDecorator(2048)){let m=(1<<u)-1;o=o+m&~m}e.alignLog2=u,e.nextMemoryOffset=o;{let m=e.getMember(B.constructor);if(m&&m.parent==e){assert(m.kind==4);let h=this.resolveFunction(m,null,assert(e.contextualTypeArguments),t);h&&(e.constructorInstance=h)}}}let d=f.operatorOverloadPrototypes;for(let m=Map_keys(d),h=0,b=m.length;h<b;++h){let A=unchecked(m[h]),S=assert(d.get(A));if(assert(A!=0),S.is(65536))continue;let k;if(S.is(262144)){let R=S.toBound(e);k=this.resolveFunction(R,null,new Map,t)}else k=this.resolveFunction(S,null,new Map,t);if(!k)continue;let w=e.operatorOverloads;if(w||(e.operatorOverloads=w=new Map),k.is(262144))switch(A){case 27:case 28:case 29:case 30:{let R=k.signature.returnType;R.isAssignableTo(e.type)||t==0&&this.error(2322,S.functionTypeNode.returnType.range,R.toString(),e.type.toString())}}if(w.has(A))t==0&&this.error(213,k.declaration.range);else if(w.set(A,k),A==1||A==2){let R=e.indexSignature;R||(e.indexSignature=R=new Ps(e)),A==1&&R.setType(k.signature.returnType)}}assert(s.has(e)),s.delete(e);for(let m=Set_values(s),h=0,b=m.length;h<b;++h){let A=m[h],S=A.base==e,k=A.interfaces;if(k){let w=!1;for(let R=Set_values(k),C=0,M=R.length;C<M;++C){let O=R[C];O==e?S=!0:s.has(O)&&(w=!0)}if(w)continue}S&&this.finishResolveClass(A,t)}}resolveClassInclTypeArguments(e,t,i,s,a,l,o=0){let u=null;if(e.is(65536)){let c=null;for(let f=e;f&&!c;f=f.basePrototype)c=f.constructorPrototype;if(!t&&c&&i&&a.size==0?u=this.inferGenericTypeArguments(l,c,e.typeParameterNodes,i):u=this.resolveTypeArguments(assert(e.typeParameterNodes),t,i,s,a,l,o),!u)return null}else if(t&&t.length>0)return o==0&&this.error(2315,l.range,e.internalName),null;return this.resolveClass(e,u,a,o)}resolveProperty(e,t=0){let i=e.instance;if(i)return i;e.instance=i=new Cs(e,e.parent);let s=e.getterPrototype;if(s){let l=this.resolveFunction(s,null,new Map,t);l&&(i.getterInstance=l,i.setType(l.signature.returnType))}let a=e.setterPrototype;if(a){let l=this.resolveFunction(a,null,new Map,t);l&&(i.setterInstance=l,i.is(4194304)||(assert(l.signature.parameterTypes.length==1),i.setType(l.signature.parameterTypes[0])))}return i.checkVisibility(this),i}ensureOneTypeArgument(e,t=0){let i=e.typeArguments,s=0;return!i||(s=i.length)!=1?(t==0&&this.error(2558,e.range,"1",s.toString()),null):i[0]}};function Jb(n,r){for(let e=0,t=n.length;e<t;++e){let i=unchecked(n[e]);if((fe.isInlineStructRef(i)||r!=null&&unchecked(r[e])==1)&&fe.fieldCountOf(i)>1)return!0}return!1}function Qo(n){let r=n.classReference;return r==null?0:r.hasDecorator(4096)?1:r.hasDecorator(2048)?2:r.hasDecorator(16)?3:0}function O1(n){switch(n){case 1:return"@inline";case 2:return"@managed";case 3:return"@unmanaged";default:return"@none"}}var Ls=class{constructor(r,e){this.source=r;this.reportNode=e}};function ex(n){if(!n)return!1;for(let r=0,e=n.length;r<e;++r)if(n[r].decoratorKind==6)return!0;return!1}function q1(n){if(!n)return!1;for(let r=0,e=n.length;r<e;++r)if(n[r].decoratorKind==7)return!0;return!1}function tx(n){if(!n)return!1;for(let r=0,e=n.length;r<e;++r)if(n[r].decoratorKind==9)return!0;return!1}function W1(n){return n.kind==8?n.text=="dynamic":!1}function rx(n){let r=null;if(n.kind==8)r=n.text;else if(n.kind==23)return 0;return r==null?0:r=="inline"?1:r=="managed"?2:r=="unmanaged"?3:0}function K1(n){let r=n.name;return r.kind==8&&r.text=="lazy"}function H1(n){let r=n.name;if(r.kind!=23)return!1;let e=r,t=e.expression;return t.kind!=8?!1:t.text=="abi"&&e.property.text=="align"}function j1(n,r){return n==1&&r==2||n==2&&r==1}var Ms=class extends tt{constructor(e=null,t=[]){super(e);this.backlog=new Array;this.seenlog=new Set;this.donelog=new Set;this.onComment=null;this.currentSource=null;this.dependees=new Map;this.currentModuleName=null;this.options=null;this.unplacedLazyExpressions=null;this.awaitNullifiedLazyExpressions=null;this.tryParseSignatureIsSignature=!1;this.parseParametersThis=null;this.inAsyncContext=!1;this.sources=t}parseFile(e,t,i){let s=Xr(t),a=ds(s);if(this.donelog.has(a))return;if(this.donelog.add(a),this.seenlog.add(a),e==null){let _=this.dependees,d=null;_.has(a)&&(d=assert(_.get(a))),this.error(6054,d?d.reportNode.range:null,t);return}let l=new Te(i?1:t.startsWith(wt)?t.indexOf(mt,wt.length)<0?3:2:0,s,e);this.sources.push(l),this.currentSource=l,this.currentModuleName=null;let o=new os(l,this.diagnostics);o.onComment=this.onComment;let u=l.statements;for(;!o.skip(122);){let _=this.parseTopLevelStatement(o,null);_?u.push(_):this.skipStatement(o)}let c=this.unplacedLazyExpressions;this.unplacedLazyExpressions=null;let f=this.awaitNullifiedLazyExpressions;if(this.awaitNullifiedLazyExpressions=null,c!=null)for(let _=Set_values(c),d=0,m=_.length;d<m;++d){let h=unchecked(_[d]);this.error(f!=null&&f.has(h)?6402:6397,h.range)}}parseTopLevelStatement(e,t=null){let i=t?t.flags&32768:0,s=-1,a=null;for(;e.skip(115);){s<0&&(s=e.tokenPos);let k=this.parseDecorator(e);if(!k){this.skipStatement(e);continue}a?a.push(k):a=[k]}let l=0,o=0,u=0,c=0;e.skip(18)&&(s<0&&(s=e.tokenPos),i|=2,l=e.tokenPos,o=e.pos,e.skip(13)&&(u=e.tokenPos,c=e.pos));let f=0,_=0,d=t!=null&&t.is(32768);e.skip(12)?d?this.error(1038,e.range()):(s<0&&(s=e.tokenPos),f=s,_=e.pos,i|=32772):d&&(i|=32768);let m=!1,h=0,b=0;if(e.peek()==2){let k=e.mark();e.next(),!e.peekOnNewLine()&&e.peek()==24?(m=!0,h=e.tokenPos,b=e.pos,s<0&&(s=h)):e.reset(k)}let A=null,S=e.peek();switch(s<0&&(s=e.nextTokenPos),S){case 8:{e.next(),i|=8,e.skip(17)?A=this.parseEnum(e,i,a,s):A=this.parseVariable(e,i,a,s),a=null;break}case 34:i|=16;case 58:{e.next(),A=this.parseVariable(e,i,a,s),a=null;break}case 17:{e.next(),A=this.parseEnum(e,i,a,s),a=null;break}case 24:{e.next(),A=this.parseFunction(e,i,a,s,m),m&&A&&i&32768&&this.error(1042,e.range(h,b),"async"),a=null;break}case 0:{let k=e.mark();e.next();let w=e.tokenPos,R=e.pos;if(e.peekOnNewLine()){e.reset(k),A=this.parseStatement(e,!0);break}let C=e.peek();if(C!=7){C==31&&this.error(1242,e.range(w,R)),e.reset(k),A=this.parseStatement(e,!0);break}else e.discard(k);i|=128}case 7:case 31:{e.next(),A=this.parseClassOrInterface(e,i,a,s),a=null;break}case 49:{let k=e.tokenPos,w=e.range(k,e.pos),R=ex(a),C=tx(a),M=q1(a);M&&R&&this.error(6390,w),M&&tx(a)&&this.error(6391,w),e.next();let O=this.parseClassOrInterface(e,i,M?a:this.withValueDefault(a,w,R||C),s);O&&(O.declaredAsStruct=!0,O.declaredAsManagedStruct=M),A=O,a=null;break}case 36:{let k=e.mark();e.next(),e.peek(1)==116?(e.discard(k),A=this.parseNamespace(e,i,a,s),a=null):(e.reset(k),A=this.parseStatement(e,!0));break}case 28:{e.next(),i|=1,i&2?A=this.parseExportImport(e,s):A=this.parseImport(e);break}case 56:{let k=e.mark();e.next(),e.peek(1)==116?(e.discard(k),A=this.parseTypeDeclaration(e,i,a,s),a=null):(e.reset(k),A=this.parseStatement(e,!0));break}case 35:{let k=e.mark();e.next(),e.peek()==117&&!e.peekOnNewLine()?(e.discard(k),A=this.parseModuleDeclaration(e,i)):(e.reset(k),A=this.parseStatement(e,!0));break}default:{i&2?c&&e.skipIdentifier(1)?(_&&this.error(1120,e.range(f,_)),A=this.parseExportDefaultAlias(e,s,u,c),u=c=0):A=this.parseExport(e,s,(i&4)!=0):(o&&this.error(1042,e.range(l,o),"export"),_&&this.error(1042,e.range(f,_),"declare"),t?this.error(2695,e.range(s)):A=this.parseStatement(e,!0));break}}if(a)for(let k=0,w=a.length;k<w;++k)this.error(1206,a[k].range);if(c&&A!=null)switch(A.kind){case 56:case 59:case 55:case 61:case 63:return y.createExportDefaultStatement(A,e.range(s,e.pos));default:this.error(1042,e.range(u,c),"default")}return A}nextFile(){let e=this.backlog;return e.length?assert(e.shift()):null}getDependee(e){let t=this.dependees;return t.has(e)?assert(t.get(e)).source.internalPath:null}finish(){if(this.backlog.length)throw new Error("backlog is not empty");this.backlog=[],this.seenlog.clear(),this.donelog.clear(),this.dependees.clear()}parseTypeName(e){let t=y.createSimpleTypeName(e.readIdentifier(),e.range()),i=t;for(;e.skip(69);)if(e.skip(116)){let s=y.createSimpleTypeName(e.readIdentifier(),e.range());i.next=s,i=s}else return this.error(1003,e.range(e.pos)),null;return t}startsUnmanagedArrayType(e){if(e.peek()==115)return!1;let t=e.mark(),s=this.parseType(e,!0,!0)!=null&&e.peek()==85;return e.reset(t),s}parseType(e,t=!0,i=!1){let s=0,a=null,l=!1,o=null,u=e.next();for(;u==115;){let _=this.parseDecorator(e);if(!_)break;let d=rx(_.name);d==0&&W1(_.name)?l?this.error(2300,_.range,"@dynamic"):(l=!0,o=_):d==0?this.error(212,_.range,_.name.range.toString()):s!=0?this.error(j1(s,d)?6391:6393,ue.join(assert(a).range,_.range)):(s=d,a=_),u=e.next()}let c=e.tokenPos,f;if(u==65){let _=e.skip(65),d=this.tryParseFunctionType(e);if(d){if(_&&!e.skip(66))return i||this.error(1005,e.range(),")"),null;f=d}else{if(_||this.tryParseSignatureIsSignature)return i||this.error(1012,e.range()),null;if(t){let m=this.parseType(e,!1,i);if(!m)return null;if(!e.skip(66))return i||this.error(1005,e.range(e.pos),")"),null;f=m,f.range.start=c,f.range.end=e.pos}else return i||this.error(1012,e.range()),null}}else if(u==45){let _=this.parseType(e,t,i);if(!_)return null;f=_,f.range.start=c}else if(u==67&&this.startsUnmanagedArrayType(e)){let _=this.parseType(e,!0,i);if(!_)return null;if(assert(e.skip(85)),e.skip(68))f=y.createUnmanagedArrayType(_,e.range(c,e.pos));else if(e.peek()==116){assert(e.skip(116));let d=y.createIdentifierExpression(e.readIdentifier(),e.range());if(!e.skip(68))return i||this.error(1005,e.range(),"]"),null;f=y.createDynamicArrayType(_,d,l||s!=0?s:3,e.range(c,e.pos))}else if(e.peek()==118){e.next();let d=e.tokenPos,m=e.readInteger(),h=e.range(d,e.pos);if(!e.skip(68)||i64_lt(m,i64_new(1))||i64_gt(m,i64_new(i32.MAX_VALUE)))return i||this.error(1005,h,"]"),null;f=y.createFixedArrayType(_,i64_low(m),e.range(c,e.pos))}else return i||this.error(1005,e.range(),"]"),null}else if(u==67&&this.options&&this.options.hasFeature(512)){let _=[],d=[],m=!1;if(!e.skip(68)){do{let h=null,b=e.mark();if(e.skip(116)){let S=e.readIdentifier(),k=e.range();e.skip(101)?(h=y.createIdentifierExpression(S,k),m=!0):e.reset(b)}let A=this.parseType(e,!0,i);if(!A)return null;_.push(A),d.push(h)}while(e.skip(72));if(!e.skip(68))return i||this.error(1005,e.range(e.pos),"]"),null}f=y.createTupleType(_,m?d:null,!1,e.range(c,e.pos))}else if(u==59)f=y.createNamedType(y.createSimpleTypeName("void",e.range()),[],!1,e.range(c,e.pos));else if(u==52)f=y.createNamedType(y.createSimpleTypeName("this",e.range()),[],!1,e.range(c,e.pos));else if(u==54||u==20)f=y.createNamedType(y.createSimpleTypeName("bool",e.range()),[],!1,e.range(c,e.pos));else if(u==38)f=y.createNamedType(y.createSimpleTypeName("null",e.range()),[],!1,e.range(c,e.pos));else if(u==117)e.readString(),f=y.createNamedType(y.createSimpleTypeName("string",e.range()),[],!1,e.range(c,e.pos));else if(u==116){let _=this.parseTypeName(e);if(!_)return null;let d=null;if(e.skip(73)){do{let m=this.parseType(e,!0,i);if(!m)return null;d?d.push(m):d=[m]}while(e.skip(72));if(!e.skip(74))return i||this.error(1005,e.range(e.pos),">"),null}d||(d=[]),f=y.createNamedType(_,d,!1,e.range(c,e.pos))}else return i||this.error(1110,e.range()),null;for(;e.skip(94);){let _=this.parseType(e,!0,!1);if(!_)return null;let d=f.kind==1&&f.isNull,m=_.kind==1&&_.isNull;if(!d&&!m)return i||this.error(100,_.range,"union types"),null;m?(f.isNullable=!0,f.range.end=_.range.end):d?(_.range.start=f.range.start,_.isNullable=!0,f=_):f.range.end=_.range.end}for(;e.skip(67);){let _=e.tokenPos,d=-1;if(e.peek()==118){e.next();let b=e.tokenPos,A=e.readInteger(),S=e.range(b,e.pos);if(!e.skip(68)||i64_lt(A,i64_new(1))||i64_gt(A,i64_new(i32.MAX_VALUE)))return i||this.error(1005,S,"]"),null;d=i64_low(A)}if(d>=0){f=y.createFixedArrayType(f,d,e.range(c,e.pos));continue}if(!e.skip(68))return i||this.error(1005,e.range(),"]"),null;let m=e.range(_,e.pos),h=!1;if(e.skip(94))if(e.skip(38))h=!0;else return i||this.error(100,e.range(),"union types"),null;if(f=y.createNamedType(y.createSimpleTypeName("Array",m),[f],h,e.range(c,e.pos)),h)break}if(l&&f.kind!=72)return i||this.error(100,assert(o).range,"`@dynamic` applies to `[T * n]` only \u2014 a runtime length needs the identifier form"),null;for(;e.peek()==115&&!e.peekOnNewLine();){e.next();let _=this.parseDecorator(e);if(!_)break;if(rx(_.name)!=0){this.error(6392,_.range,_.name.range.toString());continue}if(K1(_)){this.error(6396,_.range);continue}if(H1(_)){this.error(6410,_.range);continue}f.attributes?assert(f.attributes).push(_):f.attributes=[_]}return s!=0&&(f.memoryModel=s),f}tryParseFunctionType(e){let t=e.mark(),i=e.tokenPos,s=null,a=null,l=!1,o=null,u=0;if(e.skip(66))l=!0,e.discard(t),s=[];else{l=!1;do{let f=-1,_=0;if(e.skip(70)&&(f=e.tokenPos,l=!0,e.discard(t),_=2),e.skip(52))if(f<0&&(f=e.tokenPos),e.skip(101)){l=!0,e.discard(t);let d=this.parseType(e,!1);if(!d)return null;if(d.kind!=1)return this.error(1003,d.range),this.tryParseSignatureIsSignature=!0,null;a=d}else return e.reset(t),this.tryParseSignatureIsSignature=!1,null;else if(e.skipIdentifier()){f<0&&(f=e.tokenPos);let d=y.createIdentifierExpression(e.readIdentifier(),e.range(e.tokenPos,e.pos));if(e.skip(100)&&(l=!0,e.discard(t),_==2?this.error(1047,e.range()):_=1),e.skip(101)){l=!0,e.discard(t);let m=this.parseType(e);if(!m)return this.tryParseSignatureIsSignature=l,null;let h=y.createParameter(_,d,m,null,e.range(f,e.pos));s?s.push(h):s=[h]}else if(l||e.peek()==72&&(l=!0,e.discard(t)),l){let m=y.createParameter(_,d,y.createOmittedType(e.range(e.pos)),null,e.range(f,e.pos));s?s.push(m):s=[m],this.error(1110,m.type.range)}else s||(o=d,u=_)}else{if(l){if(e.peek()==66)break;this.error(1003,e.range())}else e.reset(t);return this.tryParseSignatureIsSignature=l,null}}while(e.skip(72));if(!e.skip(66))return l?this.error(1005,e.range(),")"):e.reset(t),this.tryParseSignatureIsSignature=l,null}let c;if(e.skip(81)){if(!l&&(l=!0,e.discard(t),o)){let f=y.createParameter(u,o,y.createOmittedType(o.range.atEnd),null,o.range);s?s.push(f):s=[f],this.error(1110,f.type.range)}if(c=this.parseType(e),!c)return this.tryParseSignatureIsSignature=l,null}else return l?this.error(1005,e.range(),"=>"):e.reset(t),this.tryParseSignatureIsSignature=l,null;return this.tryParseSignatureIsSignature=!0,s||(s=[]),y.createFunctionType(s,c,a,!1,e.range(i,e.pos))}parseDecorator(e){let t=e.tokenPos;if(e.skipIdentifier()){let i=e.readIdentifier(),s=y.createIdentifierExpression(i,e.range(t,e.pos));for(;e.skip(69);)if(e.skipIdentifier(1))i=e.readIdentifier(),s=y.createPropertyAccessExpression(s,y.createIdentifierExpression(i,e.range()),e.range(t,e.pos));else return this.error(1003,e.range()),null;let a;if(e.skip(65)){if(a=this.parseArguments(e),a)return y.createDecorator(s,a,e.range(t,e.pos))}else return y.createDecorator(s,null,e.range(t,e.pos))}else this.error(1003,e.range());return null}parseVariable(e,t,i,s,a=!1){let l=new Array;do{let u=this.parseVariableDeclaration(e,t,i,a);if(!u)return null;u.overriddenModuleName=this.currentModuleName,l.push(u)}while(e.skip(72));let o=y.createVariableStatement(i,l,e.range(s,e.pos));return!e.skip(71)&&!a&&this.checkASI(e),o}parseVariableDeclaration(e,t,i,s=!1){if(!e.skipIdentifier())return this.error(1003,e.range()),null;let a=y.createIdentifierExpression(e.readIdentifier(),e.range());Jp(a.text)&&this.error(1003,a.range);let l=t;e.skip(96)&&(l|=16384);let o=null;e.skip(101)&&(o=this.parseType(e,!0));let u=null;if(e.skip(102)){if(l&32768&&this.error(1039,e.range()),u=this.parseExpression(e,2),!u)return null;if(u.kind==32){let f=this.unplacedLazyExpressions;f?.delete(u)}l&16384&&this.error(1263,u.range)}else s||(l&8?l&32768||this.error(1155,a.range):o||this.error(1110,e.range(e.pos)));let c=ue.join(a.range,e.range());return(l&16384)!=0&&(l&32768)!=0&&this.error(1255,c),y.createVariableDeclaration(a,i,l,o,u,c)}parseEnum(e,t,i,s){if(e.next()!=116)return this.error(1003,e.range()),null;let a=y.createIdentifierExpression(e.readIdentifier(),e.range()),l=null;if(e.skip(101)&&(l=this.parseType(e,!1),!l))return null;if(e.next()!=63)return this.error(1005,e.range(),"{"),null;let o=new Array;for(;!e.skip(64);){let c=this.parseEnumValue(e,0);if(!c)return null;if(o.push(c),!e.skip(72)){if(e.skip(64))break;return this.error(1005,e.range(),"}"),null}}let u=y.createEnumDeclaration(a,i,t,o,l,e.range(s,e.pos));return u.overriddenModuleName=this.currentModuleName,e.skip(71),u}parseEnumValue(e,t){if(!e.skipIdentifier())return this.error(1003,e.range()),null;let i=y.createIdentifierExpression(e.readIdentifier(),e.range()),s=null;return e.skip(102)&&(s=this.parseExpression(e,2),!s)?null:y.createEnumValueDeclaration(i,t,s,ue.join(i.range,e.range()))}parseReturn(e){let t=e.tokenPos,i=null,s=e.peek();if(s!=71&&s!=64&&!e.peekOnNewLine()&&!(i=this.parseExpression(e)))return null;let a=y.createReturnStatement(i,e.range(t,e.pos));return e.skip(71)||this.checkASI(e),a}parseTypeParameters(e){let t=new Array,i=!1,s=e.tokenPos;for(;!e.skip(74);){let a=this.parseTypeParameter(e);if(!a)return null;if(a.defaultType?i=!0:i&&(this.error(2706,a.range),a.defaultType=null),t.push(a),!e.skip(72)){if(e.skip(74))break;return this.error(1005,e.range(),">"),null}}return t.length||this.error(1098,e.range(s,e.pos)),t}parseTypeParameter(e){if(e.next()==116){let t=y.createIdentifierExpression(e.readIdentifier(),e.range()),i=null;if(e.skip(19)){let a=this.parseType(e);if(!a)return null;if(a.kind!=1)return this.error(1003,a.range),null;i=a}let s=null;if(e.skip(102)){let a=this.parseType(e);if(!a)return null;if(a.kind!=1)return this.error(1003,a.range),null;s=a}return y.createTypeParameter(t,i,s,ue.join(t.range,e.range()))}else this.error(1003,e.range());return null}parseParameters(e,t=!1){let i=new Array,s=null,a=!1,l=!1,o=null;if(this.parseParametersThis=null,e.skip(52)){if(e.skip(101)){if(o=this.parseType(e),!o)return null;o.kind==1?this.parseParametersThis=o:this.error(1003,o.range)}else return this.error(1005,e.range(),":"),null;if(!e.skip(72))return e.skip(66)?i:(this.error(1005,e.range(),")"),null)}for(;!e.skip(66);){let u=this.parseParameter(e,t);if(!u)return null;switch(s&&!l&&(this.error(1014,s.name.range),l=!0),u.parameterKind){default:{a&&this.error(1016,u.name.range);break}case 1:{a=!0;break}case 2:{s=u;break}}if(i.push(u),!e.skip(72)){if(e.skip(66))break;return this.error(1005,e.range(),")"),null}}return i}parseParameter(e,t=!1){let i=!1,s=!1,a=null,l=0;if(t&&(e.skip(44)?(a=e.range(),l|=256):e.skip(43)?(a=e.range(),l|=1024):e.skip(42)&&(a=e.range(),l|=512),e.peek()==45)){let o=e.mark();e.next(),e.peek()!=101?(e.discard(o),a||(a=e.range()),l|=64):e.reset(o)}if(e.skip(70)&&(l?this.error(1317,e.range()):a=e.range(),i=!0),e.skipIdentifier()){i||(a=e.range());let o=y.createIdentifierExpression(e.readIdentifier(),e.range()),u=null;if((s=e.skip(100))&&i&&this.error(1047,o.range),e.skip(101)){if(u=this.parseType(e),!u)return null}else u=y.createOmittedType(e.range(e.pos));let c=null;if(e.skip(102)&&(i&&this.error(1048,o.range),s?this.error(1015,o.range):s=!0,c=this.parseExpression(e,2),!c))return null;let f=y.createParameter(i?2:s?1:0,o,u,c,ue.join(assert(a),e.range()));return f.flags|=l,f}else this.error(1003,e.range());return null}parseFunction(e,t,i,s,a=!1){if(!e.skipIdentifier())return this.error(1003,e.range(e.pos)),null;let l=y.createIdentifierExpression(e.readIdentifier(),e.range()),o=-1,u=null;if(e.skip(73)){if(o=e.tokenPos,u=this.parseTypeParameters(e),!u)return null;t|=65536}if(!e.skip(65))return this.error(1005,e.range(e.pos),"("),null;o<0&&(o=e.tokenPos);let c=this.parseParameters(e);if(!c)return null;let f=this.parseParametersThis,_=(t&4096)!=0;_&&(c.length!=1&&this.error(1049,l.range),c.length>0&&c[0].initializer&&this.error(1052,l.range)),t&2048&&c.length&&this.error(1054,l.range);let d=null;if(e.skip(101)&&(d=this.parseType(e,!0,_),!d))return null;d||(d=y.createOmittedType(e.range(e.pos)),_||this.error(1110,d.range));let m=y.createFunctionType(c,d,f,!1,e.range(o,e.pos)),h=null;if(e.skip(63)){t&32768&&this.error(1183,e.range());let A=this.inAsyncContext;if(this.inAsyncContext=a,h=this.parseBlockStatement(e,!1),this.inAsyncContext=A,!h)return null}else t&32768||this.error(2391,e.range(e.pos));let b=y.createFunctionDeclaration(l,i,t,u,m,h,0,e.range(s,e.pos),a);return b.overriddenModuleName=this.currentModuleName,e.skip(71),b}parseFunctionExpression(e,t=!1){let i=e.tokenPos,s,a=0;if(e.token==24){if(e.skipIdentifier()?s=y.createIdentifierExpression(e.readIdentifier(),e.range()):s=y.createEmptyIdentifierExpression(e.range(e.pos)),!e.skip(65))return this.error(1005,e.range(e.pos),"("),null}else a=1,assert(e.token==65),s=y.createEmptyIdentifierExpression(e.range(e.tokenPos));let l=e.pos,o=this.parseParameters(e);return o?this.parseFunctionExpressionCommon(e,s,o,this.parseParametersThis,a,i,l,t):null}parseFunctionExpressionCommon(e,t,i,s,a,l=-1,o=-1,u=!1){l<0&&(l=t.range.start),o<0&&(o=l);let c=null;if(a!=2&&e.skip(101)){if(c=this.parseType(e),!c)return null}else c=y.createOmittedType(e.range(e.pos));if(a&&!e.skip(81))return this.error(1005,e.range(e.pos),"=>"),null;let f=y.createFunctionType(i,c,s,!1,e.range(o,e.pos)),_=null,d=this.inAsyncContext;if(this.inAsyncContext=u,a)if(e.skip(63))_=this.parseBlockStatement(e,!1);else{let h=this.parseExpression(e,2);h&&(_=y.createExpressionStatement(h))}else{if(!e.skip(63))return this.inAsyncContext=d,this.error(1005,e.range(e.pos),"{"),null;_=this.parseBlockStatement(e,!1)}if(this.inAsyncContext=d,!_)return null;let m=y.createFunctionDeclaration(t,null,0,null,f,_,a,e.range(l,e.pos),u);return y.createFunctionExpression(m)}withValueDefault(e,t,i){let s=this.withUnmanaged(e,t);if(i)return s;let a=y.createDecorator(y.createIdentifierExpression("inline",t),null,t),l=new Array(s.length+1);l[0]=a;for(let o=0,u=s.length;o<u;++o)l[o+1]=s[o];return l}withUnmanaged(e,t){if(ex(e))return e;let i=y.createDecorator(y.createIdentifierExpression("unmanaged",t),null,t);if(!e)return[i];let s=new Array(e.length+1);s[0]=i;for(let a=0,l=e.length;a<l;++a)s[a+1]=e[a];return s}parseClassOrInterface(e,t,i,s){let a=e.token==31;if(!e.skipIdentifier())return this.error(1003,e.range()),null;let l=y.createIdentifierExpression(e.readIdentifier(),e.range()),o=null;if(e.skip(73)){if(o=this.parseTypeParameters(e),!o)return null;t|=65536}let u=null;if(e.skip(19)){let d=this.parseType(e);if(!d)return null;if(d.kind!=1)return this.error(1003,d.range),null;u=d}let c=null;if(e.skip(27)){a&&this.error(1176,e.range());do{let d=this.parseType(e);if(!d)return null;if(d.kind!=1)return this.error(1003,d.range),null;a||(c||(c=[]),c.push(d))}while(e.skip(72))}if(!e.skip(63))return this.error(1005,e.range(),"{"),null;let f=new Array,_;if(a?(assert(!c),_=y.createInterfaceDeclaration(l,i,t,o,u,null,f,e.range(s,e.pos))):_=y.createClassDeclaration(l,i,t,o,u,c,f,e.range(s,e.pos)),!e.skip(64))do{let d=this.parseClassMember(e,_);if(d)d.kind==69?_.indexSignature=d:(assert(d instanceof nt),f.push(d));else if(this.skipStatement(e),e.skip(122))return this.error(1005,e.range(),"}"),null}while(!e.skip(64));return _.range.end=e.pos,_.overriddenModuleName=this.currentModuleName,_}parseClassExpression(e){let t=e.tokenPos,i;if(e.skipIdentifier()?i=y.createIdentifierExpression(e.readIdentifier(),e.range()):i=y.createEmptyIdentifierExpression(e.range(e.pos)),!e.skip(63))return this.error(1005,e.range(e.pos),"{"),null;let s=new Array,a=y.createClassDeclaration(i,null,0,null,null,null,s,e.range(t,e.pos));if(!e.skip(64))do{let l=this.parseClassMember(e,a);if(l)l.kind==69?a.indexSignature=l:(assert(a instanceof nt),s.push(l));else if(this.skipStatement(e),e.skip(122))return this.error(1005,e.range(),"}"),null}while(!e.skip(64));return a.range.end=e.pos,y.createClassExpression(a)}parseClassMember(e,t){let i=t.kind==61,s=0,a=null;if(e.skip(115)){s=e.tokenPos;do{let oe=this.parseDecorator(e);if(!oe)break;a||(a=new Array),a.push(oe)}while(e.skip(115));i&&a&&this.error(1206,ue.join(a[0].range,a[a.length-1].range))}let l=t.flags&32768;i&&(l|=268435456);let o=0,u=0,c=t.is(32768);e.skip(12)?(i?this.error(1042,e.range(),"declare"):c?this.error(1038,e.range()):(l|=32772,o=e.tokenPos,u=e.pos),s||(s=e.tokenPos)):c&&(l|=32768);let f=0,_=0;e.skip(44)?(i?this.error(1042,e.range(),"public"):(l|=256,f=e.tokenPos,_=e.pos),s||(s=e.tokenPos)):e.skip(42)?(i?this.error(1042,e.range(),"private"):(l|=512,f=e.tokenPos,_=e.pos),s||(s=e.tokenPos)):e.skip(43)&&(i?this.error(1042,e.range(),"protected"):(l|=1024,f=e.tokenPos,_=e.pos),s||(s=e.tokenPos));let d=0,m=0,h=0,b=0;e.skip(48)?(i?this.error(1042,e.range(),"static"):(l|=32,d=e.tokenPos,m=e.pos),s||(s=e.tokenPos)):(l|=262144,e.skip(0)&&(i||!t.is(128)?this.error(1042,e.range(),"abstract"):(l|=128,h=e.tokenPos,b=e.pos),s||(s=e.tokenPos)),t.flags&65536&&(l|=131072));let A=0,S=0;e.skip(40)&&(i||t.extendsType==null?this.error(1042,e.range(),"override"):(l|=8192,A=e.tokenPos,S=e.pos),s||(s=e.tokenPos));let k=0,w=0;if(e.peek()==45){let oe=e.mark();e.next(),e.peek()!=101?(e.discard(oe),l|=64,k=e.tokenPos,w=e.pos,s||(s=k)):e.reset(oe)}let R=0,C=0,M=!1;if(e.skip(2))switch(M=!0,R=e.tokenPos,C=e.pos,s||(s=R),i&&this.error(1031,e.range(R,C),"async"),e.peek()){case 44:case 42:case 43:case 48:case 0:case 45:case 40:case 12:{this.error(1042,e.range(R,C),"async"),e.next(),M=!1;break}}let O=e.mark(),D=!1,Q=!1,H=0,U=0,V=!1,Y=0,q=0;i||(e.skip(25)?e.peek(1)==116&&!e.peekOnNewLine()?(l|=2048,Q=!0,H=e.tokenPos,U=e.pos,s||(s=H),l&64&&this.error(1042,e.range(k,w),"readonly")):e.reset(O):e.skip(47)?e.peek(1)==116&&!e.peekOnNewLine()?(l|=4096,V=!0,Y=e.tokenPos,q=e.pos,s||(s=Y),l&64&&this.error(1042,e.range(k,w),"readonly")):e.reset(O):e.skip(10)&&(l|=524288,D=!0,s||(s=e.tokenPos),l&32&&this.error(1042,e.range(d,m),"static"),l&128&&this.error(1042,e.range(h,b),"abstract"),l&64&&this.error(1042,e.range(k,w),"readonly")));let ne=Q||V,j;if(D)j=y.createConstructorExpression(e.range());else{if(!ne&&e.skip(67)){s||(s=e.tokenPos),l&256?this.error(1042,e.range(f,_),"public"):l&1024?this.error(1042,e.range(f,_),"protected"):l&512&&this.error(1042,e.range(f,_),"private"),l&32&&this.error(1042,e.range(d,m),"static"),l&8192&&this.error(1042,e.range(A,S),"override"),l&128&&this.error(1042,e.range(h,b),"abstract");let oe=this.parseIndexSignature(e,l,a);return oe?(e.skip(71),oe):(l&64&&this.error(1042,e.range(k,w),"readonly"),null)}if(!e.skipIdentifier(2))return this.error(1003,e.range()),null;s||(s=e.tokenPos),j=y.createIdentifierExpression(e.readIdentifier(),e.range())}let ge=null;if(e.skip(73)){let oe=e.tokenPos;if(ge=this.parseTypeParameters(e),!ge)return null;D?this.error(1092,e.range(oe,e.pos)):ne?this.error(1094,e.range(oe,e.pos)):l|=65536}if(e.skip(65)){l&4&&this.error(1031,e.range(o,u),"declare");let oe=e.tokenPos,_e=this.parseParameters(e,D);if(!_e)return null;let It=this.parseParametersThis;if(D)for(let je=0,Fn=_e.length;je<Fn;++je){let dt=_e[je];if(dt.isAny(1856)){let fr=y.createFieldDeclaration(dt.name,null,dt.flags|262144,dt.type,null,dt.range);fr.parameterIndex=je,dt.implicitFieldDeclaration=fr,t.members.push(fr)}}else Q?_e.length&&this.error(1054,j.range):V?(_e.length!=1&&this.error(1049,j.range),_e.length>0&&_e[0].initializer&&this.error(1052,j.range)):j.text=="constructor"&&this.error(230,j.range,"constructor");let Fe=null;if(e.skip(101)){if(j.kind==28?this.error(1093,e.range()):V&&this.error(1095,e.range()),Fe=this.parseType(e,V||j.kind==28),!Fe)return null}else Fe=y.createOmittedType(e.range(e.pos)),!V&&j.kind!=28&&this.error(1110,Fe.range);let vi=y.createFunctionType(_e,Fe,It,!1,e.range(oe,e.pos)),qt=null;if(e.skip(63)){l&32768?this.error(1183,e.range()):l&128?this.error(1245,e.range(),j.text):i&&this.error(1005,e.range(),";");let je=this.inAsyncContext;if(this.inAsyncContext=M,qt=this.parseBlockStatement(e,!1),this.inAsyncContext=je,!qt)return null}else!i&&!(l&32896)&&this.error(2391,e.range());let Dr=M;M&&(j.kind==28||ne)&&(Dr=!1,this.error(1042,e.range(R,C),"async"));let kn=y.createMethodDeclaration(j,a,l,ge,vi,qt,e.range(s,e.pos),Dr);return i&&e.skip(72)||e.skip(71),kn}else if(D)this.error(2390,j.range);else if(ne)this.error(2391,j.range);else{M&&this.error(1042,e.range(R,C),"async"),l&4&&this.error(100,e.range(o,u),"Ambient fields"),l&128&&this.error(1042,e.range(h,b),"abstract"),l&2048&&this.error(1042,e.range(H,U),"get"),l&4096&&this.error(1042,e.range(Y,q),"set");let oe=null;if(e.skip(100)&&this.error(219,e.range(s,e.pos)),e.skip(96)&&(l|=16384),e.skip(101)){if(oe=this.parseType(e),!oe)return null}else this.error(1110,e.range());let _e=null;if(e.skip(102)){if(l&32768&&this.error(1039,e.range()),_e=this.parseExpression(e),!_e)return null;l&16384&&this.error(1263,j.range)}let It=e.range(s,e.pos);(l&16384)!=0&&(i||(l&32768)!=0)&&this.error(1255,It);let Fe=y.createFieldDeclaration(j,a,l,oe,_e,It);return i&&e.skip(72)||e.skip(71),Fe}return null}parseIndexSignature(e,t,i){i&&i.length>0&&this.error(1206,ue.join(i[0].range,i[i.length-1].range));let s=e.tokenPos;if(e.skipIdentifier())if(e.readIdentifier()=="key")if(e.skip(101)){let l=this.parseType(e);if(!l)return null;if(l.kind!=1)return this.error(1110,e.range()),null;if(e.skip(68))if(e.skip(101)){let o=this.parseType(e);return o?o.kind!=1?(this.error(1003,o.range),null):y.createIndexSignature(l,o,t,e.range(s,e.pos)):null}else this.error(1005,e.range(),":");else this.error(1005,e.range(),"]")}else this.error(1005,e.range(),":");else this.error(1005,e.range(),"key");else this.error(1003,e.range());return null}parseNamespace(e,t,i,s){if(e.skipIdentifier()){let a=y.createIdentifierExpression(e.readIdentifier(),e.range());if(e.skip(63)){let l=new Array,o=y.createNamespaceDeclaration(a,i,t,l,e.range(s,e.pos));for(;!e.skip(64);){let u=this.parseTopLevelStatement(e,o);if(u){if(u.kind==39)return this.error(1319,u.range),null;l.push(u)}else if(this.skipStatement(e),e.skip(122))return this.error(1005,e.range(),"}"),null}return o.range.end=e.pos,o.overriddenModuleName=this.currentModuleName,e.skip(71),o}else this.error(1005,e.range(),"{")}else this.error(1003,e.range());return null}parseExport(e,t,i){let s=null,a=assert(this.currentSource);if(e.skip(63)){let l=new Array;for(;!e.skip(64);){let u=this.parseExportMember(e);if(!u)return null;if(l.push(u),!e.skip(72)){if(e.skip(64))break;return this.error(1005,e.range(),"}"),null}}if(e.skip(23))if(e.skip(117))s=y.createStringLiteralExpression(e.readString(),e.range());else return this.error(1141,e.range()),null;let o=y.createExportStatement(l,s,i,e.range(t,e.pos));if(s){let u=assert(o.internalPath);this.seenlog.has(u)||(this.dependees.set(u,new Ls(a,s)),this.backlog.push(u),this.seenlog.add(u))}return e.skip(71),o}else if(e.skip(85))if(e.skip(23))if(e.skip(117)){s=y.createStringLiteralExpression(e.readString(),e.range());let l=y.createExportStatement(null,s,i,e.range(t,e.pos)),o=assert(l.internalPath),u=e.source,c=u.exportPaths;return c?c.includes(o)||c.push(o):u.exportPaths=[o],this.seenlog.has(o)||(this.dependees.set(o,new Ls(a,s)),this.backlog.push(o)),e.skip(71),l}else this.error(1141,e.range());else this.error(1005,e.range(),"from");else this.error(1005,e.range(),"{");return null}parseExportMember(e){if(e.skipIdentifier(2)){let t=y.createIdentifierExpression(e.readIdentifier(),e.range()),i=null;if(e.skip(1))if(e.skipIdentifier(2))i=y.createIdentifierExpression(e.readIdentifier(),e.range());else return this.error(1003,e.range()),null;return i?y.createExportMember(t,i,ue.join(t.range,i.range)):y.createExportMember(t,null,t.range)}else this.error(1003,e.range());return null}parseExportDefaultAlias(e,t,i,s){let a=e.readIdentifier(),l=e.range(),o=y.createExportStatement([y.createExportMember(y.createIdentifierExpression(a,l),y.createIdentifierExpression("default",e.range(i,s)),l)],null,!1,e.range(t,e.pos));return e.skip(71),o}parseImport(e){let t=e.tokenPos,i=null,s=null,a=!1;if(e.skip(63))for(i=new Array;!e.skip(64);){let l=this.parseImportDeclaration(e);if(!l)return null;if(i.push(l),!e.skip(72)){if(e.skip(64))break;return this.error(1005,e.range(),"}"),null}}else if(e.skip(85))if(e.skip(1))if(e.skipIdentifier())s=y.createIdentifierExpression(e.readIdentifier(),e.range());else return this.error(1003,e.range()),null;else return this.error(1005,e.range(),"as"),null;else if(e.skip(116,1)){let l=e.readIdentifier(),o=e.range();if(i=[y.createImportDeclaration(y.createIdentifierExpression("default",o),y.createIdentifierExpression(l,o),o)],e.skip(72))return this.error(100,e.range(),"Mixed default and named imports"),null}else a=!0;if(a||e.skip(23))if(e.skip(117)){let l=y.createStringLiteralExpression(e.readString(),e.range()),o;s?(assert(!i),o=y.createWildcardImportStatement(s,l,e.range(t,e.pos))):o=y.createImportStatement(i,l,e.range(t,e.pos));let u=o.internalPath;return this.seenlog.has(u)||(this.dependees.set(u,new Ls(assert(this.currentSource),l)),this.backlog.push(u)),e.skip(71),o}else this.error(1141,e.range());else this.error(1005,e.range(),"from");return null}parseImportDeclaration(e){if(e.skipIdentifier(2)){let t=y.createIdentifierExpression(e.readIdentifier(),e.range()),i=null;if(e.skip(1))if(e.skipIdentifier())i=y.createIdentifierExpression(e.readIdentifier(),e.range());else return this.error(1003,e.range()),null;return i?y.createImportDeclaration(t,i,ue.join(t.range,i.range)):y.createImportDeclaration(t,null,t.range)}else this.error(1003,e.range());return null}parseExportImport(e,t){if(e.skipIdentifier()){let i=y.createIdentifierExpression(e.readIdentifier(),e.range());if(e.skip(102))if(e.skipIdentifier()){let s=y.createIdentifierExpression(e.readIdentifier(),e.range()),a=y.createExportImportStatement(s,i,e.range(t,e.pos));return e.skip(71),a}else this.error(1003,e.range());else this.error(1005,e.range(),"=")}else this.error(1003,e.range());return null}parseStatement(e,t=!1){let i=e.mark(),s=e.next(),a=null;switch(s){case 4:{a=this.parseBreak(e);break}case 8:{a=this.parseVariable(e,8,null,e.tokenPos);break}case 9:{a=this.parseContinue(e);break}case 15:{a=this.parseDoStatement(e);break}case 22:{a=this.parseForStatement(e);break}case 26:{a=this.parseIfStatement(e);break}case 34:{a=this.parseVariable(e,16,null,e.tokenPos);break}case 58:{a=this.parseVariable(e,0,null,e.tokenPos);break}case 63:{a=this.parseBlockStatement(e,t);break}case 46:{t&&this.error(1108,e.range()),a=this.parseReturn(e);break}case 71:return y.createEmptyStatement(e.range(e.tokenPos));case 51:{a=this.parseSwitchStatement(e);break}case 53:{a=this.parseThrowStatement(e);break}case 55:{a=this.parseTryStatement(e);break}case 59:{a=this.parseVoidStatement(e);break}case 60:{a=this.parseWhileStatement(e);break}case 56:if(e.peek(1)==116){a=this.parseTypeDeclaration(e,0,null,e.tokenPos);break}default:{e.reset(i),a=this.parseExpressionStatement(e);break}}return a?e.discard(i):(e.reset(i),this.skipStatement(e)),a}parseBlockStatement(e,t){let i=e.tokenPos,s=new Array;for(;!e.skip(64);){let l=e.mark(),o=this.parseStatement(e,t);if(o)e.discard(l),s.push(o);else{if(e.token==122)return null;e.reset(l),this.skipStatement(e)}}let a=y.createBlockStatement(s,e.range(i,e.pos));return t&&e.skip(71),a}parseBreak(e){let t=null;e.peek()==116&&!e.peekOnNewLine()&&(e.next(1),t=y.createIdentifierExpression(e.readIdentifier(),e.range()));let i=y.createBreakStatement(t,e.range());return e.skip(71),i}parseContinue(e){let t=null;e.peek()==116&&!e.peekOnNewLine()&&(e.next(1),t=y.createIdentifierExpression(e.readIdentifier(),e.range()));let i=y.createContinueStatement(t,e.range());return e.skip(71),i}parseDoStatement(e){let t=e.tokenPos,i=this.parseStatement(e);if(!i)return null;if(e.skip(60))if(e.skip(65)){let s=this.parseExpression(e);if(!s)return null;if(e.skip(66)){let a=y.createDoStatement(i,s,e.range(t,e.pos));return e.skip(71),a}else this.error(1005,e.range(),")")}else this.error(1005,e.range(),"(");else this.error(1005,e.range(),"while");return null}parseExpressionStatement(e){let t=this.parseExpression(e);if(!t)return null;let i=y.createExpressionStatement(t);return e.skip(71),i}parseForStatement(e){let t=e.tokenPos;if(e.skip(65)){let i=null;if(e.skip(8))i=this.parseVariable(e,8,null,e.tokenPos,!0);else if(e.skip(34))i=this.parseVariable(e,16,null,e.tokenPos,!0);else if(e.skip(58))i=this.parseVariable(e,0,null,e.tokenPos,!0);else if(!e.skip(71)&&(i=this.parseExpressionStatement(e),!i))return null;if(i){if(e.skip(39)){if(i.kind==42)return i.expression.kind!=8?(this.error(1003,i.range),null):this.parseForOfStatement(e,t,i);if(i.kind==51){let s=i.declarations;for(let a=0,l=s.length;a<l;++a){let u=s[a].initializer;u&&this.error(1190,u.range)}return this.parseForOfStatement(e,t,i)}return this.error(1003,i.range),null}if(i.kind==51){let s=i.declarations;for(let a=0,l=s.length;a<l;++a){let o=s[a];o.initializer||(o.flags&8?this.error(1155,o.name.range):o.type||this.error(1110,o.name.range.atEnd))}}}if(e.token==71){let s=null;if(!e.skip(71)&&(s=this.parseExpressionStatement(e),!s))return null;if(e.token==71){let a=null;if(!e.skip(66)){if(a=this.parseExpression(e),!a)return null;if(!e.skip(66))return this.error(1005,e.range(),")"),null}let l=this.parseStatement(e);return l?y.createForStatement(i,s?s.expression:null,a,l,e.range(t,e.pos)):null}else this.error(1005,e.range(),";")}else this.error(1005,e.range(),";")}else this.error(1005,e.range(),"(");return null}parseForOfStatement(e,t,i){let s=this.parseExpression(e);if(!s)return null;if(!e.skip(66))return this.error(1005,e.range(),")"),null;let a=this.parseStatement(e);return a?y.createForOfStatement(i,s,a,e.range(t,e.pos)):null}parseIfStatement(e){let t=e.tokenPos;if(e.skip(65)){let i=this.parseExpression(e);if(!i)return null;if(e.skip(66)){let s=this.parseStatement(e);if(!s)return null;let a=null;return e.skip(16)&&(a=this.parseStatement(e),!a)?null:y.createIfStatement(i,s,a,e.range(t,e.pos))}else this.error(1005,e.range(),")")}else this.error(1005,e.range(),"(");return null}parseSwitchStatement(e){let t=e.tokenPos;if(e.skip(65)){let i=this.parseExpression(e);if(!i)return null;if(e.skip(66))if(e.skip(63)){let s=new Array;for(;!e.skip(64);){let l=this.parseSwitchCase(e);if(!l)return null;s.push(l)}let a=y.createSwitchStatement(i,s,e.range(t,e.pos));return e.skip(71),a}else this.error(1005,e.range(),"{");else this.error(1005,e.range(),")")}else this.error(1005,e.range(),"(");return null}parseSwitchCase(e){let t=e.tokenPos,i,s;if(e.skip(5)){let a=this.parseExpression(e);if(!a)return null;if(e.skip(101)){for(i=new Array;e.peek()!=5&&e.nextToken!=13&&e.nextToken!=64;){if(s=this.parseStatement(e),!s)return null;i.push(s)}return y.createSwitchCase(a,i,e.range(t,e.pos))}else this.error(1005,e.range(),":")}else if(e.skip(13))if(e.skip(101)){for(i=new Array;e.peek()!=5&&e.nextToken!=13&&e.nextToken!=64;){if(s=this.parseStatement(e),!s)return null;i.push(s)}return y.createSwitchCase(null,i,e.range(t,e.pos))}else this.error(1005,e.range(),":");else this.error(1130,e.range());return null}parseThrowStatement(e){let t=e.tokenPos,i=this.parseExpression(e);if(!i)return null;let s=y.createThrowStatement(i,e.range(t,e.pos));return e.skip(71)||this.checkASI(e),s}parseTryStatement(e){let t=e.tokenPos,i;if(e.skip(63)){let s=new Array;for(;!e.skip(64);){if(i=this.parseStatement(e),!i)return null;s.push(i)}let a=null,l=null,o=null;if(e.skip(6)){if(!e.skip(65))return this.error(1005,e.range(),"("),null;if(!e.skipIdentifier())return this.error(1003,e.range()),null;if(a=y.createIdentifierExpression(e.readIdentifier(),e.range()),!e.skip(66))return this.error(1005,e.range(),")"),null;if(!e.skip(63))return this.error(1005,e.range(),"{"),null;for(l=[];!e.skip(64);){if(i=this.parseStatement(e),!i)return null;l.push(i)}}if(e.skip(21)){if(!e.skip(63))return this.error(1005,e.range(),"{"),null;for(o=[];!e.skip(64);){if(i=this.parseStatement(e),!i)return null;o.push(i)}}if(!(l||o))return this.error(1005,e.range(),"catch"),null;let u=y.createTryStatement(s,a,l,o,e.range(t,e.pos));return e.skip(71),u}else this.error(1005,e.range(),"{");return null}parseTypeDeclaration(e,t,i,s){if(e.skipIdentifier()){let a=y.createIdentifierExpression(e.readIdentifier(),e.range()),l=null;if(e.skip(73)){if(l=this.parseTypeParameters(e),!l)return null;t|=65536}if(e.skip(102)){e.skip(94);let o=this.parseType(e);if(!o)return null;if(Bs(a.text,o))return this.error(2456,a.range,a.text),null;let u=y.createTypeDeclaration(a,i,t,l,o,e.range(s,e.pos));return e.skip(71),u.overriddenModuleName=this.currentModuleName,u}else this.error(1005,e.range(),"=")}else this.error(1003,e.range());return null}parseModuleDeclaration(e,t){let i=e.tokenPos;assert(e.next()==117);let s=e.readString(),a=y.createModuleDeclaration(s,t,e.range(i,e.pos));return this.currentModuleName=s,e.skip(71),a}parseVoidStatement(e){let t=e.tokenPos,i=this.parseExpression(e,21);if(!i)return null;let s=y.createVoidStatement(i,e.range(t,e.pos));return e.skip(71),s}parseWhileStatement(e){let t=e.tokenPos;if(e.skip(65)){let i=this.parseExpression(e);if(!i)return null;if(e.skip(66)){let s=this.parseStatement(e);if(!s)return null;let a=y.createWhileStatement(i,s,e.range(t,e.pos));return e.skip(71),a}else this.error(1005,e.range(),")")}else this.error(1005,e.range(),"(");return null}parseExpressionStart(e){let t=e.next(1),i=e.tokenPos;switch(t){case 70:case 62:case 96:case 97:case 82:case 83:case 57:case 59:case 14:{let s=this.parseExpression(e,17);return s?y.createUnaryPrefixExpression(t,s,e.range(i,e.pos)):null}case 115:{let s=this.parseLazyExpression(e,i);return s||null}case 3:{let s=e.pos,a=this.parseExpression(e,17);if(!a)return null;if(this.inAsyncContext||this.error(1308,e.range(i,s)),a.kind==32){let l=this.awaitNullifiedLazyExpressions;l==null&&(l=new Set,this.awaitNullifiedLazyExpressions=l),l.add(a)}return y.createAwaitExpression(a,e.range(i,e.pos))}case 2:{let s=e.pos;if(e.peekOnNewLine())return this.error(1042,e.range(i,s),"async"),null;switch(e.peek()){case 24:{e.next();let a=this.parseFunctionExpression(e,!0);return a?(a.range.start=i,a):null}case 65:{e.next();let a=this.parseFunctionExpression(e,!0);return a?(a.range.start=i,a):null}case 116:{if(!e.peekOnNewLine()){e.next();let a=y.createIdentifierExpression(e.readIdentifier(),e.range(i,e.pos));if(e.peek()==81&&!e.peekOnNewLine()){let l=this.parseFunctionExpressionCommon(e,y.createEmptyIdentifierExpression(e.range(i)),[y.createParameter(0,a,y.createOmittedType(a.range.atEnd),null,a.range)],null,2,i,-1,!0);return l||null}}break}}return this.error(1042,e.range(i,s),"async"),null}case 88:case 89:{let s=this.parseExpression(e,17);if(!s)return null;switch(s.kind){case 8:case 14:case 23:break;default:this.error(2357,s.range)}return y.createUnaryPrefixExpression(t,s,e.range(i,e.pos))}case 37:{if(!e.skipIdentifier())return this.error(1003,e.range()),null;let s=this.parseTypeName(e);if(!s)return null;let a=null,l=null;if(e.skip(65)||(a=this.tryParseTypeArgumentsBeforeArguments(e))){if(l=this.parseArguments(e),!l)return null}else l=[];return y.createNewExpression(s,a,l,e.range(i,e.pos))}case 38:return y.createNullExpression(e.range());case 54:return y.createTrueExpression(e.range());case 20:return y.createFalseExpression(e.range());case 52:return y.createThisExpression(e.range());case 10:return y.createConstructorExpression(e.range());case 65:{if(e.skip(66))return this.parseFunctionExpressionCommon(e,y.createEmptyIdentifierExpression(e.range(i)),[],null,1);let s=e.mark(),a=!0;do switch(e.next(1)){case 70:return e.reset(s),this.parseFunctionExpression(e);case 116:{switch(e.readIdentifier(),e.next()){case 66:{if(e.skip(101)&&this.parseType(e,!0,!0)==null){a=!1;break}if(!e.skip(81)){a=!1;break}}case 101:return e.reset(s),this.parseFunctionExpression(e);case 100:{if(e.skip(101)||e.skip(72)||e.skip(66))return e.reset(s),this.parseFunctionExpression(e);a=!1;break}case 72:break;default:{a=!1;break}}break}default:{a=!1;break}}while(a);e.reset(s);let l=this.parseExpression(e);return l?e.skip(66)?(l=y.createParenthesizedExpression(l,e.range(i,e.pos)),this.maybeParseCallExpression(e,l)):(this.error(1005,e.range(),")"),null):null}case 67:{let s=new Array;for(;!e.skip(68);){let a;if(e.peek()==72)a=y.createOmittedExpression(e.range(e.pos));else if(a=this.parseExpression(e,2),!a)return null;if(s.push(a),!e.skip(72)){if(e.skip(68))break;return this.error(1005,e.range(),"]"),null}}return y.createArrayLiteralExpression(s,e.range(i,e.pos))}case 63:{let s=e.tokenPos,a=new Array,l=new Array,o;for(;!e.skip(64);){if(e.skipIdentifier())o=y.createIdentifierExpression(e.readIdentifier(),e.range());else{if(!e.skip(117))return this.error(1003,e.range()),null;o=y.createIdentifierExpression(e.readString(),e.range()),o.isQuoted=!0}if(a.push(o),e.skip(101)){let u=this.parseExpression(e,2);if(!u)return null;l.push(u)}else if(!o.isQuoted)l.push(o);else return this.error(1005,e.range(),":"),null;if(!e.skip(72)){if(e.skip(64))break;return this.error(1005,e.range(),"}"),null}}return y.createObjectLiteralExpression(a,l,e.range(s,e.pos))}case 73:{let s=this.parseType(e);if(!s)return null;if(!e.skip(74))return this.error(1005,e.range(),">"),null;let a=this.parseExpression(e,19);return a?y.createAssertionExpression(0,a,s,e.range(i,e.pos)):null}case 116:{let s=e.readIdentifier();if(s=="null")return y.createNullExpression(e.range());let a=y.createIdentifierExpression(s,e.range(i,e.pos));return e.skip(120)?this.parseTemplateLiteral(e,a):e.peek()==81&&!e.peekOnNewLine()?this.parseFunctionExpressionCommon(e,y.createEmptyIdentifierExpression(e.range(i)),[y.createParameter(0,a,y.createOmittedType(a.range.atEnd),null,a.range)],null,2,i):this.maybeParseCallExpression(e,a,!0)}case 50:{e.peek()!=69&&e.nextToken!=65&&this.error(1034,e.range());let s=y.createSuperExpression(e.range(i,e.pos));return this.maybeParseCallExpression(e,s)}case 117:return y.createStringLiteralExpression(e.readString(),e.range(i,e.pos));case 120:return this.parseTemplateLiteral(e);case 118:{let s=e.readInteger();return e.checkForIdentifierStartAfterNumericLiteral(),y.createIntegerLiteralExpression(s,e.range(i,e.pos))}case 119:{let s=e.readFloat();return e.checkForIdentifierStartAfterNumericLiteral(),y.createFloatLiteralExpression(s,e.range(i,e.pos))}case 86:{let s=e.readRegexpPattern();return e.skip(86)?y.createRegexpLiteralExpression(s,e.readRegexpFlags(),e.range(i,e.pos)):(this.error(1005,e.range(),"/"),null)}case 24:{let s=this.parseFunctionExpression(e);return s?this.maybeParseCallExpression(e,s):null}case 7:return this.parseClassExpression(e);default:return t==122?this.error(1126,e.range(i)):this.error(1109,e.range()),null}}tryParseTypeArgumentsBeforeArguments(e){let t=e.mark();if(!e.skip(73))return null;let i=e.tokenPos,s=null;do{if(e.peek()==74)break;let a=this.parseType(e,!0,!0);if(!a)return e.reset(t),null;s?s.push(a):s=[a]}while(e.skip(72));if(e.skip(74)){let a=e.pos;if(e.skip(65))return s||this.error(1099,e.range(i,a)),s}return e.reset(t),null}parseArguments(e){let t=new Array;for(;!e.skip(66);){let i=this.parseExpression(e,2);if(!i)return null;if(t.push(i),!e.skip(72)){if(e.skip(66))break;return this.error(1005,e.range(),")"),null}}return t}parseLazyExpression(e,t){if(!e.skipIdentifier())return this.error(1003,e.range()),null;let i=e.readIdentifier();if(i!="lazy")return this.error(212,e.range(t,e.pos),i),null;let s=this.parseExpression(e,17);if(!s)return null;let a=y.createLazyExpression(s,e.range(t,e.pos)),l=this.unplacedLazyExpressions;return l==null&&(l=new Set,this.unplacedLazyExpressions=l),l.add(a),a}parseExpression(e,t=1){assert(t!=0);let i=this.parseExpressionStart(e);if(!i)return null;let s=i.range.start,a;for(;(a=Q1(e.peek()))>=t;){let l=e.next();switch(l){case 1:{if(e.skip(8))i=y.createAssertionExpression(3,i,null,e.range(s,e.pos));else{let o=this.parseType(e);if(!o)return null;i=y.createAssertionExpression(1,i,o,e.range(s,e.pos))}break}case 96:{i=y.createAssertionExpression(2,i,null,e.range(s,e.pos)),i=this.maybeParseCallExpression(e,i);break}case 30:{let o=this.parseType(e);if(!o)return null;i=y.createInstanceOfExpression(i,o,e.range(s,e.pos));break}case 67:{let o=this.parseExpression(e);if(!o)return null;if(!e.skip(68))return this.error(1005,e.range(),"]"),null;i=y.createElementAccessExpression(i,o,e.range(s,e.pos)),i=this.maybeParseCallExpression(e,i);break}case 88:case 89:{i.kind!=8&&i.kind!=14&&i.kind!=23&&this.error(2357,i.range),i=y.createUnaryPostfixExpression(l,i,e.range(s,e.pos));break}case 100:{let o=this.parseExpression(e);if(!o)return null;if(!e.skip(101))return this.error(1005,e.range(),":"),null;let u=this.parseExpression(e,t>1?2:1);if(!u)return null;i=y.createTernaryExpression(i,o,u,e.range(s,e.pos));break}case 72:{let o=[i];do{if(i=this.parseExpression(e,2),!i)return null;o.push(i)}while(e.skip(72));i=y.createCommaExpression(o,e.range(s,e.pos));break}case 69:{if(e.skipIdentifier(2)){let o=y.createIdentifierExpression(e.readIdentifier(),e.range());i=y.createPropertyAccessExpression(i,o,e.range(s,e.pos))}else{let o=this.parseExpression(e,a+1);if(!o)return null;if(o.kind==11){if(i=this.joinPropertyCall(e,s,i,o),!i)return null}else return this.error(1003,o.range),null}if(e.skip(120)){if(i=this.parseTemplateLiteral(e,i),!i)return null}else i=this.maybeParseCallExpression(e,i,!0);break}case 102:case 103:case 104:case 106:case 105:case 107:case 108:case 109:case 110:case 111:case 112:case 114:case 113:case 84:{let o=this.parseExpression(e,a);if(!o)return null;i=y.createBinaryExpression(l,i,o,e.range(s,e.pos));break}case 73:case 74:case 75:case 76:case 77:case 79:case 80:case 78:case 82:case 83:case 85:case 86:case 87:case 90:case 91:case 92:case 93:case 94:case 95:case 98:case 99:case 29:{let o=this.parseExpression(e,a+1);if(!o)return null;i=y.createBinaryExpression(l,i,o,e.range(s,e.pos));break}default:assert(!1)}}return i}parseTemplateLiteral(e,t=null){let i=t?t.range.start:e.tokenPos,s=new Array,a=new Array,l=new Array;for(s.push(e.readString(0,t!=null)),a.push(e.source.text.substring(e.readStringStart,e.readStringEnd));e.readingTemplateString;){let o=this.parseExpression(e);if(!o)return null;if(l.push(o),!e.skip(64))return this.error(1005,e.range(),"}"),null;s.push(e.readString(96,t!=null)),a.push(e.source.text.substring(e.readStringStart,e.readStringEnd))}return y.createTemplateLiteralExpression(t,s,a,l,e.range(i,e.pos))}joinPropertyCall(e,t,i,s){let a=s.expression;switch(a.kind){case 8:{s.expression=y.createPropertyAccessExpression(i,a,e.range(t,e.pos));break}case 11:{let l=this.joinPropertyCall(e,t,i,a);if(!l)return null;s.expression=l,s.range=e.range(t,e.pos);break}default:return this.error(1003,s.range),null}return s}maybeParseCallExpression(e,t,i=!1){let s=null;for(;e.skip(65)||i&&(s=this.tryParseTypeArgumentsBeforeArguments(e));){let a=this.parseArguments(e);if(!a)break;t=y.createCallExpression(t,s,a,e.range(t.range.start,e.pos)),i=!1}return t}checkASI(e){let t=e.peek();t==122||t==64||e.peekOnNewLine()||this.error(1012,e.range(e.nextTokenPos))}skipStatement(e){e.peekOnNewLine()&&e.next();do{let t=e.peek();if(t==122||t==71){e.next();break}if(e.peekOnNewLine())break;switch(e.next()){case 116:{e.readIdentifier();break}case 117:case 120:{e.readString();break}case 118:{e.readInteger(),e.checkForIdentifierStartAfterNumericLiteral();break}case 119:{e.readFloat(),e.checkForIdentifierStartAfterNumericLiteral();break}case 63:{this.skipBlock(e);break}}}while(!0);e.readingTemplateString=!1}skipBlock(e){let t=1,i=!0;do switch(e.next()){case 122:{this.error(1005,e.range(),"}"),i=!1;break}case 63:{++t;break}case 64:{--t,t||(i=!1);break}case 116:{e.readIdentifier();break}case 117:{e.readString();break}case 120:{for(e.readString();e.readingTemplateString;)this.skipBlock(e),e.readString(96);break}case 118:{e.readInteger(),e.checkForIdentifierStartAfterNumericLiteral();break}case 119:{e.readFloat(),e.checkForIdentifierStartAfterNumericLiteral();break}}while(i)}},nx=(C=>(C[C.None=0]="None",C[C.Comma=1]="Comma",C[C.Spread=2]="Spread",C[C.Yield=3]="Yield",C[C.Assignment=4]="Assignment",C[C.Conditional=5]="Conditional",C[C.LogicalOr=6]="LogicalOr",C[C.LogicalAnd=7]="LogicalAnd",C[C.BitwiseOr=8]="BitwiseOr",C[C.BitwiseXor=9]="BitwiseXor",C[C.BitwiseAnd=10]="BitwiseAnd",C[C.Equality=11]="Equality",C[C.Relational=12]="Relational",C[C.Shift=13]="Shift",C[C.Additive=14]="Additive",C[C.Multiplicative=15]="Multiplicative",C[C.Exponentiated=16]="Exponentiated",C[C.UnaryPrefix=17]="UnaryPrefix",C[C.UnaryPostfix=18]="UnaryPostfix",C[C.Call=19]="Call",C[C.MemberAccess=20]="MemberAccess",C[C.Grouping=21]="Grouping",C))(nx||{});function Q1(n){switch(n){case 72:return 1;case 102:case 103:case 104:case 106:case 105:case 107:case 108:case 109:case 110:case 111:case 112:case 114:case 113:return 4;case 100:return 5;case 99:return 6;case 98:return 7;case 94:return 8;case 95:return 9;case 93:return 10;case 77:case 78:case 79:case 80:return 11;case 1:case 29:case 30:case 73:case 74:case 75:case 76:return 12;case 90:case 91:case 92:return 13;case 82:case 83:return 14;case 85:case 86:case 87:return 15;case 84:return 16;case 88:case 89:return 18;case 69:case 67:case 96:return 20}return 0}function Bs(n,r){switch(r.kind){case 1:{if(r.name.identifier.text==n)return!0;let e=r.typeArguments;if(e){for(let t=0,i=e.length;t<i;t++)if(Bs(n,e[t]))return!0}break}case 2:{let e=r;if(Bs(n,e.returnType))return!0;let t=e.parameters;for(let i=0,s=t.length;i<s;i++)if(Bs(n,t[i].type))return!0;break}case 3:{let e=r.elements;for(let t=0,i=e.length;t<i;t++)if(Bs(n,e[t]))return!0;break}default:assert(!1)}return!1}var ix=16,si=ix-1,Jo=class{constructor(r,e,t,i,s){this.localFile=r;this.localIdentifier=e;this.foreignIdentifier=t;this.foreignPath=i;this.foreignPathAlt=s}},eu=class{constructor(r,e,t,i){this.localIdentifier=r;this.foreignIdentifier=e;this.foreignPath=t;this.foreignPathAlt=i}},vf=class{constructor(r,e,t){this.foreignPath=r;this.foreignPathAlt=e;this.pathLiteral=t}},Me=(q=>(q[q.Invalid=0]="Invalid",q[q.IndexedGet=1]="IndexedGet",q[q.IndexedSet=2]="IndexedSet",q[q.UncheckedIndexedGet=3]="UncheckedIndexedGet",q[q.UncheckedIndexedSet=4]="UncheckedIndexedSet",q[q.Add=5]="Add",q[q.Sub=6]="Sub",q[q.Mul=7]="Mul",q[q.Div=8]="Div",q[q.Rem=9]="Rem",q[q.Pow=10]="Pow",q[q.BitwiseAnd=11]="BitwiseAnd",q[q.BitwiseOr=12]="BitwiseOr",q[q.BitwiseXor=13]="BitwiseXor",q[q.BitwiseShl=14]="BitwiseShl",q[q.BitwiseShr=15]="BitwiseShr",q[q.BitwiseShrU=16]="BitwiseShrU",q[q.Eq=17]="Eq",q[q.Ne=18]="Ne",q[q.Gt=19]="Gt",q[q.Ge=20]="Ge",q[q.Lt=21]="Lt",q[q.Le=22]="Le",q[q.Plus=23]="Plus",q[q.Minus=24]="Minus",q[q.Not=25]="Not",q[q.BitwiseNot=26]="BitwiseNot",q[q.PrefixInc=27]="PrefixInc",q[q.PrefixDec=28]="PrefixDec",q[q.PostfixInc=29]="PostfixInc",q[q.PostfixDec=30]="PostfixDec",q))(Me||{});(i=>{function n(s,a){switch(assert(a.length),s){case 2:case 3:{switch(a.charCodeAt(0)){case 91:{if(a=="[]")return 1;if(a=="[]=")return 2;break}case 123:{if(a=="{}")return 3;if(a=="{}=")return 4;break}case 43:{if(a=="+")return 5;break}case 45:{if(a=="-")return 6;break}case 42:{if(a=="*")return 7;if(a=="**")return 10;break}case 47:{if(a=="/")return 8;break}case 37:{if(a=="%")return 9;break}case 38:{if(a=="&")return 11;break}case 124:{if(a=="|")return 12;break}case 94:{if(a=="^")return 13;break}case 61:{if(a=="==")return 17;break}case 33:{if(a=="!=")return 18;break}case 62:{if(a==">")return 19;if(a==">=")return 20;if(a==">>")return 15;if(a==">>>")return 16;break}case 60:{if(a=="<")return 21;if(a=="<=")return 22;if(a=="<<")return 14;break}}break}case 4:{switch(a.charCodeAt(0)){case 43:{if(a=="+")return 23;if(a=="++")return 27;break}case 45:{if(a=="-")return 24;if(a=="--")return 28;break}case 33:{if(a=="!")return 25;break}case 126:{if(a=="~")return 26;break}}break}case 5:{switch(a.charCodeAt(0)){case 43:{if(a=="++")return 29;break}case 45:{if(a=="--")return 30;break}}break}}return 0}i.fromDecorator=n;function r(s){switch(s){case 82:case 103:return 5;case 83:case 104:return 6;case 85:case 105:return 7;case 86:case 107:return 8;case 87:case 108:return 9;case 84:case 106:return 10;case 93:case 112:return 11;case 94:case 113:return 12;case 95:case 114:return 13;case 90:case 109:return 14;case 91:case 110:return 15;case 92:case 111:return 16;case 77:case 79:return 17;case 78:case 80:return 18;case 74:return 19;case 76:return 20;case 73:return 21;case 75:return 22}return 0}i.fromBinaryToken=r;function e(s){switch(s){case 82:return 23;case 83:return 24;case 96:return 25;case 97:return 26;case 88:return 27;case 89:return 28}return 0}i.fromUnaryPrefixToken=e;function t(s){switch(s){case 88:return 29;case 89:return 30}return 0}i.fromUnaryPostfixToken=t})(Me||={});var zs=class{constructor(r){this.leafCount=r}},Ds=class extends tt{constructor(e,t=null){super(t);this.options=e;this.sources=[];this.stdSources=new Set;this.diagnosticsOffset=0;this.nextClassId=0;this.nextSignatureId=0;this.initialized=!1;this.filesByName=new Map;this.elementsByName=new Map;this.elementsByDeclaration=new Map;this.instancesByName=new Map;this.wrapperClasses=new Map;this.managedClasses=new Map;this.uniqueSignatures=new Map;this.moduleImports=new Map;this._arrayBufferViewInstance=null;this._arrayBufferInstance=null;this._arrayPrototype=null;this._staticArrayPrototype=null;this._dynamicArrayPrototype=null;this._setPrototype=null;this._mapPrototype=null;this._functionPrototype=null;this._taskPrototype=null;this._int8ArrayPrototype=null;this._int16ArrayPrototype=null;this._int32ArrayPrototype=null;this._int64ArrayPrototype=null;this._uint8ArrayPrototype=null;this._uint8ClampedArrayPrototype=null;this._uint16ArrayPrototype=null;this._uint32ArrayPrototype=null;this._uint64ArrayPrototype=null;this._float32ArrayPrototype=null;this._float64ArrayPrototype=null;this._stringInstance=null;this._regexpInstance=null;this._objectPrototype=null;this._objectInstance=null;this._templateStringsArrayInstance=null;this._allocInstance=null;this._reallocInstance=null;this._freeInstance=null;this._newInstance=null;this._renewInstance=null;this._linkInstance=null;this._collectInstance=null;this._visitInstance=null;this._newBufferInstance=null;this._newArrayInstance=null;this._BLOCKInstance=null;this._OBJECTInstance=null;this.nativeDummySignature=null;this.module=Jt.create(e.stackSize>0,e.sizeTypeRef),this.parser=new Ms(this.diagnostics,this.sources),this.resolver=new Rs(this);let i=new Vs(this,Te.native);this.nativeFile=i,this.filesByName.set(i.internalName,i),this.parser.options=this.options}get arrayBufferViewInstance(){let e=this._arrayBufferViewInstance;return e||(this._arrayBufferViewInstance=e=this.requireClass(B.ArrayBufferView)),e}get arrayBufferInstance(){let e=this._arrayBufferInstance;return e||(this._arrayBufferInstance=e=this.requireClass(B.ArrayBuffer)),e}get arrayPrototype(){let e=this._arrayPrototype;return e||(this._arrayPrototype=e=this.require(B.Array,6)),e}get staticArrayPrototype(){let e=this._staticArrayPrototype;return e||(this._staticArrayPrototype=e=this.require(B.StaticArray,6)),e}get dynamicArrayPrototype(){let e=this._dynamicArrayPrototype;return e||(this._dynamicArrayPrototype=e=this.require(B.DynamicArray,6)),e}get setPrototype(){let e=this._setPrototype;return e||(this._setPrototype=e=this.require(B.Set,6)),e}get mapPrototype(){let e=this._mapPrototype;return e||(this._mapPrototype=e=this.require(B.Map,6)),e}get functionPrototype(){let e=this._functionPrototype;return e||(this._functionPrototype=e=this.require(B.Function,6)),e}get taskPrototype(){let e=this._taskPrototype;if(!e){let t=J(this.elementsByName,B.Task);if(!t||t.kind!=6)return null;this._taskPrototype=e=t}return e}get int8ArrayPrototype(){let e=this._int8ArrayPrototype;return e||(this._int8ArrayPrototype=e=this.require(B.Int8Array,6)),e}get int16ArrayPrototype(){let e=this._int16ArrayPrototype;return e||(this._int16ArrayPrototype=e=this.require(B.Int16Array,6)),e}get int32ArrayPrototype(){let e=this._int32ArrayPrototype;return e||(this._int32ArrayPrototype=e=this.require(B.Int32Array,6)),e}get int64ArrayPrototype(){let e=this._int64ArrayPrototype;return e||(this._int64ArrayPrototype=e=this.require(B.Int64Array,6)),e}get uint8ArrayPrototype(){let e=this._uint8ArrayPrototype;return e||(this._uint8ArrayPrototype=e=this.require(B.Uint8Array,6)),e}get uint8ClampedArrayPrototype(){let e=this._uint8ClampedArrayPrototype;return e||(this._uint8ClampedArrayPrototype=e=this.require(B.Uint8ClampedArray,6)),e}get uint16ArrayPrototype(){let e=this._uint16ArrayPrototype;return e||(this._uint16ArrayPrototype=e=this.require(B.Uint16Array,6)),e}get uint32ArrayPrototype(){let e=this._uint32ArrayPrototype;return e||(this._uint32ArrayPrototype=e=this.require(B.Uint32Array,6)),e}get uint64ArrayPrototype(){let e=this._uint64ArrayPrototype;return e||(this._uint64ArrayPrototype=e=this.require(B.Uint64Array,6)),e}get float32ArrayPrototype(){let e=this._float32ArrayPrototype;return e||(this._float32ArrayPrototype=e=this.require(B.Float32Array,6)),e}get float64ArrayPrototype(){let e=this._float64ArrayPrototype;return e||(this._float64ArrayPrototype=e=this.require(B.Float64Array,6)),e}get stringInstance(){let e=this._stringInstance;return e||(this._stringInstance=e=this.requireClass(B.String)),e}get regexpInstance(){let e=this._regexpInstance;return e||(this._regexpInstance=e=this.requireClass(B.RegExp)),e}get objectPrototype(){let e=this._objectPrototype;return e||(this._objectPrototype=e=this.require(B.Object,6)),e}get objectInstance(){let e=this._objectInstance;return e||(this._objectInstance=e=this.requireClass(B.Object)),e}get templateStringsArrayInstance(){let e=this._templateStringsArrayInstance;return e||(this._templateStringsArrayInstance=e=this.requireClass(B.TemplateStringsArray)),e}get abortInstance(){let e=this.lookup(B.abort);return!e||e.kind!=4?null:this.resolver.resolveFunction(e,null)}get allocInstance(){let e=this._allocInstance;return e||(this._allocInstance=e=this.requireFunction(B.alloc)),e}get reallocInstance(){let e=this._reallocInstance;return e||(this._reallocInstance=e=this.requireFunction(B.realloc)),e}get freeInstance(){let e=this._freeInstance;return e||(this._freeInstance=e=this.requireFunction(B.free)),e}get newInstance(){let e=this._newInstance;return e||(this._newInstance=e=this.requireFunction(B.new_)),e}get renewInstance(){let e=this._renewInstance;return e||(this._renewInstance=e=this.requireFunction(B.renew)),e}get linkInstance(){let e=this._linkInstance;return e||(this._linkInstance=e=this.requireFunction(B.link)),e}get collectInstance(){let e=this._collectInstance;return e||(this._collectInstance=e=this.requireFunction(B.collect)),e}get visitInstance(){let e=this._visitInstance;return e||(this._visitInstance=e=this.requireFunction(B.visit)),e}get newBufferInstance(){let e=this._newBufferInstance;return e||(this._newBufferInstance=e=this.requireFunction(B.newBuffer)),e}get newArrayInstance(){let e=this._newArrayInstance;return e||(this._newArrayInstance=e=this.requireFunction(B.newArray)),e}get BLOCKInstance(){let e=this._BLOCKInstance;return e||(this._BLOCKInstance=e=this.requireClass(B.BLOCK)),e}get OBJECTInstance(){let e=this._OBJECTInstance;return e||(this._OBJECTInstance=e=this.requireClass(B.OBJECT)),e}getSource(e){let t=this.sources;for(let i=0;i<t.length;++i){let s=t[i];if(s.internalPath==e)return s.text}return null}get blockOverhead(){return this.BLOCKInstance.nextMemoryOffset}get objectOverhead(){return this.OBJECTInstance.nextMemoryOffset-this.blockOverhead+si&~si}get totalOverhead(){return this.blockOverhead+this.objectOverhead}searchFunctionByRef(e){let t=bf(e);if(t){let i=this.instancesByName;if(i.has(t)){let s=assert(i.get(t));if(s.kind==5)return s}}return null}computeBlockStart(e){let t=this.blockOverhead;return(e+t+si&~si)-t}computeBlockStart64(e){let t=i64_new(this.blockOverhead);return i64_sub(i64_align(i64_add(e,t),ix),t)}computeBlockSize(e,t){t&&(e+=this.objectOverhead);let i=this.computeBlockStart(e),s=this.blockOverhead,a=(3*this.options.usizeType.byteSize+s+si&~si)-s;i<a&&(i=a);let l=1<<30;if(i>=l||(i&3)!=0)throw new Error("invalid block size");return i}makeNativeVariableDeclaration(e,t=0){let i=Te.native.range;return y.createVariableDeclaration(y.createIdentifierExpression(e,i),null,t,null,null,i)}makeNativeTypeDeclaration(e,t=0){let i=Te.native.range,s=y.createIdentifierExpression(e,i);return y.createTypeDeclaration(s,null,t,null,y.createOmittedType(i),i)}makeNativeFunctionDeclaration(e,t=0){let i=Te.native.range,s=this.nativeDummySignature;return s||(this.nativeDummySignature=s=y.createFunctionType([],y.createNamedType(y.createSimpleTypeName(B.void_,i),null,!1,i),null,!1,i)),y.createFunctionDeclaration(y.createIdentifierExpression(e,i),null,t,null,s,null,0,i)}makeNativeNamespaceDeclaration(e,t=0){let i=Te.native.range;return y.createNamespaceDeclaration(y.createIdentifierExpression(e,i),null,t,[],i)}makeNativeFunction(e,t,i=this.nativeFile,s=0,a=0){return new Mt(e,new ot(e,i,this.makeNativeFunctionDeclaration(e,s),a),null,t)}getElementByDeclaration(e){let t=this.elementsByDeclaration;return t.has(e)?assert(t.get(e)):null}initialize(){if(this.initialized)return;this.initialized=!0;let e=this.options;this.registerNativeType(B.i8,p.i8),this.registerNativeType(B.i16,p.i16),this.registerNativeType(B.i32,p.i32),this.registerNativeType(B.i64,p.i64),this.registerNativeType(B.isize,e.isizeType),this.registerNativeType(B.u8,p.u8),this.registerNativeType(B.u16,p.u16),this.registerNativeType(B.u32,p.u32),this.registerNativeType(B.u64,p.u64),this.registerNativeType(B.usize,e.usizeType),this.registerNativeType(B.bool,p.bool),this.registerNativeType(B.f32,p.f32),this.registerNativeType(B.f64,p.f64),this.registerNativeType(B.void_,p.void),this.registerNativeType(B.number,p.f64),this.registerNativeType(B.boolean,p.bool),this.nativeFile.add(B.native,new lt(B.native,this.nativeFile,this.makeNativeTypeDeclaration(B.native,65538),512)),this.nativeFile.add(B.indexof,new lt(B.indexof,this.nativeFile,this.makeNativeTypeDeclaration(B.indexof,65538),512)),this.nativeFile.add(B.valueof,new lt(B.valueof,this.nativeFile,this.makeNativeTypeDeclaration(B.valueof,65538),512)),this.nativeFile.add(B.returnof,new lt(B.returnof,this.nativeFile,this.makeNativeTypeDeclaration(B.returnof,65538),512)),this.nativeFile.add(B.thisof,new lt(B.thisof,this.nativeFile,this.makeNativeTypeDeclaration(B.thisof,65538),512)),this.nativeFile.add(B.nonnull,new lt(B.nonnull,this.nativeFile,this.makeNativeTypeDeclaration(B.nonnull,65538),512)),this.registerNativeType(B.v128,p.v128),this.registerNativeType(B.ref_func,p.func),this.registerNativeType(B.ref_extern,p.extern),this.registerNativeType(B.ref_any,p.any),this.registerNativeType(B.ref_eq,p.eq),this.registerNativeType(B.ref_struct,p.struct),this.registerNativeType(B.ref_array,p.array),this.registerNativeType(B.ref_i31,p.i31),this.registerNativeType(B.ref_string,p.string),this.registerNativeType(B.ref_stringview_wtf8,p.stringview_wtf8),this.registerNativeType(B.ref_stringview_wtf16,p.stringview_wtf16),this.registerNativeType(B.ref_stringview_iter,p.stringview_iter),this.registerConstantInteger(B.ASC_TARGET,p.i32,i64_new(e.isWasm64?2:1)),this.registerConstantInteger(B.ASC_RUNTIME,p.i32,i64_new(e.runtime)),this.registerConstantInteger(B.ASC_NO_ASSERT,p.bool,i64_new(e.noAssert?1:0,0)),this.registerConstantInteger(B.ASC_MEMORY_BASE,p.i32,i64_new(e.memoryBase,0)),this.registerConstantInteger(B.ASC_TABLE_BASE,p.i32,i64_new(e.tableBase,0)),this.registerConstantInteger(B.ASC_OPTIMIZE_LEVEL,p.i32,i64_new(e.optimizeLevelHint,0)),this.registerConstantInteger(B.ASC_SHRINK_LEVEL,p.i32,i64_new(e.shrinkLevelHint,0)),this.registerConstantInteger(B.ASC_LOW_MEMORY_LIMIT,p.i32,i64_new(e.lowMemoryLimit,0)),this.registerConstantInteger(B.ASC_EXPORT_RUNTIME,p.bool,i64_new(e.exportRuntime?1:0,0)),this.registerConstantInteger(B.ASC_VERSION_MAJOR,p.i32,i64_new(e.bundleMajorVersion)),this.registerConstantInteger(B.ASC_VERSION_MINOR,p.i32,i64_new(e.bundleMinorVersion)),this.registerConstantInteger(B.ASC_VERSION_PATCH,p.i32,i64_new(e.bundlePatchVersion)),this.registerConstantInteger(B.ASC_FEATURE_SIGN_EXTENSION,p.bool,i64_new(e.hasFeature(1)?1:0,0)),this.registerConstantInteger(B.ASC_FEATURE_MUTABLE_GLOBALS,p.bool,i64_new(e.hasFeature(2)?1:0,0)),this.registerConstantInteger(B.ASC_FEATURE_NONTRAPPING_F2I,p.bool,i64_new(e.hasFeature(4)?1:0,0)),this.registerConstantInteger(B.ASC_FEATURE_BULK_MEMORY,p.bool,i64_new(e.hasFeature(8)?1:0,0)),this.registerConstantInteger(B.ASC_FEATURE_SIMD,p.bool,i64_new(e.hasFeature(16)?1:0,0)),this.registerConstantInteger(B.ASC_FEATURE_THREADS,p.bool,i64_new(e.hasFeature(32)?1:0,0)),this.registerConstantInteger(B.ASC_FEATURE_EXCEPTION_HANDLING,p.bool,i64_new(e.hasFeature(64)?1:0,0)),this.registerConstantInteger(B.ASC_FEATURE_TAIL_CALLS,p.bool,i64_new(e.hasFeature(128)?1:0,0)),this.registerConstantInteger(B.ASC_FEATURE_REFERENCE_TYPES,p.bool,i64_new(e.hasFeature(256)?1:0,0)),this.registerConstantInteger(B.ASC_FEATURE_MULTI_VALUE,p.bool,i64_new(e.hasFeature(512)?1:0,0)),this.registerConstantInteger(B.ASC_FEATURE_GC,p.bool,i64_new(e.hasFeature(1024)?1:0,0)),this.registerConstantInteger(B.ASC_FEATURE_MEMORY64,p.bool,i64_new(e.hasFeature(2048)?1:0,0)),this.registerConstantInteger(B.ASC_FEATURE_RELAXED_SIMD,p.bool,i64_new(e.hasFeature(4096)?1:0,0)),this.registerConstantInteger(B.ASC_FEATURE_EXTENDED_CONST,p.bool,i64_new(e.hasFeature(8192)?1:0,0)),this.registerConstantInteger(B.ASC_FEATURE_STRINGREF,p.bool,i64_new(e.hasFeature(16384)?1:0,0)),this.registerConstantInteger(B.ASC_FEATURE_SHARED_EVERYTHING,p.bool,i64_new(e.hasFeature(16384)?1:0,0));let t=new Array,i=new Map,s=new Map,a=new Array,l=new Array;for(let u=0,c=this.sources.length;u<c;++u){let f=this.sources[u],_=new Vs(this,f);this.filesByName.set(_.internalName,_);let d=f.statements;for(let m=0,h=d.length;m<h;++m){let b=d[m];switch(b.kind){case 39:{this.initializeExports(b,_,i,s);break}case 40:{this.initializeExportDefault(b,_,a,l);break}case 46:{this.initializeImports(b,_,t,i);break}case 51:{this.initializeVariables(b,_);break}case 55:{this.initializeClass(b,_,a,l);break}case 56:{this.initializeEnum(b,_);break}case 59:{this.initializeFunction(b,_);break}case 61:{this.initializeInterface(b,_,a);break}case 63:{this.initializeNamespace(b,_,a,l);break}case 64:{this.initializeTypeDefinition(b,_);break}}}}for(let u=Map_keys(s),c=0,f=u.length;c<f;++c){let _=u[c],d=assert(s.get(_));for(let m=0,h=d.length;m<h;++m){let b=unchecked(d[m]),A=this.lookupForeignFile(b.foreignPath,b.foreignPathAlt);if(!A){this.error(6054,b.pathLiteral.range,b.pathLiteral.value);continue}_.ensureExportStar(A)}}do{let u=0,c=!1;for(;u<t.length;){let f=t[u],_=f.localIdentifier,d=f.foreignIdentifier,m=assert(this.lookupForeignFile(f.foreignPath,f.foreignPathAlt));if(d){let h=this.lookupForeign(d.text,m,i);h?(f.localFile.add(_.text,h,_),t.splice(u,1),c=!0):++u}else{let h=f.localFile,b=_.text;h.add(b,m.asAliasNamespace(b,h,_),_),t.splice(u,1),c=!0}}if(!c){for(let f=0,_=t.length;f<_;++f){let d=t[f],m=d.foreignIdentifier;m&&this.error(2305,m.range,d.foreignPath,m.text)}break}}while(!0);for(let u=Map_keys(i),c=0,f=u.length;c<f;++c){let _=unchecked(u[c]),d=assert(i.get(_));for(let m=Map_keys(d),h=0,b=m.length;h<b;++h){let A=unchecked(m[h]),S=assert(d.get(A)),k=S.localIdentifier.text,w=S.foreignPath;if(w){let R=assert(this.lookupForeignFile(w,assert(S.foreignPathAlt))),C=this.lookupForeign(k,R,i);C?_.ensureExport(A,C):this.error(2305,S.localIdentifier.range,w,k)}else{let R=_.getMember(k);if(R)_.ensureExport(A,R);else{let C=this.lookup(k);C&&Us(C.kind)?_.ensureExport(A,C):this.error(2305,S.foreignIdentifier.range,_.internalName,S.foreignIdentifier.text)}}}}assert(this.objectInstance.id==0),assert(this.arrayBufferInstance.id==1),assert(this.stringInstance.id==2),assert(this.arrayBufferViewInstance.id==3),this.registerWrapperClass(p.i8,B.I8),this.registerWrapperClass(p.i16,B.I16),this.registerWrapperClass(p.i32,B.I32),this.registerWrapperClass(p.i64,B.I64),this.registerWrapperClass(e.isizeType,B.Isize),this.registerWrapperClass(p.u8,B.U8),this.registerWrapperClass(p.u16,B.U16),this.registerWrapperClass(p.u32,B.U32),this.registerWrapperClass(p.u64,B.U64),this.registerWrapperClass(e.usizeType,B.Usize),this.registerWrapperClass(p.bool,B.Bool),this.registerWrapperClass(p.f32,B.F32),this.registerWrapperClass(p.f64,B.F64),e.hasFeature(16)&&this.registerWrapperClass(p.v128,B.V128),e.hasFeature(256)&&(this.registerWrapperClass(p.func,B.RefFunc),this.registerWrapperClass(p.extern,B.RefExtern),e.hasFeature(1024)&&(this.registerWrapperClass(p.any,B.RefAny),this.registerWrapperClass(p.eq,B.RefEq),this.registerWrapperClass(p.struct,B.RefStruct),this.registerWrapperClass(p.array,B.RefArray),this.registerWrapperClass(p.i31,B.RefI31)),e.hasFeature(16384)&&this.registerWrapperClass(p.string,B.RefString));let o=this.resolver;for(let u=0,c=a.length;u<c;++u){let f=a[u],_=assert(f.extendsNode),d=o.resolveTypeName(_.name,null,f.parent);if(d){if(f.kind==6)if(d.kind==6){let m=d;m.hasDecorator(32)&&this.error(211,_.range,m.identifierNode.text),m.hasDecorator(16)!=f.hasDecorator(16)&&this.error(207,ue.join(f.identifierNode.range,_.range)),f.extends(m)?this.error(2506,m.identifierNode.range,m.identifierNode.text):f.basePrototype=m}else this.error(1311,_.range);else if(f.kind==8)if(d.kind==8){let m=d;f.extends(m)?this.error(2506,m.identifierNode.range,m.identifierNode.text):f.basePrototype=m}else this.error(2312,_.range)}}for(let u=0,c=a.length;u<c;u++){let f=a[u],_=f.instanceMembers;if(_){let d=Map_values(_);for(let m=0,h=d.length;m<h;m++){let b=d[m],A=b.declaration;if(A.is(8192)){let S=f.basePrototype,k=!1;for(;S;){let w=S.instanceMembers;if(w&&w.has(b.name)){k=!0;break}S=S.basePrototype}if(!k){let w=assert(f.basePrototype);this.error(4117,A.name.range,w.name)}}}}}for(let u=0,c=l.length;u<c;++u){let f=l[u],_=assert(f.implementsNodes);for(let d=0,m=_.length;d<m;++d){let h=_[d],b=o.resolveTypeName(h.name,null,f.parent);if(b)if(b.kind==8){let A=b,S=f.interfacePrototypes;S||(f.interfacePrototypes=S=new Array),S.push(A)}else this.error(2422,h.range)}}for(let u=0,c=a.length;u<c;++u){let f=a[u],_=f.basePrototype;_&&this.processOverrides(f,_)}for(let u=0,c=l.length;u<c;++u){let f=l[u],_=f.basePrototype,d=f.interfacePrototypes;if(_&&this.processOverrides(f,_),d)for(let m=0,h=d.length;m<h;++m)this.processOverrides(f,d[m])}{let u=e.globalAliases;u||(u=new Map),u.has(B.abort)||u.set(B.abort,g.abort),u.has(B.trace)||u.set(B.trace,g.trace),u.has(B.seed)||u.set(B.seed,g.seed),u.has(B.Math)||u.set(B.Math,B.NativeMath),u.has(B.Mathf)||u.set(B.Mathf,B.NativeMathf);for(let c=Map_keys(u),f=0,_=c.length;f<_;++f){let d=unchecked(c[f]),m=changetype(u.get(d));if(assert(m!=null),!m.length){this.elementsByName.delete(d);continue}let h=m.charCodeAt(0);if(h>=48&&h<=57)this.registerConstantInteger(d,p.i32,i64_new(parseInt(m,10)));else{let b=this.elementsByName;b.has(m)?b.set(d,assert(b.get(m))):this.error(111,null,m)}}}for(let u=Map_values(this.filesByName),c=0,f=u.length;c<f;++c){let _=unchecked(u[c]);_.source.sourceKind==1&&this.markModuleExports(_)}}processOverrides(e,t){let i=e.instanceMembers;if(i){let s=Map_values(i),a=null;do{let l=t.instanceMembers;if(l)for(let c=0,f=s.length;c<f;++c){let _=s[c];if(l.has(_.name)){let d=assert(l.get(_.name));this.doProcessOverride(e,_,t,d)}}let o=t.interfacePrototypes;if(o)for(let c=0,f=o.length;c<f;++c){let _=o[c];_!=t&&this.processOverrides(e,_)}let u=t.basePrototype;if(!u||(a||(a=new Set),a.add(t),a.has(u)))break;t=u}while(!0)}}doProcessOverride(e,t,i,s){if(!t.isAny(524800))if(t.kind==4&&s.kind==4){let a=t,l=s,o=a.is(65536),u=l.is(65536);if(o!=u){this.errorRelated(242,a.identifierNode.range,l.identifierNode.range,a.name);return}a.visibilityEquals(l)||this.errorRelated(2385,a.identifierNode.range,l.identifierNode.range),s.set(268435456);let c=l.unboundOverrides;c||(l.unboundOverrides=c=new Set),c.add(t);let f=l.instances;if(f)for(let _=Map_values(f),d=0,m=_.length;d<m;++d)_[d].set(268435456)}else if(t.kind==10&&s.kind==10){let a=t,l=s;if(a.visibilityEquals(l)||this.errorRelated(2385,a.identifierNode.range,l.identifierNode.range),l.parent.kind!=8){let c=a.isField;if(c!=l.isField){c?this.errorRelated(2610,a.identifierNode.range,l.identifierNode.range,a.name,i.internalName,e.internalName):this.errorRelated(2611,a.identifierNode.range,l.identifierNode.range,a.name,i.internalName,e.internalName);return}else if(c)return}l.set(268435456);let o=l.getterPrototype;if(o){o.set(268435456);let c=a.getterPrototype;if(c){let _=o.unboundOverrides;_||(o.unboundOverrides=_=new Set),_.add(c)}let f=o.instances;if(f)for(let _=Map_values(f),d=0,m=_.length;d<m;++d)_[d].set(268435456)}let u=l.setterPrototype;if(u&&a.setterPrototype){u.set(268435456);let c=a.setterPrototype;if(c){let _=u.unboundOverrides;_||(u.unboundOverrides=_=new Set),_.add(c)}let f=u.instances;if(f)for(let _=Map_values(f),d=0,m=_.length;d<m;++d)_[d].set(268435456)}}else this.errorRelated(2416,t.identifierNode.range,s.identifierNode.range,t.name,e.internalName,i.internalName)}lookup(e){let t=this.elementsByName;return t.has(e)?assert(t.get(e)):null}require(e,t){let i=this.lookup(e);if(!i)throw new Error(`Missing standard library component: ${e}`);if(i.kind!=t)throw Error(`Invalid standard library component kind: ${e}`);return i}requireGlobal(e){return this.require(e,0)}requireClass(e){let t=this.require(e,6),i=this.resolver.resolveClass(t,null);if(!i)throw new Error(`Invalid standard library class: ${e}`);return i}requireFunction(e,t=null){let i=this.require(e,4),s=this.resolver.resolveFunction(i,t);if(!s)throw new Error(`Invalid standard library function: ${e}`);return s}markModuleExports(e){let t=e.exports;if(t)for(let s=Map_values(t),a=0,l=s.length;a<l;++a){let o=unchecked(s[a]);this.markModuleExport(o)}let i=e.exportsStar;if(i)for(let s=0,a=i.length;s<a;++s)this.markModuleExports(i[s])}markModuleExport(e){switch(e.set(1048576),e.kind){case 6:{let i=e.instanceMembers;if(i)for(let s=Map_values(i),a=0,l=s.length;a<l;++a){let o=unchecked(s[a]);this.markModuleExport(o)}break}case 10:{let i=e,s=i.getterPrototype;s&&this.markModuleExport(s);let a=i.setterPrototype;a&&this.markModuleExport(a);break}case 11:case 5:case 7:assert(!1)}let t=e.members;if(t)for(let i=Map_values(t),s=0,a=i.length;s<a;++s){let l=unchecked(i[s]);this.markModuleExport(l)}}markModuleImport(e,t,i){i.set(2097152);let s=this.moduleImports,a;s.has(e)?a=assert(s.get(e)):(a=new Map,s.set(e,a)),a.set(t,i)}registerNativeType(e,t){let i=new lt(e,this.nativeFile,this.makeNativeTypeDeclaration(e,2),512);i.setType(t),this.nativeFile.add(e,i)}registerWrapperClass(e,t){let i=this.wrapperClasses;assert(!e.isInternalReference&&!i.has(e));let s=assert(this.lookup(t));assert(s.kind==6);let a=assert(this.resolver.resolveClass(s,null));a.wrappedType=e,i.set(e,a)}registerConstantInteger(e,t,i){assert(t.isIntegerInclReference);let s=new tn(e,this.nativeFile,1024,this.makeNativeVariableDeclaration(e,10));s.setConstantIntegerValue(i,t),this.nativeFile.add(e,s)}registerConstantFloat(e,t,i){assert(t.isFloatValue);let s=new tn(e,this.nativeFile,1024,this.makeNativeVariableDeclaration(e,10));s.setConstantFloatValue(i,t),this.nativeFile.add(e,s)}ensureGlobal(e,t){let i=this.elementsByName;if(i.has(e)){let s=assert(i.get(e));if(s!=t){let a=Cf(s,t);if(!a)return Us(s.kind)?this.errorRelated(2300,t.identifierNode.range,s.declaration.name.range,e):this.error(2300,t.identifierNode.range,e),t;t=a}}return i.set(e,t),t}lookupForeignFile(e,t){let i=this.filesByName;return i.has(e)?assert(i.get(e)):i.has(t)?assert(i.get(t)):null}lookupForeign(e,t,i){do{let a=t.lookupExport(e);if(a)return a;if(i.has(t)){let l=assert(i.get(t));if(l.has(e)){let o=assert(l.get(e)),u=o.foreignPath;if(u){let c=this.lookupForeignFile(u,assert(o.foreignPathAlt));if(!c)return null;e=o.localIdentifier.text,t=c;continue}if(a=t.getMember(o.localIdentifier.text),a)return a}}break}while(!0);let s=t.exportsStar;if(s)for(let a=0,l=s.length;a<l;++a){let o=this.lookupForeign(e,s[a],i);if(o)return o}return null}checkDecorators(e,t){let i=0;if(e)for(let s=0,a=e.length;s<a;++s){let l=e[s],o=Ct.fromNode(l.name),u=Lt.fromKind(o);u&&(t&u?i&u?this.error(213,l.range):i|=u:this.error(212,l.range,l.name.range.toString()))}return i}checkFeatureEnabled(e,t){return this.options.hasFeature(e)?!0:(this.error(103,t.range,Gn(e)),!1)}checkTypeSupported(e,t){switch(e.kind){case 13:return this.checkFeatureEnabled(16,t);case 16:case 15:return e.is(512)?this.checkFeatureEnabled(256,t):this.checkFeatureEnabled(1024,t);case 17:case 18:case 19:case 20:case 21:return this.checkFeatureEnabled(256,t)&&this.checkFeatureEnabled(1024,t);case 22:case 23:case 24:case 25:return this.checkFeatureEnabled(256,t)&&this.checkFeatureEnabled(16384,t)}let i=e.getClass();if(i)do{let s=i.typeArguments;if(s){for(let a=0,l=s.length;a<l;++a)if(!this.checkInlineStructValue(s[a],t,"a type argument (Array<T>)")||!this.checkTypeSupported(s[a],t))return!1}i=i.base}while(i);else{let s=e.getSignature();if(s){let a=s.thisType;if(a&&!this.checkTypeSupported(a,t))return!1;let l=s.parameterTypes;for(let u=0,c=l.length;u<c;++u)if(!this.checkTypeSupported(l[u],t))return!1;let o=s.returnType;if(!this.checkTypeSupported(o,t))return!1}}return!0}checkInlineStructValue(e,t,i){let s=e.getClass();return s!=null&&s.hasDecorator(4096)?(this.error(100,t.range,i=="a global"?"an @inline struct at top level (a global is a pointer slot, so two values would alias; declare it inside a function)":"an @inline struct value in "+i+" (value types are not implemented here yet; a pointer would alias)"),!1):!0}initializeClass(e,t,i,s){let a=e.name.text,l=e.declaredAsStruct&&X1(e.decorators,64),o=new qs(a,t,e,this.checkDecorators(e.decorators,49|(e.declaredAsStruct?2112:0)));if(!t.add(a,o))return null;l&&(o.decoratorFlags|=4096),(o.hasDecorator(2048)||o.hasDecorator(4096))&&(o.decoratorFlags|=32);let u=e.implementsTypes;if(u){let f=u.length;f&&(o.hasDecorator(16)?this.error(208,ue.join(e.name.range,u[f-1].range)):s.push(o))}e.extendsType?o.hasDecorator(4096)?this.error(100,ue.join(e.name.range,assert(e.extendsType).range),"inheritance on an @inline struct (a value type is final: no base class, no virtual methods)"):o.hasDecorator(2048)?this.error(100,ue.join(e.name.range,assert(e.extendsType).range),"inheritance on an @managed struct (its fields must stay at fixed offsets from the reference)"):i.push(o):!o.hasDecorator(16)&&o.internalName!=g.Object&&(o.implicitlyExtendsObject=!0);let c=e.members;for(let f=0,_=c.length;f<_;++f){let d=c[f];switch(d.kind){case 58:{this.initializeField(d,o);break}case 62:{let m=d;if(m.is(128)&&m.is(65536)&&this.error(241,m.name.range,m.name.text),d.isAny(6144))this.initializeProperty(m,o);else{let h=this.initializeMethod(m,o);h&&m.name.kind==28&&(o.constructorPrototype=h)}break}case 69:break;default:assert(!1)}}return o}initializeField(e,t){let i=e.name.text,s=e.decorators,a,l=8192;if(t.is(32768)&&(l|=128),e.is(32)){if(assert(t.kind!=8),l|=1024,e.is(64)&&(l|=64),a=new tn(i,t,this.checkDecorators(s,l),e),!t.add(i,a))return}else if(assert(!e.isAny(6272)),a=ai.forField(i,t,e,this.checkDecorators(s,l)),!t.addInstance(i,a))return}initializeMethod(e,t){let i=e.name.text,s=e.is(32),a=8256;e.is(65536)||(a|=14),t.is(32768)&&(a|=128),e.range.source.isLibrary&&(a|=512);let l=new ot(i,t,e,this.checkDecorators(e.decorators,a));if(l.hasDecorator(512)&&!E.has(l.internalName)&&this.error(100,e.range,`Builtin '${l.internalName}'`),s){if(assert(e.name.kind!=28),!t.add(i,l))return null}else if(!t.addInstance(i,l))return null;return this.checkOperatorOverloads(e.decorators,l,t),l}checkOperatorOverloads(e,t,i){if(e)for(let s=0,a=e.length;s<a;++s){let l=e[s];switch(l.decoratorKind){case 2:case 3:case 4:case 5:{let o=l.args,u=o?o.length:0;if(u==1){let c=l.args[0];if(c.isLiteralKind(2)){let f=c.value,_=Me.fromDecorator(l.decoratorKind,f);if(_==0)this.error(224,c.range,f);else{let d=i.operatorOverloadPrototypes;d.has(_)?this.error(2393,c.range):(t.operatorKind=_,d.set(_,t))}}else this.error(1141,c.range)}else this.error(2554,l.range,"1",u.toString())}}}}ensureProperty(e,t){let i=e.name.text;if(e.is(32)){let s=t.members;if(s&&s.has(i)){let a=assert(s.get(i));if(a.kind==10)return a}else{let a=new ai(i,t,e);return t.add(i,a)?a:null}}else{let s=t.instanceMembers;if(s&&s.has(i)){let a=assert(s.get(i));if(a.kind==10)return a}else{let a=new ai(i,t,e);return t.addInstance(i,a)?a:null}}return this.error(2718,e.name.range,i),null}initializeProperty(e,t){let i=this.ensureProperty(e,t);if(!i)return;let s=e.name.text,a=e.is(2048);if(a){if(i.getterPrototype){this.error(2718,e.name.range,s);return}}else if(i.setterPrototype){this.error(2718,e.name.range,s);return}let l=new ot((a?nl:il)+s,i.parent,e,this.checkDecorators(e.decorators,8256));a?i.getterPrototype=l:i.setterPrototype=l}initializeEnum(e,t){let i=e.name.text,s=new tu(i,t,e,this.checkDecorators(e.decorators,1089));if(!t.add(i,s))return null;let a=e.values;for(let l=0,o=a.length;l<o;++l)this.initializeEnumValue(a[l],s);return s}initializeEnumValue(e,t){let i=e.name.text,s=new ru(i,t,e,this.checkDecorators(e.decorators,0));t.add(i,s)}initializeExports(e,t,i,s){let a=e.members;if(a)for(let l=0,o=a.length;l<o;++l)this.initializeExport(a[l],t,e.internalPath,i);else{let l;s.has(t)?l=assert(s.get(t)):s.set(t,l=[]);let o=e.internalPath;l.push(new vf(o,o.endsWith(Qe)?o.substring(0,o.length-Qe.length):o+Qe,assert(e.path)))}}initializeExport(e,t,i,s){let a=e.localName.text,l=e.exportedName.text,o=t.lookupExport(l);if(o){this.error(2484,e.exportedName.range,l);return}if(i==null)if(o=t.getMember(a))t.ensureExport(l,o);else{let u;s.has(t)?u=assert(s.get(t)):s.set(t,u=new Map),u.set(l,new eu(e.localName,e.exportedName,null,null))}else{let u;s.has(t)?u=assert(s.get(t)):s.set(t,u=new Map),u.set(l,new eu(e.localName,e.exportedName,i,i.endsWith(Qe)?i.substring(0,i.length-Qe.length):i+Qe))}}initializeExportDefault(e,t,i,s){let a=e.declaration,l=null;switch(a.kind){case 56:{l=this.initializeEnum(a,t);break}case 59:{l=this.initializeFunction(a,t);break}case 55:{l=this.initializeClass(a,t,i,s);break}case 61:{l=this.initializeInterface(a,t,i);break}case 63:{l=this.initializeNamespace(a,t,i,s);break}default:assert(!1)}if(l){let o=t.exports;if(!o)t.exports=o=new Map;else if(o.has("default")){let u=assert(o.get("default"));this.errorRelated(2300,a.name.range,u.declaration.name.range,"default");return}o.set("default",l)}}initializeImports(e,t,i,s){let a=e.declarations;if(a)for(let l=0,o=a.length;l<o;++l)this.initializeImport(a[l],t,e.internalPath,i,s);else{let l=e.namespaceName;l&&i.push(new Jo(t,l,null,e.internalPath,e.internalPath+Qe))}}initializeImport(e,t,i,s,a){let l=i.endsWith(Qe)?i.substring(0,i.length-Qe.length):i+Qe,o=this.lookupForeignFile(i,l);if(o){let u=this.lookupForeign(e.foreignName.text,o,a);if(u){t.add(e.name.text,u,e.name);return}}s.push(new Jo(t,e.name,e.foreignName,i,l))}initializeFunction(e,t){let i=e.name.text,s=8192;e.is(32768)?s|=384:(s|=64,(e.range.source.isLibrary||e.is(2))&&(s|=1024)),e.is(262144)||t.kind!=6&&(s|=1),e.range.source.isLibrary&&(s|=512);let a=new ot(i,t,e,this.checkDecorators(e.decorators,s));return a.hasDecorator(512)&&!E.has(a.internalName)&&this.error(100,e.range,`Builtin '${a.internalName}'`),t.add(i,a)?a:null}initializeInterface(e,t,i){let s=e.name.text,a=new nu(s,t,e,this.checkDecorators(e.decorators,1));if(!t.add(s,a))return null;e.extendsType&&i.push(a);let l=e.members;for(let o=0,u=l.length;o<u;++o){let c=l[o];switch(c.kind){case 58:{this.initializeFieldAsProperty(c,a);break}case 62:{let f=c;f.is(65536)&&this.error(241,f.name.range,f.name.text),c.isAny(6144)?this.initializeProperty(f,a):this.initializeMethod(f,a);break}default:assert(!1)}}return a}initializeFieldAsProperty(e,t){let i=e.initializer;i&&this.error(1246,i.range);let s=e.type;s||(s=y.createOmittedType(e.name.range.atEnd)),this.initializeProperty(y.createMethodDeclaration(e.name,e.decorators,e.flags|2048,null,y.createFunctionType([],s,null,!1,e.range),null,e.range),t),e.is(64)||this.initializeProperty(y.createMethodDeclaration(e.name,e.decorators,e.flags|4096,null,y.createFunctionType([y.createParameter(0,e.name,s,null,e.name.range)],y.createOmittedType(e.name.range.atEnd),null,!1,e.range),null,e.range),t)}initializeNamespace(e,t,i,s){let a=e.name.text,l=new Os(a,t,e,this.checkDecorators(e.decorators,1));if(!t.add(a,l))return null;let o=assert(t.getMember(a)),u=e.members;for(let c=0,f=u.length;c<f;++c){let _=u[c];switch(_.kind){case 55:{this.initializeClass(_,l,i,s);break}case 56:{this.initializeEnum(_,l);break}case 59:{this.initializeFunction(_,l);break}case 61:{this.initializeInterface(_,l,i);break}case 63:{this.initializeNamespace(_,l,i,s);break}case 64:{this.initializeTypeDefinition(_,l);break}case 51:{this.initializeVariables(_,l);break}default:assert(!1)}}return l!=o&&rr(l,o),o}initializeTypeDefinition(e,t){let i=e.name.text,s=new lt(i,t,e,this.checkDecorators(e.decorators,0));t.add(i,s)}initializeVariables(e,t){let i=e.declarations;for(let s=0,a=i.length;s<a;++s){let l=i[s],o=l.name.text,u=1025;l.is(32768)&&(u|=128),l.is(8)&&(u|=64),l.range.source.isLibrary&&(u|=512);let c=new tn(o,t,this.checkDecorators(l.decorators,u),l);c.hasDecorator(512)&&!At.has(c.internalName)&&this.error(100,l.range,`Builtin '${c.internalName}'`),t.add(o,c)}}},Et=(b=>(b[b.Global=0]="Global",b[b.Local=1]="Local",b[b.Enum=2]="Enum",b[b.EnumValue=3]="EnumValue",b[b.FunctionPrototype=4]="FunctionPrototype",b[b.Function=5]="Function",b[b.ClassPrototype=6]="ClassPrototype",b[b.Class=7]="Class",b[b.InterfacePrototype=8]="InterfacePrototype",b[b.Interface=9]="Interface",b[b.PropertyPrototype=10]="PropertyPrototype",b[b.Property=11]="Property",b[b.Namespace=12]="Namespace",b[b.File=13]="File",b[b.TypeDefinition=14]="TypeDefinition",b[b.IndexSignature=15]="IndexSignature",b))(Et||{}),Lt=(h=>(h[h.None=0]="None",h[h.Global=1]="Global",h[h.OperatorBinary=2]="OperatorBinary",h[h.OperatorPrefix=4]="OperatorPrefix",h[h.OperatorPostfix=8]="OperatorPostfix",h[h.Unmanaged=16]="Unmanaged",h[h.Final=32]="Final",h[h.Inline=64]="Inline",h[h.ManagedStruct=2048]="ManagedStruct",h[h.External=128]="External",h[h.ExternalJs=256]="ExternalJs",h[h.Builtin=512]="Builtin",h[h.Lazy=1024]="Lazy",h[h.InlineStruct=4096]="InlineStruct",h[h.Unsafe=8192]="Unsafe",h))(Lt||{});(r=>{function n(e){switch(e){case 1:return 1;case 2:case 3:return 2;case 4:return 4;case 5:return 8;case 6:return 16;case 7:return 2048;case 8:return 32;case 9:return 64;case 10:return 128;case 11:return 256;case 12:return 512;case 13:return 1024;case 14:return 8192;default:return 0}}r.fromKind=n})(Lt||={});var Gs=class{constructor(r,e,t,i,s){this.kind=r;this.name=e;this.internalName=t;this.program=i;this.flags=0;this.decoratorFlags=0;this.members=null;this.shadowType=null;this.program=i,this.name=e,this.internalName=t,s?this.parent=s:(assert(this.kind==13),this.parent=this)}get file(){let r=this;do if(r=r.parent,r.kind==13)return r;while(!0)}is(r){return(this.flags&r)==r}isAny(r){return(this.flags&r)!=0}set(r){this.flags|=r}unset(r){this.flags&=~r}hasDecorator(r){return(this.decoratorFlags&r)==r}hasAnyDecorator(r){return(this.decoratorFlags&r)!=0}getMember(r){let e=this.members;return e&&e.has(r)?assert(e.get(r)):null}lookup(r,e=!1){return this.parent.lookup(r,e)}add(r,e,t=null){let i=e.declaration,s=this.members;if(!s)this.members=s=new Map;else if(s.has(r)){let l=assert(s.get(r));if(l.parent==this){let o=Cf(l,e);if(o)e=o;else{let u=t||e.identifierNode;return Us(l.kind)?this.program.errorRelated(2300,u.range,l.identifierNode.range,u.text):this.program.error(2300,u.range,u.text),!1}}}s.set(r,e);let a=this.program;return(e.kind!=4||!e.isBound)&&(a.elementsByName.set(e.internalName,e),a.elementsByDeclaration.set(i,e)),!0}get isPublic(){return!this.isAny(1536)}get isImplicitlyPublic(){return this.isPublic&&!this.is(256)}visibilityEquals(r){if(this.isPublic==r.isPublic)return!0;let e=1536;return(this.flags&e)==(r.flags&e)}visibilityNoLessThan(r){return this.isPublic?!0:this.is(512)?r.is(512):this.is(1024)?r.isAny(1536):assert(!1)}get isBound(){switch(this.parent.kind){case 7:case 9:return!0}return!1}getBoundClassOrInterface(){let r=this.parent;switch(r.kind){case 7:case 9:return r}return null}toString(){return`${this.internalName}, kind=${this.kind}`}},sx=new Set;function Us(n){return sx.has(n)}var Tr=class extends Gs{constructor(e,t,i,s,a,l){super(e,t,i,s,a);this.declaration=l;sx.add(e),this.declaration=l,this.flags=l.flags}get isDeclaredInLibrary(){return this.declaration.range.source.isLibrary}get identifierNode(){return this.declaration.name}get identifierAndSignatureRange(){let e=this.declaration,t=e.name;if(e.kind==59||e.kind==62){let i=e.signature;if(t.range.source==i.range.source)return ue.join(t.range,i.range)}return t.range}get decoratorNodes(){return this.declaration.decorators}},ax=new Set;function Xo(n){return ax.has(n)}var nr=class extends Tr{constructor(e,t,i,s,a,l){super(e,t,i,s,a,l);this.type=p.void;ax.add(e)}setType(e){assert(!this.is(4194304)),this.type=e,this.set(4194304)}refineType(e){this.type=e,this.set(4194304)}},Vs=class extends Gs{constructor(e,t){super(13,t.normalizedPath,t.internalPath,e,null);this.source=t;this.exports=null;this.exportsStar=null;this.aliasNamespaces=new Array;this.source=t,assert(!e.filesByName.has(this.internalName)),e.filesByName.set(this.internalName,this);let i=this.program.makeNativeFunction(`start:${this.internalName}`,fe.create(e,[],p.void),this);i.internalName=i.name,this.startFunction=i}add(e,t,i=null){return t.hasDecorator(1)&&(t=this.program.ensureGlobal(e,t)),super.add(e,t,i)?(t=assert(this.getMember(e)),t.is(2)&&!i&&this.ensureExport(t.name,t),!0):!1}getMember(e){let t=super.getMember(e);if(t)return t;let i=this.exportsStar;if(i){for(let s=0,a=i.length;s<a;++s)if(t=i[s].getMember(e))return t}return null}lookup(e,t=!1){let i=this.getMember(e);return i||this.program.lookup(e)}ensureExport(e,t){let i=this.exports;i||(this.exports=i=new Map),i.set(e,t),this.source.sourceKind==3&&this.program.ensureGlobal(e,t);for(let s=0;s<this.aliasNamespaces.length;s++)this.aliasNamespaces[s].add(e,t)}ensureExportStar(e){let t=this.exportsStar;if(!t)this.exportsStar=t=[];else if(t.includes(e))return;t.push(e)}lookupExport(e){let t=this.exports;if(t&&t.has(e))return assert(t.get(e));let i=this.exportsStar;if(i)for(let s=0,a=i.length;s<a;++s){let l=i[s].lookupExport(e);if(l)return l}return null}asAliasNamespace(e,t,i){let s=this.program.makeNativeNamespaceDeclaration(e);s.name=i;let a=new Os(e,t,s);return a.set(67108864),this.copyExportsToNamespace(a),this.aliasNamespaces.push(a),a}copyExportsToNamespace(e){let t=this.exports;if(t)for(let s=Map_keys(t),a=0,l=s.length;a<l;++a){let o=unchecked(s[a]),u=assert(t.get(o));e.add(o,u)}let i=this.exportsStar;if(i)for(let s=0,a=i.length;s<a;++s)i[s].copyExportsToNamespace(e)}},lt=class extends nr{constructor(r,e,t,i=0){super(14,r,Ke(r,e,!1),e.program,e,t),this.decoratorFlags=i}get typeParameterNodes(){return this.declaration.typeParameters}get typeNode(){return this.declaration.type}},Os=class extends Tr{constructor(r,e,t,i=0){super(12,r,Ke(r,e,!1),e.program,e,t),this.decoratorFlags=i}lookup(r,e=!1){let t=this.getMember(r);return t||super.lookup(r,e)}},tu=class extends nr{constructor(e,t,i,s=0){super(2,e,Ke(e,t,!1),t.program,t,i);this.toStringFunctionName=null;this.underlyingTypeResolved=!1;this.underlyingTypeResolving=!1;this.decoratorFlags=s,this.setType(p.i32)}lookup(e,t=!1){let i=this.getMember(e);return i||super.lookup(e,t)}},wf=(t=>(t[t.None=0]="None",t[t.Integer=1]="Integer",t[t.Float=2]="Float",t))(wf||{}),rn=class extends nr{constructor(e,t,i,s=i.program.makeNativeVariableDeclaration(t)){super(e,t,Ke(t,i,s.is(262144)),i.program,i,s);this.constantValueKind=0;this.constantIntegerValue=i64_zero;this.constantFloatValue=0;this.flags=s.flags}get typeNode(){return this.declaration.type}get initializerNode(){return this.declaration.initializer}setConstantIntegerValue(e,t){assert(t.isIntegerInclReference),this.type=t,this.constantValueKind=1,this.constantIntegerValue=e,this.set(37748744)}setConstantFloatValue(e,t){assert(t.isFloatValue),this.type=t,this.constantValueKind=2,this.constantFloatValue=e,this.set(37748744)}},ru=class extends rn{constructor(e,t,i,s=0){super(3,e,t,i);this.isImmutable=!1;this.decoratorFlags=s,this.setType(t.type)}get valueNode(){return this.declaration.initializer}},tn=class extends rn{constructor(r,e,t,i=e.program.makeNativeVariableDeclaration(r)){super(0,r,e,i),this.decoratorFlags=t}},If=class{constructor(r,e,t=null){this.name=r;this.type=e;this.initializer=t}},ce=class extends rn{constructor(e,t,i,s,a=s.program.makeNativeVariableDeclaration(e)){super(1,e,s,a);this.index=t;this.fieldLocals=null;this.typeRefOverride=P.None;this.isViewParam=!1;this.isViewLocal=!1;this.isDynamicLength=!1;this.originalName=e,this.index=t,assert(i!=p.void),this.setType(i)}declaredByFlow(e){return this.parent==e.targetFunction}},ot=class n extends Tr{constructor(e,t,i,s=0){super(4,e,Ke(e,t,i.is(262144)),t.program,t,i);this.operatorKind=0;this.capturesThis=!1;this.envKind=0;this.envClass=null;this.instances=null;this.unboundOverrides=null;this.boundPrototypes=null;this.decoratorFlags=s}get typeParameterNodes(){return this.declaration.typeParameters}get functionTypeNode(){return this.declaration.signature}get bodyNode(){return this.declaration.body}get arrowKind(){return this.declaration.arrowKind}get isAsync(){return this.declaration.isAsync&&!this.isAny(530432)}toBound(e){assert(this.is(262144)),assert(!this.isBound);let t=this.boundPrototypes;if(!t)this.boundPrototypes=t=new Map;else if(t.has(e))return assert(t.get(e));let i=this.declaration;assert(i.kind==62);let s=new n(this.name,e,i,this.decoratorFlags);return s.flags=this.flags,s.operatorKind=this.operatorKind,s.unboundOverrides=this.unboundOverrides,t.set(e,s),s}getResolvedInstance(e){let t=this.instances;return t&&t.has(e)?assert(t.get(e)):null}setResolvedInstance(e,t){let i=this.instances;i?assert(!i.has(e)):this.instances=i=new Map,i.set(e,t)}},Mt=class n extends nr{constructor(e,t,i,s,a=null){super(5,e,Ke(e,t.parent,t.is(262144)),t.program,t.parent,t.declaration);this.localsByIndex=[];this.debugLocations=new Map;this.ref=0;this.tableIndex=0;this.varargsStub=null;this.overrideStub=null;this.memorySegment=null;this.nextInlineId=0;this.nextAnonymousId=0;this.nextBreakId=0;this.breakStack=null;this.prototype=t,this.typeArguments=i,this.signature=s,this.flags=t.flags|4194304,this.decoratorFlags=t.decoratorFlags,this.contextualTypeArguments=a,this.original=this;let l=t.program;this.type=s.type;let o=er.createDefault(this);if(this.flow=o,!t.is(32768)){let u=0,c=s.thisType;if(c){let d=new ce(B.this_,u++,c,this),m=this.flow.scopedLocals;m||(this.flow.scopedLocals=m=new Map),m.set(B.this_,d),this.localsByIndex[d.index]=d,o.setLocalFlag(d.index,8)}if(s.hasHiddenDestParam){let d=new ce("$sretDest",u++,p.u32,this);this.localsByIndex[d.index]=d,o.setLocalFlag(d.index,8)}let f=s.parameterTypes,_=null;for(let d=0,m=f.length;d<m;++d){let h=f[d],b=this.getParameterName(d);if(s.isExportByValParam(d)){let k=this.flow.scopedLocals;k||(this.flow.scopedLocals=k=new Map);let w=new ce(b+"$byval",u++,p.u32,this);this.localsByIndex[w.index]=w,o.setLocalFlag(w.index,8),k.set(b+"$byval",w),_||(_=new Array),unchecked(_[_.length]=new kf(d,b,h,new Map));continue}if(s.isViewParam(d)){let k=this.flow.scopedLocals;k||(this.flow.scopedLocals=k=new Map);let w=new ce(b,u++,h,this);w.isViewParam=!0,this.localsByIndex[w.index]=w,o.setLocalFlag(w.index,8),k.set(b,w);continue}if(h.kind==14&&(h.fixedMemoryModel==0||h.fixedMemoryModel==1)){let k=this.flow.scopedLocals;k||(this.flow.scopedLocals=k=new Map);let w=new Map,R=this.bindSroaArrayParameterLeaves(h,b,w,u,o);u+=R.leafCount;let C=new ce(b,-1,h,this);C.fieldLocals=w,k.set(b,C);continue}if(fe.isInlineStructRef(h)){let k=this.flow.scopedLocals;k||(this.flow.scopedLocals=k=new Map);let w=new Map,R=this.bindSroaParameterLeaves(h,b,w,u,o);u+=R.leafCount;let C=new ce(b,-1,h,this);C.fieldLocals=w,k.set(b,C);continue}let A=new ce(b,u++,h,this),S=this.flow.scopedLocals;S||(this.flow.scopedLocals=S=new Map),S.set(b,A),this.localsByIndex[A.index]=A,o.setLocalFlag(A.index,8)}{let m=t.declaration.signature.parameters,h=null;for(let b=0,A=s.parameterTypes.length;b<A&&!(b>=m.length);++b){let S=m[b].type;if(S==null||S.kind!=72)continue;let k=S.lengthName.text;if(h!=null){l.error(2300,S.lengthName.range,k);continue}h=k;let w=this.flow.scopedLocals;if(w!=null&&w.has(k)){l.error(2300,S.lengthName.range,k);continue}let R=this.parent.lookup(k);if(R!=null&&R.kind==0&&R.is(8)){l.error(100,S.lengthName.range,"[T * N] where N is a compile-time constant \u2014 use [T * <literal>] for a static array or [T * n] (runtime identifier) for a dynamic array");continue}let C=new ce(k,u++,p.i32,this);C.isDynamicLength=!0,this.localsByIndex[C.index]=C;let M=this.flow.scopedLocals;M||(this.flow.scopedLocals=M=new Map),M.set(k,C)}}if(_)for(let d=0,m=_.length;d<m;++d){let h=unchecked(_[d]),b=h.parameterName,A=h.parameterType,S=h.fieldLocals,k=assert(A.classReference),w=assert(k.members);for(let M=Map_values(w),O=0,D=M.length;O<D;++O){let Q=unchecked(M[O]);if(Q.kind!=10)continue;let H=Q.instance;if(H==null||!H.isField)continue;let U=new ce(b+"$"+H.name,u++,H.type,this);S.set(H.name,U),this.localsByIndex[U.index]=U,o.setLocalFlag(U.index,8)}let R=new ce(b,-1,A,this);R.fieldLocals=S;let C=this.flow.scopedLocals;C||(this.flow.scopedLocals=C=new Map),C.set(b,R)}}l.instancesByName.has(this.internalName)?(l.error(2393,t.declaration.name.range),this.set(16777216)):Rf(l,this)}bindSroaParameterLeaves(e,t,i,s,a){let l=assert(e.classReference),o=assert(l.members),u=0;for(let c=Map_values(o),f=0,_=c.length;f<_;++f){let d=unchecked(c[f]);if(d.kind!=10)continue;let m=d.instance;if(m==null||!m.isField)continue;let h=t+"$"+m.name,b=m.type;if(fe.isInlineStructRef(b)){let S=new Map,k=this.bindSroaParameterLeaves(b,h,S,s+u,a);u+=k.leafCount;let w=new ce(h,-1,b,a.sourceFunction);w.fieldLocals=S,i.set(m.name,w);continue}let A=new ce(h,s+u,b,a.sourceFunction);this.localsByIndex[A.index]=A,a.setLocalFlag(A.index,8),i.set(m.name,A),++u}return new zs(u)}bindSroaArrayParameterLeaves(e,t,i,s,a){let l=assert(e.fixedElementType),o=l.classReference,u=o!=null&&(o.hasDecorator(16)||o.hasDecorator(2048)),c=0;for(let f=0,_=e.fixedLength;f<_;++f){let d=t+"$"+f.toString();if(u){let h=new Map,b=this.bindSroaParameterLeaves(l,d,h,s+c,a);c+=b.leafCount;let A=new ce(d,-1,l,a.sourceFunction);A.fieldLocals=h,i.set(f.toString(),A);continue}let m=new ce(d,s+c,l,a.sourceFunction);this.localsByIndex[m.index]=m,a.setLocalFlag(m.index,8),i.set(f.toString(),m),++c}return new zs(c)}getNonParameterLocalTypeRefs(){let e=this.localsByIndex,t=this.signature,i=e.length,s=t.wasmParamCount();t.thisType&&++s;let a=i-s,l=new Array(a);for(let o=0;o<a;++o){let u=e[s+o],c=u.typeRefOverride;if(c!=P.None){l[o]=c;continue}l[o]=u.isViewLocal?this.program.options.usizeType.toRef():u.type.toRef()}return l}getParameterName(e){let t=this.declaration.signature.parameters;return t.length>e?t[e].name.text:lx(e)}newStub(e,t=this.signature.requiredParameters){let i=new n(this.original.name+Dp+e,this.prototype,this.typeArguments,this.signature.clone(t),this.contextualTypeArguments);return i.original=this.original,i.set(this.flags&-8388609|134217728),i}addLocal(e,t=null,i=null){let s=this.localsByIndex,a=s.length,l=t??a.toString();i||(i=this.program.makeNativeVariableDeclaration(l));let o=new ce(l,a,e,this,i);if(t){let u=this.flow,c=u.scopedLocals;if(c||(u.scopedLocals=c=new Map),c.has(t))throw new Error("duplicate local name");c.set(t,o)}return s[a]=o,o}lookup(e,t=!1){if(!t){let i=this.flow.scopedLocals;if(i&&i.has(e))return assert(i.get(e))}return super.lookup(e,t)}finalize(e,t){this.ref=t;let i=this.breakStack;assert(!i||!i.length),this.breakStack=null,this.addDebugInfo(e,t)}addDebugInfo(e,t){if(this.program.options.sourceMap){let i=this.debugLocations;for(let s=Map_keys(i),a=0,l=s.length;a<l;++a){let o=s[a],u=assert(i.get(o)),c=u.source;e.setDebugLocation(t,o,c.debugInfoIndex,c.lineAt(u.start),c.columnAt()-1)}}if(this.program.options.debugInfo){let i=new Set,s=this.localsByIndex;for(let a=0,l=s.length;a<l;a++){let o=s[a].name;i.has(o)&&(o=`${o}|${a}`),i.add(o),e.setLocalName(t,a,o)}}}},ai=class n extends Tr{constructor(e,t,i){super(10,e,Ke(e,t,i.is(262144)),t.program,t,i);this.fieldDeclaration=null;this.getterPrototype=null;this.setterPrototype=null;this.instance=null;this.boundPrototypes=null;this.flags&=-6145}static forField(e,t,i,s){let a=Te.native.range,l=i.type;l||(l=y.createOmittedType(i.name.range.atEnd));let o=new Jr(i.name,i.decorators,i.flags|262144|2048,null,new Zr([],l,null,!1,a),null,a),u=new Jr(i.name,i.decorators,i.flags|262144|4096,null,new Zr([new Zn(0,i.name,l,null,a)],new $r(new $n(new rt("",!1,a),null,a),null,!1,a),null,!1,a),null,a),c=new n(e,t,o);return c.fieldDeclaration=i,c.decoratorFlags=s,c.getterPrototype=new ot(nl+e,t,o,s),c.setterPrototype=new ot(il+e,t,u,s),c}get isField(){return this.fieldDeclaration!=null}get typeNode(){let e=this.fieldDeclaration;if(e)return e.type;let t=this.getterPrototype;if(t){let s=t.declaration;if(s.kind==59)return s.signature.returnType}let i=this.setterPrototype;if(i){let s=i.declaration;if(s.kind==59){let a=s.signature.parameters;if(a.length)return a[0].type}}return null}get initializerNode(){let e=this.fieldDeclaration;return e?e.initializer:null}get parameterIndex(){let e=this.fieldDeclaration;return e?e.parameterIndex:-1}get thisType(){let e=this.parent;return assert(e.kind==7),e.type}toBound(e){assert(this.is(262144)),assert(!this.isBound);let t=this.boundPrototypes;if(!t)this.boundPrototypes=t=new Map;else if(t.has(e))return assert(t.get(e));let i=this.declaration;assert(i.kind==62);let s=new n(this.name,e,i);s.flags=this.flags,s.fieldDeclaration=this.fieldDeclaration;let a=this.getterPrototype;a&&(s.getterPrototype=a.toBound(e));let l=this.setterPrototype;return l&&(s.setterPrototype=l.toBound(e)),t.set(e,s),s}},Cs=class extends rn{constructor(e,t){super(11,e.name,t,e.isField?assert(e.fieldDeclaration):y.createVariableDeclaration(e.identifierNode,null,e.flags&262144,null,null,e.identifierNode.range));this.getterInstance=null;this.setterInstance=null;this.memoryOffset=-1;this.prototype=e,this.flags=e.flags,this.decoratorFlags=e.decoratorFlags,this.is(262144)&&Rf(this.program,this)}get isField(){return this.prototype.isField}checkVisibility(e){let t=this.getterInstance,i=this.setterInstance;t&&i&&!t.visibilityNoLessThan(i)&&e.errorRelated(2808,t.identifierNode.range,i.identifierNode.range,t.identifierNode.text)}},Ps=class extends nr{constructor(r){super(15,"[]",r.internalName+"[]",r.program,r,r.program.makeNativeVariableDeclaration("[]"))}getGetterInstance(r){return this.parent.lookupOverload(1,r)}getSetterInstance(r){return this.parent.lookupOverload(2,r)}};function X1(n,r){if(!n)return!1;for(let e=0,t=n.length;e<t;++e)if(Lt.fromKind(n[e].decoratorKind)&r)return!0;return!1}var qs=class extends Tr{constructor(e,t,i,s=0,a=!1){super(a?8:6,e,Ke(e,t,i.is(262144)),t.program,t,i);this.instanceMembers=null;this.basePrototype=null;this.interfacePrototypes=null;this.constructorPrototype=null;this.operatorOverloadPrototypes=new Map;this.instances=null;this.extenders=new Set;this.implicitlyExtendsObject=!1;this.decoratorFlags=s}get typeParameterNodes(){return this.declaration.typeParameters}get extendsNode(){return this.declaration.extendsType}get implementsNodes(){return this.declaration.implementsTypes}get isBuiltinArray(){let e=this.program.arrayBufferViewInstance;return e&&this.extends(e.prototype)}extends(e){let t=this,i=new Set;do{if(i.has(t))break;if(i.add(t),t==e)return!0;t=t.basePrototype}while(t);return!1}addInstance(e,t){let i=t.declaration,s=this.instanceMembers;if(!s)this.instanceMembers=s=new Map;else if(s.has(e)){let a=assert(s.get(e)),l=Cf(a,t);if(!l)return Us(a.kind)?this.program.errorRelated(2300,t.identifierNode.range,a.declaration.name.range,t.identifierNode.text):this.program.error(2300,t.identifierNode.range,t.identifierNode.text),!1;t=l}return s.set(e,t),t.is(2)&&this.is(1048576)&&t.set(1048576),this.program.elementsByDeclaration.set(i,t),!0}getResolvedInstance(e){let t=this.instances;return t&&t.has(e)?t.get(e):null}setResolvedInstance(e,t){let i=this.instances;i?assert(!i.has(e)):this.instances=i=new Map,i.set(e,t)}},Ar=class extends nr{constructor(e,t,i=null,s=!1){super(s?9:7,e,Ke(e,t.parent,t.is(262144)),t.program,t.parent,t.declaration);this.base=null;this.interfaces=null;this.contextualTypeArguments=null;this.nextMemoryOffset=0;this.alignLog2=0;this.constructorInstance=null;this.operatorOverloads=null;this.indexSignature=null;this._id=0;this.rttiFlags=0;this.wrappedType=null;this.extenders=null;this.implementers=null;this.didCheckFieldInitialization=!1;this.visitRef=0;this.prototype=t,this.flags=t.flags,this.decoratorFlags=t.decoratorFlags,this.typeArguments=i;let a=this.program,l=a.options.usizeType,o=new p(l.kind,l.flags&-129|256,l.size);if(o.classReference=this,this.setType(o),!this.hasDecorator(16)){let c=a.nextClassId++;this._id=c,a.managedClasses.set(c,this)}let u=t.typeParameterNodes;if(i){let c=i.length;if(!u||c!=u.length)throw new Error("type argument count mismatch");if(c){let f=this.contextualTypeArguments;f||(this.contextualTypeArguments=f=new Map);for(let _=0;_<c;++_)f.set(u[_].name.text,i[_])}}else if(u&&u.length>0)throw new Error("type argument count mismatch");Rf(a,this)}get id(){return this._id}get isBuiltinArray(){return this.prototype.isBuiltinArray}get isArrayLike(){if(this.isBuiltinArray)return!0;let e=this.getMember("length");return e?(e.kind==11&&e.getterInstance!=null||e.kind==10&&e.getterPrototype!=null)&&(this.lookupOverload(1)!=null||this.lookupOverload(3)!=null):!1}get isInterface(){return this.kind==9}static leastUpperBound(e,t){if(e==t)return e;let i=new Set;for(i.add(e),i.add(t);;){let s=e.base,a=t.base;if(!s&&!a)return null;if(s){if(i.has(s))return s;i.add(e=s)}if(a){if(i.has(a))return a;i.add(t=a)}}}setBase(e){assert(!this.base),this.base=e;let t=e.contextualTypeArguments;if(t){let a=this.contextualTypeArguments;for(let l=Map_keys(t),o=0,u=l.length;o<u;++o){let c=unchecked(l[o]),f=assert(t.get(c));a?a.has(c)||a.set(c,f):(this.contextualTypeArguments=a=new Map,a.set(c,f))}}e.propagateExtenderUp(this);let i=this.extenders;if(i)for(let a=Set_values(i),l=0,o=a.length;l<o;++l){let u=a[l];e.propagateExtenderUp(u)}let s=e;do{let a=s.interfaces;if(a)for(let l=Set_values(a),o=0,u=l.length;o<u;++o){let c=l[o];this.propagateInterfaceDown(c)}s=s.base}while(s)}propagateExtenderUp(e){let t=this;do{let i=t.extenders;i||(t.extenders=i=new Set),i.add(e),t=t.base}while(t)}propagateInterfaceDown(e){let t=e,i=this.extenders;do{let s=t.implementers;if(s||(t.implementers=s=new Set),s.add(this),i)for(let a=Set_values(i),l=0,o=a.length;l<o;++l){let u=a[l];s.add(u)}t=t.base}while(t)}addInterface(e){let t=this.interfaces;t||(this.interfaces=t=new Set),t.add(e),this.propagateInterfaceDown(e)}isAssignableTo(e){return e.isInterface?this.isInterface?this==e||this.extends(e):this.implements(e):this.isInterface?e==this.program.objectInstance:this==e||this.extends(e)}hasSubclassAssignableTo(e){return e.isInterface?this.isInterface?this.hasImplementerImplementing(e):this.hasExtenderImplementing(e):this.isInterface?this.hasImplementer(e):this.hasExtender(e)}lookupOverload(e,t=!1){if(t)switch(e){case 1:{let s=this.lookupOverload(3);if(s)return s;break}case 2:{let s=this.lookupOverload(4);if(s)return s;break}default:assert(!1)}let i=this;do{let s=i.operatorOverloads;if(s!=null&&s.has(e))return assert(s.get(e));i=i.base}while(i);return null}getMethod(e,t=null){let i=this.getMember(e);return i&&i.kind==4?this.program.resolver.resolveFunction(i,t):null}offsetof(e){let t=assert(this.getMember(e));assert(t.kind==10);let s=t.instance;return s?(assert(s.isField&&s.memoryOffset>=0),s.memoryOffset):0}createBuffer(e=0){let t=this.program,i=this.nextMemoryOffset+e,s=t.computeBlockSize(i,!0),a=new Uint8Array(t.blockOverhead+s),l=t.OBJECTInstance;return l.writeField("mmInfo",s,a,0),l.writeField("gcInfo",0,a,0),l.writeField("gcInfo2",0,a,0),l.writeField("rtId",this.id,a,0),l.writeField("rtSize",i,a,0),a}writeField(e,t,i,s=this.program.totalOverhead){let a=this.getMember(e);if(a&&a.kind==10){let o=a.instance;if(!o)return 0;assert(o.isField&&o.memoryOffset>=0);let u=s+o.memoryOffset,c=o.type.kind;switch(c){case 1:case 6:return assert(!i64_is(t)),be(i32(t),i,u),1;case 2:case 7:return assert(!i64_is(t)),br(i32(t),i,u),2;case 3:case 8:return assert(!i64_is(t)),Se(i32(t),i,u),4;case 5:case 10:return this.program.options.isWasm64?(i64_is(t)?Wn(t,i,u):ll(i32(t),i,u,c==10),8):(i64_is(t)?Gp(t,i,u,c==10):Se(i32(t),i,u),4);case 4:case 9:return i64_is(t)?Wn(t,i,u):ll(i32(t),i,u,c==9),8;case 11:return assert(!i64_is(t)),Wr(f32(t),i,u),4;case 12:return assert(!i64_is(t)),Kr(f64(t),i,u),8}}return assert(!1),0}extendsPrototype(e){return this.prototype.extends(e)}getTypeArgumentsTo(e){let t=this;do{if(t.prototype==e)return t.typeArguments;t=t.base}while(t);return null}getArrayValueType(){let e=this,t=this.program,i=t.arrayPrototype;if(this.extendsPrototype(i))return this.getTypeArgumentsTo(i)[0];let s=t.staticArrayPrototype;if(this.extendsPrototype(s))return this.getTypeArgumentsTo(s)[0];let a=t.arrayBufferViewInstance;for(;e.base!=a;)e=assert(e.base);let l=e.prototype;switch(l.name.charCodeAt(0)){case 70:{if(l==t.float32ArrayPrototype)return p.f32;if(l==t.float64ArrayPrototype)return p.f64;break}case 73:{if(l==t.int8ArrayPrototype)return p.i8;if(l==t.int16ArrayPrototype)return p.i16;if(l==t.int32ArrayPrototype)return p.i32;if(l==t.int64ArrayPrototype)return p.i64;break}case 85:{if(l==t.uint8ArrayPrototype)return p.u8;if(l==t.uint8ClampedArrayPrototype)return p.u8;if(l==t.uint16ArrayPrototype)return p.u16;if(l==t.uint32ArrayPrototype)return p.u32;if(l==t.uint64ArrayPrototype)return p.u64;break}}return assert(!1),p.void}get isPointerfree(){let e=this.program,t=this.members;if(t){for(let i=Map_values(t),s=0,a=i.length;s<a;++s){let l=unchecked(i[s]);if(l.kind==10){let u=l.instance;if(!u)continue;if(u.isField&&u.type.isManaged)return!1}}if(t.has(B.visit)){let i=this.prototype;if(i==e.arrayPrototype||i==e.staticArrayPrototype||i==e.setPrototype||i==e.mapPrototype){let s=assert(this.getTypeArgumentsTo(i));for(let a=0,l=s.length;a<l;++a)if(s[a].isManaged)return!1;return!0}return!1}}return!0}extends(e){return e.hasExtender(this)}hasExtender(e){let t=this.extenders;return t!=null&&t.has(e)}hasExtenderImplementing(e){let t=this.extenders;if(t){for(let i=Set_values(t),s=0,a=i.length;s<a;++s)if(i[s].implements(e))return!0}return!1}implements(e){return e.hasImplementer(this)}hasImplementer(e){let t=this.implementers;return t!=null&&t.has(e)}hasImplementerImplementing(e){let t=this.implementers;if(t){for(let i=Set_values(t),s=0,a=i.length;s<a;++s)if(i[s].implements(e))return!0}return!1}},nu=class extends qs{constructor(r,e,t,i){super(r,e,t,i,!0)}},Ns=class extends Ar{constructor(r,e,t=null){super(r,e,t,!0)}};function Rf(n,r){assert(!n.instancesByName.has(r.internalName)),n.instancesByName.set(r.internalName,r)}function Cf(n,r){if(assert(n.program==r.program),r.members)return null;let e=null;switch(n.kind){case 4:{switch(r.kind){case 12:{rr(r,n),e=n;break}case 14:{n.shadowType||(n.shadowType=r,rr(r,n),e=n);break}}break}case 6:case 2:{if(r.kind==12){rr(r,n),e=n;break}break}case 12:{switch(r.kind){case 2:case 6:case 4:{rr(n,r),e=r;break}case 12:{rr(r,n),e=n;break}case 14:{n.shadowType||(n.shadowType=r,rr(r,n),e=n);break}}break}case 0:{r.kind==14&&(n.shadowType||(n.shadowType=r,rr(r,n),e=n));break}case 14:{switch(r.kind){case 0:case 4:case 12:{r.shadowType||(r.shadowType=n,rr(n,r),e=r);break}}break}}if(e){let t=n.is(2)||n.hasDecorator(1),i=r.is(2)||r.hasDecorator(1);t!=i&&n.program.error(2395,e.identifierNode.range,e.identifierNode.text)}return e}function rr(n,r){let e=n.members;if(e){let t=r.members;t||(r.members=t=new Map);for(let i=Map_keys(e),s=0,a=i.length;s<a;++s){let l=unchecked(i[s]),o=assert(e.get(l));t.set(l,o)}}}function Ke(n,r,e,t=!1){switch(r.kind){case 13:return t?n:r.internalName+mt+n;case 5:return t?n:(assert(!e),r.internalName+zp+n);case 10:case 11:r=r.parent;default:return Ke(r.name,r.parent,r.is(262144),t)+(e?Mp:es)+n}}var Sf=[];function lx(n){for(let r=Sf.length;r<=n;++r)Sf.push(`$${r}`);return Sf[n]}var kf=class{constructor(r,e,t,i){this.index=r;this.parameterName=e;this.parameterType=t;this.fieldLocals=i}};var Er=(V=>(V[V.Bool=0]="Bool",V[V.I8=1]="I8",V[V.I16=2]="I16",V[V.I32=3]="I32",V[V.I64=4]="I64",V[V.Isize=5]="Isize",V[V.U8=6]="U8",V[V.U16=7]="U16",V[V.U32=8]="U32",V[V.U64=9]="U64",V[V.Usize=10]="Usize",V[V.F32=11]="F32",V[V.F64=12]="F64",V[V.V128=13]="V128",V[V.FixedArray=14]="FixedArray",V[V.Extern=15]="Extern",V[V.Func=16]="Func",V[V.Any=17]="Any",V[V.Eq=18]="Eq",V[V.Struct=19]="Struct",V[V.Array=20]="Array",V[V.I31=21]="I31",V[V.String=22]="String",V[V.StringviewWTF8=23]="StringviewWTF8",V[V.StringviewWTF16=24]="StringviewWTF16",V[V.StringviewIter=25]="StringviewIter",V[V.Void=26]="Void",V[V.UnmanagedArray=27]="UnmanagedArray",V[V.DynamicArray=28]="DynamicArray",V))(Er||{}),Bt=(h=>(h[h.None=0]="None",h[h.Signed=1]="Signed",h[h.Unsigned=2]="Unsigned",h[h.Integer=4]="Integer",h[h.Float=8]="Float",h[h.Varying=16]="Varying",h[h.Short=32]="Short",h[h.Long=64]="Long",h[h.Value=128]="Value",h[h.Reference=256]="Reference",h[h.Nullable=512]="Nullable",h[h.Vector=1024]="Vector",h[h.External=2048]="External",h[h.Class=4096]="Class",h[h.Function=8192]="Function",h))(Bt||{}),p=class n{constructor(r,e,t){this.classReference=null;this.signatureReference=null;this.fixedElementType=null;this.fixedLength=0;this.fixedMemoryModel=0;this.unmanagedElementType=null;this.dynamicArrayElementType=null;this.dynamicMemoryModel=0;this.fixedAlignLog2=0;this._nonNullableType=null;this._nullableType=null;this.ref=0;this.kind=r,this.flags=e,this.size=t,e&512?this._nullableType=this:this._nonNullableType=this}get intType(){if(this==n.auto)return this;switch(this.kind){case 0:case 3:case 11:return n.i32;case 1:return n.i8;case 2:return n.i16;case 12:case 4:return n.i64;case 5:return this.size==64?n.isize64:n.isize32;case 6:return n.u8;case 7:return n.u16;case 8:return n.u32;case 9:return n.u64;case 10:return this.size==64?n.usize64:n.usize32;default:return n.i32}}get exceptVoid(){return this.kind==26?n.auto:this}get byteSize(){return this.size+7>>>3}get alignLog2(){return this.kind==14?this.fixedAlignLog2:31-clz(this.byteSize)}get isValue(){return this.is(128)}get isIntegerValue(){return this.is(132)}get isShortIntegerValue(){return this.is(164)}get isLongIntegerValue(){return this.is(196)}get isSignedIntegerValue(){return this.is(133)}get isUnsignedIntegerValue(){return this.is(134)}get isVaryingIntegerValue(){return this.is(148)}get isIntegerInclReference(){return this.is(4)}get isFloatValue(){return this.is(136)}get isNumericValue(){return this.isIntegerValue||this.isFloatValue}get isBooleanValue(){return this==n.bool}get isVectorValue(){return this.is(1152)}get isReference(){return this.is(256)}get isNullableReference(){return this.is(768)}get isInternalReference(){return this.is(260)}get isExternalReference(){return this.is(2304)}get isNullableExternalReference(){return this.is(2816)}getClass(){return this.isInternalReference?this.classReference:null}get isClass(){return this.getClass()!=null}getClassOrWrapper(r){let e=this.getClass();if(e)return e;{let t=this.getSignature();if(t){let i=t.type,s=assert(r.resolver.resolveClass(r.functionPrototype,[i]));return s.wrappedType=i,s}else{let i=r.wrapperClasses;if(i.has(this))return assert(i.get(this))}}return null}lookupOverload(r,e){let t=this.getClassOrWrapper(e);return t?t.lookupOverload(r):null}getSignature(){return this.isInternalReference?this.signatureReference:null}get isFunction(){return this.getSignature()!=null}get isManaged(){if(this.isInternalReference){let r=this.classReference;return r?!r.hasDecorator(16):this.signatureReference!=null}return!1}get isUnmanaged(){let r=this.classReference;return r!=null&&r.hasDecorator(16)}get inlineExtentBytes(){let r=this.classReference;return r!=null&&(r.hasDecorator(16)||r.hasDecorator(2048))?r.nextMemoryOffset:this.byteSize}get inlineAlignLog2(){let r=this.classReference;return r!=null&&(r.hasDecorator(16)||r.hasDecorator(2048))?r.alignLog2:this.alignLog2}get isMemory(){switch(this.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:return!0}return!1}get nonNullableType(){return assert(this._nonNullableType)}get nullableType(){return this.isReference?this.asNullable():null}computeSmallIntegerShift(r){return r.size-this.size}computeSmallIntegerMask(r){let e=this.size;return this.is(2)||(e-=1),-1>>>r.size-e}is(r){return(this.flags&r)==r}isAny(r){return(this.flags&r)!=0}asNullable(){assert(this.isReference);let r=this._nullableType;return r||(assert(!this.isNullableReference),this._nullableType=r=new n(this.kind,this.flags|512,this.size),r.classReference=this.classReference,r.signatureReference=this.signatureReference,r._nonNullableType=this),r}toUnsigned(){switch(this.kind){case 1:return n.u8;case 2:return n.u16;case 3:return n.u32;case 4:return n.u64;case 5:return this.size==64?n.usize64:n.usize32}return this}equals(r){if(this.kind!=r.kind)return!1;if(this.kind==14){let e=this.fixedElementType,t=r.fixedElementType;return e!=null&&t!=null&&this.fixedLength==r.fixedLength&&this.fixedMemoryModel==r.fixedMemoryModel&&e.equals(t)}if(this.kind==28){let e=this.dynamicArrayElementType,t=r.dynamicArrayElementType;return e!=null&&t!=null&&this.dynamicMemoryModel==r.dynamicMemoryModel&&e.equals(t)}if(this.kind==27){let e=this.unmanagedElementType,t=r.unmanagedElementType;return e!=null&&t!=null&&e.equals(t)}if(this.isReference){let e=this.signatureReference,t=r.signatureReference;return this.classReference==r.classReference&&e==t&&this.isNullableReference==r.isNullableReference}return!0}isAssignableTo(r,e=!1){let t,i,s,a;if(this.isReference){if(r.isReference&&(!this.isNullableReference||r.isNullableReference)){if(t=this.getClass()){if(i=r.getClass())return t.isAssignableTo(i)}else if(s=this.getSignature()){if(a=r.getSignature())return s.isAssignableTo(a)}else if(this.isExternalReference&&(this.kind==r.kind||r.kind==17&&this.kind!=15))return!0}}else if(!r.isReference){if(this.isIntegerValue)if(r.isIntegerValue){if(!e||this.isBooleanValue||this.isSignedIntegerValue==r.isSignedIntegerValue)return this.size<=r.size}else{if(r.kind==11)return this.size<=23;if(r.kind==12)return this.size<=52}else if(this.isFloatValue){if(r.isFloatValue)return this.size<=r.size}else if(this.isVectorValue&&r.isVectorValue)return this.size==r.size}return!1}isStrictlyAssignableTo(r,e=!1){return this.isReference?this.isAssignableTo(r):r.isReference?!1:this.isIntegerValue?r.isIntegerValue&&r.size==this.size&&(!e||this.isSignedIntegerValue==r.isSignedIntegerValue):this.kind==14||this.kind==27?this.equals(r):this.kind==r.kind}hasSubtypeAssignableTo(r){let e=this.getClass(),t=r.getClass();return!e||!t?!1:e.hasSubclassAssignableTo(t)}isChangeableTo(r){if(r.kind==27)return this.is(4)||this.kind==27;if(r.kind==28)return this.is(4)||this.kind==28;if(r.kind==14)return r.fixedMemoryModel==0||r.fixedMemoryModel==1?!1:this.is(4)||this.kind==14;if(this.is(4)&&r.is(4)){let e=this.size;return e==r.size&&(e>=32||this.is(1)==r.is(1))}return this.kind==r.kind}canExtendOrImplement(r){let e=this.getClass(),t=r.getClass();if(!e||!t||this.isManaged!=r.isManaged)return!1;if(this.isInternalReference){if(!r.isInternalReference)return!1}else if(this.isExternalReference){if(!r.isExternalReference)return!1}else return!1;return!0}static commonType(r,e,t=n.auto,i=!1){if(r.isInternalReference){if(!e.isInternalReference)return null;if(t!=n.void&&r.isAssignableTo(t)&&e.isAssignableTo(t))return t;let s=r.getClass(),a=e.getClass();if(s&&a){let l=Ar.leastUpperBound(s,a);if(l)return r.is(512)||e.is(512)?l.type.asNullable():l.type}}else if(e.isInternalReference)return null;return e.isAssignableTo(r,i)?r:r.isAssignableTo(e,i)?e:null}kindToString(){switch(this.kind){case 0:return B.bool;case 1:return B.i8;case 2:return B.i16;case 3:return B.i32;case 4:return B.i64;case 5:return B.isize;case 6:return B.u8;case 7:return B.u16;case 8:return B.u32;case 9:return B.u64;case 10:return B.usize;case 11:return B.f32;case 12:return B.f64;case 13:return B.v128;case 16:return B.ref_func;case 15:return B.ref_extern;case 17:return B.ref_any;case 18:return B.ref_eq;case 19:return B.ref_struct;case 20:return B.ref_array;case 21:return B.ref_i31;case 22:return B.ref_string;case 23:return B.ref_stringview_wtf8;case 24:return B.ref_stringview_wtf16;case 25:return B.ref_stringview_iter;case 14:{let r=this.fixedElementType,e="["+(r?r.toString():"?")+" * "+this.fixedLength.toString()+"]";switch(this.fixedMemoryModel){case 3:return"@unmanaged "+e;case 2:return"@managed "+e;case 1:return"@inline "+e;default:return e}}case 27:{let r=this.unmanagedElementType;return"["+(r?r.toString():"?")+" *]"}case 28:{let r=this.dynamicArrayElementType;return(this.dynamicMemoryModel==2?"@managed @dynamic ":"@unmanaged @dynamic ")+"["+(r?r.toString():"?")+" * n]"}default:assert(!1);case 26:return B.void_}}toString(r=!1){let e=r?"|null":" | null";if(this.isReference){let t=this.getClass();if(t)return this.isNullableReference?t.internalName+e:t.internalName;{let i=this.getSignature();return i?this.isNullableReference?`(${i.toString(r)})${e}`:i.toString(r):this.isNullableReference?`${this.kindToString()}${e}`:this.kindToString()}}return this==n.auto?"auto":this.kindToString()}toRef(){switch(this.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:return P.I32;case 5:case 10:case 27:case 28:if(this.size!=64)return P.I32;case 4:case 9:return P.I64;case 11:return P.F32;case 12:return P.F64;case 13:return P.V128;case 16:return Ae(Ie.Func,this.is(512));case 15:return Ae(Ie.Extern,this.is(512));case 17:return Ae(Ie.Any,this.is(512));case 18:return Ae(Ie.Eq,this.is(512));case 19:return Ae(Ie.Struct,this.is(512));case 20:return Ae(Ie.Array,this.is(512));case 21:return Ae(Ie.I31,this.is(512));case 22:return Ae(Ie.String,this.is(512));case 26:return P.None;case 14:return this.fixedMemoryModel==3||this.fixedMemoryModel==2?P.I32:(assert(!1),P.I32)}return assert(!1),Fs(this)}static{this.i8=new n(1,165,8)}static{this.i16=new n(2,165,16)}static{this.i32=new n(3,133,32)}static{this.i64=new n(4,197,64)}static{this.isize32=new n(5,149,32)}static{this.isize64=new n(5,213,64)}static{this.u8=new n(6,166,8)}static{this.u16=new n(7,166,16)}static{this.u32=new n(8,134,32)}static{this.u64=new n(9,198,64)}static{this.usize32=new n(10,150,32)}static{this.usize64=new n(10,214,64)}static{this.bool=new n(0,166,1)}static{this.f32=new n(11,137,32)}static{this._fixedArrays=null}static fixedArray(r,e,t,i){let s=t==0||t==1,a=(s?"-":t==2?"m":"u")+r.toString()+"["+e.toString()+"]",l=n._fixedArrays;if(!l){let c=new Map;n._fixedArrays=c,l=c}let o=J(l,a);if(o&&o.fixedElementType==r)return o;let u=new n(14,0,s?r.inlineExtentBytes*e<<3:i);return u.fixedElementType=r,u.fixedLength=e,u.fixedMemoryModel=t,u.fixedAlignLog2=s?r.inlineAlignLog2:31-clz(i>>>3),l.set(a,u),u}get fixedArrayElementType(){return assert(this.fixedElementType)}static{this._unmanagedArrays=null}static unmanagedArray(r,e){let t=r.toString()+"*"+e.toString(),i=n._unmanagedArrays;if(!i){let l=new Map;n._unmanagedArrays=l,i=l}let s=J(i,t);if(s&&s.unmanagedElementType==r)return s;let a=new n(27,0,e);return a.unmanagedElementType=r,i.set(t,a),a}get unmanagedArrayElementType(){return assert(this.unmanagedElementType)}static{this._dynamicArrays=null}static dynamicArray(r,e,t){let i=(e==2?"m":"u")+r.toString()+"*d"+t.toString(),s=n._dynamicArrays;if(!s){let o=new Map;n._dynamicArrays=o,s=o}let a=J(s,i);if(a&&a.dynamicArrayElementType==r)return a;let l=new n(28,0,t);return l.dynamicArrayElementType=r,l.dynamicMemoryModel=e,s.set(i,l),l}get dynamicElementType(){return assert(this.dynamicArrayElementType)}static{this.f64=new n(12,201,64)}static{this.v128=new n(13,1152,128)}static{this.func=new n(16,2304,0)}static{this.extern=new n(15,2304,0)}static{this.any=new n(17,2304,0)}static{this.eq=new n(18,2304,0)}static{this.struct=new n(19,2304,0)}static{this.array=new n(20,2304,0)}static{this.i31=new n(21,2304,0)}static{this.string=new n(22,2304,0)}static{this.stringview_wtf8=new n(23,2304,0)}static{this.stringview_wtf16=new n(24,2304,0)}static{this.stringview_iter=new n(25,2304,0)}static{this.void=new n(26,0,0)}static{this.auto=new n(n.i32.kind,n.i32.flags,n.i32.size)}};function $1(n){let r=n.length,e=new Array(r);for(let t=0;t<r;++t)unchecked(e[t]=n[t].toRef());return e}function $o(n){let r=n.length;if(!r)return"";let e=new Array(r);for(let t=0;t<r;++t)unchecked(e[t]=n[t].toString(!0));return e.join(",")}var ii=(i=>(i[i.None=0]="None",i[i.Inline=1]="Inline",i[i.Managed=2]="Managed",i[i.Unmanaged=3]="Unmanaged",i))(ii||{});function Z1(n){if(n==null)return"";let r=n.length;if(!r)return"";let e=new Array(r);for(let t=0;t<r;++t){let i=unchecked(n[t]);unchecked(e[t]=i==1?"i":i==2?"m":i==3?"u":"-")}return"!mm:"+e.join("")+":"}var fe=class n{constructor(r,e,t,i,s,a,l,o,u,c,f,_){this.program=r;this.parameterTypes=e;this.returnType=t;this.thisType=i;this.requiredParameters=s;this.hasRest=a;this.sretDisabled=l;this.externalBoundary=o;this.exportByValParams=u;this.memoryModels=c;this.id=f;this.type=_}static create(r,e=[],t=p.void,i=null,s=e?e.length:0,a=!1,l=!1,o=!1,u=!1,c=null){let f=r.options.usizeType,_=new p(f.kind,f.flags&-129|256,f.size),d=r.uniqueSignatures,m=r.nextSignatureId,h=new n(r,e,t,i,s,a,l,o,u,c,m,_),b=(l?"!sret-disabled:":"")+(o?"!external-boundary:":"")+(u?"!export-byval:":"")+Z1(c)+h.toString();if(d.has(b)){let A=assert(d.get(b));return assert(h.equals(A)),A}return r.nextSignatureId=m+1,_.signatureReference=h,d.set(b,h),h}memoryModelOf(r){let e=this.memoryModels;return e==null?0:unchecked(e[r])}static wasmParamCountOf(r){if(r.kind==14&&(r.fixedMemoryModel==0||r.fixedMemoryModel==1)){let i=n.leafCountOf(r);return i>0?i:1}let e=r.classReference;if(e==null||!e.hasDecorator(4096))return 1;let t=n.leafCountOf(r);return t>0?t:1}static leafTypesOf(r,e){if(r.kind==14&&(r.fixedMemoryModel==0||r.fixedMemoryModel==1)){let s=assert(r.fixedElementType),a=s.classReference,l=a!=null&&(a.hasDecorator(16)||a.hasDecorator(2048));for(let o=0,u=r.fixedLength;o<u;++o)l?n.leafTypesOf(s,e):e.push(s);return}let t=r.classReference;if(t==null)return;let i=t.members;if(i)for(let s=Map_values(i),a=0,l=s.length;a<l;++a){let o=unchecked(s[a]);if(o.kind!=10)continue;let u=o.instance;if(u==null||!u.isField)continue;let c=u.type;n.isInlineStructRef(c)?n.leafTypesOf(c,e):e.push(c)}}static leafCountOf(r){let e=new Array;return n.leafTypesOf(r,e),e.length}wasmParamSlotCountOf(r){return this.isViewParam(r)||this.isByValPointerParam(r)?1:n.wasmParamCountOf(unchecked(this.parameterTypes[r]))}isViewParam(r){return this.memoryModelOf(r)==3&&n.isInlineStructRef(unchecked(this.parameterTypes[r]))}crossesByValueParam(r){return this.isViewParam(r)?!1:n.isInlineStructRef(unchecked(this.parameterTypes[r]))?!0:this.memoryModelOf(r)==1}isExternalPointerParam(r){return this.externalBoundary?this.crossesByValueParam(r):!1}isExportByValParam(r){return this.exportByValParams?this.crossesByValueParam(r):!1}isByValPointerParam(r){return this.isExternalPointerParam(r)||this.isExportByValParam(r)}get byValPointerParams(){return this.externalBoundary||this.exportByValParams}static isInlineStructRef(r){let e=r.classReference;return e!=null&&e.hasDecorator(4096)}static fieldCountOf(r){return r.classReference==null?0:n.leafCountOf(r)}get hasHiddenDestParam(){if(this.sretDisabled)return!1;let r=this.returnType.classReference;return r!=null&&r.hasDecorator(4096)}wasmParamStartOf(r){let e=this.parameterTypes,t=this.hasHiddenDestParam?1:0;for(let i=0;i<r&&i<e.length;++i)t+=this.wasmParamSlotCountOf(i);return t}wasmParamCount(){let r=this.parameterTypes,e=this.hasHiddenDestParam?1:0;for(let t=0,i=r.length;t<i;++t)e+=this.wasmParamSlotCountOf(t);return e}sourceIndexOf(r){let e=this.parameterTypes,t=this.hasHiddenDestParam?1:0;if(r<t)return-1;for(let i=0,s=e.length;i<s;++i){let a=this.wasmParamSlotCountOf(i);if(r<t+a)return i;t+=a}return-1}get paramRefs(){let r=this.thisType,e=this.parameterTypes,t=e.length,i=this.hasHiddenDestParam;if(!t&&!i)return r?r.toRef():P.None;let s=this.wasmParamCount(),a=new Array(r?1+s:s),l=0;r&&unchecked(a[l++]=r.toRef()),i&&unchecked(a[l++]=P.I32);for(let o=0;o<t;++o){let u=unchecked(e[o]);if(this.isViewParam(o))unchecked(a[l++]=P.I32);else if(this.isByValPointerParam(o))unchecked(a[l++]=P.I32);else if(n.isInlineStructRef(u)){let c=new Array;n.leafTypesOf(u,c);for(let f=0,_=c.length;f<_;++f)unchecked(a[l++]=unchecked(c[f]).toRef())}else if(u.kind==14&&(u.fixedMemoryModel==0||u.fixedMemoryModel==1)){let c=new Array;n.leafTypesOf(u,c);for(let f=0,_=c.length;f<_;++f)unchecked(a[l++]=unchecked(c[f]).toRef())}else unchecked(a[l++]=u.toRef())}return it(a)}get resultRefs(){if(this.hasHiddenDestParam)return P.None;let r=this.returnType;if(r.kind==14&&(r.fixedMemoryModel==0||r.fixedMemoryModel==1)){let e=new Array;n.leafTypesOf(r,e);let t=new Array(e.length);for(let i=0,s=e.length;i<s;++i)unchecked(t[i]=unchecked(e[i]).toRef());return it(t)}return r.toRef()}equals(r){let e=this.thisType,t=r.thisType;if(e){if(!t||!e.equals(t))return!1}else if(t)return!1;if(this.hasRest!=r.hasRest||this.sretDisabled!=r.sretDisabled||this.externalBoundary!=r.externalBoundary||this.exportByValParams!=r.exportByValParams)return!1;let i=this.memoryModels,s=r.memoryModels;if(i==null!=(s==null))return!1;if(i!=null){let u=assert(s),c=i.length;if(c!=u.length)return!1;for(let f=0;f<c;++f)if(unchecked(i[f])!=unchecked(u[f]))return!1}if(!this.returnType.equals(r.returnType))return!1;let a=this.parameterTypes,l=r.parameterTypes,o=a.length;if(o!=l.length)return!1;for(let u=0;u<o;++u){let c=unchecked(a[u]),f=unchecked(l[u]);if(!c.equals(f))return!1}return!0}isAssignableTo(r,e=!1){let t=this.thisType,i=r.thisType;if(t&&i){if(!(e?t.canExtendOrImplement(i):i.isAssignableTo(t)))return!1}else if(t||i)return!1;if(this.hasRest!=r.hasRest)return!1;let s=this.returnType,a=r.returnType;if(!(s==a||s.isAssignableTo(a)))return!1;let l=this.parameterTypes,o=r.parameterTypes,u=l.length;if(u!=o.length)return!1;for(let c=0;c<u;++c){let f=unchecked(l[c]),_=unchecked(o[c]);if(f!=_)return!1}return!0}get hasManagedOperands(){let r=this.thisType;if(r&&r.isManaged)return!0;let e=this.parameterTypes;for(let t=0,i=e.length;t<i;++t)if(unchecked(e[t]).isManaged)return!0;return!1}getManagedOperandIndices(){let r=new Array,e=0,t=this.thisType;t&&(t.isManaged&&r.push(e),++e);let i=this.parameterTypes;for(let s=0,a=i.length;s<a;++s)unchecked(i[s]).isManaged&&r.push(e),++e;return r}get hasVectorValueOperands(){let r=this.thisType;if(r&&r.isVectorValue)return!0;let e=this.parameterTypes;for(let t=0,i=e.length;t<i;++t)if(unchecked(e[t]).isVectorValue)return!0;return!1}getVectorValueOperandIndices(){let r=new Array,e=0,t=this.thisType;t&&(t.isVectorValue&&r.push(e),++e);let i=this.parameterTypes;for(let s=0,a=i.length;s<a;++s)unchecked(i[s]).isVectorValue&&r.push(e),++e;return r}toString(r=!1){let e=new Array;e.push(r?"%28":"(");let t=0,i=this.thisType;i&&(e.push(r?"this:":"this: "),e.push(i.toString(r)),t=1);let s=this.parameterTypes,a=s.length;if(a){let l=this.requiredParameters,o=this.hasRest?a-1:-1;for(let u=0;u<a;++u,++t)t&&e.push(r?"%2C":", "),u==o&&e.push("..."),e.push(s[u].toString(r)),u>=l&&u!=o&&e.push("?")}return e.push(r?"%29=>":") => "),e.push(this.returnType.toString(r)),e.join("")}clone(r=this.requiredParameters,e=this.hasRest){let t=this.parameterTypes,i=t.length,s=new Array(i);for(let a=0;a<i;++a)unchecked(s[a]=t[a]);return n.create(this.program,s,this.returnType,this.thisType,r,e,this.sretDisabled,this.externalBoundary,this.exportByValParams,this.memoryModels)}};var g;(x=>(x.start="~start",x.started="~started",x.argumentsLength="~argumentsLength",x.setArgumentsLength="~setArgumentsLength",x.env="~env",x.abort="~lib/builtins/abort",x.trace="~lib/builtins/trace",x.seed="~lib/builtins/seed",x.isBoolean="~lib/builtins/isBoolean",x.isInteger="~lib/builtins/isInteger",x.isSigned="~lib/builtins/isSigned",x.isFloat="~lib/builtins/isFloat",x.isVector="~lib/builtins/isVector",x.isReference="~lib/builtins/isReference",x.isString="~lib/builtins/isString",x.isArray="~lib/builtins/isArray",x.isArrayLike="~lib/builtins/isArrayLike",x.isFunction="~lib/builtins/isFunction",x.isNullable="~lib/builtins/isNullable",x.isDefined="~lib/builtins/isDefined",x.isConstant="~lib/builtins/isConstant",x.isManaged="~lib/builtins/isManaged",x.isVoid="~lib/builtins/isVoid",x.add="~lib/builtins/add",x.sub="~lib/builtins/sub",x.mul="~lib/builtins/mul",x.div="~lib/builtins/div",x.clz="~lib/builtins/clz",x.ctz="~lib/builtins/ctz",x.popcnt="~lib/builtins/popcnt",x.rotl="~lib/builtins/rotl",x.rotr="~lib/builtins/rotr",x.abs="~lib/builtins/abs",x.max="~lib/builtins/max",x.min="~lib/builtins/min",x.ceil="~lib/builtins/ceil",x.floor="~lib/builtins/floor",x.copysign="~lib/builtins/copysign",x.nearest="~lib/builtins/nearest",x.reinterpret="~lib/builtins/reinterpret",x.sqrt="~lib/builtins/sqrt",x.trunc="~lib/builtins/trunc",x.eq="~lib/builtins/eq",x.ne="~lib/builtins/ne",x.rem="~lib/builtins/rem",x.load="~lib/builtins/load",x.store="~lib/builtins/store",x.atomic_load="~lib/builtins/atomic.load",x.atomic_store="~lib/builtins/atomic.store",x.atomic_add="~lib/builtins/atomic.add",x.atomic_sub="~lib/builtins/atomic.sub",x.atomic_and="~lib/builtins/atomic.and",x.atomic_or="~lib/builtins/atomic.or",x.atomic_xor="~lib/builtins/atomic.xor",x.atomic_xchg="~lib/builtins/atomic.xchg",x.atomic_cmpxchg="~lib/builtins/atomic.cmpxchg",x.atomic_wait="~lib/builtins/atomic.wait",x.atomic_notify="~lib/builtins/atomic.notify",x.atomic_fence="~lib/builtins/atomic.fence",x.sizeof="~lib/builtins/sizeof",x.alignof="~lib/builtins/alignof",x.offsetof="~lib/builtins/offsetof",x.abiNameOf="~lib/builtins/abiNameOf",x.nameof="~lib/builtins/nameof",x.lengthof="~lib/builtins/lengthof",x.select="~lib/builtins/select",x.unreachable="~lib/builtins/unreachable",x.changetype="~lib/builtins/changetype",x.copyInto="~lib/builtins/copyInto",x.assert="~lib/builtins/assert",x.call_indirect="~lib/builtins/call_indirect",x.unchecked="~lib/builtins/unchecked",x.inline_always="~lib/builtins/inline.always",x.instantiate="~lib/builtins/instantiate",x.idof="~lib/builtins/idof",x.i8="~lib/builtins/i8",x.i16="~lib/builtins/i16",x.i32="~lib/builtins/i32",x.i64="~lib/builtins/i64",x.isize="~lib/builtins/isize",x.u8="~lib/builtins/u8",x.u16="~lib/builtins/u16",x.u32="~lib/builtins/u32",x.u64="~lib/builtins/u64",x.usize="~lib/builtins/usize",x.bool="~lib/builtins/bool",x.f32="~lib/builtins/f32",x.f64="~lib/builtins/f64",x.v128="~lib/builtins/v128",x.i32_clz="~lib/builtins/i32.clz",x.i64_clz="~lib/builtins/i64.clz",x.i32_ctz="~lib/builtins/i32.ctz",x.i64_ctz="~lib/builtins/i64.ctz",x.i32_popcnt="~lib/builtins/i32.popcnt",x.i64_popcnt="~lib/builtins/i64.popcnt",x.i32_rotl="~lib/builtins/i32.rotl",x.i64_rotl="~lib/builtins/i64.rotl",x.i32_rotr="~lib/builtins/i32.rotr",x.i64_rotr="~lib/builtins/i64.rotr",x.f32_abs="~lib/builtins/f32.abs",x.f64_abs="~lib/builtins/f64.abs",x.f32_max="~lib/builtins/f32.max",x.f64_max="~lib/builtins/f64.max",x.f32_min="~lib/builtins/f32.min",x.f64_min="~lib/builtins/f64.min",x.f32_ceil="~lib/builtins/f32.ceil",x.f64_ceil="~lib/builtins/f64.ceil",x.f32_floor="~lib/builtins/f32.floor",x.f64_floor="~lib/builtins/f64.floor",x.f32_copysign="~lib/builtins/f32.copysign",x.f64_copysign="~lib/builtins/f64.copysign",x.f32_nearest="~lib/builtins/f32.nearest",x.f64_nearest="~lib/builtins/f64.nearest",x.i32_reinterpret_f32="~lib/builtins/i32.reinterpret_f32",x.i64_reinterpret_f64="~lib/builtins/i64.reinterpret_f64",x.f32_reinterpret_i32="~lib/builtins/f32.reinterpret_i32",x.f64_reinterpret_i64="~lib/builtins/f64.reinterpret_i64",x.f32_sqrt="~lib/builtins/f32.sqrt",x.f64_sqrt="~lib/builtins/f64.sqrt",x.f32_trunc="~lib/builtins/f32.trunc",x.f64_trunc="~lib/builtins/f64.trunc",x.i32_add="~lib/builtins/i32.add",x.i64_add="~lib/builtins/i64.add",x.f32_add="~lib/builtins/f32.add",x.f64_add="~lib/builtins/f64.add",x.i32_sub="~lib/builtins/i32.sub",x.i64_sub="~lib/builtins/i64.sub",x.f32_sub="~lib/builtins/f32.sub",x.f64_sub="~lib/builtins/f64.sub",x.i32_mul="~lib/builtins/i32.mul",x.i64_mul="~lib/builtins/i64.mul",x.f32_mul="~lib/builtins/f32.mul",x.f64_mul="~lib/builtins/f64.mul",x.i32_div_s="~lib/builtins/i32.div_s",x.i32_div_u="~lib/builtins/i32.div_u",x.i64_div_s="~lib/builtins/i64.div_s",x.i64_div_u="~lib/builtins/i64.div_u",x.f32_div="~lib/builtins/f32.div",x.f64_div="~lib/builtins/f64.div",x.i32_eq="~lib/builtins/i32.eq",x.i64_eq="~lib/builtins/i64.eq",x.f32_eq="~lib/builtins/f32.eq",x.f64_eq="~lib/builtins/f64.eq",x.i32_ne="~lib/builtins/i32.ne",x.i64_ne="~lib/builtins/i64.ne",x.f32_ne="~lib/builtins/f32.ne",x.f64_ne="~lib/builtins/f64.ne",x.i32_rem_s="~lib/builtins/i32.rem_s",x.i32_rem_u="~lib/builtins/i32.rem_u",x.i64_rem_s="~lib/builtins/i64.rem_s",x.i64_rem_u="~lib/builtins/i64.rem_u",x.i32_load8_s="~lib/builtins/i32.load8_s",x.i32_load8_u="~lib/builtins/i32.load8_u",x.i32_load16_s="~lib/builtins/i32.load16_s",x.i32_load16_u="~lib/builtins/i32.load16_u",x.i32_load="~lib/builtins/i32.load",x.i64_load8_s="~lib/builtins/i64.load8_s",x.i64_load8_u="~lib/builtins/i64.load8_u",x.i64_load16_s="~lib/builtins/i64.load16_s",x.i64_load16_u="~lib/builtins/i64.load16_u",x.i64_load32_s="~lib/builtins/i64.load32_s",x.i64_load32_u="~lib/builtins/i64.load32_u",x.i64_load="~lib/builtins/i64.load",x.f32_load="~lib/builtins/f32.load",x.f64_load="~lib/builtins/f64.load",x.i32_store8="~lib/builtins/i32.store8",x.i32_store16="~lib/builtins/i32.store16",x.i32_store="~lib/builtins/i32.store",x.i64_store8="~lib/builtins/i64.store8",x.i64_store16="~lib/builtins/i64.store16",x.i64_store32="~lib/builtins/i64.store32",x.i64_store="~lib/builtins/i64.store",x.f32_store="~lib/builtins/f32.store",x.f64_store="~lib/builtins/f64.store",x.i32_atomic_load8_u="~lib/builtins/i32.atomic.load8_u",x.i32_atomic_load16_u="~lib/builtins/i32.atomic.load16_u",x.i32_atomic_load="~lib/builtins/i32.atomic.load",x.i64_atomic_load8_u="~lib/builtins/i64.atomic.load8_u",x.i64_atomic_load16_u="~lib/builtins/i64.atomic.load16_u",x.i64_atomic_load32_u="~lib/builtins/i64.atomic.load32_u",x.i64_atomic_load="~lib/builtins/i64.atomic.load",x.i32_atomic_store8="~lib/builtins/i32.atomic.store8",x.i32_atomic_store16="~lib/builtins/i32.atomic.store16",x.i32_atomic_store="~lib/builtins/i32.atomic.store",x.i64_atomic_store8="~lib/builtins/i64.atomic.store8",x.i64_atomic_store16="~lib/builtins/i64.atomic.store16",x.i64_atomic_store32="~lib/builtins/i64.atomic.store32",x.i64_atomic_store="~lib/builtins/i64.atomic.store",x.i32_atomic_rmw8_add_u="~lib/builtins/i32.atomic.rmw8.add_u",x.i32_atomic_rmw16_add_u="~lib/builtins/i32.atomic.rmw16.add_u",x.i32_atomic_rmw_add="~lib/builtins/i32.atomic.rmw.add",x.i64_atomic_rmw8_add_u="~lib/builtins/i64.atomic.rmw8.add_u",x.i64_atomic_rmw16_add_u="~lib/builtins/i64.atomic.rmw16.add_u",x.i64_atomic_rmw32_add_u="~lib/builtins/i64.atomic.rmw32.add_u",x.i64_atomic_rmw_add="~lib/builtins/i64.atomic.rmw.add",x.i32_atomic_rmw8_sub_u="~lib/builtins/i32.atomic.rmw8.sub_u",x.i32_atomic_rmw16_sub_u="~lib/builtins/i32.atomic.rmw16.sub_u",x.i32_atomic_rmw_sub="~lib/builtins/i32.atomic.rmw.sub",x.i64_atomic_rmw8_sub_u="~lib/builtins/i64.atomic.rmw8.sub_u",x.i64_atomic_rmw16_sub_u="~lib/builtins/i64.atomic.rmw16.sub_u",x.i64_atomic_rmw32_sub_u="~lib/builtins/i64.atomic.rmw32.sub_u",x.i64_atomic_rmw_sub="~lib/builtins/i64.atomic.rmw.sub",x.i32_atomic_rmw8_and_u="~lib/builtins/i32.atomic.rmw8.and_u",x.i32_atomic_rmw16_and_u="~lib/builtins/i32.atomic.rmw16.and_u",x.i32_atomic_rmw_and="~lib/builtins/i32.atomic.rmw.and",x.i64_atomic_rmw8_and_u="~lib/builtins/i64.atomic.rmw8.and_u",x.i64_atomic_rmw16_and_u="~lib/builtins/i64.atomic.rmw16.and_u",x.i64_atomic_rmw32_and_u="~lib/builtins/i64.atomic.rmw32.and_u",x.i64_atomic_rmw_and="~lib/builtins/i64.atomic.rmw.and",x.i32_atomic_rmw8_or_u="~lib/builtins/i32.atomic.rmw8.or_u",x.i32_atomic_rmw16_or_u="~lib/builtins/i32.atomic.rmw16.or_u",x.i32_atomic_rmw_or="~lib/builtins/i32.atomic.rmw.or",x.i64_atomic_rmw8_or_u="~lib/builtins/i64.atomic.rmw8.or_u",x.i64_atomic_rmw16_or_u="~lib/builtins/i64.atomic.rmw16.or_u",x.i64_atomic_rmw32_or_u="~lib/builtins/i64.atomic.rmw32.or_u",x.i64_atomic_rmw_or="~lib/builtins/i64.atomic.rmw.or",x.i32_atomic_rmw8_xor_u="~lib/builtins/i32.atomic.rmw8.xor_u",x.i32_atomic_rmw16_xor_u="~lib/builtins/i32.atomic.rmw16.xor_u",x.i32_atomic_rmw_xor="~lib/builtins/i32.atomic.rmw.xor",x.i64_atomic_rmw8_xor_u="~lib/builtins/i64.atomic.rmw8.xor_u",x.i64_atomic_rmw16_xor_u="~lib/builtins/i64.atomic.rmw16.xor_u",x.i64_atomic_rmw32_xor_u="~lib/builtins/i64.atomic.rmw32.xor_u",x.i64_atomic_rmw_xor="~lib/builtins/i64.atomic.rmw.xor",x.i32_atomic_rmw8_xchg_u="~lib/builtins/i32.atomic.rmw8.xchg_u",x.i32_atomic_rmw16_xchg_u="~lib/builtins/i32.atomic.rmw16.xchg_u",x.i32_atomic_rmw_xchg="~lib/builtins/i32.atomic.rmw.xchg",x.i64_atomic_rmw8_xchg_u="~lib/builtins/i64.atomic.rmw8.xchg_u",x.i64_atomic_rmw16_xchg_u="~lib/builtins/i64.atomic.rmw16.xchg_u",x.i64_atomic_rmw32_xchg_u="~lib/builtins/i64.atomic.rmw32.xchg_u",x.i64_atomic_rmw_xchg="~lib/builtins/i64.atomic.rmw.xchg",x.i32_atomic_rmw8_cmpxchg_u="~lib/builtins/i32.atomic.rmw8.cmpxchg_u",x.i32_atomic_rmw16_cmpxchg_u="~lib/builtins/i32.atomic.rmw16.cmpxchg_u",x.i32_atomic_rmw_cmpxchg="~lib/builtins/i32.atomic.rmw.cmpxchg",x.i64_atomic_rmw8_cmpxchg_u="~lib/builtins/i64.atomic.rmw8.cmpxchg_u",x.i64_atomic_rmw16_cmpxchg_u="~lib/builtins/i64.atomic.rmw16.cmpxchg_u",x.i64_atomic_rmw32_cmpxchg_u="~lib/builtins/i64.atomic.rmw32.cmpxchg_u",x.i64_atomic_rmw_cmpxchg="~lib/builtins/i64.atomic.rmw.cmpxchg",x.memory_atomic_wait32="~lib/memory/memory.atomic.wait32",x.memory_atomic_wait64="~lib/memory/memory.atomic.wait64",x.v128_splat="~lib/builtins/v128.splat",x.v128_extract_lane="~lib/builtins/v128.extract_lane",x.v128_replace_lane="~lib/builtins/v128.replace_lane",x.v128_shuffle="~lib/builtins/v128.shuffle",x.v128_swizzle="~lib/builtins/v128.swizzle",x.v128_load_splat="~lib/builtins/v128.load_splat",x.v128_load_ext="~lib/builtins/v128.load_ext",x.v128_load_zero="~lib/builtins/v128.load_zero",x.v128_load_lane="~lib/builtins/v128.load_lane",x.v128_store_lane="~lib/builtins/v128.store_lane",x.v128_load="~lib/builtins/v128.load",x.v128_load8x8_s="~lib/builtins/v128.load8x8_s",x.v128_load8x8_u="~lib/builtins/v128.load8x8_u",x.v128_load16x4_s="~lib/builtins/v128.load16x4_s",x.v128_load16x4_u="~lib/builtins/v128.load16x4_u",x.v128_load32x2_s="~lib/builtins/v128.load32x2_s",x.v128_load32x2_u="~lib/builtins/v128.load32x2_u",x.v128_load8_splat="~lib/builtins/v128.load8_splat",x.v128_load16_splat="~lib/builtins/v128.load16_splat",x.v128_load32_splat="~lib/builtins/v128.load32_splat",x.v128_load64_splat="~lib/builtins/v128.load64_splat",x.v128_load32_zero="~lib/builtins/v128.load32_zero",x.v128_load64_zero="~lib/builtins/v128.load64_zero",x.v128_load8_lane="~lib/builtins/v128.load8_lane",x.v128_load16_lane="~lib/builtins/v128.load16_lane",x.v128_load32_lane="~lib/builtins/v128.load32_lane",x.v128_load64_lane="~lib/builtins/v128.load64_lane",x.v128_store8_lane="~lib/builtins/v128.store8_lane",x.v128_store16_lane="~lib/builtins/v128.store16_lane",x.v128_store32_lane="~lib/builtins/v128.store32_lane",x.v128_store64_lane="~lib/builtins/v128.store64_lane",x.v128_store="~lib/builtins/v128.store",x.v128_add="~lib/builtins/v128.add",x.v128_sub="~lib/builtins/v128.sub",x.v128_mul="~lib/builtins/v128.mul",x.v128_div="~lib/builtins/v128.div",x.v128_neg="~lib/builtins/v128.neg",x.v128_add_sat="~lib/builtins/v128.add_sat",x.v128_sub_sat="~lib/builtins/v128.sub_sat",x.v128_shl="~lib/builtins/v128.shl",x.v128_shr="~lib/builtins/v128.shr",x.v128_and="~lib/builtins/v128.and",x.v128_or="~lib/builtins/v128.or",x.v128_xor="~lib/builtins/v128.xor",x.v128_andnot="~lib/builtins/v128.andnot",x.v128_not="~lib/builtins/v128.not",x.v128_bitselect="~lib/builtins/v128.bitselect",x.v128_any_true="~lib/builtins/v128.any_true",x.v128_all_true="~lib/builtins/v128.all_true",x.v128_bitmask="~lib/builtins/v128.bitmask",x.v128_popcnt="~lib/builtins/v128.popcnt",x.v128_min="~lib/builtins/v128.min",x.v128_max="~lib/builtins/v128.max",x.v128_pmin="~lib/builtins/v128.pmin",x.v128_pmax="~lib/builtins/v128.pmax",x.v128_dot="~lib/builtins/v128.dot",x.v128_avgr="~lib/builtins/v128.avgr",x.v128_abs="~lib/builtins/v128.abs",x.v128_sqrt="~lib/builtins/v128.sqrt",x.v128_ceil="~lib/builtins/v128.ceil",x.v128_floor="~lib/builtins/v128.floor",x.v128_trunc="~lib/builtins/v128.trunc",x.v128_nearest="~lib/builtins/v128.nearest",x.v128_eq="~lib/builtins/v128.eq",x.v128_ne="~lib/builtins/v128.ne",x.v128_lt="~lib/builtins/v128.lt",x.v128_le="~lib/builtins/v128.le",x.v128_gt="~lib/builtins/v128.gt",x.v128_ge="~lib/builtins/v128.ge",x.v128_convert="~lib/builtins/v128.convert",x.v128_convert_low="~lib/builtins/v128.convert_low",x.v128_trunc_sat="~lib/builtins/v128.trunc_sat",x.v128_trunc_sat_zero="~lib/builtins/v128.trunc_sat_zero",x.v128_narrow="~lib/builtins/v128.narrow",x.v128_extend_low="~lib/builtins/v128.extend_low",x.v128_extend_high="~lib/builtins/v128.extend_high",x.v128_extadd_pairwise="~lib/builtins/v128.extadd_pairwise",x.v128_demote_zero="~lib/builtins/v128.demote_zero",x.v128_promote_low="~lib/builtins/v128.promote_low",x.v128_q15mulr_sat="~lib/builtins/v128.q15mulr_sat",x.v128_extmul_low="~lib/builtins/v128.extmul_low",x.v128_extmul_high="~lib/builtins/v128.extmul_high",x.v128_relaxed_swizzle="~lib/builtins/v128.relaxed_swizzle",x.v128_relaxed_trunc="~lib/builtins/v128.relaxed_trunc",x.v128_relaxed_trunc_zero="~lib/builtins/v128.relaxed_trunc_zero",x.v128_relaxed_madd="~lib/builtins/v128.relaxed_madd",x.v128_relaxed_nmadd="~lib/builtins/v128.relaxed_nmadd",x.v128_relaxed_laneselect="~lib/builtins/v128.relaxed_laneselect",x.v128_relaxed_min="~lib/builtins/v128.relaxed_min",x.v128_relaxed_max="~lib/builtins/v128.relaxed_max",x.v128_relaxed_q15mulr="~lib/builtins/v128.relaxed_q15mulr",x.v128_relaxed_dot="~lib/builtins/v128.relaxed_dot",x.v128_relaxed_dot_add="~lib/builtins/v128.relaxed_dot_add",x.i8x16="~lib/builtins/i8x16",x.i16x8="~lib/builtins/i16x8",x.i32x4="~lib/builtins/i32x4",x.i64x2="~lib/builtins/i64x2",x.f32x4="~lib/builtins/f32x4",x.f64x2="~lib/builtins/f64x2",x.i8x16_splat="~lib/builtins/i8x16.splat",x.i8x16_extract_lane_s="~lib/builtins/i8x16.extract_lane_s",x.i8x16_extract_lane_u="~lib/builtins/i8x16.extract_lane_u",x.i8x16_replace_lane="~lib/builtins/i8x16.replace_lane",x.i8x16_add="~lib/builtins/i8x16.add",x.i8x16_sub="~lib/builtins/i8x16.sub",x.i8x16_mul="~lib/builtins/i8x16.mul",x.i8x16_min_s="~lib/builtins/i8x16.min_s",x.i8x16_min_u="~lib/builtins/i8x16.min_u",x.i8x16_max_s="~lib/builtins/i8x16.max_s",x.i8x16_max_u="~lib/builtins/i8x16.max_u",x.i8x16_avgr_u="~lib/builtins/i8x16.avgr_u",x.i8x16_abs="~lib/builtins/i8x16.abs",x.i8x16_neg="~lib/builtins/i8x16.neg",x.i8x16_add_sat_s="~lib/builtins/i8x16.add_sat_s",x.i8x16_add_sat_u="~lib/builtins/i8x16.add_sat_u",x.i8x16_sub_sat_s="~lib/builtins/i8x16.sub_sat_s",x.i8x16_sub_sat_u="~lib/builtins/i8x16.sub_sat_u",x.i8x16_shl="~lib/builtins/i8x16.shl",x.i8x16_shr_s="~lib/builtins/i8x16.shr_s",x.i8x16_shr_u="~lib/builtins/i8x16.shr_u",x.i8x16_all_true="~lib/builtins/i8x16.all_true",x.i8x16_bitmask="~lib/builtins/i8x16.bitmask",x.i8x16_popcnt="~lib/builtins/i8x16.popcnt",x.i8x16_eq="~lib/builtins/i8x16.eq",x.i8x16_ne="~lib/builtins/i8x16.ne",x.i8x16_lt_s="~lib/builtins/i8x16.lt_s",x.i8x16_lt_u="~lib/builtins/i8x16.lt_u",x.i8x16_le_s="~lib/builtins/i8x16.le_s",x.i8x16_le_u="~lib/builtins/i8x16.le_u",x.i8x16_gt_s="~lib/builtins/i8x16.gt_s",x.i8x16_gt_u="~lib/builtins/i8x16.gt_u",x.i8x16_ge_s="~lib/builtins/i8x16.ge_s",x.i8x16_ge_u="~lib/builtins/i8x16.ge_u",x.i8x16_narrow_i16x8_s="~lib/builtins/i8x16.narrow_i16x8_s",x.i8x16_narrow_i16x8_u="~lib/builtins/i8x16.narrow_i16x8_u",x.i8x16_shuffle="~lib/builtins/i8x16.shuffle",x.i8x16_swizzle="~lib/builtins/i8x16.swizzle",x.i16x8_splat="~lib/builtins/i16x8.splat",x.i16x8_extract_lane_s="~lib/builtins/i16x8.extract_lane_s",x.i16x8_extract_lane_u="~lib/builtins/i16x8.extract_lane_u",x.i16x8_replace_lane="~lib/builtins/i16x8.replace_lane",x.i16x8_add="~lib/builtins/i16x8.add",x.i16x8_sub="~lib/builtins/i16x8.sub",x.i16x8_mul="~lib/builtins/i16x8.mul",x.i16x8_min_s="~lib/builtins/i16x8.min_s",x.i16x8_min_u="~lib/builtins/i16x8.min_u",x.i16x8_max_s="~lib/builtins/i16x8.max_s",x.i16x8_max_u="~lib/builtins/i16x8.max_u",x.i16x8_avgr_u="~lib/builtins/i16x8.avgr_u",x.i16x8_abs="~lib/builtins/i16x8.abs",x.i16x8_neg="~lib/builtins/i16x8.neg",x.i16x8_add_sat_s="~lib/builtins/i16x8.add_sat_s",x.i16x8_add_sat_u="~lib/builtins/i16x8.add_sat_u",x.i16x8_sub_sat_s="~lib/builtins/i16x8.sub_sat_s",x.i16x8_sub_sat_u="~lib/builtins/i16x8.sub_sat_u",x.i16x8_shl="~lib/builtins/i16x8.shl",x.i16x8_shr_s="~lib/builtins/i16x8.shr_s",x.i16x8_shr_u="~lib/builtins/i16x8.shr_u",x.i16x8_all_true="~lib/builtins/i16x8.all_true",x.i16x8_bitmask="~lib/builtins/i16x8.bitmask",x.i16x8_eq="~lib/builtins/i16x8.eq",x.i16x8_ne="~lib/builtins/i16x8.ne",x.i16x8_lt_s="~lib/builtins/i16x8.lt_s",x.i16x8_lt_u="~lib/builtins/i16x8.lt_u",x.i16x8_le_s="~lib/builtins/i16x8.le_s",x.i16x8_le_u="~lib/builtins/i16x8.le_u",x.i16x8_gt_s="~lib/builtins/i16x8.gt_s",x.i16x8_gt_u="~lib/builtins/i16x8.gt_u",x.i16x8_ge_s="~lib/builtins/i16x8.ge_s",x.i16x8_ge_u="~lib/builtins/i16x8.ge_u",x.i16x8_narrow_i32x4_s="~lib/builtins/i16x8.narrow_i32x4_s",x.i16x8_narrow_i32x4_u="~lib/builtins/i16x8.narrow_i32x4_u",x.i16x8_extend_low_i8x16_s="~lib/builtins/i16x8.extend_low_i8x16_s",x.i16x8_extend_low_i8x16_u="~lib/builtins/i16x8.extend_low_i8x16_u",x.i16x8_extend_high_i8x16_s="~lib/builtins/i16x8.extend_high_i8x16_s",x.i16x8_extend_high_i8x16_u="~lib/builtins/i16x8.extend_high_i8x16_u",x.i16x8_extadd_pairwise_i8x16_s="~lib/builtins/i16x8.extadd_pairwise_i8x16_s",x.i16x8_extadd_pairwise_i8x16_u="~lib/builtins/i16x8.extadd_pairwise_i8x16_u",x.i16x8_q15mulr_sat_s="~lib/builtins/i16x8.q15mulr_sat_s",x.i16x8_extmul_low_i8x16_s="~lib/builtins/i16x8.extmul_low_i8x16_s",x.i16x8_extmul_low_i8x16_u="~lib/builtins/i16x8.extmul_low_i8x16_u",x.i16x8_extmul_high_i8x16_s="~lib/builtins/i16x8.extmul_high_i8x16_s",x.i16x8_extmul_high_i8x16_u="~lib/builtins/i16x8.extmul_high_i8x16_u",x.i16x8_shuffle="~lib/builtins/i16x8.shuffle",x.i32x4_splat="~lib/builtins/i32x4.splat",x.i32x4_extract_lane="~lib/builtins/i32x4.extract_lane",x.i32x4_replace_lane="~lib/builtins/i32x4.replace_lane",x.i32x4_add="~lib/builtins/i32x4.add",x.i32x4_sub="~lib/builtins/i32x4.sub",x.i32x4_mul="~lib/builtins/i32x4.mul",x.i32x4_min_s="~lib/builtins/i32x4.min_s",x.i32x4_min_u="~lib/builtins/i32x4.min_u",x.i32x4_max_s="~lib/builtins/i32x4.max_s",x.i32x4_max_u="~lib/builtins/i32x4.max_u",x.i32x4_dot_i16x8_s="~lib/builtins/i32x4.dot_i16x8_s",x.i32x4_abs="~lib/builtins/i32x4.abs",x.i32x4_neg="~lib/builtins/i32x4.neg",x.i32x4_shl="~lib/builtins/i32x4.shl",x.i32x4_shr_s="~lib/builtins/i32x4.shr_s",x.i32x4_shr_u="~lib/builtins/i32x4.shr_u",x.i32x4_all_true="~lib/builtins/i32x4.all_true",x.i32x4_bitmask="~lib/builtins/i32x4.bitmask",x.i32x4_eq="~lib/builtins/i32x4.eq",x.i32x4_ne="~lib/builtins/i32x4.ne",x.i32x4_lt_s="~lib/builtins/i32x4.lt_s",x.i32x4_lt_u="~lib/builtins/i32x4.lt_u",x.i32x4_le_s="~lib/builtins/i32x4.le_s",x.i32x4_le_u="~lib/builtins/i32x4.le_u",x.i32x4_gt_s="~lib/builtins/i32x4.gt_s",x.i32x4_gt_u="~lib/builtins/i32x4.gt_u",x.i32x4_ge_s="~lib/builtins/i32x4.ge_s",x.i32x4_ge_u="~lib/builtins/i32x4.ge_u",x.i32x4_trunc_sat_f32x4_s="~lib/builtins/i32x4.trunc_sat_f32x4_s",x.i32x4_trunc_sat_f32x4_u="~lib/builtins/i32x4.trunc_sat_f32x4_u",x.i32x4_trunc_sat_f64x2_s_zero="~lib/builtins/i32x4.trunc_sat_f64x2_s_zero",x.i32x4_trunc_sat_f64x2_u_zero="~lib/builtins/i32x4.trunc_sat_f64x2_u_zero",x.i32x4_extend_low_i16x8_s="~lib/builtins/i32x4.extend_low_i16x8_s",x.i32x4_extend_low_i16x8_u="~lib/builtins/i32x4.extend_low_i16x8_u",x.i32x4_extend_high_i16x8_s="~lib/builtins/i32x4.extend_high_i16x8_s",x.i32x4_extend_high_i16x8_u="~lib/builtins/i32x4.extend_high_i16x8_u",x.i32x4_extadd_pairwise_i16x8_s="~lib/builtins/i32x4.extadd_pairwise_i16x8_s",x.i32x4_extadd_pairwise_i16x8_u="~lib/builtins/i32x4.extadd_pairwise_i16x8_u",x.i32x4_extmul_low_i16x8_s="~lib/builtins/i32x4.extmul_low_i16x8_s",x.i32x4_extmul_low_i16x8_u="~lib/builtins/i32x4.extmul_low_i16x8_u",x.i32x4_extmul_high_i16x8_s="~lib/builtins/i32x4.extmul_high_i16x8_s",x.i32x4_extmul_high_i16x8_u="~lib/builtins/i32x4.extmul_high_i16x8_u",x.i32x4_shuffle="~lib/builtins/i32x4.shuffle",x.i64x2_splat="~lib/builtins/i64x2.splat",x.i64x2_extract_lane="~lib/builtins/i64x2.extract_lane",x.i64x2_replace_lane="~lib/builtins/i64x2.replace_lane",x.i64x2_add="~lib/builtins/i64x2.add",x.i64x2_sub="~lib/builtins/i64x2.sub",x.i64x2_mul="~lib/builtins/i64x2.mul",x.i64x2_abs="~lib/builtins/i64x2.abs",x.i64x2_neg="~lib/builtins/i64x2.neg",x.i64x2_shl="~lib/builtins/i64x2.shl",x.i64x2_shr_s="~lib/builtins/i64x2.shr_s",x.i64x2_shr_u="~lib/builtins/i64x2.shr_u",x.i64x2_all_true="~lib/builtins/i64x2.all_true",x.i64x2_bitmask="~lib/builtins/i64x2.bitmask",x.i64x2_eq="~lib/builtins/i64x2.eq",x.i64x2_ne="~lib/builtins/i64x2.ne",x.i64x2_lt_s="~lib/builtins/i64x2.lt_s",x.i64x2_lt_u="~lib/builtins/i64x2.lt_u",x.i64x2_le_s="~lib/builtins/i64x2.le_s",x.i64x2_le_u="~lib/builtins/i64x2.le_u",x.i64x2_gt_s="~lib/builtins/i64x2.gt_s",x.i64x2_gt_u="~lib/builtins/i64x2.gt_u",x.i64x2_ge_s="~lib/builtins/i64x2.ge_s",x.i64x2_ge_u="~lib/builtins/i64x2.ge_u",x.i64x2_extend_low_i32x4_s="~lib/builtins/i64x2.extend_low_i32x4_s",x.i64x2_extend_low_i32x4_u="~lib/builtins/i64x2.extend_low_i32x4_u",x.i64x2_extend_high_i32x4_s="~lib/builtins/i64x2.extend_high_i32x4_s",x.i64x2_extend_high_i32x4_u="~lib/builtins/i64x2.extend_high_i32x4_u",x.i64x2_extmul_low_i32x4_s="~lib/builtins/i64x2.extmul_low_i32x4_s",x.i64x2_extmul_low_i32x4_u="~lib/builtins/i64x2.extmul_low_i32x4_u",x.i64x2_extmul_high_i32x4_s="~lib/builtins/i64x2.extmul_high_i32x4_s",x.i64x2_extmul_high_i32x4_u="~lib/builtins/i64x2.extmul_high_i32x4_u",x.i64x2_shuffle="~lib/builtins/i64x2.shuffle",x.f32x4_splat="~lib/builtins/f32x4.splat",x.f32x4_extract_lane="~lib/builtins/f32x4.extract_lane",x.f32x4_replace_lane="~lib/builtins/f32x4.replace_lane",x.f32x4_add="~lib/builtins/f32x4.add",x.f32x4_sub="~lib/builtins/f32x4.sub",x.f32x4_mul="~lib/builtins/f32x4.mul",x.f32x4_div="~lib/builtins/f32x4.div",x.f32x4_neg="~lib/builtins/f32x4.neg",x.f32x4_min="~lib/builtins/f32x4.min",x.f32x4_max="~lib/builtins/f32x4.max",x.f32x4_pmin="~lib/builtins/f32x4.pmin",x.f32x4_pmax="~lib/builtins/f32x4.pmax",x.f32x4_abs="~lib/builtins/f32x4.abs",x.f32x4_sqrt="~lib/builtins/f32x4.sqrt",x.f32x4_ceil="~lib/builtins/f32x4.ceil",x.f32x4_floor="~lib/builtins/f32x4.floor",x.f32x4_trunc="~lib/builtins/f32x4.trunc",x.f32x4_nearest="~lib/builtins/f32x4.nearest",x.f32x4_eq="~lib/builtins/f32x4.eq",x.f32x4_ne="~lib/builtins/f32x4.ne",x.f32x4_lt="~lib/builtins/f32x4.lt",x.f32x4_le="~lib/builtins/f32x4.le",x.f32x4_gt="~lib/builtins/f32x4.gt",x.f32x4_ge="~lib/builtins/f32x4.ge",x.f32x4_convert_i32x4_s="~lib/builtins/f32x4.convert_i32x4_s",x.f32x4_convert_i32x4_u="~lib/builtins/f32x4.convert_i32x4_u",x.f32x4_demote_f64x2_zero="~lib/builtins/f32x4.demote_f64x2_zero",x.f32x4_shuffle="~lib/builtins/f32x4.shuffle",x.f64x2_splat="~lib/builtins/f64x2.splat",x.f64x2_extract_lane="~lib/builtins/f64x2.extract_lane",x.f64x2_replace_lane="~lib/builtins/f64x2.replace_lane",x.f64x2_add="~lib/builtins/f64x2.add",x.f64x2_sub="~lib/builtins/f64x2.sub",x.f64x2_mul="~lib/builtins/f64x2.mul",x.f64x2_div="~lib/builtins/f64x2.div",x.f64x2_neg="~lib/builtins/f64x2.neg",x.f64x2_min="~lib/builtins/f64x2.min",x.f64x2_max="~lib/builtins/f64x2.max",x.f64x2_pmin="~lib/builtins/f64x2.pmin",x.f64x2_pmax="~lib/builtins/f64x2.pmax",x.f64x2_abs="~lib/builtins/f64x2.abs",x.f64x2_sqrt="~lib/builtins/f64x2.sqrt",x.f64x2_ceil="~lib/builtins/f64x2.ceil",x.f64x2_floor="~lib/builtins/f64x2.floor",x.f64x2_trunc="~lib/builtins/f64x2.trunc",x.f64x2_nearest="~lib/builtins/f64x2.nearest",x.f64x2_eq="~lib/builtins/f64x2.eq",x.f64x2_ne="~lib/builtins/f64x2.ne",x.f64x2_lt="~lib/builtins/f64x2.lt",x.f64x2_le="~lib/builtins/f64x2.le",x.f64x2_gt="~lib/builtins/f64x2.gt",x.f64x2_ge="~lib/builtins/f64x2.ge",x.f64x2_convert_low_i32x4_s="~lib/builtins/f64x2.convert_low_i32x4_s",x.f64x2_convert_low_i32x4_u="~lib/builtins/f64x2.convert_low_i32x4_u",x.f64x2_promote_low_f32x4="~lib/builtins/f64x2.promote_low_f32x4",x.f64x2_shuffle="~lib/builtins/f64x2.shuffle",x.i8x16_relaxed_swizzle="~lib/builtins/i8x16.relaxed_swizzle",x.i32x4_relaxed_trunc_f32x4_s="~lib/builtins/i32x4.relaxed_trunc_f32x4_s",x.i32x4_relaxed_trunc_f32x4_u="~lib/builtins/i32x4.relaxed_trunc_f32x4_u",x.i32x4_relaxed_trunc_f64x2_s_zero="~lib/builtins/i32x4.relaxed_trunc_f64x2_s_zero",x.i32x4_relaxed_trunc_f64x2_u_zero="~lib/builtins/i32x4.relaxed_trunc_f64x2_u_zero",x.f32x4_relaxed_madd="~lib/builtins/f32x4.relaxed_madd",x.f32x4_relaxed_nmadd="~lib/builtins/f32x4.relaxed_nmadd",x.f64x2_relaxed_madd="~lib/builtins/f64x2.relaxed_madd",x.f64x2_relaxed_nmadd="~lib/builtins/f64x2.relaxed_nmadd",x.i8x16_relaxed_laneselect="~lib/builtins/i8x16.relaxed_laneselect",x.i16x8_relaxed_laneselect="~lib/builtins/i16x8.relaxed_laneselect",x.i32x4_relaxed_laneselect="~lib/builtins/i32x4.relaxed_laneselect",x.i64x2_relaxed_laneselect="~lib/builtins/i64x2.relaxed_laneselect",x.f32x4_relaxed_min="~lib/builtins/f32x4.relaxed_min",x.f32x4_relaxed_max="~lib/builtins/f32x4.relaxed_max",x.f64x2_relaxed_min="~lib/builtins/f64x2.relaxed_min",x.f64x2_relaxed_max="~lib/builtins/f64x2.relaxed_max",x.i16x8_relaxed_q15mulr_s="~lib/builtins/i16x8.relaxed_q15mulr_s",x.i16x8_relaxed_dot_i8x16_i7x16_s="~lib/builtins/i16x8.relaxed_dot_i8x16_i7x16_s",x.i32x4_relaxed_dot_i8x16_i7x16_add_s="~lib/builtins/i32x4.relaxed_dot_i8x16_i7x16_add_s",x.i31_new="~lib/builtins/i31.new",x.i31_get="~lib/builtins/i31.get",x.data_end="~lib/memory/__data_end",x.stack_pointer="~lib/memory/__stack_pointer",x.heap_base="~lib/memory/__heap_base",x.rtti_base="~lib/rt/__rtti_base",x.visit_globals="~lib/rt/__visit_globals",x.visit_members="~lib/rt/__visit_members",x.tostack="~lib/rt/__tostack",x.NaN="~lib/number/NaN",x.Infinity="~lib/number/Infinity",x.isNaN="~lib/number/isNaN",x.isFinite="~lib/number/isFinite",x.ERROR="~lib/diagnostics/ERROR",x.WARNING="~lib/diagnostics/WARNING",x.INFO="~lib/diagnostics/INFO",x.Function="~lib/function/Function",x.Function_call="~lib/function/Function#call",x.memory_size="~lib/memory/memory.size",x.memory_grow="~lib/memory/memory.grow",x.memory_copy="~lib/memory/memory.copy",x.memory_fill="~lib/memory/memory.fill",x.memory_data="~lib/memory/memory.data",x.Int8Array="~lib/typedarray/Int8Array",x.Uint8Array="~lib/typedarray/Uint8Array",x.Uint8ClampedArray="~lib/typedarray/Uint8ClampedArray",x.Int16Array="~lib/typedarray/Int16Array",x.Uint16Array="~lib/typedarray/Uint16Array",x.Int32Array="~lib/typedarray/Int32Array",x.Uint32Array="~lib/typedarray/Uint32Array",x.Int64Array="~lib/typedarray/Int64Array",x.Uint64Array="~lib/typedarray/Uint64Array",x.Float32Array="~lib/typedarray/Float32Array",x.Float64Array="~lib/typedarray/Float64Array",x.String_raw="~lib/string/String.raw",x.String_eq="~lib/string/String.__eq",x.String_ne="~lib/string/String.__ne",x.String_not="~lib/string/String.__not",x.Object="~lib/object/Object"))(g||={});var Yo=class{constructor(r,e,t,i,s){this.resolver=r;this.node=e;this.ctxElement=t;this.ctxTypes=i;this.reportMode=s}},Ws=class{constructor(r,e,t=e.type,i=e.identifierNode){this.compiler=r;this.element=e;this.contextualType=t;this.reportNode=i}},iu=class{constructor(r,e,t,i,s,a,l,o){this.compiler=r;this.prototype=e;this.typeArguments=t;this.operands=i;this.thisOperand=s;this.contextualType=a;this.reportNode=l;this.contextIsExact=o}},tr=new Map,E=new Map,sr=new Map,At=new Map;function Y1(n){let r=n.resolver,e=n.node,t=n.ctxElement,i=n.ctxTypes,s=n.reportMode,a=r.ensureOneTypeArgument(e,s);if(!a)return null;let l=r.resolveType(a,null,t,i,s);if(!l)return null;switch(l.kind){case 1:case 2:case 3:return p.i32;case 5:if(!r.program.options.isWasm64)return p.i32;case 4:return p.i64;case 6:case 7:case 8:case 0:return p.u32;case 10:if(!r.program.options.isWasm64)return p.u32;case 9:return p.u64;case 11:return p.f32;case 12:return p.f64;case 13:return p.v128;case 26:return p.void;default:assert(!1)}return null}tr.set(B.native,Y1);function J1(n){let r=n.resolver,e=n.node,t=n.ctxElement,i=n.ctxTypes,s=n.reportMode,a=r.ensureOneTypeArgument(e,s);if(!a)return null;let l=r.resolveType(a,null,t,i,s);if(!l)return null;let o=l.classReference;if(!o)return s==0&&r.error(2329,a.range,l.toString()),null;let u=o.lookupOverload(1);if(u){let c=u.signature.parameterTypes;return u.is(32)?(assert(c.length==2),c[1]):(assert(c.length==1),c[0])}return s==0&&r.error(2329,a.range,l.toString()),null}tr.set(B.indexof,J1);function eA(n){let r=n.resolver,e=n.node,t=n.ctxElement,i=n.ctxTypes,s=n.reportMode,a=r.ensureOneTypeArgument(e,s);if(!a)return null;let l=r.resolveType(a,null,t,i,s);if(!l)return null;let o=l.getClassOrWrapper(r.program);if(o){let u=o.lookupOverload(1);if(u)return u.signature.returnType}return s==0&&r.error(2329,a.range,l.toString()),null}tr.set(B.valueof,eA);function tA(n){let r=n.resolver,e=n.node,t=n.ctxElement,i=n.ctxTypes,s=n.reportMode,a=r.ensureOneTypeArgument(e,s);if(!a)return null;let l=r.resolveType(a,null,t,i,s);if(!l)return null;let o=l.getSignature();return o?o.returnType:(s==0&&r.error(2757,a.range,l.toString()),null)}tr.set(B.returnof,tA);function rA(n){let r=n.resolver,e=n.node,t=n.ctxElement,i=n.ctxTypes,s=n.reportMode,a=r.ensureOneTypeArgument(e,s);if(!a)return null;let l=r.resolveType(a,null,t,i,s);if(!l)return null;let o=l.getSignature();if(o){let u=o.thisType;return u||p.any}return s==0&&r.error(2757,a.range,l.toString()),null}tr.set(B.thisof,rA);function nA(n){let r=n.resolver,e=n.node,t=n.ctxElement,i=n.ctxTypes,s=n.reportMode,a=r.ensureOneTypeArgument(e,s);if(!a)return null;let l=r.resolveType(a,null,t,i,s);return l?l.isNullableReference?l.nonNullableType:l:null}tr.set(B.nonnull,nA);var oi=0;function iA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isBooleanValue?1:0)):e.unreachable()}E.set(g.isBoolean,iA);function sA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isIntegerValue?1:0)):e.unreachable()}E.set(g.isInteger,sA);function aA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isSignedIntegerValue?1:0)):e.unreachable()}E.set(g.isSigned,aA);function lA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isFloatValue?1:0)):e.unreachable()}E.set(g.isFloat,lA);function oA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isVectorValue?1:0)):e.unreachable()}E.set(g.isVector,oA);function uA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isReference?1:0)):e.unreachable()}E.set(g.isReference,uA);function cA(n){let r=n.compiler,e=r.module,t=Ve(n);if(r.currentType=p.bool,!t)return e.unreachable();let i=t.getClass();return ke(n,e.i32(i&&i.isAssignableTo(r.program.stringInstance)?1:0))}E.set(g.isString,cA);function pA(n){let r=n.compiler,e=r.module,t=Ve(n);if(r.currentType=p.bool,!t)return e.unreachable();let i=t.getClass();return ke(n,e.i32(i&&i.extendsPrototype(r.program.arrayPrototype)?1:0))}E.set(g.isArray,pA);function fA(n){let r=n.compiler,e=r.module,t=Ve(n);if(r.currentType=p.bool,!t)return e.unreachable();let i=t.getClass();return ke(n,e.i32(i&&i.isArrayLike?1:0))}E.set(g.isArrayLike,fA);function _A(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isFunction?1:0)):e.unreachable()}E.set(g.isFunction,_A);function dA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isNullableReference?1:0)):e.unreachable()}E.set(g.isNullable,dA);function hA(n){let r=n.compiler,e=r.module;if(r.currentType=p.bool,F(n)|K(n,1))return e.unreachable();let t=r.resolver.lookupExpression(n.operands[0],r.currentFlow,p.auto,1);return e.i32(t?1:0)}E.set(g.isDefined,hA);function mA(n){let r=n.compiler,e=r.module;if(r.currentType=p.bool,F(n)|K(n,1))return e.unreachable();let t=r.compileExpression(n.operands[0],p.auto);return r.currentType=p.bool,Wo(t,e.ref)?e.block(null,[e.maybeDrop(t),e.i32(0)],pe(t)):e.i32(e.isConstExpression(t)?1:0)}E.set(g.isConstant,mA);function yA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isManaged?1:0)):e.unreachable()}E.set(g.isManaged,yA);function gA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.kind==26?1:0)):e.unreachable()}E.set(g.isVoid,gA);function bA(n){let r=n.compiler,e=r.module,t=Ve(n);if(r.currentType=p.i32,!t)return e.unreachable();let i=t.signatureReference;return i?ke(n,e.i32(i.parameterTypes.length)):(r.error(2757,n.reportNode.range,t.toString()),e.unreachable())}E.set(g.lengthof,bA);function xA(n){let r=n.compiler,e=r.module;if(r.currentType=r.options.usizeType,$(n)|K(n,0))return e.unreachable();let t=n.typeArguments[0];if(t.kind==27)return r.error(100,n.reportNode.typeArgumentsRange,"sizeof of an unmanaged array ([T *]) \u2014 it is a pointer with no length, so it has no extent; use sizeof<T>() for the element and carry the count separately"),e.unreachable();if(t.kind==28)return r.error(100,n.reportNode.typeArgumentsRange,"sizeof of a dynamic array view is the pointer size (4), not the data size; use `.length * sizeof<T>` for the element count"),e.unreachable();{let a=t.classReference;if(a!=null&&a.prototype.internalName==r.resolver.program.dynamicArrayPrototype.internalName)return r.error(100,n.reportNode.typeArgumentsRange,"sizeof of a dynamic array view is the pointer size (4), not the data size; use `.length * sizeof<T>` for the element count"),e.unreachable()}let i=t.byteSize;if(!i)return r.error(203,n.reportNode.typeArgumentsRange,"sizeof",t.toString()),e.unreachable();let s=t.classReference;return s!=null&&(s.hasDecorator(16)||s.hasDecorator(2048))?nn(r,i64_new(s.nextMemoryOffset),n.contextualType):nn(r,i64_new(i),n.contextualType)}E.set(g.sizeof,xA);function EA(n){let r=n.compiler,e=r.module;if(r.currentType=r.options.usizeType,$(n)|K(n,0))return e.unreachable();let t=n.typeArguments[0],i=t.byteSize;if(!i||t.kind!=14&&!Hr(i))return r.error(203,n.reportNode.typeArgumentsRange,"alignof",t.toString()),e.unreachable();let s=t.classReference;return s!=null&&(s.hasDecorator(16)||s.hasDecorator(2048))?nn(r,i64_new(s.alignLog2),n.contextualType):nn(r,i64_new(t.alignLog2),n.contextualType)}E.set(g.alignof,EA);function AA(n){let r=n.compiler,e=r.module;if(r.currentType=r.options.usizeType,$(n)|Be(n,0,1))return e.unreachable();let t=n.operands,i=n.contextualType,s=n.typeArguments[0];if(s.kind==14)return n.operands.length?(r.error(203,n.reportNode.range,"offsetof",s.toString()),e.unreachable()):nn(r,i64_new(s.byteSize),n.contextualType);let a=s.getClassOrWrapper(r.program);if(!a)return r.error(203,n.reportNode.typeArgumentsRange,"offsetof",s.toString()),r.options.isWasm64?i.isIntegerValue&&i.size<=32&&(r.currentType=p.u32):i.isIntegerValue&&i.size==64&&(r.currentType=p.u64),e.unreachable();if(t.length){let l=t[0];if(!l.isLiteralKind(2))return r.error(1141,t[0].range),e.unreachable();let o=l.value,u=a.getMember(o);if(u&&u.kind==10){let c=u.instance;if(c&&c.isField)return assert(c.memoryOffset>=0),nn(r,i64_new(c.memoryOffset),i)}return r.error(2460,l.range,a.internalName,o),e.unreachable()}return nn(r,i64_new(a.nextMemoryOffset),i)}E.set(g.offsetof,AA);function TA(n){let r=n.compiler,e=r.module;if(r.currentType=r.program.stringInstance.type,$(n)|K(n,1))return e.unreachable();let t=n.typeArguments[0],i=t.getClassOrWrapper(r.program);if(!i)return r.error(203,n.reportNode.typeArgumentsRange,"abiNameOf",t.toString()),e.unreachable();let s=n.operands[0];if(!s.isLiteralKind(2))return r.error(1141,s.range),e.unreachable();let a=s.value,l=i.getMember(a);if(!l||l.kind!=10)return r.error(2460,s.range,i.internalName,a),e.unreachable();let o=l.fieldDeclaration,u=o?o.type:null,c=u?u.attributes:null;if(c)for(let f=0,_=c.length;f<_;++f){if(!SA(c[f]))continue;let d=c[f].args,m=d&&d.length?d[0]:null;if(m&&m.isLiteralKind(2))return ke(n,r.ensureStaticString(m.value));break}return ke(n,r.ensureStaticString(a))}E.set(g.abiNameOf,TA);function SA(n){let r=n.name;if(r.kind!=23)return!1;let e=r,t=e.expression;return t.kind!=8?!1:t.text=="abi"&&e.property.text=="alias"}function vA(n){let r=n.compiler,e=r.module,t=Ve(n);if(!t)return r.currentType=r.program.stringInstance.type,e.unreachable();let i;if(t.isInternalReference){let s=t.getClass();s?i=s.name:(assert(t.getSignature()),i="Function")}else i=t.toString();return ke(n,r.ensureStaticString(i))}E.set(g.nameof,vA);function IA(n){let r=n.compiler,e=r.module,t=Ve(n);if(r.currentType=p.u32,!t)return e.unreachable();let i=t.getSignature();if(i)return ke(n,e.i32(i.id));let s=t.getClassOrWrapper(r.program);return s&&!s.hasDecorator(16)?ke(n,e.i32(s.id)):(r.error(203,n.reportNode.typeArgumentsRange,"idof",t.toString()),e.unreachable())}E.set(g.idof,IA);function kA(n){let r=n.element;if(r.is(1048576)){let e=n.compiler.module;e.addGlobal(r.internalName,P.F64,!1,e.f64(NaN))}}sr.set(g.NaN,kA);function FA(n){let r=n.compiler,e=r.module;return n.contextualType==p.f32?(r.currentType=p.f32,e.f32(NaN)):(r.currentType=p.f64,e.f64(NaN))}At.set(g.NaN,FA);function wA(n){let r=n.element;if(r.is(1048576)){let e=n.compiler.module;e.addGlobal(r.internalName,P.F64,!1,e.f64(1/0))}}sr.set(g.Infinity,wA);function RA(n){let r=n.compiler,e=r.module;return n.contextualType==p.f32?(r.currentType=p.f32,e.f32(1/0)):(r.currentType=p.f64,e.f64(1/0))}At.set(g.Infinity,RA);function Pf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.typeArguments,i=t?r.compileExpression(n.operands[0],t[0],5):r.compileExpression(n.operands[0],p.i32,4),s=r.currentType;if(s.isValue)switch(s.kind){case 0:case 1:case 6:case 2:case 7:case 3:case 8:return e.unary(0,i);case 5:case 10:return e.unary(142,i);case 4:case 9:return e.unary(1,i)}return r.error(203,n.reportNode.typeArgumentsRange,"clz",s.toString()),e.unreachable()}E.set(g.clz,Pf);function Nf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],5):r.compileExpression(t[0],p.i32,4),a=r.currentType;if(a.isValue)switch(a.kind){case 0:case 1:case 6:case 2:case 7:case 3:case 8:return e.unary(2,s);case 5:case 10:return e.unary(143,s);case 4:case 9:return e.unary(3,s)}return r.error(203,n.reportNode.typeArgumentsRange,"ctz",a.toString()),e.unreachable()}E.set(g.ctz,Nf);function Bf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],5):r.compileExpression(t[0],p.i32,4),a=r.currentType;if(a.isValue)switch(r.currentType.kind){case 0:return s;case 1:case 6:case 2:case 7:case 3:case 8:return e.unary(4,s);case 4:case 9:return e.unary(5,s);case 5:case 10:return e.unary(144,s)}return r.error(203,n.reportNode.typeArgumentsRange,"popcnt",a.toString()),e.unreachable()}E.set(g.popcnt,Bf);function Lf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],5):r.compileExpression(t[0],p.i32,4),a=r.currentType;if(a.isValue){let l=r.compileExpression(t[1],a,1);switch(a.kind){case 0:return s;case 1:case 2:case 6:case 7:{let o=r.currentFlow,u=o.getTempLocal(a);o.setLocalFlag(u.index,2);let c=o.getTempLocal(a);return o.setLocalFlag(c.index,2),e.binary(8,e.binary(10,e.local_tee(u.index,s,!1),e.binary(7,e.local_tee(c.index,l,!1),e.i32(a.size-1))),e.binary(12,e.local_get(u.index,P.I32),e.binary(7,e.binary(1,e.i32(0),e.local_get(c.index,P.I32)),e.i32(a.size-1))))}case 3:case 8:return e.binary(13,s,l);case 4:case 9:return e.binary(38,s,l);case 5:case 10:return e.binary(230,s,l)}}return r.error(203,n.reportNode.typeArgumentsRange,"rotl",a.toString()),e.unreachable()}E.set(g.rotl,Lf);function Mf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],5):r.compileExpression(t[0],p.i32,4),a=r.currentType;if(a.isValue){let l=r.compileExpression(t[1],a,1);switch(a.kind){case 0:return s;case 1:case 2:case 6:case 7:{let o=r.currentFlow,u=o.getTempLocal(a);o.setLocalFlag(u.index,2);let c=o.getTempLocal(a);return o.setLocalFlag(c.index,2),e.binary(8,e.binary(12,e.local_tee(u.index,s,!1),e.binary(7,e.local_tee(c.index,l,!1),e.i32(a.size-1))),e.binary(10,e.local_get(u.index,P.I32),e.binary(7,e.binary(1,e.i32(0),e.local_get(c.index,P.I32)),e.i32(a.size-1))))}case 3:case 8:return e.binary(14,s,l);case 4:case 9:return e.binary(39,s,l);case 5:case 10:return e.binary(231,s,l)}}return r.error(203,n.reportNode.typeArgumentsRange,"rotr",a.toString()),e.unreachable()}E.set(g.rotr,Mf);function zf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],5):r.compileExpression(t[0],p.auto,4),a=r.currentType;if(a.isValue)switch(a.kind){case 0:case 6:case 7:case 8:case 9:case 10:return s;case 1:case 2:case 3:{let l=r.currentFlow,o=l.getTempLocal(p.i32),u=l.getTempLocal(p.i32);return e.binary(9,e.binary(0,e.local_tee(u.index,e.binary(11,e.local_tee(o.index,s,!1),e.i32(31)),!1),e.local_get(o.index,P.I32)),e.local_get(u.index,P.I32))}case 5:{let l=r.options,o=r.currentFlow,u=o.getTempLocal(l.usizeType),c=o.getTempLocal(l.usizeType);return e.binary(226,e.binary(217,e.local_tee(c.index,e.binary(228,e.local_tee(u.index,s,!1),r.options.isWasm64?e.i64(63):e.i32(31)),!1),e.local_get(u.index,l.sizeTypeRef)),e.local_get(c.index,l.sizeTypeRef))}case 4:{let l=r.currentFlow,o=l.getTempLocal(p.i64),u=l.getTempLocal(p.i64);return e.binary(34,e.binary(25,e.local_tee(u.index,e.binary(36,e.local_tee(o.index,s,!1),e.i64(63)),!1),e.local_get(o.index,P.I64)),e.local_get(u.index,P.I64))}case 11:return e.unary(8,s);case 12:return e.unary(9,s)}return r.error(203,n.reportNode.typeArgumentsRange,"abs",a.toString()),e.unreachable()}E.set(g.abs,zf);function Df(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],5):r.compileExpression(t[0],p.auto,4),l=r.currentType;if(l.isValue){let o;!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l,4),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,5))):o=r.compileExpression(t[1],l,5);let u=-1;switch(l.kind){case 1:case 2:case 3:{u=21;break}case 0:case 6:case 7:case 8:{u=22;break}case 4:{u=46;break}case 9:{u=47;break}case 5:{u=238;break}case 10:{u=239;break}case 11:return e.binary(56,a,o);case 12:return e.binary(69,a,o)}if(u!=-1){let c=r.currentFlow,f=l.toRef(),_=c.getTempLocal(l);c.setLocalFlag(_.index,2);let d=c.getTempLocal(l);return c.setLocalFlag(d.index,2),e.select(e.local_tee(_.index,a,!1),e.local_tee(d.index,o,!1),e.binary(u,e.local_get(_.index,f),e.local_get(d.index,f)))}}return r.error(203,n.reportNode.typeArgumentsRange,"max",l.toString()),e.unreachable()}E.set(g.max,Df);function Gf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],5):r.compileExpression(t[0],p.auto,4),l=r.currentType;if(l.isValue){let o;!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l,4),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,5))):o=r.compileExpression(t[1],l,5);let u=-1;switch(l.kind){case 1:case 2:case 3:{u=17;break}case 0:case 6:case 7:case 8:{u=18;break}case 4:{u=42;break}case 9:{u=43;break}case 5:{u=234;break}case 10:{u=235;break}case 11:return e.binary(55,a,o);case 12:return e.binary(68,a,o)}if(u!=-1){let c=r.currentFlow,f=l.toRef(),_=c.getTempLocal(l);c.setLocalFlag(_.index,2);let d=c.getTempLocal(l);return c.setLocalFlag(d.index,2),e.select(e.local_tee(_.index,a,!1),e.local_tee(d.index,o,!1),e.binary(u,e.local_get(_.index,f),e.local_get(d.index,f)))}}return r.error(203,n.reportNode.typeArgumentsRange,"min",l.toString()),e.unreachable()}E.set(g.min,Gf);function Uf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.auto,0),a=r.currentType;if(a.isValue)switch(a.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return s;case 11:return e.unary(10,s);case 12:return e.unary(11,s)}return r.error(203,n.reportNode.typeArgumentsRange,"ceil",a.toString()),e.unreachable()}E.set(g.ceil,Uf);function Vf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.auto,0),a=r.currentType;if(a.isValue)switch(a.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return s;case 11:return e.unary(12,s);case 12:return e.unary(13,s)}return r.error(203,n.reportNode.typeArgumentsRange,"floor",a.toString()),e.unreachable()}E.set(g.floor,Vf);function Of(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.f64,0),a=r.currentType;if(a.isValue){let l=r.compileExpression(t[1],a,1);switch(a.kind){case 11:return e.binary(54,s,l);case 12:return e.binary(67,s,l)}}return r.error(203,n.reportNode.typeArgumentsRange,"copysign",a.toString()),e.unreachable()}E.set(g.copysign,Of);function qf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.auto,0),a=r.currentType;if(a.isValue)switch(a.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return s;case 11:return e.unary(16,s);case 12:return e.unary(17,s)}return r.error(203,n.reportNode.typeArgumentsRange,"nearest",a.toString()),e.unreachable()}E.set(g.nearest,qf);function Ks(n){let r=n.compiler,e=r.module;if($(n,!0)|K(n,1))return e.unreachable();let t=n.operands,s=n.typeArguments[0];if(s.isValue)switch(s.kind){case 3:case 8:{let a=r.compileExpression(t[0],p.f32,1);return r.currentType=s,e.unary(33,a)}case 4:case 9:{let a=r.compileExpression(t[0],p.f64,1);return r.currentType=s,e.unary(34,a)}case 5:case 10:{let a=r.options.isWasm64,l=r.compileExpression(t[0],a?p.f64:p.f32,1);return r.currentType=s,e.unary(a?34:33,l)}case 11:{let a=r.compileExpression(t[0],p.i32,1);return r.currentType=p.f32,e.unary(45,a)}case 12:{let a=r.compileExpression(t[0],p.i64,1);return r.currentType=p.f64,e.unary(46,a)}}return r.error(203,n.reportNode.typeArgumentsRange,"reinterpret",s.toString()),e.unreachable()}E.set(g.reinterpret,Ks);function Wf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.f64,0),a=r.currentType;if(a.isValue)switch(a.kind){case 11:return e.unary(18,s);case 12:return e.unary(19,s)}return r.error(203,n.reportNode.typeArgumentsRange,"sqrt",a.toString()),e.unreachable()}E.set(g.sqrt,Wf);function Kf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.auto,0),a=r.currentType;if(a.isValue)switch(a.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return s;case 11:return e.unary(14,s);case 12:return e.unary(15,s)}return r.error(203,n.reportNode.typeArgumentsRange,"trunc",a.toString()),e.unreachable()}E.set(g.trunc,Kf);function CA(n){let r=n.compiler,e=r.module;if(de(n)|K(n,1))return r.currentType=p.bool,e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.auto),a=r.currentType;if(r.currentType=p.bool,a.isValue)switch(a.kind){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return e.maybeDropCondition(s,e.i32(0));case 11:{if(re(s)==8)return e.binary(58,s,e.local_get(Pt(s),P.F32));let o=r.currentFlow.getTempLocal(p.f32);return e.binary(58,e.local_tee(o.index,s,!1),e.local_get(o.index,P.F32))}case 12:{if(re(s)==8)return e.binary(71,s,e.local_get(Pt(s),P.F64));let o=r.currentFlow.getTempLocal(p.f64);return e.binary(71,e.local_tee(o.index,s,!1),e.local_get(o.index,P.F64))}}return r.error(203,n.reportNode.typeArgumentsRange,"isNaN",a.toString()),e.unreachable()}E.set(g.isNaN,CA);function PA(n){let r=n.compiler,e=r.module;if(de(n)|K(n,1))return r.currentType=p.bool,e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.auto),a=r.currentType;if(r.currentType=p.bool,a.isValue)switch(a.kind){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return e.maybeDropCondition(s,e.i32(1));case 11:{if(re(s)==8)return e.binary(57,e.binary(51,s,e.local_get(Pt(s),P.F32)),e.f32(0));let o=r.currentFlow.getTempLocal(p.f32);return e.binary(57,e.binary(51,e.local_tee(o.index,s,!1),e.local_get(o.index,P.F32)),e.f32(0))}case 12:{if(re(s)==8)return e.binary(70,e.binary(64,s,e.local_get(Pt(s),P.F64)),e.f64(0));let o=r.currentFlow.getTempLocal(p.f64);return e.binary(70,e.binary(64,e.local_tee(o.index,s,!1),e.local_get(o.index,P.F64)),e.f64(0))}}return r.error(203,n.reportNode.typeArgumentsRange,"isFinite",a.toString()),e.unreachable()}E.set(g.isFinite,PA);function NA(n){let r=n.compiler,e=r.module,t=n.element,i=t.type;r.runtimeFeatures|=4,e.addGlobal(t.internalName,i.toRef(),!0,r.makeZero(i))}sr.set(g.heap_base,NA);function BA(n){let r=n.compiler,e=r.module,t=n.element,i=t.type;return r.runtimeFeatures|=4,r.currentType=i,e.global_get(t.internalName,i.toRef())}At.set(g.heap_base,BA);function LA(n){let r=n.compiler,e=r.module,t=n.element,i=t.type;r.runtimeFeatures|=1,e.addGlobal(t.internalName,i.toRef(),!0,r.makeZero(i))}sr.set(g.data_end,LA);function MA(n){let r=n.compiler,e=r.module,t=n.element,i=t.type;return r.runtimeFeatures|=1,r.currentType=i,e.global_get(t.internalName,i.toRef())}At.set(g.data_end,MA);function zA(n){let r=n.compiler,e=r.module,t=n.element,i=t.type;r.runtimeFeatures|=2,e.addGlobal(t.internalName,i.toRef(),!0,r.makeZero(i))}sr.set(g.stack_pointer,zA);function DA(n){let r=n.compiler,e=r.module,t=n.element,i=t.type;return r.runtimeFeatures|=2,r.currentType=i,e.global_get(t.internalName,i.toRef())}At.set(g.stack_pointer,DA);function GA(n){let r=n.compiler,e=r.module,t=n.element,i=t.type;r.runtimeFeatures|=8,e.addGlobal(t.internalName,i.toRef(),!0,r.makeZero(i))}sr.set(g.rtti_base,GA);function UA(n){let r=n.compiler,e=r.module,t=n.element,i=t.type;return r.runtimeFeatures|=8,r.currentType=i,e.global_get(t.internalName,i.toRef())}At.set(g.rtti_base,UA);function Ue(n){let r=n.compiler,e=r.module;if($(n,!0)|Be(n,1,3))return e.unreachable();let t=n.operands,i=n.typeArguments,s=n.contextualType,a=i[0],l=s!=p.auto&&a.isIntegerValue&&s.isIntegerValue&&s.size>a.size?s:a;if(!l.isMemory)return r.error(203,n.reportNode.typeArgumentsRange,"load",l.toString()),r.currentType=p.void,e.unreachable();let o=r.compileExpression(t[0],r.options.usizeType,1),u=t.length,c=0,f=a.byteSize;return u>=2&&(c=_t(t[1],r),c<0||u==3&&(f=ir(t[2],f,r),f<0))?(r.currentType=l,e.unreachable()):(r.currentType=l,e.load(a.byteSize,a.isSignedIntegerValue,o,l.toRef(),c,f))}E.set(g.load,Ue);function Tt(n){let r=n.compiler,e=r.module;if(r.currentType=p.void,$(n)|Be(n,2,4))return e.unreachable();let t=n.operands,i=t.length,s=n.typeArguments,a=n.contextualType,l=s[0],o=r.compileExpression(t[0],r.options.usizeType,1),u=n.contextIsExact?r.compileExpression(t[1],a,1):r.compileExpression(t[1],l,l.isIntegerValue?0:1),c=r.currentType;if(!c.isMemory)return r.error(203,n.reportNode.typeArgumentsRange,"store",c.toString()),r.currentType=p.void,e.unreachable();l.isIntegerValue&&(!c.isIntegerValue||c.size<l.size)&&(u=r.convertExpression(u,c,l,!1,t[1]),c=l);let f=0,_=l.byteSize;if(i>=3){if(f=_t(t[2],r),f<0)return r.currentType=p.void,e.unreachable();if(i==4&&(_=ir(t[3],_,r),_<0))return r.currentType=p.void,e.unreachable()}return r.currentType=p.void,e.store(l.byteSize,o,u,c.toRef(),f,_)}E.set(g.store,Tt);function Hs(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],1):r.compileExpression(t[0],p.auto),l=r.currentType;if(l.isIntegerValue){let o;if(!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,1))):o=r.compileExpression(t[1],l,1),l.isIntegerValue)return r.makeRem(a,o,l,n.reportNode)}return r.error(203,n.reportNode.typeArgumentsRange,"rem",l.toString()),e.unreachable()}E.set(g.rem,Hs);function js(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],1):r.compileExpression(t[0],p.auto),l=r.currentType;if(l.isValue){let o;if(!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,1))):o=r.compileExpression(t[1],l,1),l.isNumericValue)return r.makeAdd(a,o,l)}return r.error(203,n.reportNode.typeArgumentsRange,"add",l.toString()),e.unreachable()}E.set(g.add,js);function Qs(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],1):r.compileExpression(t[0],p.auto),l=r.currentType;if(l.isValue){let o;if(!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,1))):o=r.compileExpression(t[1],l,1),l.isNumericValue)return r.makeSub(a,o,l)}return r.error(203,n.reportNode.typeArgumentsRange,"sub",l.toString()),e.unreachable()}E.set(g.sub,Qs);function Xs(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],1):r.compileExpression(t[0],p.auto),l=r.currentType;if(l.isValue){let o;if(!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,1))):o=r.compileExpression(t[1],l,1),l.isNumericValue)return r.makeMul(a,o,l)}return r.error(203,n.reportNode.typeArgumentsRange,"mul",l.toString()),e.unreachable()}E.set(g.mul,Xs);function sn(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],1):r.compileExpression(t[0],p.auto),l=r.currentType;if(l.isValue){let o;if(!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,1))):o=r.compileExpression(t[1],l,1),l.isNumericValue)return r.makeDiv(a,o,l)}return r.error(203,n.reportNode.typeArgumentsRange,"div",l.toString()),e.unreachable()}E.set(g.div,sn);function $s(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],1):r.compileExpression(t[0],p.auto),l=r.currentType;if(l.isValue){let o;if(!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,1))):o=r.compileExpression(t[1],l,1),l.isNumericValue)return r.currentType=p.i32,r.makeEq(a,o,l,n.reportNode)}return r.error(203,n.reportNode.typeArgumentsRange,"eq",l.toString()),e.unreachable()}E.set(g.eq,$s);function Zs(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],1):r.compileExpression(t[0],p.auto),l=r.currentType;if(l.isValue){let o;if(!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,1))):o=r.compileExpression(t[1],l,1),l.isNumericValue)return r.currentType=p.i32,r.makeNe(a,o,l,n.reportNode)}return r.error(203,n.reportNode.typeArgumentsRange,"ne",l.toString()),e.unreachable()}E.set(g.ne,Zs);function Sr(n){let r=n.compiler,e=r.module;if(X(n,32)|$(n,!0)|Be(n,1,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=n.contextualType,a=i[0],l=a.isIntegerValue&&s.isIntegerValue&&s.size>a.size?s:a;if(!a.isIntegerValue)return r.error(203,n.reportNode.typeArgumentsRange,"atomic.load",a.toString()),r.currentType=l,e.unreachable();let o=r.compileExpression(t[0],r.options.usizeType,1),u=t.length==2?_t(t[1],r):0;return u<0?(r.currentType=l,e.unreachable()):(r.currentType=l,e.atomic_load(a.byteSize,o,l.toRef(),u))}E.set(g.atomic_load,Sr);function vr(n){let r=n.compiler,e=r.module;if(X(n,32)|$(n)|Be(n,2,3))return e.unreachable();let t=n.operands,i=n.typeArguments,s=n.contextualType,a=i[0];if(!a.isIntegerValue)return r.error(203,n.reportNode.typeArgumentsRange,"atomic.store",a.toString()),r.currentType=p.void,e.unreachable();let l=r.compileExpression(t[0],r.options.usizeType,1),o=n.contextIsExact?r.compileExpression(t[1],s,1):r.compileExpression(t[1],a,a.isIntegerValue?0:1),u=r.currentType;a.isIntegerValue&&(!u.isIntegerValue||u.size<a.size)&&(o=r.convertExpression(o,u,a,!1,t[1]),u=a);let c=t.length==3?_t(t[2],r):0;return c<0?(r.currentType=p.void,e.unreachable()):(r.currentType=p.void,e.atomic_store(a.byteSize,l,o,u.toRef(),c))}E.set(g.atomic_store,vr);function ui(n,r,e){let t=n.compiler,i=t.module;if(X(n,32)|$(n,!0)|Be(n,2,3))return i.unreachable();let s=n.operands,a=n.typeArguments,l=n.contextualType,o=a[0];if(!o.isIntegerValue||o.size<8)return t.error(203,n.reportNode.typeArgumentsRange,e,o.toString()),i.unreachable();let u=t.compileExpression(s[0],t.options.usizeType,1),c=n.contextIsExact?t.compileExpression(s[1],l,1):t.compileExpression(s[1],o,o.isIntegerValue?0:1),f=t.currentType;o.isIntegerValue&&(!f.isIntegerValue||f.size<o.size)&&(c=t.convertExpression(c,f,o,!1,s[1]),f=o);let _=s.length==3?_t(s[2],t):0;return _<0?(t.currentType=f,i.unreachable()):(t.currentType=f,i.atomic_rmw(r,o.byteSize,_,u,c,f.toRef()))}function Ir(n){return ui(n,0,"atomic.add")}E.set(g.atomic_add,Ir);function kr(n){return ui(n,1,"atomic.sub")}E.set(g.atomic_sub,kr);function Fr(n){return ui(n,2,"atomic.and")}E.set(g.atomic_and,Fr);function wr(n){return ui(n,3,"atomic.or")}E.set(g.atomic_or,wr);function Rr(n){return ui(n,4,"atomic.xor")}E.set(g.atomic_xor,Rr);function Cr(n){return ui(n,5,"atomic.xchg")}E.set(g.atomic_xchg,Cr);function Pr(n){let r=n.compiler,e=r.module;if(X(n,32)|$(n,!0)|Be(n,3,4))return e.unreachable();let t=n.operands,i=n.typeArguments,s=n.contextualType,a=i[0];if(!a.isIntegerValue||a.size<8)return r.error(203,n.reportNode.typeArgumentsRange,"atomic.cmpxchg",a.toString()),e.unreachable();let l=r.compileExpression(t[0],r.options.usizeType,1),o=n.contextIsExact?r.compileExpression(t[1],s,1):r.compileExpression(t[1],a,a.isIntegerValue?0:1),u=r.currentType,c=r.compileExpression(t[2],u,1);a.isIntegerValue&&(!u.isIntegerValue||u.size<a.size)&&(o=r.convertExpression(o,u,a,!1,t[1]),c=r.convertExpression(c,u,a,!1,t[2]),u=a);let f=t.length==4?_t(t[3],r):0;return f<0?(r.currentType=u,e.unreachable()):(r.currentType=u,e.atomic_cmpxchg(a.byteSize,f,l,o,c,u.toRef()))}E.set(g.atomic_cmpxchg,Pr);function Hf(n){let r=n.compiler,e=r.module;if(X(n,32)|$(n)|Be(n,2,3))return r.currentType=p.i32,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],r.options.usizeType,1),l=r.compileExpression(t[1],s,1),o=t.length==3?r.compileExpression(t[2],p.i64,1):e.i64(-1,-1);switch(r.currentType=p.i32,s.kind){case 3:case 4:case 5:case 8:case 9:case 10:return e.atomic_wait(a,l,o,s.toRef())}return r.error(203,n.reportNode.typeArgumentsRange,"atomic.wait",s.toString()),e.unreachable()}E.set(g.atomic_wait,Hf);function VA(n){let r=n.compiler,e=r.module;if(X(n,32)|F(n)|Be(n,1,2))return r.currentType=p.i32,e.unreachable();let t=n.operands,i=r.compileExpression(t[0],r.options.usizeType,1),s=t.length==2?r.compileExpression(t[1],p.i32,1):e.i32(-1);return r.currentType=p.i32,e.atomic_notify(i,s)}E.set(g.atomic_notify,VA);function OA(n){let r=n.compiler,e=r.module;return r.currentType=p.void,X(n,32)|F(n)|K(n,0)?e.unreachable():e.atomic_fence()}E.set(g.atomic_fence,OA);function qA(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,3))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.auto),a=r.currentType;if(!a.isAny(384))return r.error(203,n.reportNode.typeArgumentsRange,"select",a.toString()),e.unreachable();let l=r.compileExpression(t[1],a,1),o=r.makeIsTrueish(r.compileExpression(t[2],p.bool),r.currentType,t[2]);return r.currentType=a,e.select(s,l,o)}E.set(g.select,qA);function WA(n){return F(n),K(n,0),n.compiler.module.unreachable()}E.set(g.unreachable,WA);function KA(n){let r=n.compiler,e=r.module;return r.currentType=p.i32,F(n)|K(n,0)?e.unreachable():e.memory_size()}E.set(g.memory_size,KA);function HA(n){let r=n.compiler,e=r.module;return r.currentType=p.i32,F(n)|K(n,1)?e.unreachable():e.memory_grow(r.compileExpression(n.operands[0],p.i32,1))}E.set(g.memory_grow,HA);function jA(n){let r=n.compiler,e=r.module;if(r.currentType=p.void,F(n)|K(n,3))return e.unreachable();let t=n.operands;if(!r.options.hasFeature(8)){let o=r.resolver.resolveFunction(n.prototype,null);return r.currentType=p.void,!o||!r.compileFunction(o,!0)?e.unreachable():r.compileCallDirect(o,t,n.reportNode)}let i=r.options.usizeType,s=r.compileExpression(t[0],i,1),a=r.compileExpression(t[1],i,1),l=r.compileExpression(t[2],i,1);return r.currentType=p.void,e.memory_copy(s,a,l)}E.set(g.memory_copy,jA);function QA(n){let r=n.compiler,e=r.module;if(r.currentType=p.void,F(n)|K(n,3))return e.unreachable();let t=n.operands;if(!r.options.hasFeature(8)){let o=r.resolver.resolveFunction(n.prototype,null);return r.currentType=p.void,!o||!r.compileFunction(o,!0)?e.unreachable():r.compileCallDirect(o,t,n.reportNode)}let i=r.options.usizeType,s=r.compileExpression(t[0],i,1),a=r.compileExpression(t[1],p.u8,1),l=r.compileExpression(t[2],i,1);return r.currentType=p.void,e.memory_fill(s,a,l)}E.set(g.memory_fill,QA);function XA(n){let r=n.compiler,e=r.module;if(r.currentType=p.i32,de(n)|Be(n,1,2))return e.unreachable();let t=n.typeArguments,i=n.operands,s=i.length,a=r.options.usizeType,l;if(t&&t.length>0){let o=t[0];if(!o.isValue)return r.error(203,n.reportNode.typeArgumentsRange,"memory.data",o.toString()),r.currentType=a,e.unreachable();let u=i[0];if(u.kind!=18||u.literalKind!=5)return r.error(227,i[0].range),r.currentType=a,e.unreachable();let c=u.elementExpressions,f=c.length,_=new Array(f),d=!0;for(let b=0;b<f;++b){let A=c[b];if(A.kind!=21){let S=r.compileExpression(A,o,1),k=e.runExpression(S,1);k?S=k:d=!1,_[b]=S}else _[b]=r.makeZero(o)}if(!d)return r.error(220,u.range),r.currentType=a,e.unreachable();let m=o.byteSize;if(s==2&&(m=ir(i[1],m,r),m<0))return r.currentType=a,e.unreachable();let h=new Uint8Array(f*o.byteSize);assert(r.writeStaticBuffer(h,0,o,_)==h.byteLength),l=r.addAlignedMemorySegment(h,m).offset}else{let o=r.compileExpression(i[0],p.i32,1),u=e.runExpression(o,1);if(!u)return r.error(220,i[0].range),r.currentType=a,e.unreachable();let c=ae(u);if(c<1)return r.error(222,i[0].range,"1",i32.MAX_VALUE.toString()),r.currentType=a,e.unreachable();let f=16;if(s==2&&(f=ir(i[1],f,r),f<0))return r.currentType=a,e.unreachable();l=r.addAlignedMemorySegment(new Uint8Array(c),f).offset}return r.currentType=a,a==p.usize32?(assert(!i64_high(l)),e.i32(i64_low(l))):e.i64(i64_low(l),i64_high(l))}E.set(g.memory_data,XA);function $A(n){let r=n.compiler,e=r.module;if(F(n)|K(n,1))return e.unreachable();let t=n.operands,i=r.compileExpression(t[0],p.i32,1);return r.currentType=p.i31,e.i31_new(i)}E.set(g.i31_new,$A);function ZA(n){let r=n.compiler,e=r.module;if(F(n)|K(n,1))return e.unreachable();let t=n.operands,i=r.compileExpression(t[0],p.i31.asNullable(),1);return n.contextualType.is(2)?(r.currentType=p.u32,e.i31_get(i,!1)):(r.currentType=p.i32,e.i31_get(i,!0))}E.set(g.i31_get,ZA);function ox(n){let r=n.classReference;return r!=null&&r.hasDecorator(2048)}function ux(n){let r=n.classReference;return r!=null&&r.hasDecorator(16)&&!r.hasDecorator(2048)&&!r.hasDecorator(4096)}function YA(n){let r=n.compiler,e=r.module;if($(n,!0))return e.unreachable();let t=n.operands,s=n.typeArguments[0],a=s.classReference;if(a!=null&&a.prototype.internalName==r.resolver.program.dynamicArrayPrototype.internalName){if(t.length==1)return r.error(100,n.reportNode.range,"changetype<@managed @dynamic [T * n]> requires 2 args (dataPtr, length); a descriptor cannot be constructed from a bare pointer alone"),e.unreachable();if(t.length!=2&&K(n,2))return e.unreachable();let c=r.resolver.resolveExpression(t[0],r.currentFlow);if(c!=null&&c.kind==28)return r.error(100,n.reportNode.range,"cannot changetype between @managed and @unmanaged dynamic arrays; the ABI shapes differ (GC reference vs bare header-prefixed pointer) even though both are 1 slot. Construct the target model explicitly from the data pointer and length."),e.unreachable();let f=a.typeArguments,_=f!=null&&f.length>0?unchecked(f[0]):s,d=r.resolver.resolveClass(r.resolver.program.dynamicArrayPrototype,[_],new Map,1);if(d==null)return r.error(100,n.reportNode.range,"cannot resolve the dynamic array descriptor class"),e.unreachable();let m=r.compileExpression(t[0],r.options.usizeType,1),h=r.compileExpression(t[1],p.i32,1),b=r.makeAbort(y.createStringLiteralExpression("dynamic array length exceeds i32.MAX (2,147,483,647)",n.reportNode.range),n.reportNode);return r.currentType=s,e.block(null,[e.if(e.binary(17,h,e.i32(0)),b,0),r.makeCallDirect(assert(d.constructorInstance),[r.makeAllocation(d),m,h],n.reportNode,!1)],P.I32)}if(s.kind==28&&t.length==1){let c=r.resolver.resolveExpression(t[0],r.currentFlow);if(c!=null){let f=c.classReference;if(f!=null&&f.prototype.internalName==r.resolver.program.dynamicArrayPrototype.internalName)return r.error(100,n.reportNode.range,"cannot changetype between @managed and @unmanaged dynamic arrays; the ABI shapes differ (GC reference vs bare header-prefixed pointer) even though both are 1 slot. Construct the target model explicitly from the data pointer and length."),e.unreachable()}}if(K(n,1))return e.unreachable();if(s.classReference!=null&&assert(s.classReference).hasDecorator(4096)){if(!r.resolver.isViewCall(n.reportNode))return r.error(100,n.reportNode.range,"changetype to an @inline struct (a value has no pointer representation; use @unmanaged struct for a view over bytes)"),e.unreachable();let c=r.resolver.resolveExpression(t[0],r.currentFlow),f=c!=null?c.classReference:null;if(f!=null&&f.hasDecorator(4096))return r.error(6395,n.reportNode.range,assert(c).toString(),"@unmanaged"),e.unreachable();let _=r.compileExpression(t[0],p.auto);return r.currentType=s,_}if(s.kind==28){let c=r.compileExpression(t[0],p.auto),_=r.currentFlow.getTempLocal(s),d=e.load(4,!1,e.local_get(_.index,P.I32),P.I32,0,4),m=r.makeAbort(y.createStringLiteralExpression("dynamic array length exceeds i32.MAX (2,147,483,647)",n.reportNode.range),n.reportNode);return r.currentType=s,e.block(null,[e.local_set(_.index,c,!1),e.if(e.binary(17,d,e.i32(0)),m,0),e.local_get(_.index,P.I32)],P.I32)}let o=r.compileExpression(t[0],p.auto),u=r.currentType;return r.currentType=s,ox(s)&&ux(u)?(r.error(6394,n.reportNode.range,u.toString()),e.unreachable()):(ux(s)&&ox(u)&&r.markOperandForRooting(),s.kind==14&&(s.fixedMemoryModel==0||s.fixedMemoryModel==1)?(r.error(100,n.reportNode.range,"a value-typed `[T * N]` cannot be constructed from an address via changetype \u2014 use `@unmanaged [T * N]` for a pointer view, or Landing 5b will give the value form inline storage"),e.unreachable()):u.isChangeableTo(s)?o:(r.error(202,n.reportNode.range,u.toString(),s.toString()),e.unreachable()))}E.set(g.changetype,YA);function JA(n){let r=n.compiler,e=r.module;if(r.currentType=p.void,K(n,2))return e.unreachable();let t=n.operands,i=r.resolver.resolveExpression(t[1],r.currentFlow);if(i==null)return e.unreachable();let s=i.classReference;if(s==null||!s.hasDecorator(4096))return r.error(100,n.reportNode.typeArgumentsRange,"copyInto needs an @inline struct value: '"+i.toString()+"' is not a value type"),e.unreachable();let a=r.compileExpression(t[0],r.options.usizeType,1),l=r.sroaTreeOf(t[1]);if(l==null)return r.error(100,t[1].range,"copyInto needs an @inline struct value held in a local (a value has no address, so only a tracked value can be copied out)"),e.unreachable();let o=new Array;return r.emitSroaStores(i,l,a,0,o),r.currentType=p.void,e.flatten(o,P.None)}E.set(g.copyInto,JA);function eT(n){let r=n.compiler,e=r.module,t=n.typeArguments;if(de(n,!0)|Be(n,1,2))return t&&(assert(t.length),r.currentType=t[0].nonNullableType),e.unreachable();let i=n.operands,s=n.contextualType,a=t?r.compileExpression(i[0],t[0],5):r.compileExpression(i[0],p.bool,4),l=r.currentType;if(r.currentType=l.nonNullableType,r.options.noAssert)return a;let o=e.runExpression(a,0);if(o)switch(pe(o)){case P.I32:{if(ae(o))return a;break}case P.I64:{if(Ne(o)|Ge(o))return a;break}case P.F32:{if(Ce(o))return a;break}case P.F64:{if(Pe(o))return a;break}}let u=r.makeAbort(i.length==2?i[1]:null,n.reportNode);if(r.currentType=l.nonNullableType,s==p.void)switch(r.currentType=p.void,l.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:return e.if(e.unary(20,a),u);case 4:case 9:return e.if(e.unary(21,a),u);case 5:case 10:return e.if(e.unary(145,a),u);case 11:return e.if(e.binary(57,a,e.f32(0)),u);case 12:return e.if(e.binary(70,a,e.f64(0)),u);case 16:case 15:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:return e.if(e.ref_is_null(a),u)}else{r.currentType=l.nonNullableType;let c=r.currentFlow;switch(r.currentType.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:{let f=c.getTempLocal(l);return c.setLocalFlag(f.index,2),e.if(e.local_tee(f.index,a,!1),e.local_get(f.index,P.I32),u)}case 4:case 9:{let f=c.getTempLocal(p.i64);return e.if(e.unary(21,e.local_tee(f.index,a,!1)),u,e.local_get(f.index,P.I64))}case 5:case 10:{let f=c.getTempLocal(r.options.usizeType);return e.if(e.unary(145,e.local_tee(f.index,a,l.isManaged)),u,e.local_get(f.index,r.options.sizeTypeRef))}case 11:{let f=c.getTempLocal(p.f32);return e.if(e.binary(57,e.local_tee(f.index,a,!1),e.f32(0)),u,e.local_get(f.index,P.F32))}case 12:{let f=c.getTempLocal(p.f64);return e.if(e.binary(70,e.local_tee(f.index,a,!1),e.f64(0)),u,e.local_get(f.index,P.F64))}case 16:case 15:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:{let f=c.getTempLocal(l);return e.if(e.ref_is_null(e.local_tee(f.index,a,!1)),u,e.local_get(f.index,l.toRef()))}}}return r.error(203,n.reportNode.typeArgumentsRange,"assert",r.currentType.toString()),u}E.set(g.assert,eT);function tT(n){let r=n.compiler,e=r.module;if(F(n)|K(n,1))return e.unreachable();let t=r.currentFlow,i=r.options.uncheckedBehavior===1,s=t.is(32768);i?assert(!s):t.set(32768);let a=r.compileExpression(n.operands[0],n.contextualType);return s||t.unset(32768),a}E.set(g.unchecked,tT);function rT(n){let r=n.compiler,e=r.module;if(F(n)|K(n,1))return e.unreachable();let t=r.currentFlow,i=t.is(131072);i||t.set(131072);let s=r.compileExpression(n.operands[0],n.contextualType);return i||t.unset(131072),s}E.set(g.inline_always,rT);function nT(n){let r=n.compiler,e=r.module;if(de(n,!0)|Be(n,1,i32.MAX_VALUE))return e.unreachable();let t=n.operands,i=n.typeArguments,s;i?(assert(i.length),s=i[0]):s=n.contextualType;let a=r.compileExpression(t[0],p.u32,1),l=t.length-1,o=new Array(l),u=new Array(l);for(let c=0;c<l;++c)o[c]=r.compileExpression(t[1+c],p.auto),r.currentType.isManaged&&(o[c]=e.tostack(o[c])),u[c]=r.currentType.toRef();return r.currentType=s,e.call_indirect(null,a,o,it(u),s.toRef())}E.set(g.call_indirect,nT);function iT(n){let r=n.compiler,e=r.module;if($(n,!0))return e.unreachable();let t=n.operands,a=n.typeArguments[0].getClass();if(!a)return r.error(2351,n.reportNode.expression.range),e.unreachable();r.currentType=a.type;let l=r.ensureConstructor(a,n.reportNode);return r.checkFieldInitialization(a,n.reportNode),r.compileInstantiate(l,t,0,n.reportNode)}E.set(g.instantiate,iT);function jf(n,r){let e=n.compiler,t=e.module;F(n);let i=n.operands,s=n.reportNode;return e.emitDiagnostic(102,r,s.range,null,i.length?i[0].range.toString():s.range.toString()),r==3?t.unreachable():t.nop()}function sT(n){return jf(n,3)}E.set(g.ERROR,sT);function aT(n){return jf(n,2)}E.set(g.WARNING,aT);function lT(n){return jf(n,1)}E.set(g.INFO,lT);function oT(n){let r=n.compiler,e=n.prototype.parent;assert(e.kind==7);let t=e;assert(t.prototype==r.program.functionPrototype);let i=assert(t.typeArguments);assert(i.length==1);let s=i[0],a=assert(s.getSignature()),l=a.returnType;if(F(n)|Be(n,1+a.requiredParameters,1+a.parameterTypes.length))return r.currentType=l,r.module.unreachable();let o=r.compileExpression(assert(n.thisOperand),s,1),u=assert(n.operands.shift()),c=a.thisType,f=0;if(c)f=r.compileExpression(u,c,1);else if(u.kind!=20)return r.error(2332,u.range),r.module.unreachable();return r.compileCallIndirect(a,o,n.operands,n.reportNode,f,n.contextualType==p.void)}E.set(g.Function_call,oT);function uT(n){let r=n.compiler,e=r.module;return r.currentType=n.compiler.program.stringInstance.type,r.error(100,n.reportNode.range,"String.raw"),e.unreachable()}E.set(g.String_raw,uT);function ut(n,r){let e=n.compiler;return F(n)|K(n,1)?(e.currentType=r,e.module.unreachable()):e.compileExpression(n.operands[0],r,2)}function cT(n){return ut(n,p.i8)}E.set(g.i8,cT);function pT(n){return ut(n,p.i16)}E.set(g.i16,pT);function fT(n){return ut(n,p.i32)}E.set(g.i32,fT);function _T(n){return ut(n,p.i64)}E.set(g.i64,_T);function dT(n){return ut(n,n.compiler.options.isizeType)}E.set(g.isize,dT);function hT(n){return ut(n,p.u8)}E.set(g.u8,hT);function mT(n){return ut(n,p.u16)}E.set(g.u16,mT);function yT(n){return ut(n,p.u32)}E.set(g.u32,yT);function gT(n){return ut(n,p.u64)}E.set(g.u64,gT);function bT(n){return ut(n,n.compiler.options.usizeType)}E.set(g.usize,bT);function xT(n){return ut(n,p.bool)}E.set(g.bool,xT);function ET(n){return ut(n,p.f32)}E.set(g.f32,ET);function AT(n){return ut(n,p.f64)}E.set(g.f64,AT);function TT(n){return cx(n)}E.set(g.v128,TT);function cx(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,16))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=new Uint8Array(16),s=new Array(16),a=0;for(let l=0;l<16;++l){let o=r.compileExpression(t[l],p.i8,1),u=e.runExpression(o,1);u?be(ae(u),i,l):(s[l]=o,a++)}if(r.currentType=p.v128,a==0)return e.v128(i);{let l,o=a==16;o?l=e.unary(60,s[0]):l=e.v128(i);for(let u=i32(o);u<16;u++){let c=s[u];c&&(l=e.simd_replace(0,l,u,c))}return l}}E.set(g.i8x16,cx);function ST(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,8))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=new Uint8Array(16),s=new Array(8),a=0;for(let l=0;l<8;++l){let o=r.compileExpression(t[l],p.i16,1),u=e.runExpression(o,1);u?br(ae(u),i,l<<1):(s[l]=o,a++)}if(r.currentType=p.v128,a==0)return e.v128(i);{let l,o=a==8;o?l=e.unary(61,s[0]):l=e.v128(i);for(let u=i32(o);u<8;u++){let c=s[u];c&&(l=e.simd_replace(1,l,u,c))}return l}}E.set(g.i16x8,ST);function vT(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,4))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=new Uint8Array(16),s=new Array(4),a=0;for(let l=0;l<4;++l){let o=r.compileExpression(t[l],p.i32,1),u=e.runExpression(o,1);u?Se(ae(u),i,l<<2):(s[l]=o,a++)}if(r.currentType=p.v128,a==0)return e.v128(i);{let l,o=a==4;o?l=e.unary(62,s[0]):l=e.v128(i);for(let u=i32(o);u<4;u++){let c=s[u];c&&(l=e.simd_replace(2,l,u,c))}return l}}E.set(g.i32x4,vT);function IT(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=new Uint8Array(16),s=new Array(2),a=0;for(let l=0;l<2;++l){let o=r.compileExpression(t[l],p.i64,1),u=e.runExpression(o,1);if(u){let c=l<<3;Se(Ne(u),i,c+0),Se(Ge(u),i,c+4)}else s[l]=o,a++}if(r.currentType=p.v128,a==0)return e.v128(i);{let l,o=a==2;o?l=e.unary(63,s[0]):l=e.v128(i);for(let u=i32(o);u<2;u++){let c=s[u];c&&(l=e.simd_replace(3,l,u,c))}return l}}E.set(g.i64x2,IT);function kT(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,4))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=new Uint8Array(16),s=new Array(4),a=0;for(let l=0;l<4;++l){let o=r.compileExpression(t[l],p.f32,1),u=e.runExpression(o,1);u?Wr(Ce(u),i,l<<2):(s[l]=o,a++)}if(r.currentType=p.v128,a==0)return e.v128(i);{let l,o=a==4;o?l=e.unary(64,s[0]):l=e.v128(i);for(let u=i32(o);u<4;u++){let c=s[u];c&&(l=e.simd_replace(5,l,u,c))}return l}}E.set(g.f32x4,kT);function FT(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=new Uint8Array(16),s=new Array(2),a=0;for(let l=0;l<2;++l){let o=r.compileExpression(t[l],p.f64,1),u=e.runExpression(o,1);u?Kr(Pe(u),i,l<<3):(s[l]=o,a++)}if(r.currentType=p.v128,a==0)return e.v128(i);{let l,o=a==2;o?l=e.unary(65,s[0]):l=e.v128(i);for(let u=i32(o);u<2;u++){let c=s[u];c&&(l=e.simd_replace(6,l,u,c))}return l}}E.set(g.f64x2,FT);function an(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],s,1);if(r.currentType=p.v128,s.isValue)switch(s.kind){case 1:case 6:return e.unary(60,a);case 2:case 7:return e.unary(61,a);case 3:case 8:return e.unary(62,a);case 4:case 9:return e.unary(63,a);case 5:case 10:return e.unary(r.options.isWasm64?63:62,a);case 11:return e.unary(64,a);case 12:return e.unary(65,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.splat",s.toString()),e.unreachable()}E.set(g.v128_splat,an);function ar(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n,!0)|K(n,2))return e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.u8,1);r.currentType=s;let o=0,u=e.runExpression(l,1);if(u?o=ae(u):r.error(220,t[1].range),s.isValue){let c=16/assert(s.byteSize)-1;switch((o<0||o>c)&&(r.error(222,t[1].range,"Lane index","0",c.toString()),o=0),s.kind){case 1:return e.simd_extract(0,a,o);case 6:return e.simd_extract(1,a,o);case 2:return e.simd_extract(2,a,o);case 7:return e.simd_extract(3,a,o);case 3:case 8:return e.simd_extract(4,a,o);case 4:case 9:return e.simd_extract(5,a,o);case 5:case 10:return e.simd_extract(r.options.isWasm64?5:4,a,o);case 11:return e.simd_extract(7,a,o);case 12:return e.simd_extract(8,a,o)}}return r.error(203,n.reportNode.typeArgumentsRange,"v128.extract_lane",s.toString()),e.unreachable()}E.set(g.v128_extract_lane,ar);function ln(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,3))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.u8,1),o=r.compileExpression(t[2],s,1);r.currentType=p.v128;let u=0,c=e.runExpression(l,1);if(c?u=ae(c):r.error(220,t[1].range),s.isValue){let f=16/assert(s.byteSize)-1;switch((u<0||u>f)&&(r.error(222,t[1].range,"Lane index","0",f.toString()),u=0),s.kind){case 1:case 6:return e.simd_replace(0,a,u,o);case 2:case 7:return e.simd_replace(1,a,u,o);case 3:case 8:return e.simd_replace(2,a,u,o);case 4:case 9:return e.simd_replace(3,a,u,o);case 5:case 10:return e.simd_replace(r.options.isWasm64?3:2,a,u,o);case 11:return e.simd_replace(5,a,u,o);case 12:return e.simd_replace(6,a,u,o)}}return r.error(203,n.reportNode.typeArgumentsRange,"v128.replace_lane",s.toString()),e.unreachable()}E.set(g.v128_replace_lane,ln);function on(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0];if(s.isValue){let a=s.byteSize,l=16/a;if(assert(Number.isInteger(l)&&Hr(l)),K(n,2+l))return r.currentType=p.v128,e.unreachable();let o=r.compileExpression(t[0],p.v128,1),u=r.compileExpression(t[1],p.v128,1);switch(s.kind){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:{let c=new Uint8Array(16),f=(l<<1)-1;for(let _=0;_<l;++_){let d=t[2+_],m=r.compileExpression(d,p.u8,1),h=e.runExpression(m,1),b=0;switch(h?(b=ae(h),(b<0||b>f)&&(r.error(222,d.range,"Lane index","0",f.toString()),b=0)):r.error(220,d.range),a){case 1:{be(b,c,_);break}case 2:{let A=_<<1,S=b<<1;be(S,c,A),be(S+1,c,A+1);break}case 4:{let A=_<<2,S=b<<2;be(S,c,A),be(S+1,c,A+1),be(S+2,c,A+2),be(S+3,c,A+3);break}case 8:{let A=_<<3,S=b<<3;be(S,c,A),be(S+1,c,A+1),be(S+2,c,A+2),be(S+3,c,A+3),be(S+4,c,A+4),be(S+5,c,A+5),be(S+6,c,A+6),be(S+7,c,A+7);break}default:assert(!1)}}return r.currentType=p.v128,e.simd_shuffle(o,u,c)}}}return r.error(203,n.reportNode.typeArgumentsRange,"v128.shuffle",s.toString()),r.currentType=p.v128,e.unreachable()}E.set(g.v128_shuffle,on);function px(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=r.compileExpression(t[0],p.v128,1),s=r.compileExpression(t[1],p.v128,1);return e.binary(209,i,s)}E.set(g.v128_swizzle,px);function Ys(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n,!0)|Be(n,1,3))return e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],r.options.usizeType,1),l=t.length,o=0,u=s.byteSize;if(l>=2){if(o=_t(t[1],r),o<0)return r.currentType=p.v128,e.unreachable();if(l==3&&(u=ir(t[2],u,r),u<0))return r.currentType=p.v128,e.unreachable()}if(r.currentType=p.v128,s.isValue)switch(s.kind){case 1:case 6:return e.simd_load(0,a,o,u);case 2:case 7:return e.simd_load(1,a,o,u);case 3:case 8:case 11:return e.simd_load(2,a,o,u);case 5:case 10:if(!r.options.isWasm64)return e.simd_load(2,a,o,u);case 4:case 9:case 12:return e.simd_load(3,a,o,u)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.load_splat",s.toString()),e.unreachable()}E.set(g.v128_load_splat,Ys);function un(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n,!0)|Be(n,1,3))return e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],r.options.usizeType,1),l=t.length,o=0,u=s.byteSize;if(l>=2){if(o=_t(t[1],r),o<0)return r.currentType=p.v128,e.unreachable();if(l==3&&(u=ir(t[2],u,r),u<0))return r.currentType=p.v128,e.unreachable()}if(r.currentType=p.v128,s.isValue)switch(s.kind){case 1:return e.simd_load(4,a,o,u);case 6:return e.simd_load(5,a,o,u);case 2:return e.simd_load(6,a,o,u);case 7:return e.simd_load(7,a,o,u);case 5:if(r.options.isWasm64)break;case 3:return e.simd_load(8,a,o,u);case 10:if(r.options.isWasm64)break;case 8:return e.simd_load(9,a,o,u)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.load_ext",s.toString()),e.unreachable()}E.set(g.v128_load_ext,un);function Qf(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n,!0)|Be(n,1,3))return e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],r.options.usizeType,1),l=t.length,o=0,u=s.byteSize;if(l>=2){if(o=_t(t[1],r),o<0)return r.currentType=p.v128,e.unreachable();if(l==3&&(u=ir(t[2],u,r),u<0))return r.currentType=p.v128,e.unreachable()}if(r.currentType=p.v128,s.isValue)switch(s.kind){case 3:case 8:case 11:return e.simd_load(10,a,o,u);case 4:case 9:case 12:return e.simd_load(11,a,o,u);case 5:case 10:return e.simd_load(r.options.isWasm64?11:10,a,o,u)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.load_zero",s.toString()),e.unreachable()}E.set(g.v128_load_zero,Qf);function Js(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n,!0)|Be(n,3,5))return e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],r.options.usizeType,1),l=r.compileExpression(t[1],p.v128,1),o=r.compileExpression(t[2],p.u8,1),u=0,c=e.runExpression(o,1);c?u=ae(c):r.error(220,t[2].range);let f=t.length,_=0,d=s.byteSize;if(f>=4){if(_=_t(t[3],r),_<0)return r.currentType=p.v128,e.unreachable();if(f==5&&(d=ir(t[4],d,r),d<0))return r.currentType=p.v128,e.unreachable()}if(r.currentType=p.v128,s.isValue){let m=16/assert(s.byteSize)-1;switch((u<0||u>m)&&(r.error(222,t[1].range,"Lane index","0",m.toString()),u=0),s.kind){case 1:case 6:return e.simd_loadstorelane(0,a,_,d,u,l);case 2:case 7:return e.simd_loadstorelane(1,a,_,d,u,l);case 3:case 8:case 11:return e.simd_loadstorelane(2,a,_,d,u,l);case 4:case 9:case 12:return e.simd_loadstorelane(3,a,_,d,u,l);case 5:case 10:return e.simd_loadstorelane(r.options.isWasm64?3:2,a,_,d,u,l)}}return r.error(203,n.reportNode.typeArgumentsRange,"v128.load_lane",s.toString()),e.unreachable()}E.set(g.v128_load_lane,Js);function ea(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n,!0)|Be(n,3,5))return e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],r.options.usizeType,1),l=r.compileExpression(t[1],p.v128,1),o=r.compileExpression(t[2],p.u8,1),u=0,c=e.runExpression(o,1);c?u=ae(c):r.error(220,t[2].range);let f=t.length,_=0,d=s.byteSize;if(f>=4){if(_=_t(t[3],r),_<0)return r.currentType=p.v128,e.unreachable();if(f==5&&(d=ir(t[4],d,r),d<0))return r.currentType=p.v128,e.unreachable()}if(r.currentType=p.void,s.isValue){let m=16/assert(s.byteSize)-1;switch((u<0||u>m)&&(r.error(222,t[1].range,"Lane index","0",m.toString()),u=0),s.kind){case 1:case 6:return e.simd_loadstorelane(4,a,_,d,u,l);case 2:case 7:return e.simd_loadstorelane(5,a,_,d,u,l);case 3:case 8:case 11:return e.simd_loadstorelane(6,a,_,d,u,l);case 4:case 9:case 12:return e.simd_loadstorelane(7,a,_,d,u,l);case 5:case 10:return e.simd_loadstorelane(r.options.isWasm64?7:6,a,_,d,u,l)}}return r.error(203,n.reportNode.typeArgumentsRange,"v128.store_lane",s.toString()),e.unreachable()}E.set(g.v128_store_lane,ea);function cn(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:case 6:return e.binary(134,a,l);case 2:case 7:return e.binary(145,a,l);case 3:case 8:return e.binary(162,a,l);case 4:case 9:return e.binary(174,a,l);case 5:case 10:return e.binary(r.options.isWasm64?174:162,a,l);case 11:return e.binary(189,a,l);case 12:return e.binary(197,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.add",s.toString()),e.unreachable()}E.set(g.v128_add,cn);function pn(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:case 6:return e.binary(137,a,l);case 2:case 7:return e.binary(148,a,l);case 3:case 8:return e.binary(163,a,l);case 4:case 9:return e.binary(175,a,l);case 5:case 10:return e.binary(r.options.isWasm64?175:163,a,l);case 11:return e.binary(190,a,l);case 12:return e.binary(198,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.sub",s.toString()),e.unreachable()}E.set(g.v128_sub,pn);function ci(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 2:case 7:return e.binary(151,a,l);case 3:case 8:return e.binary(164,a,l);case 4:case 9:return e.binary(176,a,l);case 5:case 10:return e.binary(r.options.isWasm64?176:164,a,l);case 11:return e.binary(191,a,l);case 12:return e.binary(199,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.mul",s.toString()),e.unreachable()}E.set(g.v128_mul,ci);function Xf(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.binary(192,a,l);case 12:return e.binary(200,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.div",s.toString()),e.unreachable()}E.set(g.v128_div,Xf);function ta(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(135,a,l);case 6:return e.binary(136,a,l);case 2:return e.binary(146,a,l);case 7:return e.binary(147,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.add_sat",s.toString()),e.unreachable()}E.set(g.v128_add_sat,ta);function ra(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(138,a,l);case 6:return e.binary(139,a,l);case 2:return e.binary(149,a,l);case 7:return e.binary(150,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.sub_sat",s.toString()),e.unreachable()}E.set(g.v128_sub_sat,ra);function lr(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(140,a,l);case 6:return e.binary(141,a,l);case 2:return e.binary(152,a,l);case 7:return e.binary(153,a,l);case 5:if(r.options.isWasm64)break;case 3:return e.binary(165,a,l);case 10:if(r.options.isWasm64)break;case 8:return e.binary(166,a,l);case 11:return e.binary(193,a,l);case 12:return e.binary(201,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.min",s.toString()),e.unreachable()}E.set(g.v128_min,lr);function or(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(142,a,l);case 6:return e.binary(143,a,l);case 2:return e.binary(154,a,l);case 7:return e.binary(155,a,l);case 5:if(r.options.isWasm64)break;case 3:return e.binary(167,a,l);case 10:if(r.options.isWasm64)break;case 8:return e.binary(168,a,l);case 11:return e.binary(194,a,l);case 12:return e.binary(202,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.max",s.toString()),e.unreachable()}E.set(g.v128_max,or);function $f(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.binary(195,a,l);case 12:return e.binary(203,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.pmin",s.toString()),e.unreachable()}E.set(g.v128_pmin,$f);function Zf(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.binary(196,a,l);case 12:return e.binary(204,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.pmax",s.toString()),e.unreachable()}E.set(g.v128_pmax,Zf);function fx(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);return s.isValue&&s.kind===2?e.binary(169,a,l):(r.error(203,n.reportNode.typeArgumentsRange,"v128.dot",s.toString()),e.unreachable())}E.set(g.v128_dot,fx);function Yf(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 6:return e.binary(144,a,l);case 7:return e.binary(156,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.avgr",s.toString()),e.unreachable()}E.set(g.v128_avgr,Yf);function fn(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:case 6:return e.binary(76,a,l);case 2:case 7:return e.binary(86,a,l);case 3:case 8:return e.binary(96,a,l);case 4:case 9:return e.binary(106,a,l);case 5:case 10:return e.binary(r.options.isWasm64?106:96,a,l);case 11:return e.binary(118,a,l);case 12:return e.binary(124,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.eq",s.toString()),e.unreachable()}E.set(g.v128_eq,fn);function _n(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:case 6:return e.binary(77,a,l);case 2:case 7:return e.binary(87,a,l);case 3:case 8:return e.binary(97,a,l);case 4:case 9:return e.binary(107,a,l);case 5:case 10:return e.binary(r.options.isWasm64?107:97,a,l);case 11:return e.binary(119,a,l);case 12:return e.binary(125,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.ne",s.toString()),e.unreachable()}E.set(g.v128_ne,_n);function zt(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(78,a,l);case 6:return e.binary(79,a,l);case 2:return e.binary(88,a,l);case 7:return e.binary(89,a,l);case 3:return e.binary(98,a,l);case 8:return e.binary(99,a,l);case 4:return e.binary(108,a,l);case 5:return e.binary(r.options.isWasm64?108:98,a,l);case 10:{if(r.options.isWasm64)break;return e.binary(99,a,l)}case 11:return e.binary(120,a,l);case 12:return e.binary(126,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.lt",s.toString()),e.unreachable()}E.set(g.v128_lt,zt);function Dt(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(82,a,l);case 6:return e.binary(83,a,l);case 2:return e.binary(92,a,l);case 7:return e.binary(93,a,l);case 3:return e.binary(102,a,l);case 8:return e.binary(103,a,l);case 4:return e.binary(110,a,l);case 5:return e.binary(r.options.isWasm64?110:102,a,l);case 10:{if(r.options.isWasm64)break;return e.binary(103,a,l)}case 11:return e.binary(122,a,l);case 12:return e.binary(128,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.le",s.toString()),e.unreachable()}E.set(g.v128_le,Dt);function Gt(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(80,a,l);case 6:return e.binary(81,a,l);case 2:return e.binary(90,a,l);case 7:return e.binary(91,a,l);case 3:return e.binary(100,a,l);case 8:return e.binary(101,a,l);case 4:return e.binary(109,a,l);case 5:return e.binary(r.options.isWasm64?109:100,a,l);case 10:{if(r.options.isWasm64)break;return e.binary(101,a,l)}case 11:return e.binary(121,a,l);case 12:return e.binary(127,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.gt",s.toString()),e.unreachable()}E.set(g.v128_gt,Gt);function Ut(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(84,a,l);case 6:return e.binary(85,a,l);case 2:return e.binary(94,a,l);case 7:return e.binary(95,a,l);case 3:return e.binary(104,a,l);case 8:return e.binary(105,a,l);case 4:return e.binary(111,a,l);case 5:return e.binary(r.options.isWasm64?111:104,a,l);case 10:{if(r.options.isWasm64)break;return e.binary(105,a,l)}case 11:return e.binary(123,a,l);case 12:return e.binary(129,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.ge",s.toString()),e.unreachable()}E.set(g.v128_ge,Ut);function na(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 2:return e.binary(205,a,l);case 7:return e.binary(206,a,l);case 3:return e.binary(207,a,l);case 8:return e.binary(208,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.narrow",s.toString()),e.unreachable()}E.set(g.v128_narrow,na);function dn(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 1:case 6:return e.unary(69,a);case 2:case 7:return e.unary(74,a);case 3:case 8:return e.unary(78,a);case 4:case 9:return e.unary(82,a);case 5:case 10:return e.unary(r.options.isWasm64?82:78,a);case 11:return e.unary(93,a);case 12:return e.unary(100,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.neg",s.toString()),e.unreachable()}E.set(g.v128_neg,dn);function hn(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.unary(68,a);case 2:return e.unary(73,a);case 3:return e.unary(77,a);case 4:return e.unary(81,a);case 5:return e.unary(r.options.isWasm64?81:77,a);case 6:case 7:case 8:case 9:case 10:return a;case 11:return e.unary(92,a);case 12:return e.unary(99,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.abs",s.toString()),e.unreachable()}E.set(g.v128_abs,hn);function Jf(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.unary(94,a);case 12:return e.unary(101,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.sqrt",s.toString()),e.unreachable()}E.set(g.v128_sqrt,Jf);function e_(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.unary(95,a);case 12:return e.unary(102,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.ceil",s.toString()),e.unreachable()}E.set(g.v128_ceil,e_);function t_(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.unary(96,a);case 12:return e.unary(103,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.floor",s.toString()),e.unreachable()}E.set(g.v128_floor,t_);function r_(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.unary(97,a);case 12:return e.unary(104,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.trunc",s.toString()),e.unreachable()}E.set(g.v128_trunc,r_);function n_(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.unary(98,a);case 12:return e.unary(105,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.nearest",s.toString()),e.unreachable()}E.set(g.v128_nearest,n_);function i_(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 5:if(r.options.isWasm64)break;case 3:return e.unary(112,a);case 10:if(r.options.isWasm64)break;case 8:return e.unary(113,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.convert",s.toString()),e.unreachable()}E.set(g.v128_convert,i_);function s_(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 5:if(r.options.isWasm64)break;case 3:return e.unary(126,a);case 10:if(r.options.isWasm64)break;case 8:return e.unary(127,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.convert_low",s.toString()),e.unreachable()}E.set(g.v128_convert_low,s_);function a_(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 5:if(r.options.isWasm64)break;case 3:return e.unary(110,a);case 10:if(r.options.isWasm64)break;case 8:return e.unary(111,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.trunc_sat",s.toString()),e.unreachable()}E.set(g.v128_trunc_sat,a_);function l_(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 5:if(r.options.isWasm64)break;case 3:return e.unary(128,a);case 10:if(r.options.isWasm64)break;case 8:return e.unary(129,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.trunc_sat_zero",s.toString()),e.unreachable()}E.set(g.v128_trunc_sat_zero,l_);function mn(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.unary(114,a);case 6:return e.unary(116,a);case 2:return e.unary(118,a);case 7:return e.unary(120,a);case 5:if(r.options.isWasm64)break;case 3:return e.unary(122,a);case 10:if(r.options.isWasm64)break;case 8:return e.unary(124,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.extend_low",s.toString()),e.unreachable()}E.set(g.v128_extend_low,mn);function yn(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.unary(115,a);case 6:return e.unary(117,a);case 2:return e.unary(119,a);case 7:return e.unary(121,a);case 5:if(r.options.isWasm64)break;case 3:return e.unary(123,a);case 10:if(r.options.isWasm64)break;case 8:return e.unary(125,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.extend_high",s.toString()),e.unreachable()}E.set(g.v128_extend_high,yn);function ia(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=n.typeArguments[0],s=r.compileExpression(t[0],p.v128,1),a=r.compileExpression(t[1],p.i32,1);if(r.currentType=p.v128,i.isValue)switch(i.kind){case 1:case 6:return e.simd_shift(0,s,a);case 2:case 7:return e.simd_shift(3,s,a);case 3:case 8:return e.simd_shift(6,s,a);case 4:case 9:return e.simd_shift(9,s,a);case 5:case 10:return e.simd_shift(r.options.isWasm64?9:6,s,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.shl",i.toString()),e.unreachable()}E.set(g.v128_shl,ia);function ur(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=n.typeArguments[0],s=r.compileExpression(t[0],p.v128,1),a=r.compileExpression(t[1],p.i32,1);if(r.currentType=p.v128,i.isValue)switch(i.kind){case 1:return e.simd_shift(1,s,a);case 6:return e.simd_shift(2,s,a);case 2:return e.simd_shift(4,s,a);case 7:return e.simd_shift(5,s,a);case 3:return e.simd_shift(7,s,a);case 8:return e.simd_shift(8,s,a);case 4:return e.simd_shift(10,s,a);case 9:return e.simd_shift(11,s,a);case 5:return e.simd_shift(r.options.isWasm64?10:7,s,a);case 10:return e.simd_shift(r.options.isWasm64?11:8,s,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.shr",i.toString()),e.unreachable()}E.set(g.v128_shr,ur);function su(n,r){let e=n.compiler,t=e.module;if(X(n,16)|F(n)|K(n,2))return e.currentType=p.v128,t.unreachable();let i=n.operands,s=e.compileExpression(i[0],p.v128,1),a=e.compileExpression(i[1],p.v128,1);return t.binary(r,s,a)}function wT(n){return su(n,130)}E.set(g.v128_and,wT);function RT(n){return su(n,131)}E.set(g.v128_or,RT);function CT(n){return su(n,132)}E.set(g.v128_xor,CT);function PT(n){return su(n,133)}E.set(g.v128_andnot,PT);function NT(n,r){let e=n.compiler,t=e.module;if(X(n,16)|F(n)|K(n,1))return e.currentType=p.v128,t.unreachable();let i=n.operands,s=e.compileExpression(i[0],p.v128,1);return t.unary(r,s)}function BT(n){return NT(n,66)}E.set(g.v128_not,BT);function LT(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,3))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=r.compileExpression(t[0],p.v128,1),s=r.compileExpression(t[1],p.v128,1),a=r.compileExpression(t[2],p.v128,1);return e.simd_ternary(0,i,s,a)}E.set(g.v128_bitselect,LT);function MT(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,1))return r.currentType=p.bool,e.unreachable();let t=n.operands,i=r.compileExpression(t[0],p.v128,1);return r.currentType=p.bool,e.unary(67,i)}E.set(g.v128_any_true,MT);function sa(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.bool,e.unreachable();let t=n.operands,i=n.typeArguments[0],s=r.compileExpression(t[0],p.v128,1);if(r.currentType=p.bool,i.isValue)switch(i.kind){case 1:case 6:return e.unary(70,s);case 2:case 7:return e.unary(75,s);case 3:case 8:return e.unary(79,s);case 4:case 9:return e.unary(83,s);case 5:case 10:return e.unary(r.options.isWasm64?83:79,s)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.all_true",i.toString()),e.unreachable()}E.set(g.v128_all_true,sa);function aa(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.i32,e.unreachable();let t=n.operands,i=n.typeArguments[0],s=r.compileExpression(t[0],p.v128,1);if(r.currentType=p.i32,i.isValue)switch(i.kind){case 1:case 6:return e.unary(71,s);case 2:case 7:return e.unary(76,s);case 3:case 8:return e.unary(80,s);case 4:case 9:return e.unary(84,s);case 5:case 10:return e.unary(r.options.isWasm64?84:80,s)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.bitmask",i.toString()),e.unreachable()}E.set(g.v128_bitmask,aa);function _x(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=n.typeArguments[0],s=r.compileExpression(t[0],p.v128,1);if(r.currentType=p.v128,i.isValue)switch(i.kind){case 1:case 6:return e.unary(72,s)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.popcnt",i.toString()),e.unreachable()}E.set(g.v128_popcnt,_x);function la(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=n.typeArguments[0],s=r.compileExpression(t[0],p.v128,1);if(r.currentType=p.v128,i.isValue)switch(i.kind){case 1:return e.unary(106,s);case 6:return e.unary(107,s);case 2:return e.unary(108,s);case 7:return e.unary(109,s)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.extadd_pairwise",i.toString()),e.unreachable()}E.set(g.v128_extadd_pairwise,la);function dx(n){let r=n.compiler,e=r.module;if(X(n,16)|de(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=n.typeArguments,s=i?i[0]:p.f64,a=r.compileExpression(t[0],p.v128,1);return r.currentType=p.v128,s.isValue&&s.kind===12?e.unary(130,a):(r.error(203,n.reportNode.typeArgumentsRange,"v128.demote_zero",s.toString()),e.unreachable())}E.set(g.v128_demote_zero,dx);function hx(n){let r=n.compiler,e=r.module;if(X(n,16)|de(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=n.typeArguments,s=i?i[0]:p.f32,a=r.compileExpression(t[0],p.v128,1);return r.currentType=p.v128,s.isValue&&s.kind===11?e.unary(131,a):(r.error(203,n.reportNode.typeArgumentsRange,"v128.promote_low",s.toString()),e.unreachable())}E.set(g.v128_promote_low,hx);function mx(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);return s.isValue&&s.kind===2?e.binary(157,a,l):(r.error(203,n.reportNode.typeArgumentsRange,"v128.q15mulr_sat",s.toString()),e.unreachable())}E.set(g.v128_q15mulr_sat,mx);function gn(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(158,a,l);case 6:return e.binary(160,a,l);case 2:return e.binary(170,a,l);case 7:return e.binary(172,a,l);case 3:return e.binary(177,a,l);case 8:return e.binary(179,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.extmul_low",s.toString()),e.unreachable()}E.set(g.v128_extmul_low,gn);function bn(n){let r=n.compiler,e=r.module;if(X(n,16)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(159,a,l);case 6:return e.binary(161,a,l);case 2:return e.binary(171,a,l);case 7:return e.binary(173,a,l);case 3:return e.binary(178,a,l);case 8:return e.binary(180,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.extmul_high",s.toString()),e.unreachable()}E.set(g.v128_extmul_high,bn);function yx(n){let r=n.compiler,e=r.module;if(X(n,4096)|F(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=r.compileExpression(t[0],p.v128,1),s=r.compileExpression(t[1],p.v128,1);return e.binary(210,i,s)}E.set(g.v128_relaxed_swizzle,yx);function o_(n){let r=n.compiler,e=r.module;if(X(n,4096)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 5:if(r.options.isWasm64)break;case 3:return e.unary(132,a);case 10:if(r.options.isWasm64)break;case 8:return e.unary(133,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_trunc",s.toString()),e.unreachable()}E.set(g.v128_relaxed_trunc,o_);function u_(n){let r=n.compiler,e=r.module;if(X(n,4096)|$(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 5:if(r.options.isWasm64)break;case 3:return e.unary(134,a);case 10:if(r.options.isWasm64)break;case 8:return e.unary(135,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_trunc_zero",s.toString()),e.unreachable()}E.set(g.v128_relaxed_trunc_zero,u_);function c_(n){let r=n.compiler,e=r.module;if(X(n,4096)|$(n)|K(n,3))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1),o=r.compileExpression(t[2],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.simd_ternary(1,a,l,o);case 12:return e.simd_ternary(3,a,l,o)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_madd",s.toString()),e.unreachable()}E.set(g.v128_relaxed_madd,c_);function p_(n){let r=n.compiler,e=r.module;if(X(n,4096)|$(n)|K(n,3))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1),o=r.compileExpression(t[2],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.simd_ternary(2,a,l,o);case 12:return e.simd_ternary(4,a,l,o)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_nmadd",s.toString()),e.unreachable()}E.set(g.v128_relaxed_nmadd,p_);function oa(n){let r=n.compiler,e=r.module;if(X(n,4096)|$(n)|K(n,3))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1),o=r.compileExpression(t[2],p.v128,1);if(s.isValue)switch(s.kind){case 1:case 6:return e.simd_ternary(5,a,l,o);case 2:case 7:return e.simd_ternary(6,a,l,o);case 3:case 8:return e.simd_ternary(7,a,l,o);case 4:case 9:return e.simd_ternary(8,a,l,o);case 5:case 10:return e.simd_ternary(r.options.isWasm64?8:7,a,l,o)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_laneselect",s.toString()),e.unreachable()}E.set(g.v128_relaxed_laneselect,oa);function f_(n){let r=n.compiler,e=r.module;if(X(n,4096)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.binary(211,a,l);case 12:return e.binary(213,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_min",s.toString()),e.unreachable()}E.set(g.v128_relaxed_min,f_);function __(n){let r=n.compiler,e=r.module;if(X(n,4096)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.binary(212,a,l);case 12:return e.binary(214,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_max",s.toString()),e.unreachable()}E.set(g.v128_relaxed_max,__);function gx(n){let r=n.compiler,e=r.module;if(X(n,4096)|$(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);return s.isValue&&s.kind===2?e.binary(215,a,l):(r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_q15mulr",s.toString()),e.unreachable())}E.set(g.v128_relaxed_q15mulr,gx);function bx(n){let r=n.compiler,e=r.module;if(X(n,4096)|K(n,2)|$(n))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);return s.kind===2?e.binary(216,a,l):(r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_dot",s.toString()),e.unreachable())}E.set(g.v128_relaxed_dot,bx);function xx(n){let r=n.compiler,e=r.module;if(X(n,4096)|K(n,3)|$(n))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1),o=r.compileExpression(t[2],p.v128,1);switch(s.kind){case 5:if(r.options.isWasm64)break;case 3:return e.simd_ternary(9,a,l,o)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_dot_add",s.toString()),e.unreachable()}E.set(g.v128_relaxed_dot_add,xx);function zT(n){let r=n.compiler,e=r.module;if(F(n)|K(n,1))return r.currentType=p.void,e.unreachable();let t=n.operands,i=r.compileExpression(t[0],p.u32,1);return r.runtimeFeatures|=16,r.currentType=p.void,e.call(g.visit_globals,[i],P.None)}E.set(g.visit_globals,zT);function DT(n){let r=n.compiler,e=r.module;if(F(n)|K(n,2))return r.currentType=p.void,e.unreachable();let t=n.operands,i=r.compileExpression(t[0],r.options.usizeType,1),s=r.compileExpression(t[1],p.u32,1);return r.runtimeFeatures|=32,r.currentType=p.void,e.call(g.visit_members,[i,s],P.None)}E.set(g.visit_members,DT);function GT(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Pf(n)}E.set(g.i32_clz,GT);function UT(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Pf(n)}E.set(g.i64_clz,UT);function VT(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Nf(n)}E.set(g.i32_ctz,VT);function OT(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Nf(n)}E.set(g.i64_ctz,OT);function qT(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Bf(n)}E.set(g.i32_popcnt,qT);function WT(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Bf(n)}E.set(g.i64_popcnt,WT);function KT(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Lf(n)}E.set(g.i32_rotl,KT);function HT(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Lf(n)}E.set(g.i64_rotl,HT);function jT(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Mf(n)}E.set(g.i32_rotr,jT);function QT(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Mf(n)}E.set(g.i64_rotr,QT);function XT(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,zf(n)}E.set(g.f32_abs,XT);function $T(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,zf(n)}E.set(g.f64_abs,$T);function ZT(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Df(n)}E.set(g.f32_max,ZT);function YT(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Df(n)}E.set(g.f64_max,YT);function JT(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Gf(n)}E.set(g.f32_min,JT);function e6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Gf(n)}E.set(g.f64_min,e6);function t6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Uf(n)}E.set(g.f32_ceil,t6);function r6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Uf(n)}E.set(g.f64_ceil,r6);function n6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Vf(n)}E.set(g.f32_floor,n6);function i6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Vf(n)}E.set(g.f64_floor,i6);function s6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Of(n)}E.set(g.f32_copysign,s6);function a6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Of(n)}E.set(g.f64_copysign,a6);function l6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,qf(n)}E.set(g.f32_nearest,l6);function o6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,qf(n)}E.set(g.f64_nearest,o6);function u6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.f32,Ks(n)}E.set(g.i32_reinterpret_f32,u6);function c6(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.f64,Ks(n)}E.set(g.i64_reinterpret_f64,c6);function p6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.i32,Ks(n)}E.set(g.f32_reinterpret_i32,p6);function f6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.i64,Ks(n)}E.set(g.f64_reinterpret_i64,f6);function _6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Wf(n)}E.set(g.f32_sqrt,_6);function d6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Wf(n)}E.set(g.f64_sqrt,d6);function h6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Kf(n)}E.set(g.f32_trunc,h6);function m6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Kf(n)}E.set(g.f64_trunc,m6);function y6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Hs(n)}E.set(g.i32_rem_s,y6);function g6(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.u32,Hs(n)}E.set(g.i32_rem_u,g6);function b6(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Hs(n)}E.set(g.i64_rem_s,b6);function x6(n){return F(n),n.typeArguments=[p.u64],n.contextualType=p.u64,Hs(n)}E.set(g.i64_rem_u,x6);function E6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,js(n)}E.set(g.i32_add,E6);function A6(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,js(n)}E.set(g.i64_add,A6);function T6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,js(n)}E.set(g.f32_add,T6);function S6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,js(n)}E.set(g.f64_add,S6);function v6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Qs(n)}E.set(g.i32_sub,v6);function I6(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Qs(n)}E.set(g.i64_sub,I6);function k6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Qs(n)}E.set(g.f32_sub,k6);function F6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Qs(n)}E.set(g.f64_sub,F6);function w6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Xs(n)}E.set(g.i32_mul,w6);function R6(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Xs(n)}E.set(g.i64_mul,R6);function C6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Xs(n)}E.set(g.f32_mul,C6);function P6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Xs(n)}E.set(g.f64_mul,P6);function N6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,sn(n)}E.set(g.i32_div_s,N6);function B6(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.u32,sn(n)}E.set(g.i32_div_u,B6);function L6(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,sn(n)}E.set(g.i64_div_s,L6);function M6(n){return F(n),n.typeArguments=[p.u64],n.contextualType=p.u64,sn(n)}E.set(g.i64_div_u,M6);function z6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,sn(n)}E.set(g.f32_div,z6);function D6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,sn(n)}E.set(g.f64_div,D6);function G6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,$s(n)}E.set(g.i32_eq,G6);function U6(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i32,$s(n)}E.set(g.i64_eq,U6);function V6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.i32,$s(n)}E.set(g.f32_eq,V6);function O6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.i32,$s(n)}E.set(g.f64_eq,O6);function q6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Zs(n)}E.set(g.i32_ne,q6);function W6(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i32,Zs(n)}E.set(g.i64_ne,W6);function K6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.i32,Zs(n)}E.set(g.f32_ne,K6);function H6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.i32,Zs(n)}E.set(g.f64_ne,H6);function j6(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i32,Ue(n)}E.set(g.i32_load8_s,j6);function Q6(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,Ue(n)}E.set(g.i32_load8_u,Q6);function X6(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.i32,Ue(n)}E.set(g.i32_load16_s,X6);function $6(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,Ue(n)}E.set(g.i32_load16_u,$6);function Z6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Ue(n)}E.set(g.i32_load,Z6);function Y6(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i64,Ue(n)}E.set(g.i64_load8_s,Y6);function J6(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,Ue(n)}E.set(g.i64_load8_u,J6);function eS(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.i64,Ue(n)}E.set(g.i64_load16_s,eS);function tS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,Ue(n)}E.set(g.i64_load16_u,tS);function rS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i64,Ue(n)}E.set(g.i64_load32_s,rS);function nS(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,Ue(n)}E.set(g.i64_load32_u,nS);function iS(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Ue(n)}E.set(g.i64_load,iS);function sS(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Ue(n)}E.set(g.f32_load,sS);function aS(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Ue(n)}E.set(g.f64_load,aS);function lS(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i32,n.contextIsExact=!0,Tt(n)}E.set(g.i32_store8,lS);function oS(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.i32,n.contextIsExact=!0,Tt(n)}E.set(g.i32_store16,oS);function uS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,Tt(n)}E.set(g.i32_store,uS);function cS(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i64,n.contextIsExact=!0,Tt(n)}E.set(g.i64_store8,cS);function pS(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.i64,n.contextIsExact=!0,Tt(n)}E.set(g.i64_store16,pS);function fS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i64,n.contextIsExact=!0,Tt(n)}E.set(g.i64_store32,fS);function _S(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,Tt(n)}E.set(g.i64_store,_S);function dS(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,n.contextIsExact=!0,Tt(n)}E.set(g.f32_store,dS);function hS(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,n.contextIsExact=!0,Tt(n)}E.set(g.f64_store,hS);function mS(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,Sr(n)}E.set(g.i32_atomic_load8_u,mS);function yS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,Sr(n)}E.set(g.i32_atomic_load16_u,yS);function gS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Sr(n)}E.set(g.i32_atomic_load,gS);function bS(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,Sr(n)}E.set(g.i64_atomic_load8_u,bS);function xS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,Sr(n)}E.set(g.i64_atomic_load16_u,xS);function ES(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,Sr(n)}E.set(g.i64_atomic_load32_u,ES);function AS(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Sr(n)}E.set(g.i64_atomic_load,AS);function TS(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i32,n.contextIsExact=!0,vr(n)}E.set(g.i32_atomic_store8,TS);function SS(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.i32,n.contextIsExact=!0,vr(n)}E.set(g.i32_atomic_store16,SS);function vS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,vr(n)}E.set(g.i32_atomic_store,vS);function IS(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i64,n.contextIsExact=!0,vr(n)}E.set(g.i64_atomic_store8,IS);function kS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,n.contextIsExact=!0,vr(n)}E.set(g.i64_atomic_store16,kS);function FS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i64,n.contextIsExact=!0,vr(n)}E.set(g.i64_atomic_store32,FS);function wS(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,vr(n)}E.set(g.i64_atomic_store,wS);function RS(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,n.contextIsExact=!0,Ir(n)}E.set(g.i32_atomic_rmw8_add_u,RS);function CS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,n.contextIsExact=!0,Ir(n)}E.set(g.i32_atomic_rmw16_add_u,CS);function PS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,Ir(n)}E.set(g.i32_atomic_rmw_add,PS);function NS(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,n.contextIsExact=!0,Ir(n)}E.set(g.i64_atomic_rmw8_add_u,NS);function BS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,n.contextIsExact=!0,Ir(n)}E.set(g.i64_atomic_rmw16_add_u,BS);function LS(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,n.contextIsExact=!0,Ir(n)}E.set(g.i64_atomic_rmw32_add_u,LS);function MS(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,Ir(n)}E.set(g.i64_atomic_rmw_add,MS);function zS(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,n.contextIsExact=!0,kr(n)}E.set(g.i32_atomic_rmw8_sub_u,zS);function DS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,n.contextIsExact=!0,kr(n)}E.set(g.i32_atomic_rmw16_sub_u,DS);function GS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,kr(n)}E.set(g.i32_atomic_rmw_sub,GS);function US(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,n.contextIsExact=!0,kr(n)}E.set(g.i64_atomic_rmw8_sub_u,US);function VS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,n.contextIsExact=!0,kr(n)}E.set(g.i64_atomic_rmw16_sub_u,VS);function OS(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,n.contextIsExact=!0,kr(n)}E.set(g.i64_atomic_rmw32_sub_u,OS);function qS(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,kr(n)}E.set(g.i64_atomic_rmw_sub,qS);function WS(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,n.contextIsExact=!0,Fr(n)}E.set(g.i32_atomic_rmw8_and_u,WS);function KS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,n.contextIsExact=!0,Fr(n)}E.set(g.i32_atomic_rmw16_and_u,KS);function HS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,Fr(n)}E.set(g.i32_atomic_rmw_and,HS);function jS(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,n.contextIsExact=!0,Fr(n)}E.set(g.i64_atomic_rmw8_and_u,jS);function QS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,n.contextIsExact=!0,Fr(n)}E.set(g.i64_atomic_rmw16_and_u,QS);function XS(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,n.contextIsExact=!0,Fr(n)}E.set(g.i64_atomic_rmw32_and_u,XS);function $S(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,Fr(n)}E.set(g.i64_atomic_rmw_and,$S);function ZS(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,n.contextIsExact=!0,wr(n)}E.set(g.i32_atomic_rmw8_or_u,ZS);function YS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,n.contextIsExact=!0,wr(n)}E.set(g.i32_atomic_rmw16_or_u,YS);function JS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,wr(n)}E.set(g.i32_atomic_rmw_or,JS);function ev(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,n.contextIsExact=!0,wr(n)}E.set(g.i64_atomic_rmw8_or_u,ev);function tv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,n.contextIsExact=!0,wr(n)}E.set(g.i64_atomic_rmw16_or_u,tv);function rv(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,n.contextIsExact=!0,wr(n)}E.set(g.i64_atomic_rmw32_or_u,rv);function nv(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,wr(n)}E.set(g.i64_atomic_rmw_or,nv);function iv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,n.contextIsExact=!0,Rr(n)}E.set(g.i32_atomic_rmw8_xor_u,iv);function sv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,n.contextIsExact=!0,Rr(n)}E.set(g.i32_atomic_rmw16_xor_u,sv);function av(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,Rr(n)}E.set(g.i32_atomic_rmw_xor,av);function lv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,n.contextIsExact=!0,Rr(n)}E.set(g.i64_atomic_rmw8_xor_u,lv);function ov(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,n.contextIsExact=!0,Rr(n)}E.set(g.i64_atomic_rmw16_xor_u,ov);function uv(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,n.contextIsExact=!0,Rr(n)}E.set(g.i64_atomic_rmw32_xor_u,uv);function cv(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,Rr(n)}E.set(g.i64_atomic_rmw_xor,cv);function pv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,n.contextIsExact=!0,Cr(n)}E.set(g.i32_atomic_rmw8_xchg_u,pv);function fv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,n.contextIsExact=!0,Cr(n)}E.set(g.i32_atomic_rmw16_xchg_u,fv);function _v(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,Cr(n)}E.set(g.i32_atomic_rmw_xchg,_v);function dv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,n.contextIsExact=!0,Cr(n)}E.set(g.i64_atomic_rmw8_xchg_u,dv);function hv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,n.contextIsExact=!0,Cr(n)}E.set(g.i64_atomic_rmw16_xchg_u,hv);function mv(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,n.contextIsExact=!0,Cr(n)}E.set(g.i64_atomic_rmw32_xchg_u,mv);function yv(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,Cr(n)}E.set(g.i64_atomic_rmw_xchg,yv);function gv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,n.contextIsExact=!0,Pr(n)}E.set(g.i32_atomic_rmw8_cmpxchg_u,gv);function bv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,n.contextIsExact=!0,Pr(n)}E.set(g.i32_atomic_rmw16_cmpxchg_u,bv);function xv(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,Pr(n)}E.set(g.i32_atomic_rmw_cmpxchg,xv);function Ev(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,n.contextIsExact=!0,Pr(n)}E.set(g.i64_atomic_rmw8_cmpxchg_u,Ev);function Av(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,n.contextIsExact=!0,Pr(n)}E.set(g.i64_atomic_rmw16_cmpxchg_u,Av);function Tv(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,n.contextIsExact=!0,Pr(n)}E.set(g.i64_atomic_rmw32_cmpxchg_u,Tv);function Sv(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,Pr(n)}E.set(g.i64_atomic_rmw_cmpxchg,Sv);function vv(n){return F(n),n.typeArguments=[p.i32],Hf(n)}E.set(g.memory_atomic_wait32,vv);function Iv(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i32,Hf(n)}E.set(g.memory_atomic_wait64,Iv);function kv(n){return F(n),n.typeArguments=[p.v128],n.contextualType=p.v128,Ue(n)}E.set(g.v128_load,kv);function Fv(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,un(n)}E.set(g.v128_load8x8_s,Fv);function wv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,un(n)}E.set(g.v128_load8x8_u,wv);function Rv(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,un(n)}E.set(g.v128_load16x4_s,Rv);function Cv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,un(n)}E.set(g.v128_load16x4_u,Cv);function Pv(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,un(n)}E.set(g.v128_load32x2_s,Pv);function Nv(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,un(n)}E.set(g.v128_load32x2_u,Nv);function Bv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,Ys(n)}E.set(g.v128_load8_splat,Bv);function Lv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,Ys(n)}E.set(g.v128_load16_splat,Lv);function Mv(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,Ys(n)}E.set(g.v128_load32_splat,Mv);function zv(n){return F(n),n.typeArguments=[p.u64],n.contextualType=p.v128,Ys(n)}E.set(g.v128_load64_splat,zv);function Dv(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,Qf(n)}E.set(g.v128_load32_zero,Dv);function Gv(n){return F(n),n.typeArguments=[p.u64],n.contextualType=p.v128,Qf(n)}E.set(g.v128_load64_zero,Gv);function Uv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,Js(n)}E.set(g.v128_load8_lane,Uv);function Vv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,Js(n)}E.set(g.v128_load16_lane,Vv);function Ov(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,Js(n)}E.set(g.v128_load32_lane,Ov);function qv(n){return F(n),n.typeArguments=[p.u64],n.contextualType=p.v128,Js(n)}E.set(g.v128_load64_lane,qv);function Wv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,ea(n)}E.set(g.v128_store8_lane,Wv);function Kv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,ea(n)}E.set(g.v128_store16_lane,Kv);function Hv(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,ea(n)}E.set(g.v128_store32_lane,Hv);function jv(n){return F(n),n.typeArguments=[p.u64],n.contextualType=p.v128,ea(n)}E.set(g.v128_store64_lane,jv);function Qv(n){return F(n),n.typeArguments=[p.v128],n.contextualType=p.v128,n.contextIsExact=!0,Tt(n)}E.set(g.v128_store,Qv);function Xv(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,an(n)}E.set(g.i8x16_splat,Xv);function $v(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i32,ar(n)}E.set(g.i8x16_extract_lane_s,$v);function Zv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,ar(n)}E.set(g.i8x16_extract_lane_u,Zv);function Yv(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,ln(n)}E.set(g.i8x16_replace_lane,Yv);function Jv(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,cn(n)}E.set(g.i8x16_add,Jv);function eI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,pn(n)}E.set(g.i8x16_sub,eI);function tI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,lr(n)}E.set(g.i8x16_min_s,tI);function rI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,lr(n)}E.set(g.i8x16_min_u,rI);function nI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,or(n)}E.set(g.i8x16_max_s,nI);function iI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,or(n)}E.set(g.i8x16_max_u,iI);function sI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,Yf(n)}E.set(g.i8x16_avgr_u,sI);function aI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,hn(n)}E.set(g.i8x16_abs,aI);function lI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,dn(n)}E.set(g.i8x16_neg,lI);function oI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,ta(n)}E.set(g.i8x16_add_sat_s,oI);function uI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,ta(n)}E.set(g.i8x16_add_sat_u,uI);function cI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,ra(n)}E.set(g.i8x16_sub_sat_s,cI);function pI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,ra(n)}E.set(g.i8x16_sub_sat_u,pI);function fI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,ia(n)}E.set(g.i8x16_shl,fI);function _I(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,ur(n)}E.set(g.i8x16_shr_s,_I);function dI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,ur(n)}E.set(g.i8x16_shr_u,dI);function hI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i32,sa(n)}E.set(g.i8x16_all_true,hI);function mI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i32,aa(n)}E.set(g.i8x16_bitmask,mI);function yI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,_x(n)}E.set(g.i8x16_popcnt,yI);function gI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,fn(n)}E.set(g.i8x16_eq,gI);function bI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,_n(n)}E.set(g.i8x16_ne,bI);function xI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,zt(n)}E.set(g.i8x16_lt_s,xI);function EI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,zt(n)}E.set(g.i8x16_lt_u,EI);function AI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,Dt(n)}E.set(g.i8x16_le_s,AI);function TI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,Dt(n)}E.set(g.i8x16_le_u,TI);function SI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,Gt(n)}E.set(g.i8x16_gt_s,SI);function vI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,Gt(n)}E.set(g.i8x16_gt_u,vI);function II(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,Ut(n)}E.set(g.i8x16_ge_s,II);function kI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,Ut(n)}E.set(g.i8x16_ge_u,kI);function FI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,na(n)}E.set(g.i8x16_narrow_i16x8_s,FI);function wI(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,na(n)}E.set(g.i8x16_narrow_i16x8_u,wI);function RI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,on(n)}E.set(g.i8x16_shuffle,RI);function CI(n){return F(n),n.typeArguments=null,n.contextualType=p.v128,px(n)}E.set(g.i8x16_swizzle,CI);function PI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,an(n)}E.set(g.i16x8_splat,PI);function NI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.i32,ar(n)}E.set(g.i16x8_extract_lane_s,NI);function BI(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,ar(n)}E.set(g.i16x8_extract_lane_u,BI);function LI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,ln(n)}E.set(g.i16x8_replace_lane,LI);function MI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,cn(n)}E.set(g.i16x8_add,MI);function zI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,pn(n)}E.set(g.i16x8_sub,zI);function DI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,ci(n)}E.set(g.i16x8_mul,DI);function GI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,lr(n)}E.set(g.i16x8_min_s,GI);function UI(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,lr(n)}E.set(g.i16x8_min_u,UI);function VI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,or(n)}E.set(g.i16x8_max_s,VI);function OI(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,or(n)}E.set(g.i16x8_max_u,OI);function qI(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,Yf(n)}E.set(g.i16x8_avgr_u,qI);function WI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,hn(n)}E.set(g.i16x8_abs,WI);function KI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,dn(n)}E.set(g.i16x8_neg,KI);function HI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,ta(n)}E.set(g.i16x8_add_sat_s,HI);function jI(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,ta(n)}E.set(g.i16x8_add_sat_u,jI);function QI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,ra(n)}E.set(g.i16x8_sub_sat_s,QI);function XI(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,ra(n)}E.set(g.i16x8_sub_sat_u,XI);function $I(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,ia(n)}E.set(g.i16x8_shl,$I);function ZI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,ur(n)}E.set(g.i16x8_shr_s,ZI);function YI(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,ur(n)}E.set(g.i16x8_shr_u,YI);function JI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.i32,sa(n)}E.set(g.i16x8_all_true,JI);function e4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.i32,aa(n)}E.set(g.i16x8_bitmask,e4);function t4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,fn(n)}E.set(g.i16x8_eq,t4);function r4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,_n(n)}E.set(g.i16x8_ne,r4);function n4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,zt(n)}E.set(g.i16x8_lt_s,n4);function i4(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,zt(n)}E.set(g.i16x8_lt_u,i4);function s4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,Dt(n)}E.set(g.i16x8_le_s,s4);function a4(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,Dt(n)}E.set(g.i16x8_le_u,a4);function l4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,Gt(n)}E.set(g.i16x8_gt_s,l4);function o4(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,Gt(n)}E.set(g.i16x8_gt_u,o4);function u4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,Ut(n)}E.set(g.i16x8_ge_s,u4);function c4(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,Ut(n)}E.set(g.i16x8_ge_u,c4);function p4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,na(n)}E.set(g.i16x8_narrow_i32x4_s,p4);function f4(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,na(n)}E.set(g.i16x8_narrow_i32x4_u,f4);function _4(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,mn(n)}E.set(g.i16x8_extend_low_i8x16_s,_4);function d4(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,mn(n)}E.set(g.i16x8_extend_low_i8x16_u,d4);function h4(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,yn(n)}E.set(g.i16x8_extend_high_i8x16_s,h4);function m4(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,yn(n)}E.set(g.i16x8_extend_high_i8x16_u,m4);function y4(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,la(n)}E.set(g.i16x8_extadd_pairwise_i8x16_s,y4);function g4(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,la(n)}E.set(g.i16x8_extadd_pairwise_i8x16_u,g4);function b4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,mx(n)}E.set(g.i16x8_q15mulr_sat_s,b4);function x4(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,gn(n)}E.set(g.i16x8_extmul_low_i8x16_s,x4);function E4(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,gn(n)}E.set(g.i16x8_extmul_low_i8x16_u,E4);function A4(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,bn(n)}E.set(g.i16x8_extmul_high_i8x16_s,A4);function T4(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,bn(n)}E.set(g.i16x8_extmul_high_i8x16_u,T4);function S4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,on(n)}E.set(g.i16x8_shuffle,S4);function v4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,an(n)}E.set(g.i32x4_splat,v4);function I4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,ar(n)}E.set(g.i32x4_extract_lane,I4);function k4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,ln(n)}E.set(g.i32x4_replace_lane,k4);function F4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,cn(n)}E.set(g.i32x4_add,F4);function w4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,pn(n)}E.set(g.i32x4_sub,w4);function R4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,ci(n)}E.set(g.i32x4_mul,R4);function C4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,lr(n)}E.set(g.i32x4_min_s,C4);function P4(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,lr(n)}E.set(g.i32x4_min_u,P4);function N4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,or(n)}E.set(g.i32x4_max_s,N4);function B4(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,or(n)}E.set(g.i32x4_max_u,B4);function L4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,fx(n)}E.set(g.i32x4_dot_i16x8_s,L4);function M4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,hn(n)}E.set(g.i32x4_abs,M4);function z4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,dn(n)}E.set(g.i32x4_neg,z4);function D4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,ia(n)}E.set(g.i32x4_shl,D4);function G4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,ur(n)}E.set(g.i32x4_shr_s,G4);function U4(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,ur(n)}E.set(g.i32x4_shr_u,U4);function V4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,sa(n)}E.set(g.i32x4_all_true,V4);function O4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,aa(n)}E.set(g.i32x4_bitmask,O4);function q4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,fn(n)}E.set(g.i32x4_eq,q4);function W4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,_n(n)}E.set(g.i32x4_ne,W4);function K4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,zt(n)}E.set(g.i32x4_lt_s,K4);function H4(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,zt(n)}E.set(g.i32x4_lt_u,H4);function j4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,Dt(n)}E.set(g.i32x4_le_s,j4);function Q4(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,Dt(n)}E.set(g.i32x4_le_u,Q4);function X4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,Gt(n)}E.set(g.i32x4_gt_s,X4);function $4(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,Gt(n)}E.set(g.i32x4_gt_u,$4);function Z4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,Ut(n)}E.set(g.i32x4_ge_s,Z4);function Y4(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,Ut(n)}E.set(g.i32x4_ge_u,Y4);function J4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,a_(n)}E.set(g.i32x4_trunc_sat_f32x4_s,J4);function e0(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,a_(n)}E.set(g.i32x4_trunc_sat_f32x4_u,e0);function t0(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,l_(n)}E.set(g.i32x4_trunc_sat_f64x2_s_zero,t0);function r0(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,l_(n)}E.set(g.i32x4_trunc_sat_f64x2_u_zero,r0);function n0(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,mn(n)}E.set(g.i32x4_extend_low_i16x8_s,n0);function i0(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,mn(n)}E.set(g.i32x4_extend_low_i16x8_u,i0);function s0(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,yn(n)}E.set(g.i32x4_extend_high_i16x8_s,s0);function a0(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,yn(n)}E.set(g.i32x4_extend_high_i16x8_u,a0);function l0(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,la(n)}E.set(g.i32x4_extadd_pairwise_i16x8_s,l0);function o0(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,la(n)}E.set(g.i32x4_extadd_pairwise_i16x8_u,o0);function u0(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,gn(n)}E.set(g.i32x4_extmul_low_i16x8_s,u0);function c0(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,gn(n)}E.set(g.i32x4_extmul_low_i16x8_u,c0);function p0(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,bn(n)}E.set(g.i32x4_extmul_high_i16x8_s,p0);function f0(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,bn(n)}E.set(g.i32x4_extmul_high_i16x8_u,f0);function _0(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,on(n)}E.set(g.i32x4_shuffle,_0);function d0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,an(n)}E.set(g.i64x2_splat,d0);function h0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,ar(n)}E.set(g.i64x2_extract_lane,h0);function m0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,ln(n)}E.set(g.i64x2_replace_lane,m0);function y0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,cn(n)}E.set(g.i64x2_add,y0);function g0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,pn(n)}E.set(g.i64x2_sub,g0);function b0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,ci(n)}E.set(g.i64x2_mul,b0);function x0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,hn(n)}E.set(g.i64x2_abs,x0);function E0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,dn(n)}E.set(g.i64x2_neg,E0);function A0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,ia(n)}E.set(g.i64x2_shl,A0);function T0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,ur(n)}E.set(g.i64x2_shr_s,T0);function S0(n){return F(n),n.typeArguments=[p.u64],n.contextualType=p.v128,ur(n)}E.set(g.i64x2_shr_u,S0);function v0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i32,sa(n)}E.set(g.i64x2_all_true,v0);function I0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i32,aa(n)}E.set(g.i64x2_bitmask,I0);function k0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,fn(n)}E.set(g.i64x2_eq,k0);function F0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,_n(n)}E.set(g.i64x2_ne,F0);function w0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,zt(n)}E.set(g.i64x2_lt_s,w0);function R0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,Dt(n)}E.set(g.i64x2_le_s,R0);function C0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,Gt(n)}E.set(g.i64x2_gt_s,C0);function P0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,Ut(n)}E.set(g.i64x2_ge_s,P0);function N0(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,mn(n)}E.set(g.i64x2_extend_low_i32x4_s,N0);function B0(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,mn(n)}E.set(g.i64x2_extend_low_i32x4_u,B0);function L0(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,yn(n)}E.set(g.i64x2_extend_high_i32x4_s,L0);function M0(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,yn(n)}E.set(g.i64x2_extend_high_i32x4_u,M0);function z0(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,gn(n)}E.set(g.i64x2_extmul_low_i32x4_s,z0);function D0(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,gn(n)}E.set(g.i64x2_extmul_low_i32x4_u,D0);function G0(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,bn(n)}E.set(g.i64x2_extmul_high_i32x4_s,G0);function U0(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,bn(n)}E.set(g.i64x2_extmul_high_i32x4_u,U0);function V0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,on(n)}E.set(g.i64x2_shuffle,V0);function O0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,an(n)}E.set(g.f32x4_splat,O0);function q0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,ar(n)}E.set(g.f32x4_extract_lane,q0);function W0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,ln(n)}E.set(g.f32x4_replace_lane,W0);function K0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,cn(n)}E.set(g.f32x4_add,K0);function H0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,pn(n)}E.set(g.f32x4_sub,H0);function j0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,ci(n)}E.set(g.f32x4_mul,j0);function Q0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,Xf(n)}E.set(g.f32x4_div,Q0);function X0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,dn(n)}E.set(g.f32x4_neg,X0);function $0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,lr(n)}E.set(g.f32x4_min,$0);function Z0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,or(n)}E.set(g.f32x4_max,Z0);function Y0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,$f(n)}E.set(g.f32x4_pmin,Y0);function J0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,Zf(n)}E.set(g.f32x4_pmax,J0);function e3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,hn(n)}E.set(g.f32x4_abs,e3);function t3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,Jf(n)}E.set(g.f32x4_sqrt,t3);function r3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,e_(n)}E.set(g.f32x4_ceil,r3);function n3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,t_(n)}E.set(g.f32x4_floor,n3);function i3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,r_(n)}E.set(g.f32x4_trunc,i3);function s3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,n_(n)}E.set(g.f32x4_nearest,s3);function a3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,fn(n)}E.set(g.f32x4_eq,a3);function l3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,_n(n)}E.set(g.f32x4_ne,l3);function o3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,zt(n)}E.set(g.f32x4_lt,o3);function u3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,Dt(n)}E.set(g.f32x4_le,u3);function c3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,Gt(n)}E.set(g.f32x4_gt,c3);function p3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,Ut(n)}E.set(g.f32x4_ge,p3);function f3(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,i_(n)}E.set(g.f32x4_convert_i32x4_s,f3);function _3(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,i_(n)}E.set(g.f32x4_convert_i32x4_u,_3);function d3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,dx(n)}E.set(g.f32x4_demote_f64x2_zero,d3);function h3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,on(n)}E.set(g.f32x4_shuffle,h3);function m3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,an(n)}E.set(g.f64x2_splat,m3);function y3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,ar(n)}E.set(g.f64x2_extract_lane,y3);function g3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,ln(n)}E.set(g.f64x2_replace_lane,g3);function b3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,cn(n)}E.set(g.f64x2_add,b3);function x3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,pn(n)}E.set(g.f64x2_sub,x3);function E3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,ci(n)}E.set(g.f64x2_mul,E3);function A3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,Xf(n)}E.set(g.f64x2_div,A3);function T3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,dn(n)}E.set(g.f64x2_neg,T3);function S3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,lr(n)}E.set(g.f64x2_min,S3);function v3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,or(n)}E.set(g.f64x2_max,v3);function I3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,$f(n)}E.set(g.f64x2_pmin,I3);function k3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,Zf(n)}E.set(g.f64x2_pmax,k3);function F3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,hn(n)}E.set(g.f64x2_abs,F3);function w3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,Jf(n)}E.set(g.f64x2_sqrt,w3);function R3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,e_(n)}E.set(g.f64x2_ceil,R3);function C3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,t_(n)}E.set(g.f64x2_floor,C3);function P3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,r_(n)}E.set(g.f64x2_trunc,P3);function N3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,n_(n)}E.set(g.f64x2_nearest,N3);function B3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,fn(n)}E.set(g.f64x2_eq,B3);function L3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,_n(n)}E.set(g.f64x2_ne,L3);function M3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,zt(n)}E.set(g.f64x2_lt,M3);function z3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,Dt(n)}E.set(g.f64x2_le,z3);function D3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,Gt(n)}E.set(g.f64x2_gt,D3);function G3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,Ut(n)}E.set(g.f64x2_ge,G3);function U3(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,s_(n)}E.set(g.f64x2_convert_low_i32x4_s,U3);function V3(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,s_(n)}E.set(g.f64x2_convert_low_i32x4_u,V3);function O3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,hx(n)}E.set(g.f64x2_promote_low_f32x4,O3);function q3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,on(n)}E.set(g.f64x2_shuffle,q3);function W3(n){return F(n),n.typeArguments=null,n.contextualType=p.v128,yx(n)}E.set(g.i8x16_relaxed_swizzle,W3);function K3(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,o_(n)}E.set(g.i32x4_relaxed_trunc_f32x4_s,K3);function H3(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,o_(n)}E.set(g.i32x4_relaxed_trunc_f32x4_u,H3);function j3(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,u_(n)}E.set(g.i32x4_relaxed_trunc_f64x2_s_zero,j3);function Q3(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,u_(n)}E.set(g.i32x4_relaxed_trunc_f64x2_u_zero,Q3);function X3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,c_(n)}E.set(g.f32x4_relaxed_madd,X3);function $3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,p_(n)}E.set(g.f32x4_relaxed_nmadd,$3);function Z3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,c_(n)}E.set(g.f64x2_relaxed_madd,Z3);function Y3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,p_(n)}E.set(g.f64x2_relaxed_nmadd,Y3);function J3(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,oa(n)}E.set(g.i8x16_relaxed_laneselect,J3);function ek(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,oa(n)}E.set(g.i16x8_relaxed_laneselect,ek);function tk(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,oa(n)}E.set(g.i32x4_relaxed_laneselect,tk);function rk(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,oa(n)}E.set(g.i64x2_relaxed_laneselect,rk);function nk(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,f_(n)}E.set(g.f32x4_relaxed_min,nk);function ik(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,__(n)}E.set(g.f32x4_relaxed_max,ik);function sk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,f_(n)}E.set(g.f64x2_relaxed_min,sk);function ak(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,__(n)}E.set(g.f64x2_relaxed_max,ak);function lk(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,gx(n)}E.set(g.i16x8_relaxed_q15mulr_s,lk);function ok(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,bx(n)}E.set(g.i16x8_relaxed_dot_i8x16_i7x16_s,ok);function uk(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,xx(n)}E.set(g.i32x4_relaxed_dot_i8x16_i7x16_add_s,uk);function Ex(n){let r=n.module,e=new Array,t=n.options.sizeTypeRef,i=assert(n.program.visitInstance);n.compileFunction(i,!0);for(let s=Map_values(n.program.elementsByName),a=0,l=s.length;a<l;++a){let o=unchecked(s[a]);if(o.kind!=0)continue;let u=o,f=u.type.getClass();if(f&&!f.hasDecorator(16)&&u.is(8388608))if(u.is(33554432)){let _=u.constantIntegerValue;(i64_low(_)||i64_high(_))&&e.push(r.call(i.internalName,[n.options.isWasm64?r.i64(i64_low(_),i64_high(_)):r.i32(i64_low(_)),r.local_get(0,P.I32)],P.None))}else e.push(r.if(r.local_tee(1,r.global_get(u.internalName,t),!1),r.call(i.internalName,[r.local_get(1,t),r.local_get(0,P.I32)],P.None)))}r.addFunction(g.visit_globals,P.I32,P.None,[t],e.length?r.block(null,e):r.nop())}function Ax(n,r){if(assert(r.type.isManaged),r.visitRef)return;let e=n.program,t=n.module,i=e.options.usizeType,s=i.toRef(),a=i.byteSize,l=assert(e.visitInstance),o=new Array,u=r.base;u&&o.push(t.call(`${u.internalName}~visit`,[t.local_get(0,s),t.local_get(1,P.I32)],P.None));let c=!1;if(r.isDeclaredInLibrary){let _=r.getMember("__visit");if(_){assert(_.kind==4);let d=e.resolver.resolveFunction(_,null);if(!d||!n.compileFunction(d))o.push(t.unreachable());else{let m=d.signature,h=assert(m.thisType);assert(m.parameterTypes.length==1&&m.parameterTypes[0]==p.u32&&m.returnType==p.void&&r.type.isStrictlyAssignableTo(h)),o.push(t.call(d.internalName,[t.local_get(0,s),t.local_get(1,P.I32)],P.None))}c=!0}}let f=!1;if(!c){let _=r.members;if(_)for(let d=Map_values(_),m=0,h=d.length;m<h;++m){let b=unchecked(d[m]);if(b.kind!=10)continue;let A=b.instance;if(!A)continue;let S=A.type;if(!A.isField||A.getBoundClassOrInterface()!=r||!S.isManaged)continue;let k=A.memoryOffset;assert(k>=0),f=!0,o.push(t.call(l.internalName,[t.load(a,!1,t.local_get(0,s),s,k),t.local_get(1,P.I32)],P.None))}}r.visitRef=t.addFunction(`${r.internalName}~visit`,it([s,P.I32]),P.None,f?[s]:null,t.flatten(o,P.None)),u&&u.type.isManaged&&Ax(n,u)}function Tx(n){let r=n.program,e=n.module,i=r.options.usizeType.toRef(),s=r.managedClasses,a=assert(r.visitInstance);n.compileFunction(a,!0);let l=new Array,o=new Array,u=0;for(let f=Map_keys(s),_=0,d=f.length;_<d;++_){let m=f[_];assert(m==u++);let h=assert(s.get(m));l[_]=h.internalName,h.isPointerfree?o[_]=e.return():(o[_]=e.block(null,[e.call(`${h.internalName}~visit`,[e.local_get(0,i),e.local_get(1,P.I32)],P.None),e.return()],P.None),Ax(n,h))}let c=e.block(l[0],[e.switch(l,"invalid",e.load(4,!1,i==P.I64?e.binary(26,e.local_get(0,i),e.i64(8)):e.binary(1,e.local_get(0,i),e.i32(8)),P.I32,0))],P.None);for(let f=0,_=l.length-1;f<_;++f)c=e.block(l[f+1],[c,o[f]],P.None);c=e.block("invalid",[c,o[l.length-1]],P.None),e.addFunction(g.visit_members,it([i,P.I32]),P.None,null,e.flatten([c,e.unreachable()]))}function li(n){let r=64*(1<<n.alignLog2);return n.is(1)&&(r|=2048),n.is(8)&&(r|=4096),n.is(512)&&(r|=8192),n.isManaged&&(r|=16384),r/64}function Sx(n){let r=n.program,e=n.module,t=r.managedClasses,i=t.size,s=4+4*i,a=new Uint8Array(s);Se(i,a,0);let l=4,o=r.arrayBufferViewInstance,u=o.prototype,c=r.arrayPrototype,f=r.setPrototype,_=r.mapPrototype,d=r.staticArrayPrototype,m=0;for(let A=Map_keys(t),S=0,k=A.length;S<k;++S){let w=unchecked(A[S]),R=assert(t.get(w));assert(w==m++);let C=0;if(R.isPointerfree&&(C|=32),R!=o&&R.extendsPrototype(u)){let M=R.getArrayValueType();C|=1,C|=64*li(M)}else if(R.extendsPrototype(c)){let M=R.getArrayValueType();C|=2,C|=64*li(M)}else if(R.extendsPrototype(f)){let M=assert(R.getTypeArgumentsTo(f));assert(M.length==1),C|=8,C|=64*li(M[0])}else if(R.extendsPrototype(_)){let M=assert(R.getTypeArgumentsTo(_));assert(M.length==2),C|=16,C|=32768*li(M[0]),C|=64*li(M[1])}else if(R.extendsPrototype(d)){let M=R.getArrayValueType();C|=4,C|=64*li(M)}Se(C,a,l),l+=4,R.rttiFlags=C}assert(l==s);let h=r.options.usizeType,b=n.addAlignedMemorySegment(a);if(h.size==8){let A=b.offset;e.addGlobal(g.rtti_base,P.I64,!1,e.i64(i64_low(A),i64_high(A)))}else e.addGlobal(g.rtti_base,P.I32,!1,e.i32(i64_low(b.offset)))}function Ve(n){let r=n.compiler,e=n.operands,t=n.typeArguments;if(oi=0,e.length==0)return!t||t.length!=1?(r.error(2558,n.reportNode.typeArgumentsRange,"1",t?t.length.toString():"0"),null):t[0];if(e.length==1){if(t&&t.length>0){if(t.length>1)return r.error(2558,n.reportNode.typeArgumentsRange,"1",t.length.toString()),null;oi=r.compileExpression(e[0],t[0],1)}else oi=r.compileExpression(e[0],p.auto);return r.currentType}return t&&t.length>1&&r.error(2558,n.reportNode.typeArgumentsRange,"1",t.length.toString()),r.error(2554,n.reportNode.argumentsRange,"1",e.length.toString()),null}function ke(n,r){let e=n.compiler.module;return oi&&Wo(oi,e.ref)&&(r=e.block(null,[e.maybeDrop(oi),r],pe(r))),r}function _t(n,r){let e=r.module,t;if(r.options.isWasm64){let i=r.compileExpression(n,p.usize64,1),s=e.runExpression(i,1);s?(assert(Ge(s)==0),t=Ne(s)):(r.error(220,n.range),t=-1)}else{let i=r.compileExpression(n,p.usize32,1),s=e.runExpression(i,1);s?t=ae(s):(r.error(220,n.range),t=-1)}return t}function ir(n,r,e){let t=_t(n,e);return t<0?t:t<1||r>16?(e.error(222,n.range,"Alignment","1",r.toString()),-1):Hr(t)?t:(e.error(223,n.range,"Alignment"),-1)}function X(n,r){let e=n.compiler;return e.options.hasFeature(r)?0:(e.error(103,n.reportNode.range,Gn(r)),1)}function $(n,r=!1){let e=n.compiler,t=n.typeArguments;if(t){let i=t.length;if(i==1)return 0;assert(i),r&&(e.currentType=t[0]),e.error(2558,n.reportNode.typeArgumentsRange,"1",i.toString())}else e.error(2558,n.reportNode.range,"1","0");return 1}function de(n,r=!1){let e=n.typeArguments;if(e){let t=n.compiler,i=e.length;return i==1?0:(assert(i),r&&(t.currentType=e[0]),t.error(2558,n.reportNode.typeArgumentsRange,"1",i.toString()),1)}return 0}function F(n){if(n.typeArguments){let e=n.prototype;return e.program.error(2315,n.reportNode.typeArgumentsRange,e.internalName),1}return 0}function K(n,r){let e=n.operands;return e.length!=r?(n.compiler.error(2554,n.reportNode.range,r.toString(),e.length.toString()),1):0}function Be(n,r,e){let i=n.operands.length;return i<r?(n.compiler.error(2555,n.reportNode.range,r.toString(),i.toString()),1):i>e?(n.compiler.error(2554,n.reportNode.range,e.toString(),i.toString()),1):0}function nn(n,r,e){let t=n.module;if(e!=p.auto&&e.isIntegerValue)switch(e.kind){case 3:{if(i64_is_i32(r))return n.currentType=p.i32,t.i32(i64_low(r));break}case 8:{if(i64_is_u32(r))return n.currentType=p.u32,t.i32(i64_low(r));break}case 4:case 9:return n.currentType=e,t.i64(i64_low(r),i64_high(r))}return n.options.isWasm64?(n.currentType=p.usize64,t.i64(i64_low(r),i64_high(r))):(n.currentType=p.usize32,assert(!i64_high(r)),t.i32(i64_low(r)))}var au=class{constructor(r,e){this.discriminator=r;this.recordExpression=e}},vx=null;function lu(){let n=vx;return n==null&&(vx=n=new Map),n}var m_=class{constructor(){this.stack=new Array;this._currentExpression=0}get currentExpression(){let r=this._currentExpression;if(!r)throw new Error("not walking expressions");return r}get parentExpressionOrNull(){let r=this.stack,e=r.length;return e?r[e-1]:0}visitBlock(r){}visitIf(r){}visitLoop(r){}visitBreak(r){}visitSwitch(r){}visitCallPre(r){}visitCall(r){}visitCallIndirectPre(r){}visitCallIndirect(r){}visitLocalGet(r){}visitLocalSet(r){}visitGlobalGet(r){}visitGlobalSet(r){}visitLoad(r){}visitStore(r){}visitConst(r){}visitUnary(r){}visitBinary(r){}visitSelect(r){}visitDrop(r){}visitReturn(r){}visitMemorySize(r){}visitMemoryGrow(r){}visitNop(r){}visitUnreachable(r){}visitAtomicRMW(r){}visitAtomicCmpxchg(r){}visitAtomicWait(r){}visitAtomicNotify(r){}visitAtomicFence(r){}visitSIMDExtract(r){}visitSIMDReplace(r){}visitSIMDShuffle(r){}visitSIMDTernary(r){}visitSIMDShift(r){}visitSIMDLoad(r){}visitSIMDLoadStoreLane(r){}visitMemoryInit(r){}visitDataDrop(r){}visitMemoryCopy(r){}visitMemoryFill(r){}visitPop(r){}visitRefNull(r){}visitRefIsNull(r){}visitRefFunc(r){}visitRefEq(r){}visitTry(r){}visitThrow(r){}visitRethrow(r){}visitTupleMake(r){}visitTupleExtract(r){}visitRefI31(r){}visitI31Get(r){}visitCallRef(r){}visitRefTest(r){}visitRefCast(r){}visitBrOn(r){}visitStructNew(r){}visitStructGet(r){}visitStructSet(r){}visitArrayNew(r){}visitArrayNewFixed(r){}visitArrayGet(r){}visitArraySet(r){}visitArrayLen(r){}visitArrayCopy(r){}visitRefAs(r){}visitStringNew(r){}visitStringConst(r){}visitStringMeasure(r){}visitStringEncode(r){}visitStringConcat(r){}visitStringEq(r){}visitStringAs(r){}visitStringWTF8Advance(r){}visitStringWTF16Get(r){}visitStringIterNext(r){}visitStringIterMove(r){}visitStringSliceWTF(r){}visitStringSliceIter(r){}visitName(r){}visitLabel(r){}visitIndex(r){}visitTag(r){}visit(r){let e=this._currentExpression;switch(this._currentExpression=assert(r),Kt(r)){case 1:{this.stack.push(r);let t=Pa(r);t&&this.visitLabel(t);for(let i=0,s=Pi(r);i<s;++i)this.visit(Ni(r,i));assert(this.stack.pop()==r),this.visitBlock(r);break}case 2:{this.stack.push(r),this.visit(Bi(r)),this.visit(Li(r));let t=Mi(r);t&&this.visit(t),assert(this.stack.pop()==r),this.visitIf(r);break}case 3:{this.stack.push(r);let t=Na(r);t&&this.visitLabel(t),this.visit(zi(r)),assert(this.stack.pop()==r),this.visitLoop(r);break}case 4:{this.stack.push(r),this.visitLabel(Ba(r));let t=Di(r);t&&this.visit(t);let i=Uu(r);i&&this.visit(i),assert(this.stack.pop()==r),this.visitBreak(r);break}case 5:{this.stack.push(r);let t=Ld(r);t&&this.visitLabel(t);let i=Nd(r);for(let a=0;a<i;++a)this.visitLabel(Bd(r,a));this.visit(Vu(r));let s=Ou(r);s&&this.visit(s),assert(this.stack.pop()==r),this.visitSwitch(r);break}case 6:{this.visitCallPre(r),this.stack.push(r),this.visitName(Cn(r));let t=hr(r);for(let i=0;i<t;++i)this.visit(mr(r,i));assert(this.stack.pop()==r),this.visitCall(r);break}case 7:{this.visitCallIndirectPre(r),this.stack.push(r),this.visit(qu(r));for(let t=0,i=Gi(r);t<i;++t)this.visit(Ui(r,t));assert(this.stack.pop()==r),this.visitCallIndirect(r);break}case 8:{this.stack.push(r),this.visitIndex(za(r)),assert(this.stack.pop()==r),this.visitLocalGet(r);break}case 9:{this.stack.push(r),this.visitIndex(Pn(r)),this.visit(Gr(r)),assert(this.stack.pop()==r),this.visitLocalSet(r);break}case 10:{this.stack.push(r),this.visitName(Ua(r)),assert(this.stack.pop()==r),this.visitGlobalGet(r);break}case 11:{this.stack.push(r),this.visitName(Qd(r)),this.visit(Wu(r)),assert(this.stack.pop()==r),this.visitGlobalSet(r);break}case 12:{this.stack.push(r),this.visit(Oi(r)),assert(this.stack.pop()==r),this.visitLoad(r);break}case 13:{this.stack.push(r),this.visit(Ur(r)),this.visit(qi(r)),assert(this.stack.pop()==r),this.visitStore(r);break}case 14:{this.visitConst(r);break}case 15:{this.stack.push(r),this.visit(Wi(r)),assert(this.stack.pop()==r),this.visitUnary(r);break}case 16:{this.stack.push(r),this.visit(Ki(r)),this.visit(Hi(r)),assert(this.stack.pop()==r),this.visitBinary(r);break}case 17:{this.stack.push(r),this.visit(ji(r)),this.visit(Qi(r)),this.visit(Xi(r)),assert(this.stack.pop()==r),this.visitSelect(r);break}case 18:{this.stack.push(r),this.visit($i(r)),assert(this.stack.pop()==r),this.visitDrop(r);break}case 19:{let t=Vr(r);t&&(this.stack.push(r),this.visit(t),assert(this.stack.pop()==r)),this.visitReturn(r);break}case 20:{this.visitMemorySize(r);break}case 21:{this.stack.push(r),this.visit(Vi(r)),assert(this.stack.pop()==r),this.visitMemoryGrow(r);break}case 22:{this.visitNop(r);break}case 23:{this.visitUnreachable(r);break}case 24:{this.stack.push(r),this.visit(Hu(r)),this.visit(ju(r)),assert(this.stack.pop()==r),this.visitAtomicRMW(r);break}case 25:{this.stack.push(r),this.visit(Qu(r)),this.visit(Xu(r)),this.visit($u(r)),assert(this.stack.pop()==r),this.visitAtomicCmpxchg(r);break}case 26:{this.stack.push(r),this.visit(Zu(r)),this.visit(Yu(r)),this.visit(Ju(r)),assert(this.stack.pop()==r),this.visitAtomicWait(r);break}case 27:{this.stack.push(r),this.visit(ec(r)),this.visit(tc(r)),assert(this.stack.pop()==r),this.visitAtomicNotify(r);break}case 28:{this.visitAtomicFence(r);break}case 30:{this.stack.push(r),this.visit(rc(r)),assert(this.stack.pop()==r),this.visitSIMDExtract(r);break}case 31:{this.stack.push(r),this.visit(nc(r)),this.visit(ic(r)),assert(this.stack.pop()==r),this.visitSIMDReplace(r);break}case 32:{this.stack.push(r),this.visit(sc(r)),this.visit(ac(r)),assert(this.stack.pop()==r),this.visitSIMDShuffle(r);break}case 33:{this.stack.push(r),this.visit(lc(r)),this.visit(oc(r)),this.visit(uc(r)),assert(this.stack.pop()==r),this.visitSIMDTernary(r);break}case 34:{this.stack.push(r),this.visit(cc(r)),this.visit(pc(r)),assert(this.stack.pop()==r),this.visitSIMDShift(r);break}case 35:{this.stack.push(r),this.visit(fc(r)),assert(this.stack.pop()==r),this.visitSIMDLoad(r);break}case 36:{this.stack.push(r),this.visit(_c(r)),this.visit(dc(r)),assert(this.stack.pop()==r),this.visitSIMDLoadStoreLane(r);break}case 37:{this.stack.push(r),this.visit(hc(r)),this.visit(mc(r)),this.visit(yc(r)),assert(this.stack.pop()==r),this.visitMemoryInit(r);break}case 38:{this.visitDataDrop(r);break}case 39:{this.stack.push(r),this.visit(gc(r)),this.visit(bc(r)),this.visit(xc(r)),assert(this.stack.pop()==r),this.visitMemoryCopy(r);break}case 40:{this.stack.push(r),this.visit(Ec(r)),this.visit(Ac(r)),this.visit(Tc(r)),assert(this.stack.pop()==r),this.visitMemoryFill(r);break}case 41:{this.visitPop(r);break}case 42:{this.visitRefNull(r);break}case 43:{this.stack.push(r),this.visit(Sc(r)),assert(this.stack.pop()==r),this.visitRefIsNull(r);break}case 44:{this.stack.push(r),this.visitName(Im(r)),assert(this.stack.pop()==r),this.visitRefFunc(r);break}case 45:{this.stack.push(r),this.visit(kc(r)),this.visit(Fc(r)),assert(this.stack.pop()==r),this.visitRefEq(r);break}case 54:{this.stack.push(r),this.visit(wc(r));let t=Rc(r);for(let i=0;i<t;++i)this.visit(Cc(r,i));assert(this.stack.pop()==r),this.visitTry(r);break}case 56:{this.stack.push(r),this.visitTag(Dm(r));let t=Pc(r);for(let i=0;i<t;++i)this.visit(Nc(r,i));assert(this.stack.pop()==r),this.visitThrow(r);break}case 57:{this.visitRethrow(r);break}case 59:{let t=Bc(r);if(t){this.stack.push(r);for(let i=0;i<t;++i)this.visit(Lc(r,i));assert(this.stack.pop()==r)}this.visitTupleMake(r);break}case 60:{this.stack.push(r),this.visit(Mc(r)),assert(this.stack.pop()==r),this.visitTupleExtract(r);break}case 61:{this.stack.push(r),this.visit(zc(r)),assert(this.stack.pop()==r),this.visitRefI31(r);break}case 62:{this.stack.push(r),this.visit(Dc(r)),assert(this.stack.pop()==r),this.visitI31Get(r);break}case 63:{this.stack.push(r);let t=Gc(r);if(t)for(let i=0;i<t;++i)this.visit(Uc(r,i));this.visit(Vc(r)),assert(this.stack.pop()==r),this.visitCallRef(r);break}case 64:{this.stack.push(r),this.visit(Oc(r)),assert(this.stack.pop()==r),this.visitRefTest(r);break}case 65:{this.stack.push(r),this.visit(qc(r)),assert(this.stack.pop()==r),this.visitRefCast(r);break}case 67:{this.stack.push(r),this.visitLabel(ey(r)),this.visit(Wc(r)),assert(this.stack.pop()==r),this.visitBrOn(r);break}case 68:{let t=Kc(r);if(t){this.stack.push(r);for(let i=0;i<t;++i)this.visit(Hc(r,i));assert(this.stack.pop()==r)}this.visitStructNew(r);break}case 69:{this.stack.push(r),this.visit(jc(r)),this.visitIndex(ny(r)),assert(this.stack.pop()==r),this.visitStructGet(r);break}case 70:{this.stack.push(r),this.visit(Qc(r)),this.visitIndex(sy(r)),this.visit(Xc(r)),assert(this.stack.pop()==r),this.visitStructSet(r);break}case 73:{this.stack.push(r),this.visit(Zc(r));let t=$c(r);t&&this.visit(t),assert(this.stack.pop()==r),this.visitArrayNew(r);break}case 76:{let t=Yc(r);if(t){this.stack.push(r);for(let i=0;i<t;++i)this.visit(Jc(r,i));assert(this.stack.pop()==r)}this.visitArrayNewFixed(r);break}case 77:{this.stack.push(r),this.visit(ep(r)),this.visit(tp(r)),assert(this.stack.pop()==r),this.visitArrayGet(r);break}case 78:{this.stack.push(r),this.visit(rp(r)),this.visit(np(r)),this.visit(ip(r)),assert(this.stack.pop()==r),this.visitArraySet(r);break}case 81:{this.stack.push(r),this.visit(sp(r)),assert(this.stack.pop()==r),this.visitArrayLen(r);break}case 82:{this.stack.push(r),this.visit(ap(r)),this.visit(lp(r)),this.visit(op(r)),this.visit(up(r)),this.visit(cp(r)),assert(this.stack.pop()==r),this.visitArrayCopy(r);break}case 88:{this.stack.push(r),this.visit(Ic(r)),assert(this.stack.pop()==r),this.visitRefAs(r);break}case 89:{this.stack.push(r),this.visit(pp(r));let t=fp(r);t&&this.visit(t);let i=_p(r);i&&this.visit(i),assert(this.stack.pop()==r),this.visitStringNew(r);break}case 90:{this.stack.push(r),assert(this.stack.pop()==r),this.visitStringConst(r);break}case 91:{this.stack.push(r),this.visit(dp(r)),assert(this.stack.pop()==r),this.visitStringMeasure(r);break}case 92:{this.stack.push(r),this.visit(hp(r)),this.visit(mp(r));let t=yp(r);t&&this.visit(t),assert(this.stack.pop()==r),this.visitStringEncode(r);break}case 93:{this.stack.push(r),this.visit(gp(r)),this.visit(bp(r)),assert(this.stack.pop()==r),this.visitStringConcat(r);break}case 94:{this.stack.push(r),this.visit(Ep(r)),this.visit(Ap(r)),assert(this.stack.pop()==r),this.visitStringEq(r);break}case 96:{this.stack.push(r),this.visit(Tp(r)),this.visit(Sp(r)),assert(this.stack.pop()==r),this.visitStringWTF16Get(r);break}case 97:{this.stack.push(r),this.visit(vp(r)),this.visit(Ip(r)),this.visit(kp(r)),assert(this.stack.pop()==r),this.visitStringSliceWTF(r);break}default:throw new Error("unexpected expression kind")}this._currentExpression=e}},xn=class extends m_{constructor(e){super();this.module=e;this._currentFunction=0;this._currentGlobal=0}get currentFunction(){let e=this._currentFunction;if(!e)throw new Error("not walking a function");return e}get currentGlobal(){let e=this._currentGlobal;if(!e)throw new Error("not walking a global");return e}walkModule(){this.walkFunctions(),this.walkGlobals()}walkFunctions(){let e=this.module.ref;for(let t=0,i=Dy(e);t<i;++t)this.walkFunction(Gy(e,t))}walkFunction(e){let t=yr(e);t&&(this._currentFunction=e,this.visit(t),this._currentFunction=0)}walkGlobals(){let e=this.module.ref;for(let t=0,i=ng(e);t<i;++t)this.walkGlobal(ig(e,t))}walkGlobal(e){this._currentGlobal=e;let t=Za(e);t&&this.visit(t),this._currentGlobal=0}replaceCurrent(e){let t=this.currentExpression,i=this.currentFunction;if(yr(i)==t)ja(i,e);else{let a=assert(this.parentExpressionOrNull);if(!ck(a,t,e))throw Error("failed to replace expression");xd(a)}}};function ck(n,r,e){switch(Kt(n)){case 1:{let t=Pi(n);for(let i=0;i<t;++i){let s=Ni(n,i);if(s==r)return Ad(n,i,e),s}break}case 2:{let t=Bi(n);if(t==r)return Sd(n,e),t;let i=Li(n);if(i==r)return vd(n,e),i;let s=Mi(n);if(s==r)return Id(n,e),s;break}case 3:{let t=zi(n);if(t==r)return Fd(n,e),t;break}case 4:{let t=Di(n);if(t==r)return Rd(n,e),t;let i=Uu(n);if(i==r)return Cd(n,e),i;break}case 5:{let t=Vu(n);if(t==r)return Md(n,e),t;let i=Ou(n);if(i==r)return zd(n,e),i;break}case 6:{let t=hr(n);for(let i=0;i<t;++i){let s=mr(n,i);if(s==r)return La(n,i,e),s}break}case 7:{let t=qu(n);if(t==r)return Vd(n,e),t;let i=Gi(n);for(let s=0;s<i;++s){let a=Ui(n,s);if(a==r)return Ma(n,s,e),a}break}case 8:break;case 9:{let t=Gr(n);if(t==r)return Ga(n,e),t;break}case 10:break;case 11:{let t=Wu(n);if(t==r)return Xd(n,e),t;break}case 12:{let t=Oi(n);if(t==r)return nh(n,e),t;break}case 13:{let t=Ur(n);if(t==r)return qa(n,e),t;let i=qi(n);if(i==r)return ah(n,e),i;break}case 14:break;case 15:{let t=Wi(n);if(t==r)return dh(n,e),t;break}case 16:{let t=Ki(n);if(t==r)return bh(n,e),t;let i=Hi(n);if(i==r)return xh(n,e),i;break}case 17:{let t=ji(n);if(t==r)return Ah(n,e),t;let i=Qi(n);if(i==r)return Th(n,e),i;let s=Xi(n);if(s==r)return Sh(n,e),s;break}case 18:{let t=$i(n);if(t==r)return vh(n,e),t;break}case 19:{let t=Vr(n);if(t==r)return Wa(n,e),t;break}case 20:break;case 21:{let t=Vi(n);if(t==r)return Yd(n,e),t;break}case 22:break;case 23:break;case 24:{let t=Hu(n);if(t==r)return Rh(n,e),t;let i=ju(n);if(i==r)return Ch(n,e),i;break}case 25:{let t=Qu(n);if(t==r)return Nh(n,e),t;let i=Xu(n);if(i==r)return Bh(n,e),i;let s=$u(n);if(s==r)return Lh(n,e),s;break}case 26:{let t=Zu(n);if(t==r)return zh(n,e),t;let i=Yu(n);if(i==r)return Dh(n,e),i;let s=Ju(n);if(s==r)return Gh(n,e),s;break}case 27:{let t=ec(n);if(t==r)return Vh(n,e),t;let i=tc(n);if(i==r)return Oh(n,e),i;break}case 28:break;case 30:{let t=rc(n);if(t==r)return Kh(n,e),t;break}case 31:{let t=nc(n);if(t==r)return jh(n,e),t;let i=ic(n);if(i==r)return Qh(n,e),i;break}case 32:{let t=sc(n);if(t==r)return $h(n,e),t;let i=ac(n);if(i==r)return Zh(n,e),i;break}case 33:{let t=lc(n);if(t==r)return Jh(n,e),t;let i=oc(n);if(i==r)return em(n,e),i;let s=uc(n);if(s==r)return tm(n,e),s;break}case 34:{let t=cc(n);if(t==r)return nm(n,e),t;let i=pc(n);if(i==r)return im(n,e),i;break}case 35:{let t=fc(n);if(t==r)return am(n,e),t;break}case 36:{let t=_c(n);if(t==r)return om(n,e),t;if(dc(n)==r)return um(n,e),t;break}case 37:{let t=hc(n);if(t==r)return cm(n,e),t;let i=mc(n);if(i==r)return pm(n,e),i;let s=yc(n);if(s==r)return fm(n,e),s;break}case 38:break;case 39:{let t=gc(n);if(t==r)return dm(n,e),t;let i=bc(n);if(i==r)return hm(n,e),i;let s=xc(n);if(s==r)return mm(n,e),s;break}case 40:{let t=Ec(n);if(t==r)return gm(n,e),t;let i=Ac(n);if(i==r)return bm(n,e),i;let s=Tc(n);if(s==r)return xm(n,e),s;break}case 41:break;case 42:break;case 43:{let t=Sc(n);if(t==r)return Tm(n,e),t;break}case 44:break;case 45:{let t=kc(n);if(t==r)return Fm(n,e),t;let i=Fc(n);if(i==r)return wm(n,e),i;break}case 54:{let t=wc(n);if(t==r)return Lm(n,e),t;let i=Rc(n);for(let s=0;s<i;++s){let a=Cc(n,s);if(a==r)return Mm(n,s,e),a}break}case 56:{let t=Pc(n);for(let i=0;i<t;++i){let s=Nc(n,i);if(s==r)return Gm(n,i,e),s}break}case 57:break;case 59:{let t=Bc(n);for(let i=0;i<t;++i){let s=Lc(n,i);if(s==r)return Om(n,i,e),s}break}case 60:{let t=Mc(n);if(t==r)return Wm(n,e),t;break}case 61:{let t=zc(n);if(t==r)return jm(n,e),t;break}case 62:{let t=Dc(n);if(t==r)return Xm(n,e),t;break}case 63:{let t=Gc(n);for(let s=0;s<t;++s){let a=Uc(n,s);if(a==r)return $m(n,s,e),a}let i=Vc(n);if(i==r)return Zm(n,e),i;break}case 64:{let t=Oc(n);if(t==r)return Ym(n,e),t;break}case 65:{let t=qc(n);if(t==r)return Jm(n,e),t;break}case 67:{let t=Wc(n);if(t==r)return ty(n,e),t;break}case 68:{let t=Kc(n);for(let i=0;i<t;++i){let s=Hc(n,i);if(s==r)return ry(n,i,e),s}break}case 69:{let t=jc(n);if(t==r)return iy(n,e),t;break}case 70:{let t=Qc(n);if(t==r)return ay(n,e),t;let i=Xc(n);if(i==r)return ly(n,e),i;break}case 73:{let t=Zc(n);if(t==r)return uy(n,e),t;let i=$c(n);if(i==r)return oy(n,e),i;break}case 76:{let t=Yc(n);for(let i=0;i<t;++i){let s=Jc(n,i);if(s==r)return cy(n,i,e),s}break}case 77:{let t=ep(n);if(t==r)return py(n,e),t;let i=tp(n);if(i==r)return fy(n,e),i;break}case 78:{let t=rp(n);if(t==r)return _y(n,e),t;let i=np(n);if(i==r)return dy(n,e),i;let s=ip(n);if(s==r)return hy(n,e),s;break}case 81:{let t=sp(n);if(t==r)return my(n,e),t;break}case 82:{let t=ap(n);if(t==r)return yy(n,e),t;let i=lp(n);if(i==r)return gy(n,e),i;let s=op(n);if(s==r)return by(n,e),s;let a=up(n);if(a==r)return xy(n,e),a;let l=cp(n);if(l==r)return Ey(n,e),l;break}case 88:{let t=Ic(n);if(t==r)return Sm(n,e),t;break}case 89:{let t=pp(n);if(t==r)return Ay(n,e),t;let i=fp(n);if(i==r)return Ty(n,e),i;let s=_p(n);if(s==r)return Sy(n,e),s;break}case 90:break;case 91:{let t=dp(n);if(t==r)return vy(n,e),t;break}case 92:{let t=hp(n);if(t==r)return Iy(n,e),t;let i=mp(n);if(i==r)return ky(n,e),i;let s=yp(n);if(s==r)return Fy(n,e),s;break}case 93:{let t=gp(n);if(t==r)return wy(n,e),t;let i=bp(n);if(i==r)return Ry(n,e),i;break}case 94:{let t=Ep(n);if(t==r)return Cy(n,e),t;let i=Ap(n);if(i==r)return Py(n,e),i;break}case 96:{let t=Tp(n);if(t==r)return Ny(n,e),t;let i=Sp(n);if(i==r)return By(n,e),i;break}case 97:{let t=vp(n);if(t==r)return Ly(n,e),t;let i=Ip(n);if(i==r)return My(n,e),i;let s=kp(n);if(s==r)return zy(n,e),s;break}default:throw new Error("unexpected expression id")}return 0}var ou=class extends xn{constructor(e){super(e.module);this.seenStores=!1;this.ptrType=e.options.sizeTypeRef}checkRT(){return this.module.readStringCached(Mn(this.currentFunction)).startsWith("~lib/rt/")}visitStore(e){let t=this.module,i=Ur(e),s=Oa(e),a=Va(e);qa(e,t.call("~onstore",[i,t.i32(s),t.i32(a),t.i32(i32(this.checkRT()))],this.ptrType)),this.seenStores=!0}walkModule(){super.walkModule(),this.seenStores&&this.module.addFunctionImport("~onstore","rtrace","onstore",it([this.ptrType,P.I32,P.I32,P.I32]),this.ptrType)}};function Ix(n,r){let e=!1;for(;Kt(r)==6&&n.readStringCached(Cn(r))==g.tostack;)assert(hr(r)==1),r=mr(r,0),e=!0;return e?r:0}function kx(n){return Kt(n)===14?!st(n):!0}var uu=class extends xn{constructor(e){super(e.module);this.slotMaps=new Map;this.tempMaps=new Map;this.exportMap=new Map;this.hasStackCheckFunction=!1;this.callSlotOffset=0;this.callSlotStack=new Array;this.compiler=e}get options(){return this.compiler.options}get ptrType(){return this.options.sizeTypeRef}get ptrSize(){return this.ptrType==P.I64?8:4}get ptrBinaryAdd(){return this.ptrType==P.I64?25:0}get ptrBinarySub(){return this.ptrType==P.I64?26:1}ptrConst(e){return this.ptrType==P.I64?this.module.i64(e):this.module.i32(e)}noteSlot(e,t){let i;if(this.slotMaps.has(e)){if(i=changetype(this.slotMaps.get(e)),i.has(t))return changetype(i.get(t))}else i=new Map,this.slotMaps.set(e,i);let s=i.size;return i.set(t,s),s}noteExport(e,t){t.length&&this.exportMap.set(e,t)}getSharedTemp(e,t){let i;if(this.tempMaps.has(e)){if(i=changetype(this.tempMaps.get(e)),i.has(t))return changetype(i.get(t))}else i=new Map,this.tempMaps.set(e,i);let a=Fp(e)+i.size;return i.set(t,a),a}makeStackOffset(e){assert(e!=0);let t=this.module,i=t.global_set(g.stack_pointer,t.binary(e>=0?this.ptrBinaryAdd:this.ptrBinarySub,t.global_get(g.stack_pointer,this.ptrType),this.ptrConst(abs(e))));return e>0?i:t.block(null,[i,this.makeStackCheck()],P.None)}makeStackFill(e,t){assert(e>0);let i=this.module;if(this.options.hasFeature(8)&&e>16)t.push(i.memory_fill(i.global_get(g.stack_pointer,this.ptrType),i.i32(0),this.ptrConst(e)));else{let s=e;for(;s>=8;)t.push(i.store(8,i.global_get(g.stack_pointer,this.ptrType),i.i64(0),P.I64,e-s)),s-=8;s&&(assert(s==4),t.push(i.store(4,i.global_get(g.stack_pointer,this.ptrType),i.i32(0),P.I32,e-s)))}}makeStackCheck(){let e=this.module;return this.hasStackCheckFunction||(this.hasStackCheckFunction=!0,e.addFunction("~stack_check",P.None,P.None,null,e.if(e.binary(17,e.global_get(g.stack_pointer,this.ptrType),e.global_get(g.data_end,this.ptrType)),this.compiler.makeStaticAbort(this.compiler.ensureStaticString("stack overflow"),Te.native)))),e.call("~stack_check",null,P.None)}updateCallOperands(e){let t=this.module,i=0;for(let s=0,a=e.length;s<a;++s){let l=e[s],o=Ix(t,l);if(!o)continue;if(!kx(o)){e[s]=o;continue}let u=this.currentFunction,c=Fp(u),f=this.noteSlot(u,c+this.callSlotOffset+i),_=this.getSharedTemp(u,this.ptrType),d=new Array;d.push(t.local_set(_,o,!1)),d.push(t.store(this.ptrSize,t.global_get(g.stack_pointer,this.ptrType),t.local_get(_,this.ptrType),this.ptrType,f*this.ptrSize)),d.push(t.local_get(_,this.ptrType)),e[s]=t.block(null,d,this.ptrType),++i}return i}visitCallPre(e){let t=hr(e),i=new Array(t);for(let a=0;a<t;++a)i[a]=mr(e,a);let s=this.updateCallOperands(i);for(let a=0,l=i.length;a<l;++a)La(e,a,i[a]);s&&(this.callSlotOffset+=s),this.callSlotStack.push(s)}visitCall(e){let t=this.callSlotStack.pop();t&&(this.callSlotOffset-=t)}visitCallIndirectPre(e){let t=Gi(e),i=new Array(t);for(let a=0;a<t;++a)i[a]=Ui(e,a);let s=this.updateCallOperands(i);for(let a=0,l=i.length;a<l;++a)Ma(e,a,i[a]);s&&(this.callSlotOffset+=s),this.callSlotStack.push(s)}visitCallIndirect(e){let t=this.callSlotStack.pop();t&&(this.callSlotOffset-=t)}visitLocalSet(e){let t=this.module,i=Gr(e),s=Ix(t,i);if(!s)return;if(!kx(s)){Ga(e,s);return}let a=Pn(e),l=this.noteSlot(this.currentFunction,a),o=new Array;o.push(t.store(this.ptrSize,t.global_get(g.stack_pointer,this.ptrType),t.local_tee(a,s,!1),this.ptrType,l*this.ptrSize)),Da(e)?(o.push(t.local_get(a,this.ptrType)),this.replaceCurrent(t.flatten(o,this.ptrType))):this.replaceCurrent(t.flatten(o,P.None))}updateFunction(e){let t=Mn(e),i=Yi(e),s=Ji(e),a=assert(yr(e)),l=Ka(e),o=new Array;for(let d=0;d<l;++d)o[d]=Ha(e,d);let u=this.tempMaps;if(u.has(e)){let d=changetype(u.get(e));for(let m=Map_keys(d),h=0,b=m.length;h<b;++h)o.push(m[h])}let c=this.module.ref;Zi(c,t);let f=Ee(o),_=Bn(c,t,i,s,f,o.length,a);if(this.options.sourceMap||this.options.debugInfo){let d=this.compiler.program.searchFunctionByRef(_);d&&d.addDebugInfo(this.module,_)}ie(f)}updateExport(e,t){let i=this.module,s=i.ref;assert(Yy(e)==0);let a=eg(e),l=i.readStringCached(a),o=Jy(e),u=Ln(s,a),c=Yi(u),f=ff(c),_=f.length,d=Ji(u),m=_,h=new Array,b=assert(t.length),A=b*this.ptrSize,S="export:"+l,k=i.allocStringCached(S);if(Ln(s,k)==0){let w=new Array;w.push(this.makeStackOffset(-A));for(let M=0;M<b;++M)w.push(i.store(this.ptrSize,i.global_get(g.stack_pointer,this.ptrType),i.local_get(t[M],this.ptrType),this.ptrType,M*this.ptrSize));let R=new Array(_);for(let M=0;M<_;++M)R[M]=i.local_get(M,f[M]);if(d!=P.None){let M=m++;h.push(d),w.push(i.local_set(M,i.call(l,R,d),!1)),w.push(this.makeStackOffset(+A)),w.push(i.local_get(M,d))}else w.push(i.call(l,R,d)),w.push(this.makeStackOffset(+A));let C=Ee(h);Bn(s,k,c,d,C,h.length,i.block(null,w,d)),ie(C)}$a(s,o),Qa(s,k,o)}walkModule(){super.walkModule();let e=this.module,t=new y_(this);for(let s=Map_keys(this.slotMaps),a=0,l=s.length;a<l;++a){let o=s[a],c=changetype(this.slotMaps.get(o)).size*this.ptrSize;t.frameSize=c,t.walkFunction(o);let f=new Array;f.push(this.makeStackOffset(-c)),this.makeStackFill(c,f);let _=yr(o),d=dr(_);if(d==P.Unreachable)f.push(_);else if(d==P.None)f.push(_),f.push(this.makeStackOffset(+c));else{let m=this.getSharedTemp(o,d);f.push(e.local_set(m,_,!1)),f.push(this.makeStackOffset(+c)),f.push(e.local_get(m,d))}ja(o,e.flatten(f,d))}for(let s=Map_keys(this.tempMaps),a=0,l=s.length;a<l;++a)this.updateFunction(s[a]);let i=this.exportMap;for(let s=Map_keys(i),a=0,l=s.length;a<l;++a){let o=s[a],u=Xa(e.ref,e.allocStringCached(o)),c=changetype(i.get(o));this.updateExport(u,c)}}},y_=class extends xn{constructor(e){super(e.module);this.frameSize=0;this.parentPass=e}visitReturn(e){assert(this.frameSize);let t=this.module,i=Vr(e),s=new Array;if(i){let a=dr(i);if(a==P.Unreachable)return;let l=this.parentPass.getSharedTemp(this.currentFunction,a);s.push(t.local_set(l,i,!1)),s.push(this.parentPass.makeStackOffset(+this.frameSize)),Wa(e,t.local_get(l,a))}else s.push(this.parentPass.makeStackOffset(+this.frameSize));s.push(e),this.replaceCurrent(t.flatten(s,P.Unreachable))}};var pi=class{constructor(r,e=!1){this.seen=new Map;this.program=r,this.includePrivate=e}walk(){for(let r=Map_values(this.program.filesByName),e=0,t=r.length;e<t;++e){let i=unchecked(r[e]);i.source.sourceKind==1&&this.visitFile(i)}}visitFile(r){let e=r.exports;if(e)for(let i=Map_keys(e),s=0,a=i.length;s<a;++s){let l=unchecked(i[s]),o=assert(e.get(l));this.visitElement(l,o)}let t=r.exportsStar;if(t)for(let i=0,s=t.length;i<s;++i){let a=unchecked(t[i]);this.visitFile(a)}}visitElement(r,e){if(e.is(512)&&!this.includePrivate)return;let t=this.seen;if(!e.is(262144)&&t.has(e)){this.visitAlias(r,e,assert(t.get(e)));return}switch(t.set(e,r),e.kind){case 0:{e.is(8388608)&&this.visitGlobal(r,e);break}case 2:{e.is(8388608)&&this.visitEnum(r,e);break}case 3:break;case 4:{this.visitFunctionInstances(r,e);break}case 6:{this.visitClassInstances(r,e);break}case 8:{this.visitInterfaceInstances(r,e);break}case 10:{let i=e.instance;if(!i)break;e=i}case 11:{let i=e,s=i.getterInstance;s&&this.visitFunction(r,s);let a=i.setterInstance;a&&this.visitFunction(r,a);break}case 12:{Fx(e)&&this.visitNamespace(r,e);break}case 14:case 15:break;default:assert(!1)}}visitFunctionInstances(r,e){let t=e.instances;if(t)for(let i=Map_values(t),s=0,a=i.length;s<a;++s){let l=unchecked(i[s]);l.is(8388608)&&this.visitFunction(r,l)}}visitClassInstances(r,e){let t=e.instances;if(t)for(let i=Map_values(t),s=0,a=i.length;s<a;++s){let l=unchecked(i[s]);assert(l.kind==7),l.is(8388608)&&this.visitClass(r,l)}}visitInterfaceInstances(r,e){let t=e.instances;if(t)for(let i=Map_values(t),s=0,a=i.length;s<a;++s){let l=unchecked(i[s]);assert(l.kind==9),l.is(8388608)&&this.visitInterface(r,l)}}};function Fx(n){let r=n.members;if(r)for(let e=Map_values(r),t=0,i=e.length;t<i;++t){let s=unchecked(e[t]);switch(s.kind){case 4:{let a=s.instances;if(a){for(let l=Map_values(a),o=0,u=l.length;o<u;++o)if(unchecked(l[o]).is(8388608))return!0}break}case 6:{let a=s.instances;if(a){for(let l=Map_values(a),o=0,u=l.length;o<u;++o)if(unchecked(l[o]).is(8388608))return!0}break}default:{if(s.is(8388608)||Fx(s))return!0;break}}}return!1}function pk(n){return n=="rtrace"?"#rtrace":n}function fk(n){return n!="rtrace"}var _i=class n extends pi{constructor(e,t,i=!1){super(e,i);this.sb=[];this.indentLevel=0;this.needsLiftBuffer=!1;this.needsLowerBuffer=!1;this.needsLiftString=!1;this.needsLowerString=!1;this.needsLiftArray=!1;this.needsLowerArray=!1;this.needsLiftTypedArray=!1;this.needsLowerTypedArray=!1;this.needsLiftStaticArray=!1;this.needsLowerStaticArray=!1;this.needsLiftInternref=!1;this.needsLowerInternref=!1;this.needsRetain=!1;this.needsRelease=!1;this.needsNotNull=!1;this.needsSetU8=!1;this.needsSetU16=!1;this.needsSetU32=!1;this.needsSetU64=!1;this.needsSetF32=!1;this.needsSetF64=!1;this.needsGetI8=!1;this.needsGetU8=!1;this.needsGetI16=!1;this.needsGetU16=!1;this.needsGetI32=!1;this.needsGetU32=!1;this.needsGetI64=!1;this.needsGetU64=!1;this.needsGetF32=!1;this.needsGetF64=!1;this.deferredLifts=new Set;this.deferredLowers=new Set;this.deferredCode=new Array;this.exports=new Array;this.importMappings=new Map;this.esm=t}static build(e,t=!0){return new n(e,t).build()}visitGlobal(e,t){let i=this.sb,s=t.type;this.exports.push(e),En(s,1)||(W(i,this.indentLevel),i.push(e),i.push(`: {
16
+ `),c.push(u),c.push(" \u2514\u2500 in "),c.push(e.normalizedPath),c.join("")}var tt=class{constructor(r=null){this.seen=new Map;r||(r=[]),this.diagnostics=r}emitDiagnostic(r,e,t,i,s=null,a=null,l=null){let o=ml.create(r,e,s,a,l);if(t&&(o=o.withRange(t)),i&&(o.relatedRange=i),t){let u=this.seen;if(u.has(t.source)){let c=assert(u.get(t.source));if(c.has(t.start)){let f=assert(c.get(t.start));for(let _=0,d=f.length;_<d;++_)if(f[_].equals(o))return;f.push(o)}else c.set(t.start,[o])}else{let c=new Map;c.set(t.start,[o]),u.set(t.source,c)}}this.diagnostics.push(o)}pedantic(r,e,t=null,i=null,s=null){this.emitDiagnostic(r,0,e,null,t,i,s)}pedanticRelated(r,e,t,i=null,s=null,a=null){this.emitDiagnostic(r,0,e,t,i,s,a)}info(r,e,t=null,i=null,s=null){this.emitDiagnostic(r,1,e,null,t,i,s)}infoRelated(r,e,t,i=null,s=null,a=null){this.emitDiagnostic(r,1,e,t,i,s,a)}warning(r,e,t=null,i=null,s=null){this.emitDiagnostic(r,2,e,null,t,i,s)}warningRelated(r,e,t,i=null,s=null,a=null){this.emitDiagnostic(r,2,e,t,i,s,a)}error(r,e,t=null,i=null,s=null){this.emitDiagnostic(r,3,e,null,t,i,s)}errorRelated(r,e,t,i=null,s=null,a=null){this.emitDiagnostic(r,3,e,t,i,s,a)}};var bt=(T=>(T[T.Abstract=0]="Abstract",T[T.As=1]="As",T[T.Async=2]="Async",T[T.Await=3]="Await",T[T.Break=4]="Break",T[T.Case=5]="Case",T[T.Catch=6]="Catch",T[T.Class=7]="Class",T[T.Const=8]="Const",T[T.Continue=9]="Continue",T[T.Constructor=10]="Constructor",T[T.Debugger=11]="Debugger",T[T.Declare=12]="Declare",T[T.Default=13]="Default",T[T.Delete=14]="Delete",T[T.Do=15]="Do",T[T.Else=16]="Else",T[T.Enum=17]="Enum",T[T.Export=18]="Export",T[T.Extends=19]="Extends",T[T.False=20]="False",T[T.Finally=21]="Finally",T[T.For=22]="For",T[T.From=23]="From",T[T.Function=24]="Function",T[T.Get=25]="Get",T[T.If=26]="If",T[T.Implements=27]="Implements",T[T.Import=28]="Import",T[T.In=29]="In",T[T.InstanceOf=30]="InstanceOf",T[T.Interface=31]="Interface",T[T.Is=32]="Is",T[T.KeyOf=33]="KeyOf",T[T.Let=34]="Let",T[T.Module=35]="Module",T[T.Namespace=36]="Namespace",T[T.New=37]="New",T[T.Null=38]="Null",T[T.Of=39]="Of",T[T.Override=40]="Override",T[T.Package=41]="Package",T[T.Private=42]="Private",T[T.Protected=43]="Protected",T[T.Public=44]="Public",T[T.Readonly=45]="Readonly",T[T.Return=46]="Return",T[T.Set=47]="Set",T[T.Static=48]="Static",T[T.Struct=49]="Struct",T[T.Super=50]="Super",T[T.Switch=51]="Switch",T[T.This=52]="This",T[T.Throw=53]="Throw",T[T.True=54]="True",T[T.Try=55]="Try",T[T.Type=56]="Type",T[T.TypeOf=57]="TypeOf",T[T.Var=58]="Var",T[T.Void=59]="Void",T[T.While=60]="While",T[T.With=61]="With",T[T.Yield=62]="Yield",T[T.OpenBrace=63]="OpenBrace",T[T.CloseBrace=64]="CloseBrace",T[T.OpenParen=65]="OpenParen",T[T.CloseParen=66]="CloseParen",T[T.OpenBracket=67]="OpenBracket",T[T.CloseBracket=68]="CloseBracket",T[T.Dot=69]="Dot",T[T.Dot_Dot_Dot=70]="Dot_Dot_Dot",T[T.Semicolon=71]="Semicolon",T[T.Comma=72]="Comma",T[T.LessThan=73]="LessThan",T[T.GreaterThan=74]="GreaterThan",T[T.LessThan_Equals=75]="LessThan_Equals",T[T.GreaterThan_Equals=76]="GreaterThan_Equals",T[T.Equals_Equals=77]="Equals_Equals",T[T.Exclamation_Equals=78]="Exclamation_Equals",T[T.Equals_Equals_Equals=79]="Equals_Equals_Equals",T[T.Exclamation_Equals_Equals=80]="Exclamation_Equals_Equals",T[T.Equals_GreaterThan=81]="Equals_GreaterThan",T[T.Plus=82]="Plus",T[T.Minus=83]="Minus",T[T.Asterisk_Asterisk=84]="Asterisk_Asterisk",T[T.Asterisk=85]="Asterisk",T[T.Slash=86]="Slash",T[T.Percent=87]="Percent",T[T.Plus_Plus=88]="Plus_Plus",T[T.Minus_Minus=89]="Minus_Minus",T[T.LessThan_LessThan=90]="LessThan_LessThan",T[T.GreaterThan_GreaterThan=91]="GreaterThan_GreaterThan",T[T.GreaterThan_GreaterThan_GreaterThan=92]="GreaterThan_GreaterThan_GreaterThan",T[T.Ampersand=93]="Ampersand",T[T.Bar=94]="Bar",T[T.Caret=95]="Caret",T[T.Exclamation=96]="Exclamation",T[T.Tilde=97]="Tilde",T[T.Ampersand_Ampersand=98]="Ampersand_Ampersand",T[T.Bar_Bar=99]="Bar_Bar",T[T.Question=100]="Question",T[T.Colon=101]="Colon",T[T.Equals=102]="Equals",T[T.Plus_Equals=103]="Plus_Equals",T[T.Minus_Equals=104]="Minus_Equals",T[T.Asterisk_Equals=105]="Asterisk_Equals",T[T.Asterisk_Asterisk_Equals=106]="Asterisk_Asterisk_Equals",T[T.Slash_Equals=107]="Slash_Equals",T[T.Percent_Equals=108]="Percent_Equals",T[T.LessThan_LessThan_Equals=109]="LessThan_LessThan_Equals",T[T.GreaterThan_GreaterThan_Equals=110]="GreaterThan_GreaterThan_Equals",T[T.GreaterThan_GreaterThan_GreaterThan_Equals=111]="GreaterThan_GreaterThan_GreaterThan_Equals",T[T.Ampersand_Equals=112]="Ampersand_Equals",T[T.Bar_Equals=113]="Bar_Equals",T[T.Caret_Equals=114]="Caret_Equals",T[T.At=115]="At",T[T.Identifier=116]="Identifier",T[T.StringLiteral=117]="StringLiteral",T[T.IntegerLiteral=118]="IntegerLiteral",T[T.FloatLiteral=119]="FloatLiteral",T[T.TemplateLiteral=120]="TemplateLiteral",T[T.Invalid=121]="Invalid",T[T.EndOfFile=122]="EndOfFile",T))(bt||{}),Yp=(t=>(t[t.Default=0]="Default",t[t.Prefer=1]="Prefer",t[t.Always=2]="Always",t))(Yp||{});function Ub(n){let r=n.length;switch(assert(r),n.charCodeAt(0)){case 97:{if(r==5){if(n=="async")return 2;if(n=="await")return 3;break}if(n=="as")return 1;if(n=="abstract")return 0;break}case 98:{if(n=="break")return 4;break}case 99:{if(r==5){if(n=="const")return 8;if(n=="class")return 7;if(n=="catch")return 6;break}if(n=="case")return 5;if(n=="continue")return 9;if(n=="constructor")return 10;break}case 100:{if(r==7){if(n=="default")return 13;if(n=="declare")return 12;break}if(n=="do")return 15;if(n=="delete")return 14;if(n=="debugger")return 11;break}case 101:{if(r==4){if(n=="else")return 16;if(n=="enum")return 17;break}if(n=="export")return 18;if(n=="extends")return 19;break}case 102:{if(r<=5){if(n=="false")return 20;if(n=="for")return 22;if(n=="from")return 23;break}if(n=="function")return 24;if(n=="finally")return 21;break}case 103:{if(n=="get")return 25;break}case 105:{if(r==2){if(n=="if")return 26;if(n=="in")return 29;if(n=="is")return 32;break}switch(n.charCodeAt(3)){case 108:{if(n=="implements")return 27;break}case 111:{if(n=="import")return 28;break}case 116:{if(n=="instanceof")return 30;break}case 101:{if(n=="interface")return 31;break}}break}case 107:{if(n=="keyof")return 33;break}case 108:{if(n=="let")return 34;break}case 109:{if(n=="module")return 35;break}case 110:{if(n=="new")return 37;if(n=="null")return 38;if(n=="namespace")return 36;break}case 111:{if(n=="of")return 39;if(n=="override")return 40;break}case 112:{if(r==7){if(n=="private")return 42;if(n=="package")return 41;break}if(n=="public")return 44;if(n=="protected")return 43;break}case 114:{if(n=="return")return 46;if(n=="readonly")return 45;break}case 115:{if(r==6){if(n=="switch")return 51;if(n=="static")return 48;if(n=="struct")return 49;break}if(n=="set")return 47;if(n=="super")return 50;break}case 116:{if(r==4){if(n=="true")return 54;if(n=="this")return 52;if(n=="type")return 56;break}if(n=="try")return 55;if(n=="throw")return 53;if(n=="typeof")return 57;break}case 118:{if(n=="var")return 58;if(n=="void")return 59;break}case 119:{if(n=="while")return 60;if(n=="with")return 61;break}case 121:{if(n=="yield")return 62;break}}return 121}function Vb(n){switch(n){case 0:case 1:case 10:case 12:case 14:case 23:case 22:case 25:case 30:case 32:case 33:case 35:case 36:case 38:case 45:case 47:case 56:case 59:return!0;default:return!1}}function Jp(n){switch(assert(n.length),n.charCodeAt(0)){case 100:return n=="delete";case 102:return n=="for";case 105:return n=="instanceof";case 110:return n=="null";case 118:return n=="void"}return!1}function Be(n){switch(n){case 14:return"delete";case 29:return"in";case 30:return"instanceof";case 37:return"new";case 57:return"typeof";case 59:return"void";case 62:return"yield";case 70:return"...";case 72:return",";case 73:return"<";case 74:return">";case 75:return"<=";case 76:return">=";case 77:return"==";case 78:return"!=";case 79:return"===";case 80:return"!==";case 82:return"+";case 83:return"-";case 84:return"**";case 85:return"*";case 86:return"/";case 87:return"%";case 88:return"++";case 89:return"--";case 90:return"<<";case 91:return">>";case 92:return">>>";case 93:return"&";case 94:return"|";case 95:return"^";case 96:return"!";case 97:return"~";case 98:return"&&";case 99:return"||";case 102:return"=";case 103:return"+=";case 104:return"-=";case 105:return"*=";case 106:return"**=";case 107:return"/=";case 108:return"%=";case 109:return"<<=";case 110:return">>=";case 111:return">>>=";case 112:return"&=";case 113:return"|=";case 114:return"^=";default:return assert(!1),""}}var os=class extends tt{constructor(e,t=null){super(t);this.end=0;this.pos=0;this.token=-1;this.tokenPos=0;this.nextToken=-1;this.nextTokenPos=0;this.nextTokenOnNewLine=2;this.onComment=null;this.readingTemplateString=!1;this.readStringStart=0;this.readStringEnd=0;t||(t=[]),this.diagnostics=t,this.source=e;let i=e.text,s=i.length,a=0;if(a<s&&i.charCodeAt(a)==65279&&++a,a+1<s&&i.charCodeAt(a)==35&&i.charCodeAt(a+1)==33)for(a+=2;a<s&&i.charCodeAt(a)!=10;)++a;this.pos=a,this.end=s}next(e=0){this.clearNextToken();let t;do t=this.unsafeNext(e);while(t==121);return this.token=t,t}unsafeNext(e=0,t=i32.MAX_VALUE){let i=this.source.text,s=this.end,a=this.pos;for(;a<s;){this.tokenPos=a;let l=i.charCodeAt(a);switch(l){case 13:if(!(++a<s&&i.charCodeAt(a)==10))break;case 10:case 9:case 11:case 12:case 32:{++a;break}case 33:return++a,t>1&&a<s&&i.charCodeAt(a)==61?(++a,t>2&&a<s&&i.charCodeAt(a)==61?(this.pos=a+1,80):(this.pos=a,78)):(this.pos=a,96);case 34:case 39:return this.pos=a,117;case 96:return this.pos=a,120;case 37:return++a,t>1&&a<s&&i.charCodeAt(a)==61?(this.pos=a+1,108):(this.pos=a,87);case 38:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(o==38)return this.pos=a+1,98;if(o==61)return this.pos=a+1,112}return this.pos=a,93}case 40:return this.pos=a+1,65;case 41:return this.pos=a+1,66;case 42:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(o==61)return this.pos=a+1,105;if(o==42)return++a,t>2&&a<s&&i.charCodeAt(a)==61?(this.pos=a+1,106):(this.pos=a,84)}return this.pos=a,85}case 43:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(o==43)return this.pos=a+1,88;if(o==61)return this.pos=a+1,103}return this.pos=a,82}case 44:return this.pos=a+1,72;case 45:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(o==45)return this.pos=a+1,89;if(o==61)return this.pos=a+1,104}return this.pos=a,83}case 46:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(gt(o))return this.pos=a-1,119;if(t>2&&a+1<s&&o==46&&i.charCodeAt(a+1)==46)return this.pos=a+2,70}return this.pos=a,69}case 47:{let o=a;if(++a,t>1&&a<s){let u=i.charCodeAt(a);if(u==47){let c=0;for(a+1<s&&i.charCodeAt(a+1)==47&&(++a,c=1);++a<s;)if(i.charCodeAt(a)==10){++a;break}this.onComment&&this.onComment(c,i.substring(o,a),this.range(o,a));break}if(u==42){let c=!1;for(;++a<s;)if(l=i.charCodeAt(a),l==42&&a+1<s&&i.charCodeAt(a+1)==47){a+=2,c=!0;break}c?this.onComment&&this.onComment(2,i.substring(o,a),this.range(o,a)):this.error(1005,this.range(a),"*/");break}if(u==61)return this.pos=a+1,107}return this.pos=a,86}case 48:case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.pos=a,this.testInteger()?118:119;case 58:return this.pos=a+1,101;case 59:return this.pos=a+1,71;case 60:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(o==60)return++a,t>2&&a<s&&i.charCodeAt(a)==61?(this.pos=a+1,109):(this.pos=a,90);if(o==61)return this.pos=a+1,75}return this.pos=a,73}case 61:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(o==61)return++a,t>2&&a<s&&i.charCodeAt(a)==61?(this.pos=a+1,79):(this.pos=a,77);if(o==62)return this.pos=a+1,81}return this.pos=a,102}case 62:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(o==62){if(++a,t>2&&a<s){if(o=i.charCodeAt(a),o==62)return++a,t>3&&a<s&&i.charCodeAt(a)==61?(this.pos=a+1,111):(this.pos=a,92);if(o==61)return this.pos=a+1,110}return this.pos=a,91}if(o==61)return this.pos=a+1,76}return this.pos=a,74}case 63:return this.pos=a+1,100;case 91:return this.pos=a+1,67;case 93:return this.pos=a+1,68;case 94:return++a,t>1&&a<s&&i.charCodeAt(a)==61?(this.pos=a+1,114):(this.pos=a,95);case 123:return this.pos=a+1,63;case 124:{if(++a,t>1&&a<s){let o=i.charCodeAt(a);if(o==124)return this.pos=a+1,99;if(o==61)return this.pos=a+1,113}return this.pos=a,94}case 125:return this.pos=a+1,64;case 126:return this.pos=a+1,97;case 64:return this.pos=a+1,115;default:{if(Hn(l)&&a+1<s&&(l=is(l,i.charCodeAt(a+1))),jn(l)){let u=a;for(;(a+=jr(l))<s&&Qn(l=i.codePointAt(a)););if(e!=2){let c=Ub(i.substring(u,a));if(c!=121&&!(e==1&&Vb(c)))return this.pos=a,c}return this.pos=u,116}else if(rs(l)){++a;break}let o=a;return a+=jr(l),this.error(1127,this.range(o,a)),this.pos=a,121}}}return this.pos=a,122}peek(e=0,t=i32.MAX_VALUE){let i=this.nextToken;if(i<0){let s=this.pos,a=this.token,l=this.tokenPos;do i=this.unsafeNext(e,t);while(i==121);this.nextToken=i,this.nextTokenPos=this.tokenPos,this.nextTokenOnNewLine=2,this.pos=s,this.token=a,this.tokenPos=l}return i}peekOnNewLine(){switch(this.nextTokenOnNewLine){case 0:return!1;case 1:return!0}this.peek();let e=this.source.text;for(let t=this.pos,i=this.nextTokenPos;t<i;++t)if(Ht(e.charCodeAt(t)))return this.nextTokenOnNewLine=1,!0;return this.nextTokenOnNewLine=0,!1}skipIdentifier(e=1){return this.skip(116,e)}skip(e,t=0){let i=this.pos,s=this.token,a=this.tokenPos,l=i32.MAX_VALUE;e==74&&(l=1);let o;do o=this.unsafeNext(t,l);while(o==121);return o==e?(this.token=e,this.clearNextToken(),!0):(this.pos=i,this.token=s,this.tokenPos=a,!1)}mark(){let e=$p;return e?($p=null,e.pos=this.pos,e.token=this.token,e.tokenPos=this.tokenPos):e=new yl(this.pos,this.token,this.tokenPos),e}discard(e){$p=e}reset(e){this.pos=e.pos,this.token=e.token,this.tokenPos=e.tokenPos,this.clearNextToken()}clearNextToken(){this.nextToken=-1,this.nextTokenPos=0,this.nextTokenOnNewLine=2}range(e=-1,t=-1){e<0?(e=this.tokenPos,t=this.pos):t<0&&(t=e);let i=new ce(e,t);return i.source=this.source,i}readIdentifier(){let e=this.source.text,t=this.end,i=this.pos,s=i,a=e.codePointAt(i);for(assert(jn(a));(i+=jr(a))<t&&Qn(a=e.codePointAt(i)););return this.pos=i,e.substring(s,i)}readString(e=0,t=!1){let i=this.source.text,s=this.end,a=this.pos;e||(e=i.charCodeAt(a++));let l=a;this.readStringStart=l;let o="";for(;;){if(a>=s){o+=i.substring(l,a),this.error(1002,this.range(l-1,s)),this.readStringEnd=s;break}let u=i.charCodeAt(a);if(u==e){this.readStringEnd=a,o+=i.substring(l,a++);break}if(u==92){o+=i.substring(l,a),this.pos=a,o+=this.readEscapeSequence(t),a=this.pos,l=a;continue}if(e==96){if(u==36&&a+1<s&&i.charCodeAt(a+1)==123)return o+=i.substring(l,a),this.readStringEnd=a,this.pos=a+2,this.readingTemplateString=!0,o}else if(Ht(u)){o+=i.substring(l,a),this.error(1002,this.range(l-1,a)),this.readStringEnd=a;break}++a}return this.pos=a,this.readingTemplateString=!1,o}readEscapeSequence(e=!1){let t=this.pos,i=this.end;if(++this.pos>=i)return this.error(1126,this.range(i)),"";let s=this.source.text,a=s.charCodeAt(this.pos++);switch(a){case 48:return e&&this.pos<i&&gt(s.charCodeAt(this.pos))?(++this.pos,s.substring(t,this.pos)):"\0";case 98:return"\b";case 116:return" ";case 110:return`
17
+ `;case 118:return"\v";case 102:return"\f";case 114:return"\r";case 39:return"'";case 34:return'"';case 117:return this.pos<i&&s.charCodeAt(this.pos)==123?(++this.pos,this.readExtendedUnicodeEscape(e?t:-1)):this.readUnicodeEscape(e?t:-1);case 120:return this.readHexadecimalEscape(2,e?t:-1);case 13:this.pos<i&&s.charCodeAt(this.pos)==10&&++this.pos;case 10:case 8232:case 8233:return"";default:return String.fromCodePoint(a)}}readRegexpPattern(){let e=this.source.text,t=this.pos,i=this.end,s=!1;for(;;){if(this.pos>=i){this.error(1161,this.range(t,i));break}if(e.charCodeAt(this.pos)==92){++this.pos,s=!0;continue}let a=e.charCodeAt(this.pos);if(!s&&a==47)break;if(Ht(a)){this.error(1161,this.range(t,this.pos));break}++this.pos,s=!1}return e.substring(t,this.pos)}readRegexpFlags(){let e=this.source.text,t=this.pos,i=this.end,s=0;for(;this.pos<i;){let a=e.charCodeAt(this.pos);if(!Qn(a))break;switch(++this.pos,a){case 103:{s|=s&1?-1:1;break}case 105:{s|=s&2?-1:2;break}case 109:{s|=s&4?-1:4;break}default:{s=-1;break}}}return s==-1&&this.error(209,this.range(t,this.pos)),e.substring(t,this.pos)}testInteger(){let e=this.source.text,t=this.pos,i=this.end;if(t+1<i&&e.charCodeAt(t)==48)switch(e.charCodeAt(t+2)|32){case 120:case 98:case 111:return!0}for(;t<i;){let s=e.charCodeAt(t);if(s==46||(s|32)==101)return!1;if(s!=95&&(s<48||s>57))break;t++}return!0}readInteger(){let e=this.source.text,t=this.pos;if(t+2<this.end&&e.charCodeAt(t)==48){switch(e.charCodeAt(t+1)|32){case 120:return this.pos=t+2,this.readHexInteger();case 98:return this.pos=t+2,this.readBinaryInteger();case 111:return this.pos=t+2,this.readOctalInteger()}if(pl(e.charCodeAt(t+1))){let i=t;this.pos=t+1;let s=this.readOctalInteger();return this.error(1121,this.range(i,this.pos)),s}}return this.readDecimalInteger()}readHexInteger(){let e=this.source.text,t=this.pos,i=this.end,s=t,a=s,l=i64_zero,o=i64_new(4),u=l,c=!1;for(;t<i;){let f=e.charCodeAt(t);if(gt(f))u=i64_add(i64_shl(l,o),i64_new(f-48));else if(ss(f))u=i64_add(i64_shl(l,o),i64_new((f|32)+-87));else if(f==95)a==t&&this.error(a==s?6188:6189,this.range(t)),a=t+1;else break;i64_gt_u(l,u)&&(c=!0),l=u,++t}return t==s?this.error(1125,this.range(s)):a==t&&this.error(6188,this.range(a-1)),c&&this.error(236,this.range(s-2,t),this.source.text.substring(s-2,t)),this.pos=t,l}readDecimalInteger(){let e=this.source.text,t=this.pos,i=this.end,s=t,a=s,l=i64_zero,o=i64_new(10),u=l,c=!1;for(;t<i;){let f=e.charCodeAt(t);if(gt(f))u=i64_add(i64_mul(l,o),i64_new(f-48));else if(f==95)a==t?this.error(a==s?6188:6189,this.range(t)):t-1==s&&e.charCodeAt(t-1)==48&&this.error(6188,this.range(t)),a=t+1;else break;i64_gt_u(l,u)&&(c=!0),l=u,++t}return t==s?this.error(1124,this.range(s)):a==t?this.error(6188,this.range(a-1)):c&&this.error(236,this.range(s,t),this.source.text.substring(s,t)),this.pos=t,l}readOctalInteger(){let e=this.source.text,t=this.pos,i=this.end,s=t,a=s,l=i64_zero,o=i64_new(3),u=l,c=!1;for(;t<i;){let f=e.charCodeAt(t);if(pl(f))u=i64_add(i64_shl(l,o),i64_new(f-48));else if(f==95)a==t&&this.error(a==s?6188:6189,this.range(t)),a=t+1;else break;i64_gt_u(l,u)&&(c=!0),l=u,++t}return t==s?this.error(1178,this.range(s)):a==t?this.error(6188,this.range(a-1)):c&&this.error(236,this.range(s-2,t),this.source.text.substring(s-2,t)),this.pos=t,l}readBinaryInteger(){let e=this.source.text,t=this.pos,i=this.end,s=t,a=s,l=i64_zero,o=l,u=!1;for(;t<i;){let c=e.charCodeAt(t);if(c==48)o=i64_shl(l,i64_one);else if(c==49)o=i64_or(i64_shl(l,i64_one),i64_one);else if(c==95)a==t&&this.error(a==s?6188:6189,this.range(t)),a=t+1;else break;i64_gt(l,o)&&(u=!0),l=o,++t}return t==s?this.error(1177,this.range(s)):a==t?this.error(6188,this.range(a-1)):u&&this.error(236,this.range(s-2,t),this.source.text.substring(s-2,t)),this.pos=t,l}readFloat(){return this.readDecimalFloat()}readDecimalFloat(){let e=this.source.text,t=this.end,i=this.pos,s=this.readDecimalFloatPartial(!1);if(this.pos<t&&e.charCodeAt(this.pos)==46&&(++this.pos,s+=this.readDecimalFloatPartial()),this.pos<t){let l=e.charCodeAt(this.pos);(l|32)==101&&((++this.pos<t&&(l=e.charCodeAt(this.pos))==45||l==43&&gt(e.charCodeAt(this.pos+1)))&&++this.pos,s+=this.readDecimalFloatPartial())}let a=e.substring(i,this.pos);return s&&(a=a.replaceAll("_","")),parseFloat(a)}readDecimalFloatPartial(e=!0){let t=this.source.text,i=this.pos,s=i,a=this.end,l=s,o=0;for(;i<a;){let u=t.charCodeAt(i);if(u==95)l==i?this.error(l==s?6188:6189,this.range(i)):!e&&i-1==s&&t.charCodeAt(i-1)==48&&this.error(6188,this.range(i)),l=i+1,++o;else if(!gt(u))break;++i}return i!=s&&l==i&&this.error(6188,this.range(l-1)),this.pos=i,o}readHexFloat(){throw new Error("not implemented")}readHexadecimalEscape(e=2,t=-1){let i=0,s=this.source.text,a=this.pos,l=this.end;for(;a<l;){let o=s.charCodeAt(a++);if(gt(o))i=(i<<4)+o-48;else if(ss(o))i=(i<<4)+(o|32)+-87;else return~t?(this.pos=--a,s.substring(t,a)):(this.pos=a,this.error(1125,this.range(a-1,a)),"");if(--e==0)break}return e?(this.pos=a,~t?s.substring(t,a):(this.error(1126,this.range(a)),"")):(this.pos=a,String.fromCodePoint(i))}checkForIdentifierStartAfterNumericLiteral(){let e=this.pos;e<this.end&&jn(this.source.text.charCodeAt(e))&&this.error(1351,this.range(e))}readUnicodeEscape(e=-1){return this.readHexadecimalEscape(4,e)}readExtendedUnicodeEscape(e=-1){let t=this.pos,i=this.readHexInteger(),s=i64_low(i),a=!1;assert(!i64_high(i)),s>1114111&&(e==-1&&this.error(1198,this.range(t,this.pos)),a=!0);let l=this.end,o=this.source.text;return this.pos>=l?(e==-1&&this.error(1126,this.range(t,l)),a=!0):o.charCodeAt(this.pos)==125?++this.pos:(e==-1&&this.error(1199,this.range(t,this.pos)),a=!0),a?~e?o.substring(e,this.pos):"":String.fromCodePoint(s)}},yl=class{constructor(r,e,t){this.pos=r;this.token=e;this.tokenPos=t}},$p=null;var $e=(G=>(G[G.Source=0]="Source",G[G.NamedType=1]="NamedType",G[G.FunctionType=2]="FunctionType",G[G.TupleType=3]="TupleType",G[G.FixedArrayType=4]="FixedArrayType",G[G.TypeName=5]="TypeName",G[G.TypeParameter=6]="TypeParameter",G[G.Parameter=7]="Parameter",G[G.Identifier=8]="Identifier",G[G.Assertion=9]="Assertion",G[G.Binary=10]="Binary",G[G.Call=11]="Call",G[G.Class=12]="Class",G[G.Comma=13]="Comma",G[G.ElementAccess=14]="ElementAccess",G[G.False=15]="False",G[G.Function=16]="Function",G[G.InstanceOf=17]="InstanceOf",G[G.Literal=18]="Literal",G[G.New=19]="New",G[G.Null=20]="Null",G[G.Omitted=21]="Omitted",G[G.Parenthesized=22]="Parenthesized",G[G.PropertyAccess=23]="PropertyAccess",G[G.Ternary=24]="Ternary",G[G.Super=25]="Super",G[G.This=26]="This",G[G.True=27]="True",G[G.Constructor=28]="Constructor",G[G.UnaryPostfix=29]="UnaryPostfix",G[G.UnaryPrefix=30]="UnaryPrefix",G[G.Await=31]="Await",G[G.Lazy=32]="Lazy",G[G.Compiled=33]="Compiled",G[G.Block=34]="Block",G[G.Break=35]="Break",G[G.Continue=36]="Continue",G[G.Do=37]="Do",G[G.Empty=38]="Empty",G[G.Export=39]="Export",G[G.ExportDefault=40]="ExportDefault",G[G.ExportImport=41]="ExportImport",G[G.Expression=42]="Expression",G[G.For=43]="For",G[G.ForOf=44]="ForOf",G[G.If=45]="If",G[G.Import=46]="Import",G[G.Return=47]="Return",G[G.Switch=48]="Switch",G[G.Throw=49]="Throw",G[G.Try=50]="Try",G[G.Variable=51]="Variable",G[G.Void=52]="Void",G[G.While=53]="While",G[G.Module=54]="Module",G[G.ClassDeclaration=55]="ClassDeclaration",G[G.EnumDeclaration=56]="EnumDeclaration",G[G.EnumValueDeclaration=57]="EnumValueDeclaration",G[G.FieldDeclaration=58]="FieldDeclaration",G[G.FunctionDeclaration=59]="FunctionDeclaration",G[G.ImportDeclaration=60]="ImportDeclaration",G[G.InterfaceDeclaration=61]="InterfaceDeclaration",G[G.MethodDeclaration=62]="MethodDeclaration",G[G.NamespaceDeclaration=63]="NamespaceDeclaration",G[G.TypeDeclaration=64]="TypeDeclaration",G[G.VariableDeclaration=65]="VariableDeclaration",G[G.Decorator=66]="Decorator",G[G.ExportMember=67]="ExportMember",G[G.SwitchCase=68]="SwitchCase",G[G.IndexSignature=69]="IndexSignature",G[G.Comment=70]="Comment",G[G.UnmanagedArrayType=71]="UnmanagedArrayType",G[G.DynamicArrayType=72]="DynamicArrayType",G))($e||{}),y=class n{constructor(r,e){this.kind=r;this.range=e}static createSimpleTypeName(r,e){return new Zn(n.createIdentifierExpression(r,e),null,e)}static createNamedType(r,e,t,i){return new Zr(r,e,t,i)}static createFunctionType(r,e,t,i,s){return new $r(r,e,t,i,s)}static createTupleType(r,e,t,i){return new gl(r,e,t,i)}static createFixedArrayType(r,e,t){return new bl(r,e,t)}static createUnmanagedArrayType(r,e){return new xl(r,e)}static createDynamicArrayType(r,e,t,i){return new El(r,e,t,i)}static createOmittedType(r){return new Zr(n.createSimpleTypeName("",r),null,!1,r)}static createTypeParameter(r,e,t,i){return new Al(r,e,t,i)}static createParameter(r,e,t,i,s){return new $n(r,e,t,i,s)}static createDecorator(r,e,t){return new Tl(Ct.fromNode(r),r,e,t)}static createComment(r,e,t){return new Sl(r,e,t)}static createIdentifierExpression(r,e,t=!1){return new rt(r,t,e)}static createEmptyIdentifierExpression(r){return new rt("",!1,r)}static createArrayLiteralExpression(r,e){return new Yr(r,e)}static createAssertionExpression(r,e,t,i){return new vl(r,e,t,i)}static createBinaryExpression(r,e,t,i){return new Il(r,e,t,i)}static createCallExpression(r,e,t,i){return new kl(r,e,t,i)}static createClassExpression(r){return new Fl(r)}static createCommaExpression(r,e){return new wl(r,e)}static createConstructorExpression(r){return new Rl(r)}static createElementAccessExpression(r,e,t){return new Cl(r,e,t)}static createFalseExpression(r){return new Xl(r)}static createFloatLiteralExpression(r,e){return new Pl(r,e)}static createFunctionExpression(r){return new Nl(r)}static createInstanceOfExpression(r,e,t){return new Ll(r,e,t)}static createIntegerLiteralExpression(r,e){return new Bl(r,e)}static createNewExpression(r,e,t,i){return new Ml(r,e,t,i)}static createNullExpression(r){return new zl(r)}static createObjectLiteralExpression(r,e,t){return new Dl(r,e,t)}static createOmittedExpression(r){return new Gl(r)}static createParenthesizedExpression(r,e){return new Ul(r,e)}static createPropertyAccessExpression(r,e,t){return new Vl(r,e,t)}static createRegexpLiteralExpression(r,e,t){return new Ol(r,e,t)}static createTernaryExpression(r,e,t,i){return new ql(r,e,t,i)}static createStringLiteralExpression(r,e){return new Wl(r,e)}static createSuperExpression(r){return new Kl(r)}static createTemplateLiteralExpression(r,e,t,i,s){return new Hl(r,e,t,i,s)}static createThisExpression(r){return new jl(r)}static createTrueExpression(r){return new Ql(r)}static createUnaryPostfixExpression(r,e,t){return new Zl(r,e,t)}static createUnaryPrefixExpression(r,e,t){return new $l(r,e,t)}static createAwaitExpression(r,e){return new Yl(r,e)}static createLazyExpression(r,e){return new Jl(r,e)}static createCompiledExpression(r,e,t){return new eo(r,e,t)}static createBlockStatement(r,e){return new ro(r,e)}static createBreakStatement(r,e){return new no(r,e)}static createClassDeclaration(r,e,t,i,s,a,l,o){return new cs(r,e,t,i,s,a,l,o)}static createContinueStatement(r,e){return new io(r,e)}static createDoStatement(r,e,t){return new so(r,e,t)}static createEmptyStatement(r){return new ao(r)}static createEnumDeclaration(r,e,t,i,s,a){return new lo(r,e,t,i,s,a)}static createEnumValueDeclaration(r,e,t,i){return new oo(r,e,t,i)}static createExportStatement(r,e,t,i){return new po(r,e,t,i)}static createExportDefaultStatement(r,e){return new fo(r,e)}static createExportImportStatement(r,e,t){return new uo(r,e,t)}static createExportMember(r,e,t){return e||(e=r),new co(r,e,t)}static createExpressionStatement(r){return new _o(r)}static createIfStatement(r,e,t,i){return new go(r,e,t,i)}static createImportStatement(r,e,t){return new fs(r,null,e,t)}static createWildcardImportStatement(r,e,t){return new fs(null,r,e,t)}static createImportDeclaration(r,e,t){return e||(e=r),new bo(e,r,t)}static createInterfaceDeclaration(r,e,t,i,s,a,l,o){return new xo(r,e,t,i,s,a,l,o)}static createFieldDeclaration(r,e,t,i,s,a){return new ho(r,e,t,i,s,-1,a)}static createForStatement(r,e,t,i,s){return new mo(r,e,t,i,s)}static createForOfStatement(r,e,t,i){return new yo(r,e,t,i)}static createFunctionDeclaration(r,e,t,i,s,a,l,o,u=!1){return new ps(r,e,t,i,s,a,l,o,u)}static createIndexSignature(r,e,t,i){return new to(r,e,t,i)}static createMethodDeclaration(r,e,t,i,s,a,l,o=!1){return new Jr(r,e,t,i,s,a,l,o)}static createNamespaceDeclaration(r,e,t,i,s){return new Eo(r,e,t,i,s)}static createReturnStatement(r,e){return new Ao(r,e)}static createSwitchStatement(r,e,t){return new So(r,e,t)}static createSwitchCase(r,e,t){return new To(r,e,t)}static createThrowStatement(r,e){return new vo(r,e)}static createTryStatement(r,e,t,i,s){return new Io(r,e,t,i,s)}static createTypeDeclaration(r,e,t,i,s,a){return new Fo(r,e,t,i,s,a)}static createModuleDeclaration(r,e,t){return new ko(r,e,t)}static createVariableStatement(r,e,t){return new Ro(r,e,t)}static createVariableDeclaration(r,e,t,i,s,a){return new wo(r,e,t,i,s,a)}static createVoidStatement(r,e){return new Co(r,e)}static createWhileStatement(r,e,t){return new Po(r,e,t)}isLiteralKind(r){return this.kind==18&&changetype(this).literalKind==r}get isNumericLiteral(){if(this.kind==18)switch(changetype(this).literalKind){case 0:case 1:return!0}return!1}get compilesToConst(){switch(this.kind){case 18:{switch(changetype(this).literalKind){case 0:case 1:case 2:return!0}break}case 20:case 27:case 15:return!0}return!1}get evaluatesToConst(){switch(this.kind){case 9:return changetype(this).expression.evaluatesToConst;case 30:{let r=changetype(this),e=r.operator;if(e==82||e==83)return r.operand.evaluatesToConst;break}}return this.compilesToConst}isAccessOn(r){let e=changetype(this);return e.kind==11&&(e=e.expression),e.kind==23&&e.expression.kind==r}get isAccessOnThis(){return this.isAccessOn(26)}get isAccessOnSuper(){return this.isAccessOn(25)}get isEmpty(){return this.kind==38}},jt=class extends y{constructor(e,t,i){super(e,i);this.isNullable=t;this.currentlyResolving=!1;this.memoryModel=0;this.attributes=null}hasGenericComponent(e){if(this.kind==1){let t=changetype(this);if(!t.name.next){let i=t.typeArguments;if(i&&i.length>0){for(let s=0,a=i.length;s<a;++s)if(i[s].hasGenericComponent(e))return!0}else{let s=t.name.identifier.text;for(let a=0,l=e.length;a<l;++a)if(e[a].name.text==s)return!0}}}else if(this.kind==2){let t=changetype(this),i=t.parameters;for(let a=0,l=i.length;a<l;++a)if(i[a].type.hasGenericComponent(e))return!0;if(t.returnType.hasGenericComponent(e))return!0;let s=t.explicitThisType;if(s&&s.hasGenericComponent(e))return!0}else if(this.kind==3){let i=changetype(this).elements;for(let s=0,a=i.length;s<a;++s)if(i[s].hasGenericComponent(e))return!0}else assert(!1);return!1}},Zn=class extends y{constructor(e,t,i){super(5,i);this.identifier=e;this.next=t}},Zr=class extends jt{constructor(e,t,i,s){super(1,i,s);this.name=e;this.typeArguments=t}get hasTypeArguments(){let e=this.typeArguments;return e!=null&&e.length>0}get isNull(){return this.name.identifier.text=="null"}},$r=class extends jt{constructor(e,t,i,s,a){super(2,s,a);this.parameters=e;this.returnType=t;this.explicitThisType=i}},gl=class extends jt{constructor(e,t,i,s){super(3,i,s);this.elements=e;this.elementNames=t}},bl=class extends jt{constructor(e,t,i){super(4,!1,i);this.elementType=e;this.length=t}},xl=class extends jt{constructor(e,t){super(71,!1,t);this.elementType=e}},El=class extends jt{constructor(e,t,i,s){super(72,!1,s);this.elementType=e;this.lengthName=t;this.dynamicMemoryModel=i}},Al=class extends y{constructor(e,t,i,s){super(6,s);this.name=e;this.extendsType=t;this.defaultType=i}},Qt=(t=>(t[t.Default=0]="Default",t[t.Optional=1]="Optional",t[t.Rest=2]="Rest",t))(Qt||{}),$n=class extends y{constructor(e,t,i,s,a){super(7,a);this.parameterKind=e;this.name=t;this.type=i;this.initializer=s;this.implicitFieldDeclaration=null;this.flags=0}is(e){return(this.flags&e)==e}isAny(e){return(this.flags&e)!=0}set(e){this.flags|=e}},_s=(i=>(i[i.Any=0]="Any",i[i.Inline=1]="Inline",i[i.Managed=2]="Managed",i[i.Unmanaged=3]="Unmanaged",i))(_s||{}),Ct=(h=>(h[h.Custom=0]="Custom",h[h.Global=1]="Global",h[h.Operator=2]="Operator",h[h.OperatorBinary=3]="OperatorBinary",h[h.OperatorPrefix=4]="OperatorPrefix",h[h.OperatorPostfix=5]="OperatorPostfix",h[h.Unmanaged=6]="Unmanaged",h[h.Managed=7]="Managed",h[h.Final=8]="Final",h[h.Inline=9]="Inline",h[h.External=10]="External",h[h.ExternalJs=11]="ExternalJs",h[h.Builtin=12]="Builtin",h[h.Lazy=13]="Lazy",h[h.Unsafe=14]="Unsafe",h))(Ct||{});(r=>{function n(e){if(e.kind==8){let t=e.text;switch(assert(t.length),t.charCodeAt(0)){case 98:{if(t=="builtin")return 12;break}case 101:{if(t=="external")return 10;break}case 102:{if(t=="final")return 8;break}case 103:{if(t=="global")return 1;break}case 105:{if(t=="inline")return 9;break}case 108:{if(t=="lazy")return 13;break}case 109:{if(t=="managed")return 7;break}case 111:{if(t=="operator")return 2;break}case 117:{if(t=="unmanaged")return 6;if(t=="unsafe")return 14;break}}}else if(e.kind==23){let t=e,i=t.expression;if(i.kind==8){let s=i.text;assert(s.length);let a=t.property.text;if(assert(a.length),s=="operator")switch(a.charCodeAt(0)){case 98:{if(a=="binary")return 3;break}case 112:{if(a=="prefix")return 4;if(a=="postfix")return 5;break}}else if(s=="external")switch(a.charCodeAt(0)){case 106:{if(a=="js")return 11;break}}}}return 0}r.fromNode=n})(Ct||={});var Tl=class extends y{constructor(e,t,i,s){super(66,s);this.decoratorKind=e;this.name=t;this.args=i}},ef=(t=>(t[t.Line=0]="Line",t[t.Triple=1]="Triple",t[t.Block=2]="Block",t))(ef||{}),Sl=class extends y{constructor(e,t,i){super(70,i);this.commentKind=e;this.text=t}},xe=class extends y{},rt=class extends xe{constructor(e,t,i){super(8,i);this.text=e;this.isQuoted=t}},ft=(l=>(l[l.Float=0]="Float",l[l.Integer=1]="Integer",l[l.String=2]="String",l[l.Template=3]="Template",l[l.RegExp=4]="RegExp",l[l.Array=5]="Array",l[l.Object=6]="Object",l))(ft||{}),Rt=class extends xe{constructor(e,t){super(18,t);this.literalKind=e}},Yr=class extends Rt{constructor(e,t){super(5,t);this.elementExpressions=e}},Xt=(i=>(i[i.Prefix=0]="Prefix",i[i.As=1]="As",i[i.NonNull=2]="NonNull",i[i.Const=3]="Const",i))(Xt||{}),vl=class extends xe{constructor(e,t,i,s){super(9,s);this.assertionKind=e;this.expression=t;this.toType=i}},Il=class extends xe{constructor(e,t,i,s){super(10,s);this.operator=e;this.left=t;this.right=i}},kl=class extends xe{constructor(e,t,i,s){super(11,s);this.expression=e;this.typeArguments=t;this.args=i}get typeArgumentsRange(){let e=this.typeArguments,t;return e&&(t=e.length)?ce.join(e[0].range,e[t-1].range):this.expression.range}get argumentsRange(){let e=this.args,t=e.length;return t?ce.join(e[0].range,e[t-1].range):this.expression.range}},Fl=class extends xe{constructor(e){super(12,e.range);this.declaration=e}},wl=class extends xe{constructor(e,t){super(13,t);this.expressions=e}},Rl=class extends rt{constructor(r){super("constructor",!1,r),this.kind=28}},Cl=class extends xe{constructor(e,t,i){super(14,i);this.expression=e;this.elementExpression=t}},Pl=class extends Rt{constructor(e,t){super(0,t);this.value=e}},Nl=class extends xe{constructor(e){super(16,e.range);this.declaration=e}},Ll=class extends xe{constructor(e,t,i){super(17,i);this.expression=e;this.isType=t}},Bl=class extends Rt{constructor(e,t){super(1,t);this.value=e}},Ml=class extends xe{constructor(e,t,i,s){super(19,s);this.typeName=e;this.typeArguments=t;this.args=i}get typeArgumentsRange(){let e=this.typeArguments,t;return e&&(t=e.length)>0?ce.join(e[0].range,e[t-1].range):this.typeName.range}get argumentsRange(){let e=this.args,t=e.length;return t?ce.join(e[0].range,e[t-1].range):this.typeName.range}},zl=class extends rt{constructor(r){super("null",!1,r),this.kind=20}},Dl=class extends Rt{constructor(e,t,i){super(6,i);this.names=e;this.values=t}},Gl=class extends xe{constructor(r){super(21,r)}},Ul=class extends xe{constructor(e,t){super(22,t);this.expression=e}},Vl=class extends xe{constructor(e,t,i){super(23,i);this.expression=e;this.property=t}},Ol=class extends Rt{constructor(e,t,i){super(4,i);this.pattern=e;this.patternFlags=t}},ql=class extends xe{constructor(e,t,i,s){super(24,s);this.condition=e;this.ifThen=t;this.ifElse=i}},Wl=class extends Rt{constructor(e,t){super(2,t);this.value=e}},Kl=class extends rt{constructor(r){super("super",!1,r),this.kind=25}},Hl=class extends Rt{constructor(e,t,i,s,a){super(3,a);this.tag=e;this.parts=t;this.rawParts=i;this.expressions=s}},jl=class extends rt{constructor(r){super("this",!1,r),this.kind=26}},Ql=class extends rt{constructor(r){super("true",!1,r),this.kind=27}},Xl=class extends rt{constructor(r){super("false",!1,r),this.kind=15}},us=class extends xe{constructor(e,t,i,s){super(e,s);this.operator=t;this.operand=i}},Zl=class extends us{constructor(r,e,t){super(29,r,e,t)}},$l=class extends us{constructor(r,e,t){super(30,r,e,t)}},Yl=class extends xe{constructor(e,t){super(31,t);this.operand=e}},Jl=class extends xe{constructor(e,t){super(32,t);this.expression=e}},eo=class extends xe{constructor(e,t,i){super(33,i);this.expr=e;this.type=t}},ye=class extends y{},Jn=(i=>(i[i.User=0]="User",i[i.UserEntry=1]="UserEntry",i[i.Library=2]="Library",i[i.LibraryEntry=3]="LibraryEntry",i))(Jn||{}),Te=class n extends y{constructor(e,t,i){super(0,new ce(0,i.length));this.sourceKind=e;this.normalizedPath=t;this.text=i;this.statements=new Array;this.debugInfoIndex=-1;this.exportPaths=null;this.lineCache=null;this.lineColumn=1;let s=ds(t);this.internalPath=s;let a=s.lastIndexOf(mt);this.simplePath=a>=0?s.substring(a+1):s,this.range.source=this}static get native(){let e=n._native;return e||(n._native=e=new n(3,wt+"native.ts","[native code]")),e}static{this._native=null}get isNative(){return this==n._native}get isLibrary(){let e=this.sourceKind;return e==2||e==3}lineAt(e){assert(e>=0&&e<2147483647);let t=this.lineCache;if(!t){this.lineCache=t=[0];let a=this.text,l=0,o=a.length;for(;l<o;)a.charCodeAt(l++)==10&&t.push(l);t.push(2147483647)}let i=0,s=t.length-1;for(;i<s;){let a=i+(s-i>>1),l=unchecked(t[a]);if(e<l)s=a;else{if(e<unchecked(t[a+1]))return this.lineColumn=e-l+1,a+1;i=a+1}}return assert(0)}columnAt(){return this.lineColumn}},nt=class extends ye{constructor(e,t,i,s,a){super(e,a);this.name=t;this.decorators=i;this.flags=s;this.overriddenModuleName=null}is(e){return(this.flags&e)==e}isAny(e){return(this.flags&e)!=0}set(e){this.flags|=e}},to=class extends y{constructor(e,t,i,s){super(69,s);this.keyType=e;this.valueType=t;this.flags=i}},Yn=class extends nt{constructor(e,t,i,s,a,l,o){super(e,t,i,s,o);this.type=a;this.initializer=l}},ro=class extends ye{constructor(e,t){super(34,t);this.statements=e}},no=class extends ye{constructor(e,t){super(35,t);this.label=e}},cs=class extends nt{constructor(e,t,i,s,a,l,o,u){super(55,e,t,i,u);this.typeParameters=s;this.extendsType=a;this.implementsTypes=l;this.members=o;this.indexSignature=null;this.declaredAsStruct=!1;this.declaredAsManagedStruct=!1}get isGeneric(){let e=this.typeParameters;return e!=null&&e.length>0}},io=class extends ye{constructor(e,t){super(36,t);this.label=e}},so=class extends ye{constructor(e,t,i){super(37,i);this.body=e;this.condition=t}},ao=class extends ye{constructor(r){super(38,r)}},lo=class extends nt{constructor(e,t,i,s,a,l){super(56,e,t,i,l);this.values=s;this.underlyingTypeNode=a}},oo=class extends Yn{constructor(r,e,t,i){super(57,r,null,e,null,t,i)}},uo=class extends ye{constructor(e,t,i){super(41,i);this.name=e;this.externalName=t}},co=class extends y{constructor(e,t,i){super(67,i);this.localName=e;this.exportedName=t}},po=class extends ye{constructor(e,t,i,s){super(39,s);this.members=e;this.path=t;this.isDeclare=i;if(t){let a=Xr(t.value);t.value.startsWith(".")?a=fl(a,s.source.internalPath):a.startsWith(wt)||(a=wt+a),this.internalPath=a}else this.internalPath=null}},fo=class extends ye{constructor(e,t){super(40,t);this.declaration=e}},_o=class extends ye{constructor(e){super(42,e.range);this.expression=e}},ho=class extends Yn{constructor(e,t,i,s,a,l,o){super(58,e,t,i,s,a,o);this.parameterIndex=l}},mo=class extends ye{constructor(e,t,i,s,a){super(43,a);this.initializer=e;this.condition=t;this.incrementor=i;this.body=s}},yo=class extends ye{constructor(e,t,i,s){super(44,s);this.variable=e;this.iterable=t;this.body=i}},Zt=(t=>(t[t.None=0]="None",t[t.Parenthesized=1]="Parenthesized",t[t.Single=2]="Single",t))(Zt||{}),ps=class n extends nt{constructor(e,t,i,s,a,l,o,u,c=!1){super(59,e,t,i,u);this.typeParameters=s;this.signature=a;this.body=l;this.arrowKind=o;this.isAsync=c}get isGeneric(){let e=this.typeParameters;return e!=null&&e.length>0}clone(){return new n(this.name,this.decorators,this.flags,this.typeParameters,this.signature,this.body,this.arrowKind,this.range,this.isAsync)}},go=class extends ye{constructor(e,t,i,s){super(45,s);this.condition=e;this.ifTrue=t;this.ifFalse=i}},bo=class extends nt{constructor(e,t,i){super(60,e,null,0,i);this.foreignName=t}},fs=class extends ye{constructor(e,t,i,s){super(46,s);this.declarations=e;this.namespaceName=t;this.path=i;let a=Xr(i.value);i.value.startsWith(".")?a=fl(a,s.source.internalPath):a.startsWith(wt)||(a=wt+a),this.internalPath=ds(a)}},xo=class extends cs{constructor(r,e,t,i,s,a,l,o){super(r,e,t,i,s,a,l,o),this.kind=61}},Jr=class extends ps{constructor(r,e,t,i,s,a,l,o=!1){super(r,e,t,i,s,a,0,l,o),this.kind=62}},Eo=class extends nt{constructor(e,t,i,s,a){super(63,e,t,i,a);this.members=s}},Ao=class extends ye{constructor(e,t){super(47,t);this.value=e}},To=class extends y{constructor(e,t,i){super(68,i);this.label=e;this.statements=t}get isDefault(){return this.label==null}},So=class extends ye{constructor(e,t,i){super(48,i);this.condition=e;this.cases=t}},vo=class extends ye{constructor(e,t){super(49,t);this.value=e}},Io=class extends ye{constructor(e,t,i,s,a){super(50,a);this.bodyStatements=e;this.catchVariable=t;this.catchStatements=i;this.finallyStatements=s}},ko=class extends ye{constructor(e,t,i){super(54,i);this.moduleName=e;this.flags=t}},Fo=class extends nt{constructor(e,t,i,s,a,l){super(64,e,t,i,l);this.typeParameters=s;this.type=a}},wo=class extends Yn{constructor(r,e,t,i,s,a){super(65,r,e,t,i,s,a)}},Ro=class extends ye{constructor(e,t,i){super(51,i);this.decorators=e;this.declarations=t}},Co=class extends ye{constructor(e,t){super(52,t);this.expression=e}},Po=class extends ye{constructor(e,t,i){super(53,i);this.condition=e;this.body=t}};function $t(n,r){if(r)for(let e=0,t=r.length;e<t;++e){let i=r[e];if(i.decoratorKind==n)return i}return null}function ds(n){return n.endsWith("/")?n+="index":n.endsWith(".ts")&&(n=n.substring(0,n.length-3)),n}function De(n){if(n.kind==1){let r=n.name;return!(r.next||r.identifier.text.length>0)}return!1}var P;(S=>{S.None=0,S.Unreachable=1,S.I32=2,S.I64=3,S.F32=4,S.F64=5,S.V128=6;function l(){return Y_()}S.funcref=l,S.Externref=J_(),S.Anyref=ed(),S.Eqref=td(),S.Structref=nd(),S.Arrayref=id(),S.I31ref=rd(),S.Stringref=sd(),S.Noneref=ad(),S.Nofuncref=od(),S.Noexternref=ld()})(P||={});var Ie;(b=>{b.Extern=8,b.Func=16,b.Any=32,b.Eq=40,b.I31=48,b.Struct=56,b.Array=64,b.Exn=7,b.String=80,b.None=88,b.Noextern=96,b.Nofunc=104;function _(A){return ud(A)}b.isBottom=_;function d(A){return cd(A)}b.getBottom=d;function m(A,S){return pd(A,S)}b.isSubtype=m;function h(A,S){if(A==S)return A;if(d(A)!=d(S))return-1;if(_(A))return S;if(_(S))return A;if(A>S){let k=A;A=S,S=k}switch(A){case b.Extern:return S==b.String?A:-1;case b.Func:return-1;case b.Any:return A;case b.Eq:return S==b.I31||S==b.Struct||S==b.Array?b.Eq:b.Any;case b.I31:return S==b.Struct||S==b.Array?b.Eq:b.Any;case b.Struct:return S==b.Array?b.Eq:b.Any;case b.Array:return b.Any}return assert(!1),-1}b.leastUpperBound=h})(Ie||={});var ms;(t=>(t.NotPacked=0,t.I8=1,t.I16=2))(ms||={});var rf;(s=>{s.SelfSupertype=0,s.InvalidSupertype=1,s.ForwardSupertypeReference=2,s.ForwardChildReference=3;function i(a){switch(a){case 0:return"SelfSupertype";case 1:return"InvalidSupertype";case 2:return"ForwardSupertypeReference";case 3:return"ForwardChildReference"}return assert(!1),""}s.toString=i})(rf||={});var Mo=(U=>(U[U.MVP=0]="MVP",U[U.Atomics=1]="Atomics",U[U.MutableGlobals=2]="MutableGlobals",U[U.TruncSat=4]="TruncSat",U[U.SIMD=8]="SIMD",U[U.BulkMemory=16]="BulkMemory",U[U.SignExt=32]="SignExt",U[U.ExceptionHandling=64]="ExceptionHandling",U[U.TailCall=128]="TailCall",U[U.ReferenceTypes=256]="ReferenceTypes",U[U.MultiValue=512]="MultiValue",U[U.GC=1024]="GC",U[U.Memory64=2048]="Memory64",U[U.RelaxedSIMD=4096]="RelaxedSIMD",U[U.ExtendedConst=8192]="ExtendedConst",U[U.Strings=16384]="Strings",U[U.MultiMemory=32768]="MultiMemory",U[U.StackSwitching=65536]="StackSwitching",U[U.SharedEverything=131072]="SharedEverything",U[U.FP16=262144]="FP16",U[U.BulkMemoryOpt=524288]="BulkMemoryOpt",U[U.CallIndirectOverlong=1048576]="CallIndirectOverlong",U[U.RelaxedAtomics=4194304]="RelaxedAtomics",U[U.CustomPageSizes=8388608]="CustomPageSizes",U[U.Multibyte=16777216]="Multibyte",U[U.WideArithmetic=33554432]="WideArithmetic",U[U.CompactImports=67108864]="CompactImports",U[U.All=134217727]="All",U))(Mo||{}),en=(B=>(B[B.Invalid=0]="Invalid",B[B.Block=1]="Block",B[B.If=2]="If",B[B.Loop=3]="Loop",B[B.Break=4]="Break",B[B.Switch=5]="Switch",B[B.Call=6]="Call",B[B.CallIndirect=7]="CallIndirect",B[B.LocalGet=8]="LocalGet",B[B.LocalSet=9]="LocalSet",B[B.GlobalGet=10]="GlobalGet",B[B.GlobalSet=11]="GlobalSet",B[B.Load=12]="Load",B[B.Store=13]="Store",B[B.Const=14]="Const",B[B.Unary=15]="Unary",B[B.Binary=16]="Binary",B[B.Select=17]="Select",B[B.Drop=18]="Drop",B[B.Return=19]="Return",B[B.MemorySize=20]="MemorySize",B[B.MemoryGrow=21]="MemoryGrow",B[B.Nop=22]="Nop",B[B.Unreachable=23]="Unreachable",B[B.AtomicRMW=24]="AtomicRMW",B[B.AtomicCmpxchg=25]="AtomicCmpxchg",B[B.AtomicWait=26]="AtomicWait",B[B.AtomicNotify=27]="AtomicNotify",B[B.AtomicFence=28]="AtomicFence",B[B.Pause=29]="Pause",B[B.SIMDExtract=30]="SIMDExtract",B[B.SIMDReplace=31]="SIMDReplace",B[B.SIMDShuffle=32]="SIMDShuffle",B[B.SIMDTernary=33]="SIMDTernary",B[B.SIMDShift=34]="SIMDShift",B[B.SIMDLoad=35]="SIMDLoad",B[B.SIMDLoadStoreLane=36]="SIMDLoadStoreLane",B[B.MemoryInit=37]="MemoryInit",B[B.DataDrop=38]="DataDrop",B[B.MemoryCopy=39]="MemoryCopy",B[B.MemoryFill=40]="MemoryFill",B[B.Pop=41]="Pop",B[B.RefNull=42]="RefNull",B[B.RefIsNull=43]="RefIsNull",B[B.RefFunc=44]="RefFunc",B[B.RefEq=45]="RefEq",B[B.TableGet=46]="TableGet",B[B.TableSet=47]="TableSet",B[B.TableSize=48]="TableSize",B[B.TableGrow=49]="TableGrow",B[B.TableFill=50]="TableFill",B[B.TableCopy=51]="TableCopy",B[B.TableInit=52]="TableInit",B[B.ElemDrop=53]="ElemDrop",B[B.Try=54]="Try",B[B.TryTable=55]="TryTable",B[B.Throw=56]="Throw",B[B.Rethrow=57]="Rethrow",B[B.ThrowRef=58]="ThrowRef",B[B.TupleMake=59]="TupleMake",B[B.TupleExtract=60]="TupleExtract",B[B.RefI31=61]="RefI31",B[B.I31Get=62]="I31Get",B[B.CallRef=63]="CallRef",B[B.RefTest=64]="RefTest",B[B.RefCast=65]="RefCast",B[B.RefGetDesc=66]="RefGetDesc",B[B.BrOn=67]="BrOn",B[B.StructNew=68]="StructNew",B[B.StructGet=69]="StructGet",B[B.StructSet=70]="StructSet",B[B.StructRMW=71]="StructRMW",B[B.StructCmpxchg=72]="StructCmpxchg",B[B.ArrayNew=73]="ArrayNew",B[B.ArrayNewData=74]="ArrayNewData",B[B.ArrayNewElem=75]="ArrayNewElem",B[B.ArrayNewFixed=76]="ArrayNewFixed",B[B.ArrayGet=77]="ArrayGet",B[B.ArraySet=78]="ArraySet",B[B.ArrayLoad=79]="ArrayLoad",B[B.ArrayStore=80]="ArrayStore",B[B.ArrayLen=81]="ArrayLen",B[B.ArrayCopy=82]="ArrayCopy",B[B.ArrayFill=83]="ArrayFill",B[B.ArrayInitData=84]="ArrayInitData",B[B.ArrayInitElem=85]="ArrayInitElem",B[B.ArrayRMW=86]="ArrayRMW",B[B.ArrayCmpxchg=87]="ArrayCmpxchg",B[B.RefAs=88]="RefAs",B[B.StringNew=89]="StringNew",B[B.StringConst=90]="StringConst",B[B.StringMeasure=91]="StringMeasure",B[B.StringEncode=92]="StringEncode",B[B.StringConcat=93]="StringConcat",B[B.StringEq=94]="StringEq",B[B.StringTest=95]="StringTest",B[B.StringWTF16Get=96]="StringWTF16Get",B[B.StringSliceWTF=97]="StringSliceWTF",B[B.ContNew=98]="ContNew",B[B.ContBind=99]="ContBind",B[B.Suspend=100]="Suspend",B[B.Resume=101]="Resume",B[B.ResumeThrow=102]="ResumeThrow",B[B.StackSwitch=103]="StackSwitch",B[B.StructWait=104]="StructWait",B[B.StructNotify=105]="StructNotify",B[B.WideIntAddSub=106]="WideIntAddSub",B[B.WideIntMul=107]="WideIntMul",B))(en||{}),nf=(s=>(s[s.Function=0]="Function",s[s.Table=1]="Table",s[s.Memory=2]="Memory",s[s.Global=3]="Global",s[s.Tag=4]="Tag",s))(nf||{}),Ob=(t=>(t[t.Unordered=0]="Unordered",t[t.SeqCst=1]="SeqCst",t[t.AcqRel=2]="AcqRel",t))(Ob||{}),gs=(N=>(N[N.ClzI32=0]="ClzI32",N[N.ClzI64=1]="ClzI64",N[N.CtzI32=2]="CtzI32",N[N.CtzI64=3]="CtzI64",N[N.PopcntI32=4]="PopcntI32",N[N.PopcntI64=5]="PopcntI64",N[N.NegF32=6]="NegF32",N[N.NegF64=7]="NegF64",N[N.AbsF32=8]="AbsF32",N[N.AbsF64=9]="AbsF64",N[N.CeilF32=10]="CeilF32",N[N.CeilF64=11]="CeilF64",N[N.FloorF32=12]="FloorF32",N[N.FloorF64=13]="FloorF64",N[N.TruncF32=14]="TruncF32",N[N.TruncF64=15]="TruncF64",N[N.NearestF32=16]="NearestF32",N[N.NearestF64=17]="NearestF64",N[N.SqrtF32=18]="SqrtF32",N[N.SqrtF64=19]="SqrtF64",N[N.EqzI32=20]="EqzI32",N[N.EqzI64=21]="EqzI64",N[N.ExtendI32ToI64=22]="ExtendI32ToI64",N[N.ExtendU32ToU64=23]="ExtendU32ToU64",N[N.WrapI64ToI32=24]="WrapI64ToI32",N[N.TruncF32ToI32=25]="TruncF32ToI32",N[N.TruncF32ToI64=26]="TruncF32ToI64",N[N.TruncF32ToU32=27]="TruncF32ToU32",N[N.TruncF32ToU64=28]="TruncF32ToU64",N[N.TruncF64ToI32=29]="TruncF64ToI32",N[N.TruncF64ToI64=30]="TruncF64ToI64",N[N.TruncF64ToU32=31]="TruncF64ToU32",N[N.TruncF64ToU64=32]="TruncF64ToU64",N[N.ReinterpretF32ToI32=33]="ReinterpretF32ToI32",N[N.ReinterpretF64ToI64=34]="ReinterpretF64ToI64",N[N.ConvertI32ToF32=35]="ConvertI32ToF32",N[N.ConvertI32ToF64=36]="ConvertI32ToF64",N[N.ConvertU32ToF32=37]="ConvertU32ToF32",N[N.ConvertU32ToF64=38]="ConvertU32ToF64",N[N.ConvertI64ToF32=39]="ConvertI64ToF32",N[N.ConvertI64ToF64=40]="ConvertI64ToF64",N[N.ConvertU64ToF32=41]="ConvertU64ToF32",N[N.ConvertU64ToF64=42]="ConvertU64ToF64",N[N.PromoteF32ToF64=43]="PromoteF32ToF64",N[N.DemoteF64ToF32=44]="DemoteF64ToF32",N[N.ReinterpretI32ToF32=45]="ReinterpretI32ToF32",N[N.ReinterpretI64ToF64=46]="ReinterpretI64ToF64",N[N.Extend8I32=47]="Extend8I32",N[N.Extend16I32=48]="Extend16I32",N[N.Extend8I64=49]="Extend8I64",N[N.Extend16I64=50]="Extend16I64",N[N.Extend32I64=51]="Extend32I64",N[N.TruncSatF32ToI32=52]="TruncSatF32ToI32",N[N.TruncSatF32ToU32=53]="TruncSatF32ToU32",N[N.TruncSatF64ToI32=54]="TruncSatF64ToI32",N[N.TruncSatF64ToU32=55]="TruncSatF64ToU32",N[N.TruncSatF32ToI64=56]="TruncSatF32ToI64",N[N.TruncSatF32ToU64=57]="TruncSatF32ToU64",N[N.TruncSatF64ToI64=58]="TruncSatF64ToI64",N[N.TruncSatF64ToU64=59]="TruncSatF64ToU64",N[N.SplatI8x16=60]="SplatI8x16",N[N.SplatI16x8=61]="SplatI16x8",N[N.SplatI32x4=62]="SplatI32x4",N[N.SplatI64x2=63]="SplatI64x2",N[N.SplatF32x4=64]="SplatF32x4",N[N.SplatF64x2=65]="SplatF64x2",N[N.NotV128=66]="NotV128",N[N.AnyTrueV128=67]="AnyTrueV128",N[N.AbsI8x16=68]="AbsI8x16",N[N.NegI8x16=69]="NegI8x16",N[N.AllTrueI8x16=70]="AllTrueI8x16",N[N.BitmaskI8x16=71]="BitmaskI8x16",N[N.PopcntI8x16=72]="PopcntI8x16",N[N.AbsI16x8=73]="AbsI16x8",N[N.NegI16x8=74]="NegI16x8",N[N.AllTrueI16x8=75]="AllTrueI16x8",N[N.BitmaskI16x8=76]="BitmaskI16x8",N[N.AbsI32x4=77]="AbsI32x4",N[N.NegI32x4=78]="NegI32x4",N[N.AllTrueI32x4=79]="AllTrueI32x4",N[N.BitmaskI32x4=80]="BitmaskI32x4",N[N.AbsI64x2=81]="AbsI64x2",N[N.NegI64x2=82]="NegI64x2",N[N.AllTrueI64x2=83]="AllTrueI64x2",N[N.BitmaskI64x2=84]="BitmaskI64x2",N[N.AbsF32x4=92]="AbsF32x4",N[N.NegF32x4=93]="NegF32x4",N[N.SqrtF32x4=94]="SqrtF32x4",N[N.CeilF32x4=95]="CeilF32x4",N[N.FloorF32x4=96]="FloorF32x4",N[N.TruncF32x4=97]="TruncF32x4",N[N.NearestF32x4=98]="NearestF32x4",N[N.AbsF64x2=99]="AbsF64x2",N[N.NegF64x2=100]="NegF64x2",N[N.SqrtF64x2=101]="SqrtF64x2",N[N.CeilF64x2=102]="CeilF64x2",N[N.FloorF64x2=103]="FloorF64x2",N[N.TruncF64x2=104]="TruncF64x2",N[N.NearestF64x2=105]="NearestF64x2",N[N.ExtaddPairwiseI8x16ToI16x8=106]="ExtaddPairwiseI8x16ToI16x8",N[N.ExtaddPairwiseU8x16ToU16x8=107]="ExtaddPairwiseU8x16ToU16x8",N[N.ExtaddPairwiseI16x8ToI32x4=108]="ExtaddPairwiseI16x8ToI32x4",N[N.ExtaddPairwiseU16x8ToU32x4=109]="ExtaddPairwiseU16x8ToU32x4",N[N.TruncSatF32x4ToI32x4=110]="TruncSatF32x4ToI32x4",N[N.TruncSatF32x4ToU32x4=111]="TruncSatF32x4ToU32x4",N[N.ConvertI32x4ToF32x4=112]="ConvertI32x4ToF32x4",N[N.ConvertU32x4ToF32x4=113]="ConvertU32x4ToF32x4",N[N.ExtendLowI8x16ToI16x8=114]="ExtendLowI8x16ToI16x8",N[N.ExtendHighI8x16ToI16x8=115]="ExtendHighI8x16ToI16x8",N[N.ExtendLowU8x16ToU16x8=116]="ExtendLowU8x16ToU16x8",N[N.ExtendHighU8x16ToU16x8=117]="ExtendHighU8x16ToU16x8",N[N.ExtendLowI16x8ToI32x4=118]="ExtendLowI16x8ToI32x4",N[N.ExtendHighI16x8ToI32x4=119]="ExtendHighI16x8ToI32x4",N[N.ExtendLowU16x8ToU32x4=120]="ExtendLowU16x8ToU32x4",N[N.ExtendHighU16x8ToU32x4=121]="ExtendHighU16x8ToU32x4",N[N.ExtendLowI32x4ToI64x2=122]="ExtendLowI32x4ToI64x2",N[N.ExtendHighI32x4ToI64x2=123]="ExtendHighI32x4ToI64x2",N[N.ExtendLowU32x4ToU64x2=124]="ExtendLowU32x4ToU64x2",N[N.ExtendHighU32x4ToU64x2=125]="ExtendHighU32x4ToU64x2",N[N.ConvertLowI32x4ToF64x2=126]="ConvertLowI32x4ToF64x2",N[N.ConvertLowU32x4ToF64x2=127]="ConvertLowU32x4ToF64x2",N[N.TruncSatF64x2ToI32x4Zero=128]="TruncSatF64x2ToI32x4Zero",N[N.TruncSatF64x2ToU32x4Zero=129]="TruncSatF64x2ToU32x4Zero",N[N.DemoteZeroF64x2ToF32x4=130]="DemoteZeroF64x2ToF32x4",N[N.PromoteLowF32x4ToF64x2=131]="PromoteLowF32x4ToF64x2",N[N.RelaxedTruncF32x4ToI32x4=132]="RelaxedTruncF32x4ToI32x4",N[N.RelaxedTruncF32x4ToU32x4=133]="RelaxedTruncF32x4ToU32x4",N[N.RelaxedTruncF64x2ToI32x4Zero=134]="RelaxedTruncF64x2ToI32x4Zero",N[N.RelaxedTruncF64x2ToU32x4Zero=135]="RelaxedTruncF64x2ToU32x4Zero",N[N.PromoteLowF16x8ToF32x4=141]="PromoteLowF16x8ToF32x4",N[N._last=141]="_last",N[N.ClzSize=142]="ClzSize",N[N.CtzSize=143]="CtzSize",N[N.PopcntSize=144]="PopcntSize",N[N.EqzSize=145]="EqzSize",N))(gs||{}),ti=(I=>(I[I.AddI32=0]="AddI32",I[I.SubI32=1]="SubI32",I[I.MulI32=2]="MulI32",I[I.DivI32=3]="DivI32",I[I.DivU32=4]="DivU32",I[I.RemI32=5]="RemI32",I[I.RemU32=6]="RemU32",I[I.AndI32=7]="AndI32",I[I.OrI32=8]="OrI32",I[I.XorI32=9]="XorI32",I[I.ShlI32=10]="ShlI32",I[I.ShrI32=11]="ShrI32",I[I.ShrU32=12]="ShrU32",I[I.RotlI32=13]="RotlI32",I[I.RotrI32=14]="RotrI32",I[I.EqI32=15]="EqI32",I[I.NeI32=16]="NeI32",I[I.LtI32=17]="LtI32",I[I.LtU32=18]="LtU32",I[I.LeI32=19]="LeI32",I[I.LeU32=20]="LeU32",I[I.GtI32=21]="GtI32",I[I.GtU32=22]="GtU32",I[I.GeI32=23]="GeI32",I[I.GeU32=24]="GeU32",I[I.AddI64=25]="AddI64",I[I.SubI64=26]="SubI64",I[I.MulI64=27]="MulI64",I[I.DivI64=28]="DivI64",I[I.DivU64=29]="DivU64",I[I.RemI64=30]="RemI64",I[I.RemU64=31]="RemU64",I[I.AndI64=32]="AndI64",I[I.OrI64=33]="OrI64",I[I.XorI64=34]="XorI64",I[I.ShlI64=35]="ShlI64",I[I.ShrI64=36]="ShrI64",I[I.ShrU64=37]="ShrU64",I[I.RotlI64=38]="RotlI64",I[I.RotrI64=39]="RotrI64",I[I.EqI64=40]="EqI64",I[I.NeI64=41]="NeI64",I[I.LtI64=42]="LtI64",I[I.LtU64=43]="LtU64",I[I.LeI64=44]="LeI64",I[I.LeU64=45]="LeU64",I[I.GtI64=46]="GtI64",I[I.GtU64=47]="GtU64",I[I.GeI64=48]="GeI64",I[I.GeU64=49]="GeU64",I[I.AddF32=50]="AddF32",I[I.SubF32=51]="SubF32",I[I.MulF32=52]="MulF32",I[I.DivF32=53]="DivF32",I[I.CopysignF32=54]="CopysignF32",I[I.MinF32=55]="MinF32",I[I.MaxF32=56]="MaxF32",I[I.EqF32=57]="EqF32",I[I.NeF32=58]="NeF32",I[I.LtF32=59]="LtF32",I[I.LeF32=60]="LeF32",I[I.GtF32=61]="GtF32",I[I.GeF32=62]="GeF32",I[I.AddF64=63]="AddF64",I[I.SubF64=64]="SubF64",I[I.MulF64=65]="MulF64",I[I.DivF64=66]="DivF64",I[I.CopysignF64=67]="CopysignF64",I[I.MinF64=68]="MinF64",I[I.MaxF64=69]="MaxF64",I[I.EqF64=70]="EqF64",I[I.NeF64=71]="NeF64",I[I.LtF64=72]="LtF64",I[I.LeF64=73]="LeF64",I[I.GtF64=74]="GtF64",I[I.GeF64=75]="GeF64",I[I.EqI8x16=76]="EqI8x16",I[I.NeI8x16=77]="NeI8x16",I[I.LtI8x16=78]="LtI8x16",I[I.LtU8x16=79]="LtU8x16",I[I.GtI8x16=80]="GtI8x16",I[I.GtU8x16=81]="GtU8x16",I[I.LeI8x16=82]="LeI8x16",I[I.LeU8x16=83]="LeU8x16",I[I.GeI8x16=84]="GeI8x16",I[I.GeU8x16=85]="GeU8x16",I[I.EqI16x8=86]="EqI16x8",I[I.NeI16x8=87]="NeI16x8",I[I.LtI16x8=88]="LtI16x8",I[I.LtU16x8=89]="LtU16x8",I[I.GtI16x8=90]="GtI16x8",I[I.GtU16x8=91]="GtU16x8",I[I.LeI16x8=92]="LeI16x8",I[I.LeU16x8=93]="LeU16x8",I[I.GeI16x8=94]="GeI16x8",I[I.GeU16x8=95]="GeU16x8",I[I.EqI32x4=96]="EqI32x4",I[I.NeI32x4=97]="NeI32x4",I[I.LtI32x4=98]="LtI32x4",I[I.LtU32x4=99]="LtU32x4",I[I.GtI32x4=100]="GtI32x4",I[I.GtU32x4=101]="GtU32x4",I[I.LeI32x4=102]="LeI32x4",I[I.LeU32x4=103]="LeU32x4",I[I.GeI32x4=104]="GeI32x4",I[I.GeU32x4=105]="GeU32x4",I[I.EqI64x2=106]="EqI64x2",I[I.NeI64x2=107]="NeI64x2",I[I.LtI64x2=108]="LtI64x2",I[I.GtI64x2=109]="GtI64x2",I[I.LeI64x2=110]="LeI64x2",I[I.GeI64x2=111]="GeI64x2",I[I.EqF32x4=118]="EqF32x4",I[I.NeF32x4=119]="NeF32x4",I[I.LtF32x4=120]="LtF32x4",I[I.GtF32x4=121]="GtF32x4",I[I.LeF32x4=122]="LeF32x4",I[I.GeF32x4=123]="GeF32x4",I[I.EqF64x2=124]="EqF64x2",I[I.NeF64x2=125]="NeF64x2",I[I.LtF64x2=126]="LtF64x2",I[I.GtF64x2=127]="GtF64x2",I[I.LeF64x2=128]="LeF64x2",I[I.GeF64x2=129]="GeF64x2",I[I.AndV128=130]="AndV128",I[I.OrV128=131]="OrV128",I[I.XorV128=132]="XorV128",I[I.AndnotV128=133]="AndnotV128",I[I.AddI8x16=134]="AddI8x16",I[I.AddSatI8x16=135]="AddSatI8x16",I[I.AddSatU8x16=136]="AddSatU8x16",I[I.SubI8x16=137]="SubI8x16",I[I.SubSatI8x16=138]="SubSatI8x16",I[I.SubSatU8x16=139]="SubSatU8x16",I[I.MinI8x16=140]="MinI8x16",I[I.MinU8x16=141]="MinU8x16",I[I.MaxI8x16=142]="MaxI8x16",I[I.MaxU8x16=143]="MaxU8x16",I[I.AvgrU8x16=144]="AvgrU8x16",I[I.AddI16x8=145]="AddI16x8",I[I.AddSatI16x8=146]="AddSatI16x8",I[I.AddSatU16x8=147]="AddSatU16x8",I[I.SubI16x8=148]="SubI16x8",I[I.SubSatI16x8=149]="SubSatI16x8",I[I.SubSatU16x8=150]="SubSatU16x8",I[I.MulI16x8=151]="MulI16x8",I[I.MinI16x8=152]="MinI16x8",I[I.MinU16x8=153]="MinU16x8",I[I.MaxI16x8=154]="MaxI16x8",I[I.MaxU16x8=155]="MaxU16x8",I[I.AvgrU16x8=156]="AvgrU16x8",I[I.Q15mulrSatI16x8=157]="Q15mulrSatI16x8",I[I.ExtmulLowI16x8=158]="ExtmulLowI16x8",I[I.ExtmulHighI16x8=159]="ExtmulHighI16x8",I[I.ExtmulLowU16x8=160]="ExtmulLowU16x8",I[I.ExtmulHighU16x8=161]="ExtmulHighU16x8",I[I.AddI32x4=162]="AddI32x4",I[I.SubI32x4=163]="SubI32x4",I[I.MulI32x4=164]="MulI32x4",I[I.MinI32x4=165]="MinI32x4",I[I.MinU32x4=166]="MinU32x4",I[I.MaxI32x4=167]="MaxI32x4",I[I.MaxU32x4=168]="MaxU32x4",I[I.DotI16x8=169]="DotI16x8",I[I.ExtmulLowI32x4=170]="ExtmulLowI32x4",I[I.ExtmulHighI32x4=171]="ExtmulHighI32x4",I[I.ExtmulLowU32x4=172]="ExtmulLowU32x4",I[I.ExtmulHighU32x4=173]="ExtmulHighU32x4",I[I.AddI64x2=174]="AddI64x2",I[I.SubI64x2=175]="SubI64x2",I[I.MulI64x2=176]="MulI64x2",I[I.ExtmulLowI64x2=177]="ExtmulLowI64x2",I[I.ExtmulHighI64x2=178]="ExtmulHighI64x2",I[I.ExtmulLowU64x2=179]="ExtmulLowU64x2",I[I.ExtmulHighU64x2=180]="ExtmulHighU64x2",I[I.AddF32x4=189]="AddF32x4",I[I.SubF32x4=190]="SubF32x4",I[I.MulF32x4=191]="MulF32x4",I[I.DivF32x4=192]="DivF32x4",I[I.MinF32x4=193]="MinF32x4",I[I.MaxF32x4=194]="MaxF32x4",I[I.PminF32x4=195]="PminF32x4",I[I.PmaxF32x4=196]="PmaxF32x4",I[I.AddF64x2=197]="AddF64x2",I[I.SubF64x2=198]="SubF64x2",I[I.MulF64x2=199]="MulF64x2",I[I.DivF64x2=200]="DivF64x2",I[I.MinF64x2=201]="MinF64x2",I[I.MaxF64x2=202]="MaxF64x2",I[I.PminF64x2=203]="PminF64x2",I[I.PmaxF64x2=204]="PmaxF64x2",I[I.NarrowI16x8ToI8x16=205]="NarrowI16x8ToI8x16",I[I.NarrowU16x8ToU8x16=206]="NarrowU16x8ToU8x16",I[I.NarrowI32x4ToI16x8=207]="NarrowI32x4ToI16x8",I[I.NarrowU32x4ToU16x8=208]="NarrowU32x4ToU16x8",I[I.SwizzleI8x16=209]="SwizzleI8x16",I[I.RelaxedSwizzleI8x16=210]="RelaxedSwizzleI8x16",I[I.RelaxedMinF32x4=211]="RelaxedMinF32x4",I[I.RelaxedMaxF32x4=212]="RelaxedMaxF32x4",I[I.RelaxedMinF64x2=213]="RelaxedMinF64x2",I[I.RelaxedMaxF64x2=214]="RelaxedMaxF64x2",I[I.RelaxedQ15MulrI16x8=215]="RelaxedQ15MulrI16x8",I[I.RelaxedDotI8x16I7x16ToI16x8=216]="RelaxedDotI8x16I7x16ToI16x8",I[I._last=216]="_last",I[I.AddSize=217]="AddSize",I[I.SubSize=218]="SubSize",I[I.MulSize=219]="MulSize",I[I.DivISize=220]="DivISize",I[I.DivUSize=221]="DivUSize",I[I.RemISize=222]="RemISize",I[I.RemUSize=223]="RemUSize",I[I.AndSize=224]="AndSize",I[I.OrSize=225]="OrSize",I[I.XorSize=226]="XorSize",I[I.ShlSize=227]="ShlSize",I[I.ShrISize=228]="ShrISize",I[I.ShrUSize=229]="ShrUSize",I[I.RotlSize=230]="RotlSize",I[I.RotrSize=231]="RotrSize",I[I.EqSize=232]="EqSize",I[I.NeSize=233]="NeSize",I[I.LtISize=234]="LtISize",I[I.LtUSize=235]="LtUSize",I[I.LeISize=236]="LeISize",I[I.LeUSize=237]="LeUSize",I[I.GtISize=238]="GtISize",I[I.GtUSize=239]="GtUSize",I[I.GeISize=240]="GeISize",I[I.GeUSize=241]="GeUSize",I))(ti||{}),sf=(a=>(a[a.Add=0]="Add",a[a.Sub=1]="Sub",a[a.And=2]="And",a[a.Or=3]="Or",a[a.Xor=4]="Xor",a[a.Xchg=5]="Xchg",a))(sf||{}),af=(o=>(o[o.ExtractLaneI8x16=0]="ExtractLaneI8x16",o[o.ExtractLaneU8x16=1]="ExtractLaneU8x16",o[o.ExtractLaneI16x8=2]="ExtractLaneI16x8",o[o.ExtractLaneU16x8=3]="ExtractLaneU16x8",o[o.ExtractLaneI32x4=4]="ExtractLaneI32x4",o[o.ExtractLaneI64x2=5]="ExtractLaneI64x2",o[o.ExtractLaneF32x4=7]="ExtractLaneF32x4",o[o.ExtractLaneF64x2=8]="ExtractLaneF64x2",o))(af||{}),lf=(a=>(a[a.ReplaceLaneI8x16=0]="ReplaceLaneI8x16",a[a.ReplaceLaneI16x8=1]="ReplaceLaneI16x8",a[a.ReplaceLaneI32x4=2]="ReplaceLaneI32x4",a[a.ReplaceLaneI64x2=3]="ReplaceLaneI64x2",a[a.ReplaceLaneF32x4=5]="ReplaceLaneF32x4",a[a.ReplaceLaneF64x2=6]="ReplaceLaneF64x2",a))(lf||{}),of=(_=>(_[_.ShlI8x16=0]="ShlI8x16",_[_.ShrI8x16=1]="ShrI8x16",_[_.ShrU8x16=2]="ShrU8x16",_[_.ShlI16x8=3]="ShlI16x8",_[_.ShrI16x8=4]="ShrI16x8",_[_.ShrU16x8=5]="ShrU16x8",_[_.ShlI32x4=6]="ShlI32x4",_[_.ShrI32x4=7]="ShrI32x4",_[_.ShrU32x4=8]="ShrU32x4",_[_.ShlI64x2=9]="ShlI64x2",_[_.ShrI64x2=10]="ShrI64x2",_[_.ShrU64x2=11]="ShrU64x2",_))(of||{}),uf=(_=>(_[_.Load8Splat=0]="Load8Splat",_[_.Load16Splat=1]="Load16Splat",_[_.Load32Splat=2]="Load32Splat",_[_.Load64Splat=3]="Load64Splat",_[_.Load8x8S=4]="Load8x8S",_[_.Load8x8U=5]="Load8x8U",_[_.Load16x4S=6]="Load16x4S",_[_.Load16x4U=7]="Load16x4U",_[_.Load32x2S=8]="Load32x2S",_[_.Load32x2U=9]="Load32x2U",_[_.Load32Zero=10]="Load32Zero",_[_.Load64Zero=11]="Load64Zero",_))(uf||{}),cf=(o=>(o[o.Load8Lane=0]="Load8Lane",o[o.Load16Lane=1]="Load16Lane",o[o.Load32Lane=2]="Load32Lane",o[o.Load64Lane=3]="Load64Lane",o[o.Store8Lane=4]="Store8Lane",o[o.Store16Lane=5]="Store16Lane",o[o.Store32Lane=6]="Store32Lane",o[o.Store64Lane=7]="Store64Lane",o))(cf||{}),pf=(c=>(c[c.Bitselect=0]="Bitselect",c[c.RelaxedMaddF32x4=1]="RelaxedMaddF32x4",c[c.RelaxedNmaddF32x4=2]="RelaxedNmaddF32x4",c[c.RelaxedMaddF64x2=3]="RelaxedMaddF64x2",c[c.RelaxedNmaddF64x2=4]="RelaxedNmaddF64x2",c[c.RelaxedLaneselectI8x16=5]="RelaxedLaneselectI8x16",c[c.RelaxedLaneselectI16x8=6]="RelaxedLaneselectI16x8",c[c.RelaxedLaneselectI32x4=7]="RelaxedLaneselectI32x4",c[c.RelaxedLaneselectI64x2=8]="RelaxedLaneselectI64x2",c[c.RelaxedDotI8x16I7x16AddToI32x4=9]="RelaxedDotI8x16I7x16AddToI32x4",c))(pf||{}),qb=(t=>(t[t.NonNull=0]="NonNull",t[t.AnyConvertExtern=1]="AnyConvertExtern",t[t.ExternConvertAny=2]="ExternConvertAny",t))(qb||{}),Wb=(e=>(e[e.Add=0]="Add",e[e.Sub=1]="Sub",e))(Wb||{}),Kb=(e=>(e[e.SignedI64=0]="SignedI64",e[e.UnsignedI64=1]="UnsignedI64",e))(Kb||{}),Hb=(i=>(i[i.Null=0]="Null",i[i.NonNull=1]="NonNull",i[i.Cast=2]="Cast",i[i.CastFail=3]="CastFail",i))(Hb||{}),jb=(t=>(t[t.LossyUTF8Array=0]="LossyUTF8Array",t[t.WTF16Array=1]="WTF16Array",t[t.FromCodePoint=2]="FromCodePoint",t))(jb||{}),Qb=(e=>(e[e.UTF8=0]="UTF8",e[e.WTF16=1]="WTF16",e))(Qb||{}),Xb=(e=>(e[e.LossyUTF8Array=0]="LossyUTF8Array",e[e.WTF16Array=1]="WTF16Array",e))(Xb||{}),Zb=(e=>(e[e.Equal=0]="Equal",e[e.Compare=1]="Compare",e))(Zb||{}),zo=(e=>(e[e.Default=0]="Default",e[e.PreserveSideeffects=1]="PreserveSideeffects",e))(zo||{}),ei=class{constructor(r,e){this.buffer=r;this.offset=e}},Jt=class n{constructor(r,e,t){this.ref=r;this.useShadowStack=e;this.sizeType=t;this.hasTemporaryFunction=!1;this.cachedStringsToPointers=new Map;this.cachedPointersToStrings=new Map;assert(t==P.I32||t==P.I64),this.lit=kt(Gu())}static create(r,e){return new n(_d(),r,e)}static createFrom(r,e,t){let i=hs(r),s=new n(vg(i,r.length),e,t);return ie(changetype(i)),s}i32(r){let e=this.lit;return hd(e,r),Nn(this.ref,e)}i64(r,e=0){let t=this.lit;return vb(t,i64_new(r,e)),Nn(this.ref,t)}usize(r){return i64_is(r)?this.sizeType==P.I64?this.i64(i64_low(r),i64_high(r)):(assert(i64_is_u32(r)),this.i32(i64_low(r))):this.sizeType==P.I64?this.i64(i32(r)):this.i32(i32(r))}f32(r){let e=this.lit;return md(e,r),Nn(this.ref,e)}f64(r){let e=this.lit;return yd(e,r),Nn(this.ref,e)}v128(r){assert(r.length==16);let e=this.lit;for(let t=0;t<16;++t)qe(e+t,unchecked(r[t]));return gd(e,e),Nn(this.ref,e)}ref_null(r){return Em(this.ref,r)}ref_eq(r,e){return km(this.ref,r,e)}string_eq(r,e){return xp(this.ref,0,r,e)}string_compare(r,e){return xp(this.ref,1,r,e)}unary(r,e){if(r>141){let t=this.sizeType==P.I64;switch(r){case 142:r=t?1:0;break;case 143:r=t?3:2;break;case 144:r=t?5:4;break;case 145:r=t?21:20;break;default:assert(!1)}}return fh(this.ref,r,e)}binary(r,e,t){if(r>216){let i=this.sizeType==P.I64;switch(r){case 217:r=i?25:0;break;case 218:r=i?26:1;break;case 219:r=i?27:2;break;case 220:r=i?28:3;break;case 221:r=i?29:4;break;case 222:r=i?30:5;break;case 223:r=i?31:6;break;case 224:r=i?32:7;break;case 225:r=i?33:8;break;case 226:r=i?34:9;break;case 227:r=i?35:10;break;case 228:r=i?36:11;break;case 229:r=i?37:12;break;case 230:r=i?38:13;break;case 231:r=i?39:14;break;case 232:r=i?40:15;break;case 233:r=i?41:16;break;case 234:r=i?42:17;break;case 235:r=i?43:18;break;case 236:r=i?44:19;break;case 237:r=i?45:20;break;case 238:r=i?46:21;break;case 239:r=i?47:22;break;case 240:r=i?48:23;break;case 241:r=i?49:24;break;default:assert(!1)}}return yh(this.ref,r,e,t)}wide_int_add_sub(r,e,t,i,s){return hh(this.ref,r,e,t,i,s)}wide_int_mul(r,e,t){return mh(this.ref,r,e,t)}memory_size(r=L.DefaultMemory,e=!1){let t=this.allocStringCached(r);return Zd(this.ref,t,e)}memory_grow(r,e=L.DefaultMemory,t=!1){let i=this.allocStringCached(e);return $d(this.ref,r,i,t)}table_size(r){let e=this.allocStringCached(r);return Pm(this.ref,e)}table_grow(r,e,t=0){let i=this.allocStringCached(r);return Nm(this.ref,i,t,e)}local_get(r,e){return qd(this.ref,r,e)}tostack(r){if(this.useShadowStack){let e=dr(r);return assert(e==P.I32||e==P.Unreachable),this.call(g.tostack,[r],e)}return r}local_tee(r,e,t,i=-1){return i==-1&&(i=dr(e)),t&&this.useShadowStack&&(e=this.tostack(e)),Kd(this.ref,r,e,i)}global_get(r,e){let t=this.allocStringCached(r);return Hd(this.ref,t,e)}table_get(r,e,t){let i=this.allocStringCached(r);return Rm(this.ref,i,e,t)}load(r,e,t,i,s=0,a=r,l=L.DefaultMemory){let o=this.allocStringCached(l);return Jd(this.ref,r,e,s,a,i,t,o)}store(r,e,t,i,s=0,a=r,l=L.DefaultMemory){let o=this.allocStringCached(l);return sh(this.ref,r,s,a,e,t,i,o)}atomic_load(r,e,t,i=0,s=L.DefaultMemory,a=1){let l=this.allocStringCached(s);return ih(this.ref,r,i,t,e,l,a)}atomic_store(r,e,t,i,s=0,a=L.DefaultMemory,l=1){let o=this.allocStringCached(a);return lh(this.ref,r,s,e,t,i,o,l)}atomic_rmw(r,e,t,i,s,a,l=L.DefaultMemory,o=1){let u=this.allocStringCached(l);return wh(this.ref,r,e,t,i,s,a,u,o)}atomic_cmpxchg(r,e,t,i,s,a,l=L.DefaultMemory,o=1){let u=this.allocStringCached(l);return Ph(this.ref,r,e,t,i,s,a,u,o)}atomic_wait(r,e,t,i,s=L.DefaultMemory){let a=this.allocStringCached(s);return Mh(this.ref,r,e,t,i,a)}atomic_notify(r,e,t=L.DefaultMemory){let i=this.allocStringCached(t);return Uh(this.ref,r,e,i)}atomic_fence(r=null){let e=this.allocStringCached(r);return qh(this.ref,e)}local_set(r,e,t){return t&&this.useShadowStack&&(e=this.tostack(e)),Wd(this.ref,r,e)}global_set(r,e){let t=this.allocStringCached(r);return jd(this.ref,t,e)}table_set(r,e,t){let i=this.allocStringCached(r);return Cm(this.ref,i,e,t)}block(r,e,t=P.None){let i=this.allocStringCached(r),s=Ee(e),a=Ed(this.ref,i,s,e.length,t);return ie(s),a}flatten(r,e=P.None){let t=r.length;if(t==0)return this.nop();if(t==1){let i=r[0];switch(re(i)){case 19:case 56:case 23:return i}let s=fe(i);return s!=P.Unreachable&&s!=e?this.unreachable():i}return this.block(null,r,e)}br(r,e=0,t=0){let i=this.allocStringCached(r);return wd(this.ref,i,e,t)}drop(r){return Ku(this.ref,r)}maybeDrop(r){let e=dr(r);return e!=P.None&&e!=P.Unreachable?Ku(this.ref,r):r}maybeDropCondition(r,e){return(ks(r,this.ref)&-21)!=0?this.block(null,[this.drop(r),e],fe(e)):e}loop(r,e){let t=this.allocStringCached(r);return kd(this.ref,t,e)}if(r,e,t=0){return Td(this.ref,r,e,t)}nop(){return kh(this.ref)}return(r=0){return Ih(this.ref,r)}select(r,e,t){return Eh(this.ref,t,r,e)}switch(r,e,t,i=0){let s=r.length,a=new Array(s);for(let c=0;c<s;++c)unchecked(a[c]=this.allocStringCached(r[c]));let l=Ee(a),o=this.allocStringCached(e),u=Pd(this.ref,l,s,o,t,i);return ie(l),u}call(r,e,t,i=!1){let s=this.allocStringCached(r),a=Ee(e),l=i?Gd(this.ref,s,a,e?e.length:0,t):Dd(this.ref,s,a,e?e.length:0,t);return ie(a),l}return_call(r,e,t){return this.call(r,e,t,!0)}call_indirect(r,e,t,i,s,a=!1){let l=this.allocStringCached(r??L.DefaultTable),o=Ee(t),u=a?Od(this.ref,l,e,o,t?t.length:0,i,s):Ud(this.ref,l,e,o,t?t.length:0,i,s);return ie(o),u}return_call_indirect(r,e,t,i,s){return this.call_indirect(r,e,t,i,s,!0)}unreachable(){return Fh(this.ref)}memory_copy(r,e,t,i=L.DefaultMemory,s=L.DefaultMemory){let a=this.allocStringCached(i),l=this.allocStringCached(s);return _m(this.ref,r,e,t,a,l)}memory_fill(r,e,t,i=L.DefaultMemory){let s=this.allocStringCached(i);return ym(this.ref,r,e,t,s)}try(r,e,t,i,s=null){let a=t.length,l=new Array(a);for(let d=0;d<a;++d)l[d]=this.allocStringCached(t[d]);let o=Ee(l),u=Ee(i),c=this.allocStringCached(r),f=this.allocStringCached(s),_=Lm(this.ref,c,e,o,a,u,i.length,f);return ie(u),ie(o),_}throw(r,e){let t=this.allocStringCached(r),i=Ee(e),s=zm(this.ref,t,i,e.length);return ie(i),s}rethrow(r){let e=this.allocStringCached(r);return Um(this.ref,e)}pop(r){return Km(this.ref,r)}tuple_make(r){let e=Ee(r),t=Vm(this.ref,e,r.length);return ie(e),t}tuple_extract(r,e){return qm(this.ref,r,e)}simd_extract(r,e,t){return Wh(this.ref,r,e,t)}simd_replace(r,e,t,i){return Hh(this.ref,r,e,t,i)}simd_shuffle(r,e,t){assert(t.length==16);let i=hs(t),s=Xh(this.ref,r,e,i);return ie(i),s}simd_ternary(r,e,t,i){return Yh(this.ref,r,e,t,i)}simd_shift(r,e,t){return rm(this.ref,r,e,t)}simd_load(r,e,t,i,s=L.DefaultMemory){let a=this.allocStringCached(s);return sm(this.ref,r,t,i,e,a)}simd_loadstorelane(r,e,t,i,s,a,l=L.DefaultMemory){let o=this.allocStringCached(l);return lm(this.ref,r,t,i,s,e,a,o)}ref_is_null(r){return Am(this.ref,r)}ref_as(r,e){return vc(this.ref,r,e)}ref_as_nonnull(r){return $b(fe(r))?vc(this.ref,0,r):r}ref_func(r,e){let t=this.allocStringCached(r);return vm(this.ref,t,_r(e))}i31_new(r){return Hm(this.ref,r)}i31_get(r,e){return Qm(this.ref,r,e)}addGlobal(r,e,t,i){let s=this.allocStringCached(r);return tg(this.ref,s,e,t,i)}getGlobal(r){let e=this.allocStringCached(r);return wp(this.ref,e)}removeGlobal(r){let e=this.allocStringCached(r);return wp(this.ref,e)?(rg(this.ref,e),!0):!1}addTag(r,e,t){let i=this.allocStringCached(r);return og(this.ref,i,e,t)}getTag(r){let e=this.allocStringCached(r);return ug(this.ref,e)}removeTag(r){let e=this.allocStringCached(r);cg(this.ref,e)}addFunction(r,e,t,i,s){let a=this.allocStringCached(r),l=Ee(i),o=Ln(this.ref,a,e,t,l,i?i.length:0,s);return ie(l),o}setLocalName(r,e,t){Uy(r,e,this.allocStringCached(t))}getFunction(r){let e=this.allocStringCached(r);return Bn(this.ref,e)}removeFunction(r){let e=this.allocStringCached(r);$i(this.ref,e)}hasFunction(r){let e=this.allocStringCached(r);return Bn(this.ref,e)!=0}addTemporaryFunction(r,e,t){this.hasTemporaryFunction=assert(!this.hasTemporaryFunction);let i=this.allocStringCached(""),s=Ee(e),a=Ln(this.ref,i,it(e),r,0,0,t);return ie(s),a}removeTemporaryFunction(){this.hasTemporaryFunction=!assert(this.hasTemporaryFunction);let r=this.allocStringCached("");$i(this.ref,r)}setStart(r){gg(this.ref,r)}addFunctionExport(r,e){let t=this.allocStringCached(r),i=this.allocStringCached(e);return Qa(this.ref,t,i)}addTableExport(r,e){let t=this.allocStringCached(r),i=this.allocStringCached(e);return Qy(this.ref,t,i)}addMemoryExport(r,e){let t=this.allocStringCached(r),i=this.allocStringCached(e);return Xy(this.ref,t,i)}addGlobalExport(r,e){let t=this.allocStringCached(r),i=this.allocStringCached(e);return Zy(this.ref,t,i)}addTagExport(r,e){let t=this.allocStringCached(r),i=this.allocStringCached(e);return $y(this.ref,t,i)}removeExport(r){let e=this.allocStringCached(r);Za(this.ref,e)}hasExport(r){let e=this.allocStringCached(r);return Xa(this.ref,e)!=0}addFunctionImport(r,e,t,i,s){let a=this.allocStringCached(r),l=this.allocStringCached(e),o=this.allocStringCached(t);qy(this.ref,a,l,o,i,s)}addTableImport(r,e,t){let i=this.allocStringCached(r),s=this.allocStringCached(e),a=this.allocStringCached(t);Wy(this.ref,i,s,a)}addMemoryImport(r,e,t,i=!1){let s=this.allocStringCached(r),a=this.allocStringCached(e),l=this.allocStringCached(t);Ky(this.ref,s,a,l,i)}addGlobalImport(r,e,t,i,s=!1){let a=this.allocStringCached(r),l=this.allocStringCached(e),o=this.allocStringCached(t);Hy(this.ref,a,l,o,i,s)}addTagImport(r,e,t,i,s){let a=this.allocStringCached(r),l=this.allocStringCached(e),o=this.allocStringCached(t);jy(this.ref,a,l,o,i,s)}static{this.UNLIMITED_MEMORY=-1}setMemory(r,e,t,i,s=null,a=L.DefaultMemory,l=!1){let o=this.allocStringCached(s),u=this.allocStringCached(a),c=t.length,f=new Array(c),_=new Uint8Array(c),d=new Array(c),m=new Array(c);for(let k=0;k<c;++k){let w=unchecked(t[k]),R=w.buffer,C=w.offset;unchecked(f[k]=hs(R)),unchecked(_[k]=0),unchecked(d[k]=i==2?this.i64(i64_low(C),i64_high(C)):this.i32(i64_low(C))),unchecked(m[k]=R.length)}let h=Ee(f),b=hs(_),A=Ee(d),S=tf(m);yg(this.ref,r,e,o,0,h,b,A,S,c,l,!1,u),ie(S),ie(A),ie(b),ie(h);for(let k=c-1;k>=0;--k)ie(unchecked(f[k]))}static{this.UNLIMITED_TABLE=-1}addFunctionTable(r,e,t,i,s){let a=this.allocStringCached(r),l=i.length,o=new Array(l);for(let f=0;f<l;++f)unchecked(o[f]=this.allocStringCached(i[f]));let u=Ee(o),c=Cp(this.ref,a);c?(dg(c,e),hg(c,t)):c=Rp(this.ref,a,e,t,P.funcref()),mg(this.ref,a,a,u,l,s),ie(u)}ensureFunctionTable(r){let e=this.allocStringCached(r);Cp(this.ref,e)||Rp(this.ref,e,0,n.UNLIMITED_TABLE,P.funcref())}addCustomSection(r,e){let t=this.allocStringCached(r),i=hs(e);Cg(this.ref,t,i,e.length),ie(i)}getOptimizeLevel(){return Qg()}setOptimizeLevel(r){Xg(r)}getShrinkLevel(){return Zg()}setShrinkLevel(r){$g(r)}getDebugInfo(){return Yg()}setDebugInfo(r){Jg(r)}getTrapsNeverHappen(){return eb()}setTrapsNeverHappen(r){tb(r)}getClosedWorld(){return rb()}setClosedWorld(r){nb(r)}getLowMemoryUnused(){return ib()}setLowMemoryUnused(r){sb(r)}getZeroFilledMemory(){return ab()}setZeroFilledMemory(r){lb(r)}getFastMath(){return ob()}setFastMath(r){ub(r)}getGenerateStackIR(){return cb()}setGenerateStackIR(r){pb(r)}getOptimizeStackIR(){return fb()}setOptimizeStackIR(r){_b(r)}getPassArgument(r){let e=this.allocStringCached(r),t=db(e);return t?Ye(t):null}setPassArgument(r,e){let t=this.allocStringCached(r),i=this.allocStringCached(e);hb(t,i)}clearPassArguments(){mb()}getAlwaysInlineMaxSize(){return yb()}setAlwaysInlineMaxSize(r){gb(r)}getFlexibleInlineMaxSize(){return bb()}setFlexibleInlineMaxSize(r){xb(r)}getOneCallerInlineMaxSize(){return Eb()}setOneCallerInlineMaxSize(r){Ab(r)}getAllowInliningFunctionsWithLoops(){return Tb()}setAllowInliningFunctionsWithLoops(r){Sb(r)}setPartialInliningIfs(r){this.setPassArgument("partial-inlining-ifs",r.toString())}getFeatures(){return wg(this.ref)}setFeatures(r){r&16&&(r|=524288),Rg(this.ref,r)}runPasses(r,e=0){let t=r.length,i=new Array(t);for(let a=0;a<t;++a)i[a]=No(r[a]);let s=Ee(i);e?Vy(e,this.ref,s,t):xg(this.ref,s,t),ie(s);for(let a=t-1;a>=0;--a)ie(i[a])}optimize(r,e,t=!1,i=!1){(r>=3||e>=2)&&(r=4),this.clearPassArguments(),this.setOptimizeLevel(r),this.setShrinkLevel(e),this.setDebugInfo(t),this.setZeroFilledMemory(i),this.setFastMath(!0);let s=r>=2||e>=1;if(this.setGenerateStackIR(s),this.setOptimizeStackIR(s),r>=2&&e==0?(this.setAlwaysInlineMaxSize(12),this.setFlexibleInlineMaxSize(70),this.setOneCallerInlineMaxSize(200),this.setAllowInliningFunctionsWithLoops(!0)):(this.setAlwaysInlineMaxSize(r<=1||e>=2?2:6),this.setFlexibleInlineMaxSize(65),this.setOneCallerInlineMaxSize(80),this.setAllowInliningFunctionsWithLoops(!1)),this.setPartialInliningIfs(r>=2?4:0),r>0||e>0){let a=new Array;a.push("duplicate-function-elimination"),a.push("remove-unused-module-elements"),r>=2&&a.push("once-reduction"),(r>=2||e>=1)&&(a.push("inlining"),a.push("simplify-globals-optimizing"),a.push("generate-global-effects")),(r>=3||e>=1)&&(a.push("rse"),a.push("vacuum"),a.push("code-folding"),a.push("ssa-nomerge"),a.push("local-cse"),a.push("remove-unused-brs"),a.push("remove-unused-names"),a.push("merge-blocks"),a.push("precompute-propagate"),a.push("simplify-globals-optimizing"),a.push("dae-optimizing")),r>=3&&(a.push("simplify-locals-nostructure"),a.push("flatten"),a.push("vacuum"),a.push("simplify-locals-notee-nostructure"),a.push("vacuum"),a.push("local-cse"),a.push("licm"),a.push("merge-locals"),a.push("reorder-locals")),a.push("optimize-instructions"),r>=2&&a.push("avoid-reinterprets"),a.push("dce"),a.push("remove-unused-brs"),a.push("remove-unused-names"),a.push("merge-blocks"),this.getFeatures()&512&&a.push("tuple-optimization"),r>=3||e>=2?(a.push("inlining"),a.push("precompute-propagate"),a.push("simplify-globals-optimizing")):r>=2||e>=1?a.push("precompute-propagate"):a.push("precompute"),(r>=2||e>=1)&&a.push("pick-load-signs"),a.push("simplify-locals-notee-nostructure"),a.push("vacuum"),(r>=2||e>=1)&&a.push("local-cse"),a.push("reorder-locals"),a.push("coalesce-locals"),a.push("simplify-locals"),a.push("coalesce-locals"),a.push("reorder-locals"),a.push("vacuum"),(r>=2||e>=1)&&(a.push("rse"),a.push("vacuum")),e>=1&&(a.push("merge-locals"),a.push("vacuum")),(r>=2||e>=1)&&(a.push("simplify-globals-optimizing"),a.push("simplify-globals-optimizing")),a.push("remove-unused-brs"),a.push("remove-unused-names"),a.push("merge-blocks"),r>=3&&a.push("optimize-instructions"),(r>=2||e>=1)&&(a.push("simplify-globals-optimizing"),a.push("dae-optimizing")),(r>=2||e>=2)&&a.push("inlining-optimizing"),this.getLowMemoryUnused()&&(r>=3||e>=1?a.push("optimize-added-constants-propagate"):a.push("optimize-added-constants")),a.push("duplicate-import-elimination"),r>=2||e>=2?a.push("simplify-globals-optimizing"):(a.push("simplify-globals"),a.push("vacuum")),r>=2&&(this.getFeatures()&1024)!=0&&(a.push("heap2local"),a.push("merge-locals"),a.push("local-subtyping")),r>=2||e>=1?(a.push("precompute-propagate"),a.push("simplify-globals-optimizing"),a.push("simplify-globals-optimizing")):a.push("precompute"),a.push("directize"),a.push("dae-optimizing"),(r>=3||e>=1)&&a.push("gufa-optimizing"),a.push("inlining-optimizing"),(r>=2||e>=1)&&(a.push("code-folding"),a.push("ssa-nomerge"),a.push("rse"),a.push("code-pushing"),r>=3&&(a.push("simplify-globals"),a.push("vacuum"),a.push("precompute-propagate"),a.push("inlining-optimizing"),a.push("directize"),a.push("dae-optimizing"),a.push("local-cse"),a.push("merge-locals"),a.push("coalesce-locals"),a.push("simplify-locals"),a.push("vacuum"),a.push("inlining"),a.push("precompute-propagate"),a.push("rse"),a.push("vacuum"),a.push("ssa-nomerge"),a.push("simplify-locals"),a.push("coalesce-locals")),a.push("optimize-instructions"),a.push("remove-unused-brs"),a.push("remove-unused-names"),a.push("merge-blocks"),a.push("vacuum"),this.getFeatures()&16384&&a.push("string-gathering"),a.push("simplify-globals-optimizing"),a.push("remove-unused-brs"),a.push("optimize-instructions"),a.push("vacuum")),a.push("reorder-globals"),a.push("reorder-functions"),(r>=2||e>=1)&&a.push("duplicate-function-elimination"),e>=2&&a.push("merge-similar-functions"),a.push("memory-packing"),a.push("remove-unused-module-elements"),(r>=2||e>=1)&&a.push("discard-global-effects"),this.runPasses(a)}}validate(){return bg(this.ref)==1}interpret(){Ig(this.ref)}toBinary(r=null){assert(Gu()>=Eg());let e=this.lit,t=No(r);Ag(e,this.ref,t);let i=gr(e+0),s=gr(e+4),a=gr(e+8),l=new Bo(z1(assert(i),s),Ye(a));return t&&ie(t),a&&ie(a),ie(i),l}toText(r=!0){let e=r?Sg(this.ref):Tg(this.ref),t=Ye(e);return e&&ie(e),t||""}allocStringCached(r){if(r==null)return 0;let e=this.cachedStringsToPointers;if(e.has(r))return changetype(e.get(r));let t=No(r);return e.set(r,t),t}readStringCached(r){if(r==0)return null;let e=this.cachedPointersToStrings;if(e.has(r))return changetype(e.get(r));let t=Ye(r);return e.set(r,t),t}dispose(){assert(this.ref);for(let r=Map_values(this.cachedStringsToPointers),e=0,t=r.length;e<t;++e){let i=unchecked(r[e]);ie(i)}this.cachedStringsToPointers.clear(),this.cachedPointersToStrings.clear(),ie(this.lit),dd(this.ref),this.ref=0}createRelooper(){return Lo.create(this)}tryCopyTrivialExpression(r){return this.isTrivialExpression(r)?this.copyExpression(r):0}isTrivialExpression(r){switch(Kt(r)){case 8:case 10:case 14:case 20:case 22:case 23:case 38:case 42:return!0}return!1}copyExpression(r){return bd(r,this.ref)}runExpression(r,e,t=50,i=1){let s=Gg(this.ref,e,t,i),a=Ug(s,r);if(a){if(!this.isConstExpression(a))return 0;assert(fe(a)==fe(r))}return a}isConstExpression(r){switch(re(r)){case 14:case 42:case 44:case 61:return!0;case 16:{if(this.getFeatures()&8192)switch(ri(r)){case 0:case 1:case 2:case 25:case 26:case 27:return this.isConstExpression(at(r))&&this.isConstExpression(We(r))}break}}return!1}addDebugInfoFile(r){let e=No(r),t=kg(this.ref,e);return ie(e),t}getDebugInfoFile(r){return Ye(Fg(this.ref,r))}setDebugLocation(r,e,t,i,s){Oy(r,e,t,i,s)}};function it(n){if(!n)return P.None;switch(n.length){case 0:return P.None;case 1:return n[0]}let r=Ee(n),e=Q_(r,n.length);return ie(r),e}function ff(n){let r=X_(n),e=kt(r<<2);Z_(n,e);let t=new Array(r);for(let i=0;i<r;++i)unchecked(t[i]=gr(e+(i<<2)));return ie(e),t}function $b(n){return $_(n)}function re(n){return Kt(n)}function fe(n){return dr(n)}function ae(n){return oh(n)}function Ne(n){return i64_low(Bp(n))}function Ge(n){return i64_high(Bp(n))}function _f(n,r){let e=0,t=0;return r?(e=Ne(n),t=Ge(n)):e=ae(n),i64_new(e,t)}function Ce(n){return uh(n)}function Pe(n){return ch(n)}function df(n){let r=kt(16);ph(n,r);let e=new Uint8Array(16);for(let t=0;t<16;++t)e[t]=Or(r+t);return ie(r),e}function st(n){if(re(n)!=14)return!1;let r=fe(n);return r==P.I32?ae(n)==0:r==P.I64?(Ne(n)|Ge(n))==0:r==P.F32?Ce(n)==0:r==P.F64?Pe(n)==0:!1}function xt(n){if(re(n)!=14)return!1;let r=fe(n);return r==P.I32?ae(n)!=0:r==P.I64?(Ne(n)|Ge(n))!=0:r==P.F32?Ce(n)!=0:r==P.F64?Pe(n)!=0:!1}function Do(n){if(re(n)!=14)return!1;let r=fe(n);if(r==P.F32){let e=Ce(n);return e==0&&f32_as_i32(e)<0}if(r==P.F64){let e=Pe(n);return e==0&&i64_signbit(f64_as_i64(e))}return!1}function c1(n){if(re(n)!=14)return!1;let r=fe(n);return r==P.F32?isNaN(Ce(n)):r==P.F64?isNaN(Pe(n)):!1}function Go(n,r){let e=re(r),t=fe(r);if(t==P.F32||t==P.F64){if(e==14)return isNaN(t==P.F32?Ce(r):Pe(r));if(e==10){let i=n.runExpression(r,0,8);if(i)return isNaN(t==P.F32?Ce(i):Pe(i))}}return!1}function Pt(n){return za(n)}function Uo(n){return Pn(n)}function Vo(n){return Gr(n)}function bs(n){return Da(n)}function xs(n){return Ye(Ua(n))}function ri(n){return gh(n)}function at(n){return Ki(n)}function We(n){return Hi(n)}function Es(n){return _h(n)}function Oo(n){return Wi(n)}function hf(n){return rh(n)}function p1(n){return th(n)}function f1(n){return Oi(n)}function mf(n){return eh(n)}function _1(n){return Va(n)}function d1(n){return Oa(n)}function h1(n){return Ur(n)}function m1(n){return qi(n)}function As(n){return Ye(Pa(n))}function Ts(n){return Pi(n)}function Ss(n,r){return Ni(n,r)}function qo(n){return Li(n)}function vs(n){return Bi(n)}function ni(n){return Mi(n)}function y1(n){return Ye(Na(n))}function g1(n){return zi(n)}function b1(n){return Ye(La(n))}function x1(n){return Di(n)}function yf(n){return ji(n)}function gf(n){return Qi(n)}function E1(n){return Xi(n)}function A1(n){return Zi(n)}function T1(n){return Vr(n)}function Is(n){return Ye(Cn(n))}function Nt(n){return hr(n)}function Je(n,r){return mr(n,r)}function S1(n){return Vi(n)}function v1(n){return yr(n)}function bf(n){return Ye(Mn(n))}function I1(n){return Yi(n)}function k1(n){return Ji(n)}function F1(n){let r=Ka(n),e=new Array(r);for(let t=0;t<r;++t)unchecked(e[t]=Ha(n,t));return e}function w1(n){return Ye(sg(n))}function R1(n){return ag(n)}function xf(n){return lg(n)}function C1(n){return $a(n)}function P1(n){return Ye(pg(n))}function N1(n){return fg(n)}function L1(n){return _g(n)}var Lo=class n{constructor(r,e){this.module=r;this.ref=e}static create(r){return new n(r,Ng(r.ref))}addBlock(r){return Lg(this.ref,r)}addBranch(r,e,t=0,i=0){Bg(r,e,t,i)}addBlockWithSwitch(r,e){return Mg(this.ref,r,e)}addBranchForSwitch(r,e,t,i=0){let s=B1(t);zg(r,e,s,t.length,i),ie(s)}renderAndDispose(r,e){return Dg(this.ref,r,e)}},ys=class{constructor(r,e){this.values=new Array;this.indexes=new Array;this.cases=new Array;this.defaultIndex=-1;this.module=r,this.condition=e}addOrReplaceCase(r,e){let t=this.values.indexOf(r),i=this.addCode(e);t>=0?this.indexes[t]=i:(this.values.push(r),this.indexes.push(i))}addCase(r,e){this.values.push(r),this.indexes.push(this.addCode(e))}addCode(r){let e=this.cases,t=e.indexOf(r);return t<0&&(t=e.length,e.push(r)),t}addDefault(r){assert(this.defaultIndex==-1);let e=this.cases;this.defaultIndex=e.length,e.push(r)}render(r,e=""){let t=this.module,i=this.cases,s=i.length;if(!s)return t.drop(this.condition);let a=this.values,l=a.length,o=this.indexes,u=new Array(1+l+1),c=new Array(s);for(let h=0;h<s;++h)unchecked(c[h]=`case${h}${e}`);u[0]=t.local_set(r,this.condition,!1);for(let h=0;h<l;++h){let b=unchecked(o[h]);unchecked(u[1+h]=t.br(c[b],t.binary(15,t.local_get(r,P.I32),t.i32(a[h]))))}let f=this.defaultIndex,_=`default${e}`;u[1+l]=t.br(~f?c[f]:_);let d=t.block(c[0],u);for(let h=1;h<s;++h){let b=i[h-1];b.unshift(d),d=t.block(unchecked(c[h]),b)}let m=i[s-1];return m.unshift(d),t.block(~f?null:_,m)}},Ef=(A=>(A[A.None=0]="None",A[A.Branches=1]="Branches",A[A.Calls=2]="Calls",A[A.ReadsLocal=4]="ReadsLocal",A[A.WritesLocal=8]="WritesLocal",A[A.ReadsGlobal=16]="ReadsGlobal",A[A.WritesGlobal=32]="WritesGlobal",A[A.ReadsMemory=64]="ReadsMemory",A[A.WritesMemory=128]="WritesMemory",A[A.ReadsTable=256]="ReadsTable",A[A.WritesTable=512]="WritesTable",A[A.ImplicitTrap=1024]="ImplicitTrap",A[A.IsAtomic=2048]="IsAtomic",A[A.Throws=4096]="Throws",A[A.DanglingPop=8192]="DanglingPop",A[A.TrapsNeverHappen=16384]="TrapsNeverHappen",A[A.Any=32767]="Any",A))(Ef||{});function ks(n,r){return Pg(n,r)}function Wo(n,r){return(ks(n,r)&-21)!=0}function hs(n){if(!n)return 0;let r=n.length,e=kt(r);for(let t=0;t<r;++t)qe(e+t,unchecked(n[t]));return e}function B1(n){if(!n)return 0;let r=n.length,e=kt(r<<2),t=e;for(let i=0;i<r;++i){let s=unchecked(n[i]);Ja(t,s),t+=4}return e}function tf(n){if(!n)return 0;let r=n.length,e=kt(r<<2),t=e;for(let i=0;i<r;++i){let s=unchecked(n[i]);Ja(t,s),t+=4}return e}function Ee(n){if(!n)return 0;assert(ASC_TARGET!=2);let r=n.length,e=kt(r<<2),t=e;for(let i=0,s=r;i<s;++i){let a=unchecked(n[i]);Ja(t,a),t+=4}return e}function M1(n){let r=0;for(let e=0,t=n.length;e<t;++e){let i=n.charCodeAt(e)>>>0;i<=127?r+=1:i<=2047?r+=2:Hn(i)&&e+1<t&&cl(n.charCodeAt(e+1))?(e++,r+=4):r+=3}return r}function No(n){if(n==null)return 0;let r=M1(n),e=kt(r+1)>>>0,t=e;if(r==n.length)for(let i=0,s=n.length;i<s;++i){let a=n.charCodeAt(i)>>>0;qe(t++,a)}else for(let i=0,s=n.length;i<s;++i){let a=n.charCodeAt(i)>>>0,l;a<=127?qe(t++,a):a<=2047?(qe(t++,192|a>>>6),qe(t++,128|a&63)):Hn(a)&&i+1<s&&cl(l=n.charCodeAt(i+1))?(a=is(a,l),++i,qe(t++,240|a>>>18),qe(t++,128|a>>>12&63),qe(t++,128|a>>>6&63),qe(t++,128|a&63)):(qe(t++,224|a>>>12),qe(t++,128|a>>>6&63),qe(t++,128|a&63))}return qe(t,0),e}function z1(n,r){let e=new Uint8Array(r);for(let t=0;t<r;++t)unchecked(e[t]=Or(n+t));return e}function Ye(n){if(!n)return null;let r=new Array,e,t,i,s;for(;e=Or(n++);){if(!(e&128)){r.push(e);continue}if(t=Or(n++)&63,(e&224)==192){r.push((e&31)<<6|t);continue}if(i=Or(n++)&63,(e&240)==224?e=(e&15)<<12|t<<6|i:(s=Or(n++)&63,(e&248)==240?e=(e&7)<<18|t<<12|i<<6|s:assert(!1,"Invalid UTF8 sequence during readString")),e<65536)r.push(e);else{let a=e-65536;r.push(ns|a>>>10),r.push(Kn|a&1023)}}return String.fromCharCodes(r)}var Bo=class{constructor(r,e){this.output=r;this.sourceMap=e}},Yt=!1;function Fs(n){if(n==p.void)return P.None;let r=Yb(n);if(r)return r;let e=n;if(n=n.nonNullableType,r=n.ref)return Ae(_r(r),e.is(512));ASC_TARGET&&assert(sizeof()==4);let t=Vg(0),i=new Map;xr(t,i,n);let s=Ya(t),a=kt(max(4*s,8));if(!Kg(t,a,a,a+4)){let l=gr(a),o=gr(a+4);throw ie(a),new Error(`type builder error at index ${l}: ${rf.toString(o)}`)}for(let l=Map_keys(i),o=0,u=l.length;o<u;++o){let c=l[o];assert(!c.is(512));let f=gr(a+4*o),_=Ae(f,!1);assert(!c.ref),c.ref=_,Yt&&console.log(` set ${c.toString()}`);let d=c.getClass();if(d){let m=d.program.module;Hg(m.ref,f,m.allocStringCached(d.internalName));let h=d.members;if(h){let b=fd(f),A=0;for(let S=Map_values(h),k=0,w=S.length;k<w;++k){let R=S[k];if(R.kind!=10)continue;let C=R.instance;!C||!C.isField||jg(m.ref,f,A++,m.allocStringCached(C.name))}assert(b==A)}}}return ie(a),Yt&&console.log(` finalize ${n.toString()}`),r=assert(n.ref),Ae(_r(r),e.is(512))}function Yb(n){switch(n.kind){case 0:case 1:case 6:case 2:case 7:case 3:case 8:return P.I32;case 4:case 9:return P.I64;case 5:case 10:{if(n.isInternalReference)break;return n.size==64?P.I64:P.I32}case 11:return P.F32;case 12:return P.F64;case 13:return P.V128;case 16:return Ae(Ie.Func,n.is(512));case 15:return Ae(Ie.Extern,n.is(512));case 17:return Ae(Ie.Any,n.is(512));case 18:return Ae(Ie.Eq,n.is(512));case 19:return Ae(Ie.Struct,n.is(512));case 20:return Ae(Ie.Array,n.is(512));case 21:return Ae(Ie.I31,n.is(512));case 22:return Ae(Ie.String,n.is(512));case 26:assert(!1)}return 0}function D1(n){switch(n.kind){case 0:case 1:case 6:return ms.I8;case 2:case 7:return ms.I16}return ms.NotPacked}function xr(n,r,e){if(e==p.void)return P.None;let t=Yb(e);if(t||(assert(!e.is(512)),t=e.ref))return t;if(r.has(e))return Yt&&console.log(` prepare ${e.toString()} (seen)`),changetype(r.get(e));Yt&&console.log(`prepare ${e.toString()}`);let i=e.getClass();if(i){let a=i.base,l=0;a&&(l=xr(n,r,a.type));let o=Ya(n);Pp(n,1),Yt&&console.log(` block [${o}]: ${e.toString()}`);let u=Np(n,o);t=zn(n,u,!1),r.set(e,t);let c=new Array,f=new Array,_=new Array,d=i.members;if(d)for(let A=Map_values(d),S=0,k=A.length;S<k;++S){let w=A[S];if(w.kind!=10)continue;let R=w.instance;if(!R||!R.isField)continue;let C=R.type;Yt&&console.log(` field ${C.toString()}`),C.is(512)?c.push(zn(n,_r(xr(n,r,C.nonNullableType)),!0)):c.push(xr(n,r,C)),f.push(D1(C)),_.push(1)}let m=Ee(c),h=tf(f),b=tf(_);return Yt&&console.log(` concretize [${o}]: ${e.toString()}`),qg(n,o,m,h,b,c.length),a&&(Yt&&console.log(` set super [${o}]: ${e.toString()} <: ${a.type.toString()} ${l==a.type.ref?" (known)":""}`),Wg(n,o,_r(l))),ie(b),ie(h),ie(m),t}let s=e.getSignature();if(s){let a=Ya(n);Pp(n,1);let l=zn(n,Np(n,a),!1);r.set(e,l);let o=new Array,u=new Array,c=s.parameterTypes;for(let m=0,h=c.length;m<h;++m){let b=c[m];b.is(512)?o.push(zn(n,_r(xr(n,r,b.nonNullableType)),!0)):o.push(xr(n,r,b))}let f=s.returnType;u.push(f==p.void?P.None:f.is(512)?zn(n,_r(xr(n,r,f.nonNullableType)),!0):xr(n,r,f));let _;if(o.length>1){let m=Ee(o);_=Lp(n,m,o.length),ie(m)}else _=o.length?o[0]:P.None;let d;if(u.length>1){let m=Ee(u);d=Lp(n,m,u.length),ie(m)}else d=u[0];return Yt&&console.log(` concretize [${a}]: ${e.toString()}`),Og(n,a,_,d),l}throw new Error(`unexpected complex type: ${e.toString()}`)}var Ho=(R=>(R[R.None=0]="None",R[R.Returns=1]="Returns",R[R.ReturnsWrapped=2]="ReturnsWrapped",R[R.ReturnsNonNull=4]="ReturnsNonNull",R[R.Throws=8]="Throws",R[R.Breaks=16]="Breaks",R[R.Continues=32]="Continues",R[R.AccessesThis=64]="AccessesThis",R[R.CallsSuper=128]="CallsSuper",R[R.Terminates=256]="Terminates",R[R.ConditionallyReturns=512]="ConditionallyReturns",R[R.ConditionallyThrows=1024]="ConditionallyThrows",R[R.ConditionallyBreaks=2048]="ConditionallyBreaks",R[R.ConditionallyContinues=4096]="ConditionallyContinues",R[R.ConditionallyAccessesThis=8192]="ConditionallyAccessesThis",R[R.MayReturnNonThis=16384]="MayReturnNonThis",R[R.UncheckedContext=32768]="UncheckedContext",R[R.CtorParamContext=65536]="CtorParamContext",R[R.InlineContext=131072]="InlineContext",R[R.AnyCategorical=511]="AnyCategorical",R[R.AnyConditional=15872]="AnyConditional",R))(Ho||{}),ws=(s=>(s[s.None=0]="None",s[s.Constant=1]="Constant",s[s.Wrapped=2]="Wrapped",s[s.NonNull=4]="NonNull",s[s.Initialized=8]="Initialized",s))(ws||{}),Af=(e=>(e[e.None=0]="None",e[e.Initialized=1]="Initialized",e))(Af||{}),Tf=(t=>(t[t.Unknown=0]="Unknown",t[t.True=1]="True",t[t.False=2]="False",t))(Tf||{}),er=class n{constructor(r,e=null){this.targetFunction=r;this.inlineFunction=e;this.parent=null;this.outer=null;this.flags=0;this.continueLabel=null;this.breakLabel=null;this.scopedLocals=null;this.scopedTypeAlias=null;this.localFlags=[];this.thisFieldFlags=null;this.inlineReturnLabel=null;this.trueFlows=null;this.falseFlows=null}static createDefault(r){let e=new n(r);return r.is(524288)&&e.initThisFieldFlags(),r.program.options.uncheckedBehavior===2&&e.set(32768),e}static createInline(r,e){let t=new n(r,e);return t.inlineReturnLabel=`${e.internalName}|inlined.${e.nextInlineId++}`,e.is(524288)&&t.initThisFieldFlags(),r.program.options.uncheckedBehavior===2&&t.set(32768),t}get isInline(){return this.inlineFunction!=null}get sourceFunction(){let r=this.inlineFunction;return r||this.targetFunction}get program(){return this.targetFunction.program}get returnType(){return this.sourceFunction.signature.returnType}get contextualTypeArguments(){return this.sourceFunction.contextualTypeArguments}is(r){return(this.flags&r)==r}isAny(r){return(this.flags&r)!=0}set(r){this.flags|=r}unset(r){this.flags&=~r}deriveConditionalFlags(){let r=this.flags&15872;return this.is(1)&&(r|=512),this.is(8)&&(r|=1024),this.is(16)&&(r|=2048),this.is(32)&&(r|=4096),this.is(64)&&(r|=8192),r}fork(r=!1,e=r){let t=new n(this.targetFunction,this.inlineFunction);if(t.parent=this,t.flags=this.flags,t.outer=this.outer,r?t.flags&=-2065:t.breakLabel=this.breakLabel,e?t.flags&=-4129:t.continueLabel=this.continueLabel,t.localFlags=this.localFlags.slice(),this.sourceFunction.is(524288)){let i=assert(this.thisFieldFlags);t.thisFieldFlags=me(i)}else assert(!this.thisFieldFlags);return t.inlineReturnLabel=this.inlineReturnLabel,t}forkThen(r,e=!1,t=e){let i=this.fork(e,t),s=this.trueFlows;return s&&s.has(r)&&i.inherit(changetype(s.get(r))),i.inheritNonnullIfTrue(r),i}noteThen(r,e){let t=this.trueFlows;t||(this.trueFlows=t=new Map),t.set(r,e)}forkElse(r){let e=this.fork(),t=this.falseFlows;return t&&t.has(r)&&e.inherit(changetype(t.get(r))),e.inheritNonnullIfFalse(r),e}noteElse(r,e){let t=this.falseFlows;t||(this.falseFlows=t=new Map),t.set(r,e)}addScopedTypeAlias(r,e){let t=this.scopedTypeAlias;t||(this.scopedTypeAlias=t=new Map),t.set(r,e)}lookupScopedTypeAlias(r){let e=this;do{let t=e.scopedTypeAlias;if(t&&t.has(r))return assert(t.get(r));e=e.parent}while(e);return null}lookupTypeAlias(r){let e=null;if(e=this.lookupScopedTypeAlias(r))return e;let t=this.sourceFunction.parent;return t.kind==5?t.flow.lookupTypeAlias(r):null}getTempLocal(r){let e=this.targetFunction.addLocal(r);return this.unsetLocalFlag(e.index,-1),e}getScopedLocal(r){let e=this.scopedLocals;return e&&e.has(r)?assert(e.get(r)):null}addScopedLocal(r,e){let t=this.getTempLocal(e);t.name=r,t.internalName=Ke(r,t.parent,!1);let i=this.scopedLocals;return i?assert(!i.has(r)):this.scopedLocals=i=new Map,t.set(67108864),i.set(r,t),t}addScopedDummyLocal(r,e,t){let i=new pe(r,-1,e,this.targetFunction),s=this.scopedLocals;return s?s.has(r)&&this.program.error(2451,t.range,r):this.scopedLocals=s=new Map,i.set(67108864),s.set(r,i),i}addScopedAlias(r,e,t,i=null){let s=this.scopedLocals;if(!s)this.scopedLocals=s=new Map;else if(s.has(r)){let l=assert(s.get(r));return i&&(l.declaration.range.source.isNative?this.program.error(2300,i.range,r):this.program.errorRelated(2300,i.range,l.declaration.name.range,r)),l}assert(t<this.targetFunction.localsByIndex.length);let a=new pe(r,t,e,this.targetFunction);return a.set(67108864),s.set(r,a),a}freeScopedDummyLocal(r){let e=assert(this.scopedLocals);assert(e.has(r));let t=assert(e.get(r));assert(t.index==-1),e.delete(r)}lookupLocal(r){let e=this;do{let t=e.scopedLocals;if(t&&t.has(r))return assert(t.get(r));e=e.parent}while(e);return null}lookup(r){let e=this.lookupLocal(r);return e||this.sourceFunction.lookup(r)}isLocalFlag(r,e,t=!0){if(r<0)return t;let i=this.localFlags;return r<i.length&&(unchecked(i[r])&e)==e}isAnyLocalFlag(r,e,t=!0){if(r<0)return t;let i=this.localFlags;return r<i.length&&(unchecked(i[r])&e)!=0}setLocalFlag(r,e){if(r<0)return;let t=this.localFlags,i=r<t.length?unchecked(t[r]):0;t[r]=i|e}unsetLocalFlag(r,e){if(r<0)return;let t=this.localFlags,i=r<t.length?unchecked(t[r]):0;t[r]=i&~e}initThisFieldFlags(){let r=this.sourceFunction;assert(r.is(524288));let e=r.parent;assert(e.kind==7);let t=e;this.thisFieldFlags=new Map;let i=t.members;if(i)for(let s=Map_values(i),a=0,l=s.length;a<l;++a){let o=s[a];if(o.kind!=10)continue;let u=o.instance;!u||!u.isField||(u.prototype.parent!=t||u.initializerNode||u.prototype.parameterIndex!=-1||u.type.isAny(640)||u.type.kind==27)&&this.setThisFieldFlag(u,1)}}isThisFieldFlag(r,e){let t=this.thisFieldFlags;return t!=null&&t.has(r)?(changetype(t.get(r))&e)==e:!1}setThisFieldFlag(r,e){let t=this.thisFieldFlags;if(t)if(assert(this.sourceFunction.is(524288)),t.has(r)){let i=changetype(t.get(r));t.set(r,i|e)}else t.set(r,e);else assert(!this.sourceFunction.is(524288))}pushControlFlowLabel(){let r=this.targetFunction,e=r.nextBreakId++,t=r.breakStack;return t?t.push(e):r.breakStack=[e],e}popControlFlowLabel(r){let e=this.targetFunction,t=assert(e.breakStack);assert(t.length),assert(t.pop()==r)}inherit(r){assert(r.targetFunction==this.targetFunction);let e=r.flags;this.breakLabel!=r.breakLabel&&(e&2064&&(e&=-257),e&=-2065),this.continueLabel!=r.continueLabel&&(e&=-4129),this.flags=this.flags|e,this.localFlags=r.localFlags,this.thisFieldFlags=r.thisFieldFlags}mergeSideEffects(r){assert(r.targetFunction==this.targetFunction);let e=this.flags,t=r.flags,i=0;e&1?i|=1:t&1?i|=512:i|=(e|t)&512,i|=e&t&2,i|=e&t&4,e&8?i|=8:t&8?i|=1024:i|=(e|t)&1024,e&16?i|=16:r.breakLabel==this.breakLabel?t&16?i|=2048:i|=(e|t)&2048:i|=e&2048,e&32?i|=32:r.continueLabel==this.continueLabel?t&32?i|=4096:i|=(e|t)&4096:i|=e&4096,e&64?t&64?i|=64:i|=8192:t&64&&(i|=8192),i|=(e|t)&16384,i|=e&t&128,e&256&&(i|=256),this.flags=i|e&98304}mergeBranch(r){this.mergeSideEffects(r);let e=this.localFlags,t=e.length,i=r.localFlags,s=i.length,a=max(t,s);for(let l=0;l<a;++l){let o=l<t?e[l]:0,u=l<s?i[l]:0;e[l]=o&u&15}}inheritAlternatives(r,e){assert(r.targetFunction==e.targetFunction),assert(r.targetFunction==this.targetFunction);let t=r.flags,i=e.flags,s=0;t&1?i&1?s|=1:s|=512:i&1?s|=512:s|=(t|i)&512,t&2&&i&2&&(s|=2),t&4&&i&4&&(s|=4),t&8?i&8?s|=8:s|=1024:i&8?s|=1024:s|=(t|i)&1024,t&16?i&16?s|=16:s|=2048:i&16?s|=2048:s|=(t|i)&2048,t&32?i&32?s|=32:s|=4096:i&32?s|=4096:s|=(t|i)&4096,t&64?i&64?s|=64:s|=8192:i&64?s|=8192:s|=(t|i)&8192,s|=(t|i)&16384,t&128&&i&128&&(s|=128),t&256&&i&256&&(s|=256),this.flags=s|this.flags&98304;let a=this.localFlags;if(t&256){if(!(i&256)){let o=e.localFlags;for(let u=0,c=o.length;u<c;++u)a[u]=o[u]}}else if(i&256){let o=r.localFlags;for(let u=0,c=o.length;u<c;++u)a[u]=o[u]}else{let o=r.localFlags,u=o.length,c=e.localFlags,f=c.length,_=max(u,f);for(let d=0;d<_;++d){let m=d<u?o[d]:0,h=d<f?c[d]:0;a[d]=m&h&15}}let l=r.thisFieldFlags;if(l){let o=new Map,u=assert(e.thisFieldFlags);for(let c=Map_keys(l),f=0,_=c.length;f<_;++f){let d=c[f];(changetype(l.get(d))&1)!=0&&u.has(d)&&changetype(u.get(d))&1&&o.set(d,1)}this.thisFieldFlags=o}else assert(!e.thisFieldFlags)}resetIfNeedsRecompile(r,e){let t=this.localFlags.length,i=r.localFlags.length,s=this.targetFunction;assert(s==r.targetFunction);let a=s.localsByIndex;assert(a==r.targetFunction.localsByIndex);let l=!1;for(let o=0,u=min(t,i);o<u;++o){let f=a[o].type;f.isShortIntegerValue&&this.isLocalFlag(o,2)&&!r.isLocalFlag(o,2)&&(this.unsetLocalFlag(o,2),l=!0),f.isNullableReference&&this.isLocalFlag(o,4)&&!r.isLocalFlag(o,4)&&(this.unsetLocalFlag(o,4),l=!0)}return l&&(assert(a.length>=e),a.length=e,this.localFlags.length>e&&(this.localFlags.length=e)),l}isNonnull(r,e){if(!e.isNullableReference)return!0;switch(re(r)){case 9:{if(!bs(r))break;let t=this.targetFunction.localsByIndex[Uo(r)];return!t.type.isNullableReference||this.isLocalFlag(t.index,4,!1)}case 8:{let t=this.targetFunction.localsByIndex[Pt(r)];return!t.type.isNullableReference||this.isLocalFlag(t.index,4,!1)}}return!1}inheritNonnullIfTrue(r,e=null){switch(re(r)){case 9:{if(!bs(r))break;let t=this.targetFunction.localsByIndex[Uo(r)];(!e||e.isLocalFlag(t.index,4))&&this.setLocalFlag(t.index,4),this.inheritNonnullIfTrue(Vo(r),e);break}case 8:{let t=this.targetFunction.localsByIndex[Pt(r)];(!e||e.isLocalFlag(t.index,4))&&this.setLocalFlag(t.index,4);break}case 2:{let t=ni(r);t&&st(t)&&(this.inheritNonnullIfTrue(qo(r),e),this.inheritNonnullIfTrue(vs(r),e));break}case 15:{switch(Es(r)){case 20:case 21:{this.inheritNonnullIfFalse(Oo(r),e);break}}break}case 16:{switch(ri(r)){case 15:case 40:{let t=at(r),i=We(r);xt(t)?this.inheritNonnullIfTrue(i,e):xt(i)&&this.inheritNonnullIfTrue(t,e);break}case 16:case 41:{let t=at(r),i=We(r);st(t)?this.inheritNonnullIfTrue(i,e):st(i)&&this.inheritNonnullIfTrue(t,e);break}}break}case 6:{let t=Is(r);if(t==g.String_eq){assert(Nt(r)==2);let i=Je(r,0),s=Je(r,1);xt(i)?this.inheritNonnullIfTrue(s,e):xt(s)&&this.inheritNonnullIfTrue(i,e)}else if(t==g.String_ne){assert(Nt(r)==2);let i=Je(r,0),s=Je(r,1);st(i)?this.inheritNonnullIfTrue(s,e):st(s)&&this.inheritNonnullIfTrue(i,e)}else t==g.String_not?(assert(Nt(r)==1),this.inheritNonnullIfFalse(Je(r,0),e)):t==g.tostack&&(assert(Nt(r)==1),this.inheritNonnullIfTrue(Je(r,0),e));break}}}inheritNonnullIfFalse(r,e=null){switch(re(r)){case 15:{switch(Es(r)){case 20:case 21:{this.inheritNonnullIfTrue(Oo(r),e);break}}break}case 2:{let t=vs(r);ni(r)&&xt(t)&&(this.inheritNonnullIfFalse(qo(r),e),this.inheritNonnullIfFalse(ni(r),e));break}case 16:{switch(ri(r)){case 15:case 40:{let t=at(r),i=We(r);st(t)?this.inheritNonnullIfTrue(i,e):st(i)&&this.inheritNonnullIfTrue(t,e);break}case 16:case 41:{let t=at(r),i=We(r);xt(t)?this.inheritNonnullIfTrue(i,e):xt(i)&&this.inheritNonnullIfTrue(t,e);break}}break}case 6:{let t=Is(r);if(t==g.String_eq){assert(Nt(r)==2);let i=Je(r,0),s=Je(r,1);st(i)?this.inheritNonnullIfTrue(s,e):st(s)&&this.inheritNonnullIfTrue(i,e)}else if(t==g.String_ne){assert(Nt(r)==2);let i=Je(r,0),s=Je(r,1);xt(i)?this.inheritNonnullIfTrue(s,e):xt(s)&&this.inheritNonnullIfTrue(i,e)}else t==g.String_not?(assert(Nt(r)==1),this.inheritNonnullIfTrue(Je(r,0),e)):t==g.tostack&&(assert(Nt(r)==1),this.inheritNonnullIfFalse(Je(r,0),e));break}}}canOverflow(r,e){if(!e.isShortIntegerValue)return!1;let t;switch(re(r)){case 8:{let i=this.targetFunction.localsByIndex[Pt(r)];return!this.isLocalFlag(i.index,2,!0)||Ko(i.type,e)}case 9:return assert(bs(r)),this.canOverflow(Vo(r),e);case 10:{let i=assert(this.program.elementsByName.get(assert(xs(r))));return assert(i.kind==0||i.kind==3),Ko(i.type,e)}case 16:{switch(ri(r)){case 15:case 40:case 57:case 70:case 16:case 41:case 58:case 71:case 17:case 18:case 42:case 43:case 59:case 72:case 19:case 20:case 44:case 45:case 60:case 73:case 21:case 22:case 46:case 47:case 61:case 74:case 23:case 24:case 48:case 49:case 62:case 75:return!1;case 2:return!(re(t=at(r))==14&&(ae(t)==0||ae(t)==1&&!this.canOverflow(We(r),e))||re(t=We(r))==14&&(ae(t)==0||ae(t)==1&&!this.canOverflow(at(r),e)));case 7:return!(re(t=at(r))==14&&ae(t)<=e.computeSmallIntegerMask(p.i32)||!this.canOverflow(t,e)||re(t=We(r))==14&&ae(t)<=e.computeSmallIntegerMask(p.i32)||!this.canOverflow(t,e));case 10:{let i=32-e.size;return re(t=We(r))!=14||ae(t)<i}case 11:{let i=32-e.size;return this.canOverflow(at(r),e)&&(re(t=We(r))!=14||ae(t)<i)}case 12:{let i=32-e.size;return e.isSignedIntegerValue?!(re(t=We(r))==14&&ae(t)>i):this.canOverflow(at(r),e)&&!(re(t=We(r))==14&&ae(t)>=i)}case 4:case 5:case 6:return this.canOverflow(at(r),e)||this.canOverflow(We(r),e)}break}case 15:{switch(Es(r)){case 20:case 21:return!1;case 0:case 2:case 4:return e.size<7;case 47:return e.size<(e.isUnsignedIntegerValue?32:8);case 49:return e.size<(e.isUnsignedIntegerValue?64:8);case 48:return e.size<(e.isUnsignedIntegerValue?32:16);case 50:return e.size<(e.isUnsignedIntegerValue?64:16);case 51:return e.size<(e.isUnsignedIntegerValue?64:32)}break}case 14:{let i=0;switch(fe(r)){case P.I32:{i=ae(r);break}case P.I64:{i=Ne(r);break}case P.F32:{i=i32(Ce(r));break}case P.F64:{i=i32(Pe(r));break}case P.V128:return!1;default:assert(!1)}switch(e.kind){case 0:return(i&-2)!=0;case 1:return i<i8.MIN_VALUE||i>i8.MAX_VALUE;case 2:return i<i16.MIN_VALUE||i>i16.MAX_VALUE;case 6:return i<0||i>u8.MAX_VALUE;case 7:return i<0||i>u16.MAX_VALUE}break}case 12:{let i,s=mf(r);switch(hf(r)){case 1:{i=s?p.i8:p.u8;break}case 2:{i=s?p.i16:p.u16;break}default:{i=s?p.i32:p.u32;break}}return Ko(i,e)}case 1:{if(!As(r)){let i=assert(Ts(r)),s=Ss(r,i-1);return this.canOverflow(s,e)}break}case 2:return this.canOverflow(vs(r),e)||this.canOverflow(assert(ni(r)),e);case 17:return this.canOverflow(yf(r),e)||this.canOverflow(gf(r),e);case 6:{let s=this.program.instancesByName,a=assert(Is(r));if(s.has(a)){let l=assert(s.get(a));assert(l.kind==5);let o=l,u=o.signature.returnType;return!o.flow.is(2)||Ko(u,e)}return!1}case 23:return!1}return!0}toString(){let r=0,e=this.parent;for(;e;)e=e.parent,++r;let t=new Array;return this.is(1)&&t.push("RETURNS"),this.is(2)&&t.push("RETURNS_WRAPPED"),this.is(4)&&t.push("RETURNS_NONNULL"),this.is(8)&&t.push("THROWS"),this.is(16)&&t.push("BREAKS"),this.is(32)&&t.push("CONTINUES"),this.is(64)&&t.push("ACCESSES_THIS"),this.is(128)&&t.push("CALLS_SUPER"),this.is(256)&&t.push("TERMINATES"),this.is(512)&&t.push("CONDITIONALLY_RETURNS"),this.is(1024)&&t.push("CONDITIONALLY_THROWS"),this.is(2048)&&t.push("CONDITIONALLY_BREAKS"),this.is(4096)&&t.push("CONDITIONALLY_CONTINUES"),this.is(8192)&&t.push("CONDITIONALLY_ACCESSES_THIS"),this.is(16384)&&t.push("MAY_RETURN_NONTHIS"),`Flow(${this.sourceFunction})[${r}] ${t.join(" ")}`}};function Ko(n,r){return r.isShortIntegerValue&&(!n.isIntegerValue||n.size>r.size||n.isSignedIntegerValue!=r.isSignedIntegerValue)}var $o=(e=>(e[e.Report=0]="Report",e[e.Swallow=1]="Swallow",e))($o||{});function G1(n){let r=n.name;if(r.kind!=23)return!1;let e=r,t=e.expression;return t.kind!=8?!1:t.text=="abi"&&e.property.text=="align"}function U1(n){if(!n)return null;for(let r=0,e=n.length;r<e;++r){let t=n[r];if(G1(t))return t}return null}function V1(n){switch(n.kind){case 1:case 6:case 2:case 7:case 3:case 8:return!0;default:return!1}}var Rs=class extends tt{constructor(e){super(e.diagnostics);this.currentThisExpression=null;this.currentElementExpression=null;this.discoveredOverride=!1;this.allowInlineView=!1;this.allowInlineViewParam=!1;this.viewCalls=null;this.resolvingExpressions=new Set;this.resolveClassPending=new Set;this.program=e}markViewCall(e){let t=this.viewCalls;t==null&&(this.viewCalls=t=new Set),t.add(e)}isViewCall(e){let t=this.viewCalls;return t!=null&&t.has(e)}resolveType(e,t,i,s=null,a=0){if(e.currentlyResolving)return this.error(100,e.range,"Recursive types"),null;e.currentlyResolving=!0;let l=null;switch(e.kind){case 1:{l=this.resolveNamedType(e,t,i,s,a);break}case 2:{l=this.resolveFunctionType(e,t,i,s,a);break}case 3:{l=this.resolveTupleType(e,t,i,s,a);break}case 4:{l=this.resolveFixedArrayType(e,t,i,s,a);break}case 71:{l=this.resolveUnmanagedArrayType(e,t,i,s,a);break}case 72:{l=this.resolveDynamicArrayType(e,t,i,s,a);break}default:assert(!1)}return e.currentlyResolving=!1,l!=null&&e.memoryModel!=0&&(l=this.checkMemoryModelOverride(e,l,a)),l}checkMemoryModelOverride(e,t,i){let s=e.memoryModel,a=Qo(t);return a==0||s==a?t:s==2&&a==3?(i==0&&this.error(6394,e.range,t.toString()),null):(s==3||s==2)&&a==1?s==3&&(this.allowInlineView||this.allowInlineViewParam)?t:(i==0&&this.error(6395,e.range,t.toString(),O1(s)),null):t}resolveNamedType(e,t,i,s=null,a=0){let l=e.name,o=e.typeArguments,u=!l.next;if(u){let _=l.identifier.text;if(s&&s.has(_)){let d=assert(s.get(_));if(o&&o.length>0&&a==0&&this.error(2315,e.range,d.toString()),e.isNullable){if(d.isReference)return d.asNullable();a==0&&this.error(204,e.range,d.toString())}return d}}let c=this.resolveTypeName(l,t,i,a);if(!c)return null;let f=c.shadowType;if(f)c=f;else{if(c.kind==2){o&&o.length>0&&a==0&&this.error(2315,e.range,c.internalName);let _=this.resolveEnumType(c,a);return e.isNullable&&a==0&&this.error(204,e.range,`${c.name}/${_.toString()}`),_}if(c.kind==6||c.kind==8){let _=this.resolveClassInclTypeArguments(c,o,t,i,me(s),e,a);return _?e.isNullable?_.type.asNullable():_.type:null}}if(c.kind==14){let _=c;if(c.is(4194304)){o&&o.length>0&&a==0&&this.error(2315,e.range,c.internalName);let b=_.type;if(e.isNullable){if(b.isReference)return b.asNullable();a==0&&this.error(204,l.range,l.identifier.text)}return b}if(u){let b=l.identifier.text;if(tr.has(b)){let A=assert(tr.get(b)),S=new Yo(this,e,i,s,a);return A(S)}}let d=_.typeParameterNodes,m=null;if(d){if(m=this.resolveTypeArguments(d,o,t,i,s=me(s),e,a),!m)return null}else o&&o.length>0&&this.error(2315,e.range,l.identifier.text);let h=this.resolveType(_.typeNode,t,c,s,a);if(!h)return null;if(e.isNullable){if(h.isReference)return h.asNullable();a==0&&this.error(204,l.range,l.identifier.text)}return h}return a==0&&this.error(2304,l.range,l.identifier.text),null}resolveEnumType(e,t=0){if(e.underlyingTypeResolved)return e.type;let i=e.declaration.underlyingTypeNode;if(!i)return e.underlyingTypeResolved=!0,e.type;if(e.underlyingTypeResolving)return p.i32;e.underlyingTypeResolving=!0;let s=this.resolveType(i,null,e.parent,null,t);if(e.underlyingTypeResolving=!1,!s)return p.i32;if(!V1(s))return t==0&&this.error(6403,i.range,s.toString()),p.i32;e.refineType(s);let a=e.members;if(a)for(let l=Map_values(a),o=0,u=l.length;o<u;++o){let c=unchecked(l[o]);c.kind==3&&c.refineType(s)}return e.underlyingTypeResolved=!0,s}resolveFunctionType(e,t,i,s=null,a=0){let l=e.explicitThisType,o=null;if(l&&(o=this.resolveType(l,t,i,s,a),!o))return null;let u=e.parameters,c=u.length,f=new Array(c),_=0,d=!1,m=this.allowInlineViewParam;this.allowInlineViewParam=!0;for(let S=0;S<c;++S){let k=u[S];switch(k.parameterKind){case 0:{_=S+1;break}case 2:{assert(S==c-1),d=!0;break}}let w=k.type;if(De(w))return a==0&&this.error(1110,w.range),null;let R=this.resolveType(w,t,i,s,a);if(!R)return null;if(R==p.void)return a==0&&this.error(214,w.range,R.toString()),null;f[S]=R}this.allowInlineViewParam=m;let h=e.returnType,b;if(De(h))a==0&&this.error(1110,h.range),b=p.void;else{if(b=this.resolveType(h,t,i,s,a),!b)return null;this.isValueFormFixedArray(b)&&this.enableMultiValueForArrayReturn()}let A=oe.create(this.program,f,b,o,_,d);return e.isNullable?A.type.asNullable():A.type}enableMultiValueForArrayReturn(){let e=this.program.options;if(e.hasFeature(512))return;e.features|=512;let t=this.program.module;t.setFeatures(t.getFeatures()|512)}isValueFormFixedArray(e){return e.kind!=14?!1:e.fixedMemoryModel==0||e.fixedMemoryModel==1}resolveFixedArrayType(e,t,i,s=null,a=0){let l=e.memoryModel,o=l==0||l==1,u=this.resolveType(e.elementType,t,i,s,a);if(!u)return null;if(o){if(u.classReference!=null&&assert(u.classReference).hasDecorator(4096))return a==0&&this.error(100,e.elementType.range,"an inline array (T[N]) of an @inline struct (elements by value are a later phase)"),null;let f=u.classReference;if(f!=null&&f.hasDecorator(2048))return a==0&&this.error(100,e.elementType.range,"an inline array (T[N]) of a @managed record (the elements would be GC references with nowhere for the collector to find their headers; use Array<T>, or @unmanaged records for a C-layout block)"),null;if(f!=null&&f.hasDecorator(16)&&this.resolveClassPending.has(f))return a==0&&this.error(100,e.elementType.range,"a recursive record: '"+f.name+"' would have an infinite size (it contains itself by value, directly or through another record)"),null}if(!u.isMemory)return a==0&&this.error(203,e.elementType.range,"a fixed-size array of",u.toString()),null;let c=l==0?0:l==1?1:l==2?2:3;return p.fixedArray(u,e.length,c,this.program.options.usizeType.size)}resolveUnmanagedArrayType(e,t,i,s=null,a=0){let l=this.resolveType(e.elementType,t,i,s,a);return l?l.byteSize?l.isManaged?(a==0&&this.error(100,e.elementType.range,"an unmanaged array cannot hold GC references ([T *] where T is @managed); a GC reference in an unscanned buffer will dangle. Use a scalar, an @unmanaged struct, or an @inline struct element"),null):p.unmanagedArray(l,this.program.options.usizeType.size):(a==0&&this.error(203,e.elementType.range,"an unmanaged array of",l.toString()),null):null}resolveDynamicArrayType(e,t,i,s=null,a=0){let l=e.dynamicMemoryModel;if(l==2){let u=this.resolveType(e.elementType,t,i,s,a);if(!u)return null;if(!u.byteSize)return a==0&&this.error(203,e.elementType.range,"a dynamic array of",u.toString()),null;if(u.isManaged)return a==0&&this.error(100,e.elementType.range,"a dynamic array cannot hold GC references (its buffer is not scanned); use a scalar, an @unmanaged struct, or an @inline struct element"),null;let c=this.resolveClass(this.program.dynamicArrayPrototype,[u],new Map,a);return c!=null?c.type:null}if(l==0||l!=3)return a==0&&this.error(100,e.range,"inline runtime-length arrays have no WASM representation; use @unmanaged @dynamic (C-compatible) or @managed @dynamic (GC-managed)"),null;let o=this.resolveType(e.elementType,t,i,s,a);return o?o.byteSize?o.isManaged?(a==0&&this.error(100,e.elementType.range,"a dynamic array cannot hold GC references (its buffer is not scanned); use a scalar, an @unmanaged struct, or an @inline struct element"),null):p.dynamicArray(o,3,this.program.options.usizeType.size):(a==0&&this.error(203,e.elementType.range,"a dynamic array of",o.toString()),null):null}resolveTupleType(e,t,i,s=null,a=0){let l=e.elements;for(let o=0,u=l.length;o<u;++o)if(!this.resolveType(l[o],t,i,s,a))return null;return a==0&&this.error(100,e.range,"Tuple types"),null}resolveBuiltinNotNullableType(e,t,i=null,s=0){let a=this.ensureOneTypeArgument(e,s);if(!a)return null;let l=this.resolveType(a,null,t,i,s);return l?l.isNullableReference?l.nonNullableType:l:null}resolveTypeName(e,t,i,s=0){let a=null;if(t&&(a=t.lookupTypeAlias(e.identifier.text)),a||(a=i.lookup(e.identifier.text,!0)),!a)return s==0&&this.error(2304,e.range,e.identifier.text),null;let l=e,o=e.next;for(;o;){if(!(a=a.getMember(o.identifier.text)))return s==0&&this.error(2339,o.range,o.identifier.text,l.identifier.text),null;l=o,o=o.next}return a}resolveTypeArguments(e,t,i,s,a=new Map,l=null,o=0){let u=0,c=0;for(let m=0,h=e.length;m<h;++m)e[m].defaultType||++u,++c;let f=t?t.length:0;if(f<u||f>c)return o==0&&this.error(2558,f?ce.join(t[0].range,t[f-1].range):l.range,(f<u?u:c).toString(),f.toString()),null;let _=new Array(c),d=me(a);a.clear();for(let m=0;m<c;++m){let h=m<f?this.resolveType(t[m],i,s,d,o):this.resolveType(assert(e[m].defaultType),i,s,me(a),o);if(!h)return null;a.set(e[m].name.text,h),_[m]=h}return _}maybeInferCall(e,t,i,s=0){let a=e.typeArguments;if(a){if(!t.is(65536))return s==0&&this.error(2315,e.expression.range,t.internalName),null;let l=t.internalName==g.changetype;if(l&&a.length==1&&a[0].memoryModel==3){let u=this.viewCalls;u==null&&(this.viewCalls=u=new Set),u.add(e)}l&&(this.allowInlineView=!0);let o=this.resolveFunctionInclTypeArguments(t,a,i.sourceFunction,me(i.contextualTypeArguments),e,s);return l&&(this.allowInlineView=!1),o}if(t.is(65536)){let l=this.inferGenericTypeArguments(e,t,t.typeParameterNodes,i,s);return l?this.resolveFunction(t,l,me(i.contextualTypeArguments),s):null}return this.resolveFunction(t,null,new Map,s)}inferGenericTypeArguments(e,t,i,s,a=0){if(!i)return null;let l=me(s.contextualTypeArguments),o=i.length,u=new Set;for(let b=0;b<o;++b){let A=i[b].name.text;l.set(A,p.auto),u.add(A)}let c=t.functionTypeNode.parameters,f=c.length,_,d;switch(e.kind){case 11:{let b=e;_=b.args,d=b.argumentsRange;break}case 19:{let b=e;_=b.args,d=b.argumentsRange;break}default:return assert(!1),null}let m=_.length;for(let b=0;b<f;++b){let A=b<m?_[b]:c[b].initializer;if(!A){if(c[b].parameterKind==1)continue;return a==0&&(c[b].parameterKind==2?this.error(1140,d.atEnd):this.error(2554,e.range,f.toString(),m.toString())),null}let S=c[b].type;if(c[b].parameterKind==2&&(S=S.typeArguments[0]),S.hasGenericComponent(i)){let k=this.resolveExpression(A,s,p.auto,1);k&&this.propagateInferredGenericTypes(S,k,t,l,u)}}let h=new Array(o);for(let b=0;b<o;++b){let A=i[b],S=A.name.text;if(l.has(S)){let k=assert(l.get(S));if(k!=p.auto){h[b]=k;continue}let w=A.defaultType;if(w){let R=t.parent,C=null;(R.kind==7||R.kind==5)&&(C=R.contextualTypeArguments);let M=this.resolveType(w,null,t,C,a);if(!M)return null;h[b]=M;continue}}if(a==0){let k;switch(e.kind){case 11:k=e.expression.range;break;case 19:k=e.typeName.range;break;default:return assert(!1),null}this.error(1140,k.atEnd)}return null}return h}propagateInferredGenericTypes(e,t,i,s,a){if(e.kind==1){let l=e,o=l.typeArguments;if(o&&o.length>0){let u=t.classReference;if(u){let c=this.resolveTypeName(l.name,null,i);if(!c||c.kind!=6)return;if(u.prototype==c){let f=u.typeArguments;if(f&&f.length==o.length){for(let _=0,d=f.length;_<d;++_)this.propagateInferredGenericTypes(o[_],f[_],i,s,a);return}}}}else{let u=l.name.identifier.text;if(s.has(u)){let c=assert(s.get(u));(c==p.auto||a.has(u)&&c.isAssignableTo(t))&&s.set(u,t)}}}else if(e.kind==2){let l=e,o=l.parameters,u=t.signatureReference;if(u){let c=u.parameterTypes;for(let m=0,h=min(c.length,o.length);m<h;++m)this.propagateInferredGenericTypes(o[m].type,c[m],i,s,a);let f=u.returnType;f!=p.void&&this.propagateInferredGenericTypes(l.returnType,f,i,s,a);let _=u.thisType,d=l.explicitThisType;_&&d&&this.propagateInferredGenericTypes(d,_,i,s,a);return}}}getTypeOfElement(e){let t=e.kind;if(t==0&&!this.ensureResolvedLazyGlobal(e,1))return null;if(Xo(t)){let i=e.type,s=i.getClassOrWrapper(this.program);if(s){let a=s.wrappedType;a&&(i=a)}return i}return null}getElementOfType(e){let t=e.getClassOrWrapper(this.program);return t||null}lookupExpression(e,t,i=p.auto,s=0){for(;e.kind==22;)e=e.expression;switch(e.kind){case 9:return this.lookupAssertionExpression(e,t,i,s);case 10:return this.lookupBinaryExpression(e,t,i,s);case 11:return this.lookupCallExpression(e,t,i,s);case 13:return this.lookupCommaExpression(e,t,i,s);case 14:return this.lookupElementAccessExpression(e,t,i,s);case 16:return this.lookupFunctionExpression(e,t,i,s);case 8:case 15:case 20:case 27:return this.lookupIdentifierExpression(e,t,t.sourceFunction,s);case 26:return this.lookupThisExpression(e,t,i,s);case 25:return this.lookupSuperExpression(e,t,i,s);case 17:return this.lookupInstanceOfExpression(e,t,i,s);case 18:return this.lookupLiteralExpression(e,t,i,s);case 19:return this.lookupNewExpression(e,t,i,s);case 23:return this.lookupPropertyAccessExpression(e,t,i,s);case 24:return this.lookupTernaryExpression(e,t,i,s);case 29:return this.lookupUnaryPostfixExpression(e,t,i,s);case 30:return this.lookupUnaryPrefixExpression(e,t,i,s);case 31:{let a=this.resolveAwaitExpression(e,t,s);return a?this.getElementOfType(a):null}}return assert(!1),null}resolveExpression(e,t,i=p.auto,s=0){let a=this.resolvingExpressions;if(a.has(e))return null;a.add(e);let l=this.doResolveExpression(e,t,i,s);return a.delete(e),l}doResolveExpression(e,t,i=p.auto,s=0){for(;e.kind==22;)e=e.expression;switch(e.kind){case 9:return this.resolveAssertionExpression(e,t,i,s);case 10:return this.resolveBinaryExpression(e,t,i,s);case 11:return this.resolveCallExpression(e,t,i,s);case 13:return this.resolveCommaExpression(e,t,i,s);case 14:return this.resolveElementAccessExpression(e,t,i,s);case 16:return this.resolveFunctionExpression(e,t,i,s);case 8:case 15:case 20:case 27:return this.resolveIdentifierExpression(e,t,i,t.sourceFunction,s);case 26:return this.resolveThisExpression(e,t,i,s);case 25:return this.resolveSuperExpression(e,t,i,s);case 17:return this.resolveInstanceOfExpression(e,t,i,s);case 18:return this.resolveLiteralExpression(e,t,i,s);case 19:return this.resolveNewExpression(e,t,i,s);case 23:return this.resolvePropertyAccessExpression(e,t,i,s);case 24:return this.resolveTernaryExpression(e,t,i,s);case 29:return this.resolveUnaryPostfixExpression(e,t,i,s);case 30:return this.resolveUnaryPrefixExpression(e,t,i,s);case 31:return this.resolveAwaitExpression(e,t,s)}return assert(!1),null}resolveAwaitExpression(e,t,i=0){let s=this.resolveExpression(e.operand,t,p.auto,i);if(!s)return null;let a=this.resolveTaskValueType(s);return a??s}resolveTaskValueType(e){let t=e.getClass();if(!t)return null;let i=this.program.taskPrototype;if(!i)return null;let s=t.getTypeArgumentsTo(i);return!s||s.length!=1?null:s[0]}lookupIdentifierExpression(e,t,i=t.sourceFunction,s=0){switch(e.kind){case 27:case 15:case 20:{let u=this.resolveIdentifierExpression(e,t,p.auto,i,s);return u?this.getElementOfType(u):null}}let a=e.text,l;if(l=t.lookup(a))return this.currentThisExpression=null,this.currentElementExpression=null,l;let o=t.outer;return o&&(l=o.lookup(a))?(this.currentThisExpression=null,this.currentElementExpression=null,l):(l=i.lookup(a))?(this.currentThisExpression=null,this.currentElementExpression=null,l):(l=this.program.lookup(a))?(this.currentThisExpression=null,this.currentElementExpression=null,l):(s==0&&this.error(2304,e.range,a),null)}resolveIdentifierExpression(e,t,i=p.auto,s=t.sourceFunction,a=0){switch(e.kind){case 27:case 15:return p.bool;case 20:{let u=i.getClass();if(u)return u.type.asNullable();{let c=i.getSignature();if(c)return c.type.asNullable();if(i.isExternalReference)return i}return this.program.options.usizeType}}let l=this.lookupIdentifierExpression(e,t,s,a);if(!l)return null;if(l.kind==4){let u=this.resolveFunction(l,null,new Map,a);if(!u)return null;l=u}let o=this.getTypeOfElement(l);return o||a==0&&this.error(225,e.range),o}ensureResolvedLazyGlobal(e,t=0){if(e.is(4194304))return!0;let i=e.typeNode,s=i?this.resolveType(i,null,e.parent,null,t):this.resolveExpression(assert(e.initializerNode),e.file.startFunction.flow,p.auto,t);return s?(e.setType(s),!0):!1}lookupPropertyAccessExpression(e,t,i,s=0){let a=e.expression,l=this.lookupExpression(a,t,i,s);if(!l)return null;let o=e.property.text;switch(l.kind){case 0:if(!this.ensureResolvedLazyGlobal(l,s))return null;case 3:case 1:{let u=l,c=u.type;if(c==p.void)return null;let f=c.getClassOrWrapper(this.program);if(!f)return s==0&&this.error(2339,e.property.range,o,u.type.toString()),null;l=f;break}case 10:{let u=this.resolveProperty(l,s);if(!u)return null;l=u}case 11:{let u=l,c=u.getterInstance;if(!c){let d=assert(u.setterInstance);return this.errorRelated(229,a.range,d.declaration.range,u.name),null}let f=c.signature.returnType,_=f.getClassOrWrapper(this.program);if(!_)return s==0&&this.error(2339,e.property.range,o,f.toString()),null;l=_;break}case 15:{let c=l.parent;assert(c.kind==7);let f=c,_=assert(this.currentElementExpression),d=f.lookupOverload(1);if(!d)return s==0&&this.error(2329,_.range,c.internalName),null;let m=d.signature.returnType,h=m.getClassOrWrapper(this.program);if(!h)return s==0&&this.error(2339,e.property.range,o,m.toString()),null;l=h;break}case 4:{let u=l.shadowType;if(u){if(!u.is(4194304)){let f=this.resolveType(u.typeNode,null,u.parent,null,s);f&&u.setType(f)}let c=u.type.classReference;c&&(l=c.prototype);break}else if(!l.is(65536)&&!l.getMember(o)){let f=this.resolveFunction(l,null,new Map,1);if(f){let _=f.type.getClassOrWrapper(this.program);_&&(l=_)}}break}}switch(l.kind){case 6:case 8:case 7:case 9:{let u=l,c=!1;do{let f=u.getMember(o);if(f){if(f.kind==10){let _=this.resolveProperty(f,s);if(!_)return null;f=_,_.is(32)?this.currentThisExpression=null:this.currentThisExpression=a}else this.currentThisExpression=a;return this.currentElementExpression=null,f}switch(c=!1,u.kind){case 6:case 8:{let d=u.basePrototype;d&&(c=!0,u=d);break}case 7:case 9:{let d=u.base;d&&(c=!0,u=d);break}}}while(c);break}default:{let u=l.getMember(o);if(u)return this.currentThisExpression=a,this.currentElementExpression=null,u;break}}return s==0&&this.error(2339,e.property.range,o,l.internalName),null}resolvePropertyAccessExpression(e,t,i,s=0){let a=null;if(e.expression.kind==8){let u=t.lookupLocal(e.expression.text);u!=null&&(a=u.type)}if(a!=null&&a.kind==28){let u=e.property.text;return u=="length"?p.i32:(s==0&&this.error(2339,e.property.range,u,a.toString()),null)}let l=this.lookupPropertyAccessExpression(e,t,i,s);if(!l)return null;let o=this.getTypeOfElement(l);return o||s==0&&this.error(225,e.range),o}arrayKindElementType(e){switch(e.kind){case 27:return e.unmanagedArrayElementType;case 28:return e.dynamicElementType;case 14:return e.fixedElementType}let t=e.classReference;if(t!=null&&this.isManagedDynamicArrayClass(t)){let i=t.typeArguments;if(i!=null&&i.length>0)return unchecked(i[0])}return null}isManagedDynamicArrayClass(e){return e.prototype.internalName==this.program.dynamicArrayPrototype.internalName}lookupElementAccessExpression(e,t,i,s=0){let a=e.expression,l=this.resolveExpression(a,t,i,s);if(!l)return null;let o=l.getClassOrWrapper(this.program);if(o)do{let c=o.indexSignature;if(c)return this.currentThisExpression=a,this.currentElementExpression=e.elementExpression,c;o=o.base}while(o);let u=this.arrayKindElementType(l);if(u!=null){let c=u.getClassOrWrapper(this.program);if(c!=null)return this.currentThisExpression=a,this.currentElementExpression=e.elementExpression,c}return s==0&&this.error(2329,a.range,l.toString()),null}resolveElementAccessExpression(e,t,i,s=0){let a=this.resolveExpression(e.expression,t,i,1);if(a!=null){let u=this.arrayKindElementType(a);if(u!=null)return u}let l=this.lookupElementAccessExpression(e,t,i,s);if(!l)return null;let o=this.getTypeOfElement(l);return o||s==0&&this.error(225,e.range),o}determineIntegerLiteralType(e,t,i){let s=e.value;if(t){if(i64_gt(i64_add(s,i64_minimum),i64_zero)){let a=e.range;this.error(236,a,a.source.text.substring(a.start-1,a.end))}else if(i64_eq(s,i64_zero)){if(i.isFloatValue)return i.kind==11?p.f32:p.f64;if(!i.isIntegerValue)return p.f64}s=i64_neg(s)}if(i.isValue)switch(i.kind){case 0:{if(i64_is_bool(s))return p.bool;break}case 1:{if(i64_is_i8(s))return p.i8;break}case 6:{if(i64_is_u8(s))return p.u8;break}case 2:{if(i64_is_i16(s))return p.i16;break}case 7:{if(i64_is_u16(s))return p.u16;break}case 3:{if(i64_is_i32(s))return p.i32;break}case 8:{if(i64_is_u32(s))return p.u32;break}case 5:{if(!this.program.options.isWasm64){if(i64_is_i32(s))return p.isize32;break}return p.isize64}case 10:{if(!this.program.options.isWasm64){if(i64_is_u32(s))return p.usize32;break}return p.usize64}case 4:return p.i64;case 9:return p.u64;case 11:return p.f32;case 12:return p.f64}return i64_is_i32(s)?p.i32:i64_is_u32(s)?p.u32:p.i64}lookupAssertionExpression(e,t,i=p.auto,s=0){switch(e.assertionKind){case 1:case 0:{let a=this.resolveType(assert(e.toType),null,t.sourceFunction,t.contextualTypeArguments,s);if(!a)return null;let l=this.getElementOfType(a);return l||(s==0&&this.error(214,e.range,a.toString()),this.currentThisExpression=null,this.currentElementExpression=null,null)}case 2:return this.lookupExpression(e.expression,t,i,s);case 3:return this.error(100,e.range,"Const assertion"),null}return assert(!1),null}resolveAssertionExpression(e,t,i=p.auto,s=0){switch(e.assertionKind){case 1:case 0:return this.resolveType(assert(e.toType),null,t.sourceFunction,t.contextualTypeArguments,s);case 2:{let a=this.resolveExpression(e.expression,t,i,s);return a?a.nonNullableType:null}case 3:{let a=this.lookupExpression(e,t,i,s);if(!a)return null;let l=this.getTypeOfElement(a);return l||s==0&&this.error(225,e.range),l}default:assert(!1)}return null}lookupUnaryPrefixExpression(e,t,i=p.auto,s=0){let a=this.resolveUnaryPrefixExpression(e,t,i,s);if(!a)return null;let l=this.getElementOfType(a);return l||s==0&&this.error(2469,e.range,Be(e.operator),a.toString()),l}resolveUnaryPrefixExpression(e,t,i=p.auto,s=0){let a=e.operand,l=e.operator;switch(l){case 83:if(a.isLiteralKind(1))return this.determineIntegerLiteralType(a,!0,i);case 82:case 88:case 89:{let o=this.resolveExpression(a,t,i,s);if(!o)return null;let u=o.getClassOrWrapper(this.program);if(u){let c=u.lookupOverload(Me.fromUnaryPrefixToken(l));if(c)return c.signature.returnType}return o.isNumericValue?o:(s==0&&this.error(2469,e.range,Be(l),o.toString()),null)}case 96:{let o=this.resolveExpression(a,t,i,s);if(!o)return null;let u=o.getClassOrWrapper(this.program);if(u){let c=u.lookupOverload(25);if(c)return c.signature.returnType}return p.bool}case 97:{let o=this.resolveExpression(a,t,i,s);if(!o)return null;let u=o.getClassOrWrapper(this.program);if(u){let c=u.lookupOverload(26);if(c)return c.signature.returnType}return o.isNumericValue?o.intType:(s==0&&this.error(2469,e.range,"~",o.toString()),null)}case 70:return s==0&&this.error(100,e.range,"Spread operator"),null;case 57:return this.program.stringInstance.type;default:assert(!1)}return null}lookupUnaryPostfixExpression(e,t,i=p.auto,s=0){let a=this.resolveUnaryPostfixExpression(e,t,i,s);if(!a)return null;let l=this.getElementOfType(a);return l||s==0&&this.error(2469,e.range,Be(e.operator),a.toString()),l}resolveUnaryPostfixExpression(e,t,i=p.auto,s=0){let a=e.operator;switch(a){case 88:case 89:{let l=this.resolveExpression(e.operand,t,i,s);if(!l)return null;let o=l.getClassOrWrapper(this.program);if(o){let u=o.lookupOverload(Me.fromUnaryPostfixToken(a));if(u)return u.signature.returnType}return l.isNumericValue?l:(s==0&&this.error(2469,e.range,Be(a),l.toString()),null)}}return assert(!1),null}lookupBinaryExpression(e,t,i=p.auto,s=0){let a=this.resolveBinaryExpression(e,t,i,s);if(!a)return null;let l=this.getElementOfType(a);return l||(s==0&&this.error(214,e.range,a.toString()),null)}resolveBinaryExpression(e,t,i=p.auto,s=0){let a=e.left,l=e.right,o=e.operator;switch(o){case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:return this.resolveExpression(a,t,i,s);case 73:case 74:case 75:case 76:{let u=this.resolveExpression(a,t,i,s);if(!u)return null;let c=u.getClassOrWrapper(this.program);if(c){let f=c.lookupOverload(Me.fromBinaryToken(o));if(f)return f.signature.returnType}return u.isNumericValue?p.bool:(s==0&&this.error(2469,e.range,Be(o),u.toString()),null)}case 77:case 78:{let u=this.resolveExpression(a,t,i,s);if(!u)return null;let c=u.getClassOrWrapper(this.program);if(c){let f=c.lookupOverload(Me.fromBinaryToken(o));if(f)return f.signature.returnType}return p.bool}case 79:case 80:return p.bool;case 29:return p.bool;case 82:case 83:case 85:case 86:case 87:case 84:{let u=this.resolveExpression(a,t,i,s);if(!u)return null;let c=u.getClassOrWrapper(this.program);if(c){let d=c.lookupOverload(Me.fromBinaryToken(o));if(d)return d.signature.returnType}let f=this.resolveExpression(l,t,u,s);if(!f)return null;let _=p.commonType(u,f,i);return _||s==0&&this.error(2365,e.range,Be(o),u.toString(),f.toString()),_}case 90:case 91:case 92:{let u=this.resolveExpression(a,t,i,s);if(!u)return null;let c=u.getClassOrWrapper(this.program);if(c){let f=c.lookupOverload(Me.fromBinaryToken(o));if(f)return f.signature.returnType}return u.isIntegerValue?u:(s==0&&this.error(2469,e.range,Be(o),u.toString()),null)}case 93:case 94:case 95:{let u=this.resolveExpression(a,t,i,s);if(!u)return null;let c=u.getClassOrWrapper(this.program);if(c){let d=c.lookupOverload(Me.fromBinaryToken(o));if(d)return d.signature.returnType}let f=this.resolveExpression(l,t,i,s);if(!f)return null;let _=p.commonType(u,f,i);return(!_||!_.isIntegerValue)&&s==0&&this.error(2365,e.range,Be(o),u.toString(),f.toString()),_}case 98:{let u=this.resolveExpression(a,t,i,s);if(!u)return null;let c=this.resolveExpression(l,t,u,s);if(!c)return null;let f=p.commonType(u,c,i);return f||s==0&&this.error(2365,e.range,"&&",u.toString(),c.toString()),f}case 99:{let u=this.resolveExpression(a,t,i,s);if(!u)return null;let c=this.resolveExpression(l,t,u,s);if(!c)return null;let f=p.commonType(u,c,i);return f?u.is(512)&&c.is(512)?f:f.nonNullableType:(s==0&&this.error(2365,e.range,"||",u.toString(),c.toString()),null)}}return assert(!1),null}markCapturingArrows(e,t){for(let i=0,s=e.length;i<s;++i){let a=e[i];a.prototype.capturesThis||(a.prototype.capturesThis=!0,assert(!a.signature.thisType),a.addLocal(t,L.this_))}}lookupThisExpression(e,t,i=p.auto,s=0){if(t.isInline){let o=t.lookupLocal(L.this_);if(o)return this.currentThisExpression=null,this.currentElementExpression=null,o}let a=t.sourceFunction,l=null;for(;a!=null&&a.prototype.arrowKind!=0;){l||(l=new Array),l.push(a);let o=a.parent;a=o!=null&&o.kind==5?o:null}if(a!=null){let o=a.parent;if(o!=null&&o.kind==7)return l&&this.markCapturingArrows(l,o.type),this.currentThisExpression=null,this.currentElementExpression=null,o;if(o!=null&&o.kind==6)return this.currentThisExpression=null,this.currentElementExpression=null,o;let u=a.flow.scopedLocals,c=u?J(u,L.this_):null;if(c)return l&&this.markCapturingArrows(l,c.type),this.currentThisExpression=null,this.currentElementExpression=null,c}return s==0&&this.error(2332,e.range),null}resolveThisExpression(e,t,i=p.auto,s=0){let a=this.lookupThisExpression(e,t,i,s);if(!a)return null;let l=this.getTypeOfElement(a);return l||s==0&&this.error(225,e.range),l}lookupSuperExpression(e,t,i=p.auto,s=0){if(t.isInline){let l=t.lookupLocal(L.super_);if(l)return this.currentThisExpression=null,this.currentElementExpression=null,l}let a=t.sourceFunction.parent;if(a&&a.kind==7){let l=a.base;if(l)return this.currentThisExpression=null,this.currentElementExpression=null,l}return s==0&&this.error(2335,e.range),null}resolveSuperExpression(e,t,i=p.auto,s=0){let a=this.lookupSuperExpression(e,t,i,s);if(!a)return null;let l=this.getTypeOfElement(a);return l||s==0&&this.error(225,e.range),l}lookupLiteralExpression(e,t,i=p.auto,s=0){switch(this.currentThisExpression=e,this.currentElementExpression=null,e.literalKind){case 1:{let a=this.determineIntegerLiteralType(e,!1,i);return assert(a.getClassOrWrapper(this.program))}case 0:{let a=i==p.f32?p.f32:p.f64;return assert(a.getClassOrWrapper(this.program))}case 2:case 3:return this.program.stringInstance;case 4:return this.program.regexpInstance;case 5:{let a=i.getClass();if(a&&a.prototype==this.program.arrayPrototype)return this.getElementOfType(i);let l=e.elementExpressions,o=l.length,u=p.auto,c=0;for(let f=0,_=o;f<_;++f){let d=l[f];if(d)if(d.kind==20&&o>1)++c;else{let m=this.resolveExpression(d,t,u);if(!m)return null;if(u==p.auto)u=m;else if(m!=u){let h=p.commonType(u,m,u);h&&(u=h)}}}if(u==p.auto)if(c==o)u=this.program.options.usizeType;else return s==0&&this.error(2453,e.range,"T"),null;return c>0&&u.isInternalReference&&(u=u.asNullable()),assert(this.resolveClass(this.program.arrayPrototype,[u]))}case 6:return i.isClass?i.classReference:(s==0&&this.error(225,e.range),null)}return assert(!1),null}resolveLiteralExpression(e,t,i=p.auto,s=0){if(e.literalKind==5&&i.kind==14&&(i.fixedMemoryModel==0||i.fixedMemoryModel==1))return i;let a=this.lookupLiteralExpression(e,t,i,s);if(!a)return null;let l=this.getTypeOfElement(a);return l||s==0&&this.error(225,e.range),l}lookupCallExpression(e,t,i=p.void,s=0){let a=this.resolveCallExpression(e,t,i,s);if(!a)return null;let l=this.getElementOfType(a);return l||s==0&&this.error(214,e.range,a.toString()),l}resolveCallExpression(e,t,i=p.void,s=0){let a=e.expression,l=this.lookupExpression(a,t,i,s);if(!l)return null;switch(l.kind){case 4:{let o=l;if(o.internalName==g.unchecked&&e.args.length>0)return this.resolveExpression(e.args[0],t,i,s);let u=this.maybeInferCall(e,o,t,s);if(!u)return null;l=u}case 5:{let o=l;if(o.prototype.isAsync){let u=this.resolveAsyncCallType(o,s);if(u)return u}return o.signature.returnType}case 10:{let o=this.resolveProperty(l,s);if(!o)return null;l=o}default:{if(!Xo(l.kind))break;let o=this.getElementOfType(l.type);if(!o||o.kind!=7)break;l=o}case 7:{let o=l.getTypeArgumentsTo(this.program.functionPrototype);if(!(o&&o.length))break;return assert(o[0].getSignature()).returnType}}return s==0&&this.error(2349,a.range,l.internalName),null}resolveAsyncCallType(e,t=0){let i=this.program.taskPrototype;if(!i)return null;let s=this.resolveClass(i,[e.signature.returnType],new Map,t);return s?s.type:null}lookupCommaExpression(e,t,i=p.auto,s=0){let a=e.expressions;return this.lookupExpression(a[assert(a.length)-1],t,i,s)}resolveCommaExpression(e,t,i=p.auto,s=0){let a=e.expressions;return this.resolveExpression(a[assert(a.length)-1],t,i,s)}lookupInstanceOfExpression(e,t,i=p.auto,s=0){return assert(p.bool.getClassOrWrapper(this.program))}resolveInstanceOfExpression(e,t,i=p.auto,s=0){return p.bool}lookupTernaryExpression(e,t,i,s=0){let a=this.resolveTernaryExpression(e,t,i,s);if(!a)return null;let l=this.getElementOfType(a);return l||s==0&&this.error(214,e.range,a.toString()),l}resolveTernaryExpression(e,t,i,s=0){let a=this.resolveExpression(e.ifThen,t,i,s);if(!a)return null;let l=this.resolveExpression(e.ifElse,t,a,s);if(!l)return null;let o=p.commonType(a,l,i);return o||s==0&&this.error(2365,e.range,"?:",a.toString(),l.toString()),o}lookupNewExpression(e,t,i,s=0){let a=this.resolveTypeName(e.typeName,t,t.sourceFunction,s);return a?a.kind==6?this.resolveClassInclTypeArguments(a,e.typeArguments,t,t.sourceFunction,me(t.contextualTypeArguments),e,s):(s==0&&this.error(2351,e.range),null):null}resolveNewExpression(e,t,i,s=0){let a=this.lookupNewExpression(e,t,i,s);if(!a)return null;let l=this.getTypeOfElement(a);return l||s==0&&this.error(225,e.range),l}lookupFunctionExpression(e,t,i,s=0){let a=this.resolveFunctionExpression(e,t,i,s);if(!a)return null;let l=this.getElementOfType(a);return l||s==0&&this.error(214,e.range,a.toString()),l}resolveFunctionExpression(e,t,i,s=0){let a=e.declaration,l=a.signature,o=a.body,u=this.resolveType(l,null,t.sourceFunction,t.contextualTypeArguments,s);if(u&&a.arrowKind!=0&&o&&o.kind==42&&De(l.returnType)){let c=o.expression,f=assert(u.getSignature()),_=er.createDefault(t.sourceFunction),d=l.parameters;assert(f.parameterTypes.length==d.length);for(let h=0,b=d.length;h<b;h++){let A=d[h],S=f.parameterTypes[h];_.addScopedDummyLocal(A.name.text,S,A)}let m=this.resolveExpression(c,_,i,s);m&&(u.signatureReference=oe.create(this.program,f.parameterTypes,m,f.thisType,f.requiredParameters,f.hasRest))}return u}resolveFunction(e,t,i=new Map,s=0){let a=null,l=t?Zo(t):"";if(e.is(262144)){a=assert(e.getBoundClassOrInterface());let H=e.getResolvedInstance(l);if(H)return H;let U=a.typeArguments;if(U){let V=assert(a.prototype.typeParameterNodes),Y=V.length;assert(Y==V.length);for(let q=0;q<Y;++q){let ne=V[q].name.text;i.set(ne,U[q])}}}else{assert(!e.isBound);let H=e.getResolvedInstance(l);if(H)return H}let o=e.functionTypeNode,u=e.typeParameterNodes,c;if(t&&(c=t.length)>0){assert(u&&c==u.length);for(let H=0;H<c;++H)i.set(u[H].name.text,t[H])}else assert(!u||u.length==0);let f=null,_=o.explicitThisType;if(_){if(f=this.resolveType(_,null,e.parent,i,s),!f)return null;i.set(L.this_,f)}else a&&(f=a.type,i.set(L.this_,f));let d=o.parameters,m=d.length,h=new Array(m),b=null,A=0,S=!1,k=this.allowInlineViewParam;this.allowInlineViewParam=!0;for(let H=0;H<m;++H){let U=d[H];U.parameterKind==0?A=H+1:U.parameterKind==2&&(S=!0);let V=U.type;if(De(V))return s==0&&this.error(1110,V.range),null;let Y=this.resolveType(V,null,e.parent,i,s);if(!Y)return null;if(Y==p.void)return s==0&&this.error(1110,V.range),null;h[H]=Y;let q=V.memoryModel;if(q!=0){if(b==null){b=new Array(m);for(let ne=0;ne<m;++ne)unchecked(b[ne]=0)}unchecked(b[H]=q)}}this.allowInlineViewParam=k;let w;if(e.is(4096))w=p.void;else if(e.is(524288))w=a.type;else{let H=o.returnType;if(De(H))return s==0&&this.error(1110,H.range),null;let U=this.resolveType(H,null,e.parent,i,s);if(!U)return null;w=U,this.isValueFormFixedArray(w)&&this.enableMultiValueForArrayReturn()}let R=e.is(524288)&&w.classReference!=null&&assert(w.classReference).hasDecorator(4096),C=e.hasAnyDecorator(384)&&Jb(h,b),M=e.is(1048576)&&!e.hasAnyDecorator(384)&&Jb(h,b);if(b!=null&&(e.hasAnyDecorator(384)||e.is(1048576))){for(let H=0;H<m;++H)if(unchecked(b[H])==3&&oe.isInlineStructRef(unchecked(h[H])))return s==0&&this.error(6411,d[H].type.range,unchecked(h[H]).toString()),null}if(b!=null&&(e.hasAnyDecorator(384)||e.is(1048576))){for(let H=0;H<m;++H)if(unchecked(b[H])==3&&oe.isInlineStructRef(unchecked(h[H])))return s==0&&this.error(6411,d[H].type.range,unchecked(h[H]).toString()),null}let O=oe.create(this.program,h,w,f,A,S,R,C,M,b),D=e.name;l.length&&(D+=`<${l}>`);let Q=new Mt(D,e,t,O,i);if(e.setResolvedInstance(l,Q),a){let H=Q.declaration.name.text,U=a.base;if(U){let V=U.getMember(H);if(V){this.discoveredOverride=!0;let Y=!0;if(Q.isAny(6144)){if(V.kind==10){let q=this.resolveProperty(V,s);if(q)if(Q.is(2048)){let ne=q.getterInstance;ne&&Q.signature.isAssignableTo(ne.signature,!0)&&(Y=!1)}else{assert(Q.is(4096));let ne=q.setterInstance;ne&&Q.signature.isAssignableTo(ne.signature,!0)&&(Y=!1)}}}else if(Q.is(524288))Y=!1;else if(V.kind==4){let q=V,ne=q.typeParameterNodes,j=ne!=null&&ne.length>0,ge=t!=null&&t.length>0;if(j!=ge)this.errorRelated(242,Q.identifierAndSignatureRange,V.identifierAndSignatureRange,H),Y=!1;else{let ue=this.resolveFunction(q,t,new Map,1);ue&&Q.signature.isAssignableTo(ue.signature,!0)&&(Y=!1)}}Y&&this.errorRelated(2394,Q.identifierAndSignatureRange,V.identifierAndSignatureRange)}}}return Q}resolveFunctionInclTypeArguments(e,t,i,s,a,l=0){let o=null;if(e.is(65536)){if(e.is(262144)){let u=assert(e.getBoundClassOrInterface()),c=u.typeArguments;if(c){let f=assert(u.prototype.typeParameterNodes),_=c.length;assert(_==f.length);for(let d=0;d<_;++d)s.set(f[d].name.text,c[d])}}if(o=this.resolveTypeArguments(assert(e.typeParameterNodes),t,null,i,s,a,l),!o)return null}else if(t&&t.length>0)return l==0&&this.error(2315,a.range,e.internalName),null;return this.resolveFunction(e,o,s,l)}resolveOverrides(e){let t=e.prototype.unboundOverrides;if(!t)return null;let i=assert(e.getBoundClassOrInterface()),s=new Set;for(let a=Set_values(t),l=0,o=a.length;l<o;++l){let u=a[l];assert(!u.isBound);let c=u.parent,f;if(assert(c.kind==6||c.kind==8),f=c.instances,!!f)for(let _=Map_values(f),d=0,m=_.length;d<m;++d){let h=_[d];if(!h.isAssignableTo(i))continue;let b=null;if(e.isAny(6144)){let A=e.declaration.name.text,S=assert(h.getMember(A));assert(S.kind==10);let k=this.resolveProperty(S);if(!k)continue;e.is(2048)?b=k.getterInstance:(assert(e.is(4096)),b=k.setterInstance)}else{let A=h.getMember(u.name);if(A){assert(A.kind==4);let S=A;S.is(65536)==e.is(65536)&&(b=this.resolveFunction(S,e.typeArguments))}}b&&s.add(b)}}return Set_values(s)}findManagedLeaf(e,t){let i=e.classReference;if(i==null||t.has(i))return null;t.add(i);let s=i.members;if(!s)return null;for(let a=Map_values(s),l=0,o=a.length;l<o;++l){let u=unchecked(a[l]);if(u.kind!=10)continue;let c=u.instance;if(c==null||!c.isField)continue;let f=c.type;if(f.isManaged)return c;if(f.kind==14){let _=f.fixedElementType;if(_!=null&&_.isManaged)return c}else if(Qo(f)==1){let _=this.findManagedLeaf(f,t);if(_!=null)return _}}return null}resolveClass(e,t,i=new Map,s=0){let a=t?Zo(t):"",l=e.getResolvedInstance(a);if(l)return l;let o=e.name;a.length&&(o+=`<${a}>`),e.kind==8?l=new Ns(o,e,t):l=new Ar(o,e,t),e.setResolvedInstance(a,l);let u=this.resolveClassPending;if(u.add(l),t){let d=assert(e.typeParameterNodes),m=d.length,h=t.length;assert(h==m);for(let b=0;b<h;++b)i.set(d[b].name.text,t[b])}else{let d=e.typeParameterNodes;assert(!(d&&d.length>0))}l.contextualTypeArguments=i;let c=!1,f=e.basePrototype;if(f){let d=f;do{if(d==e)return this.error(2506,e.identifierNode.range,e.internalName),null;d=d.basePrototype}while(d);let m=assert(e.extendsNode),h=this.resolveClassInclTypeArguments(f,m.typeArguments,null,e.parent,me(i),m,s);if(!h)return null;l.setBase(h),u.has(h)&&(c=!0)}else e.implicitlyExtendsObject&&l.setBase(this.program.objectInstance);let _=e.interfacePrototypes;if(_)for(let d=0,m=_.length;d<m;++d){let h=_[d],b=h;do{if(b==e)return this.error(2506,e.identifierNode.range,e.internalName),null;b=b.basePrototype}while(b);let A=assert(e.implementsNodes[d]),S=this.resolveClassInclTypeArguments(h,A.typeArguments,null,e.parent,me(i),A,s);if(!S)return null;assert(S.kind==9),l.addInterface(S),u.has(S)&&(c=!0)}return c||this.finishResolveClass(l,s),l}checkOverrideVisibility(e,t,i,s,a,l){let o=!1;return t.is(524288)?(assert(s.is(524288)),s.is(512)&&(l==0&&this.errorRelated(2675,t.identifierNode.range,s.identifierNode.range,a.internalName),o=!0)):t.is(512)?s.is(512)?(l==0&&this.errorRelated(2442,t.identifierNode.range,s.identifierNode.range,e),o=!0):(l==0&&this.errorRelated(2325,t.identifierNode.range,s.identifierNode.range,e,i.internalName,a.internalName),o=!0):t.is(1024)?s.is(512)?(l==0&&this.errorRelated(2325,t.identifierNode.range,s.identifierNode.range,e,a.internalName,i.internalName),o=!0):s.isPublic?(l==0&&this.errorRelated(2444,t.identifierNode.range,s.identifierNode.range,e,i.internalName,a.internalName),o=!0):assert(s.is(1024)):t.isPublic&&(s.is(512)?(l==0&&this.errorRelated(2325,t.identifierNode.range,s.identifierNode.range,e,a.internalName,i.internalName),o=!0):s.is(1024)?(l==0&&this.errorRelated(2444,t.identifierNode.range,s.identifierNode.range,e,a.internalName,i.internalName),o=!0):assert(s.isPublic)),!o}finishResolveClass(e,t){let i=e.members;i||(e.members=i=new Map);let s=this.resolveClassPending,a=new Map,l=e.interfaces;if(l)for(let m=Set_values(l),h=0,b=m.length;h<b;++h){let A=m[h];assert(!s.has(A));let S=A.members;if(S)for(let k=Map_keys(S),w=0,R=k.length;w<R;++w){let C=unchecked(k[w]),M=assert(S.get(C)),O=e.getMember(C);O&&!this.checkOverrideVisibility(C,O,e,M,A,t)||(i.set(C,M),a.set(C,M))}}let o=0,u=0,c=e.base;if(c){let m=e.prototype.implicitlyExtendsObject;assert(!s.has(c));let h=c.members;if(h)for(let b=Map_keys(h),A=0,S=b.length;A<S;++A){let k=unchecked(b[A]),w=assert(h.get(k));if(m&&w.is(32))continue;let R=e.getMember(k);R&&!this.checkOverrideVisibility(k,R,e,w,c,t)||(i.set(k,w),w.is(128)?a.set(k,w):a.delete(k))}o=c.nextMemoryOffset,u=c.alignLog2}let f=e.prototype,_=f.instanceMembers;if(_)for(let m=Map_values(_),h=0,b=m.length;h<b;++h){let A=unchecked(m[h]),S=A.name;if(c){let k=c.getMember(S);k&&this.checkOverrideVisibility(S,A,e,k,c,t)}switch(A.kind){case 4:{let k=A.toBound(e);e.add(k.name,k);break}case 10:{let k=A.toBound(e);if(k.isField){let w=this.resolveProperty(k,t);if(w){let R=w.type;if(R==p.void)break;if(R.kind==14&&R.fixedMemoryModel==2){this.error(100,assert(k.typeNode).range,"heap fixed-extent is Landing 5c (GC block, N in type, no length field). Use `@managed @dynamic [T * n]` for a runtime-length heap array (available now)");break}if(R.isExternalReference){this.error(100,assert(k.typeNode).range,"Reference typed fields");break}let C=!0;if(c){let O=c.getMember(k.name);if(O&&O.kind==10){let D=O,Q=this.resolveProperty(D,t);if(Q&&Q.isField){if(Q.type!=w.type){this.errorRelated(2416,w.identifierNode.range,Q.identifierNode.range,w.name,e.internalName,c.internalName);break}w.memoryOffset=Q.memoryOffset,C=!1}}}if(C){let O=null;if(Qo(R)==1){let Y=R.classReference;if(Y!=null){O=Y;let q=assert(k.fieldDeclaration).type;if(s.has(Y)){this.error(100,q.range,"a recursive @inline struct: '"+Y.name+"' would have an infinite size (it contains itself, directly or through another @inline struct, by value)");break}let ne=this.findManagedLeaf(Y.type,new Set);if(ne!=null){this.error(100,q.range,"an @inline struct field '"+ne.name+"' of '"+Y.name+"' is a GC reference, and"+(e.hasDecorator(2048)?" the __visit pass walks the outer's fields -- an inline field's GC pointer is invisible to it, so the collector would not trace it":" an inline field's GC pointer is invisible to the collector -- the field looks safe but is not; the escape hatch is a hand-written byte layout, not an @inline field"));break}}}let D=O!=null?O.nextMemoryOffset:R.byteSize;if(e.hasDecorator(2048)&&R.kind==14){let Y=R.fixedElementType;this.error(100,assert(k.fieldDeclaration).type.range,Y!=null&&Y.isManaged?"an inline array of GC references on an @managed struct (the collector cannot trace its elements)":"an inline array (T[N]) on an @managed struct (field initialization cannot fill an extent yet; see compiler.ts makeZero)");break}let Q=O!=null?O.alignLog2:R.alignLog2,H=Q,U=U1(assert(k.fieldDeclaration).decorators);if(U){let Y=U.args,q=i64_zero,ne=!1;if(Y&&Y.length==1&&Y[0].isLiteralKind(1)&&(q=Y[0].value,ne=!0),!ne)this.error(6405,U.range);else if(i64_lt(q,i64_one))this.error(6406,U.range,q.toString());else if(i64_gt(q,i64_new(1073741824,0)))this.error(6409,U.range,q.toString(),"1073741824");else{let j=i64_low(q);if((j&j-1)!=0)this.error(6407,U.range,q.toString());else{let ge=1<<Q;if(j<ge)this.error(6408,U.range,q.toString(),ge.toString());else{let ue=0,_e=j;for(;_e>1;)_e>>=1,++ue;H=ue}}}}assert(H>=0),H>u&&(u=H);let V=(1<<H)-1;o&V&&(o=(o|V)+1),w.memoryOffset=o,o+=D}k.instance=w,e.add(k.name,k);let M=assert(k.fieldDeclaration).type;M&&(Qo(R)==1&&(e.hasDecorator(4096)||!e.hasDecorator(16)&&!e.hasDecorator(2048)&&this.error(100,M.range,"an @inline struct as a class field (a class field is a pointer slot; inline-in-heap is a separate, deferred case -- use an @unmanaged or @managed record field)")),this.program.checkTypeSupported(R,M))}}else e.add(k.name,k);break}default:assert(!1)}!A.is(128)&&!A.is(65536)&&a.delete(S)}if(e.kind!=9){if(!e.is(128)&&a.size>0)for(let m=Map_keys(a),h=0,b=m.length;h<b;++h){let A=m[h],S=assert(a.get(A));this.errorRelated(2515,e.identifierNode.range,S.identifierNode.range,e.internalName,A,S.parent.internalName)}if(e.hasDecorator(16)||e.hasDecorator(2048)){let m=(1<<u)-1;o=o+m&~m}e.alignLog2=u,e.nextMemoryOffset=o;{let m=e.getMember(L.constructor);if(m&&m.parent==e){assert(m.kind==4);let h=this.resolveFunction(m,null,assert(e.contextualTypeArguments),t);h&&(e.constructorInstance=h)}}}let d=f.operatorOverloadPrototypes;for(let m=Map_keys(d),h=0,b=m.length;h<b;++h){let A=unchecked(m[h]),S=assert(d.get(A));if(assert(A!=0),S.is(65536))continue;let k;if(S.is(262144)){let R=S.toBound(e);k=this.resolveFunction(R,null,new Map,t)}else k=this.resolveFunction(S,null,new Map,t);if(!k)continue;let w=e.operatorOverloads;if(w||(e.operatorOverloads=w=new Map),k.is(262144))switch(A){case 27:case 28:case 29:case 30:{let R=k.signature.returnType;R.isAssignableTo(e.type)||t==0&&this.error(2322,S.functionTypeNode.returnType.range,R.toString(),e.type.toString())}}if(w.has(A))t==0&&this.error(213,k.declaration.range);else if(w.set(A,k),A==1||A==2){let R=e.indexSignature;R||(e.indexSignature=R=new Ps(e)),A==1&&R.setType(k.signature.returnType)}}assert(s.has(e)),s.delete(e);for(let m=Set_values(s),h=0,b=m.length;h<b;++h){let A=m[h],S=A.base==e,k=A.interfaces;if(k){let w=!1;for(let R=Set_values(k),C=0,M=R.length;C<M;++C){let O=R[C];O==e?S=!0:s.has(O)&&(w=!0)}if(w)continue}S&&this.finishResolveClass(A,t)}}resolveClassInclTypeArguments(e,t,i,s,a,l,o=0){let u=null;if(e.is(65536)){let c=null;for(let f=e;f&&!c;f=f.basePrototype)c=f.constructorPrototype;if(!t&&c&&i&&a.size==0?u=this.inferGenericTypeArguments(l,c,e.typeParameterNodes,i):u=this.resolveTypeArguments(assert(e.typeParameterNodes),t,i,s,a,l,o),!u)return null}else if(t&&t.length>0)return o==0&&this.error(2315,l.range,e.internalName),null;return this.resolveClass(e,u,a,o)}resolveProperty(e,t=0){let i=e.instance;if(i)return i;e.instance=i=new Cs(e,e.parent);let s=e.getterPrototype;if(s){let l=this.resolveFunction(s,null,new Map,t);l&&(i.getterInstance=l,i.setType(l.signature.returnType))}let a=e.setterPrototype;if(a){let l=this.resolveFunction(a,null,new Map,t);l&&(i.setterInstance=l,i.is(4194304)||(assert(l.signature.parameterTypes.length==1),i.setType(l.signature.parameterTypes[0])))}return i.checkVisibility(this),i}ensureOneTypeArgument(e,t=0){let i=e.typeArguments,s=0;return!i||(s=i.length)!=1?(t==0&&this.error(2558,e.range,"1",s.toString()),null):i[0]}};function Jb(n,r){for(let e=0,t=n.length;e<t;++e){let i=unchecked(n[e]);if((oe.isInlineStructRef(i)||r!=null&&unchecked(r[e])==1)&&oe.fieldCountOf(i)>1)return!0}return!1}function Qo(n){let r=n.classReference;return r==null?0:r.hasDecorator(4096)?1:r.hasDecorator(2048)?2:r.hasDecorator(16)?3:0}function O1(n){switch(n){case 1:return"@inline";case 2:return"@managed";case 3:return"@unmanaged";default:return"@none"}}var Bs=class{constructor(r,e){this.source=r;this.reportNode=e}};function ex(n){if(!n)return!1;for(let r=0,e=n.length;r<e;++r)if(n[r].decoratorKind==6)return!0;return!1}function q1(n){if(!n)return!1;for(let r=0,e=n.length;r<e;++r)if(n[r].decoratorKind==7)return!0;return!1}function tx(n){if(!n)return!1;for(let r=0,e=n.length;r<e;++r)if(n[r].decoratorKind==9)return!0;return!1}function W1(n){return n.kind==8?n.text=="dynamic":!1}function rx(n){let r=null;if(n.kind==8)r=n.text;else if(n.kind==23)return 0;return r==null?0:r=="inline"?1:r=="managed"?2:r=="unmanaged"?3:0}function K1(n){let r=n.name;return r.kind==8&&r.text=="lazy"}function H1(n){let r=n.name;if(r.kind!=23)return!1;let e=r,t=e.expression;return t.kind!=8?!1:t.text=="abi"&&e.property.text=="align"}function j1(n,r){return n==1&&r==2||n==2&&r==1}var Ms=class extends tt{constructor(e=null,t=[]){super(e);this.backlog=new Array;this.seenlog=new Set;this.donelog=new Set;this.onComment=null;this.currentSource=null;this.dependees=new Map;this.currentModuleName=null;this.options=null;this.unplacedLazyExpressions=null;this.awaitNullifiedLazyExpressions=null;this.tryParseSignatureIsSignature=!1;this.parseParametersThis=null;this.inAsyncContext=!1;this.sources=t}parseFile(e,t,i){let s=Xr(t),a=ds(s);if(this.donelog.has(a))return;if(this.donelog.add(a),this.seenlog.add(a),e==null){let _=this.dependees,d=null;_.has(a)&&(d=assert(_.get(a))),this.error(6054,d?d.reportNode.range:null,t);return}let l=new Te(i?1:t.startsWith(wt)?t.indexOf(mt,wt.length)<0?3:2:0,s,e);this.sources.push(l),this.currentSource=l,this.currentModuleName=null;let o=new os(l,this.diagnostics);o.onComment=this.onComment;let u=l.statements;for(;!o.skip(122);){let _=this.parseTopLevelStatement(o,null);_?u.push(_):this.skipStatement(o)}let c=this.unplacedLazyExpressions;this.unplacedLazyExpressions=null;let f=this.awaitNullifiedLazyExpressions;if(this.awaitNullifiedLazyExpressions=null,c!=null)for(let _=Set_values(c),d=0,m=_.length;d<m;++d){let h=unchecked(_[d]);this.error(f!=null&&f.has(h)?6402:6397,h.range)}}parseTopLevelStatement(e,t=null){let i=t?t.flags&32768:0,s=-1,a=null;for(;e.skip(115);){s<0&&(s=e.tokenPos);let k=this.parseDecorator(e);if(!k){this.skipStatement(e);continue}a?a.push(k):a=[k]}let l=0,o=0,u=0,c=0;e.skip(18)&&(s<0&&(s=e.tokenPos),i|=2,l=e.tokenPos,o=e.pos,e.skip(13)&&(u=e.tokenPos,c=e.pos));let f=0,_=0,d=t!=null&&t.is(32768);e.skip(12)?d?this.error(1038,e.range()):(s<0&&(s=e.tokenPos),f=s,_=e.pos,i|=32772):d&&(i|=32768);let m=!1,h=0,b=0;if(e.peek()==2){let k=e.mark();e.next(),!e.peekOnNewLine()&&e.peek()==24?(m=!0,h=e.tokenPos,b=e.pos,s<0&&(s=h)):e.reset(k)}let A=null,S=e.peek();switch(s<0&&(s=e.nextTokenPos),S){case 8:{e.next(),i|=8,e.skip(17)?A=this.parseEnum(e,i,a,s):A=this.parseVariable(e,i,a,s),a=null;break}case 34:i|=16;case 58:{e.next(),A=this.parseVariable(e,i,a,s),a=null;break}case 17:{e.next(),A=this.parseEnum(e,i,a,s),a=null;break}case 24:{e.next(),A=this.parseFunction(e,i,a,s,m),m&&A&&i&32768&&this.error(1042,e.range(h,b),"async"),a=null;break}case 0:{let k=e.mark();e.next();let w=e.tokenPos,R=e.pos;if(e.peekOnNewLine()){e.reset(k),A=this.parseStatement(e,!0);break}let C=e.peek();if(C!=7){C==31&&this.error(1242,e.range(w,R)),e.reset(k),A=this.parseStatement(e,!0);break}else e.discard(k);i|=128}case 7:case 31:{e.next(),A=this.parseClassOrInterface(e,i,a,s),a=null;break}case 49:{let k=e.tokenPos,w=e.range(k,e.pos),R=ex(a),C=tx(a),M=q1(a);M&&R&&this.error(6390,w),M&&tx(a)&&this.error(6391,w),e.next();let O=this.parseClassOrInterface(e,i,M?a:this.withValueDefault(a,w,R||C),s);O&&(O.declaredAsStruct=!0,O.declaredAsManagedStruct=M),A=O,a=null;break}case 36:{let k=e.mark();e.next(),e.peek(1)==116?(e.discard(k),A=this.parseNamespace(e,i,a,s),a=null):(e.reset(k),A=this.parseStatement(e,!0));break}case 28:{e.next(),i|=1,i&2?A=this.parseExportImport(e,s):A=this.parseImport(e);break}case 56:{let k=e.mark();e.next(),e.peek(1)==116?(e.discard(k),A=this.parseTypeDeclaration(e,i,a,s),a=null):(e.reset(k),A=this.parseStatement(e,!0));break}case 35:{let k=e.mark();e.next(),e.peek()==117&&!e.peekOnNewLine()?(e.discard(k),A=this.parseModuleDeclaration(e,i)):(e.reset(k),A=this.parseStatement(e,!0));break}default:{i&2?c&&e.skipIdentifier(1)?(_&&this.error(1120,e.range(f,_)),A=this.parseExportDefaultAlias(e,s,u,c),u=c=0):A=this.parseExport(e,s,(i&4)!=0):(o&&this.error(1042,e.range(l,o),"export"),_&&this.error(1042,e.range(f,_),"declare"),t?this.error(2695,e.range(s)):A=this.parseStatement(e,!0));break}}if(a)for(let k=0,w=a.length;k<w;++k)this.error(1206,a[k].range);if(c&&A!=null)switch(A.kind){case 56:case 59:case 55:case 61:case 63:return y.createExportDefaultStatement(A,e.range(s,e.pos));default:this.error(1042,e.range(u,c),"default")}return A}nextFile(){let e=this.backlog;return e.length?assert(e.shift()):null}getDependee(e){let t=this.dependees;return t.has(e)?assert(t.get(e)).source.internalPath:null}finish(){if(this.backlog.length)throw new Error("backlog is not empty");this.backlog=[],this.seenlog.clear(),this.donelog.clear(),this.dependees.clear()}parseTypeName(e){let t=y.createSimpleTypeName(e.readIdentifier(),e.range()),i=t;for(;e.skip(69);)if(e.skip(116)){let s=y.createSimpleTypeName(e.readIdentifier(),e.range());i.next=s,i=s}else return this.error(1003,e.range(e.pos)),null;return t}startsUnmanagedArrayType(e){if(e.peek()==115)return!1;let t=e.mark(),s=this.parseType(e,!0,!0)!=null&&e.peek()==85;return e.reset(t),s}parseType(e,t=!0,i=!1){let s=0,a=null,l=!1,o=null,u=e.next();for(;u==115;){let _=this.parseDecorator(e);if(!_)break;let d=rx(_.name);d==0&&W1(_.name)?l?this.error(2300,_.range,"@dynamic"):(l=!0,o=_):d==0?this.error(212,_.range,_.name.range.toString()):s!=0?this.error(j1(s,d)?6391:6393,ce.join(assert(a).range,_.range)):(s=d,a=_),u=e.next()}let c=e.tokenPos,f;if(u==65){let _=e.skip(65),d=this.tryParseFunctionType(e);if(d){if(_&&!e.skip(66))return i||this.error(1005,e.range(),")"),null;f=d}else{if(_||this.tryParseSignatureIsSignature)return i||this.error(1012,e.range()),null;if(t){let m=this.parseType(e,!1,i);if(!m)return null;if(!e.skip(66))return i||this.error(1005,e.range(e.pos),")"),null;f=m,f.range.start=c,f.range.end=e.pos}else return i||this.error(1012,e.range()),null}}else if(u==45){let _=this.parseType(e,t,i);if(!_)return null;f=_,f.range.start=c}else if(u==67&&this.startsUnmanagedArrayType(e)){let _=this.parseType(e,!0,i);if(!_)return null;if(assert(e.skip(85)),e.skip(68))f=y.createUnmanagedArrayType(_,e.range(c,e.pos));else if(e.peek()==116){assert(e.skip(116));let d=y.createIdentifierExpression(e.readIdentifier(),e.range());if(!e.skip(68))return i||this.error(1005,e.range(),"]"),null;f=y.createDynamicArrayType(_,d,l||s!=0?s:3,e.range(c,e.pos))}else if(e.peek()==118){e.next();let d=e.tokenPos,m=e.readInteger(),h=e.range(d,e.pos);if(!e.skip(68)||i64_lt(m,i64_new(1))||i64_gt(m,i64_new(i32.MAX_VALUE)))return i||this.error(1005,h,"]"),null;f=y.createFixedArrayType(_,i64_low(m),e.range(c,e.pos))}else return i||this.error(1005,e.range(),"]"),null}else if(u==67&&this.options&&this.options.hasFeature(512)){let _=[],d=[],m=!1;if(!e.skip(68)){do{let h=null,b=e.mark();if(e.skip(116)){let S=e.readIdentifier(),k=e.range();e.skip(101)?(h=y.createIdentifierExpression(S,k),m=!0):e.reset(b)}let A=this.parseType(e,!0,i);if(!A)return null;_.push(A),d.push(h)}while(e.skip(72));if(!e.skip(68))return i||this.error(1005,e.range(e.pos),"]"),null}f=y.createTupleType(_,m?d:null,!1,e.range(c,e.pos))}else if(u==59)f=y.createNamedType(y.createSimpleTypeName("void",e.range()),[],!1,e.range(c,e.pos));else if(u==52)f=y.createNamedType(y.createSimpleTypeName("this",e.range()),[],!1,e.range(c,e.pos));else if(u==54||u==20)f=y.createNamedType(y.createSimpleTypeName("bool",e.range()),[],!1,e.range(c,e.pos));else if(u==38)f=y.createNamedType(y.createSimpleTypeName("null",e.range()),[],!1,e.range(c,e.pos));else if(u==117)e.readString(),f=y.createNamedType(y.createSimpleTypeName("string",e.range()),[],!1,e.range(c,e.pos));else if(u==116){let _=this.parseTypeName(e);if(!_)return null;let d=null;if(e.skip(73)){do{let m=this.parseType(e,!0,i);if(!m)return null;d?d.push(m):d=[m]}while(e.skip(72));if(!e.skip(74))return i||this.error(1005,e.range(e.pos),">"),null}d||(d=[]),f=y.createNamedType(_,d,!1,e.range(c,e.pos))}else return i||this.error(1110,e.range()),null;for(;e.skip(94);){let _=this.parseType(e,!0,!1);if(!_)return null;let d=f.kind==1&&f.isNull,m=_.kind==1&&_.isNull;if(!d&&!m)return i||this.error(100,_.range,"union types"),null;m?(f.isNullable=!0,f.range.end=_.range.end):d?(_.range.start=f.range.start,_.isNullable=!0,f=_):f.range.end=_.range.end}for(;e.skip(67);){let _=e.tokenPos,d=-1;if(e.peek()==118){e.next();let b=e.tokenPos,A=e.readInteger(),S=e.range(b,e.pos);if(!e.skip(68)||i64_lt(A,i64_new(1))||i64_gt(A,i64_new(i32.MAX_VALUE)))return i||this.error(1005,S,"]"),null;d=i64_low(A)}if(d>=0){f=y.createFixedArrayType(f,d,e.range(c,e.pos));continue}if(!e.skip(68))return i||this.error(1005,e.range(),"]"),null;let m=e.range(_,e.pos),h=!1;if(e.skip(94))if(e.skip(38))h=!0;else return i||this.error(100,e.range(),"union types"),null;if(f=y.createNamedType(y.createSimpleTypeName("Array",m),[f],h,e.range(c,e.pos)),h)break}if(l&&f.kind!=72)return i||this.error(100,assert(o).range,"`@dynamic` applies to `[T * n]` only \u2014 a runtime length needs the identifier form"),null;for(;e.peek()==115&&!e.peekOnNewLine();){e.next();let _=this.parseDecorator(e);if(!_)break;if(rx(_.name)!=0){this.error(6392,_.range,_.name.range.toString());continue}if(K1(_)){this.error(6396,_.range);continue}if(H1(_)){this.error(6410,_.range);continue}f.attributes?assert(f.attributes).push(_):f.attributes=[_]}return s!=0&&(f.memoryModel=s),f}tryParseFunctionType(e){let t=e.mark(),i=e.tokenPos,s=null,a=null,l=!1,o=null,u=0;if(e.skip(66))l=!0,e.discard(t),s=[];else{l=!1;do{let f=-1,_=0;if(e.skip(70)&&(f=e.tokenPos,l=!0,e.discard(t),_=2),e.skip(52))if(f<0&&(f=e.tokenPos),e.skip(101)){l=!0,e.discard(t);let d=this.parseType(e,!1);if(!d)return null;if(d.kind!=1)return this.error(1003,d.range),this.tryParseSignatureIsSignature=!0,null;a=d}else return e.reset(t),this.tryParseSignatureIsSignature=!1,null;else if(e.skipIdentifier()){f<0&&(f=e.tokenPos);let d=y.createIdentifierExpression(e.readIdentifier(),e.range(e.tokenPos,e.pos));if(e.skip(100)&&(l=!0,e.discard(t),_==2?this.error(1047,e.range()):_=1),e.skip(101)){l=!0,e.discard(t);let m=this.parseType(e);if(!m)return this.tryParseSignatureIsSignature=l,null;let h=y.createParameter(_,d,m,null,e.range(f,e.pos));s?s.push(h):s=[h]}else if(l||e.peek()==72&&(l=!0,e.discard(t)),l){let m=y.createParameter(_,d,y.createOmittedType(e.range(e.pos)),null,e.range(f,e.pos));s?s.push(m):s=[m],this.error(1110,m.type.range)}else s||(o=d,u=_)}else{if(l){if(e.peek()==66)break;this.error(1003,e.range())}else e.reset(t);return this.tryParseSignatureIsSignature=l,null}}while(e.skip(72));if(!e.skip(66))return l?this.error(1005,e.range(),")"):e.reset(t),this.tryParseSignatureIsSignature=l,null}let c;if(e.skip(81)){if(!l&&(l=!0,e.discard(t),o)){let f=y.createParameter(u,o,y.createOmittedType(o.range.atEnd),null,o.range);s?s.push(f):s=[f],this.error(1110,f.type.range)}if(c=this.parseType(e),!c)return this.tryParseSignatureIsSignature=l,null}else return l?this.error(1005,e.range(),"=>"):e.reset(t),this.tryParseSignatureIsSignature=l,null;return this.tryParseSignatureIsSignature=!0,s||(s=[]),y.createFunctionType(s,c,a,!1,e.range(i,e.pos))}parseDecorator(e){let t=e.tokenPos;if(e.skipIdentifier()){let i=e.readIdentifier(),s=y.createIdentifierExpression(i,e.range(t,e.pos));for(;e.skip(69);)if(e.skipIdentifier(1))i=e.readIdentifier(),s=y.createPropertyAccessExpression(s,y.createIdentifierExpression(i,e.range()),e.range(t,e.pos));else return this.error(1003,e.range()),null;let a;if(e.skip(65)){if(a=this.parseArguments(e),a)return y.createDecorator(s,a,e.range(t,e.pos))}else return y.createDecorator(s,null,e.range(t,e.pos))}else this.error(1003,e.range());return null}parseVariable(e,t,i,s,a=!1){let l=new Array;do{let u=this.parseVariableDeclaration(e,t,i,a);if(!u)return null;u.overriddenModuleName=this.currentModuleName,l.push(u)}while(e.skip(72));let o=y.createVariableStatement(i,l,e.range(s,e.pos));return!e.skip(71)&&!a&&this.checkASI(e),o}parseVariableDeclaration(e,t,i,s=!1){if(!e.skipIdentifier())return this.error(1003,e.range()),null;let a=y.createIdentifierExpression(e.readIdentifier(),e.range());Jp(a.text)&&this.error(1003,a.range);let l=t;e.skip(96)&&(l|=16384);let o=null;e.skip(101)&&(o=this.parseType(e,!0));let u=null;if(e.skip(102)){if(l&32768&&this.error(1039,e.range()),u=this.parseExpression(e,2),!u)return null;if(u.kind==32){let f=this.unplacedLazyExpressions;f?.delete(u)}l&16384&&this.error(1263,u.range)}else s||(l&8?l&32768||this.error(1155,a.range):o||this.error(1110,e.range(e.pos)));let c=ce.join(a.range,e.range());return(l&16384)!=0&&(l&32768)!=0&&this.error(1255,c),y.createVariableDeclaration(a,i,l,o,u,c)}parseEnum(e,t,i,s){if(e.next()!=116)return this.error(1003,e.range()),null;let a=y.createIdentifierExpression(e.readIdentifier(),e.range()),l=null;if(e.skip(101)&&(l=this.parseType(e,!1),!l))return null;if(e.next()!=63)return this.error(1005,e.range(),"{"),null;let o=new Array;for(;!e.skip(64);){let c=this.parseEnumValue(e,0);if(!c)return null;if(o.push(c),!e.skip(72)){if(e.skip(64))break;return this.error(1005,e.range(),"}"),null}}let u=y.createEnumDeclaration(a,i,t,o,l,e.range(s,e.pos));return u.overriddenModuleName=this.currentModuleName,e.skip(71),u}parseEnumValue(e,t){if(!e.skipIdentifier())return this.error(1003,e.range()),null;let i=y.createIdentifierExpression(e.readIdentifier(),e.range()),s=null;return e.skip(102)&&(s=this.parseExpression(e,2),!s)?null:y.createEnumValueDeclaration(i,t,s,ce.join(i.range,e.range()))}parseReturn(e){let t=e.tokenPos,i=null,s=e.peek();if(s!=71&&s!=64&&!e.peekOnNewLine()&&!(i=this.parseExpression(e)))return null;let a=y.createReturnStatement(i,e.range(t,e.pos));return e.skip(71)||this.checkASI(e),a}parseTypeParameters(e){let t=new Array,i=!1,s=e.tokenPos;for(;!e.skip(74);){let a=this.parseTypeParameter(e);if(!a)return null;if(a.defaultType?i=!0:i&&(this.error(2706,a.range),a.defaultType=null),t.push(a),!e.skip(72)){if(e.skip(74))break;return this.error(1005,e.range(),">"),null}}return t.length||this.error(1098,e.range(s,e.pos)),t}parseTypeParameter(e){if(e.next()==116){let t=y.createIdentifierExpression(e.readIdentifier(),e.range()),i=null;if(e.skip(19)){let a=this.parseType(e);if(!a)return null;if(a.kind!=1)return this.error(1003,a.range),null;i=a}let s=null;if(e.skip(102)){let a=this.parseType(e);if(!a)return null;if(a.kind!=1)return this.error(1003,a.range),null;s=a}return y.createTypeParameter(t,i,s,ce.join(t.range,e.range()))}else this.error(1003,e.range());return null}parseParameters(e,t=!1){let i=new Array,s=null,a=!1,l=!1,o=null;if(this.parseParametersThis=null,e.skip(52)){if(e.skip(101)){if(o=this.parseType(e),!o)return null;o.kind==1?this.parseParametersThis=o:this.error(1003,o.range)}else return this.error(1005,e.range(),":"),null;if(!e.skip(72))return e.skip(66)?i:(this.error(1005,e.range(),")"),null)}for(;!e.skip(66);){let u=this.parseParameter(e,t);if(!u)return null;switch(s&&!l&&(this.error(1014,s.name.range),l=!0),u.parameterKind){default:{a&&this.error(1016,u.name.range);break}case 1:{a=!0;break}case 2:{s=u;break}}if(i.push(u),!e.skip(72)){if(e.skip(66))break;return this.error(1005,e.range(),")"),null}}return i}parseParameter(e,t=!1){let i=!1,s=!1,a=null,l=0;if(t&&(e.skip(44)?(a=e.range(),l|=256):e.skip(43)?(a=e.range(),l|=1024):e.skip(42)&&(a=e.range(),l|=512),e.peek()==45)){let o=e.mark();e.next(),e.peek()!=101?(e.discard(o),a||(a=e.range()),l|=64):e.reset(o)}if(e.skip(70)&&(l?this.error(1317,e.range()):a=e.range(),i=!0),e.skipIdentifier()){i||(a=e.range());let o=y.createIdentifierExpression(e.readIdentifier(),e.range()),u=null;if((s=e.skip(100))&&i&&this.error(1047,o.range),e.skip(101)){if(u=this.parseType(e),!u)return null}else u=y.createOmittedType(e.range(e.pos));let c=null;if(e.skip(102)&&(i&&this.error(1048,o.range),s?this.error(1015,o.range):s=!0,c=this.parseExpression(e,2),!c))return null;let f=y.createParameter(i?2:s?1:0,o,u,c,ce.join(assert(a),e.range()));return f.flags|=l,f}else this.error(1003,e.range());return null}parseFunction(e,t,i,s,a=!1){if(!e.skipIdentifier())return this.error(1003,e.range(e.pos)),null;let l=y.createIdentifierExpression(e.readIdentifier(),e.range()),o=-1,u=null;if(e.skip(73)){if(o=e.tokenPos,u=this.parseTypeParameters(e),!u)return null;t|=65536}if(!e.skip(65))return this.error(1005,e.range(e.pos),"("),null;o<0&&(o=e.tokenPos);let c=this.parseParameters(e);if(!c)return null;let f=this.parseParametersThis,_=(t&4096)!=0;_&&(c.length!=1&&this.error(1049,l.range),c.length>0&&c[0].initializer&&this.error(1052,l.range)),t&2048&&c.length&&this.error(1054,l.range);let d=null;if(e.skip(101)&&(d=this.parseType(e,!0,_),!d))return null;d||(d=y.createOmittedType(e.range(e.pos)),_||this.error(1110,d.range));let m=y.createFunctionType(c,d,f,!1,e.range(o,e.pos)),h=null;if(e.skip(63)){t&32768&&this.error(1183,e.range());let A=this.inAsyncContext;if(this.inAsyncContext=a,h=this.parseBlockStatement(e,!1),this.inAsyncContext=A,!h)return null}else t&32768||this.error(2391,e.range(e.pos));let b=y.createFunctionDeclaration(l,i,t,u,m,h,0,e.range(s,e.pos),a);return b.overriddenModuleName=this.currentModuleName,e.skip(71),b}parseFunctionExpression(e,t=!1){let i=e.tokenPos,s,a=0;if(e.token==24){if(e.skipIdentifier()?s=y.createIdentifierExpression(e.readIdentifier(),e.range()):s=y.createEmptyIdentifierExpression(e.range(e.pos)),!e.skip(65))return this.error(1005,e.range(e.pos),"("),null}else a=1,assert(e.token==65),s=y.createEmptyIdentifierExpression(e.range(e.tokenPos));let l=e.pos,o=this.parseParameters(e);return o?this.parseFunctionExpressionCommon(e,s,o,this.parseParametersThis,a,i,l,t):null}parseFunctionExpressionCommon(e,t,i,s,a,l=-1,o=-1,u=!1){l<0&&(l=t.range.start),o<0&&(o=l);let c=null;if(a!=2&&e.skip(101)){if(c=this.parseType(e),!c)return null}else c=y.createOmittedType(e.range(e.pos));if(a&&!e.skip(81))return this.error(1005,e.range(e.pos),"=>"),null;let f=y.createFunctionType(i,c,s,!1,e.range(o,e.pos)),_=null,d=this.inAsyncContext;if(this.inAsyncContext=u,a)if(e.skip(63))_=this.parseBlockStatement(e,!1);else{let h=this.parseExpression(e,2);h&&(_=y.createExpressionStatement(h))}else{if(!e.skip(63))return this.inAsyncContext=d,this.error(1005,e.range(e.pos),"{"),null;_=this.parseBlockStatement(e,!1)}if(this.inAsyncContext=d,!_)return null;let m=y.createFunctionDeclaration(t,null,0,null,f,_,a,e.range(l,e.pos),u);return y.createFunctionExpression(m)}withValueDefault(e,t,i){let s=this.withUnmanaged(e,t);if(i)return s;let a=y.createDecorator(y.createIdentifierExpression("inline",t),null,t),l=new Array(s.length+1);l[0]=a;for(let o=0,u=s.length;o<u;++o)l[o+1]=s[o];return l}withUnmanaged(e,t){if(ex(e))return e;let i=y.createDecorator(y.createIdentifierExpression("unmanaged",t),null,t);if(!e)return[i];let s=new Array(e.length+1);s[0]=i;for(let a=0,l=e.length;a<l;++a)s[a+1]=e[a];return s}parseClassOrInterface(e,t,i,s){let a=e.token==31;if(!e.skipIdentifier())return this.error(1003,e.range()),null;let l=y.createIdentifierExpression(e.readIdentifier(),e.range()),o=null;if(e.skip(73)){if(o=this.parseTypeParameters(e),!o)return null;t|=65536}let u=null;if(e.skip(19)){let d=this.parseType(e);if(!d)return null;if(d.kind!=1)return this.error(1003,d.range),null;u=d}let c=null;if(e.skip(27)){a&&this.error(1176,e.range());do{let d=this.parseType(e);if(!d)return null;if(d.kind!=1)return this.error(1003,d.range),null;a||(c||(c=[]),c.push(d))}while(e.skip(72))}if(!e.skip(63))return this.error(1005,e.range(),"{"),null;let f=new Array,_;if(a?(assert(!c),_=y.createInterfaceDeclaration(l,i,t,o,u,null,f,e.range(s,e.pos))):_=y.createClassDeclaration(l,i,t,o,u,c,f,e.range(s,e.pos)),!e.skip(64))do{let d=this.parseClassMember(e,_);if(d)d.kind==69?_.indexSignature=d:(assert(d instanceof nt),f.push(d));else if(this.skipStatement(e),e.skip(122))return this.error(1005,e.range(),"}"),null}while(!e.skip(64));return _.range.end=e.pos,_.overriddenModuleName=this.currentModuleName,_}parseClassExpression(e){let t=e.tokenPos,i;if(e.skipIdentifier()?i=y.createIdentifierExpression(e.readIdentifier(),e.range()):i=y.createEmptyIdentifierExpression(e.range(e.pos)),!e.skip(63))return this.error(1005,e.range(e.pos),"{"),null;let s=new Array,a=y.createClassDeclaration(i,null,0,null,null,null,s,e.range(t,e.pos));if(!e.skip(64))do{let l=this.parseClassMember(e,a);if(l)l.kind==69?a.indexSignature=l:(assert(a instanceof nt),s.push(l));else if(this.skipStatement(e),e.skip(122))return this.error(1005,e.range(),"}"),null}while(!e.skip(64));return a.range.end=e.pos,y.createClassExpression(a)}parseClassMember(e,t){let i=t.kind==61,s=0,a=null;if(e.skip(115)){s=e.tokenPos;do{let ue=this.parseDecorator(e);if(!ue)break;a||(a=new Array),a.push(ue)}while(e.skip(115));i&&a&&this.error(1206,ce.join(a[0].range,a[a.length-1].range))}let l=t.flags&32768;i&&(l|=268435456);let o=0,u=0,c=t.is(32768);e.skip(12)?(i?this.error(1042,e.range(),"declare"):c?this.error(1038,e.range()):(l|=32772,o=e.tokenPos,u=e.pos),s||(s=e.tokenPos)):c&&(l|=32768);let f=0,_=0;e.skip(44)?(i?this.error(1042,e.range(),"public"):(l|=256,f=e.tokenPos,_=e.pos),s||(s=e.tokenPos)):e.skip(42)?(i?this.error(1042,e.range(),"private"):(l|=512,f=e.tokenPos,_=e.pos),s||(s=e.tokenPos)):e.skip(43)&&(i?this.error(1042,e.range(),"protected"):(l|=1024,f=e.tokenPos,_=e.pos),s||(s=e.tokenPos));let d=0,m=0,h=0,b=0;e.skip(48)?(i?this.error(1042,e.range(),"static"):(l|=32,d=e.tokenPos,m=e.pos),s||(s=e.tokenPos)):(l|=262144,e.skip(0)&&(i||!t.is(128)?this.error(1042,e.range(),"abstract"):(l|=128,h=e.tokenPos,b=e.pos),s||(s=e.tokenPos)),t.flags&65536&&(l|=131072));let A=0,S=0;e.skip(40)&&(i||t.extendsType==null?this.error(1042,e.range(),"override"):(l|=8192,A=e.tokenPos,S=e.pos),s||(s=e.tokenPos));let k=0,w=0;if(e.peek()==45){let ue=e.mark();e.next(),e.peek()!=101?(e.discard(ue),l|=64,k=e.tokenPos,w=e.pos,s||(s=k)):e.reset(ue)}let R=0,C=0,M=!1;if(e.skip(2))switch(M=!0,R=e.tokenPos,C=e.pos,s||(s=R),i&&this.error(1031,e.range(R,C),"async"),e.peek()){case 44:case 42:case 43:case 48:case 0:case 45:case 40:case 12:{this.error(1042,e.range(R,C),"async"),e.next(),M=!1;break}}let O=e.mark(),D=!1,Q=!1,H=0,U=0,V=!1,Y=0,q=0;i||(e.skip(25)?e.peek(1)==116&&!e.peekOnNewLine()?(l|=2048,Q=!0,H=e.tokenPos,U=e.pos,s||(s=H),l&64&&this.error(1042,e.range(k,w),"readonly")):e.reset(O):e.skip(47)?e.peek(1)==116&&!e.peekOnNewLine()?(l|=4096,V=!0,Y=e.tokenPos,q=e.pos,s||(s=Y),l&64&&this.error(1042,e.range(k,w),"readonly")):e.reset(O):e.skip(10)&&(l|=524288,D=!0,s||(s=e.tokenPos),l&32&&this.error(1042,e.range(d,m),"static"),l&128&&this.error(1042,e.range(h,b),"abstract"),l&64&&this.error(1042,e.range(k,w),"readonly")));let ne=Q||V,j;if(D)j=y.createConstructorExpression(e.range());else{if(!ne&&e.skip(67)){s||(s=e.tokenPos),l&256?this.error(1042,e.range(f,_),"public"):l&1024?this.error(1042,e.range(f,_),"protected"):l&512&&this.error(1042,e.range(f,_),"private"),l&32&&this.error(1042,e.range(d,m),"static"),l&8192&&this.error(1042,e.range(A,S),"override"),l&128&&this.error(1042,e.range(h,b),"abstract");let ue=this.parseIndexSignature(e,l,a);return ue?(e.skip(71),ue):(l&64&&this.error(1042,e.range(k,w),"readonly"),null)}if(!e.skipIdentifier(2))return this.error(1003,e.range()),null;s||(s=e.tokenPos),j=y.createIdentifierExpression(e.readIdentifier(),e.range())}let ge=null;if(e.skip(73)){let ue=e.tokenPos;if(ge=this.parseTypeParameters(e),!ge)return null;D?this.error(1092,e.range(ue,e.pos)):ne?this.error(1094,e.range(ue,e.pos)):l|=65536}if(e.skip(65)){l&4&&this.error(1031,e.range(o,u),"declare");let ue=e.tokenPos,_e=this.parseParameters(e,D);if(!_e)return null;let It=this.parseParametersThis;if(D)for(let je=0,Fn=_e.length;je<Fn;++je){let dt=_e[je];if(dt.isAny(1856)){let fr=y.createFieldDeclaration(dt.name,null,dt.flags|262144,dt.type,null,dt.range);fr.parameterIndex=je,dt.implicitFieldDeclaration=fr,t.members.push(fr)}}else Q?_e.length&&this.error(1054,j.range):V?(_e.length!=1&&this.error(1049,j.range),_e.length>0&&_e[0].initializer&&this.error(1052,j.range)):j.text=="constructor"&&this.error(230,j.range,"constructor");let Fe=null;if(e.skip(101)){if(j.kind==28?this.error(1093,e.range()):V&&this.error(1095,e.range()),Fe=this.parseType(e,V||j.kind==28),!Fe)return null}else Fe=y.createOmittedType(e.range(e.pos)),!V&&j.kind!=28&&this.error(1110,Fe.range);let vi=y.createFunctionType(_e,Fe,It,!1,e.range(ue,e.pos)),qt=null;if(e.skip(63)){l&32768?this.error(1183,e.range()):l&128?this.error(1245,e.range(),j.text):i&&this.error(1005,e.range(),";");let je=this.inAsyncContext;if(this.inAsyncContext=M,qt=this.parseBlockStatement(e,!1),this.inAsyncContext=je,!qt)return null}else!i&&!(l&32896)&&this.error(2391,e.range());let Dr=M;M&&(j.kind==28||ne)&&(Dr=!1,this.error(1042,e.range(R,C),"async"));let kn=y.createMethodDeclaration(j,a,l,ge,vi,qt,e.range(s,e.pos),Dr);return i&&e.skip(72)||e.skip(71),kn}else if(D)this.error(2390,j.range);else if(ne)this.error(2391,j.range);else{M&&this.error(1042,e.range(R,C),"async"),l&4&&this.error(100,e.range(o,u),"Ambient fields"),l&128&&this.error(1042,e.range(h,b),"abstract"),l&2048&&this.error(1042,e.range(H,U),"get"),l&4096&&this.error(1042,e.range(Y,q),"set");let ue=null;if(e.skip(100)&&this.error(219,e.range(s,e.pos)),e.skip(96)&&(l|=16384),e.skip(101)){if(ue=this.parseType(e),!ue)return null}else this.error(1110,e.range());let _e=null;if(e.skip(102)){if(l&32768&&this.error(1039,e.range()),_e=this.parseExpression(e),!_e)return null;l&16384&&this.error(1263,j.range)}let It=e.range(s,e.pos);(l&16384)!=0&&(i||(l&32768)!=0)&&this.error(1255,It);let Fe=y.createFieldDeclaration(j,a,l,ue,_e,It);return i&&e.skip(72)||e.skip(71),Fe}return null}parseIndexSignature(e,t,i){i&&i.length>0&&this.error(1206,ce.join(i[0].range,i[i.length-1].range));let s=e.tokenPos;if(e.skipIdentifier())if(e.readIdentifier()=="key")if(e.skip(101)){let l=this.parseType(e);if(!l)return null;if(l.kind!=1)return this.error(1110,e.range()),null;if(e.skip(68))if(e.skip(101)){let o=this.parseType(e);return o?o.kind!=1?(this.error(1003,o.range),null):y.createIndexSignature(l,o,t,e.range(s,e.pos)):null}else this.error(1005,e.range(),":");else this.error(1005,e.range(),"]")}else this.error(1005,e.range(),":");else this.error(1005,e.range(),"key");else this.error(1003,e.range());return null}parseNamespace(e,t,i,s){if(e.skipIdentifier()){let a=y.createIdentifierExpression(e.readIdentifier(),e.range());if(e.skip(63)){let l=new Array,o=y.createNamespaceDeclaration(a,i,t,l,e.range(s,e.pos));for(;!e.skip(64);){let u=this.parseTopLevelStatement(e,o);if(u){if(u.kind==39)return this.error(1319,u.range),null;l.push(u)}else if(this.skipStatement(e),e.skip(122))return this.error(1005,e.range(),"}"),null}return o.range.end=e.pos,o.overriddenModuleName=this.currentModuleName,e.skip(71),o}else this.error(1005,e.range(),"{")}else this.error(1003,e.range());return null}parseExport(e,t,i){let s=null,a=assert(this.currentSource);if(e.skip(63)){let l=new Array;for(;!e.skip(64);){let u=this.parseExportMember(e);if(!u)return null;if(l.push(u),!e.skip(72)){if(e.skip(64))break;return this.error(1005,e.range(),"}"),null}}if(e.skip(23))if(e.skip(117))s=y.createStringLiteralExpression(e.readString(),e.range());else return this.error(1141,e.range()),null;let o=y.createExportStatement(l,s,i,e.range(t,e.pos));if(s){let u=assert(o.internalPath);this.seenlog.has(u)||(this.dependees.set(u,new Bs(a,s)),this.backlog.push(u),this.seenlog.add(u))}return e.skip(71),o}else if(e.skip(85))if(e.skip(23))if(e.skip(117)){s=y.createStringLiteralExpression(e.readString(),e.range());let l=y.createExportStatement(null,s,i,e.range(t,e.pos)),o=assert(l.internalPath),u=e.source,c=u.exportPaths;return c?c.includes(o)||c.push(o):u.exportPaths=[o],this.seenlog.has(o)||(this.dependees.set(o,new Bs(a,s)),this.backlog.push(o)),e.skip(71),l}else this.error(1141,e.range());else this.error(1005,e.range(),"from");else this.error(1005,e.range(),"{");return null}parseExportMember(e){if(e.skipIdentifier(2)){let t=y.createIdentifierExpression(e.readIdentifier(),e.range()),i=null;if(e.skip(1))if(e.skipIdentifier(2))i=y.createIdentifierExpression(e.readIdentifier(),e.range());else return this.error(1003,e.range()),null;return i?y.createExportMember(t,i,ce.join(t.range,i.range)):y.createExportMember(t,null,t.range)}else this.error(1003,e.range());return null}parseExportDefaultAlias(e,t,i,s){let a=e.readIdentifier(),l=e.range(),o=y.createExportStatement([y.createExportMember(y.createIdentifierExpression(a,l),y.createIdentifierExpression("default",e.range(i,s)),l)],null,!1,e.range(t,e.pos));return e.skip(71),o}parseImport(e){let t=e.tokenPos,i=null,s=null,a=!1;if(e.skip(63))for(i=new Array;!e.skip(64);){let l=this.parseImportDeclaration(e);if(!l)return null;if(i.push(l),!e.skip(72)){if(e.skip(64))break;return this.error(1005,e.range(),"}"),null}}else if(e.skip(85))if(e.skip(1))if(e.skipIdentifier())s=y.createIdentifierExpression(e.readIdentifier(),e.range());else return this.error(1003,e.range()),null;else return this.error(1005,e.range(),"as"),null;else if(e.skip(116,1)){let l=e.readIdentifier(),o=e.range();if(i=[y.createImportDeclaration(y.createIdentifierExpression("default",o),y.createIdentifierExpression(l,o),o)],e.skip(72))return this.error(100,e.range(),"Mixed default and named imports"),null}else a=!0;if(a||e.skip(23))if(e.skip(117)){let l=y.createStringLiteralExpression(e.readString(),e.range()),o;s?(assert(!i),o=y.createWildcardImportStatement(s,l,e.range(t,e.pos))):o=y.createImportStatement(i,l,e.range(t,e.pos));let u=o.internalPath;return this.seenlog.has(u)||(this.dependees.set(u,new Bs(assert(this.currentSource),l)),this.backlog.push(u)),e.skip(71),o}else this.error(1141,e.range());else this.error(1005,e.range(),"from");return null}parseImportDeclaration(e){if(e.skipIdentifier(2)){let t=y.createIdentifierExpression(e.readIdentifier(),e.range()),i=null;if(e.skip(1))if(e.skipIdentifier())i=y.createIdentifierExpression(e.readIdentifier(),e.range());else return this.error(1003,e.range()),null;return i?y.createImportDeclaration(t,i,ce.join(t.range,i.range)):y.createImportDeclaration(t,null,t.range)}else this.error(1003,e.range());return null}parseExportImport(e,t){if(e.skipIdentifier()){let i=y.createIdentifierExpression(e.readIdentifier(),e.range());if(e.skip(102))if(e.skipIdentifier()){let s=y.createIdentifierExpression(e.readIdentifier(),e.range()),a=y.createExportImportStatement(s,i,e.range(t,e.pos));return e.skip(71),a}else this.error(1003,e.range());else this.error(1005,e.range(),"=")}else this.error(1003,e.range());return null}parseStatement(e,t=!1){let i=e.mark(),s=e.next(),a=null;switch(s){case 4:{a=this.parseBreak(e);break}case 8:{a=this.parseVariable(e,8,null,e.tokenPos);break}case 9:{a=this.parseContinue(e);break}case 15:{a=this.parseDoStatement(e);break}case 22:{a=this.parseForStatement(e);break}case 26:{a=this.parseIfStatement(e);break}case 34:{a=this.parseVariable(e,16,null,e.tokenPos);break}case 58:{a=this.parseVariable(e,0,null,e.tokenPos);break}case 63:{a=this.parseBlockStatement(e,t);break}case 46:{t&&this.error(1108,e.range()),a=this.parseReturn(e);break}case 71:return y.createEmptyStatement(e.range(e.tokenPos));case 51:{a=this.parseSwitchStatement(e);break}case 53:{a=this.parseThrowStatement(e);break}case 55:{a=this.parseTryStatement(e);break}case 59:{a=this.parseVoidStatement(e);break}case 60:{a=this.parseWhileStatement(e);break}case 56:if(e.peek(1)==116){a=this.parseTypeDeclaration(e,0,null,e.tokenPos);break}default:{e.reset(i),a=this.parseExpressionStatement(e);break}}return a?e.discard(i):(e.reset(i),this.skipStatement(e)),a}parseBlockStatement(e,t){let i=e.tokenPos,s=new Array;for(;!e.skip(64);){let l=e.mark(),o=this.parseStatement(e,t);if(o)e.discard(l),s.push(o);else{if(e.token==122)return null;e.reset(l),this.skipStatement(e)}}let a=y.createBlockStatement(s,e.range(i,e.pos));return t&&e.skip(71),a}parseBreak(e){let t=null;e.peek()==116&&!e.peekOnNewLine()&&(e.next(1),t=y.createIdentifierExpression(e.readIdentifier(),e.range()));let i=y.createBreakStatement(t,e.range());return e.skip(71),i}parseContinue(e){let t=null;e.peek()==116&&!e.peekOnNewLine()&&(e.next(1),t=y.createIdentifierExpression(e.readIdentifier(),e.range()));let i=y.createContinueStatement(t,e.range());return e.skip(71),i}parseDoStatement(e){let t=e.tokenPos,i=this.parseStatement(e);if(!i)return null;if(e.skip(60))if(e.skip(65)){let s=this.parseExpression(e);if(!s)return null;if(e.skip(66)){let a=y.createDoStatement(i,s,e.range(t,e.pos));return e.skip(71),a}else this.error(1005,e.range(),")")}else this.error(1005,e.range(),"(");else this.error(1005,e.range(),"while");return null}parseExpressionStatement(e){let t=this.parseExpression(e);if(!t)return null;let i=y.createExpressionStatement(t);return e.skip(71),i}parseForStatement(e){let t=e.tokenPos;if(e.skip(65)){let i=null;if(e.skip(8))i=this.parseVariable(e,8,null,e.tokenPos,!0);else if(e.skip(34))i=this.parseVariable(e,16,null,e.tokenPos,!0);else if(e.skip(58))i=this.parseVariable(e,0,null,e.tokenPos,!0);else if(!e.skip(71)&&(i=this.parseExpressionStatement(e),!i))return null;if(i){if(e.skip(39)){if(i.kind==42)return i.expression.kind!=8?(this.error(1003,i.range),null):this.parseForOfStatement(e,t,i);if(i.kind==51){let s=i.declarations;for(let a=0,l=s.length;a<l;++a){let u=s[a].initializer;u&&this.error(1190,u.range)}return this.parseForOfStatement(e,t,i)}return this.error(1003,i.range),null}if(i.kind==51){let s=i.declarations;for(let a=0,l=s.length;a<l;++a){let o=s[a];o.initializer||(o.flags&8?this.error(1155,o.name.range):o.type||this.error(1110,o.name.range.atEnd))}}}if(e.token==71){let s=null;if(!e.skip(71)&&(s=this.parseExpressionStatement(e),!s))return null;if(e.token==71){let a=null;if(!e.skip(66)){if(a=this.parseExpression(e),!a)return null;if(!e.skip(66))return this.error(1005,e.range(),")"),null}let l=this.parseStatement(e);return l?y.createForStatement(i,s?s.expression:null,a,l,e.range(t,e.pos)):null}else this.error(1005,e.range(),";")}else this.error(1005,e.range(),";")}else this.error(1005,e.range(),"(");return null}parseForOfStatement(e,t,i){let s=this.parseExpression(e);if(!s)return null;if(!e.skip(66))return this.error(1005,e.range(),")"),null;let a=this.parseStatement(e);return a?y.createForOfStatement(i,s,a,e.range(t,e.pos)):null}parseIfStatement(e){let t=e.tokenPos;if(e.skip(65)){let i=this.parseExpression(e);if(!i)return null;if(e.skip(66)){let s=this.parseStatement(e);if(!s)return null;let a=null;return e.skip(16)&&(a=this.parseStatement(e),!a)?null:y.createIfStatement(i,s,a,e.range(t,e.pos))}else this.error(1005,e.range(),")")}else this.error(1005,e.range(),"(");return null}parseSwitchStatement(e){let t=e.tokenPos;if(e.skip(65)){let i=this.parseExpression(e);if(!i)return null;if(e.skip(66))if(e.skip(63)){let s=new Array;for(;!e.skip(64);){let l=this.parseSwitchCase(e);if(!l)return null;s.push(l)}let a=y.createSwitchStatement(i,s,e.range(t,e.pos));return e.skip(71),a}else this.error(1005,e.range(),"{");else this.error(1005,e.range(),")")}else this.error(1005,e.range(),"(");return null}parseSwitchCase(e){let t=e.tokenPos,i,s;if(e.skip(5)){let a=this.parseExpression(e);if(!a)return null;if(e.skip(101)){for(i=new Array;e.peek()!=5&&e.nextToken!=13&&e.nextToken!=64;){if(s=this.parseStatement(e),!s)return null;i.push(s)}return y.createSwitchCase(a,i,e.range(t,e.pos))}else this.error(1005,e.range(),":")}else if(e.skip(13))if(e.skip(101)){for(i=new Array;e.peek()!=5&&e.nextToken!=13&&e.nextToken!=64;){if(s=this.parseStatement(e),!s)return null;i.push(s)}return y.createSwitchCase(null,i,e.range(t,e.pos))}else this.error(1005,e.range(),":");else this.error(1130,e.range());return null}parseThrowStatement(e){let t=e.tokenPos,i=this.parseExpression(e);if(!i)return null;let s=y.createThrowStatement(i,e.range(t,e.pos));return e.skip(71)||this.checkASI(e),s}parseTryStatement(e){let t=e.tokenPos,i;if(e.skip(63)){let s=new Array;for(;!e.skip(64);){if(i=this.parseStatement(e),!i)return null;s.push(i)}let a=null,l=null,o=null;if(e.skip(6)){if(!e.skip(65))return this.error(1005,e.range(),"("),null;if(!e.skipIdentifier())return this.error(1003,e.range()),null;if(a=y.createIdentifierExpression(e.readIdentifier(),e.range()),!e.skip(66))return this.error(1005,e.range(),")"),null;if(!e.skip(63))return this.error(1005,e.range(),"{"),null;for(l=[];!e.skip(64);){if(i=this.parseStatement(e),!i)return null;l.push(i)}}if(e.skip(21)){if(!e.skip(63))return this.error(1005,e.range(),"{"),null;for(o=[];!e.skip(64);){if(i=this.parseStatement(e),!i)return null;o.push(i)}}if(!(l||o))return this.error(1005,e.range(),"catch"),null;let u=y.createTryStatement(s,a,l,o,e.range(t,e.pos));return e.skip(71),u}else this.error(1005,e.range(),"{");return null}parseTypeDeclaration(e,t,i,s){if(e.skipIdentifier()){let a=y.createIdentifierExpression(e.readIdentifier(),e.range()),l=null;if(e.skip(73)){if(l=this.parseTypeParameters(e),!l)return null;t|=65536}if(e.skip(102)){e.skip(94);let o=this.parseType(e);if(!o)return null;if(Ls(a.text,o))return this.error(2456,a.range,a.text),null;let u=y.createTypeDeclaration(a,i,t,l,o,e.range(s,e.pos));return e.skip(71),u.overriddenModuleName=this.currentModuleName,u}else this.error(1005,e.range(),"=")}else this.error(1003,e.range());return null}parseModuleDeclaration(e,t){let i=e.tokenPos;assert(e.next()==117);let s=e.readString(),a=y.createModuleDeclaration(s,t,e.range(i,e.pos));return this.currentModuleName=s,e.skip(71),a}parseVoidStatement(e){let t=e.tokenPos,i=this.parseExpression(e,21);if(!i)return null;let s=y.createVoidStatement(i,e.range(t,e.pos));return e.skip(71),s}parseWhileStatement(e){let t=e.tokenPos;if(e.skip(65)){let i=this.parseExpression(e);if(!i)return null;if(e.skip(66)){let s=this.parseStatement(e);if(!s)return null;let a=y.createWhileStatement(i,s,e.range(t,e.pos));return e.skip(71),a}else this.error(1005,e.range(),")")}else this.error(1005,e.range(),"(");return null}parseExpressionStart(e){let t=e.next(1),i=e.tokenPos;switch(t){case 70:case 62:case 96:case 97:case 82:case 83:case 57:case 59:case 14:{let s=this.parseExpression(e,17);return s?y.createUnaryPrefixExpression(t,s,e.range(i,e.pos)):null}case 115:{let s=this.parseLazyExpression(e,i);return s||null}case 3:{let s=e.pos,a=this.parseExpression(e,17);if(!a)return null;if(this.inAsyncContext||this.error(1308,e.range(i,s)),a.kind==32){let l=this.awaitNullifiedLazyExpressions;l==null&&(l=new Set,this.awaitNullifiedLazyExpressions=l),l.add(a)}return y.createAwaitExpression(a,e.range(i,e.pos))}case 2:{let s=e.pos;if(e.peekOnNewLine())return this.error(1042,e.range(i,s),"async"),null;switch(e.peek()){case 24:{e.next();let a=this.parseFunctionExpression(e,!0);return a?(a.range.start=i,a):null}case 65:{e.next();let a=this.parseFunctionExpression(e,!0);return a?(a.range.start=i,a):null}case 116:{if(!e.peekOnNewLine()){e.next();let a=y.createIdentifierExpression(e.readIdentifier(),e.range(i,e.pos));if(e.peek()==81&&!e.peekOnNewLine()){let l=this.parseFunctionExpressionCommon(e,y.createEmptyIdentifierExpression(e.range(i)),[y.createParameter(0,a,y.createOmittedType(a.range.atEnd),null,a.range)],null,2,i,-1,!0);return l||null}}break}}return this.error(1042,e.range(i,s),"async"),null}case 88:case 89:{let s=this.parseExpression(e,17);if(!s)return null;switch(s.kind){case 8:case 14:case 23:break;default:this.error(2357,s.range)}return y.createUnaryPrefixExpression(t,s,e.range(i,e.pos))}case 37:{if(!e.skipIdentifier())return this.error(1003,e.range()),null;let s=this.parseTypeName(e);if(!s)return null;let a=null,l=null;if(e.skip(65)||(a=this.tryParseTypeArgumentsBeforeArguments(e))){if(l=this.parseArguments(e),!l)return null}else l=[];return y.createNewExpression(s,a,l,e.range(i,e.pos))}case 38:return y.createNullExpression(e.range());case 54:return y.createTrueExpression(e.range());case 20:return y.createFalseExpression(e.range());case 52:return y.createThisExpression(e.range());case 10:return y.createConstructorExpression(e.range());case 65:{if(e.skip(66))return this.parseFunctionExpressionCommon(e,y.createEmptyIdentifierExpression(e.range(i)),[],null,1);let s=e.mark(),a=!0;do switch(e.next(1)){case 70:return e.reset(s),this.parseFunctionExpression(e);case 116:{switch(e.readIdentifier(),e.next()){case 66:{if(e.skip(101)&&this.parseType(e,!0,!0)==null){a=!1;break}if(!e.skip(81)){a=!1;break}}case 101:return e.reset(s),this.parseFunctionExpression(e);case 100:{if(e.skip(101)||e.skip(72)||e.skip(66))return e.reset(s),this.parseFunctionExpression(e);a=!1;break}case 72:break;default:{a=!1;break}}break}default:{a=!1;break}}while(a);e.reset(s);let l=this.parseExpression(e);return l?e.skip(66)?(l=y.createParenthesizedExpression(l,e.range(i,e.pos)),this.maybeParseCallExpression(e,l)):(this.error(1005,e.range(),")"),null):null}case 67:{let s=new Array;for(;!e.skip(68);){let a;if(e.peek()==72)a=y.createOmittedExpression(e.range(e.pos));else if(a=this.parseExpression(e,2),!a)return null;if(s.push(a),!e.skip(72)){if(e.skip(68))break;return this.error(1005,e.range(),"]"),null}}return y.createArrayLiteralExpression(s,e.range(i,e.pos))}case 63:{let s=e.tokenPos,a=new Array,l=new Array,o;for(;!e.skip(64);){if(e.skipIdentifier())o=y.createIdentifierExpression(e.readIdentifier(),e.range());else{if(!e.skip(117))return this.error(1003,e.range()),null;o=y.createIdentifierExpression(e.readString(),e.range()),o.isQuoted=!0}if(a.push(o),e.skip(101)){let u=this.parseExpression(e,2);if(!u)return null;l.push(u)}else if(!o.isQuoted)l.push(o);else return this.error(1005,e.range(),":"),null;if(!e.skip(72)){if(e.skip(64))break;return this.error(1005,e.range(),"}"),null}}return y.createObjectLiteralExpression(a,l,e.range(s,e.pos))}case 73:{let s=this.parseType(e);if(!s)return null;if(!e.skip(74))return this.error(1005,e.range(),">"),null;let a=this.parseExpression(e,19);return a?y.createAssertionExpression(0,a,s,e.range(i,e.pos)):null}case 116:{let s=e.readIdentifier();if(s=="null")return y.createNullExpression(e.range());let a=y.createIdentifierExpression(s,e.range(i,e.pos));return e.skip(120)?this.parseTemplateLiteral(e,a):e.peek()==81&&!e.peekOnNewLine()?this.parseFunctionExpressionCommon(e,y.createEmptyIdentifierExpression(e.range(i)),[y.createParameter(0,a,y.createOmittedType(a.range.atEnd),null,a.range)],null,2,i):this.maybeParseCallExpression(e,a,!0)}case 50:{e.peek()!=69&&e.nextToken!=65&&this.error(1034,e.range());let s=y.createSuperExpression(e.range(i,e.pos));return this.maybeParseCallExpression(e,s)}case 117:return y.createStringLiteralExpression(e.readString(),e.range(i,e.pos));case 120:return this.parseTemplateLiteral(e);case 118:{let s=e.readInteger();return e.checkForIdentifierStartAfterNumericLiteral(),y.createIntegerLiteralExpression(s,e.range(i,e.pos))}case 119:{let s=e.readFloat();return e.checkForIdentifierStartAfterNumericLiteral(),y.createFloatLiteralExpression(s,e.range(i,e.pos))}case 86:{let s=e.readRegexpPattern();return e.skip(86)?y.createRegexpLiteralExpression(s,e.readRegexpFlags(),e.range(i,e.pos)):(this.error(1005,e.range(),"/"),null)}case 24:{let s=this.parseFunctionExpression(e);return s?this.maybeParseCallExpression(e,s):null}case 7:return this.parseClassExpression(e);default:return t==122?this.error(1126,e.range(i)):this.error(1109,e.range()),null}}tryParseTypeArgumentsBeforeArguments(e){let t=e.mark();if(!e.skip(73))return null;let i=e.tokenPos,s=null;do{if(e.peek()==74)break;let a=this.parseType(e,!0,!0);if(!a)return e.reset(t),null;s?s.push(a):s=[a]}while(e.skip(72));if(e.skip(74)){let a=e.pos;if(e.skip(65))return s||this.error(1099,e.range(i,a)),s}return e.reset(t),null}parseArguments(e){let t=new Array;for(;!e.skip(66);){let i=this.parseExpression(e,2);if(!i)return null;if(t.push(i),!e.skip(72)){if(e.skip(66))break;return this.error(1005,e.range(),")"),null}}return t}parseLazyExpression(e,t){if(!e.skipIdentifier())return this.error(1003,e.range()),null;let i=e.readIdentifier();if(i!="lazy")return this.error(212,e.range(t,e.pos),i),null;let s=this.parseExpression(e,17);if(!s)return null;let a=y.createLazyExpression(s,e.range(t,e.pos)),l=this.unplacedLazyExpressions;return l==null&&(l=new Set,this.unplacedLazyExpressions=l),l.add(a),a}parseExpression(e,t=1){assert(t!=0);let i=this.parseExpressionStart(e);if(!i)return null;let s=i.range.start,a;for(;(a=Q1(e.peek()))>=t;){let l=e.next();switch(l){case 1:{if(e.skip(8))i=y.createAssertionExpression(3,i,null,e.range(s,e.pos));else{let o=this.parseType(e);if(!o)return null;i=y.createAssertionExpression(1,i,o,e.range(s,e.pos))}break}case 96:{i=y.createAssertionExpression(2,i,null,e.range(s,e.pos)),i=this.maybeParseCallExpression(e,i);break}case 30:{let o=this.parseType(e);if(!o)return null;i=y.createInstanceOfExpression(i,o,e.range(s,e.pos));break}case 67:{let o=this.parseExpression(e);if(!o)return null;if(!e.skip(68))return this.error(1005,e.range(),"]"),null;i=y.createElementAccessExpression(i,o,e.range(s,e.pos)),i=this.maybeParseCallExpression(e,i);break}case 88:case 89:{i.kind!=8&&i.kind!=14&&i.kind!=23&&this.error(2357,i.range),i=y.createUnaryPostfixExpression(l,i,e.range(s,e.pos));break}case 100:{let o=this.parseExpression(e);if(!o)return null;if(!e.skip(101))return this.error(1005,e.range(),":"),null;let u=this.parseExpression(e,t>1?2:1);if(!u)return null;i=y.createTernaryExpression(i,o,u,e.range(s,e.pos));break}case 72:{let o=[i];do{if(i=this.parseExpression(e,2),!i)return null;o.push(i)}while(e.skip(72));i=y.createCommaExpression(o,e.range(s,e.pos));break}case 69:{if(e.skipIdentifier(2)){let o=y.createIdentifierExpression(e.readIdentifier(),e.range());i=y.createPropertyAccessExpression(i,o,e.range(s,e.pos))}else{let o=this.parseExpression(e,a+1);if(!o)return null;if(o.kind==11){if(i=this.joinPropertyCall(e,s,i,o),!i)return null}else return this.error(1003,o.range),null}if(e.skip(120)){if(i=this.parseTemplateLiteral(e,i),!i)return null}else i=this.maybeParseCallExpression(e,i,!0);break}case 102:case 103:case 104:case 106:case 105:case 107:case 108:case 109:case 110:case 111:case 112:case 114:case 113:case 84:{let o=this.parseExpression(e,a);if(!o)return null;i=y.createBinaryExpression(l,i,o,e.range(s,e.pos));break}case 73:case 74:case 75:case 76:case 77:case 79:case 80:case 78:case 82:case 83:case 85:case 86:case 87:case 90:case 91:case 92:case 93:case 94:case 95:case 98:case 99:case 29:{let o=this.parseExpression(e,a+1);if(!o)return null;i=y.createBinaryExpression(l,i,o,e.range(s,e.pos));break}default:assert(!1)}}return i}parseTemplateLiteral(e,t=null){let i=t?t.range.start:e.tokenPos,s=new Array,a=new Array,l=new Array;for(s.push(e.readString(0,t!=null)),a.push(e.source.text.substring(e.readStringStart,e.readStringEnd));e.readingTemplateString;){let o=this.parseExpression(e);if(!o)return null;if(l.push(o),!e.skip(64))return this.error(1005,e.range(),"}"),null;s.push(e.readString(96,t!=null)),a.push(e.source.text.substring(e.readStringStart,e.readStringEnd))}return y.createTemplateLiteralExpression(t,s,a,l,e.range(i,e.pos))}joinPropertyCall(e,t,i,s){let a=s.expression;switch(a.kind){case 8:{s.expression=y.createPropertyAccessExpression(i,a,e.range(t,e.pos));break}case 11:{let l=this.joinPropertyCall(e,t,i,a);if(!l)return null;s.expression=l,s.range=e.range(t,e.pos);break}default:return this.error(1003,s.range),null}return s}maybeParseCallExpression(e,t,i=!1){let s=null;for(;e.skip(65)||i&&(s=this.tryParseTypeArgumentsBeforeArguments(e));){let a=this.parseArguments(e);if(!a)break;t=y.createCallExpression(t,s,a,e.range(t.range.start,e.pos)),i=!1}return t}checkASI(e){let t=e.peek();t==122||t==64||e.peekOnNewLine()||this.error(1012,e.range(e.nextTokenPos))}skipStatement(e){e.peekOnNewLine()&&e.next();do{let t=e.peek();if(t==122||t==71){e.next();break}if(e.peekOnNewLine())break;switch(e.next()){case 116:{e.readIdentifier();break}case 117:case 120:{e.readString();break}case 118:{e.readInteger(),e.checkForIdentifierStartAfterNumericLiteral();break}case 119:{e.readFloat(),e.checkForIdentifierStartAfterNumericLiteral();break}case 63:{this.skipBlock(e);break}}}while(!0);e.readingTemplateString=!1}skipBlock(e){let t=1,i=!0;do switch(e.next()){case 122:{this.error(1005,e.range(),"}"),i=!1;break}case 63:{++t;break}case 64:{--t,t||(i=!1);break}case 116:{e.readIdentifier();break}case 117:{e.readString();break}case 120:{for(e.readString();e.readingTemplateString;)this.skipBlock(e),e.readString(96);break}case 118:{e.readInteger(),e.checkForIdentifierStartAfterNumericLiteral();break}case 119:{e.readFloat(),e.checkForIdentifierStartAfterNumericLiteral();break}}while(i)}},nx=(C=>(C[C.None=0]="None",C[C.Comma=1]="Comma",C[C.Spread=2]="Spread",C[C.Yield=3]="Yield",C[C.Assignment=4]="Assignment",C[C.Conditional=5]="Conditional",C[C.LogicalOr=6]="LogicalOr",C[C.LogicalAnd=7]="LogicalAnd",C[C.BitwiseOr=8]="BitwiseOr",C[C.BitwiseXor=9]="BitwiseXor",C[C.BitwiseAnd=10]="BitwiseAnd",C[C.Equality=11]="Equality",C[C.Relational=12]="Relational",C[C.Shift=13]="Shift",C[C.Additive=14]="Additive",C[C.Multiplicative=15]="Multiplicative",C[C.Exponentiated=16]="Exponentiated",C[C.UnaryPrefix=17]="UnaryPrefix",C[C.UnaryPostfix=18]="UnaryPostfix",C[C.Call=19]="Call",C[C.MemberAccess=20]="MemberAccess",C[C.Grouping=21]="Grouping",C))(nx||{});function Q1(n){switch(n){case 72:return 1;case 102:case 103:case 104:case 106:case 105:case 107:case 108:case 109:case 110:case 111:case 112:case 114:case 113:return 4;case 100:return 5;case 99:return 6;case 98:return 7;case 94:return 8;case 95:return 9;case 93:return 10;case 77:case 78:case 79:case 80:return 11;case 1:case 29:case 30:case 73:case 74:case 75:case 76:return 12;case 90:case 91:case 92:return 13;case 82:case 83:return 14;case 85:case 86:case 87:return 15;case 84:return 16;case 88:case 89:return 18;case 69:case 67:case 96:return 20}return 0}function Ls(n,r){switch(r.kind){case 1:{if(r.name.identifier.text==n)return!0;let e=r.typeArguments;if(e){for(let t=0,i=e.length;t<i;t++)if(Ls(n,e[t]))return!0}break}case 2:{let e=r;if(Ls(n,e.returnType))return!0;let t=e.parameters;for(let i=0,s=t.length;i<s;i++)if(Ls(n,t[i].type))return!0;break}case 3:{let e=r.elements;for(let t=0,i=e.length;t<i;t++)if(Ls(n,e[t]))return!0;break}default:assert(!1)}return!1}var ix=16,si=ix-1,Jo=class{constructor(r,e,t,i,s){this.localFile=r;this.localIdentifier=e;this.foreignIdentifier=t;this.foreignPath=i;this.foreignPathAlt=s}},eu=class{constructor(r,e,t,i){this.localIdentifier=r;this.foreignIdentifier=e;this.foreignPath=t;this.foreignPathAlt=i}},vf=class{constructor(r,e,t){this.foreignPath=r;this.foreignPathAlt=e;this.pathLiteral=t}},Me=(q=>(q[q.Invalid=0]="Invalid",q[q.IndexedGet=1]="IndexedGet",q[q.IndexedSet=2]="IndexedSet",q[q.UncheckedIndexedGet=3]="UncheckedIndexedGet",q[q.UncheckedIndexedSet=4]="UncheckedIndexedSet",q[q.Add=5]="Add",q[q.Sub=6]="Sub",q[q.Mul=7]="Mul",q[q.Div=8]="Div",q[q.Rem=9]="Rem",q[q.Pow=10]="Pow",q[q.BitwiseAnd=11]="BitwiseAnd",q[q.BitwiseOr=12]="BitwiseOr",q[q.BitwiseXor=13]="BitwiseXor",q[q.BitwiseShl=14]="BitwiseShl",q[q.BitwiseShr=15]="BitwiseShr",q[q.BitwiseShrU=16]="BitwiseShrU",q[q.Eq=17]="Eq",q[q.Ne=18]="Ne",q[q.Gt=19]="Gt",q[q.Ge=20]="Ge",q[q.Lt=21]="Lt",q[q.Le=22]="Le",q[q.Plus=23]="Plus",q[q.Minus=24]="Minus",q[q.Not=25]="Not",q[q.BitwiseNot=26]="BitwiseNot",q[q.PrefixInc=27]="PrefixInc",q[q.PrefixDec=28]="PrefixDec",q[q.PostfixInc=29]="PostfixInc",q[q.PostfixDec=30]="PostfixDec",q))(Me||{});(i=>{function n(s,a){switch(assert(a.length),s){case 2:case 3:{switch(a.charCodeAt(0)){case 91:{if(a=="[]")return 1;if(a=="[]=")return 2;break}case 123:{if(a=="{}")return 3;if(a=="{}=")return 4;break}case 43:{if(a=="+")return 5;break}case 45:{if(a=="-")return 6;break}case 42:{if(a=="*")return 7;if(a=="**")return 10;break}case 47:{if(a=="/")return 8;break}case 37:{if(a=="%")return 9;break}case 38:{if(a=="&")return 11;break}case 124:{if(a=="|")return 12;break}case 94:{if(a=="^")return 13;break}case 61:{if(a=="==")return 17;break}case 33:{if(a=="!=")return 18;break}case 62:{if(a==">")return 19;if(a==">=")return 20;if(a==">>")return 15;if(a==">>>")return 16;break}case 60:{if(a=="<")return 21;if(a=="<=")return 22;if(a=="<<")return 14;break}}break}case 4:{switch(a.charCodeAt(0)){case 43:{if(a=="+")return 23;if(a=="++")return 27;break}case 45:{if(a=="-")return 24;if(a=="--")return 28;break}case 33:{if(a=="!")return 25;break}case 126:{if(a=="~")return 26;break}}break}case 5:{switch(a.charCodeAt(0)){case 43:{if(a=="++")return 29;break}case 45:{if(a=="--")return 30;break}}break}}return 0}i.fromDecorator=n;function r(s){switch(s){case 82:case 103:return 5;case 83:case 104:return 6;case 85:case 105:return 7;case 86:case 107:return 8;case 87:case 108:return 9;case 84:case 106:return 10;case 93:case 112:return 11;case 94:case 113:return 12;case 95:case 114:return 13;case 90:case 109:return 14;case 91:case 110:return 15;case 92:case 111:return 16;case 77:case 79:return 17;case 78:case 80:return 18;case 74:return 19;case 76:return 20;case 73:return 21;case 75:return 22}return 0}i.fromBinaryToken=r;function e(s){switch(s){case 82:return 23;case 83:return 24;case 96:return 25;case 97:return 26;case 88:return 27;case 89:return 28}return 0}i.fromUnaryPrefixToken=e;function t(s){switch(s){case 88:return 29;case 89:return 30}return 0}i.fromUnaryPostfixToken=t})(Me||={});var zs=class{constructor(r){this.leafCount=r}},Ds=class extends tt{constructor(e,t=null){super(t);this.options=e;this.sources=[];this.stdSources=new Set;this.diagnosticsOffset=0;this.nextClassId=0;this.nextSignatureId=0;this.initialized=!1;this.filesByName=new Map;this.elementsByName=new Map;this.elementsByDeclaration=new Map;this.instancesByName=new Map;this.wrapperClasses=new Map;this.managedClasses=new Map;this.uniqueSignatures=new Map;this.moduleImports=new Map;this._arrayBufferViewInstance=null;this._arrayBufferInstance=null;this._arrayPrototype=null;this._staticArrayPrototype=null;this._dynamicArrayPrototype=null;this._setPrototype=null;this._mapPrototype=null;this._functionPrototype=null;this._taskPrototype=null;this._int8ArrayPrototype=null;this._int16ArrayPrototype=null;this._int32ArrayPrototype=null;this._int64ArrayPrototype=null;this._uint8ArrayPrototype=null;this._uint8ClampedArrayPrototype=null;this._uint16ArrayPrototype=null;this._uint32ArrayPrototype=null;this._uint64ArrayPrototype=null;this._float32ArrayPrototype=null;this._float64ArrayPrototype=null;this._stringInstance=null;this._regexpInstance=null;this._objectPrototype=null;this._objectInstance=null;this._templateStringsArrayInstance=null;this._allocInstance=null;this._reallocInstance=null;this._freeInstance=null;this._newInstance=null;this._renewInstance=null;this._linkInstance=null;this._collectInstance=null;this._visitInstance=null;this._newBufferInstance=null;this._newArrayInstance=null;this._BLOCKInstance=null;this._OBJECTInstance=null;this.nativeDummySignature=null;this.module=Jt.create(e.stackSize>0,e.sizeTypeRef),this.parser=new Ms(this.diagnostics,this.sources),this.resolver=new Rs(this);let i=new Vs(this,Te.native);this.nativeFile=i,this.filesByName.set(i.internalName,i),this.parser.options=this.options}get arrayBufferViewInstance(){let e=this._arrayBufferViewInstance;return e||(this._arrayBufferViewInstance=e=this.requireClass(L.ArrayBufferView)),e}get arrayBufferInstance(){let e=this._arrayBufferInstance;return e||(this._arrayBufferInstance=e=this.requireClass(L.ArrayBuffer)),e}get arrayPrototype(){let e=this._arrayPrototype;return e||(this._arrayPrototype=e=this.require(L.Array,6)),e}get staticArrayPrototype(){let e=this._staticArrayPrototype;return e||(this._staticArrayPrototype=e=this.require(L.StaticArray,6)),e}get dynamicArrayPrototype(){let e=this._dynamicArrayPrototype;return e||(this._dynamicArrayPrototype=e=this.require(L.DynamicArray,6)),e}get setPrototype(){let e=this._setPrototype;return e||(this._setPrototype=e=this.require(L.Set,6)),e}get mapPrototype(){let e=this._mapPrototype;return e||(this._mapPrototype=e=this.require(L.Map,6)),e}get functionPrototype(){let e=this._functionPrototype;return e||(this._functionPrototype=e=this.require(L.Function,6)),e}get taskPrototype(){let e=this._taskPrototype;if(!e){let t=J(this.elementsByName,L.Task);if(!t||t.kind!=6)return null;this._taskPrototype=e=t}return e}get int8ArrayPrototype(){let e=this._int8ArrayPrototype;return e||(this._int8ArrayPrototype=e=this.require(L.Int8Array,6)),e}get int16ArrayPrototype(){let e=this._int16ArrayPrototype;return e||(this._int16ArrayPrototype=e=this.require(L.Int16Array,6)),e}get int32ArrayPrototype(){let e=this._int32ArrayPrototype;return e||(this._int32ArrayPrototype=e=this.require(L.Int32Array,6)),e}get int64ArrayPrototype(){let e=this._int64ArrayPrototype;return e||(this._int64ArrayPrototype=e=this.require(L.Int64Array,6)),e}get uint8ArrayPrototype(){let e=this._uint8ArrayPrototype;return e||(this._uint8ArrayPrototype=e=this.require(L.Uint8Array,6)),e}get uint8ClampedArrayPrototype(){let e=this._uint8ClampedArrayPrototype;return e||(this._uint8ClampedArrayPrototype=e=this.require(L.Uint8ClampedArray,6)),e}get uint16ArrayPrototype(){let e=this._uint16ArrayPrototype;return e||(this._uint16ArrayPrototype=e=this.require(L.Uint16Array,6)),e}get uint32ArrayPrototype(){let e=this._uint32ArrayPrototype;return e||(this._uint32ArrayPrototype=e=this.require(L.Uint32Array,6)),e}get uint64ArrayPrototype(){let e=this._uint64ArrayPrototype;return e||(this._uint64ArrayPrototype=e=this.require(L.Uint64Array,6)),e}get float32ArrayPrototype(){let e=this._float32ArrayPrototype;return e||(this._float32ArrayPrototype=e=this.require(L.Float32Array,6)),e}get float64ArrayPrototype(){let e=this._float64ArrayPrototype;return e||(this._float64ArrayPrototype=e=this.require(L.Float64Array,6)),e}get stringInstance(){let e=this._stringInstance;return e||(this._stringInstance=e=this.requireClass(L.String)),e}get regexpInstance(){let e=this._regexpInstance;return e||(this._regexpInstance=e=this.requireClass(L.RegExp)),e}get objectPrototype(){let e=this._objectPrototype;return e||(this._objectPrototype=e=this.require(L.Object,6)),e}get objectInstance(){let e=this._objectInstance;return e||(this._objectInstance=e=this.requireClass(L.Object)),e}get templateStringsArrayInstance(){let e=this._templateStringsArrayInstance;return e||(this._templateStringsArrayInstance=e=this.requireClass(L.TemplateStringsArray)),e}get abortInstance(){let e=this.lookup(L.abort);return!e||e.kind!=4?null:this.resolver.resolveFunction(e,null)}get allocInstance(){let e=this._allocInstance;return e||(this._allocInstance=e=this.requireFunction(L.alloc)),e}get reallocInstance(){let e=this._reallocInstance;return e||(this._reallocInstance=e=this.requireFunction(L.realloc)),e}get freeInstance(){let e=this._freeInstance;return e||(this._freeInstance=e=this.requireFunction(L.free)),e}get newInstance(){let e=this._newInstance;return e||(this._newInstance=e=this.requireFunction(L.new_)),e}get renewInstance(){let e=this._renewInstance;return e||(this._renewInstance=e=this.requireFunction(L.renew)),e}get linkInstance(){let e=this._linkInstance;return e||(this._linkInstance=e=this.requireFunction(L.link)),e}get collectInstance(){let e=this._collectInstance;return e||(this._collectInstance=e=this.requireFunction(L.collect)),e}get visitInstance(){let e=this._visitInstance;return e||(this._visitInstance=e=this.requireFunction(L.visit)),e}get newBufferInstance(){let e=this._newBufferInstance;return e||(this._newBufferInstance=e=this.requireFunction(L.newBuffer)),e}get newArrayInstance(){let e=this._newArrayInstance;return e||(this._newArrayInstance=e=this.requireFunction(L.newArray)),e}get BLOCKInstance(){let e=this._BLOCKInstance;return e||(this._BLOCKInstance=e=this.requireClass(L.BLOCK)),e}get OBJECTInstance(){let e=this._OBJECTInstance;return e||(this._OBJECTInstance=e=this.requireClass(L.OBJECT)),e}getSource(e){let t=this.sources;for(let i=0;i<t.length;++i){let s=t[i];if(s.internalPath==e)return s.text}return null}get blockOverhead(){return this.BLOCKInstance.nextMemoryOffset}get objectOverhead(){return this.OBJECTInstance.nextMemoryOffset-this.blockOverhead+si&~si}get totalOverhead(){return this.blockOverhead+this.objectOverhead}searchFunctionByRef(e){let t=bf(e);if(t){let i=this.instancesByName;if(i.has(t)){let s=assert(i.get(t));if(s.kind==5)return s}}return null}computeBlockStart(e){let t=this.blockOverhead;return(e+t+si&~si)-t}computeBlockStart64(e){let t=i64_new(this.blockOverhead);return i64_sub(i64_align(i64_add(e,t),ix),t)}computeBlockSize(e,t){t&&(e+=this.objectOverhead);let i=this.computeBlockStart(e),s=this.blockOverhead,a=(3*this.options.usizeType.byteSize+s+si&~si)-s;i<a&&(i=a);let l=1<<30;if(i>=l||(i&3)!=0)throw new Error("invalid block size");return i}makeNativeVariableDeclaration(e,t=0){let i=Te.native.range;return y.createVariableDeclaration(y.createIdentifierExpression(e,i),null,t,null,null,i)}makeNativeTypeDeclaration(e,t=0){let i=Te.native.range,s=y.createIdentifierExpression(e,i);return y.createTypeDeclaration(s,null,t,null,y.createOmittedType(i),i)}makeNativeFunctionDeclaration(e,t=0){let i=Te.native.range,s=this.nativeDummySignature;return s||(this.nativeDummySignature=s=y.createFunctionType([],y.createNamedType(y.createSimpleTypeName(L.void_,i),null,!1,i),null,!1,i)),y.createFunctionDeclaration(y.createIdentifierExpression(e,i),null,t,null,s,null,0,i)}makeNativeNamespaceDeclaration(e,t=0){let i=Te.native.range;return y.createNamespaceDeclaration(y.createIdentifierExpression(e,i),null,t,[],i)}makeNativeFunction(e,t,i=this.nativeFile,s=0,a=0){return new Mt(e,new ot(e,i,this.makeNativeFunctionDeclaration(e,s),a),null,t)}getElementByDeclaration(e){let t=this.elementsByDeclaration;return t.has(e)?assert(t.get(e)):null}initialize(){if(this.initialized)return;this.initialized=!0;let e=this.options;this.registerNativeType(L.i8,p.i8),this.registerNativeType(L.i16,p.i16),this.registerNativeType(L.i32,p.i32),this.registerNativeType(L.i64,p.i64),this.registerNativeType(L.isize,e.isizeType),this.registerNativeType(L.u8,p.u8),this.registerNativeType(L.u16,p.u16),this.registerNativeType(L.u32,p.u32),this.registerNativeType(L.u64,p.u64),this.registerNativeType(L.usize,e.usizeType),this.registerNativeType(L.bool,p.bool),this.registerNativeType(L.f32,p.f32),this.registerNativeType(L.f64,p.f64),this.registerNativeType(L.void_,p.void),this.registerNativeType(L.number,p.f64),this.registerNativeType(L.boolean,p.bool),this.nativeFile.add(L.native,new lt(L.native,this.nativeFile,this.makeNativeTypeDeclaration(L.native,65538),512)),this.nativeFile.add(L.indexof,new lt(L.indexof,this.nativeFile,this.makeNativeTypeDeclaration(L.indexof,65538),512)),this.nativeFile.add(L.valueof,new lt(L.valueof,this.nativeFile,this.makeNativeTypeDeclaration(L.valueof,65538),512)),this.nativeFile.add(L.returnof,new lt(L.returnof,this.nativeFile,this.makeNativeTypeDeclaration(L.returnof,65538),512)),this.nativeFile.add(L.thisof,new lt(L.thisof,this.nativeFile,this.makeNativeTypeDeclaration(L.thisof,65538),512)),this.nativeFile.add(L.nonnull,new lt(L.nonnull,this.nativeFile,this.makeNativeTypeDeclaration(L.nonnull,65538),512)),this.registerNativeType(L.v128,p.v128),this.registerNativeType(L.ref_func,p.func),this.registerNativeType(L.ref_extern,p.extern),this.registerNativeType(L.ref_any,p.any),this.registerNativeType(L.ref_eq,p.eq),this.registerNativeType(L.ref_struct,p.struct),this.registerNativeType(L.ref_array,p.array),this.registerNativeType(L.ref_i31,p.i31),this.registerNativeType(L.ref_string,p.string),this.registerNativeType(L.ref_stringview_wtf8,p.stringview_wtf8),this.registerNativeType(L.ref_stringview_wtf16,p.stringview_wtf16),this.registerNativeType(L.ref_stringview_iter,p.stringview_iter),this.registerConstantInteger(L.ASC_TARGET,p.i32,i64_new(e.isWasm64?2:1)),this.registerConstantInteger(L.ASC_RUNTIME,p.i32,i64_new(e.runtime)),this.registerConstantInteger(L.ASC_NO_ASSERT,p.bool,i64_new(e.noAssert?1:0,0)),this.registerConstantInteger(L.ASC_MEMORY_BASE,p.i32,i64_new(e.memoryBase,0)),this.registerConstantInteger(L.ASC_TABLE_BASE,p.i32,i64_new(e.tableBase,0)),this.registerConstantInteger(L.ASC_OPTIMIZE_LEVEL,p.i32,i64_new(e.optimizeLevelHint,0)),this.registerConstantInteger(L.ASC_SHRINK_LEVEL,p.i32,i64_new(e.shrinkLevelHint,0)),this.registerConstantInteger(L.ASC_LOW_MEMORY_LIMIT,p.i32,i64_new(e.lowMemoryLimit,0)),this.registerConstantInteger(L.ASC_EXPORT_RUNTIME,p.bool,i64_new(e.exportRuntime?1:0,0)),this.registerConstantInteger(L.ASC_VERSION_MAJOR,p.i32,i64_new(e.bundleMajorVersion)),this.registerConstantInteger(L.ASC_VERSION_MINOR,p.i32,i64_new(e.bundleMinorVersion)),this.registerConstantInteger(L.ASC_VERSION_PATCH,p.i32,i64_new(e.bundlePatchVersion)),this.registerConstantInteger(L.ASC_FEATURE_SIGN_EXTENSION,p.bool,i64_new(e.hasFeature(1)?1:0,0)),this.registerConstantInteger(L.ASC_FEATURE_MUTABLE_GLOBALS,p.bool,i64_new(e.hasFeature(2)?1:0,0)),this.registerConstantInteger(L.ASC_FEATURE_NONTRAPPING_F2I,p.bool,i64_new(e.hasFeature(4)?1:0,0)),this.registerConstantInteger(L.ASC_FEATURE_BULK_MEMORY,p.bool,i64_new(e.hasFeature(8)?1:0,0)),this.registerConstantInteger(L.ASC_FEATURE_SIMD,p.bool,i64_new(e.hasFeature(16)?1:0,0)),this.registerConstantInteger(L.ASC_FEATURE_THREADS,p.bool,i64_new(e.hasFeature(32)?1:0,0)),this.registerConstantInteger(L.ASC_FEATURE_EXCEPTION_HANDLING,p.bool,i64_new(e.hasFeature(64)?1:0,0)),this.registerConstantInteger(L.ASC_FEATURE_TAIL_CALLS,p.bool,i64_new(e.hasFeature(128)?1:0,0)),this.registerConstantInteger(L.ASC_FEATURE_REFERENCE_TYPES,p.bool,i64_new(e.hasFeature(256)?1:0,0)),this.registerConstantInteger(L.ASC_FEATURE_MULTI_VALUE,p.bool,i64_new(e.hasFeature(512)?1:0,0)),this.registerConstantInteger(L.ASC_FEATURE_GC,p.bool,i64_new(e.hasFeature(1024)?1:0,0)),this.registerConstantInteger(L.ASC_FEATURE_MEMORY64,p.bool,i64_new(e.hasFeature(2048)?1:0,0)),this.registerConstantInteger(L.ASC_FEATURE_RELAXED_SIMD,p.bool,i64_new(e.hasFeature(4096)?1:0,0)),this.registerConstantInteger(L.ASC_FEATURE_EXTENDED_CONST,p.bool,i64_new(e.hasFeature(8192)?1:0,0)),this.registerConstantInteger(L.ASC_FEATURE_STRINGREF,p.bool,i64_new(e.hasFeature(16384)?1:0,0)),this.registerConstantInteger(L.ASC_FEATURE_SHARED_EVERYTHING,p.bool,i64_new(e.hasFeature(16384)?1:0,0));let t=new Array,i=new Map,s=new Map,a=new Array,l=new Array;for(let u=0,c=this.sources.length;u<c;++u){let f=this.sources[u],_=new Vs(this,f);this.filesByName.set(_.internalName,_);let d=f.statements;for(let m=0,h=d.length;m<h;++m){let b=d[m];switch(b.kind){case 39:{this.initializeExports(b,_,i,s);break}case 40:{this.initializeExportDefault(b,_,a,l);break}case 46:{this.initializeImports(b,_,t,i);break}case 51:{this.initializeVariables(b,_);break}case 55:{this.initializeClass(b,_,a,l);break}case 56:{this.initializeEnum(b,_);break}case 59:{this.initializeFunction(b,_);break}case 61:{this.initializeInterface(b,_,a);break}case 63:{this.initializeNamespace(b,_,a,l);break}case 64:{this.initializeTypeDefinition(b,_);break}}}}for(let u=Map_keys(s),c=0,f=u.length;c<f;++c){let _=u[c],d=assert(s.get(_));for(let m=0,h=d.length;m<h;++m){let b=unchecked(d[m]),A=this.lookupForeignFile(b.foreignPath,b.foreignPathAlt);if(!A){this.error(6054,b.pathLiteral.range,b.pathLiteral.value);continue}_.ensureExportStar(A)}}do{let u=0,c=!1;for(;u<t.length;){let f=t[u],_=f.localIdentifier,d=f.foreignIdentifier,m=assert(this.lookupForeignFile(f.foreignPath,f.foreignPathAlt));if(d){let h=this.lookupForeign(d.text,m,i);h?(f.localFile.add(_.text,h,_),t.splice(u,1),c=!0):++u}else{let h=f.localFile,b=_.text;h.add(b,m.asAliasNamespace(b,h,_),_),t.splice(u,1),c=!0}}if(!c){for(let f=0,_=t.length;f<_;++f){let d=t[f],m=d.foreignIdentifier;m&&this.error(2305,m.range,d.foreignPath,m.text)}break}}while(!0);for(let u=Map_keys(i),c=0,f=u.length;c<f;++c){let _=unchecked(u[c]),d=assert(i.get(_));for(let m=Map_keys(d),h=0,b=m.length;h<b;++h){let A=unchecked(m[h]),S=assert(d.get(A)),k=S.localIdentifier.text,w=S.foreignPath;if(w){let R=assert(this.lookupForeignFile(w,assert(S.foreignPathAlt))),C=this.lookupForeign(k,R,i);C?_.ensureExport(A,C):this.error(2305,S.localIdentifier.range,w,k)}else{let R=_.getMember(k);if(R)_.ensureExport(A,R);else{let C=this.lookup(k);C&&Us(C.kind)?_.ensureExport(A,C):this.error(2305,S.foreignIdentifier.range,_.internalName,S.foreignIdentifier.text)}}}}assert(this.objectInstance.id==0),assert(this.arrayBufferInstance.id==1),assert(this.stringInstance.id==2),assert(this.arrayBufferViewInstance.id==3),this.registerWrapperClass(p.i8,L.I8),this.registerWrapperClass(p.i16,L.I16),this.registerWrapperClass(p.i32,L.I32),this.registerWrapperClass(p.i64,L.I64),this.registerWrapperClass(e.isizeType,L.Isize),this.registerWrapperClass(p.u8,L.U8),this.registerWrapperClass(p.u16,L.U16),this.registerWrapperClass(p.u32,L.U32),this.registerWrapperClass(p.u64,L.U64),this.registerWrapperClass(e.usizeType,L.Usize),this.registerWrapperClass(p.bool,L.Bool),this.registerWrapperClass(p.f32,L.F32),this.registerWrapperClass(p.f64,L.F64),e.hasFeature(16)&&this.registerWrapperClass(p.v128,L.V128),e.hasFeature(256)&&(this.registerWrapperClass(p.func,L.RefFunc),this.registerWrapperClass(p.extern,L.RefExtern),e.hasFeature(1024)&&(this.registerWrapperClass(p.any,L.RefAny),this.registerWrapperClass(p.eq,L.RefEq),this.registerWrapperClass(p.struct,L.RefStruct),this.registerWrapperClass(p.array,L.RefArray),this.registerWrapperClass(p.i31,L.RefI31)),e.hasFeature(16384)&&this.registerWrapperClass(p.string,L.RefString));let o=this.resolver;for(let u=0,c=a.length;u<c;++u){let f=a[u],_=assert(f.extendsNode),d=o.resolveTypeName(_.name,null,f.parent);if(d){if(f.kind==6)if(d.kind==6){let m=d;m.hasDecorator(32)&&this.error(211,_.range,m.identifierNode.text),m.hasDecorator(16)!=f.hasDecorator(16)&&this.error(207,ce.join(f.identifierNode.range,_.range)),f.extends(m)?this.error(2506,m.identifierNode.range,m.identifierNode.text):f.basePrototype=m}else this.error(1311,_.range);else if(f.kind==8)if(d.kind==8){let m=d;f.extends(m)?this.error(2506,m.identifierNode.range,m.identifierNode.text):f.basePrototype=m}else this.error(2312,_.range)}}for(let u=0,c=a.length;u<c;u++){let f=a[u],_=f.instanceMembers;if(_){let d=Map_values(_);for(let m=0,h=d.length;m<h;m++){let b=d[m],A=b.declaration;if(A.is(8192)){let S=f.basePrototype,k=!1;for(;S;){let w=S.instanceMembers;if(w&&w.has(b.name)){k=!0;break}S=S.basePrototype}if(!k){let w=assert(f.basePrototype);this.error(4117,A.name.range,w.name)}}}}}for(let u=0,c=l.length;u<c;++u){let f=l[u],_=assert(f.implementsNodes);for(let d=0,m=_.length;d<m;++d){let h=_[d],b=o.resolveTypeName(h.name,null,f.parent);if(b)if(b.kind==8){let A=b,S=f.interfacePrototypes;S||(f.interfacePrototypes=S=new Array),S.push(A)}else this.error(2422,h.range)}}for(let u=0,c=a.length;u<c;++u){let f=a[u],_=f.basePrototype;_&&this.processOverrides(f,_)}for(let u=0,c=l.length;u<c;++u){let f=l[u],_=f.basePrototype,d=f.interfacePrototypes;if(_&&this.processOverrides(f,_),d)for(let m=0,h=d.length;m<h;++m)this.processOverrides(f,d[m])}{let u=e.globalAliases;u||(u=new Map),u.has(L.abort)||u.set(L.abort,g.abort),u.has(L.trace)||u.set(L.trace,g.trace),u.has(L.seed)||u.set(L.seed,g.seed),u.has(L.Math)||u.set(L.Math,L.NativeMath),u.has(L.Mathf)||u.set(L.Mathf,L.NativeMathf);for(let c=Map_keys(u),f=0,_=c.length;f<_;++f){let d=unchecked(c[f]),m=changetype(u.get(d));if(assert(m!=null),!m.length){this.elementsByName.delete(d);continue}let h=m.charCodeAt(0);if(h>=48&&h<=57)this.registerConstantInteger(d,p.i32,i64_new(parseInt(m,10)));else{let b=this.elementsByName;b.has(m)?b.set(d,assert(b.get(m))):this.error(111,null,m)}}}for(let u=Map_values(this.filesByName),c=0,f=u.length;c<f;++c){let _=unchecked(u[c]);_.source.sourceKind==1&&this.markModuleExports(_)}}processOverrides(e,t){let i=e.instanceMembers;if(i){let s=Map_values(i),a=null;do{let l=t.instanceMembers;if(l)for(let c=0,f=s.length;c<f;++c){let _=s[c];if(l.has(_.name)){let d=assert(l.get(_.name));this.doProcessOverride(e,_,t,d)}}let o=t.interfacePrototypes;if(o)for(let c=0,f=o.length;c<f;++c){let _=o[c];_!=t&&this.processOverrides(e,_)}let u=t.basePrototype;if(!u||(a||(a=new Set),a.add(t),a.has(u)))break;t=u}while(!0)}}doProcessOverride(e,t,i,s){if(!t.isAny(524800))if(t.kind==4&&s.kind==4){let a=t,l=s,o=a.is(65536),u=l.is(65536);if(o!=u){this.errorRelated(242,a.identifierNode.range,l.identifierNode.range,a.name);return}a.visibilityEquals(l)||this.errorRelated(2385,a.identifierNode.range,l.identifierNode.range),s.set(268435456);let c=l.unboundOverrides;c||(l.unboundOverrides=c=new Set),c.add(t);let f=l.instances;if(f)for(let _=Map_values(f),d=0,m=_.length;d<m;++d)_[d].set(268435456)}else if(t.kind==10&&s.kind==10){let a=t,l=s;if(a.visibilityEquals(l)||this.errorRelated(2385,a.identifierNode.range,l.identifierNode.range),l.parent.kind!=8){let c=a.isField;if(c!=l.isField){c?this.errorRelated(2610,a.identifierNode.range,l.identifierNode.range,a.name,i.internalName,e.internalName):this.errorRelated(2611,a.identifierNode.range,l.identifierNode.range,a.name,i.internalName,e.internalName);return}else if(c)return}l.set(268435456);let o=l.getterPrototype;if(o){o.set(268435456);let c=a.getterPrototype;if(c){let _=o.unboundOverrides;_||(o.unboundOverrides=_=new Set),_.add(c)}let f=o.instances;if(f)for(let _=Map_values(f),d=0,m=_.length;d<m;++d)_[d].set(268435456)}let u=l.setterPrototype;if(u&&a.setterPrototype){u.set(268435456);let c=a.setterPrototype;if(c){let _=u.unboundOverrides;_||(u.unboundOverrides=_=new Set),_.add(c)}let f=u.instances;if(f)for(let _=Map_values(f),d=0,m=_.length;d<m;++d)_[d].set(268435456)}}else this.errorRelated(2416,t.identifierNode.range,s.identifierNode.range,t.name,e.internalName,i.internalName)}lookup(e){let t=this.elementsByName;return t.has(e)?assert(t.get(e)):null}require(e,t){let i=this.lookup(e);if(!i)throw new Error(`Missing standard library component: ${e}`);if(i.kind!=t)throw Error(`Invalid standard library component kind: ${e}`);return i}requireGlobal(e){return this.require(e,0)}requireClass(e){let t=this.require(e,6),i=this.resolver.resolveClass(t,null);if(!i)throw new Error(`Invalid standard library class: ${e}`);return i}requireFunction(e,t=null){let i=this.require(e,4),s=this.resolver.resolveFunction(i,t);if(!s)throw new Error(`Invalid standard library function: ${e}`);return s}markModuleExports(e){let t=e.exports;if(t)for(let s=Map_values(t),a=0,l=s.length;a<l;++a){let o=unchecked(s[a]);this.markModuleExport(o)}let i=e.exportsStar;if(i)for(let s=0,a=i.length;s<a;++s)this.markModuleExports(i[s])}markModuleExport(e){switch(e.set(1048576),e.kind){case 6:{let i=e.instanceMembers;if(i)for(let s=Map_values(i),a=0,l=s.length;a<l;++a){let o=unchecked(s[a]);this.markModuleExport(o)}break}case 10:{let i=e,s=i.getterPrototype;s&&this.markModuleExport(s);let a=i.setterPrototype;a&&this.markModuleExport(a);break}case 11:case 5:case 7:assert(!1)}let t=e.members;if(t)for(let i=Map_values(t),s=0,a=i.length;s<a;++s){let l=unchecked(i[s]);this.markModuleExport(l)}}markModuleImport(e,t,i){i.set(2097152);let s=this.moduleImports,a;s.has(e)?a=assert(s.get(e)):(a=new Map,s.set(e,a)),a.set(t,i)}registerNativeType(e,t){let i=new lt(e,this.nativeFile,this.makeNativeTypeDeclaration(e,2),512);i.setType(t),this.nativeFile.add(e,i)}registerWrapperClass(e,t){let i=this.wrapperClasses;assert(!e.isInternalReference&&!i.has(e));let s=assert(this.lookup(t));assert(s.kind==6);let a=assert(this.resolver.resolveClass(s,null));a.wrappedType=e,i.set(e,a)}registerConstantInteger(e,t,i){assert(t.isIntegerInclReference);let s=new tn(e,this.nativeFile,1024,this.makeNativeVariableDeclaration(e,10));s.setConstantIntegerValue(i,t),this.nativeFile.add(e,s)}registerConstantFloat(e,t,i){assert(t.isFloatValue);let s=new tn(e,this.nativeFile,1024,this.makeNativeVariableDeclaration(e,10));s.setConstantFloatValue(i,t),this.nativeFile.add(e,s)}ensureGlobal(e,t){let i=this.elementsByName;if(i.has(e)){let s=assert(i.get(e));if(s!=t){let a=Cf(s,t);if(!a)return Us(s.kind)?this.errorRelated(2300,t.identifierNode.range,s.declaration.name.range,e):this.error(2300,t.identifierNode.range,e),t;t=a}}return i.set(e,t),t}lookupForeignFile(e,t){let i=this.filesByName;return i.has(e)?assert(i.get(e)):i.has(t)?assert(i.get(t)):null}lookupForeign(e,t,i){do{let a=t.lookupExport(e);if(a)return a;if(i.has(t)){let l=assert(i.get(t));if(l.has(e)){let o=assert(l.get(e)),u=o.foreignPath;if(u){let c=this.lookupForeignFile(u,assert(o.foreignPathAlt));if(!c)return null;e=o.localIdentifier.text,t=c;continue}if(a=t.getMember(o.localIdentifier.text),a)return a}}break}while(!0);let s=t.exportsStar;if(s)for(let a=0,l=s.length;a<l;++a){let o=this.lookupForeign(e,s[a],i);if(o)return o}return null}checkDecorators(e,t){let i=0;if(e)for(let s=0,a=e.length;s<a;++s){let l=e[s],o=Ct.fromNode(l.name),u=Bt.fromKind(o);u&&(t&u?i&u?this.error(213,l.range):i|=u:this.error(212,l.range,l.name.range.toString()))}return i}checkFeatureEnabled(e,t){return this.options.hasFeature(e)?!0:(this.error(103,t.range,Gn(e)),!1)}checkTypeSupported(e,t){switch(e.kind){case 13:return this.checkFeatureEnabled(16,t);case 16:case 15:return e.is(512)?this.checkFeatureEnabled(256,t):this.checkFeatureEnabled(1024,t);case 17:case 18:case 19:case 20:case 21:return this.checkFeatureEnabled(256,t)&&this.checkFeatureEnabled(1024,t);case 22:case 23:case 24:case 25:return this.checkFeatureEnabled(256,t)&&this.checkFeatureEnabled(16384,t)}let i=e.getClass();if(i)do{let s=i.typeArguments;if(s){for(let a=0,l=s.length;a<l;++a)if(!this.checkInlineStructValue(s[a],t,"a type argument (Array<T>)")||!this.checkTypeSupported(s[a],t))return!1}i=i.base}while(i);else{let s=e.getSignature();if(s){let a=s.thisType;if(a&&!this.checkTypeSupported(a,t))return!1;let l=s.parameterTypes;for(let u=0,c=l.length;u<c;++u)if(!this.checkTypeSupported(l[u],t))return!1;let o=s.returnType;if(!this.checkTypeSupported(o,t))return!1}}return!0}checkInlineStructValue(e,t,i){let s=e.getClass();return s!=null&&s.hasDecorator(4096)?(this.error(100,t.range,i=="a global"?"an @inline struct at top level (a global is a pointer slot, so two values would alias; declare it inside a function)":"an @inline struct value in "+i+" (value types are not implemented here yet; a pointer would alias)"),!1):!0}initializeClass(e,t,i,s){let a=e.name.text,l=e.declaredAsStruct&&X1(e.decorators,64),o=new qs(a,t,e,this.checkDecorators(e.decorators,49|(e.declaredAsStruct?2112:0)));if(!t.add(a,o))return null;l&&(o.decoratorFlags|=4096),(o.hasDecorator(2048)||o.hasDecorator(4096))&&(o.decoratorFlags|=32);let u=e.implementsTypes;if(u){let f=u.length;f&&(o.hasDecorator(16)?this.error(208,ce.join(e.name.range,u[f-1].range)):s.push(o))}e.extendsType?o.hasDecorator(4096)?this.error(100,ce.join(e.name.range,assert(e.extendsType).range),"inheritance on an @inline struct (a value type is final: no base class, no virtual methods)"):o.hasDecorator(2048)?this.error(100,ce.join(e.name.range,assert(e.extendsType).range),"inheritance on an @managed struct (its fields must stay at fixed offsets from the reference)"):i.push(o):!o.hasDecorator(16)&&o.internalName!=g.Object&&(o.implicitlyExtendsObject=!0);let c=e.members;for(let f=0,_=c.length;f<_;++f){let d=c[f];switch(d.kind){case 58:{this.initializeField(d,o);break}case 62:{let m=d;if(m.is(128)&&m.is(65536)&&this.error(241,m.name.range,m.name.text),d.isAny(6144))this.initializeProperty(m,o);else{let h=this.initializeMethod(m,o);h&&m.name.kind==28&&(o.constructorPrototype=h)}break}case 69:break;default:assert(!1)}}return o}initializeField(e,t){let i=e.name.text,s=e.decorators,a,l=8192;if(t.is(32768)&&(l|=128),e.is(32)){if(assert(t.kind!=8),l|=1024,e.is(64)&&(l|=64),a=new tn(i,t,this.checkDecorators(s,l),e),!t.add(i,a))return}else if(assert(!e.isAny(6272)),a=ai.forField(i,t,e,this.checkDecorators(s,l)),!t.addInstance(i,a))return}initializeMethod(e,t){let i=e.name.text,s=e.is(32),a=8256;e.is(65536)||(a|=14),t.is(32768)&&(a|=128),e.range.source.isLibrary&&(a|=512);let l=new ot(i,t,e,this.checkDecorators(e.decorators,a));if(l.hasDecorator(512)&&!E.has(l.internalName)&&this.error(100,e.range,`Builtin '${l.internalName}'`),s){if(assert(e.name.kind!=28),!t.add(i,l))return null}else if(!t.addInstance(i,l))return null;return this.checkOperatorOverloads(e.decorators,l,t),l}checkOperatorOverloads(e,t,i){if(e)for(let s=0,a=e.length;s<a;++s){let l=e[s];switch(l.decoratorKind){case 2:case 3:case 4:case 5:{let o=l.args,u=o?o.length:0;if(u==1){let c=l.args[0];if(c.isLiteralKind(2)){let f=c.value,_=Me.fromDecorator(l.decoratorKind,f);if(_==0)this.error(224,c.range,f);else{let d=i.operatorOverloadPrototypes;d.has(_)?this.error(2393,c.range):(t.operatorKind=_,d.set(_,t))}}else this.error(1141,c.range)}else this.error(2554,l.range,"1",u.toString())}}}}ensureProperty(e,t){let i=e.name.text;if(e.is(32)){let s=t.members;if(s&&s.has(i)){let a=assert(s.get(i));if(a.kind==10)return a}else{let a=new ai(i,t,e);return t.add(i,a)?a:null}}else{let s=t.instanceMembers;if(s&&s.has(i)){let a=assert(s.get(i));if(a.kind==10)return a}else{let a=new ai(i,t,e);return t.addInstance(i,a)?a:null}}return this.error(2718,e.name.range,i),null}initializeProperty(e,t){let i=this.ensureProperty(e,t);if(!i)return;let s=e.name.text,a=e.is(2048);if(a){if(i.getterPrototype){this.error(2718,e.name.range,s);return}}else if(i.setterPrototype){this.error(2718,e.name.range,s);return}let l=new ot((a?nl:il)+s,i.parent,e,this.checkDecorators(e.decorators,8256));a?i.getterPrototype=l:i.setterPrototype=l}initializeEnum(e,t){let i=e.name.text,s=new tu(i,t,e,this.checkDecorators(e.decorators,1089));if(!t.add(i,s))return null;let a=e.values;for(let l=0,o=a.length;l<o;++l)this.initializeEnumValue(a[l],s);return s}initializeEnumValue(e,t){let i=e.name.text,s=new ru(i,t,e,this.checkDecorators(e.decorators,0));t.add(i,s)}initializeExports(e,t,i,s){let a=e.members;if(a)for(let l=0,o=a.length;l<o;++l)this.initializeExport(a[l],t,e.internalPath,i);else{let l;s.has(t)?l=assert(s.get(t)):s.set(t,l=[]);let o=e.internalPath;l.push(new vf(o,o.endsWith(Qe)?o.substring(0,o.length-Qe.length):o+Qe,assert(e.path)))}}initializeExport(e,t,i,s){let a=e.localName.text,l=e.exportedName.text,o=t.lookupExport(l);if(o){this.error(2484,e.exportedName.range,l);return}if(i==null)if(o=t.getMember(a))t.ensureExport(l,o);else{let u;s.has(t)?u=assert(s.get(t)):s.set(t,u=new Map),u.set(l,new eu(e.localName,e.exportedName,null,null))}else{let u;s.has(t)?u=assert(s.get(t)):s.set(t,u=new Map),u.set(l,new eu(e.localName,e.exportedName,i,i.endsWith(Qe)?i.substring(0,i.length-Qe.length):i+Qe))}}initializeExportDefault(e,t,i,s){let a=e.declaration,l=null;switch(a.kind){case 56:{l=this.initializeEnum(a,t);break}case 59:{l=this.initializeFunction(a,t);break}case 55:{l=this.initializeClass(a,t,i,s);break}case 61:{l=this.initializeInterface(a,t,i);break}case 63:{l=this.initializeNamespace(a,t,i,s);break}default:assert(!1)}if(l){let o=t.exports;if(!o)t.exports=o=new Map;else if(o.has("default")){let u=assert(o.get("default"));this.errorRelated(2300,a.name.range,u.declaration.name.range,"default");return}o.set("default",l)}}initializeImports(e,t,i,s){let a=e.declarations;if(a)for(let l=0,o=a.length;l<o;++l)this.initializeImport(a[l],t,e.internalPath,i,s);else{let l=e.namespaceName;l&&i.push(new Jo(t,l,null,e.internalPath,e.internalPath+Qe))}}initializeImport(e,t,i,s,a){let l=i.endsWith(Qe)?i.substring(0,i.length-Qe.length):i+Qe,o=this.lookupForeignFile(i,l);if(o){let u=this.lookupForeign(e.foreignName.text,o,a);if(u){t.add(e.name.text,u,e.name);return}}s.push(new Jo(t,e.name,e.foreignName,i,l))}initializeFunction(e,t){let i=e.name.text,s=8192;e.is(32768)?s|=384:(s|=64,(e.range.source.isLibrary||e.is(2))&&(s|=1024)),e.is(262144)||t.kind!=6&&(s|=1),e.range.source.isLibrary&&(s|=512);let a=new ot(i,t,e,this.checkDecorators(e.decorators,s));return a.hasDecorator(512)&&!E.has(a.internalName)&&this.error(100,e.range,`Builtin '${a.internalName}'`),t.add(i,a)?a:null}initializeInterface(e,t,i){let s=e.name.text,a=new nu(s,t,e,this.checkDecorators(e.decorators,1));if(!t.add(s,a))return null;e.extendsType&&i.push(a);let l=e.members;for(let o=0,u=l.length;o<u;++o){let c=l[o];switch(c.kind){case 58:{this.initializeFieldAsProperty(c,a);break}case 62:{let f=c;f.is(65536)&&this.error(241,f.name.range,f.name.text),c.isAny(6144)?this.initializeProperty(f,a):this.initializeMethod(f,a);break}default:assert(!1)}}return a}initializeFieldAsProperty(e,t){let i=e.initializer;i&&this.error(1246,i.range);let s=e.type;s||(s=y.createOmittedType(e.name.range.atEnd)),this.initializeProperty(y.createMethodDeclaration(e.name,e.decorators,e.flags|2048,null,y.createFunctionType([],s,null,!1,e.range),null,e.range),t),e.is(64)||this.initializeProperty(y.createMethodDeclaration(e.name,e.decorators,e.flags|4096,null,y.createFunctionType([y.createParameter(0,e.name,s,null,e.name.range)],y.createOmittedType(e.name.range.atEnd),null,!1,e.range),null,e.range),t)}initializeNamespace(e,t,i,s){let a=e.name.text,l=new Os(a,t,e,this.checkDecorators(e.decorators,1));if(!t.add(a,l))return null;let o=assert(t.getMember(a)),u=e.members;for(let c=0,f=u.length;c<f;++c){let _=u[c];switch(_.kind){case 55:{this.initializeClass(_,l,i,s);break}case 56:{this.initializeEnum(_,l);break}case 59:{this.initializeFunction(_,l);break}case 61:{this.initializeInterface(_,l,i);break}case 63:{this.initializeNamespace(_,l,i,s);break}case 64:{this.initializeTypeDefinition(_,l);break}case 51:{this.initializeVariables(_,l);break}default:assert(!1)}}return l!=o&&rr(l,o),o}initializeTypeDefinition(e,t){let i=e.name.text,s=new lt(i,t,e,this.checkDecorators(e.decorators,0));t.add(i,s)}initializeVariables(e,t){let i=e.declarations;for(let s=0,a=i.length;s<a;++s){let l=i[s],o=l.name.text,u=1025;l.is(32768)&&(u|=128),l.is(8)&&(u|=64),l.range.source.isLibrary&&(u|=512);let c=new tn(o,t,this.checkDecorators(l.decorators,u),l);c.hasDecorator(512)&&!At.has(c.internalName)&&this.error(100,l.range,`Builtin '${c.internalName}'`),t.add(o,c)}}},Et=(b=>(b[b.Global=0]="Global",b[b.Local=1]="Local",b[b.Enum=2]="Enum",b[b.EnumValue=3]="EnumValue",b[b.FunctionPrototype=4]="FunctionPrototype",b[b.Function=5]="Function",b[b.ClassPrototype=6]="ClassPrototype",b[b.Class=7]="Class",b[b.InterfacePrototype=8]="InterfacePrototype",b[b.Interface=9]="Interface",b[b.PropertyPrototype=10]="PropertyPrototype",b[b.Property=11]="Property",b[b.Namespace=12]="Namespace",b[b.File=13]="File",b[b.TypeDefinition=14]="TypeDefinition",b[b.IndexSignature=15]="IndexSignature",b))(Et||{}),Bt=(h=>(h[h.None=0]="None",h[h.Global=1]="Global",h[h.OperatorBinary=2]="OperatorBinary",h[h.OperatorPrefix=4]="OperatorPrefix",h[h.OperatorPostfix=8]="OperatorPostfix",h[h.Unmanaged=16]="Unmanaged",h[h.Final=32]="Final",h[h.Inline=64]="Inline",h[h.ManagedStruct=2048]="ManagedStruct",h[h.External=128]="External",h[h.ExternalJs=256]="ExternalJs",h[h.Builtin=512]="Builtin",h[h.Lazy=1024]="Lazy",h[h.InlineStruct=4096]="InlineStruct",h[h.Unsafe=8192]="Unsafe",h))(Bt||{});(r=>{function n(e){switch(e){case 1:return 1;case 2:case 3:return 2;case 4:return 4;case 5:return 8;case 6:return 16;case 7:return 2048;case 8:return 32;case 9:return 64;case 10:return 128;case 11:return 256;case 12:return 512;case 13:return 1024;case 14:return 8192;default:return 0}}r.fromKind=n})(Bt||={});var Gs=class{constructor(r,e,t,i,s){this.kind=r;this.name=e;this.internalName=t;this.program=i;this.flags=0;this.decoratorFlags=0;this.members=null;this.shadowType=null;this.program=i,this.name=e,this.internalName=t,s?this.parent=s:(assert(this.kind==13),this.parent=this)}get file(){let r=this;do if(r=r.parent,r.kind==13)return r;while(!0)}is(r){return(this.flags&r)==r}isAny(r){return(this.flags&r)!=0}set(r){this.flags|=r}unset(r){this.flags&=~r}hasDecorator(r){return(this.decoratorFlags&r)==r}hasAnyDecorator(r){return(this.decoratorFlags&r)!=0}getMember(r){let e=this.members;return e&&e.has(r)?assert(e.get(r)):null}lookup(r,e=!1){return this.parent.lookup(r,e)}add(r,e,t=null){let i=e.declaration,s=this.members;if(!s)this.members=s=new Map;else if(s.has(r)){let l=assert(s.get(r));if(l.parent==this){let o=Cf(l,e);if(o)e=o;else{let u=t||e.identifierNode;return Us(l.kind)?this.program.errorRelated(2300,u.range,l.identifierNode.range,u.text):this.program.error(2300,u.range,u.text),!1}}}s.set(r,e);let a=this.program;return(e.kind!=4||!e.isBound)&&(a.elementsByName.set(e.internalName,e),a.elementsByDeclaration.set(i,e)),!0}get isPublic(){return!this.isAny(1536)}get isImplicitlyPublic(){return this.isPublic&&!this.is(256)}visibilityEquals(r){if(this.isPublic==r.isPublic)return!0;let e=1536;return(this.flags&e)==(r.flags&e)}visibilityNoLessThan(r){return this.isPublic?!0:this.is(512)?r.is(512):this.is(1024)?r.isAny(1536):assert(!1)}get isBound(){switch(this.parent.kind){case 7:case 9:return!0}return!1}getBoundClassOrInterface(){let r=this.parent;switch(r.kind){case 7:case 9:return r}return null}toString(){return`${this.internalName}, kind=${this.kind}`}},sx=new Set;function Us(n){return sx.has(n)}var Tr=class extends Gs{constructor(e,t,i,s,a,l){super(e,t,i,s,a);this.declaration=l;sx.add(e),this.declaration=l,this.flags=l.flags}get isDeclaredInLibrary(){return this.declaration.range.source.isLibrary}get identifierNode(){return this.declaration.name}get identifierAndSignatureRange(){let e=this.declaration,t=e.name;if(e.kind==59||e.kind==62){let i=e.signature;if(t.range.source==i.range.source)return ce.join(t.range,i.range)}return t.range}get decoratorNodes(){return this.declaration.decorators}},ax=new Set;function Xo(n){return ax.has(n)}var nr=class extends Tr{constructor(e,t,i,s,a,l){super(e,t,i,s,a,l);this.type=p.void;ax.add(e)}setType(e){assert(!this.is(4194304)),this.type=e,this.set(4194304)}refineType(e){this.type=e,this.set(4194304)}},Vs=class extends Gs{constructor(e,t){super(13,t.normalizedPath,t.internalPath,e,null);this.source=t;this.exports=null;this.exportsStar=null;this.aliasNamespaces=new Array;this.source=t,assert(!e.filesByName.has(this.internalName)),e.filesByName.set(this.internalName,this);let i=this.program.makeNativeFunction(`start:${this.internalName}`,oe.create(e,[],p.void),this);i.internalName=i.name,this.startFunction=i}add(e,t,i=null){return t.hasDecorator(1)&&(t=this.program.ensureGlobal(e,t)),super.add(e,t,i)?(t=assert(this.getMember(e)),t.is(2)&&!i&&this.ensureExport(t.name,t),!0):!1}getMember(e){let t=super.getMember(e);if(t)return t;let i=this.exportsStar;if(i){for(let s=0,a=i.length;s<a;++s)if(t=i[s].getMember(e))return t}return null}lookup(e,t=!1){let i=this.getMember(e);return i||this.program.lookup(e)}ensureExport(e,t){let i=this.exports;i||(this.exports=i=new Map),i.set(e,t),this.source.sourceKind==3&&this.program.ensureGlobal(e,t);for(let s=0;s<this.aliasNamespaces.length;s++)this.aliasNamespaces[s].add(e,t)}ensureExportStar(e){let t=this.exportsStar;if(!t)this.exportsStar=t=[];else if(t.includes(e))return;t.push(e)}lookupExport(e){let t=this.exports;if(t&&t.has(e))return assert(t.get(e));let i=this.exportsStar;if(i)for(let s=0,a=i.length;s<a;++s){let l=i[s].lookupExport(e);if(l)return l}return null}asAliasNamespace(e,t,i){let s=this.program.makeNativeNamespaceDeclaration(e);s.name=i;let a=new Os(e,t,s);return a.set(67108864),this.copyExportsToNamespace(a),this.aliasNamespaces.push(a),a}copyExportsToNamespace(e){let t=this.exports;if(t)for(let s=Map_keys(t),a=0,l=s.length;a<l;++a){let o=unchecked(s[a]),u=assert(t.get(o));e.add(o,u)}let i=this.exportsStar;if(i)for(let s=0,a=i.length;s<a;++s)i[s].copyExportsToNamespace(e)}},lt=class extends nr{constructor(r,e,t,i=0){super(14,r,Ke(r,e,!1),e.program,e,t),this.decoratorFlags=i}get typeParameterNodes(){return this.declaration.typeParameters}get typeNode(){return this.declaration.type}},Os=class extends Tr{constructor(r,e,t,i=0){super(12,r,Ke(r,e,!1),e.program,e,t),this.decoratorFlags=i}lookup(r,e=!1){let t=this.getMember(r);return t||super.lookup(r,e)}},tu=class extends nr{constructor(e,t,i,s=0){super(2,e,Ke(e,t,!1),t.program,t,i);this.toStringFunctionName=null;this.underlyingTypeResolved=!1;this.underlyingTypeResolving=!1;this.decoratorFlags=s,this.setType(p.i32)}lookup(e,t=!1){let i=this.getMember(e);return i||super.lookup(e,t)}},wf=(t=>(t[t.None=0]="None",t[t.Integer=1]="Integer",t[t.Float=2]="Float",t))(wf||{}),rn=class extends nr{constructor(e,t,i,s=i.program.makeNativeVariableDeclaration(t)){super(e,t,Ke(t,i,s.is(262144)),i.program,i,s);this.constantValueKind=0;this.constantIntegerValue=i64_zero;this.constantFloatValue=0;this.flags=s.flags}get typeNode(){return this.declaration.type}get initializerNode(){return this.declaration.initializer}setConstantIntegerValue(e,t){assert(t.isIntegerInclReference),this.type=t,this.constantValueKind=1,this.constantIntegerValue=e,this.set(37748744)}setConstantFloatValue(e,t){assert(t.isFloatValue),this.type=t,this.constantValueKind=2,this.constantFloatValue=e,this.set(37748744)}},ru=class extends rn{constructor(e,t,i,s=0){super(3,e,t,i);this.isImmutable=!1;this.decoratorFlags=s,this.setType(t.type)}get valueNode(){return this.declaration.initializer}},tn=class extends rn{constructor(r,e,t,i=e.program.makeNativeVariableDeclaration(r)){super(0,r,e,i),this.decoratorFlags=t}},If=class{constructor(r,e,t=null){this.name=r;this.type=e;this.initializer=t}},pe=class extends rn{constructor(e,t,i,s,a=s.program.makeNativeVariableDeclaration(e)){super(1,e,s,a);this.index=t;this.fieldLocals=null;this.typeRefOverride=P.None;this.isViewParam=!1;this.isViewLocal=!1;this.isDynamicLength=!1;this.originalName=e,this.index=t,assert(i!=p.void),this.setType(i)}declaredByFlow(e){return this.parent==e.targetFunction}},ot=class n extends Tr{constructor(e,t,i,s=0){super(4,e,Ke(e,t,i.is(262144)),t.program,t,i);this.operatorKind=0;this.capturesThis=!1;this.envKind=0;this.envClass=null;this.instances=null;this.unboundOverrides=null;this.boundPrototypes=null;this.decoratorFlags=s}get typeParameterNodes(){return this.declaration.typeParameters}get functionTypeNode(){return this.declaration.signature}get bodyNode(){return this.declaration.body}get arrowKind(){return this.declaration.arrowKind}get isAsync(){return this.declaration.isAsync&&!this.isAny(530432)}toBound(e){assert(this.is(262144)),assert(!this.isBound);let t=this.boundPrototypes;if(!t)this.boundPrototypes=t=new Map;else if(t.has(e))return assert(t.get(e));let i=this.declaration;assert(i.kind==62);let s=new n(this.name,e,i,this.decoratorFlags);return s.flags=this.flags,s.operatorKind=this.operatorKind,s.unboundOverrides=this.unboundOverrides,t.set(e,s),s}getResolvedInstance(e){let t=this.instances;return t&&t.has(e)?assert(t.get(e)):null}setResolvedInstance(e,t){let i=this.instances;i?assert(!i.has(e)):this.instances=i=new Map,i.set(e,t)}},Mt=class n extends nr{constructor(e,t,i,s,a=null){super(5,e,Ke(e,t.parent,t.is(262144)),t.program,t.parent,t.declaration);this.localsByIndex=[];this.debugLocations=new Map;this.ref=0;this.tableIndex=0;this.varargsStub=null;this.overrideStub=null;this.memorySegment=null;this.nextInlineId=0;this.nextAnonymousId=0;this.nextBreakId=0;this.breakStack=null;this.prototype=t,this.typeArguments=i,this.signature=s,this.flags=t.flags|4194304,this.decoratorFlags=t.decoratorFlags,this.contextualTypeArguments=a,this.original=this;let l=t.program;this.type=s.type;let o=er.createDefault(this);if(this.flow=o,!t.is(32768)){let u=0,c=s.thisType;if(c){let d=new pe(L.this_,u++,c,this),m=this.flow.scopedLocals;m||(this.flow.scopedLocals=m=new Map),m.set(L.this_,d),this.localsByIndex[d.index]=d,o.setLocalFlag(d.index,8)}if(s.hasHiddenDestParam){let d=new pe("$sretDest",u++,p.u32,this);this.localsByIndex[d.index]=d,o.setLocalFlag(d.index,8)}let f=s.parameterTypes,_=null;for(let d=0,m=f.length;d<m;++d){let h=f[d],b=this.getParameterName(d);if(s.isExportByValParam(d)){let k=this.flow.scopedLocals;k||(this.flow.scopedLocals=k=new Map);let w=new pe(b+"$byval",u++,p.u32,this);this.localsByIndex[w.index]=w,o.setLocalFlag(w.index,8),k.set(b+"$byval",w),_||(_=new Array),unchecked(_[_.length]=new kf(d,b,h,new Map));continue}if(s.isViewParam(d)){let k=this.flow.scopedLocals;k||(this.flow.scopedLocals=k=new Map);let w=new pe(b,u++,h,this);w.isViewParam=!0,this.localsByIndex[w.index]=w,o.setLocalFlag(w.index,8),k.set(b,w);continue}if(h.kind==14&&(h.fixedMemoryModel==0||h.fixedMemoryModel==1)){let k=this.flow.scopedLocals;k||(this.flow.scopedLocals=k=new Map);let w=new Map,R=this.bindSroaArrayParameterLeaves(h,b,w,u,o);u+=R.leafCount;let C=new pe(b,-1,h,this);C.fieldLocals=w,k.set(b,C);continue}if(oe.isInlineStructRef(h)){let k=this.flow.scopedLocals;k||(this.flow.scopedLocals=k=new Map);let w=new Map,R=this.bindSroaParameterLeaves(h,b,w,u,o);u+=R.leafCount;let C=new pe(b,-1,h,this);C.fieldLocals=w,k.set(b,C);continue}let A=new pe(b,u++,h,this),S=this.flow.scopedLocals;S||(this.flow.scopedLocals=S=new Map),S.set(b,A),this.localsByIndex[A.index]=A,o.setLocalFlag(A.index,8)}{let m=t.declaration.signature.parameters,h=null;for(let b=0,A=s.parameterTypes.length;b<A&&!(b>=m.length);++b){let S=m[b].type;if(S==null||S.kind!=72)continue;let k=S.lengthName.text;if(h!=null){l.error(2300,S.lengthName.range,k);continue}h=k;let w=this.flow.scopedLocals;if(w!=null&&w.has(k)){l.error(2300,S.lengthName.range,k);continue}let R=this.parent.lookup(k);if(R!=null&&R.kind==0&&R.is(8)){l.error(100,S.lengthName.range,"[T * N] where N is a compile-time constant \u2014 use [T * <literal>] for a static array or [T * n] (runtime identifier) for a dynamic array");continue}let C=new pe(k,u++,p.i32,this);C.isDynamicLength=!0,this.localsByIndex[C.index]=C;let M=this.flow.scopedLocals;M||(this.flow.scopedLocals=M=new Map),M.set(k,C)}}if(_)for(let d=0,m=_.length;d<m;++d){let h=unchecked(_[d]),b=h.parameterName,A=h.parameterType,S=h.fieldLocals,k=assert(A.classReference),w=assert(k.members);for(let M=Map_values(w),O=0,D=M.length;O<D;++O){let Q=unchecked(M[O]);if(Q.kind!=10)continue;let H=Q.instance;if(H==null||!H.isField)continue;let U=new pe(b+"$"+H.name,u++,H.type,this);S.set(H.name,U),this.localsByIndex[U.index]=U,o.setLocalFlag(U.index,8)}let R=new pe(b,-1,A,this);R.fieldLocals=S;let C=this.flow.scopedLocals;C||(this.flow.scopedLocals=C=new Map),C.set(b,R)}}l.instancesByName.has(this.internalName)?(l.error(2393,t.declaration.name.range),this.set(16777216)):Rf(l,this)}bindSroaParameterLeaves(e,t,i,s,a){let l=assert(e.classReference),o=assert(l.members),u=0;for(let c=Map_values(o),f=0,_=c.length;f<_;++f){let d=unchecked(c[f]);if(d.kind!=10)continue;let m=d.instance;if(m==null||!m.isField)continue;let h=t+"$"+m.name,b=m.type;if(oe.isInlineStructRef(b)){let S=new Map,k=this.bindSroaParameterLeaves(b,h,S,s+u,a);u+=k.leafCount;let w=new pe(h,-1,b,a.sourceFunction);w.fieldLocals=S,i.set(m.name,w);continue}let A=new pe(h,s+u,b,a.sourceFunction);this.localsByIndex[A.index]=A,a.setLocalFlag(A.index,8),i.set(m.name,A),++u}return new zs(u)}bindSroaArrayParameterLeaves(e,t,i,s,a){let l=assert(e.fixedElementType),o=l.classReference,u=o!=null&&(o.hasDecorator(16)||o.hasDecorator(2048)),c=0;for(let f=0,_=e.fixedLength;f<_;++f){let d=t+"$"+f.toString();if(u){let h=new Map,b=this.bindSroaParameterLeaves(l,d,h,s+c,a);c+=b.leafCount;let A=new pe(d,-1,l,a.sourceFunction);A.fieldLocals=h,i.set(f.toString(),A);continue}let m=new pe(d,s+c,l,a.sourceFunction);this.localsByIndex[m.index]=m,a.setLocalFlag(m.index,8),i.set(f.toString(),m),++c}return new zs(c)}getNonParameterLocalTypeRefs(){let e=this.localsByIndex,t=this.signature,i=e.length,s=t.wasmParamCount();t.thisType&&++s;let a=i-s,l=new Array(a);for(let o=0;o<a;++o){let u=e[s+o],c=u.typeRefOverride;if(c!=P.None){l[o]=c;continue}l[o]=u.isViewLocal?this.program.options.usizeType.toRef():u.type.toRef()}return l}getParameterName(e){let t=this.declaration.signature.parameters;return t.length>e?t[e].name.text:lx(e)}newStub(e,t=this.signature.requiredParameters){let i=new n(this.original.name+Dp+e,this.prototype,this.typeArguments,this.signature.clone(t),this.contextualTypeArguments);return i.original=this.original,i.set(this.flags&-8388609|134217728),i}addLocal(e,t=null,i=null){let s=this.localsByIndex,a=s.length,l=t??a.toString();i||(i=this.program.makeNativeVariableDeclaration(l));let o=new pe(l,a,e,this,i);if(t){let u=this.flow,c=u.scopedLocals;if(c||(u.scopedLocals=c=new Map),c.has(t))throw new Error("duplicate local name");c.set(t,o)}return s[a]=o,o}lookup(e,t=!1){if(!t){let i=this.flow.scopedLocals;if(i&&i.has(e))return assert(i.get(e))}return super.lookup(e,t)}finalize(e,t){this.ref=t;let i=this.breakStack;assert(!i||!i.length),this.breakStack=null,this.addDebugInfo(e,t)}addDebugInfo(e,t){if(this.program.options.sourceMap){let i=this.debugLocations;for(let s=Map_keys(i),a=0,l=s.length;a<l;++a){let o=s[a],u=assert(i.get(o)),c=u.source;e.setDebugLocation(t,o,c.debugInfoIndex,c.lineAt(u.start),c.columnAt()-1)}}if(this.program.options.debugInfo){let i=new Set,s=this.localsByIndex;for(let a=0,l=s.length;a<l;a++){let o=s[a].name;i.has(o)&&(o=`${o}|${a}`),i.add(o),e.setLocalName(t,a,o)}}}},ai=class n extends Tr{constructor(e,t,i){super(10,e,Ke(e,t,i.is(262144)),t.program,t,i);this.fieldDeclaration=null;this.getterPrototype=null;this.setterPrototype=null;this.instance=null;this.boundPrototypes=null;this.flags&=-6145}static forField(e,t,i,s){let a=Te.native.range,l=i.type;l||(l=y.createOmittedType(i.name.range.atEnd));let o=new Jr(i.name,i.decorators,i.flags|262144|2048,null,new $r([],l,null,!1,a),null,a),u=new Jr(i.name,i.decorators,i.flags|262144|4096,null,new $r([new $n(0,i.name,l,null,a)],new Zr(new Zn(new rt("",!1,a),null,a),null,!1,a),null,!1,a),null,a),c=new n(e,t,o);return c.fieldDeclaration=i,c.decoratorFlags=s,c.getterPrototype=new ot(nl+e,t,o,s),c.setterPrototype=new ot(il+e,t,u,s),c}get isField(){return this.fieldDeclaration!=null}get typeNode(){let e=this.fieldDeclaration;if(e)return e.type;let t=this.getterPrototype;if(t){let s=t.declaration;if(s.kind==59)return s.signature.returnType}let i=this.setterPrototype;if(i){let s=i.declaration;if(s.kind==59){let a=s.signature.parameters;if(a.length)return a[0].type}}return null}get initializerNode(){let e=this.fieldDeclaration;return e?e.initializer:null}get parameterIndex(){let e=this.fieldDeclaration;return e?e.parameterIndex:-1}get thisType(){let e=this.parent;return assert(e.kind==7),e.type}toBound(e){assert(this.is(262144)),assert(!this.isBound);let t=this.boundPrototypes;if(!t)this.boundPrototypes=t=new Map;else if(t.has(e))return assert(t.get(e));let i=this.declaration;assert(i.kind==62);let s=new n(this.name,e,i);s.flags=this.flags,s.fieldDeclaration=this.fieldDeclaration;let a=this.getterPrototype;a&&(s.getterPrototype=a.toBound(e));let l=this.setterPrototype;return l&&(s.setterPrototype=l.toBound(e)),t.set(e,s),s}},Cs=class extends rn{constructor(e,t){super(11,e.name,t,e.isField?assert(e.fieldDeclaration):y.createVariableDeclaration(e.identifierNode,null,e.flags&262144,null,null,e.identifierNode.range));this.getterInstance=null;this.setterInstance=null;this.memoryOffset=-1;this.prototype=e,this.flags=e.flags,this.decoratorFlags=e.decoratorFlags,this.is(262144)&&Rf(this.program,this)}get isField(){return this.prototype.isField}checkVisibility(e){let t=this.getterInstance,i=this.setterInstance;t&&i&&!t.visibilityNoLessThan(i)&&e.errorRelated(2808,t.identifierNode.range,i.identifierNode.range,t.identifierNode.text)}},Ps=class extends nr{constructor(r){super(15,"[]",r.internalName+"[]",r.program,r,r.program.makeNativeVariableDeclaration("[]"))}getGetterInstance(r){return this.parent.lookupOverload(1,r)}getSetterInstance(r){return this.parent.lookupOverload(2,r)}};function X1(n,r){if(!n)return!1;for(let e=0,t=n.length;e<t;++e)if(Bt.fromKind(n[e].decoratorKind)&r)return!0;return!1}var qs=class extends Tr{constructor(e,t,i,s=0,a=!1){super(a?8:6,e,Ke(e,t,i.is(262144)),t.program,t,i);this.instanceMembers=null;this.basePrototype=null;this.interfacePrototypes=null;this.constructorPrototype=null;this.operatorOverloadPrototypes=new Map;this.instances=null;this.extenders=new Set;this.implicitlyExtendsObject=!1;this.decoratorFlags=s}get typeParameterNodes(){return this.declaration.typeParameters}get extendsNode(){return this.declaration.extendsType}get implementsNodes(){return this.declaration.implementsTypes}get isBuiltinArray(){let e=this.program.arrayBufferViewInstance;return e&&this.extends(e.prototype)}extends(e){let t=this,i=new Set;do{if(i.has(t))break;if(i.add(t),t==e)return!0;t=t.basePrototype}while(t);return!1}addInstance(e,t){let i=t.declaration,s=this.instanceMembers;if(!s)this.instanceMembers=s=new Map;else if(s.has(e)){let a=assert(s.get(e)),l=Cf(a,t);if(!l)return Us(a.kind)?this.program.errorRelated(2300,t.identifierNode.range,a.declaration.name.range,t.identifierNode.text):this.program.error(2300,t.identifierNode.range,t.identifierNode.text),!1;t=l}return s.set(e,t),t.is(2)&&this.is(1048576)&&t.set(1048576),this.program.elementsByDeclaration.set(i,t),!0}getResolvedInstance(e){let t=this.instances;return t&&t.has(e)?t.get(e):null}setResolvedInstance(e,t){let i=this.instances;i?assert(!i.has(e)):this.instances=i=new Map,i.set(e,t)}},Ar=class extends nr{constructor(e,t,i=null,s=!1){super(s?9:7,e,Ke(e,t.parent,t.is(262144)),t.program,t.parent,t.declaration);this.base=null;this.interfaces=null;this.contextualTypeArguments=null;this.nextMemoryOffset=0;this.alignLog2=0;this.constructorInstance=null;this.operatorOverloads=null;this.indexSignature=null;this._id=0;this.rttiFlags=0;this.wrappedType=null;this.extenders=null;this.implementers=null;this.didCheckFieldInitialization=!1;this.visitRef=0;this.prototype=t,this.flags=t.flags,this.decoratorFlags=t.decoratorFlags,this.typeArguments=i;let a=this.program,l=a.options.usizeType,o=new p(l.kind,l.flags&-129|256,l.size);if(o.classReference=this,this.setType(o),!this.hasDecorator(16)){let c=a.nextClassId++;this._id=c,a.managedClasses.set(c,this)}let u=t.typeParameterNodes;if(i){let c=i.length;if(!u||c!=u.length)throw new Error("type argument count mismatch");if(c){let f=this.contextualTypeArguments;f||(this.contextualTypeArguments=f=new Map);for(let _=0;_<c;++_)f.set(u[_].name.text,i[_])}}else if(u&&u.length>0)throw new Error("type argument count mismatch");Rf(a,this)}get id(){return this._id}get isBuiltinArray(){return this.prototype.isBuiltinArray}get isArrayLike(){if(this.isBuiltinArray)return!0;let e=this.getMember("length");return e?(e.kind==11&&e.getterInstance!=null||e.kind==10&&e.getterPrototype!=null)&&(this.lookupOverload(1)!=null||this.lookupOverload(3)!=null):!1}get isInterface(){return this.kind==9}static leastUpperBound(e,t){if(e==t)return e;let i=new Set;for(i.add(e),i.add(t);;){let s=e.base,a=t.base;if(!s&&!a)return null;if(s){if(i.has(s))return s;i.add(e=s)}if(a){if(i.has(a))return a;i.add(t=a)}}}setBase(e){assert(!this.base),this.base=e;let t=e.contextualTypeArguments;if(t){let a=this.contextualTypeArguments;for(let l=Map_keys(t),o=0,u=l.length;o<u;++o){let c=unchecked(l[o]),f=assert(t.get(c));a?a.has(c)||a.set(c,f):(this.contextualTypeArguments=a=new Map,a.set(c,f))}}e.propagateExtenderUp(this);let i=this.extenders;if(i)for(let a=Set_values(i),l=0,o=a.length;l<o;++l){let u=a[l];e.propagateExtenderUp(u)}let s=e;do{let a=s.interfaces;if(a)for(let l=Set_values(a),o=0,u=l.length;o<u;++o){let c=l[o];this.propagateInterfaceDown(c)}s=s.base}while(s)}propagateExtenderUp(e){let t=this;do{let i=t.extenders;i||(t.extenders=i=new Set),i.add(e),t=t.base}while(t)}propagateInterfaceDown(e){let t=e,i=this.extenders;do{let s=t.implementers;if(s||(t.implementers=s=new Set),s.add(this),i)for(let a=Set_values(i),l=0,o=a.length;l<o;++l){let u=a[l];s.add(u)}t=t.base}while(t)}addInterface(e){let t=this.interfaces;t||(this.interfaces=t=new Set),t.add(e),this.propagateInterfaceDown(e)}isAssignableTo(e){return e.isInterface?this.isInterface?this==e||this.extends(e):this.implements(e):this.isInterface?e==this.program.objectInstance:this==e||this.extends(e)}hasSubclassAssignableTo(e){return e.isInterface?this.isInterface?this.hasImplementerImplementing(e):this.hasExtenderImplementing(e):this.isInterface?this.hasImplementer(e):this.hasExtender(e)}lookupOverload(e,t=!1){if(t)switch(e){case 1:{let s=this.lookupOverload(3);if(s)return s;break}case 2:{let s=this.lookupOverload(4);if(s)return s;break}default:assert(!1)}let i=this;do{let s=i.operatorOverloads;if(s!=null&&s.has(e))return assert(s.get(e));i=i.base}while(i);return null}getMethod(e,t=null){let i=this.getMember(e);return i&&i.kind==4?this.program.resolver.resolveFunction(i,t):null}offsetof(e){let t=assert(this.getMember(e));assert(t.kind==10);let s=t.instance;return s?(assert(s.isField&&s.memoryOffset>=0),s.memoryOffset):0}createBuffer(e=0){let t=this.program,i=this.nextMemoryOffset+e,s=t.computeBlockSize(i,!0),a=new Uint8Array(t.blockOverhead+s),l=t.OBJECTInstance;return l.writeField("mmInfo",s,a,0),l.writeField("gcInfo",0,a,0),l.writeField("gcInfo2",0,a,0),l.writeField("rtId",this.id,a,0),l.writeField("rtSize",i,a,0),a}writeField(e,t,i,s=this.program.totalOverhead){let a=this.getMember(e);if(a&&a.kind==10){let o=a.instance;if(!o)return 0;assert(o.isField&&o.memoryOffset>=0);let u=s+o.memoryOffset,c=o.type.kind;switch(c){case 1:case 6:return assert(!i64_is(t)),be(i32(t),i,u),1;case 2:case 7:return assert(!i64_is(t)),br(i32(t),i,u),2;case 3:case 8:return assert(!i64_is(t)),Se(i32(t),i,u),4;case 5:case 10:return this.program.options.isWasm64?(i64_is(t)?Wn(t,i,u):ll(i32(t),i,u,c==10),8):(i64_is(t)?Gp(t,i,u,c==10):Se(i32(t),i,u),4);case 4:case 9:return i64_is(t)?Wn(t,i,u):ll(i32(t),i,u,c==9),8;case 11:return assert(!i64_is(t)),Wr(f32(t),i,u),4;case 12:return assert(!i64_is(t)),Kr(f64(t),i,u),8}}return assert(!1),0}extendsPrototype(e){return this.prototype.extends(e)}getTypeArgumentsTo(e){let t=this;do{if(t.prototype==e)return t.typeArguments;t=t.base}while(t);return null}getArrayValueType(){let e=this,t=this.program,i=t.arrayPrototype;if(this.extendsPrototype(i))return this.getTypeArgumentsTo(i)[0];let s=t.staticArrayPrototype;if(this.extendsPrototype(s))return this.getTypeArgumentsTo(s)[0];let a=t.arrayBufferViewInstance;for(;e.base!=a;)e=assert(e.base);let l=e.prototype;switch(l.name.charCodeAt(0)){case 70:{if(l==t.float32ArrayPrototype)return p.f32;if(l==t.float64ArrayPrototype)return p.f64;break}case 73:{if(l==t.int8ArrayPrototype)return p.i8;if(l==t.int16ArrayPrototype)return p.i16;if(l==t.int32ArrayPrototype)return p.i32;if(l==t.int64ArrayPrototype)return p.i64;break}case 85:{if(l==t.uint8ArrayPrototype)return p.u8;if(l==t.uint8ClampedArrayPrototype)return p.u8;if(l==t.uint16ArrayPrototype)return p.u16;if(l==t.uint32ArrayPrototype)return p.u32;if(l==t.uint64ArrayPrototype)return p.u64;break}}return assert(!1),p.void}get isPointerfree(){let e=this.program,t=this.members;if(t){for(let i=Map_values(t),s=0,a=i.length;s<a;++s){let l=unchecked(i[s]);if(l.kind==10){let u=l.instance;if(!u)continue;if(u.isField&&u.type.isManaged)return!1}}if(t.has(L.visit)){let i=this.prototype;if(i==e.arrayPrototype||i==e.staticArrayPrototype||i==e.setPrototype||i==e.mapPrototype){let s=assert(this.getTypeArgumentsTo(i));for(let a=0,l=s.length;a<l;++a)if(s[a].isManaged)return!1;return!0}return!1}}return!0}extends(e){return e.hasExtender(this)}hasExtender(e){let t=this.extenders;return t!=null&&t.has(e)}hasExtenderImplementing(e){let t=this.extenders;if(t){for(let i=Set_values(t),s=0,a=i.length;s<a;++s)if(i[s].implements(e))return!0}return!1}implements(e){return e.hasImplementer(this)}hasImplementer(e){let t=this.implementers;return t!=null&&t.has(e)}hasImplementerImplementing(e){let t=this.implementers;if(t){for(let i=Set_values(t),s=0,a=i.length;s<a;++s)if(i[s].implements(e))return!0}return!1}},nu=class extends qs{constructor(r,e,t,i){super(r,e,t,i,!0)}},Ns=class extends Ar{constructor(r,e,t=null){super(r,e,t,!0)}};function Rf(n,r){assert(!n.instancesByName.has(r.internalName)),n.instancesByName.set(r.internalName,r)}function Cf(n,r){if(assert(n.program==r.program),r.members)return null;let e=null;switch(n.kind){case 4:{switch(r.kind){case 12:{rr(r,n),e=n;break}case 14:{n.shadowType||(n.shadowType=r,rr(r,n),e=n);break}}break}case 6:case 2:{if(r.kind==12){rr(r,n),e=n;break}break}case 12:{switch(r.kind){case 2:case 6:case 4:{rr(n,r),e=r;break}case 12:{rr(r,n),e=n;break}case 14:{n.shadowType||(n.shadowType=r,rr(r,n),e=n);break}}break}case 0:{r.kind==14&&(n.shadowType||(n.shadowType=r,rr(r,n),e=n));break}case 14:{switch(r.kind){case 0:case 4:case 12:{r.shadowType||(r.shadowType=n,rr(n,r),e=r);break}}break}}if(e){let t=n.is(2)||n.hasDecorator(1),i=r.is(2)||r.hasDecorator(1);t!=i&&n.program.error(2395,e.identifierNode.range,e.identifierNode.text)}return e}function rr(n,r){let e=n.members;if(e){let t=r.members;t||(r.members=t=new Map);for(let i=Map_keys(e),s=0,a=i.length;s<a;++s){let l=unchecked(i[s]),o=assert(e.get(l));t.set(l,o)}}}function Ke(n,r,e,t=!1){switch(r.kind){case 13:return t?n:r.internalName+mt+n;case 5:return t?n:(assert(!e),r.internalName+zp+n);case 10:case 11:r=r.parent;default:return Ke(r.name,r.parent,r.is(262144),t)+(e?Mp:es)+n}}var Sf=[];function lx(n){for(let r=Sf.length;r<=n;++r)Sf.push(`$${r}`);return Sf[n]}var kf=class{constructor(r,e,t,i){this.index=r;this.parameterName=e;this.parameterType=t;this.fieldLocals=i}};var Er=(V=>(V[V.Bool=0]="Bool",V[V.I8=1]="I8",V[V.I16=2]="I16",V[V.I32=3]="I32",V[V.I64=4]="I64",V[V.Isize=5]="Isize",V[V.U8=6]="U8",V[V.U16=7]="U16",V[V.U32=8]="U32",V[V.U64=9]="U64",V[V.Usize=10]="Usize",V[V.F32=11]="F32",V[V.F64=12]="F64",V[V.V128=13]="V128",V[V.FixedArray=14]="FixedArray",V[V.Extern=15]="Extern",V[V.Func=16]="Func",V[V.Any=17]="Any",V[V.Eq=18]="Eq",V[V.Struct=19]="Struct",V[V.Array=20]="Array",V[V.I31=21]="I31",V[V.String=22]="String",V[V.StringviewWTF8=23]="StringviewWTF8",V[V.StringviewWTF16=24]="StringviewWTF16",V[V.StringviewIter=25]="StringviewIter",V[V.Void=26]="Void",V[V.UnmanagedArray=27]="UnmanagedArray",V[V.DynamicArray=28]="DynamicArray",V))(Er||{}),Lt=(h=>(h[h.None=0]="None",h[h.Signed=1]="Signed",h[h.Unsigned=2]="Unsigned",h[h.Integer=4]="Integer",h[h.Float=8]="Float",h[h.Varying=16]="Varying",h[h.Short=32]="Short",h[h.Long=64]="Long",h[h.Value=128]="Value",h[h.Reference=256]="Reference",h[h.Nullable=512]="Nullable",h[h.Vector=1024]="Vector",h[h.External=2048]="External",h[h.Class=4096]="Class",h[h.Function=8192]="Function",h))(Lt||{}),p=class n{constructor(r,e,t){this.classReference=null;this.signatureReference=null;this.fixedElementType=null;this.fixedLength=0;this.fixedMemoryModel=0;this.unmanagedElementType=null;this.dynamicArrayElementType=null;this.dynamicMemoryModel=0;this.fixedAlignLog2=0;this._nonNullableType=null;this._nullableType=null;this.ref=0;this.kind=r,this.flags=e,this.size=t,e&512?this._nullableType=this:this._nonNullableType=this}get intType(){if(this==n.auto)return this;switch(this.kind){case 0:case 3:case 11:return n.i32;case 1:return n.i8;case 2:return n.i16;case 12:case 4:return n.i64;case 5:return this.size==64?n.isize64:n.isize32;case 6:return n.u8;case 7:return n.u16;case 8:return n.u32;case 9:return n.u64;case 10:return this.size==64?n.usize64:n.usize32;default:return n.i32}}get exceptVoid(){return this.kind==26?n.auto:this}get byteSize(){return this.size+7>>>3}get alignLog2(){return this.kind==14?this.fixedAlignLog2:31-clz(this.byteSize)}get isValue(){return this.is(128)}get isIntegerValue(){return this.is(132)}get isShortIntegerValue(){return this.is(164)}get isLongIntegerValue(){return this.is(196)}get isSignedIntegerValue(){return this.is(133)}get isUnsignedIntegerValue(){return this.is(134)}get isVaryingIntegerValue(){return this.is(148)}get isIntegerInclReference(){return this.is(4)}get isFloatValue(){return this.is(136)}get isNumericValue(){return this.isIntegerValue||this.isFloatValue}get isBooleanValue(){return this==n.bool}get isVectorValue(){return this.is(1152)}get isReference(){return this.is(256)}get isNullableReference(){return this.is(768)}get isInternalReference(){return this.is(260)}get isExternalReference(){return this.is(2304)}get isNullableExternalReference(){return this.is(2816)}getClass(){return this.isInternalReference?this.classReference:null}get isClass(){return this.getClass()!=null}getClassOrWrapper(r){let e=this.getClass();if(e)return e;{let t=this.getSignature();if(t){let i=t.type,s=assert(r.resolver.resolveClass(r.functionPrototype,[i]));return s.wrappedType=i,s}else{let i=r.wrapperClasses;if(i.has(this))return assert(i.get(this))}}return null}lookupOverload(r,e){let t=this.getClassOrWrapper(e);return t?t.lookupOverload(r):null}getSignature(){return this.isInternalReference?this.signatureReference:null}get isFunction(){return this.getSignature()!=null}get isManaged(){if(this.isInternalReference){let r=this.classReference;return r?!r.hasDecorator(16):this.signatureReference!=null}return!1}get isUnmanaged(){let r=this.classReference;return r!=null&&r.hasDecorator(16)}get inlineExtentBytes(){let r=this.classReference;return r!=null&&(r.hasDecorator(16)||r.hasDecorator(2048))?r.nextMemoryOffset:this.byteSize}get inlineAlignLog2(){let r=this.classReference;return r!=null&&(r.hasDecorator(16)||r.hasDecorator(2048))?r.alignLog2:this.alignLog2}get isMemory(){switch(this.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:return!0}return!1}get nonNullableType(){return assert(this._nonNullableType)}get nullableType(){return this.isReference?this.asNullable():null}computeSmallIntegerShift(r){return r.size-this.size}computeSmallIntegerMask(r){let e=this.size;return this.is(2)||(e-=1),-1>>>r.size-e}is(r){return(this.flags&r)==r}isAny(r){return(this.flags&r)!=0}asNullable(){assert(this.isReference);let r=this._nullableType;return r||(assert(!this.isNullableReference),this._nullableType=r=new n(this.kind,this.flags|512,this.size),r.classReference=this.classReference,r.signatureReference=this.signatureReference,r._nonNullableType=this),r}toUnsigned(){switch(this.kind){case 1:return n.u8;case 2:return n.u16;case 3:return n.u32;case 4:return n.u64;case 5:return this.size==64?n.usize64:n.usize32}return this}equals(r){if(this.kind!=r.kind)return!1;if(this.kind==14){let e=this.fixedElementType,t=r.fixedElementType;return e!=null&&t!=null&&this.fixedLength==r.fixedLength&&this.fixedMemoryModel==r.fixedMemoryModel&&e.equals(t)}if(this.kind==28){let e=this.dynamicArrayElementType,t=r.dynamicArrayElementType;return e!=null&&t!=null&&this.dynamicMemoryModel==r.dynamicMemoryModel&&e.equals(t)}if(this.kind==27){let e=this.unmanagedElementType,t=r.unmanagedElementType;return e!=null&&t!=null&&e.equals(t)}if(this.isReference){let e=this.signatureReference,t=r.signatureReference;return this.classReference==r.classReference&&e==t&&this.isNullableReference==r.isNullableReference}return!0}isAssignableTo(r,e=!1){let t,i,s,a;if(this.isReference){if(r.isReference&&(!this.isNullableReference||r.isNullableReference)){if(t=this.getClass()){if(i=r.getClass())return t.isAssignableTo(i)}else if(s=this.getSignature()){if(a=r.getSignature())return s.isAssignableTo(a)}else if(this.isExternalReference&&(this.kind==r.kind||r.kind==17&&this.kind!=15))return!0}}else if(!r.isReference){if(this.isIntegerValue)if(r.isIntegerValue){if(!e||this.isBooleanValue||this.isSignedIntegerValue==r.isSignedIntegerValue)return this.size<=r.size}else{if(r.kind==11)return this.size<=23;if(r.kind==12)return this.size<=52}else if(this.isFloatValue){if(r.isFloatValue)return this.size<=r.size}else if(this.isVectorValue&&r.isVectorValue)return this.size==r.size}return!1}isStrictlyAssignableTo(r,e=!1){return this.isReference?this.isAssignableTo(r):r.isReference?!1:this.isIntegerValue?r.isIntegerValue&&r.size==this.size&&(!e||this.isSignedIntegerValue==r.isSignedIntegerValue):this.kind==14||this.kind==27?this.equals(r):this.kind==r.kind}hasSubtypeAssignableTo(r){let e=this.getClass(),t=r.getClass();return!e||!t?!1:e.hasSubclassAssignableTo(t)}isChangeableTo(r){if(r.kind==27)return this.is(4)||this.kind==27;if(r.kind==28)return this.is(4)||this.kind==28;if(r.kind==14)return r.fixedMemoryModel==0||r.fixedMemoryModel==1?!1:this.is(4)||this.kind==14;if(this.is(4)&&r.is(4)){let e=this.size;return e==r.size&&(e>=32||this.is(1)==r.is(1))}return this.kind==r.kind}canExtendOrImplement(r){let e=this.getClass(),t=r.getClass();if(!e||!t||this.isManaged!=r.isManaged)return!1;if(this.isInternalReference){if(!r.isInternalReference)return!1}else if(this.isExternalReference){if(!r.isExternalReference)return!1}else return!1;return!0}static commonType(r,e,t=n.auto,i=!1){if(r.isInternalReference){if(!e.isInternalReference)return null;if(t!=n.void&&r.isAssignableTo(t)&&e.isAssignableTo(t))return t;let s=r.getClass(),a=e.getClass();if(s&&a){let l=Ar.leastUpperBound(s,a);if(l)return r.is(512)||e.is(512)?l.type.asNullable():l.type}}else if(e.isInternalReference)return null;return e.isAssignableTo(r,i)?r:r.isAssignableTo(e,i)?e:null}kindToString(){switch(this.kind){case 0:return L.bool;case 1:return L.i8;case 2:return L.i16;case 3:return L.i32;case 4:return L.i64;case 5:return L.isize;case 6:return L.u8;case 7:return L.u16;case 8:return L.u32;case 9:return L.u64;case 10:return L.usize;case 11:return L.f32;case 12:return L.f64;case 13:return L.v128;case 16:return L.ref_func;case 15:return L.ref_extern;case 17:return L.ref_any;case 18:return L.ref_eq;case 19:return L.ref_struct;case 20:return L.ref_array;case 21:return L.ref_i31;case 22:return L.ref_string;case 23:return L.ref_stringview_wtf8;case 24:return L.ref_stringview_wtf16;case 25:return L.ref_stringview_iter;case 14:{let r=this.fixedElementType,e="["+(r?r.toString():"?")+" * "+this.fixedLength.toString()+"]";switch(this.fixedMemoryModel){case 3:return"@unmanaged "+e;case 2:return"@managed "+e;case 1:return"@inline "+e;default:return e}}case 27:{let r=this.unmanagedElementType;return"["+(r?r.toString():"?")+" *]"}case 28:{let r=this.dynamicArrayElementType;return(this.dynamicMemoryModel==2?"@managed @dynamic ":"@unmanaged @dynamic ")+"["+(r?r.toString():"?")+" * n]"}default:assert(!1);case 26:return L.void_}}toString(r=!1){let e=r?"|null":" | null";if(this.isReference){let t=this.getClass();if(t)return this.isNullableReference?t.internalName+e:t.internalName;{let i=this.getSignature();return i?this.isNullableReference?`(${i.toString(r)})${e}`:i.toString(r):this.isNullableReference?`${this.kindToString()}${e}`:this.kindToString()}}return this==n.auto?"auto":this.kindToString()}toRef(){switch(this.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:return P.I32;case 5:case 10:case 27:case 28:if(this.size!=64)return P.I32;case 4:case 9:return P.I64;case 11:return P.F32;case 12:return P.F64;case 13:return P.V128;case 16:return Ae(Ie.Func,this.is(512));case 15:return Ae(Ie.Extern,this.is(512));case 17:return Ae(Ie.Any,this.is(512));case 18:return Ae(Ie.Eq,this.is(512));case 19:return Ae(Ie.Struct,this.is(512));case 20:return Ae(Ie.Array,this.is(512));case 21:return Ae(Ie.I31,this.is(512));case 22:return Ae(Ie.String,this.is(512));case 26:return P.None;case 14:return this.fixedMemoryModel==3||this.fixedMemoryModel==2?P.I32:(assert(!1),P.I32)}return assert(!1),Fs(this)}static{this.i8=new n(1,165,8)}static{this.i16=new n(2,165,16)}static{this.i32=new n(3,133,32)}static{this.i64=new n(4,197,64)}static{this.isize32=new n(5,149,32)}static{this.isize64=new n(5,213,64)}static{this.u8=new n(6,166,8)}static{this.u16=new n(7,166,16)}static{this.u32=new n(8,134,32)}static{this.u64=new n(9,198,64)}static{this.usize32=new n(10,150,32)}static{this.usize64=new n(10,214,64)}static{this.bool=new n(0,166,1)}static{this.f32=new n(11,137,32)}static{this._fixedArrays=null}static fixedArray(r,e,t,i){let s=t==0||t==1,a=(s?"-":t==2?"m":"u")+r.toString()+"["+e.toString()+"]",l=n._fixedArrays;if(!l){let c=new Map;n._fixedArrays=c,l=c}let o=J(l,a);if(o&&o.fixedElementType==r)return o;let u=new n(14,0,s?r.inlineExtentBytes*e<<3:i);return u.fixedElementType=r,u.fixedLength=e,u.fixedMemoryModel=t,u.fixedAlignLog2=s?r.inlineAlignLog2:31-clz(i>>>3),l.set(a,u),u}get fixedArrayElementType(){return assert(this.fixedElementType)}static{this._unmanagedArrays=null}static unmanagedArray(r,e){let t=r.toString()+"*"+e.toString(),i=n._unmanagedArrays;if(!i){let l=new Map;n._unmanagedArrays=l,i=l}let s=J(i,t);if(s&&s.unmanagedElementType==r)return s;let a=new n(27,0,e);return a.unmanagedElementType=r,i.set(t,a),a}get unmanagedArrayElementType(){return assert(this.unmanagedElementType)}static{this._dynamicArrays=null}static dynamicArray(r,e,t){let i=(e==2?"m":"u")+r.toString()+"*d"+t.toString(),s=n._dynamicArrays;if(!s){let o=new Map;n._dynamicArrays=o,s=o}let a=J(s,i);if(a&&a.dynamicArrayElementType==r)return a;let l=new n(28,0,t);return l.dynamicArrayElementType=r,l.dynamicMemoryModel=e,s.set(i,l),l}get dynamicElementType(){return assert(this.dynamicArrayElementType)}static{this.f64=new n(12,201,64)}static{this.v128=new n(13,1152,128)}static{this.func=new n(16,2304,0)}static{this.extern=new n(15,2304,0)}static{this.any=new n(17,2304,0)}static{this.eq=new n(18,2304,0)}static{this.struct=new n(19,2304,0)}static{this.array=new n(20,2304,0)}static{this.i31=new n(21,2304,0)}static{this.string=new n(22,2304,0)}static{this.stringview_wtf8=new n(23,2304,0)}static{this.stringview_wtf16=new n(24,2304,0)}static{this.stringview_iter=new n(25,2304,0)}static{this.void=new n(26,0,0)}static{this.auto=new n(n.i32.kind,n.i32.flags,n.i32.size)}};function Z1(n){let r=n.length,e=new Array(r);for(let t=0;t<r;++t)unchecked(e[t]=n[t].toRef());return e}function Zo(n){let r=n.length;if(!r)return"";let e=new Array(r);for(let t=0;t<r;++t)unchecked(e[t]=n[t].toString(!0));return e.join(",")}var ii=(i=>(i[i.None=0]="None",i[i.Inline=1]="Inline",i[i.Managed=2]="Managed",i[i.Unmanaged=3]="Unmanaged",i))(ii||{});function $1(n){if(n==null)return"";let r=n.length;if(!r)return"";let e=new Array(r);for(let t=0;t<r;++t){let i=unchecked(n[t]);unchecked(e[t]=i==1?"i":i==2?"m":i==3?"u":"-")}return"!mm:"+e.join("")+":"}var oe=class n{constructor(r,e,t,i,s,a,l,o,u,c,f,_){this.program=r;this.parameterTypes=e;this.returnType=t;this.thisType=i;this.requiredParameters=s;this.hasRest=a;this.sretDisabled=l;this.externalBoundary=o;this.exportByValParams=u;this.memoryModels=c;this.id=f;this.type=_}static create(r,e=[],t=p.void,i=null,s=e?e.length:0,a=!1,l=!1,o=!1,u=!1,c=null){let f=r.options.usizeType,_=new p(f.kind,f.flags&-129|256,f.size),d=r.uniqueSignatures,m=r.nextSignatureId,h=new n(r,e,t,i,s,a,l,o,u,c,m,_),b=(l?"!sret-disabled:":"")+(o?"!external-boundary:":"")+(u?"!export-byval:":"")+$1(c)+h.toString();if(d.has(b)){let A=assert(d.get(b));return assert(h.equals(A)),A}return r.nextSignatureId=m+1,_.signatureReference=h,d.set(b,h),h}memoryModelOf(r){let e=this.memoryModels;return e==null?0:unchecked(e[r])}static wasmParamCountOf(r){if(r.kind==14&&(r.fixedMemoryModel==0||r.fixedMemoryModel==1)){let i=n.leafCountOf(r);return i>0?i:1}let e=r.classReference;if(e==null||!e.hasDecorator(4096))return 1;let t=n.leafCountOf(r);return t>0?t:1}static leafTypesOf(r,e){if(r.kind==14&&(r.fixedMemoryModel==0||r.fixedMemoryModel==1)){let s=assert(r.fixedElementType),a=s.classReference,l=a!=null&&(a.hasDecorator(16)||a.hasDecorator(2048));for(let o=0,u=r.fixedLength;o<u;++o)l?n.leafTypesOf(s,e):e.push(s);return}let t=r.classReference;if(t==null)return;let i=t.members;if(i)for(let s=Map_values(i),a=0,l=s.length;a<l;++a){let o=unchecked(s[a]);if(o.kind!=10)continue;let u=o.instance;if(u==null||!u.isField)continue;let c=u.type;n.isInlineStructRef(c)?n.leafTypesOf(c,e):e.push(c)}}static leafCountOf(r){let e=new Array;return n.leafTypesOf(r,e),e.length}wasmParamSlotCountOf(r){return this.isViewParam(r)||this.isByValPointerParam(r)?1:n.wasmParamCountOf(unchecked(this.parameterTypes[r]))}isViewParam(r){return this.memoryModelOf(r)==3&&n.isInlineStructRef(unchecked(this.parameterTypes[r]))}crossesByValueParam(r){return this.isViewParam(r)?!1:n.isInlineStructRef(unchecked(this.parameterTypes[r]))?!0:this.memoryModelOf(r)==1}isExternalPointerParam(r){return this.externalBoundary?this.crossesByValueParam(r):!1}isExportByValParam(r){return this.exportByValParams?this.crossesByValueParam(r):!1}isByValPointerParam(r){return this.isExternalPointerParam(r)||this.isExportByValParam(r)}get byValPointerParams(){return this.externalBoundary||this.exportByValParams}static isInlineStructRef(r){let e=r.classReference;return e!=null&&e.hasDecorator(4096)}static fieldCountOf(r){return r.classReference==null?0:n.leafCountOf(r)}get hasHiddenDestParam(){if(this.sretDisabled)return!1;let r=this.returnType.classReference;return r!=null&&r.hasDecorator(4096)}wasmParamStartOf(r){let e=this.parameterTypes,t=this.hasHiddenDestParam?1:0;for(let i=0;i<r&&i<e.length;++i)t+=this.wasmParamSlotCountOf(i);return t}wasmParamCount(){let r=this.parameterTypes,e=this.hasHiddenDestParam?1:0;for(let t=0,i=r.length;t<i;++t)e+=this.wasmParamSlotCountOf(t);return e}sourceIndexOf(r){let e=this.parameterTypes,t=this.hasHiddenDestParam?1:0;if(r<t)return-1;for(let i=0,s=e.length;i<s;++i){let a=this.wasmParamSlotCountOf(i);if(r<t+a)return i;t+=a}return-1}get paramRefs(){let r=this.thisType,e=this.parameterTypes,t=e.length,i=this.hasHiddenDestParam;if(!t&&!i)return r?r.toRef():P.None;let s=this.wasmParamCount(),a=new Array(r?1+s:s),l=0;r&&unchecked(a[l++]=r.toRef()),i&&unchecked(a[l++]=P.I32);for(let o=0;o<t;++o){let u=unchecked(e[o]);if(this.isViewParam(o))unchecked(a[l++]=P.I32);else if(this.isByValPointerParam(o))unchecked(a[l++]=P.I32);else if(n.isInlineStructRef(u)){let c=new Array;n.leafTypesOf(u,c);for(let f=0,_=c.length;f<_;++f)unchecked(a[l++]=unchecked(c[f]).toRef())}else if(u.kind==14&&(u.fixedMemoryModel==0||u.fixedMemoryModel==1)){let c=new Array;n.leafTypesOf(u,c);for(let f=0,_=c.length;f<_;++f)unchecked(a[l++]=unchecked(c[f]).toRef())}else unchecked(a[l++]=u.toRef())}return it(a)}get resultRefs(){if(this.hasHiddenDestParam)return P.None;let r=this.returnType;if(r.kind==14&&(r.fixedMemoryModel==0||r.fixedMemoryModel==1)){let e=new Array;n.leafTypesOf(r,e);let t=new Array(e.length);for(let i=0,s=e.length;i<s;++i)unchecked(t[i]=unchecked(e[i]).toRef());return it(t)}return r.toRef()}equals(r){let e=this.thisType,t=r.thisType;if(e){if(!t||!e.equals(t))return!1}else if(t)return!1;if(this.hasRest!=r.hasRest||this.sretDisabled!=r.sretDisabled||this.externalBoundary!=r.externalBoundary||this.exportByValParams!=r.exportByValParams)return!1;let i=this.memoryModels,s=r.memoryModels;if(i==null!=(s==null))return!1;if(i!=null){let u=assert(s),c=i.length;if(c!=u.length)return!1;for(let f=0;f<c;++f)if(unchecked(i[f])!=unchecked(u[f]))return!1}if(!this.returnType.equals(r.returnType))return!1;let a=this.parameterTypes,l=r.parameterTypes,o=a.length;if(o!=l.length)return!1;for(let u=0;u<o;++u){let c=unchecked(a[u]),f=unchecked(l[u]);if(!c.equals(f))return!1}return!0}isAssignableTo(r,e=!1){let t=this.thisType,i=r.thisType;if(t&&i){if(!(e?t.canExtendOrImplement(i):i.isAssignableTo(t)))return!1}else if(t||i)return!1;if(this.hasRest!=r.hasRest)return!1;let s=this.returnType,a=r.returnType;if(!(s==a||s.isAssignableTo(a)))return!1;let l=this.parameterTypes,o=r.parameterTypes,u=l.length;if(u!=o.length)return!1;for(let c=0;c<u;++c){let f=unchecked(l[c]),_=unchecked(o[c]);if(f!=_)return!1}return!0}get hasManagedOperands(){let r=this.thisType;if(r&&r.isManaged)return!0;let e=this.parameterTypes;for(let t=0,i=e.length;t<i;++t)if(unchecked(e[t]).isManaged)return!0;return!1}getManagedOperandIndices(){let r=new Array,e=0,t=this.thisType;t&&(t.isManaged&&r.push(e),++e);let i=this.parameterTypes;for(let s=0,a=i.length;s<a;++s)unchecked(i[s]).isManaged&&r.push(e),++e;return r}get hasVectorValueOperands(){let r=this.thisType;if(r&&r.isVectorValue)return!0;let e=this.parameterTypes;for(let t=0,i=e.length;t<i;++t)if(unchecked(e[t]).isVectorValue)return!0;return!1}getVectorValueOperandIndices(){let r=new Array,e=0,t=this.thisType;t&&(t.isVectorValue&&r.push(e),++e);let i=this.parameterTypes;for(let s=0,a=i.length;s<a;++s)unchecked(i[s]).isVectorValue&&r.push(e),++e;return r}toString(r=!1){let e=new Array;e.push(r?"%28":"(");let t=0,i=this.thisType;i&&(e.push(r?"this:":"this: "),e.push(i.toString(r)),t=1);let s=this.parameterTypes,a=s.length;if(a){let l=this.requiredParameters,o=this.hasRest?a-1:-1;for(let u=0;u<a;++u,++t)t&&e.push(r?"%2C":", "),u==o&&e.push("..."),e.push(s[u].toString(r)),u>=l&&u!=o&&e.push("?")}return e.push(r?"%29=>":") => "),e.push(this.returnType.toString(r)),e.join("")}clone(r=this.requiredParameters,e=this.hasRest){let t=this.parameterTypes,i=t.length,s=new Array(i);for(let a=0;a<i;++a)unchecked(s[a]=t[a]);return n.create(this.program,s,this.returnType,this.thisType,r,e,this.sretDisabled,this.externalBoundary,this.exportByValParams,this.memoryModels)}};var g;(x=>(x.start="~start",x.started="~started",x.argumentsLength="~argumentsLength",x.setArgumentsLength="~setArgumentsLength",x.env="~env",x.abort="~lib/builtins/abort",x.trace="~lib/builtins/trace",x.seed="~lib/builtins/seed",x.isBoolean="~lib/builtins/isBoolean",x.isInteger="~lib/builtins/isInteger",x.isSigned="~lib/builtins/isSigned",x.isFloat="~lib/builtins/isFloat",x.isVector="~lib/builtins/isVector",x.isReference="~lib/builtins/isReference",x.isString="~lib/builtins/isString",x.isArray="~lib/builtins/isArray",x.isArrayLike="~lib/builtins/isArrayLike",x.isFunction="~lib/builtins/isFunction",x.isNullable="~lib/builtins/isNullable",x.isDefined="~lib/builtins/isDefined",x.isConstant="~lib/builtins/isConstant",x.isManaged="~lib/builtins/isManaged",x.isVoid="~lib/builtins/isVoid",x.add="~lib/builtins/add",x.sub="~lib/builtins/sub",x.mul="~lib/builtins/mul",x.div="~lib/builtins/div",x.clz="~lib/builtins/clz",x.ctz="~lib/builtins/ctz",x.popcnt="~lib/builtins/popcnt",x.rotl="~lib/builtins/rotl",x.rotr="~lib/builtins/rotr",x.abs="~lib/builtins/abs",x.max="~lib/builtins/max",x.min="~lib/builtins/min",x.ceil="~lib/builtins/ceil",x.floor="~lib/builtins/floor",x.copysign="~lib/builtins/copysign",x.nearest="~lib/builtins/nearest",x.reinterpret="~lib/builtins/reinterpret",x.sqrt="~lib/builtins/sqrt",x.trunc="~lib/builtins/trunc",x.eq="~lib/builtins/eq",x.ne="~lib/builtins/ne",x.rem="~lib/builtins/rem",x.load="~lib/builtins/load",x.store="~lib/builtins/store",x.atomic_load="~lib/builtins/atomic.load",x.atomic_store="~lib/builtins/atomic.store",x.atomic_add="~lib/builtins/atomic.add",x.atomic_sub="~lib/builtins/atomic.sub",x.atomic_and="~lib/builtins/atomic.and",x.atomic_or="~lib/builtins/atomic.or",x.atomic_xor="~lib/builtins/atomic.xor",x.atomic_xchg="~lib/builtins/atomic.xchg",x.atomic_cmpxchg="~lib/builtins/atomic.cmpxchg",x.atomic_wait="~lib/builtins/atomic.wait",x.atomic_notify="~lib/builtins/atomic.notify",x.atomic_fence="~lib/builtins/atomic.fence",x.sizeof="~lib/builtins/sizeof",x.alignof="~lib/builtins/alignof",x.offsetof="~lib/builtins/offsetof",x.abiNameOf="~lib/builtins/abiNameOf",x.nameof="~lib/builtins/nameof",x.lengthof="~lib/builtins/lengthof",x.select="~lib/builtins/select",x.unreachable="~lib/builtins/unreachable",x.changetype="~lib/builtins/changetype",x.copyInto="~lib/builtins/copyInto",x.assert="~lib/builtins/assert",x.call_indirect="~lib/builtins/call_indirect",x.unchecked="~lib/builtins/unchecked",x.inline_always="~lib/builtins/inline.always",x.instantiate="~lib/builtins/instantiate",x.idof="~lib/builtins/idof",x.i8="~lib/builtins/i8",x.i16="~lib/builtins/i16",x.i32="~lib/builtins/i32",x.i64="~lib/builtins/i64",x.isize="~lib/builtins/isize",x.u8="~lib/builtins/u8",x.u16="~lib/builtins/u16",x.u32="~lib/builtins/u32",x.u64="~lib/builtins/u64",x.usize="~lib/builtins/usize",x.bool="~lib/builtins/bool",x.f32="~lib/builtins/f32",x.f64="~lib/builtins/f64",x.v128="~lib/builtins/v128",x.i32_clz="~lib/builtins/i32.clz",x.i64_clz="~lib/builtins/i64.clz",x.i32_ctz="~lib/builtins/i32.ctz",x.i64_ctz="~lib/builtins/i64.ctz",x.i32_popcnt="~lib/builtins/i32.popcnt",x.i64_popcnt="~lib/builtins/i64.popcnt",x.i32_rotl="~lib/builtins/i32.rotl",x.i64_rotl="~lib/builtins/i64.rotl",x.i32_rotr="~lib/builtins/i32.rotr",x.i64_rotr="~lib/builtins/i64.rotr",x.f32_abs="~lib/builtins/f32.abs",x.f64_abs="~lib/builtins/f64.abs",x.f32_max="~lib/builtins/f32.max",x.f64_max="~lib/builtins/f64.max",x.f32_min="~lib/builtins/f32.min",x.f64_min="~lib/builtins/f64.min",x.f32_ceil="~lib/builtins/f32.ceil",x.f64_ceil="~lib/builtins/f64.ceil",x.f32_floor="~lib/builtins/f32.floor",x.f64_floor="~lib/builtins/f64.floor",x.f32_copysign="~lib/builtins/f32.copysign",x.f64_copysign="~lib/builtins/f64.copysign",x.f32_nearest="~lib/builtins/f32.nearest",x.f64_nearest="~lib/builtins/f64.nearest",x.i32_reinterpret_f32="~lib/builtins/i32.reinterpret_f32",x.i64_reinterpret_f64="~lib/builtins/i64.reinterpret_f64",x.f32_reinterpret_i32="~lib/builtins/f32.reinterpret_i32",x.f64_reinterpret_i64="~lib/builtins/f64.reinterpret_i64",x.f32_sqrt="~lib/builtins/f32.sqrt",x.f64_sqrt="~lib/builtins/f64.sqrt",x.f32_trunc="~lib/builtins/f32.trunc",x.f64_trunc="~lib/builtins/f64.trunc",x.i32_add="~lib/builtins/i32.add",x.i64_add="~lib/builtins/i64.add",x.f32_add="~lib/builtins/f32.add",x.f64_add="~lib/builtins/f64.add",x.i32_sub="~lib/builtins/i32.sub",x.i64_sub="~lib/builtins/i64.sub",x.f32_sub="~lib/builtins/f32.sub",x.f64_sub="~lib/builtins/f64.sub",x.i32_mul="~lib/builtins/i32.mul",x.i64_mul="~lib/builtins/i64.mul",x.f32_mul="~lib/builtins/f32.mul",x.f64_mul="~lib/builtins/f64.mul",x.i32_div_s="~lib/builtins/i32.div_s",x.i32_div_u="~lib/builtins/i32.div_u",x.i64_div_s="~lib/builtins/i64.div_s",x.i64_div_u="~lib/builtins/i64.div_u",x.f32_div="~lib/builtins/f32.div",x.f64_div="~lib/builtins/f64.div",x.i32_eq="~lib/builtins/i32.eq",x.i64_eq="~lib/builtins/i64.eq",x.f32_eq="~lib/builtins/f32.eq",x.f64_eq="~lib/builtins/f64.eq",x.i32_ne="~lib/builtins/i32.ne",x.i64_ne="~lib/builtins/i64.ne",x.f32_ne="~lib/builtins/f32.ne",x.f64_ne="~lib/builtins/f64.ne",x.i32_rem_s="~lib/builtins/i32.rem_s",x.i32_rem_u="~lib/builtins/i32.rem_u",x.i64_rem_s="~lib/builtins/i64.rem_s",x.i64_rem_u="~lib/builtins/i64.rem_u",x.i32_load8_s="~lib/builtins/i32.load8_s",x.i32_load8_u="~lib/builtins/i32.load8_u",x.i32_load16_s="~lib/builtins/i32.load16_s",x.i32_load16_u="~lib/builtins/i32.load16_u",x.i32_load="~lib/builtins/i32.load",x.i64_load8_s="~lib/builtins/i64.load8_s",x.i64_load8_u="~lib/builtins/i64.load8_u",x.i64_load16_s="~lib/builtins/i64.load16_s",x.i64_load16_u="~lib/builtins/i64.load16_u",x.i64_load32_s="~lib/builtins/i64.load32_s",x.i64_load32_u="~lib/builtins/i64.load32_u",x.i64_load="~lib/builtins/i64.load",x.f32_load="~lib/builtins/f32.load",x.f64_load="~lib/builtins/f64.load",x.i32_store8="~lib/builtins/i32.store8",x.i32_store16="~lib/builtins/i32.store16",x.i32_store="~lib/builtins/i32.store",x.i64_store8="~lib/builtins/i64.store8",x.i64_store16="~lib/builtins/i64.store16",x.i64_store32="~lib/builtins/i64.store32",x.i64_store="~lib/builtins/i64.store",x.f32_store="~lib/builtins/f32.store",x.f64_store="~lib/builtins/f64.store",x.i32_atomic_load8_u="~lib/builtins/i32.atomic.load8_u",x.i32_atomic_load16_u="~lib/builtins/i32.atomic.load16_u",x.i32_atomic_load="~lib/builtins/i32.atomic.load",x.i64_atomic_load8_u="~lib/builtins/i64.atomic.load8_u",x.i64_atomic_load16_u="~lib/builtins/i64.atomic.load16_u",x.i64_atomic_load32_u="~lib/builtins/i64.atomic.load32_u",x.i64_atomic_load="~lib/builtins/i64.atomic.load",x.i32_atomic_store8="~lib/builtins/i32.atomic.store8",x.i32_atomic_store16="~lib/builtins/i32.atomic.store16",x.i32_atomic_store="~lib/builtins/i32.atomic.store",x.i64_atomic_store8="~lib/builtins/i64.atomic.store8",x.i64_atomic_store16="~lib/builtins/i64.atomic.store16",x.i64_atomic_store32="~lib/builtins/i64.atomic.store32",x.i64_atomic_store="~lib/builtins/i64.atomic.store",x.i32_atomic_rmw8_add_u="~lib/builtins/i32.atomic.rmw8.add_u",x.i32_atomic_rmw16_add_u="~lib/builtins/i32.atomic.rmw16.add_u",x.i32_atomic_rmw_add="~lib/builtins/i32.atomic.rmw.add",x.i64_atomic_rmw8_add_u="~lib/builtins/i64.atomic.rmw8.add_u",x.i64_atomic_rmw16_add_u="~lib/builtins/i64.atomic.rmw16.add_u",x.i64_atomic_rmw32_add_u="~lib/builtins/i64.atomic.rmw32.add_u",x.i64_atomic_rmw_add="~lib/builtins/i64.atomic.rmw.add",x.i32_atomic_rmw8_sub_u="~lib/builtins/i32.atomic.rmw8.sub_u",x.i32_atomic_rmw16_sub_u="~lib/builtins/i32.atomic.rmw16.sub_u",x.i32_atomic_rmw_sub="~lib/builtins/i32.atomic.rmw.sub",x.i64_atomic_rmw8_sub_u="~lib/builtins/i64.atomic.rmw8.sub_u",x.i64_atomic_rmw16_sub_u="~lib/builtins/i64.atomic.rmw16.sub_u",x.i64_atomic_rmw32_sub_u="~lib/builtins/i64.atomic.rmw32.sub_u",x.i64_atomic_rmw_sub="~lib/builtins/i64.atomic.rmw.sub",x.i32_atomic_rmw8_and_u="~lib/builtins/i32.atomic.rmw8.and_u",x.i32_atomic_rmw16_and_u="~lib/builtins/i32.atomic.rmw16.and_u",x.i32_atomic_rmw_and="~lib/builtins/i32.atomic.rmw.and",x.i64_atomic_rmw8_and_u="~lib/builtins/i64.atomic.rmw8.and_u",x.i64_atomic_rmw16_and_u="~lib/builtins/i64.atomic.rmw16.and_u",x.i64_atomic_rmw32_and_u="~lib/builtins/i64.atomic.rmw32.and_u",x.i64_atomic_rmw_and="~lib/builtins/i64.atomic.rmw.and",x.i32_atomic_rmw8_or_u="~lib/builtins/i32.atomic.rmw8.or_u",x.i32_atomic_rmw16_or_u="~lib/builtins/i32.atomic.rmw16.or_u",x.i32_atomic_rmw_or="~lib/builtins/i32.atomic.rmw.or",x.i64_atomic_rmw8_or_u="~lib/builtins/i64.atomic.rmw8.or_u",x.i64_atomic_rmw16_or_u="~lib/builtins/i64.atomic.rmw16.or_u",x.i64_atomic_rmw32_or_u="~lib/builtins/i64.atomic.rmw32.or_u",x.i64_atomic_rmw_or="~lib/builtins/i64.atomic.rmw.or",x.i32_atomic_rmw8_xor_u="~lib/builtins/i32.atomic.rmw8.xor_u",x.i32_atomic_rmw16_xor_u="~lib/builtins/i32.atomic.rmw16.xor_u",x.i32_atomic_rmw_xor="~lib/builtins/i32.atomic.rmw.xor",x.i64_atomic_rmw8_xor_u="~lib/builtins/i64.atomic.rmw8.xor_u",x.i64_atomic_rmw16_xor_u="~lib/builtins/i64.atomic.rmw16.xor_u",x.i64_atomic_rmw32_xor_u="~lib/builtins/i64.atomic.rmw32.xor_u",x.i64_atomic_rmw_xor="~lib/builtins/i64.atomic.rmw.xor",x.i32_atomic_rmw8_xchg_u="~lib/builtins/i32.atomic.rmw8.xchg_u",x.i32_atomic_rmw16_xchg_u="~lib/builtins/i32.atomic.rmw16.xchg_u",x.i32_atomic_rmw_xchg="~lib/builtins/i32.atomic.rmw.xchg",x.i64_atomic_rmw8_xchg_u="~lib/builtins/i64.atomic.rmw8.xchg_u",x.i64_atomic_rmw16_xchg_u="~lib/builtins/i64.atomic.rmw16.xchg_u",x.i64_atomic_rmw32_xchg_u="~lib/builtins/i64.atomic.rmw32.xchg_u",x.i64_atomic_rmw_xchg="~lib/builtins/i64.atomic.rmw.xchg",x.i32_atomic_rmw8_cmpxchg_u="~lib/builtins/i32.atomic.rmw8.cmpxchg_u",x.i32_atomic_rmw16_cmpxchg_u="~lib/builtins/i32.atomic.rmw16.cmpxchg_u",x.i32_atomic_rmw_cmpxchg="~lib/builtins/i32.atomic.rmw.cmpxchg",x.i64_atomic_rmw8_cmpxchg_u="~lib/builtins/i64.atomic.rmw8.cmpxchg_u",x.i64_atomic_rmw16_cmpxchg_u="~lib/builtins/i64.atomic.rmw16.cmpxchg_u",x.i64_atomic_rmw32_cmpxchg_u="~lib/builtins/i64.atomic.rmw32.cmpxchg_u",x.i64_atomic_rmw_cmpxchg="~lib/builtins/i64.atomic.rmw.cmpxchg",x.memory_atomic_wait32="~lib/memory/memory.atomic.wait32",x.memory_atomic_wait64="~lib/memory/memory.atomic.wait64",x.v128_splat="~lib/builtins/v128.splat",x.v128_extract_lane="~lib/builtins/v128.extract_lane",x.v128_replace_lane="~lib/builtins/v128.replace_lane",x.v128_shuffle="~lib/builtins/v128.shuffle",x.v128_swizzle="~lib/builtins/v128.swizzle",x.v128_load_splat="~lib/builtins/v128.load_splat",x.v128_load_ext="~lib/builtins/v128.load_ext",x.v128_load_zero="~lib/builtins/v128.load_zero",x.v128_load_lane="~lib/builtins/v128.load_lane",x.v128_store_lane="~lib/builtins/v128.store_lane",x.v128_load="~lib/builtins/v128.load",x.v128_load8x8_s="~lib/builtins/v128.load8x8_s",x.v128_load8x8_u="~lib/builtins/v128.load8x8_u",x.v128_load16x4_s="~lib/builtins/v128.load16x4_s",x.v128_load16x4_u="~lib/builtins/v128.load16x4_u",x.v128_load32x2_s="~lib/builtins/v128.load32x2_s",x.v128_load32x2_u="~lib/builtins/v128.load32x2_u",x.v128_load8_splat="~lib/builtins/v128.load8_splat",x.v128_load16_splat="~lib/builtins/v128.load16_splat",x.v128_load32_splat="~lib/builtins/v128.load32_splat",x.v128_load64_splat="~lib/builtins/v128.load64_splat",x.v128_load32_zero="~lib/builtins/v128.load32_zero",x.v128_load64_zero="~lib/builtins/v128.load64_zero",x.v128_load8_lane="~lib/builtins/v128.load8_lane",x.v128_load16_lane="~lib/builtins/v128.load16_lane",x.v128_load32_lane="~lib/builtins/v128.load32_lane",x.v128_load64_lane="~lib/builtins/v128.load64_lane",x.v128_store8_lane="~lib/builtins/v128.store8_lane",x.v128_store16_lane="~lib/builtins/v128.store16_lane",x.v128_store32_lane="~lib/builtins/v128.store32_lane",x.v128_store64_lane="~lib/builtins/v128.store64_lane",x.v128_store="~lib/builtins/v128.store",x.v128_add="~lib/builtins/v128.add",x.v128_sub="~lib/builtins/v128.sub",x.v128_mul="~lib/builtins/v128.mul",x.v128_div="~lib/builtins/v128.div",x.v128_neg="~lib/builtins/v128.neg",x.v128_add_sat="~lib/builtins/v128.add_sat",x.v128_sub_sat="~lib/builtins/v128.sub_sat",x.v128_shl="~lib/builtins/v128.shl",x.v128_shr="~lib/builtins/v128.shr",x.v128_and="~lib/builtins/v128.and",x.v128_or="~lib/builtins/v128.or",x.v128_xor="~lib/builtins/v128.xor",x.v128_andnot="~lib/builtins/v128.andnot",x.v128_not="~lib/builtins/v128.not",x.v128_bitselect="~lib/builtins/v128.bitselect",x.v128_any_true="~lib/builtins/v128.any_true",x.v128_all_true="~lib/builtins/v128.all_true",x.v128_bitmask="~lib/builtins/v128.bitmask",x.v128_popcnt="~lib/builtins/v128.popcnt",x.v128_min="~lib/builtins/v128.min",x.v128_max="~lib/builtins/v128.max",x.v128_pmin="~lib/builtins/v128.pmin",x.v128_pmax="~lib/builtins/v128.pmax",x.v128_dot="~lib/builtins/v128.dot",x.v128_avgr="~lib/builtins/v128.avgr",x.v128_abs="~lib/builtins/v128.abs",x.v128_sqrt="~lib/builtins/v128.sqrt",x.v128_ceil="~lib/builtins/v128.ceil",x.v128_floor="~lib/builtins/v128.floor",x.v128_trunc="~lib/builtins/v128.trunc",x.v128_nearest="~lib/builtins/v128.nearest",x.v128_eq="~lib/builtins/v128.eq",x.v128_ne="~lib/builtins/v128.ne",x.v128_lt="~lib/builtins/v128.lt",x.v128_le="~lib/builtins/v128.le",x.v128_gt="~lib/builtins/v128.gt",x.v128_ge="~lib/builtins/v128.ge",x.v128_convert="~lib/builtins/v128.convert",x.v128_convert_low="~lib/builtins/v128.convert_low",x.v128_trunc_sat="~lib/builtins/v128.trunc_sat",x.v128_trunc_sat_zero="~lib/builtins/v128.trunc_sat_zero",x.v128_narrow="~lib/builtins/v128.narrow",x.v128_extend_low="~lib/builtins/v128.extend_low",x.v128_extend_high="~lib/builtins/v128.extend_high",x.v128_extadd_pairwise="~lib/builtins/v128.extadd_pairwise",x.v128_demote_zero="~lib/builtins/v128.demote_zero",x.v128_promote_low="~lib/builtins/v128.promote_low",x.v128_q15mulr_sat="~lib/builtins/v128.q15mulr_sat",x.v128_extmul_low="~lib/builtins/v128.extmul_low",x.v128_extmul_high="~lib/builtins/v128.extmul_high",x.v128_relaxed_swizzle="~lib/builtins/v128.relaxed_swizzle",x.v128_relaxed_trunc="~lib/builtins/v128.relaxed_trunc",x.v128_relaxed_trunc_zero="~lib/builtins/v128.relaxed_trunc_zero",x.v128_relaxed_madd="~lib/builtins/v128.relaxed_madd",x.v128_relaxed_nmadd="~lib/builtins/v128.relaxed_nmadd",x.v128_relaxed_laneselect="~lib/builtins/v128.relaxed_laneselect",x.v128_relaxed_min="~lib/builtins/v128.relaxed_min",x.v128_relaxed_max="~lib/builtins/v128.relaxed_max",x.v128_relaxed_q15mulr="~lib/builtins/v128.relaxed_q15mulr",x.v128_relaxed_dot="~lib/builtins/v128.relaxed_dot",x.v128_relaxed_dot_add="~lib/builtins/v128.relaxed_dot_add",x.i8x16="~lib/builtins/i8x16",x.i16x8="~lib/builtins/i16x8",x.i32x4="~lib/builtins/i32x4",x.i64x2="~lib/builtins/i64x2",x.f32x4="~lib/builtins/f32x4",x.f64x2="~lib/builtins/f64x2",x.i8x16_splat="~lib/builtins/i8x16.splat",x.i8x16_extract_lane_s="~lib/builtins/i8x16.extract_lane_s",x.i8x16_extract_lane_u="~lib/builtins/i8x16.extract_lane_u",x.i8x16_replace_lane="~lib/builtins/i8x16.replace_lane",x.i8x16_add="~lib/builtins/i8x16.add",x.i8x16_sub="~lib/builtins/i8x16.sub",x.i8x16_mul="~lib/builtins/i8x16.mul",x.i8x16_min_s="~lib/builtins/i8x16.min_s",x.i8x16_min_u="~lib/builtins/i8x16.min_u",x.i8x16_max_s="~lib/builtins/i8x16.max_s",x.i8x16_max_u="~lib/builtins/i8x16.max_u",x.i8x16_avgr_u="~lib/builtins/i8x16.avgr_u",x.i8x16_abs="~lib/builtins/i8x16.abs",x.i8x16_neg="~lib/builtins/i8x16.neg",x.i8x16_add_sat_s="~lib/builtins/i8x16.add_sat_s",x.i8x16_add_sat_u="~lib/builtins/i8x16.add_sat_u",x.i8x16_sub_sat_s="~lib/builtins/i8x16.sub_sat_s",x.i8x16_sub_sat_u="~lib/builtins/i8x16.sub_sat_u",x.i8x16_shl="~lib/builtins/i8x16.shl",x.i8x16_shr_s="~lib/builtins/i8x16.shr_s",x.i8x16_shr_u="~lib/builtins/i8x16.shr_u",x.i8x16_all_true="~lib/builtins/i8x16.all_true",x.i8x16_bitmask="~lib/builtins/i8x16.bitmask",x.i8x16_popcnt="~lib/builtins/i8x16.popcnt",x.i8x16_eq="~lib/builtins/i8x16.eq",x.i8x16_ne="~lib/builtins/i8x16.ne",x.i8x16_lt_s="~lib/builtins/i8x16.lt_s",x.i8x16_lt_u="~lib/builtins/i8x16.lt_u",x.i8x16_le_s="~lib/builtins/i8x16.le_s",x.i8x16_le_u="~lib/builtins/i8x16.le_u",x.i8x16_gt_s="~lib/builtins/i8x16.gt_s",x.i8x16_gt_u="~lib/builtins/i8x16.gt_u",x.i8x16_ge_s="~lib/builtins/i8x16.ge_s",x.i8x16_ge_u="~lib/builtins/i8x16.ge_u",x.i8x16_narrow_i16x8_s="~lib/builtins/i8x16.narrow_i16x8_s",x.i8x16_narrow_i16x8_u="~lib/builtins/i8x16.narrow_i16x8_u",x.i8x16_shuffle="~lib/builtins/i8x16.shuffle",x.i8x16_swizzle="~lib/builtins/i8x16.swizzle",x.i16x8_splat="~lib/builtins/i16x8.splat",x.i16x8_extract_lane_s="~lib/builtins/i16x8.extract_lane_s",x.i16x8_extract_lane_u="~lib/builtins/i16x8.extract_lane_u",x.i16x8_replace_lane="~lib/builtins/i16x8.replace_lane",x.i16x8_add="~lib/builtins/i16x8.add",x.i16x8_sub="~lib/builtins/i16x8.sub",x.i16x8_mul="~lib/builtins/i16x8.mul",x.i16x8_min_s="~lib/builtins/i16x8.min_s",x.i16x8_min_u="~lib/builtins/i16x8.min_u",x.i16x8_max_s="~lib/builtins/i16x8.max_s",x.i16x8_max_u="~lib/builtins/i16x8.max_u",x.i16x8_avgr_u="~lib/builtins/i16x8.avgr_u",x.i16x8_abs="~lib/builtins/i16x8.abs",x.i16x8_neg="~lib/builtins/i16x8.neg",x.i16x8_add_sat_s="~lib/builtins/i16x8.add_sat_s",x.i16x8_add_sat_u="~lib/builtins/i16x8.add_sat_u",x.i16x8_sub_sat_s="~lib/builtins/i16x8.sub_sat_s",x.i16x8_sub_sat_u="~lib/builtins/i16x8.sub_sat_u",x.i16x8_shl="~lib/builtins/i16x8.shl",x.i16x8_shr_s="~lib/builtins/i16x8.shr_s",x.i16x8_shr_u="~lib/builtins/i16x8.shr_u",x.i16x8_all_true="~lib/builtins/i16x8.all_true",x.i16x8_bitmask="~lib/builtins/i16x8.bitmask",x.i16x8_eq="~lib/builtins/i16x8.eq",x.i16x8_ne="~lib/builtins/i16x8.ne",x.i16x8_lt_s="~lib/builtins/i16x8.lt_s",x.i16x8_lt_u="~lib/builtins/i16x8.lt_u",x.i16x8_le_s="~lib/builtins/i16x8.le_s",x.i16x8_le_u="~lib/builtins/i16x8.le_u",x.i16x8_gt_s="~lib/builtins/i16x8.gt_s",x.i16x8_gt_u="~lib/builtins/i16x8.gt_u",x.i16x8_ge_s="~lib/builtins/i16x8.ge_s",x.i16x8_ge_u="~lib/builtins/i16x8.ge_u",x.i16x8_narrow_i32x4_s="~lib/builtins/i16x8.narrow_i32x4_s",x.i16x8_narrow_i32x4_u="~lib/builtins/i16x8.narrow_i32x4_u",x.i16x8_extend_low_i8x16_s="~lib/builtins/i16x8.extend_low_i8x16_s",x.i16x8_extend_low_i8x16_u="~lib/builtins/i16x8.extend_low_i8x16_u",x.i16x8_extend_high_i8x16_s="~lib/builtins/i16x8.extend_high_i8x16_s",x.i16x8_extend_high_i8x16_u="~lib/builtins/i16x8.extend_high_i8x16_u",x.i16x8_extadd_pairwise_i8x16_s="~lib/builtins/i16x8.extadd_pairwise_i8x16_s",x.i16x8_extadd_pairwise_i8x16_u="~lib/builtins/i16x8.extadd_pairwise_i8x16_u",x.i16x8_q15mulr_sat_s="~lib/builtins/i16x8.q15mulr_sat_s",x.i16x8_extmul_low_i8x16_s="~lib/builtins/i16x8.extmul_low_i8x16_s",x.i16x8_extmul_low_i8x16_u="~lib/builtins/i16x8.extmul_low_i8x16_u",x.i16x8_extmul_high_i8x16_s="~lib/builtins/i16x8.extmul_high_i8x16_s",x.i16x8_extmul_high_i8x16_u="~lib/builtins/i16x8.extmul_high_i8x16_u",x.i16x8_shuffle="~lib/builtins/i16x8.shuffle",x.i32x4_splat="~lib/builtins/i32x4.splat",x.i32x4_extract_lane="~lib/builtins/i32x4.extract_lane",x.i32x4_replace_lane="~lib/builtins/i32x4.replace_lane",x.i32x4_add="~lib/builtins/i32x4.add",x.i32x4_sub="~lib/builtins/i32x4.sub",x.i32x4_mul="~lib/builtins/i32x4.mul",x.i32x4_min_s="~lib/builtins/i32x4.min_s",x.i32x4_min_u="~lib/builtins/i32x4.min_u",x.i32x4_max_s="~lib/builtins/i32x4.max_s",x.i32x4_max_u="~lib/builtins/i32x4.max_u",x.i32x4_dot_i16x8_s="~lib/builtins/i32x4.dot_i16x8_s",x.i32x4_abs="~lib/builtins/i32x4.abs",x.i32x4_neg="~lib/builtins/i32x4.neg",x.i32x4_shl="~lib/builtins/i32x4.shl",x.i32x4_shr_s="~lib/builtins/i32x4.shr_s",x.i32x4_shr_u="~lib/builtins/i32x4.shr_u",x.i32x4_all_true="~lib/builtins/i32x4.all_true",x.i32x4_bitmask="~lib/builtins/i32x4.bitmask",x.i32x4_eq="~lib/builtins/i32x4.eq",x.i32x4_ne="~lib/builtins/i32x4.ne",x.i32x4_lt_s="~lib/builtins/i32x4.lt_s",x.i32x4_lt_u="~lib/builtins/i32x4.lt_u",x.i32x4_le_s="~lib/builtins/i32x4.le_s",x.i32x4_le_u="~lib/builtins/i32x4.le_u",x.i32x4_gt_s="~lib/builtins/i32x4.gt_s",x.i32x4_gt_u="~lib/builtins/i32x4.gt_u",x.i32x4_ge_s="~lib/builtins/i32x4.ge_s",x.i32x4_ge_u="~lib/builtins/i32x4.ge_u",x.i32x4_trunc_sat_f32x4_s="~lib/builtins/i32x4.trunc_sat_f32x4_s",x.i32x4_trunc_sat_f32x4_u="~lib/builtins/i32x4.trunc_sat_f32x4_u",x.i32x4_trunc_sat_f64x2_s_zero="~lib/builtins/i32x4.trunc_sat_f64x2_s_zero",x.i32x4_trunc_sat_f64x2_u_zero="~lib/builtins/i32x4.trunc_sat_f64x2_u_zero",x.i32x4_extend_low_i16x8_s="~lib/builtins/i32x4.extend_low_i16x8_s",x.i32x4_extend_low_i16x8_u="~lib/builtins/i32x4.extend_low_i16x8_u",x.i32x4_extend_high_i16x8_s="~lib/builtins/i32x4.extend_high_i16x8_s",x.i32x4_extend_high_i16x8_u="~lib/builtins/i32x4.extend_high_i16x8_u",x.i32x4_extadd_pairwise_i16x8_s="~lib/builtins/i32x4.extadd_pairwise_i16x8_s",x.i32x4_extadd_pairwise_i16x8_u="~lib/builtins/i32x4.extadd_pairwise_i16x8_u",x.i32x4_extmul_low_i16x8_s="~lib/builtins/i32x4.extmul_low_i16x8_s",x.i32x4_extmul_low_i16x8_u="~lib/builtins/i32x4.extmul_low_i16x8_u",x.i32x4_extmul_high_i16x8_s="~lib/builtins/i32x4.extmul_high_i16x8_s",x.i32x4_extmul_high_i16x8_u="~lib/builtins/i32x4.extmul_high_i16x8_u",x.i32x4_shuffle="~lib/builtins/i32x4.shuffle",x.i64x2_splat="~lib/builtins/i64x2.splat",x.i64x2_extract_lane="~lib/builtins/i64x2.extract_lane",x.i64x2_replace_lane="~lib/builtins/i64x2.replace_lane",x.i64x2_add="~lib/builtins/i64x2.add",x.i64x2_sub="~lib/builtins/i64x2.sub",x.i64x2_mul="~lib/builtins/i64x2.mul",x.i64x2_abs="~lib/builtins/i64x2.abs",x.i64x2_neg="~lib/builtins/i64x2.neg",x.i64x2_shl="~lib/builtins/i64x2.shl",x.i64x2_shr_s="~lib/builtins/i64x2.shr_s",x.i64x2_shr_u="~lib/builtins/i64x2.shr_u",x.i64x2_all_true="~lib/builtins/i64x2.all_true",x.i64x2_bitmask="~lib/builtins/i64x2.bitmask",x.i64x2_eq="~lib/builtins/i64x2.eq",x.i64x2_ne="~lib/builtins/i64x2.ne",x.i64x2_lt_s="~lib/builtins/i64x2.lt_s",x.i64x2_lt_u="~lib/builtins/i64x2.lt_u",x.i64x2_le_s="~lib/builtins/i64x2.le_s",x.i64x2_le_u="~lib/builtins/i64x2.le_u",x.i64x2_gt_s="~lib/builtins/i64x2.gt_s",x.i64x2_gt_u="~lib/builtins/i64x2.gt_u",x.i64x2_ge_s="~lib/builtins/i64x2.ge_s",x.i64x2_ge_u="~lib/builtins/i64x2.ge_u",x.i64x2_extend_low_i32x4_s="~lib/builtins/i64x2.extend_low_i32x4_s",x.i64x2_extend_low_i32x4_u="~lib/builtins/i64x2.extend_low_i32x4_u",x.i64x2_extend_high_i32x4_s="~lib/builtins/i64x2.extend_high_i32x4_s",x.i64x2_extend_high_i32x4_u="~lib/builtins/i64x2.extend_high_i32x4_u",x.i64x2_extmul_low_i32x4_s="~lib/builtins/i64x2.extmul_low_i32x4_s",x.i64x2_extmul_low_i32x4_u="~lib/builtins/i64x2.extmul_low_i32x4_u",x.i64x2_extmul_high_i32x4_s="~lib/builtins/i64x2.extmul_high_i32x4_s",x.i64x2_extmul_high_i32x4_u="~lib/builtins/i64x2.extmul_high_i32x4_u",x.i64x2_shuffle="~lib/builtins/i64x2.shuffle",x.f32x4_splat="~lib/builtins/f32x4.splat",x.f32x4_extract_lane="~lib/builtins/f32x4.extract_lane",x.f32x4_replace_lane="~lib/builtins/f32x4.replace_lane",x.f32x4_add="~lib/builtins/f32x4.add",x.f32x4_sub="~lib/builtins/f32x4.sub",x.f32x4_mul="~lib/builtins/f32x4.mul",x.f32x4_div="~lib/builtins/f32x4.div",x.f32x4_neg="~lib/builtins/f32x4.neg",x.f32x4_min="~lib/builtins/f32x4.min",x.f32x4_max="~lib/builtins/f32x4.max",x.f32x4_pmin="~lib/builtins/f32x4.pmin",x.f32x4_pmax="~lib/builtins/f32x4.pmax",x.f32x4_abs="~lib/builtins/f32x4.abs",x.f32x4_sqrt="~lib/builtins/f32x4.sqrt",x.f32x4_ceil="~lib/builtins/f32x4.ceil",x.f32x4_floor="~lib/builtins/f32x4.floor",x.f32x4_trunc="~lib/builtins/f32x4.trunc",x.f32x4_nearest="~lib/builtins/f32x4.nearest",x.f32x4_eq="~lib/builtins/f32x4.eq",x.f32x4_ne="~lib/builtins/f32x4.ne",x.f32x4_lt="~lib/builtins/f32x4.lt",x.f32x4_le="~lib/builtins/f32x4.le",x.f32x4_gt="~lib/builtins/f32x4.gt",x.f32x4_ge="~lib/builtins/f32x4.ge",x.f32x4_convert_i32x4_s="~lib/builtins/f32x4.convert_i32x4_s",x.f32x4_convert_i32x4_u="~lib/builtins/f32x4.convert_i32x4_u",x.f32x4_demote_f64x2_zero="~lib/builtins/f32x4.demote_f64x2_zero",x.f32x4_shuffle="~lib/builtins/f32x4.shuffle",x.f64x2_splat="~lib/builtins/f64x2.splat",x.f64x2_extract_lane="~lib/builtins/f64x2.extract_lane",x.f64x2_replace_lane="~lib/builtins/f64x2.replace_lane",x.f64x2_add="~lib/builtins/f64x2.add",x.f64x2_sub="~lib/builtins/f64x2.sub",x.f64x2_mul="~lib/builtins/f64x2.mul",x.f64x2_div="~lib/builtins/f64x2.div",x.f64x2_neg="~lib/builtins/f64x2.neg",x.f64x2_min="~lib/builtins/f64x2.min",x.f64x2_max="~lib/builtins/f64x2.max",x.f64x2_pmin="~lib/builtins/f64x2.pmin",x.f64x2_pmax="~lib/builtins/f64x2.pmax",x.f64x2_abs="~lib/builtins/f64x2.abs",x.f64x2_sqrt="~lib/builtins/f64x2.sqrt",x.f64x2_ceil="~lib/builtins/f64x2.ceil",x.f64x2_floor="~lib/builtins/f64x2.floor",x.f64x2_trunc="~lib/builtins/f64x2.trunc",x.f64x2_nearest="~lib/builtins/f64x2.nearest",x.f64x2_eq="~lib/builtins/f64x2.eq",x.f64x2_ne="~lib/builtins/f64x2.ne",x.f64x2_lt="~lib/builtins/f64x2.lt",x.f64x2_le="~lib/builtins/f64x2.le",x.f64x2_gt="~lib/builtins/f64x2.gt",x.f64x2_ge="~lib/builtins/f64x2.ge",x.f64x2_convert_low_i32x4_s="~lib/builtins/f64x2.convert_low_i32x4_s",x.f64x2_convert_low_i32x4_u="~lib/builtins/f64x2.convert_low_i32x4_u",x.f64x2_promote_low_f32x4="~lib/builtins/f64x2.promote_low_f32x4",x.f64x2_shuffle="~lib/builtins/f64x2.shuffle",x.i8x16_relaxed_swizzle="~lib/builtins/i8x16.relaxed_swizzle",x.i32x4_relaxed_trunc_f32x4_s="~lib/builtins/i32x4.relaxed_trunc_f32x4_s",x.i32x4_relaxed_trunc_f32x4_u="~lib/builtins/i32x4.relaxed_trunc_f32x4_u",x.i32x4_relaxed_trunc_f64x2_s_zero="~lib/builtins/i32x4.relaxed_trunc_f64x2_s_zero",x.i32x4_relaxed_trunc_f64x2_u_zero="~lib/builtins/i32x4.relaxed_trunc_f64x2_u_zero",x.f32x4_relaxed_madd="~lib/builtins/f32x4.relaxed_madd",x.f32x4_relaxed_nmadd="~lib/builtins/f32x4.relaxed_nmadd",x.f64x2_relaxed_madd="~lib/builtins/f64x2.relaxed_madd",x.f64x2_relaxed_nmadd="~lib/builtins/f64x2.relaxed_nmadd",x.i8x16_relaxed_laneselect="~lib/builtins/i8x16.relaxed_laneselect",x.i16x8_relaxed_laneselect="~lib/builtins/i16x8.relaxed_laneselect",x.i32x4_relaxed_laneselect="~lib/builtins/i32x4.relaxed_laneselect",x.i64x2_relaxed_laneselect="~lib/builtins/i64x2.relaxed_laneselect",x.f32x4_relaxed_min="~lib/builtins/f32x4.relaxed_min",x.f32x4_relaxed_max="~lib/builtins/f32x4.relaxed_max",x.f64x2_relaxed_min="~lib/builtins/f64x2.relaxed_min",x.f64x2_relaxed_max="~lib/builtins/f64x2.relaxed_max",x.i16x8_relaxed_q15mulr_s="~lib/builtins/i16x8.relaxed_q15mulr_s",x.i16x8_relaxed_dot_i8x16_i7x16_s="~lib/builtins/i16x8.relaxed_dot_i8x16_i7x16_s",x.i32x4_relaxed_dot_i8x16_i7x16_add_s="~lib/builtins/i32x4.relaxed_dot_i8x16_i7x16_add_s",x.i31_new="~lib/builtins/i31.new",x.i31_get="~lib/builtins/i31.get",x.data_end="~lib/memory/__data_end",x.stack_pointer="~lib/memory/__stack_pointer",x.heap_base="~lib/memory/__heap_base",x.rtti_base="~lib/rt/__rtti_base",x.visit_globals="~lib/rt/__visit_globals",x.visit_members="~lib/rt/__visit_members",x.tostack="~lib/rt/__tostack",x.NaN="~lib/number/NaN",x.Infinity="~lib/number/Infinity",x.isNaN="~lib/number/isNaN",x.isFinite="~lib/number/isFinite",x.ERROR="~lib/diagnostics/ERROR",x.WARNING="~lib/diagnostics/WARNING",x.INFO="~lib/diagnostics/INFO",x.Function="~lib/function/Function",x.Function_call="~lib/function/Function#call",x.memory_size="~lib/memory/memory.size",x.memory_grow="~lib/memory/memory.grow",x.memory_copy="~lib/memory/memory.copy",x.memory_fill="~lib/memory/memory.fill",x.memory_data="~lib/memory/memory.data",x.Int8Array="~lib/typedarray/Int8Array",x.Uint8Array="~lib/typedarray/Uint8Array",x.Uint8ClampedArray="~lib/typedarray/Uint8ClampedArray",x.Int16Array="~lib/typedarray/Int16Array",x.Uint16Array="~lib/typedarray/Uint16Array",x.Int32Array="~lib/typedarray/Int32Array",x.Uint32Array="~lib/typedarray/Uint32Array",x.Int64Array="~lib/typedarray/Int64Array",x.Uint64Array="~lib/typedarray/Uint64Array",x.Float32Array="~lib/typedarray/Float32Array",x.Float64Array="~lib/typedarray/Float64Array",x.String_raw="~lib/string/String.raw",x.String_eq="~lib/string/String.__eq",x.String_ne="~lib/string/String.__ne",x.String_not="~lib/string/String.__not",x.Object="~lib/object/Object"))(g||={});var Yo=class{constructor(r,e,t,i,s){this.resolver=r;this.node=e;this.ctxElement=t;this.ctxTypes=i;this.reportMode=s}},Ws=class{constructor(r,e,t=e.type,i=e.identifierNode){this.compiler=r;this.element=e;this.contextualType=t;this.reportNode=i}},iu=class{constructor(r,e,t,i,s,a,l,o){this.compiler=r;this.prototype=e;this.typeArguments=t;this.operands=i;this.thisOperand=s;this.contextualType=a;this.reportNode=l;this.contextIsExact=o}},tr=new Map,E=new Map,sr=new Map,At=new Map;function Y1(n){let r=n.resolver,e=n.node,t=n.ctxElement,i=n.ctxTypes,s=n.reportMode,a=r.ensureOneTypeArgument(e,s);if(!a)return null;let l=r.resolveType(a,null,t,i,s);if(!l)return null;switch(l.kind){case 1:case 2:case 3:return p.i32;case 5:if(!r.program.options.isWasm64)return p.i32;case 4:return p.i64;case 6:case 7:case 8:case 0:return p.u32;case 10:if(!r.program.options.isWasm64)return p.u32;case 9:return p.u64;case 11:return p.f32;case 12:return p.f64;case 13:return p.v128;case 26:return p.void;default:assert(!1)}return null}tr.set(L.native,Y1);function J1(n){let r=n.resolver,e=n.node,t=n.ctxElement,i=n.ctxTypes,s=n.reportMode,a=r.ensureOneTypeArgument(e,s);if(!a)return null;let l=r.resolveType(a,null,t,i,s);if(!l)return null;let o=l.classReference;if(!o)return s==0&&r.error(2329,a.range,l.toString()),null;let u=o.lookupOverload(1);if(u){let c=u.signature.parameterTypes;return u.is(32)?(assert(c.length==2),c[1]):(assert(c.length==1),c[0])}return s==0&&r.error(2329,a.range,l.toString()),null}tr.set(L.indexof,J1);function eA(n){let r=n.resolver,e=n.node,t=n.ctxElement,i=n.ctxTypes,s=n.reportMode,a=r.ensureOneTypeArgument(e,s);if(!a)return null;let l=r.resolveType(a,null,t,i,s);if(!l)return null;let o=l.getClassOrWrapper(r.program);if(o){let u=o.lookupOverload(1);if(u)return u.signature.returnType}return s==0&&r.error(2329,a.range,l.toString()),null}tr.set(L.valueof,eA);function tA(n){let r=n.resolver,e=n.node,t=n.ctxElement,i=n.ctxTypes,s=n.reportMode,a=r.ensureOneTypeArgument(e,s);if(!a)return null;let l=r.resolveType(a,null,t,i,s);if(!l)return null;let o=l.getSignature();return o?o.returnType:(s==0&&r.error(2757,a.range,l.toString()),null)}tr.set(L.returnof,tA);function rA(n){let r=n.resolver,e=n.node,t=n.ctxElement,i=n.ctxTypes,s=n.reportMode,a=r.ensureOneTypeArgument(e,s);if(!a)return null;let l=r.resolveType(a,null,t,i,s);if(!l)return null;let o=l.getSignature();if(o){let u=o.thisType;return u||p.any}return s==0&&r.error(2757,a.range,l.toString()),null}tr.set(L.thisof,rA);function nA(n){let r=n.resolver,e=n.node,t=n.ctxElement,i=n.ctxTypes,s=n.reportMode,a=r.ensureOneTypeArgument(e,s);if(!a)return null;let l=r.resolveType(a,null,t,i,s);return l?l.isNullableReference?l.nonNullableType:l:null}tr.set(L.nonnull,nA);var oi=0;function iA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isBooleanValue?1:0)):e.unreachable()}E.set(g.isBoolean,iA);function sA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isIntegerValue?1:0)):e.unreachable()}E.set(g.isInteger,sA);function aA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isSignedIntegerValue?1:0)):e.unreachable()}E.set(g.isSigned,aA);function lA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isFloatValue?1:0)):e.unreachable()}E.set(g.isFloat,lA);function oA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isVectorValue?1:0)):e.unreachable()}E.set(g.isVector,oA);function uA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isReference?1:0)):e.unreachable()}E.set(g.isReference,uA);function cA(n){let r=n.compiler,e=r.module,t=Ve(n);if(r.currentType=p.bool,!t)return e.unreachable();let i=t.getClass();return ke(n,e.i32(i&&i.isAssignableTo(r.program.stringInstance)?1:0))}E.set(g.isString,cA);function pA(n){let r=n.compiler,e=r.module,t=Ve(n);if(r.currentType=p.bool,!t)return e.unreachable();let i=t.getClass();return ke(n,e.i32(i&&i.extendsPrototype(r.program.arrayPrototype)?1:0))}E.set(g.isArray,pA);function fA(n){let r=n.compiler,e=r.module,t=Ve(n);if(r.currentType=p.bool,!t)return e.unreachable();let i=t.getClass();return ke(n,e.i32(i&&i.isArrayLike?1:0))}E.set(g.isArrayLike,fA);function _A(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isFunction?1:0)):e.unreachable()}E.set(g.isFunction,_A);function dA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isNullableReference?1:0)):e.unreachable()}E.set(g.isNullable,dA);function hA(n){let r=n.compiler,e=r.module;if(r.currentType=p.bool,F(n)|K(n,1))return e.unreachable();let t=r.resolver.lookupExpression(n.operands[0],r.currentFlow,p.auto,1);return e.i32(t?1:0)}E.set(g.isDefined,hA);function mA(n){let r=n.compiler,e=r.module;if(r.currentType=p.bool,F(n)|K(n,1))return e.unreachable();let t=r.compileExpression(n.operands[0],p.auto);return r.currentType=p.bool,Wo(t,e.ref)?e.block(null,[e.maybeDrop(t),e.i32(0)],fe(t)):e.i32(e.isConstExpression(t)?1:0)}E.set(g.isConstant,mA);function yA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.isManaged?1:0)):e.unreachable()}E.set(g.isManaged,yA);function gA(n){let r=n.compiler,e=r.module,t=Ve(n);return r.currentType=p.bool,t?ke(n,e.i32(t.kind==26?1:0)):e.unreachable()}E.set(g.isVoid,gA);function bA(n){let r=n.compiler,e=r.module,t=Ve(n);if(r.currentType=p.i32,!t)return e.unreachable();let i=t.signatureReference;return i?ke(n,e.i32(i.parameterTypes.length)):(r.error(2757,n.reportNode.range,t.toString()),e.unreachable())}E.set(g.lengthof,bA);function xA(n){let r=n.compiler,e=r.module;if(r.currentType=r.options.usizeType,Z(n)|K(n,0))return e.unreachable();let t=n.typeArguments[0];if(t.kind==27)return r.error(100,n.reportNode.typeArgumentsRange,"sizeof of an unmanaged array ([T *]) \u2014 it is a pointer with no length, so it has no extent; use sizeof<T>() for the element and carry the count separately"),e.unreachable();if(t.kind==28)return r.error(100,n.reportNode.typeArgumentsRange,"sizeof of a dynamic array view is the pointer size (4), not the data size; use `.length * sizeof<T>` for the element count"),e.unreachable();{let a=t.classReference;if(a!=null&&a.prototype.internalName==r.resolver.program.dynamicArrayPrototype.internalName)return r.error(100,n.reportNode.typeArgumentsRange,"sizeof of a dynamic array view is the pointer size (4), not the data size; use `.length * sizeof<T>` for the element count"),e.unreachable()}let i=t.byteSize;if(!i)return r.error(203,n.reportNode.typeArgumentsRange,"sizeof",t.toString()),e.unreachable();let s=t.classReference;return s!=null&&(s.hasDecorator(16)||s.hasDecorator(2048))?nn(r,i64_new(s.nextMemoryOffset),n.contextualType):nn(r,i64_new(i),n.contextualType)}E.set(g.sizeof,xA);function EA(n){let r=n.compiler,e=r.module;if(r.currentType=r.options.usizeType,Z(n)|K(n,0))return e.unreachable();let t=n.typeArguments[0],i=t.byteSize;if(!i||t.kind!=14&&!Hr(i))return r.error(203,n.reportNode.typeArgumentsRange,"alignof",t.toString()),e.unreachable();let s=t.classReference;return s!=null&&(s.hasDecorator(16)||s.hasDecorator(2048))?nn(r,i64_new(s.alignLog2),n.contextualType):nn(r,i64_new(t.alignLog2),n.contextualType)}E.set(g.alignof,EA);function AA(n){let r=n.compiler,e=r.module;if(r.currentType=r.options.usizeType,Z(n)|Le(n,0,1))return e.unreachable();let t=n.operands,i=n.contextualType,s=n.typeArguments[0];if(s.kind==14)return n.operands.length?(r.error(203,n.reportNode.range,"offsetof",s.toString()),e.unreachable()):nn(r,i64_new(s.byteSize),n.contextualType);let a=s.getClassOrWrapper(r.program);if(!a)return r.error(203,n.reportNode.typeArgumentsRange,"offsetof",s.toString()),r.options.isWasm64?i.isIntegerValue&&i.size<=32&&(r.currentType=p.u32):i.isIntegerValue&&i.size==64&&(r.currentType=p.u64),e.unreachable();if(t.length){let l=t[0];if(!l.isLiteralKind(2))return r.error(1141,t[0].range),e.unreachable();let o=l.value,u=a.getMember(o);if(u&&u.kind==10){let c=u.instance;if(c&&c.isField)return assert(c.memoryOffset>=0),nn(r,i64_new(c.memoryOffset),i)}return r.error(2460,l.range,a.internalName,o),e.unreachable()}return nn(r,i64_new(a.nextMemoryOffset),i)}E.set(g.offsetof,AA);function TA(n){let r=n.compiler,e=r.module;if(r.currentType=r.program.stringInstance.type,Z(n)|K(n,1))return e.unreachable();let t=n.typeArguments[0],i=t.getClassOrWrapper(r.program);if(!i)return r.error(203,n.reportNode.typeArgumentsRange,"abiNameOf",t.toString()),e.unreachable();let s=n.operands[0];if(!s.isLiteralKind(2))return r.error(1141,s.range),e.unreachable();let a=s.value,l=i.getMember(a);if(!l||l.kind!=10)return r.error(2460,s.range,i.internalName,a),e.unreachable();let o=l.fieldDeclaration,u=o?o.type:null,c=u?u.attributes:null;if(c)for(let f=0,_=c.length;f<_;++f){if(!SA(c[f]))continue;let d=c[f].args,m=d&&d.length?d[0]:null;if(m&&m.isLiteralKind(2))return ke(n,r.ensureStaticString(m.value));break}return ke(n,r.ensureStaticString(a))}E.set(g.abiNameOf,TA);function SA(n){let r=n.name;if(r.kind!=23)return!1;let e=r,t=e.expression;return t.kind!=8?!1:t.text=="abi"&&e.property.text=="alias"}function vA(n){let r=n.compiler,e=r.module,t=Ve(n);if(!t)return r.currentType=r.program.stringInstance.type,e.unreachable();let i;if(t.isInternalReference){let s=t.getClass();s?i=s.name:(assert(t.getSignature()),i="Function")}else i=t.toString();return ke(n,r.ensureStaticString(i))}E.set(g.nameof,vA);function IA(n){let r=n.compiler,e=r.module,t=Ve(n);if(r.currentType=p.u32,!t)return e.unreachable();let i=t.getSignature();if(i)return ke(n,e.i32(i.id));let s=t.getClassOrWrapper(r.program);return s&&!s.hasDecorator(16)?ke(n,e.i32(s.id)):(r.error(203,n.reportNode.typeArgumentsRange,"idof",t.toString()),e.unreachable())}E.set(g.idof,IA);function kA(n){let r=n.element;if(r.is(1048576)){let e=n.compiler.module;e.addGlobal(r.internalName,P.F64,!1,e.f64(NaN))}}sr.set(g.NaN,kA);function FA(n){let r=n.compiler,e=r.module;return n.contextualType==p.f32?(r.currentType=p.f32,e.f32(NaN)):(r.currentType=p.f64,e.f64(NaN))}At.set(g.NaN,FA);function wA(n){let r=n.element;if(r.is(1048576)){let e=n.compiler.module;e.addGlobal(r.internalName,P.F64,!1,e.f64(1/0))}}sr.set(g.Infinity,wA);function RA(n){let r=n.compiler,e=r.module;return n.contextualType==p.f32?(r.currentType=p.f32,e.f32(1/0)):(r.currentType=p.f64,e.f64(1/0))}At.set(g.Infinity,RA);function Pf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.typeArguments,i=t?r.compileExpression(n.operands[0],t[0],5):r.compileExpression(n.operands[0],p.i32,4),s=r.currentType;if(s.isValue)switch(s.kind){case 0:case 1:case 6:case 2:case 7:case 3:case 8:return e.unary(0,i);case 5:case 10:return e.unary(142,i);case 4:case 9:return e.unary(1,i)}return r.error(203,n.reportNode.typeArgumentsRange,"clz",s.toString()),e.unreachable()}E.set(g.clz,Pf);function Nf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],5):r.compileExpression(t[0],p.i32,4),a=r.currentType;if(a.isValue)switch(a.kind){case 0:case 1:case 6:case 2:case 7:case 3:case 8:return e.unary(2,s);case 5:case 10:return e.unary(143,s);case 4:case 9:return e.unary(3,s)}return r.error(203,n.reportNode.typeArgumentsRange,"ctz",a.toString()),e.unreachable()}E.set(g.ctz,Nf);function Lf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],5):r.compileExpression(t[0],p.i32,4),a=r.currentType;if(a.isValue)switch(r.currentType.kind){case 0:return s;case 1:case 6:case 2:case 7:case 3:case 8:return e.unary(4,s);case 4:case 9:return e.unary(5,s);case 5:case 10:return e.unary(144,s)}return r.error(203,n.reportNode.typeArgumentsRange,"popcnt",a.toString()),e.unreachable()}E.set(g.popcnt,Lf);function Bf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],5):r.compileExpression(t[0],p.i32,4),a=r.currentType;if(a.isValue){let l=r.compileExpression(t[1],a,1);switch(a.kind){case 0:return s;case 1:case 2:case 6:case 7:{let o=r.currentFlow,u=o.getTempLocal(a);o.setLocalFlag(u.index,2);let c=o.getTempLocal(a);return o.setLocalFlag(c.index,2),e.binary(8,e.binary(10,e.local_tee(u.index,s,!1),e.binary(7,e.local_tee(c.index,l,!1),e.i32(a.size-1))),e.binary(12,e.local_get(u.index,P.I32),e.binary(7,e.binary(1,e.i32(0),e.local_get(c.index,P.I32)),e.i32(a.size-1))))}case 3:case 8:return e.binary(13,s,l);case 4:case 9:return e.binary(38,s,l);case 5:case 10:return e.binary(230,s,l)}}return r.error(203,n.reportNode.typeArgumentsRange,"rotl",a.toString()),e.unreachable()}E.set(g.rotl,Bf);function Mf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],5):r.compileExpression(t[0],p.i32,4),a=r.currentType;if(a.isValue){let l=r.compileExpression(t[1],a,1);switch(a.kind){case 0:return s;case 1:case 2:case 6:case 7:{let o=r.currentFlow,u=o.getTempLocal(a);o.setLocalFlag(u.index,2);let c=o.getTempLocal(a);return o.setLocalFlag(c.index,2),e.binary(8,e.binary(12,e.local_tee(u.index,s,!1),e.binary(7,e.local_tee(c.index,l,!1),e.i32(a.size-1))),e.binary(10,e.local_get(u.index,P.I32),e.binary(7,e.binary(1,e.i32(0),e.local_get(c.index,P.I32)),e.i32(a.size-1))))}case 3:case 8:return e.binary(14,s,l);case 4:case 9:return e.binary(39,s,l);case 5:case 10:return e.binary(231,s,l)}}return r.error(203,n.reportNode.typeArgumentsRange,"rotr",a.toString()),e.unreachable()}E.set(g.rotr,Mf);function zf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],5):r.compileExpression(t[0],p.auto,4),a=r.currentType;if(a.isValue)switch(a.kind){case 0:case 6:case 7:case 8:case 9:case 10:return s;case 1:case 2:case 3:{let l=r.currentFlow,o=l.getTempLocal(p.i32),u=l.getTempLocal(p.i32);return e.binary(9,e.binary(0,e.local_tee(u.index,e.binary(11,e.local_tee(o.index,s,!1),e.i32(31)),!1),e.local_get(o.index,P.I32)),e.local_get(u.index,P.I32))}case 5:{let l=r.options,o=r.currentFlow,u=o.getTempLocal(l.usizeType),c=o.getTempLocal(l.usizeType);return e.binary(226,e.binary(217,e.local_tee(c.index,e.binary(228,e.local_tee(u.index,s,!1),r.options.isWasm64?e.i64(63):e.i32(31)),!1),e.local_get(u.index,l.sizeTypeRef)),e.local_get(c.index,l.sizeTypeRef))}case 4:{let l=r.currentFlow,o=l.getTempLocal(p.i64),u=l.getTempLocal(p.i64);return e.binary(34,e.binary(25,e.local_tee(u.index,e.binary(36,e.local_tee(o.index,s,!1),e.i64(63)),!1),e.local_get(o.index,P.I64)),e.local_get(u.index,P.I64))}case 11:return e.unary(8,s);case 12:return e.unary(9,s)}return r.error(203,n.reportNode.typeArgumentsRange,"abs",a.toString()),e.unreachable()}E.set(g.abs,zf);function Df(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],5):r.compileExpression(t[0],p.auto,4),l=r.currentType;if(l.isValue){let o;!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l,4),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,5))):o=r.compileExpression(t[1],l,5);let u=-1;switch(l.kind){case 1:case 2:case 3:{u=21;break}case 0:case 6:case 7:case 8:{u=22;break}case 4:{u=46;break}case 9:{u=47;break}case 5:{u=238;break}case 10:{u=239;break}case 11:return e.binary(56,a,o);case 12:return e.binary(69,a,o)}if(u!=-1){let c=r.currentFlow,f=l.toRef(),_=c.getTempLocal(l);c.setLocalFlag(_.index,2);let d=c.getTempLocal(l);return c.setLocalFlag(d.index,2),e.select(e.local_tee(_.index,a,!1),e.local_tee(d.index,o,!1),e.binary(u,e.local_get(_.index,f),e.local_get(d.index,f)))}}return r.error(203,n.reportNode.typeArgumentsRange,"max",l.toString()),e.unreachable()}E.set(g.max,Df);function Gf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],5):r.compileExpression(t[0],p.auto,4),l=r.currentType;if(l.isValue){let o;!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l,4),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,5))):o=r.compileExpression(t[1],l,5);let u=-1;switch(l.kind){case 1:case 2:case 3:{u=17;break}case 0:case 6:case 7:case 8:{u=18;break}case 4:{u=42;break}case 9:{u=43;break}case 5:{u=234;break}case 10:{u=235;break}case 11:return e.binary(55,a,o);case 12:return e.binary(68,a,o)}if(u!=-1){let c=r.currentFlow,f=l.toRef(),_=c.getTempLocal(l);c.setLocalFlag(_.index,2);let d=c.getTempLocal(l);return c.setLocalFlag(d.index,2),e.select(e.local_tee(_.index,a,!1),e.local_tee(d.index,o,!1),e.binary(u,e.local_get(_.index,f),e.local_get(d.index,f)))}}return r.error(203,n.reportNode.typeArgumentsRange,"min",l.toString()),e.unreachable()}E.set(g.min,Gf);function Uf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.auto,0),a=r.currentType;if(a.isValue)switch(a.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return s;case 11:return e.unary(10,s);case 12:return e.unary(11,s)}return r.error(203,n.reportNode.typeArgumentsRange,"ceil",a.toString()),e.unreachable()}E.set(g.ceil,Uf);function Vf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.auto,0),a=r.currentType;if(a.isValue)switch(a.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return s;case 11:return e.unary(12,s);case 12:return e.unary(13,s)}return r.error(203,n.reportNode.typeArgumentsRange,"floor",a.toString()),e.unreachable()}E.set(g.floor,Vf);function Of(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.f64,0),a=r.currentType;if(a.isValue){let l=r.compileExpression(t[1],a,1);switch(a.kind){case 11:return e.binary(54,s,l);case 12:return e.binary(67,s,l)}}return r.error(203,n.reportNode.typeArgumentsRange,"copysign",a.toString()),e.unreachable()}E.set(g.copysign,Of);function qf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.auto,0),a=r.currentType;if(a.isValue)switch(a.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return s;case 11:return e.unary(16,s);case 12:return e.unary(17,s)}return r.error(203,n.reportNode.typeArgumentsRange,"nearest",a.toString()),e.unreachable()}E.set(g.nearest,qf);function Ks(n){let r=n.compiler,e=r.module;if(Z(n,!0)|K(n,1))return e.unreachable();let t=n.operands,s=n.typeArguments[0];if(s.isValue)switch(s.kind){case 3:case 8:{let a=r.compileExpression(t[0],p.f32,1);return r.currentType=s,e.unary(33,a)}case 4:case 9:{let a=r.compileExpression(t[0],p.f64,1);return r.currentType=s,e.unary(34,a)}case 5:case 10:{let a=r.options.isWasm64,l=r.compileExpression(t[0],a?p.f64:p.f32,1);return r.currentType=s,e.unary(a?34:33,l)}case 11:{let a=r.compileExpression(t[0],p.i32,1);return r.currentType=p.f32,e.unary(45,a)}case 12:{let a=r.compileExpression(t[0],p.i64,1);return r.currentType=p.f64,e.unary(46,a)}}return r.error(203,n.reportNode.typeArgumentsRange,"reinterpret",s.toString()),e.unreachable()}E.set(g.reinterpret,Ks);function Wf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.f64,0),a=r.currentType;if(a.isValue)switch(a.kind){case 11:return e.unary(18,s);case 12:return e.unary(19,s)}return r.error(203,n.reportNode.typeArgumentsRange,"sqrt",a.toString()),e.unreachable()}E.set(g.sqrt,Wf);function Kf(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,1))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.auto,0),a=r.currentType;if(a.isValue)switch(a.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return s;case 11:return e.unary(14,s);case 12:return e.unary(15,s)}return r.error(203,n.reportNode.typeArgumentsRange,"trunc",a.toString()),e.unreachable()}E.set(g.trunc,Kf);function CA(n){let r=n.compiler,e=r.module;if(de(n)|K(n,1))return r.currentType=p.bool,e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.auto),a=r.currentType;if(r.currentType=p.bool,a.isValue)switch(a.kind){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return e.maybeDropCondition(s,e.i32(0));case 11:{if(re(s)==8)return e.binary(58,s,e.local_get(Pt(s),P.F32));let o=r.currentFlow.getTempLocal(p.f32);return e.binary(58,e.local_tee(o.index,s,!1),e.local_get(o.index,P.F32))}case 12:{if(re(s)==8)return e.binary(71,s,e.local_get(Pt(s),P.F64));let o=r.currentFlow.getTempLocal(p.f64);return e.binary(71,e.local_tee(o.index,s,!1),e.local_get(o.index,P.F64))}}return r.error(203,n.reportNode.typeArgumentsRange,"isNaN",a.toString()),e.unreachable()}E.set(g.isNaN,CA);function PA(n){let r=n.compiler,e=r.module;if(de(n)|K(n,1))return r.currentType=p.bool,e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.auto),a=r.currentType;if(r.currentType=p.bool,a.isValue)switch(a.kind){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:return e.maybeDropCondition(s,e.i32(1));case 11:{if(re(s)==8)return e.binary(57,e.binary(51,s,e.local_get(Pt(s),P.F32)),e.f32(0));let o=r.currentFlow.getTempLocal(p.f32);return e.binary(57,e.binary(51,e.local_tee(o.index,s,!1),e.local_get(o.index,P.F32)),e.f32(0))}case 12:{if(re(s)==8)return e.binary(70,e.binary(64,s,e.local_get(Pt(s),P.F64)),e.f64(0));let o=r.currentFlow.getTempLocal(p.f64);return e.binary(70,e.binary(64,e.local_tee(o.index,s,!1),e.local_get(o.index,P.F64)),e.f64(0))}}return r.error(203,n.reportNode.typeArgumentsRange,"isFinite",a.toString()),e.unreachable()}E.set(g.isFinite,PA);function NA(n){let r=n.compiler,e=r.module,t=n.element,i=t.type;r.runtimeFeatures|=4,e.addGlobal(t.internalName,i.toRef(),!0,r.makeZero(i))}sr.set(g.heap_base,NA);function LA(n){let r=n.compiler,e=r.module,t=n.element,i=t.type;return r.runtimeFeatures|=4,r.currentType=i,e.global_get(t.internalName,i.toRef())}At.set(g.heap_base,LA);function BA(n){let r=n.compiler,e=r.module,t=n.element,i=t.type;r.runtimeFeatures|=1,e.addGlobal(t.internalName,i.toRef(),!0,r.makeZero(i))}sr.set(g.data_end,BA);function MA(n){let r=n.compiler,e=r.module,t=n.element,i=t.type;return r.runtimeFeatures|=1,r.currentType=i,e.global_get(t.internalName,i.toRef())}At.set(g.data_end,MA);function zA(n){let r=n.compiler,e=r.module,t=n.element,i=t.type;r.runtimeFeatures|=2,e.addGlobal(t.internalName,i.toRef(),!0,r.makeZero(i))}sr.set(g.stack_pointer,zA);function DA(n){let r=n.compiler,e=r.module,t=n.element,i=t.type;return r.runtimeFeatures|=2,r.currentType=i,e.global_get(t.internalName,i.toRef())}At.set(g.stack_pointer,DA);function GA(n){let r=n.compiler,e=r.module,t=n.element,i=t.type;r.runtimeFeatures|=8,e.addGlobal(t.internalName,i.toRef(),!0,r.makeZero(i))}sr.set(g.rtti_base,GA);function UA(n){let r=n.compiler,e=r.module,t=n.element,i=t.type;return r.runtimeFeatures|=8,r.currentType=i,e.global_get(t.internalName,i.toRef())}At.set(g.rtti_base,UA);function Ue(n){let r=n.compiler,e=r.module;if(Z(n,!0)|Le(n,1,3))return e.unreachable();let t=n.operands,i=n.typeArguments,s=n.contextualType,a=i[0],l=s!=p.auto&&a.isIntegerValue&&s.isIntegerValue&&s.size>a.size?s:a;if(!l.isMemory)return r.error(203,n.reportNode.typeArgumentsRange,"load",l.toString()),r.currentType=p.void,e.unreachable();let o=r.compileExpression(t[0],r.options.usizeType,1),u=t.length,c=0,f=a.byteSize;return u>=2&&(c=_t(t[1],r),c<0||u==3&&(f=ir(t[2],f,r),f<0))?(r.currentType=l,e.unreachable()):(r.currentType=l,e.load(a.byteSize,a.isSignedIntegerValue,o,l.toRef(),c,f))}E.set(g.load,Ue);function Tt(n){let r=n.compiler,e=r.module;if(r.currentType=p.void,Z(n)|Le(n,2,4))return e.unreachable();let t=n.operands,i=t.length,s=n.typeArguments,a=n.contextualType,l=s[0],o=r.compileExpression(t[0],r.options.usizeType,1),u=n.contextIsExact?r.compileExpression(t[1],a,1):r.compileExpression(t[1],l,l.isIntegerValue?0:1),c=r.currentType;if(!c.isMemory)return r.error(203,n.reportNode.typeArgumentsRange,"store",c.toString()),r.currentType=p.void,e.unreachable();l.isIntegerValue&&(!c.isIntegerValue||c.size<l.size)&&(u=r.convertExpression(u,c,l,!1,t[1]),c=l);let f=0,_=l.byteSize;if(i>=3){if(f=_t(t[2],r),f<0)return r.currentType=p.void,e.unreachable();if(i==4&&(_=ir(t[3],_,r),_<0))return r.currentType=p.void,e.unreachable()}return r.currentType=p.void,e.store(l.byteSize,o,u,c.toRef(),f,_)}E.set(g.store,Tt);function Hs(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],1):r.compileExpression(t[0],p.auto),l=r.currentType;if(l.isIntegerValue){let o;if(!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,1))):o=r.compileExpression(t[1],l,1),l.isIntegerValue)return r.makeRem(a,o,l,n.reportNode)}return r.error(203,n.reportNode.typeArgumentsRange,"rem",l.toString()),e.unreachable()}E.set(g.rem,Hs);function js(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],1):r.compileExpression(t[0],p.auto),l=r.currentType;if(l.isValue){let o;if(!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,1))):o=r.compileExpression(t[1],l,1),l.isNumericValue)return r.makeAdd(a,o,l)}return r.error(203,n.reportNode.typeArgumentsRange,"add",l.toString()),e.unreachable()}E.set(g.add,js);function Qs(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],1):r.compileExpression(t[0],p.auto),l=r.currentType;if(l.isValue){let o;if(!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,1))):o=r.compileExpression(t[1],l,1),l.isNumericValue)return r.makeSub(a,o,l)}return r.error(203,n.reportNode.typeArgumentsRange,"sub",l.toString()),e.unreachable()}E.set(g.sub,Qs);function Xs(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],1):r.compileExpression(t[0],p.auto),l=r.currentType;if(l.isValue){let o;if(!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,1))):o=r.compileExpression(t[1],l,1),l.isNumericValue)return r.makeMul(a,o,l)}return r.error(203,n.reportNode.typeArgumentsRange,"mul",l.toString()),e.unreachable()}E.set(g.mul,Xs);function sn(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],1):r.compileExpression(t[0],p.auto),l=r.currentType;if(l.isValue){let o;if(!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,1))):o=r.compileExpression(t[1],l,1),l.isNumericValue)return r.makeDiv(a,o,l)}return r.error(203,n.reportNode.typeArgumentsRange,"div",l.toString()),e.unreachable()}E.set(g.div,sn);function Zs(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],1):r.compileExpression(t[0],p.auto),l=r.currentType;if(l.isValue){let o;if(!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,1))):o=r.compileExpression(t[1],l,1),l.isNumericValue)return r.currentType=p.i32,r.makeEq(a,o,l,n.reportNode)}return r.error(203,n.reportNode.typeArgumentsRange,"eq",l.toString()),e.unreachable()}E.set(g.eq,Zs);function $s(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=t[0],a=i?r.compileExpression(s,i[0],1):r.compileExpression(t[0],p.auto),l=r.currentType;if(l.isValue){let o;if(!i&&s.isNumericLiteral?(o=r.compileExpression(t[1],l),r.currentType!=l&&(a=r.compileExpression(s,l=r.currentType,1))):o=r.compileExpression(t[1],l,1),l.isNumericValue)return r.currentType=p.i32,r.makeNe(a,o,l,n.reportNode)}return r.error(203,n.reportNode.typeArgumentsRange,"ne",l.toString()),e.unreachable()}E.set(g.ne,$s);function Sr(n){let r=n.compiler,e=r.module;if(X(n,32)|Z(n,!0)|Le(n,1,2))return e.unreachable();let t=n.operands,i=n.typeArguments,s=n.contextualType,a=i[0],l=a.isIntegerValue&&s.isIntegerValue&&s.size>a.size?s:a;if(!a.isIntegerValue)return r.error(203,n.reportNode.typeArgumentsRange,"atomic.load",a.toString()),r.currentType=l,e.unreachable();let o=r.compileExpression(t[0],r.options.usizeType,1),u=t.length==2?_t(t[1],r):0;return u<0?(r.currentType=l,e.unreachable()):(r.currentType=l,e.atomic_load(a.byteSize,o,l.toRef(),u))}E.set(g.atomic_load,Sr);function vr(n){let r=n.compiler,e=r.module;if(X(n,32)|Z(n)|Le(n,2,3))return e.unreachable();let t=n.operands,i=n.typeArguments,s=n.contextualType,a=i[0];if(!a.isIntegerValue)return r.error(203,n.reportNode.typeArgumentsRange,"atomic.store",a.toString()),r.currentType=p.void,e.unreachable();let l=r.compileExpression(t[0],r.options.usizeType,1),o=n.contextIsExact?r.compileExpression(t[1],s,1):r.compileExpression(t[1],a,a.isIntegerValue?0:1),u=r.currentType;a.isIntegerValue&&(!u.isIntegerValue||u.size<a.size)&&(o=r.convertExpression(o,u,a,!1,t[1]),u=a);let c=t.length==3?_t(t[2],r):0;return c<0?(r.currentType=p.void,e.unreachable()):(r.currentType=p.void,e.atomic_store(a.byteSize,l,o,u.toRef(),c))}E.set(g.atomic_store,vr);function ui(n,r,e){let t=n.compiler,i=t.module;if(X(n,32)|Z(n,!0)|Le(n,2,3))return i.unreachable();let s=n.operands,a=n.typeArguments,l=n.contextualType,o=a[0];if(!o.isIntegerValue||o.size<8)return t.error(203,n.reportNode.typeArgumentsRange,e,o.toString()),i.unreachable();let u=t.compileExpression(s[0],t.options.usizeType,1),c=n.contextIsExact?t.compileExpression(s[1],l,1):t.compileExpression(s[1],o,o.isIntegerValue?0:1),f=t.currentType;o.isIntegerValue&&(!f.isIntegerValue||f.size<o.size)&&(c=t.convertExpression(c,f,o,!1,s[1]),f=o);let _=s.length==3?_t(s[2],t):0;return _<0?(t.currentType=f,i.unreachable()):(t.currentType=f,i.atomic_rmw(r,o.byteSize,_,u,c,f.toRef()))}function Ir(n){return ui(n,0,"atomic.add")}E.set(g.atomic_add,Ir);function kr(n){return ui(n,1,"atomic.sub")}E.set(g.atomic_sub,kr);function Fr(n){return ui(n,2,"atomic.and")}E.set(g.atomic_and,Fr);function wr(n){return ui(n,3,"atomic.or")}E.set(g.atomic_or,wr);function Rr(n){return ui(n,4,"atomic.xor")}E.set(g.atomic_xor,Rr);function Cr(n){return ui(n,5,"atomic.xchg")}E.set(g.atomic_xchg,Cr);function Pr(n){let r=n.compiler,e=r.module;if(X(n,32)|Z(n,!0)|Le(n,3,4))return e.unreachable();let t=n.operands,i=n.typeArguments,s=n.contextualType,a=i[0];if(!a.isIntegerValue||a.size<8)return r.error(203,n.reportNode.typeArgumentsRange,"atomic.cmpxchg",a.toString()),e.unreachable();let l=r.compileExpression(t[0],r.options.usizeType,1),o=n.contextIsExact?r.compileExpression(t[1],s,1):r.compileExpression(t[1],a,a.isIntegerValue?0:1),u=r.currentType,c=r.compileExpression(t[2],u,1);a.isIntegerValue&&(!u.isIntegerValue||u.size<a.size)&&(o=r.convertExpression(o,u,a,!1,t[1]),c=r.convertExpression(c,u,a,!1,t[2]),u=a);let f=t.length==4?_t(t[3],r):0;return f<0?(r.currentType=u,e.unreachable()):(r.currentType=u,e.atomic_cmpxchg(a.byteSize,f,l,o,c,u.toRef()))}E.set(g.atomic_cmpxchg,Pr);function Hf(n){let r=n.compiler,e=r.module;if(X(n,32)|Z(n)|Le(n,2,3))return r.currentType=p.i32,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],r.options.usizeType,1),l=r.compileExpression(t[1],s,1),o=t.length==3?r.compileExpression(t[2],p.i64,1):e.i64(-1,-1);switch(r.currentType=p.i32,s.kind){case 3:case 4:case 5:case 8:case 9:case 10:return e.atomic_wait(a,l,o,s.toRef())}return r.error(203,n.reportNode.typeArgumentsRange,"atomic.wait",s.toString()),e.unreachable()}E.set(g.atomic_wait,Hf);function VA(n){let r=n.compiler,e=r.module;if(X(n,32)|F(n)|Le(n,1,2))return r.currentType=p.i32,e.unreachable();let t=n.operands,i=r.compileExpression(t[0],r.options.usizeType,1),s=t.length==2?r.compileExpression(t[1],p.i32,1):e.i32(-1);return r.currentType=p.i32,e.atomic_notify(i,s)}E.set(g.atomic_notify,VA);function OA(n){let r=n.compiler,e=r.module;return r.currentType=p.void,X(n,32)|F(n)|K(n,0)?e.unreachable():e.atomic_fence()}E.set(g.atomic_fence,OA);function qA(n){let r=n.compiler,e=r.module;if(de(n,!0)|K(n,3))return e.unreachable();let t=n.operands,i=n.typeArguments,s=i?r.compileExpression(t[0],i[0],1):r.compileExpression(t[0],p.auto),a=r.currentType;if(!a.isAny(384))return r.error(203,n.reportNode.typeArgumentsRange,"select",a.toString()),e.unreachable();let l=r.compileExpression(t[1],a,1),o=r.makeIsTrueish(r.compileExpression(t[2],p.bool),r.currentType,t[2]);return r.currentType=a,e.select(s,l,o)}E.set(g.select,qA);function WA(n){return F(n),K(n,0),n.compiler.module.unreachable()}E.set(g.unreachable,WA);function KA(n){let r=n.compiler,e=r.module;return r.currentType=p.i32,F(n)|K(n,0)?e.unreachable():e.memory_size()}E.set(g.memory_size,KA);function HA(n){let r=n.compiler,e=r.module;return r.currentType=p.i32,F(n)|K(n,1)?e.unreachable():e.memory_grow(r.compileExpression(n.operands[0],p.i32,1))}E.set(g.memory_grow,HA);function jA(n){let r=n.compiler,e=r.module;if(r.currentType=p.void,F(n)|K(n,3))return e.unreachable();let t=n.operands;if(!r.options.hasFeature(8)){let o=r.resolver.resolveFunction(n.prototype,null);return r.currentType=p.void,!o||!r.compileFunction(o,!0)?e.unreachable():r.compileCallDirect(o,t,n.reportNode)}let i=r.options.usizeType,s=r.compileExpression(t[0],i,1),a=r.compileExpression(t[1],i,1),l=r.compileExpression(t[2],i,1);return r.currentType=p.void,e.memory_copy(s,a,l)}E.set(g.memory_copy,jA);function QA(n){let r=n.compiler,e=r.module;if(r.currentType=p.void,F(n)|K(n,3))return e.unreachable();let t=n.operands;if(!r.options.hasFeature(8)){let o=r.resolver.resolveFunction(n.prototype,null);return r.currentType=p.void,!o||!r.compileFunction(o,!0)?e.unreachable():r.compileCallDirect(o,t,n.reportNode)}let i=r.options.usizeType,s=r.compileExpression(t[0],i,1),a=r.compileExpression(t[1],p.u8,1),l=r.compileExpression(t[2],i,1);return r.currentType=p.void,e.memory_fill(s,a,l)}E.set(g.memory_fill,QA);function XA(n){let r=n.compiler,e=r.module;if(r.currentType=p.i32,de(n)|Le(n,1,2))return e.unreachable();let t=n.typeArguments,i=n.operands,s=i.length,a=r.options.usizeType,l;if(t&&t.length>0){let o=t[0];if(!o.isValue)return r.error(203,n.reportNode.typeArgumentsRange,"memory.data",o.toString()),r.currentType=a,e.unreachable();let u=i[0];if(u.kind!=18||u.literalKind!=5)return r.error(227,i[0].range),r.currentType=a,e.unreachable();let c=u.elementExpressions,f=c.length,_=new Array(f),d=!0;for(let b=0;b<f;++b){let A=c[b];if(A.kind!=21){let S=r.compileExpression(A,o,1),k=e.runExpression(S,1);k?S=k:d=!1,_[b]=S}else _[b]=r.makeZero(o)}if(!d)return r.error(220,u.range),r.currentType=a,e.unreachable();let m=o.byteSize;if(s==2&&(m=ir(i[1],m,r),m<0))return r.currentType=a,e.unreachable();let h=new Uint8Array(f*o.byteSize);assert(r.writeStaticBuffer(h,0,o,_)==h.byteLength),l=r.addAlignedMemorySegment(h,m).offset}else{let o=r.compileExpression(i[0],p.i32,1),u=e.runExpression(o,1);if(!u)return r.error(220,i[0].range),r.currentType=a,e.unreachable();let c=ae(u);if(c<1)return r.error(222,i[0].range,"1",i32.MAX_VALUE.toString()),r.currentType=a,e.unreachable();let f=16;if(s==2&&(f=ir(i[1],f,r),f<0))return r.currentType=a,e.unreachable();l=r.addAlignedMemorySegment(new Uint8Array(c),f).offset}return r.currentType=a,a==p.usize32?(assert(!i64_high(l)),e.i32(i64_low(l))):e.i64(i64_low(l),i64_high(l))}E.set(g.memory_data,XA);function ZA(n){let r=n.compiler,e=r.module;if(F(n)|K(n,1))return e.unreachable();let t=n.operands,i=r.compileExpression(t[0],p.i32,1);return r.currentType=p.i31,e.i31_new(i)}E.set(g.i31_new,ZA);function $A(n){let r=n.compiler,e=r.module;if(F(n)|K(n,1))return e.unreachable();let t=n.operands,i=r.compileExpression(t[0],p.i31.asNullable(),1);return n.contextualType.is(2)?(r.currentType=p.u32,e.i31_get(i,!1)):(r.currentType=p.i32,e.i31_get(i,!0))}E.set(g.i31_get,$A);function ox(n){let r=n.classReference;return r!=null&&r.hasDecorator(2048)}function ux(n){let r=n.classReference;return r!=null&&r.hasDecorator(16)&&!r.hasDecorator(2048)&&!r.hasDecorator(4096)}function YA(n){let r=n.compiler,e=r.module;if(Z(n,!0))return e.unreachable();let t=n.operands,s=n.typeArguments[0],a=s.classReference;if(a!=null&&a.prototype.internalName==r.resolver.program.dynamicArrayPrototype.internalName){if(t.length==1)return r.error(100,n.reportNode.range,"changetype<@managed @dynamic [T * n]> requires 2 args (dataPtr, length); a descriptor cannot be constructed from a bare pointer alone"),e.unreachable();if(t.length!=2&&K(n,2))return e.unreachable();let c=r.resolver.resolveExpression(t[0],r.currentFlow);if(c!=null&&c.kind==28)return r.error(100,n.reportNode.range,"cannot changetype between @managed and @unmanaged dynamic arrays; the ABI shapes differ (GC reference vs bare header-prefixed pointer) even though both are 1 slot. Construct the target model explicitly from the data pointer and length."),e.unreachable();let f=a.typeArguments,_=f!=null&&f.length>0?unchecked(f[0]):s,d=r.resolver.resolveClass(r.resolver.program.dynamicArrayPrototype,[_],new Map,1);if(d==null)return r.error(100,n.reportNode.range,"cannot resolve the dynamic array descriptor class"),e.unreachable();let m=r.compileExpression(t[0],r.options.usizeType,1),h=r.compileExpression(t[1],p.i32,1),b=r.makeAbort(y.createStringLiteralExpression("dynamic array length exceeds i32.MAX (2,147,483,647)",n.reportNode.range),n.reportNode);return r.currentType=s,e.block(null,[e.if(e.binary(17,h,e.i32(0)),b,0),r.makeCallDirect(assert(d.constructorInstance),[r.makeAllocation(d),m,h],n.reportNode,!1)],P.I32)}if(s.kind==28&&t.length==1){let c=r.resolver.resolveExpression(t[0],r.currentFlow);if(c!=null){let f=c.classReference;if(f!=null&&f.prototype.internalName==r.resolver.program.dynamicArrayPrototype.internalName)return r.error(100,n.reportNode.range,"cannot changetype between @managed and @unmanaged dynamic arrays; the ABI shapes differ (GC reference vs bare header-prefixed pointer) even though both are 1 slot. Construct the target model explicitly from the data pointer and length."),e.unreachable()}}if(K(n,1))return e.unreachable();if(s.classReference!=null&&assert(s.classReference).hasDecorator(4096)){if(!r.resolver.isViewCall(n.reportNode))return r.error(100,n.reportNode.range,"changetype to an @inline struct (a value has no pointer representation; use @unmanaged struct for a view over bytes)"),e.unreachable();let c=r.resolver.resolveExpression(t[0],r.currentFlow),f=c!=null?c.classReference:null;if(f!=null&&f.hasDecorator(4096))return r.error(6395,n.reportNode.range,assert(c).toString(),"@unmanaged"),e.unreachable();let _=r.compileExpression(t[0],p.auto);return r.currentType=s,_}if(s.kind==28){let c=r.compileExpression(t[0],p.auto),_=r.currentFlow.getTempLocal(s),d=e.load(4,!1,e.local_get(_.index,P.I32),P.I32,0,4),m=r.makeAbort(y.createStringLiteralExpression("dynamic array length exceeds i32.MAX (2,147,483,647)",n.reportNode.range),n.reportNode);return r.currentType=s,e.block(null,[e.local_set(_.index,c,!1),e.if(e.binary(17,d,e.i32(0)),m,0),e.local_get(_.index,P.I32)],P.I32)}let o=r.compileExpression(t[0],p.auto),u=r.currentType;return r.currentType=s,ox(s)&&ux(u)?(r.error(6394,n.reportNode.range,u.toString()),e.unreachable()):(ux(s)&&ox(u)&&r.markOperandForRooting(),s.kind==14&&(s.fixedMemoryModel==0||s.fixedMemoryModel==1)?(r.error(100,n.reportNode.range,"a value-typed `[T * N]` cannot be constructed from an address via changetype \u2014 use `@unmanaged [T * N]` for a pointer view, or Landing 5b will give the value form inline storage"),e.unreachable()):u.isChangeableTo(s)?o:(r.error(202,n.reportNode.range,u.toString(),s.toString()),e.unreachable()))}E.set(g.changetype,YA);function JA(n){let r=n.compiler,e=r.module;if(r.currentType=p.void,K(n,2))return e.unreachable();let t=n.operands,i=r.resolver.resolveExpression(t[1],r.currentFlow);if(i==null)return e.unreachable();let s=i.classReference;if(s==null||!s.hasDecorator(4096))return r.error(100,n.reportNode.typeArgumentsRange,"copyInto needs an @inline struct value: '"+i.toString()+"' is not a value type"),e.unreachable();let a=r.compileExpression(t[0],r.options.usizeType,1),l=r.sroaTreeOf(t[1]);if(l==null)return r.error(100,t[1].range,"copyInto needs an @inline struct value held in a local (a value has no address, so only a tracked value can be copied out)"),e.unreachable();let o=new Array;return r.emitSroaStores(i,l,a,0,o),r.currentType=p.void,e.flatten(o,P.None)}E.set(g.copyInto,JA);function eT(n){let r=n.compiler,e=r.module,t=n.typeArguments;if(de(n,!0)|Le(n,1,2))return t&&(assert(t.length),r.currentType=t[0].nonNullableType),e.unreachable();let i=n.operands,s=n.contextualType,a=t?r.compileExpression(i[0],t[0],5):r.compileExpression(i[0],p.bool,4),l=r.currentType;if(r.currentType=l.nonNullableType,r.options.noAssert)return a;let o=e.runExpression(a,0);if(o)switch(fe(o)){case P.I32:{if(ae(o))return a;break}case P.I64:{if(Ne(o)|Ge(o))return a;break}case P.F32:{if(Ce(o))return a;break}case P.F64:{if(Pe(o))return a;break}}let u=r.makeAbort(i.length==2?i[1]:null,n.reportNode);if(r.currentType=l.nonNullableType,s==p.void)switch(r.currentType=p.void,l.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:return e.if(e.unary(20,a),u);case 4:case 9:return e.if(e.unary(21,a),u);case 5:case 10:return e.if(e.unary(145,a),u);case 11:return e.if(e.binary(57,a,e.f32(0)),u);case 12:return e.if(e.binary(70,a,e.f64(0)),u);case 16:case 15:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:return e.if(e.ref_is_null(a),u)}else{r.currentType=l.nonNullableType;let c=r.currentFlow;switch(r.currentType.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:{let f=c.getTempLocal(l);return c.setLocalFlag(f.index,2),e.if(e.local_tee(f.index,a,!1),e.local_get(f.index,P.I32),u)}case 4:case 9:{let f=c.getTempLocal(p.i64);return e.if(e.unary(21,e.local_tee(f.index,a,!1)),u,e.local_get(f.index,P.I64))}case 5:case 10:{let f=c.getTempLocal(r.options.usizeType);return e.if(e.unary(145,e.local_tee(f.index,a,l.isManaged)),u,e.local_get(f.index,r.options.sizeTypeRef))}case 11:{let f=c.getTempLocal(p.f32);return e.if(e.binary(57,e.local_tee(f.index,a,!1),e.f32(0)),u,e.local_get(f.index,P.F32))}case 12:{let f=c.getTempLocal(p.f64);return e.if(e.binary(70,e.local_tee(f.index,a,!1),e.f64(0)),u,e.local_get(f.index,P.F64))}case 16:case 15:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:{let f=c.getTempLocal(l);return e.if(e.ref_is_null(e.local_tee(f.index,a,!1)),u,e.local_get(f.index,l.toRef()))}}}return r.error(203,n.reportNode.typeArgumentsRange,"assert",r.currentType.toString()),u}E.set(g.assert,eT);function tT(n){let r=n.compiler,e=r.module;if(F(n)|K(n,1))return e.unreachable();let t=r.currentFlow,i=r.options.uncheckedBehavior===1,s=t.is(32768);i?assert(!s):t.set(32768);let a=r.compileExpression(n.operands[0],n.contextualType);return s||t.unset(32768),a}E.set(g.unchecked,tT);function rT(n){let r=n.compiler,e=r.module;if(F(n)|K(n,1))return e.unreachable();let t=r.currentFlow,i=t.is(131072);i||t.set(131072);let s=r.compileExpression(n.operands[0],n.contextualType);return i||t.unset(131072),s}E.set(g.inline_always,rT);function nT(n){let r=n.compiler,e=r.module;if(de(n,!0)|Le(n,1,i32.MAX_VALUE))return e.unreachable();let t=n.operands,i=n.typeArguments,s;i?(assert(i.length),s=i[0]):s=n.contextualType;let a=r.compileExpression(t[0],p.u32,1),l=t.length-1,o=new Array(l),u=new Array(l);for(let c=0;c<l;++c)o[c]=r.compileExpression(t[1+c],p.auto),r.currentType.isManaged&&(o[c]=e.tostack(o[c])),u[c]=r.currentType.toRef();return r.currentType=s,e.call_indirect(null,a,o,it(u),s.toRef())}E.set(g.call_indirect,nT);function iT(n){let r=n.compiler,e=r.module;if(Z(n,!0))return e.unreachable();let t=n.operands,a=n.typeArguments[0].getClass();if(!a)return r.error(2351,n.reportNode.expression.range),e.unreachable();r.currentType=a.type;let l=r.ensureConstructor(a,n.reportNode);return r.checkFieldInitialization(a,n.reportNode),r.compileInstantiate(l,t,0,n.reportNode)}E.set(g.instantiate,iT);function jf(n,r){let e=n.compiler,t=e.module;F(n);let i=n.operands,s=n.reportNode;return e.emitDiagnostic(102,r,s.range,null,i.length?i[0].range.toString():s.range.toString()),r==3?t.unreachable():t.nop()}function sT(n){return jf(n,3)}E.set(g.ERROR,sT);function aT(n){return jf(n,2)}E.set(g.WARNING,aT);function lT(n){return jf(n,1)}E.set(g.INFO,lT);function oT(n){let r=n.compiler,e=n.prototype.parent;assert(e.kind==7);let t=e;assert(t.prototype==r.program.functionPrototype);let i=assert(t.typeArguments);assert(i.length==1);let s=i[0],a=assert(s.getSignature()),l=a.returnType;if(F(n)|Le(n,1+a.requiredParameters,1+a.parameterTypes.length))return r.currentType=l,r.module.unreachable();let o=r.compileExpression(assert(n.thisOperand),s,1),u=assert(n.operands.shift()),c=a.thisType,f=0;if(c)f=r.compileExpression(u,c,1);else if(u.kind!=20)return r.error(2332,u.range),r.module.unreachable();return r.compileCallIndirect(a,o,n.operands,n.reportNode,f,n.contextualType==p.void)}E.set(g.Function_call,oT);function uT(n){let r=n.compiler,e=r.module;return r.currentType=n.compiler.program.stringInstance.type,r.error(100,n.reportNode.range,"String.raw"),e.unreachable()}E.set(g.String_raw,uT);function ut(n,r){let e=n.compiler;return F(n)|K(n,1)?(e.currentType=r,e.module.unreachable()):e.compileExpression(n.operands[0],r,2)}function cT(n){return ut(n,p.i8)}E.set(g.i8,cT);function pT(n){return ut(n,p.i16)}E.set(g.i16,pT);function fT(n){return ut(n,p.i32)}E.set(g.i32,fT);function _T(n){return ut(n,p.i64)}E.set(g.i64,_T);function dT(n){return ut(n,n.compiler.options.isizeType)}E.set(g.isize,dT);function hT(n){return ut(n,p.u8)}E.set(g.u8,hT);function mT(n){return ut(n,p.u16)}E.set(g.u16,mT);function yT(n){return ut(n,p.u32)}E.set(g.u32,yT);function gT(n){return ut(n,p.u64)}E.set(g.u64,gT);function bT(n){return ut(n,n.compiler.options.usizeType)}E.set(g.usize,bT);function xT(n){return ut(n,p.bool)}E.set(g.bool,xT);function ET(n){return ut(n,p.f32)}E.set(g.f32,ET);function AT(n){return ut(n,p.f64)}E.set(g.f64,AT);function TT(n){return cx(n)}E.set(g.v128,TT);function cx(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,16))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=new Uint8Array(16),s=new Array(16),a=0;for(let l=0;l<16;++l){let o=r.compileExpression(t[l],p.i8,1),u=e.runExpression(o,1);u?be(ae(u),i,l):(s[l]=o,a++)}if(r.currentType=p.v128,a==0)return e.v128(i);{let l,o=a==16;o?l=e.unary(60,s[0]):l=e.v128(i);for(let u=i32(o);u<16;u++){let c=s[u];c&&(l=e.simd_replace(0,l,u,c))}return l}}E.set(g.i8x16,cx);function ST(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,8))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=new Uint8Array(16),s=new Array(8),a=0;for(let l=0;l<8;++l){let o=r.compileExpression(t[l],p.i16,1),u=e.runExpression(o,1);u?br(ae(u),i,l<<1):(s[l]=o,a++)}if(r.currentType=p.v128,a==0)return e.v128(i);{let l,o=a==8;o?l=e.unary(61,s[0]):l=e.v128(i);for(let u=i32(o);u<8;u++){let c=s[u];c&&(l=e.simd_replace(1,l,u,c))}return l}}E.set(g.i16x8,ST);function vT(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,4))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=new Uint8Array(16),s=new Array(4),a=0;for(let l=0;l<4;++l){let o=r.compileExpression(t[l],p.i32,1),u=e.runExpression(o,1);u?Se(ae(u),i,l<<2):(s[l]=o,a++)}if(r.currentType=p.v128,a==0)return e.v128(i);{let l,o=a==4;o?l=e.unary(62,s[0]):l=e.v128(i);for(let u=i32(o);u<4;u++){let c=s[u];c&&(l=e.simd_replace(2,l,u,c))}return l}}E.set(g.i32x4,vT);function IT(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=new Uint8Array(16),s=new Array(2),a=0;for(let l=0;l<2;++l){let o=r.compileExpression(t[l],p.i64,1),u=e.runExpression(o,1);if(u){let c=l<<3;Se(Ne(u),i,c+0),Se(Ge(u),i,c+4)}else s[l]=o,a++}if(r.currentType=p.v128,a==0)return e.v128(i);{let l,o=a==2;o?l=e.unary(63,s[0]):l=e.v128(i);for(let u=i32(o);u<2;u++){let c=s[u];c&&(l=e.simd_replace(3,l,u,c))}return l}}E.set(g.i64x2,IT);function kT(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,4))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=new Uint8Array(16),s=new Array(4),a=0;for(let l=0;l<4;++l){let o=r.compileExpression(t[l],p.f32,1),u=e.runExpression(o,1);u?Wr(Ce(u),i,l<<2):(s[l]=o,a++)}if(r.currentType=p.v128,a==0)return e.v128(i);{let l,o=a==4;o?l=e.unary(64,s[0]):l=e.v128(i);for(let u=i32(o);u<4;u++){let c=s[u];c&&(l=e.simd_replace(5,l,u,c))}return l}}E.set(g.f32x4,kT);function FT(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=new Uint8Array(16),s=new Array(2),a=0;for(let l=0;l<2;++l){let o=r.compileExpression(t[l],p.f64,1),u=e.runExpression(o,1);u?Kr(Pe(u),i,l<<3):(s[l]=o,a++)}if(r.currentType=p.v128,a==0)return e.v128(i);{let l,o=a==2;o?l=e.unary(65,s[0]):l=e.v128(i);for(let u=i32(o);u<2;u++){let c=s[u];c&&(l=e.simd_replace(6,l,u,c))}return l}}E.set(g.f64x2,FT);function an(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],s,1);if(r.currentType=p.v128,s.isValue)switch(s.kind){case 1:case 6:return e.unary(60,a);case 2:case 7:return e.unary(61,a);case 3:case 8:return e.unary(62,a);case 4:case 9:return e.unary(63,a);case 5:case 10:return e.unary(r.options.isWasm64?63:62,a);case 11:return e.unary(64,a);case 12:return e.unary(65,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.splat",s.toString()),e.unreachable()}E.set(g.v128_splat,an);function ar(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n,!0)|K(n,2))return e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.u8,1);r.currentType=s;let o=0,u=e.runExpression(l,1);if(u?o=ae(u):r.error(220,t[1].range),s.isValue){let c=16/assert(s.byteSize)-1;switch((o<0||o>c)&&(r.error(222,t[1].range,"Lane index","0",c.toString()),o=0),s.kind){case 1:return e.simd_extract(0,a,o);case 6:return e.simd_extract(1,a,o);case 2:return e.simd_extract(2,a,o);case 7:return e.simd_extract(3,a,o);case 3:case 8:return e.simd_extract(4,a,o);case 4:case 9:return e.simd_extract(5,a,o);case 5:case 10:return e.simd_extract(r.options.isWasm64?5:4,a,o);case 11:return e.simd_extract(7,a,o);case 12:return e.simd_extract(8,a,o)}}return r.error(203,n.reportNode.typeArgumentsRange,"v128.extract_lane",s.toString()),e.unreachable()}E.set(g.v128_extract_lane,ar);function ln(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,3))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.u8,1),o=r.compileExpression(t[2],s,1);r.currentType=p.v128;let u=0,c=e.runExpression(l,1);if(c?u=ae(c):r.error(220,t[1].range),s.isValue){let f=16/assert(s.byteSize)-1;switch((u<0||u>f)&&(r.error(222,t[1].range,"Lane index","0",f.toString()),u=0),s.kind){case 1:case 6:return e.simd_replace(0,a,u,o);case 2:case 7:return e.simd_replace(1,a,u,o);case 3:case 8:return e.simd_replace(2,a,u,o);case 4:case 9:return e.simd_replace(3,a,u,o);case 5:case 10:return e.simd_replace(r.options.isWasm64?3:2,a,u,o);case 11:return e.simd_replace(5,a,u,o);case 12:return e.simd_replace(6,a,u,o)}}return r.error(203,n.reportNode.typeArgumentsRange,"v128.replace_lane",s.toString()),e.unreachable()}E.set(g.v128_replace_lane,ln);function on(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0];if(s.isValue){let a=s.byteSize,l=16/a;if(assert(Number.isInteger(l)&&Hr(l)),K(n,2+l))return r.currentType=p.v128,e.unreachable();let o=r.compileExpression(t[0],p.v128,1),u=r.compileExpression(t[1],p.v128,1);switch(s.kind){case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:{let c=new Uint8Array(16),f=(l<<1)-1;for(let _=0;_<l;++_){let d=t[2+_],m=r.compileExpression(d,p.u8,1),h=e.runExpression(m,1),b=0;switch(h?(b=ae(h),(b<0||b>f)&&(r.error(222,d.range,"Lane index","0",f.toString()),b=0)):r.error(220,d.range),a){case 1:{be(b,c,_);break}case 2:{let A=_<<1,S=b<<1;be(S,c,A),be(S+1,c,A+1);break}case 4:{let A=_<<2,S=b<<2;be(S,c,A),be(S+1,c,A+1),be(S+2,c,A+2),be(S+3,c,A+3);break}case 8:{let A=_<<3,S=b<<3;be(S,c,A),be(S+1,c,A+1),be(S+2,c,A+2),be(S+3,c,A+3),be(S+4,c,A+4),be(S+5,c,A+5),be(S+6,c,A+6),be(S+7,c,A+7);break}default:assert(!1)}}return r.currentType=p.v128,e.simd_shuffle(o,u,c)}}}return r.error(203,n.reportNode.typeArgumentsRange,"v128.shuffle",s.toString()),r.currentType=p.v128,e.unreachable()}E.set(g.v128_shuffle,on);function px(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=r.compileExpression(t[0],p.v128,1),s=r.compileExpression(t[1],p.v128,1);return e.binary(209,i,s)}E.set(g.v128_swizzle,px);function Ys(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n,!0)|Le(n,1,3))return e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],r.options.usizeType,1),l=t.length,o=0,u=s.byteSize;if(l>=2){if(o=_t(t[1],r),o<0)return r.currentType=p.v128,e.unreachable();if(l==3&&(u=ir(t[2],u,r),u<0))return r.currentType=p.v128,e.unreachable()}if(r.currentType=p.v128,s.isValue)switch(s.kind){case 1:case 6:return e.simd_load(0,a,o,u);case 2:case 7:return e.simd_load(1,a,o,u);case 3:case 8:case 11:return e.simd_load(2,a,o,u);case 5:case 10:if(!r.options.isWasm64)return e.simd_load(2,a,o,u);case 4:case 9:case 12:return e.simd_load(3,a,o,u)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.load_splat",s.toString()),e.unreachable()}E.set(g.v128_load_splat,Ys);function un(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n,!0)|Le(n,1,3))return e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],r.options.usizeType,1),l=t.length,o=0,u=s.byteSize;if(l>=2){if(o=_t(t[1],r),o<0)return r.currentType=p.v128,e.unreachable();if(l==3&&(u=ir(t[2],u,r),u<0))return r.currentType=p.v128,e.unreachable()}if(r.currentType=p.v128,s.isValue)switch(s.kind){case 1:return e.simd_load(4,a,o,u);case 6:return e.simd_load(5,a,o,u);case 2:return e.simd_load(6,a,o,u);case 7:return e.simd_load(7,a,o,u);case 5:if(r.options.isWasm64)break;case 3:return e.simd_load(8,a,o,u);case 10:if(r.options.isWasm64)break;case 8:return e.simd_load(9,a,o,u)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.load_ext",s.toString()),e.unreachable()}E.set(g.v128_load_ext,un);function Qf(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n,!0)|Le(n,1,3))return e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],r.options.usizeType,1),l=t.length,o=0,u=s.byteSize;if(l>=2){if(o=_t(t[1],r),o<0)return r.currentType=p.v128,e.unreachable();if(l==3&&(u=ir(t[2],u,r),u<0))return r.currentType=p.v128,e.unreachable()}if(r.currentType=p.v128,s.isValue)switch(s.kind){case 3:case 8:case 11:return e.simd_load(10,a,o,u);case 4:case 9:case 12:return e.simd_load(11,a,o,u);case 5:case 10:return e.simd_load(r.options.isWasm64?11:10,a,o,u)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.load_zero",s.toString()),e.unreachable()}E.set(g.v128_load_zero,Qf);function Js(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n,!0)|Le(n,3,5))return e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],r.options.usizeType,1),l=r.compileExpression(t[1],p.v128,1),o=r.compileExpression(t[2],p.u8,1),u=0,c=e.runExpression(o,1);c?u=ae(c):r.error(220,t[2].range);let f=t.length,_=0,d=s.byteSize;if(f>=4){if(_=_t(t[3],r),_<0)return r.currentType=p.v128,e.unreachable();if(f==5&&(d=ir(t[4],d,r),d<0))return r.currentType=p.v128,e.unreachable()}if(r.currentType=p.v128,s.isValue){let m=16/assert(s.byteSize)-1;switch((u<0||u>m)&&(r.error(222,t[1].range,"Lane index","0",m.toString()),u=0),s.kind){case 1:case 6:return e.simd_loadstorelane(0,a,_,d,u,l);case 2:case 7:return e.simd_loadstorelane(1,a,_,d,u,l);case 3:case 8:case 11:return e.simd_loadstorelane(2,a,_,d,u,l);case 4:case 9:case 12:return e.simd_loadstorelane(3,a,_,d,u,l);case 5:case 10:return e.simd_loadstorelane(r.options.isWasm64?3:2,a,_,d,u,l)}}return r.error(203,n.reportNode.typeArgumentsRange,"v128.load_lane",s.toString()),e.unreachable()}E.set(g.v128_load_lane,Js);function ea(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n,!0)|Le(n,3,5))return e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],r.options.usizeType,1),l=r.compileExpression(t[1],p.v128,1),o=r.compileExpression(t[2],p.u8,1),u=0,c=e.runExpression(o,1);c?u=ae(c):r.error(220,t[2].range);let f=t.length,_=0,d=s.byteSize;if(f>=4){if(_=_t(t[3],r),_<0)return r.currentType=p.v128,e.unreachable();if(f==5&&(d=ir(t[4],d,r),d<0))return r.currentType=p.v128,e.unreachable()}if(r.currentType=p.void,s.isValue){let m=16/assert(s.byteSize)-1;switch((u<0||u>m)&&(r.error(222,t[1].range,"Lane index","0",m.toString()),u=0),s.kind){case 1:case 6:return e.simd_loadstorelane(4,a,_,d,u,l);case 2:case 7:return e.simd_loadstorelane(5,a,_,d,u,l);case 3:case 8:case 11:return e.simd_loadstorelane(6,a,_,d,u,l);case 4:case 9:case 12:return e.simd_loadstorelane(7,a,_,d,u,l);case 5:case 10:return e.simd_loadstorelane(r.options.isWasm64?7:6,a,_,d,u,l)}}return r.error(203,n.reportNode.typeArgumentsRange,"v128.store_lane",s.toString()),e.unreachable()}E.set(g.v128_store_lane,ea);function cn(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:case 6:return e.binary(134,a,l);case 2:case 7:return e.binary(145,a,l);case 3:case 8:return e.binary(162,a,l);case 4:case 9:return e.binary(174,a,l);case 5:case 10:return e.binary(r.options.isWasm64?174:162,a,l);case 11:return e.binary(189,a,l);case 12:return e.binary(197,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.add",s.toString()),e.unreachable()}E.set(g.v128_add,cn);function pn(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:case 6:return e.binary(137,a,l);case 2:case 7:return e.binary(148,a,l);case 3:case 8:return e.binary(163,a,l);case 4:case 9:return e.binary(175,a,l);case 5:case 10:return e.binary(r.options.isWasm64?175:163,a,l);case 11:return e.binary(190,a,l);case 12:return e.binary(198,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.sub",s.toString()),e.unreachable()}E.set(g.v128_sub,pn);function ci(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 2:case 7:return e.binary(151,a,l);case 3:case 8:return e.binary(164,a,l);case 4:case 9:return e.binary(176,a,l);case 5:case 10:return e.binary(r.options.isWasm64?176:164,a,l);case 11:return e.binary(191,a,l);case 12:return e.binary(199,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.mul",s.toString()),e.unreachable()}E.set(g.v128_mul,ci);function Xf(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.binary(192,a,l);case 12:return e.binary(200,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.div",s.toString()),e.unreachable()}E.set(g.v128_div,Xf);function ta(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(135,a,l);case 6:return e.binary(136,a,l);case 2:return e.binary(146,a,l);case 7:return e.binary(147,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.add_sat",s.toString()),e.unreachable()}E.set(g.v128_add_sat,ta);function ra(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(138,a,l);case 6:return e.binary(139,a,l);case 2:return e.binary(149,a,l);case 7:return e.binary(150,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.sub_sat",s.toString()),e.unreachable()}E.set(g.v128_sub_sat,ra);function lr(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(140,a,l);case 6:return e.binary(141,a,l);case 2:return e.binary(152,a,l);case 7:return e.binary(153,a,l);case 5:if(r.options.isWasm64)break;case 3:return e.binary(165,a,l);case 10:if(r.options.isWasm64)break;case 8:return e.binary(166,a,l);case 11:return e.binary(193,a,l);case 12:return e.binary(201,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.min",s.toString()),e.unreachable()}E.set(g.v128_min,lr);function or(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(142,a,l);case 6:return e.binary(143,a,l);case 2:return e.binary(154,a,l);case 7:return e.binary(155,a,l);case 5:if(r.options.isWasm64)break;case 3:return e.binary(167,a,l);case 10:if(r.options.isWasm64)break;case 8:return e.binary(168,a,l);case 11:return e.binary(194,a,l);case 12:return e.binary(202,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.max",s.toString()),e.unreachable()}E.set(g.v128_max,or);function Zf(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.binary(195,a,l);case 12:return e.binary(203,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.pmin",s.toString()),e.unreachable()}E.set(g.v128_pmin,Zf);function $f(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.binary(196,a,l);case 12:return e.binary(204,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.pmax",s.toString()),e.unreachable()}E.set(g.v128_pmax,$f);function fx(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);return s.isValue&&s.kind===2?e.binary(169,a,l):(r.error(203,n.reportNode.typeArgumentsRange,"v128.dot",s.toString()),e.unreachable())}E.set(g.v128_dot,fx);function Yf(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 6:return e.binary(144,a,l);case 7:return e.binary(156,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.avgr",s.toString()),e.unreachable()}E.set(g.v128_avgr,Yf);function fn(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:case 6:return e.binary(76,a,l);case 2:case 7:return e.binary(86,a,l);case 3:case 8:return e.binary(96,a,l);case 4:case 9:return e.binary(106,a,l);case 5:case 10:return e.binary(r.options.isWasm64?106:96,a,l);case 11:return e.binary(118,a,l);case 12:return e.binary(124,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.eq",s.toString()),e.unreachable()}E.set(g.v128_eq,fn);function _n(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:case 6:return e.binary(77,a,l);case 2:case 7:return e.binary(87,a,l);case 3:case 8:return e.binary(97,a,l);case 4:case 9:return e.binary(107,a,l);case 5:case 10:return e.binary(r.options.isWasm64?107:97,a,l);case 11:return e.binary(119,a,l);case 12:return e.binary(125,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.ne",s.toString()),e.unreachable()}E.set(g.v128_ne,_n);function zt(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(78,a,l);case 6:return e.binary(79,a,l);case 2:return e.binary(88,a,l);case 7:return e.binary(89,a,l);case 3:return e.binary(98,a,l);case 8:return e.binary(99,a,l);case 4:return e.binary(108,a,l);case 5:return e.binary(r.options.isWasm64?108:98,a,l);case 10:{if(r.options.isWasm64)break;return e.binary(99,a,l)}case 11:return e.binary(120,a,l);case 12:return e.binary(126,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.lt",s.toString()),e.unreachable()}E.set(g.v128_lt,zt);function Dt(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(82,a,l);case 6:return e.binary(83,a,l);case 2:return e.binary(92,a,l);case 7:return e.binary(93,a,l);case 3:return e.binary(102,a,l);case 8:return e.binary(103,a,l);case 4:return e.binary(110,a,l);case 5:return e.binary(r.options.isWasm64?110:102,a,l);case 10:{if(r.options.isWasm64)break;return e.binary(103,a,l)}case 11:return e.binary(122,a,l);case 12:return e.binary(128,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.le",s.toString()),e.unreachable()}E.set(g.v128_le,Dt);function Gt(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(80,a,l);case 6:return e.binary(81,a,l);case 2:return e.binary(90,a,l);case 7:return e.binary(91,a,l);case 3:return e.binary(100,a,l);case 8:return e.binary(101,a,l);case 4:return e.binary(109,a,l);case 5:return e.binary(r.options.isWasm64?109:100,a,l);case 10:{if(r.options.isWasm64)break;return e.binary(101,a,l)}case 11:return e.binary(121,a,l);case 12:return e.binary(127,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.gt",s.toString()),e.unreachable()}E.set(g.v128_gt,Gt);function Ut(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(84,a,l);case 6:return e.binary(85,a,l);case 2:return e.binary(94,a,l);case 7:return e.binary(95,a,l);case 3:return e.binary(104,a,l);case 8:return e.binary(105,a,l);case 4:return e.binary(111,a,l);case 5:return e.binary(r.options.isWasm64?111:104,a,l);case 10:{if(r.options.isWasm64)break;return e.binary(105,a,l)}case 11:return e.binary(123,a,l);case 12:return e.binary(129,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.ge",s.toString()),e.unreachable()}E.set(g.v128_ge,Ut);function na(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 2:return e.binary(205,a,l);case 7:return e.binary(206,a,l);case 3:return e.binary(207,a,l);case 8:return e.binary(208,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.narrow",s.toString()),e.unreachable()}E.set(g.v128_narrow,na);function dn(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 1:case 6:return e.unary(69,a);case 2:case 7:return e.unary(74,a);case 3:case 8:return e.unary(78,a);case 4:case 9:return e.unary(82,a);case 5:case 10:return e.unary(r.options.isWasm64?82:78,a);case 11:return e.unary(93,a);case 12:return e.unary(100,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.neg",s.toString()),e.unreachable()}E.set(g.v128_neg,dn);function hn(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.unary(68,a);case 2:return e.unary(73,a);case 3:return e.unary(77,a);case 4:return e.unary(81,a);case 5:return e.unary(r.options.isWasm64?81:77,a);case 6:case 7:case 8:case 9:case 10:return a;case 11:return e.unary(92,a);case 12:return e.unary(99,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.abs",s.toString()),e.unreachable()}E.set(g.v128_abs,hn);function Jf(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.unary(94,a);case 12:return e.unary(101,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.sqrt",s.toString()),e.unreachable()}E.set(g.v128_sqrt,Jf);function e_(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.unary(95,a);case 12:return e.unary(102,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.ceil",s.toString()),e.unreachable()}E.set(g.v128_ceil,e_);function t_(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.unary(96,a);case 12:return e.unary(103,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.floor",s.toString()),e.unreachable()}E.set(g.v128_floor,t_);function r_(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.unary(97,a);case 12:return e.unary(104,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.trunc",s.toString()),e.unreachable()}E.set(g.v128_trunc,r_);function n_(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.unary(98,a);case 12:return e.unary(105,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.nearest",s.toString()),e.unreachable()}E.set(g.v128_nearest,n_);function i_(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 5:if(r.options.isWasm64)break;case 3:return e.unary(112,a);case 10:if(r.options.isWasm64)break;case 8:return e.unary(113,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.convert",s.toString()),e.unreachable()}E.set(g.v128_convert,i_);function s_(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 5:if(r.options.isWasm64)break;case 3:return e.unary(126,a);case 10:if(r.options.isWasm64)break;case 8:return e.unary(127,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.convert_low",s.toString()),e.unreachable()}E.set(g.v128_convert_low,s_);function a_(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 5:if(r.options.isWasm64)break;case 3:return e.unary(110,a);case 10:if(r.options.isWasm64)break;case 8:return e.unary(111,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.trunc_sat",s.toString()),e.unreachable()}E.set(g.v128_trunc_sat,a_);function l_(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 5:if(r.options.isWasm64)break;case 3:return e.unary(128,a);case 10:if(r.options.isWasm64)break;case 8:return e.unary(129,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.trunc_sat_zero",s.toString()),e.unreachable()}E.set(g.v128_trunc_sat_zero,l_);function mn(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.unary(114,a);case 6:return e.unary(116,a);case 2:return e.unary(118,a);case 7:return e.unary(120,a);case 5:if(r.options.isWasm64)break;case 3:return e.unary(122,a);case 10:if(r.options.isWasm64)break;case 8:return e.unary(124,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.extend_low",s.toString()),e.unreachable()}E.set(g.v128_extend_low,mn);function yn(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.unary(115,a);case 6:return e.unary(117,a);case 2:return e.unary(119,a);case 7:return e.unary(121,a);case 5:if(r.options.isWasm64)break;case 3:return e.unary(123,a);case 10:if(r.options.isWasm64)break;case 8:return e.unary(125,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.extend_high",s.toString()),e.unreachable()}E.set(g.v128_extend_high,yn);function ia(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=n.typeArguments[0],s=r.compileExpression(t[0],p.v128,1),a=r.compileExpression(t[1],p.i32,1);if(r.currentType=p.v128,i.isValue)switch(i.kind){case 1:case 6:return e.simd_shift(0,s,a);case 2:case 7:return e.simd_shift(3,s,a);case 3:case 8:return e.simd_shift(6,s,a);case 4:case 9:return e.simd_shift(9,s,a);case 5:case 10:return e.simd_shift(r.options.isWasm64?9:6,s,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.shl",i.toString()),e.unreachable()}E.set(g.v128_shl,ia);function ur(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=n.typeArguments[0],s=r.compileExpression(t[0],p.v128,1),a=r.compileExpression(t[1],p.i32,1);if(r.currentType=p.v128,i.isValue)switch(i.kind){case 1:return e.simd_shift(1,s,a);case 6:return e.simd_shift(2,s,a);case 2:return e.simd_shift(4,s,a);case 7:return e.simd_shift(5,s,a);case 3:return e.simd_shift(7,s,a);case 8:return e.simd_shift(8,s,a);case 4:return e.simd_shift(10,s,a);case 9:return e.simd_shift(11,s,a);case 5:return e.simd_shift(r.options.isWasm64?10:7,s,a);case 10:return e.simd_shift(r.options.isWasm64?11:8,s,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.shr",i.toString()),e.unreachable()}E.set(g.v128_shr,ur);function su(n,r){let e=n.compiler,t=e.module;if(X(n,16)|F(n)|K(n,2))return e.currentType=p.v128,t.unreachable();let i=n.operands,s=e.compileExpression(i[0],p.v128,1),a=e.compileExpression(i[1],p.v128,1);return t.binary(r,s,a)}function wT(n){return su(n,130)}E.set(g.v128_and,wT);function RT(n){return su(n,131)}E.set(g.v128_or,RT);function CT(n){return su(n,132)}E.set(g.v128_xor,CT);function PT(n){return su(n,133)}E.set(g.v128_andnot,PT);function NT(n,r){let e=n.compiler,t=e.module;if(X(n,16)|F(n)|K(n,1))return e.currentType=p.v128,t.unreachable();let i=n.operands,s=e.compileExpression(i[0],p.v128,1);return t.unary(r,s)}function LT(n){return NT(n,66)}E.set(g.v128_not,LT);function BT(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,3))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=r.compileExpression(t[0],p.v128,1),s=r.compileExpression(t[1],p.v128,1),a=r.compileExpression(t[2],p.v128,1);return e.simd_ternary(0,i,s,a)}E.set(g.v128_bitselect,BT);function MT(n){let r=n.compiler,e=r.module;if(X(n,16)|F(n)|K(n,1))return r.currentType=p.bool,e.unreachable();let t=n.operands,i=r.compileExpression(t[0],p.v128,1);return r.currentType=p.bool,e.unary(67,i)}E.set(g.v128_any_true,MT);function sa(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.bool,e.unreachable();let t=n.operands,i=n.typeArguments[0],s=r.compileExpression(t[0],p.v128,1);if(r.currentType=p.bool,i.isValue)switch(i.kind){case 1:case 6:return e.unary(70,s);case 2:case 7:return e.unary(75,s);case 3:case 8:return e.unary(79,s);case 4:case 9:return e.unary(83,s);case 5:case 10:return e.unary(r.options.isWasm64?83:79,s)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.all_true",i.toString()),e.unreachable()}E.set(g.v128_all_true,sa);function aa(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.i32,e.unreachable();let t=n.operands,i=n.typeArguments[0],s=r.compileExpression(t[0],p.v128,1);if(r.currentType=p.i32,i.isValue)switch(i.kind){case 1:case 6:return e.unary(71,s);case 2:case 7:return e.unary(76,s);case 3:case 8:return e.unary(80,s);case 4:case 9:return e.unary(84,s);case 5:case 10:return e.unary(r.options.isWasm64?84:80,s)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.bitmask",i.toString()),e.unreachable()}E.set(g.v128_bitmask,aa);function _x(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=n.typeArguments[0],s=r.compileExpression(t[0],p.v128,1);if(r.currentType=p.v128,i.isValue)switch(i.kind){case 1:case 6:return e.unary(72,s)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.popcnt",i.toString()),e.unreachable()}E.set(g.v128_popcnt,_x);function la(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=n.typeArguments[0],s=r.compileExpression(t[0],p.v128,1);if(r.currentType=p.v128,i.isValue)switch(i.kind){case 1:return e.unary(106,s);case 6:return e.unary(107,s);case 2:return e.unary(108,s);case 7:return e.unary(109,s)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.extadd_pairwise",i.toString()),e.unreachable()}E.set(g.v128_extadd_pairwise,la);function dx(n){let r=n.compiler,e=r.module;if(X(n,16)|de(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=n.typeArguments,s=i?i[0]:p.f64,a=r.compileExpression(t[0],p.v128,1);return r.currentType=p.v128,s.isValue&&s.kind===12?e.unary(130,a):(r.error(203,n.reportNode.typeArgumentsRange,"v128.demote_zero",s.toString()),e.unreachable())}E.set(g.v128_demote_zero,dx);function hx(n){let r=n.compiler,e=r.module;if(X(n,16)|de(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=n.typeArguments,s=i?i[0]:p.f32,a=r.compileExpression(t[0],p.v128,1);return r.currentType=p.v128,s.isValue&&s.kind===11?e.unary(131,a):(r.error(203,n.reportNode.typeArgumentsRange,"v128.promote_low",s.toString()),e.unreachable())}E.set(g.v128_promote_low,hx);function mx(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);return s.isValue&&s.kind===2?e.binary(157,a,l):(r.error(203,n.reportNode.typeArgumentsRange,"v128.q15mulr_sat",s.toString()),e.unreachable())}E.set(g.v128_q15mulr_sat,mx);function gn(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(158,a,l);case 6:return e.binary(160,a,l);case 2:return e.binary(170,a,l);case 7:return e.binary(172,a,l);case 3:return e.binary(177,a,l);case 8:return e.binary(179,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.extmul_low",s.toString()),e.unreachable()}E.set(g.v128_extmul_low,gn);function bn(n){let r=n.compiler,e=r.module;if(X(n,16)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 1:return e.binary(159,a,l);case 6:return e.binary(161,a,l);case 2:return e.binary(171,a,l);case 7:return e.binary(173,a,l);case 3:return e.binary(178,a,l);case 8:return e.binary(180,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.extmul_high",s.toString()),e.unreachable()}E.set(g.v128_extmul_high,bn);function yx(n){let r=n.compiler,e=r.module;if(X(n,4096)|F(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,i=r.compileExpression(t[0],p.v128,1),s=r.compileExpression(t[1],p.v128,1);return e.binary(210,i,s)}E.set(g.v128_relaxed_swizzle,yx);function o_(n){let r=n.compiler,e=r.module;if(X(n,4096)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 5:if(r.options.isWasm64)break;case 3:return e.unary(132,a);case 10:if(r.options.isWasm64)break;case 8:return e.unary(133,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_trunc",s.toString()),e.unreachable()}E.set(g.v128_relaxed_trunc,o_);function u_(n){let r=n.compiler,e=r.module;if(X(n,4096)|Z(n)|K(n,1))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1);if(s.isValue)switch(s.kind){case 5:if(r.options.isWasm64)break;case 3:return e.unary(134,a);case 10:if(r.options.isWasm64)break;case 8:return e.unary(135,a)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_trunc_zero",s.toString()),e.unreachable()}E.set(g.v128_relaxed_trunc_zero,u_);function c_(n){let r=n.compiler,e=r.module;if(X(n,4096)|Z(n)|K(n,3))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1),o=r.compileExpression(t[2],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.simd_ternary(1,a,l,o);case 12:return e.simd_ternary(3,a,l,o)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_madd",s.toString()),e.unreachable()}E.set(g.v128_relaxed_madd,c_);function p_(n){let r=n.compiler,e=r.module;if(X(n,4096)|Z(n)|K(n,3))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1),o=r.compileExpression(t[2],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.simd_ternary(2,a,l,o);case 12:return e.simd_ternary(4,a,l,o)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_nmadd",s.toString()),e.unreachable()}E.set(g.v128_relaxed_nmadd,p_);function oa(n){let r=n.compiler,e=r.module;if(X(n,4096)|Z(n)|K(n,3))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1),o=r.compileExpression(t[2],p.v128,1);if(s.isValue)switch(s.kind){case 1:case 6:return e.simd_ternary(5,a,l,o);case 2:case 7:return e.simd_ternary(6,a,l,o);case 3:case 8:return e.simd_ternary(7,a,l,o);case 4:case 9:return e.simd_ternary(8,a,l,o);case 5:case 10:return e.simd_ternary(r.options.isWasm64?8:7,a,l,o)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_laneselect",s.toString()),e.unreachable()}E.set(g.v128_relaxed_laneselect,oa);function f_(n){let r=n.compiler,e=r.module;if(X(n,4096)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.binary(211,a,l);case 12:return e.binary(213,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_min",s.toString()),e.unreachable()}E.set(g.v128_relaxed_min,f_);function __(n){let r=n.compiler,e=r.module;if(X(n,4096)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);if(s.isValue)switch(s.kind){case 11:return e.binary(212,a,l);case 12:return e.binary(214,a,l)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_max",s.toString()),e.unreachable()}E.set(g.v128_relaxed_max,__);function gx(n){let r=n.compiler,e=r.module;if(X(n,4096)|Z(n)|K(n,2))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);return s.isValue&&s.kind===2?e.binary(215,a,l):(r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_q15mulr",s.toString()),e.unreachable())}E.set(g.v128_relaxed_q15mulr,gx);function bx(n){let r=n.compiler,e=r.module;if(X(n,4096)|K(n,2)|Z(n))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1);return s.kind===2?e.binary(216,a,l):(r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_dot",s.toString()),e.unreachable())}E.set(g.v128_relaxed_dot,bx);function xx(n){let r=n.compiler,e=r.module;if(X(n,4096)|K(n,3)|Z(n))return r.currentType=p.v128,e.unreachable();let t=n.operands,s=n.typeArguments[0],a=r.compileExpression(t[0],p.v128,1),l=r.compileExpression(t[1],p.v128,1),o=r.compileExpression(t[2],p.v128,1);switch(s.kind){case 5:if(r.options.isWasm64)break;case 3:return e.simd_ternary(9,a,l,o)}return r.error(203,n.reportNode.typeArgumentsRange,"v128.relaxed_dot_add",s.toString()),e.unreachable()}E.set(g.v128_relaxed_dot_add,xx);function zT(n){let r=n.compiler,e=r.module;if(F(n)|K(n,1))return r.currentType=p.void,e.unreachable();let t=n.operands,i=r.compileExpression(t[0],p.u32,1);return r.runtimeFeatures|=16,r.currentType=p.void,e.call(g.visit_globals,[i],P.None)}E.set(g.visit_globals,zT);function DT(n){let r=n.compiler,e=r.module;if(F(n)|K(n,2))return r.currentType=p.void,e.unreachable();let t=n.operands,i=r.compileExpression(t[0],r.options.usizeType,1),s=r.compileExpression(t[1],p.u32,1);return r.runtimeFeatures|=32,r.currentType=p.void,e.call(g.visit_members,[i,s],P.None)}E.set(g.visit_members,DT);function GT(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Pf(n)}E.set(g.i32_clz,GT);function UT(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Pf(n)}E.set(g.i64_clz,UT);function VT(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Nf(n)}E.set(g.i32_ctz,VT);function OT(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Nf(n)}E.set(g.i64_ctz,OT);function qT(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Lf(n)}E.set(g.i32_popcnt,qT);function WT(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Lf(n)}E.set(g.i64_popcnt,WT);function KT(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Bf(n)}E.set(g.i32_rotl,KT);function HT(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Bf(n)}E.set(g.i64_rotl,HT);function jT(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Mf(n)}E.set(g.i32_rotr,jT);function QT(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Mf(n)}E.set(g.i64_rotr,QT);function XT(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,zf(n)}E.set(g.f32_abs,XT);function ZT(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,zf(n)}E.set(g.f64_abs,ZT);function $T(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Df(n)}E.set(g.f32_max,$T);function YT(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Df(n)}E.set(g.f64_max,YT);function JT(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Gf(n)}E.set(g.f32_min,JT);function e6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Gf(n)}E.set(g.f64_min,e6);function t6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Uf(n)}E.set(g.f32_ceil,t6);function r6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Uf(n)}E.set(g.f64_ceil,r6);function n6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Vf(n)}E.set(g.f32_floor,n6);function i6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Vf(n)}E.set(g.f64_floor,i6);function s6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Of(n)}E.set(g.f32_copysign,s6);function a6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Of(n)}E.set(g.f64_copysign,a6);function l6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,qf(n)}E.set(g.f32_nearest,l6);function o6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,qf(n)}E.set(g.f64_nearest,o6);function u6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.f32,Ks(n)}E.set(g.i32_reinterpret_f32,u6);function c6(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.f64,Ks(n)}E.set(g.i64_reinterpret_f64,c6);function p6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.i32,Ks(n)}E.set(g.f32_reinterpret_i32,p6);function f6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.i64,Ks(n)}E.set(g.f64_reinterpret_i64,f6);function _6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Wf(n)}E.set(g.f32_sqrt,_6);function d6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Wf(n)}E.set(g.f64_sqrt,d6);function h6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Kf(n)}E.set(g.f32_trunc,h6);function m6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Kf(n)}E.set(g.f64_trunc,m6);function y6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Hs(n)}E.set(g.i32_rem_s,y6);function g6(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.u32,Hs(n)}E.set(g.i32_rem_u,g6);function b6(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Hs(n)}E.set(g.i64_rem_s,b6);function x6(n){return F(n),n.typeArguments=[p.u64],n.contextualType=p.u64,Hs(n)}E.set(g.i64_rem_u,x6);function E6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,js(n)}E.set(g.i32_add,E6);function A6(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,js(n)}E.set(g.i64_add,A6);function T6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,js(n)}E.set(g.f32_add,T6);function S6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,js(n)}E.set(g.f64_add,S6);function v6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Qs(n)}E.set(g.i32_sub,v6);function I6(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Qs(n)}E.set(g.i64_sub,I6);function k6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Qs(n)}E.set(g.f32_sub,k6);function F6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Qs(n)}E.set(g.f64_sub,F6);function w6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Xs(n)}E.set(g.i32_mul,w6);function R6(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Xs(n)}E.set(g.i64_mul,R6);function C6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Xs(n)}E.set(g.f32_mul,C6);function P6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Xs(n)}E.set(g.f64_mul,P6);function N6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,sn(n)}E.set(g.i32_div_s,N6);function L6(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.u32,sn(n)}E.set(g.i32_div_u,L6);function B6(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,sn(n)}E.set(g.i64_div_s,B6);function M6(n){return F(n),n.typeArguments=[p.u64],n.contextualType=p.u64,sn(n)}E.set(g.i64_div_u,M6);function z6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,sn(n)}E.set(g.f32_div,z6);function D6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,sn(n)}E.set(g.f64_div,D6);function G6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Zs(n)}E.set(g.i32_eq,G6);function U6(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i32,Zs(n)}E.set(g.i64_eq,U6);function V6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.i32,Zs(n)}E.set(g.f32_eq,V6);function O6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.i32,Zs(n)}E.set(g.f64_eq,O6);function q6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,$s(n)}E.set(g.i32_ne,q6);function W6(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i32,$s(n)}E.set(g.i64_ne,W6);function K6(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.i32,$s(n)}E.set(g.f32_ne,K6);function H6(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.i32,$s(n)}E.set(g.f64_ne,H6);function j6(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i32,Ue(n)}E.set(g.i32_load8_s,j6);function Q6(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,Ue(n)}E.set(g.i32_load8_u,Q6);function X6(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.i32,Ue(n)}E.set(g.i32_load16_s,X6);function Z6(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,Ue(n)}E.set(g.i32_load16_u,Z6);function $6(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Ue(n)}E.set(g.i32_load,$6);function Y6(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i64,Ue(n)}E.set(g.i64_load8_s,Y6);function J6(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,Ue(n)}E.set(g.i64_load8_u,J6);function eS(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.i64,Ue(n)}E.set(g.i64_load16_s,eS);function tS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,Ue(n)}E.set(g.i64_load16_u,tS);function rS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i64,Ue(n)}E.set(g.i64_load32_s,rS);function nS(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,Ue(n)}E.set(g.i64_load32_u,nS);function iS(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Ue(n)}E.set(g.i64_load,iS);function sS(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,Ue(n)}E.set(g.f32_load,sS);function aS(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,Ue(n)}E.set(g.f64_load,aS);function lS(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i32,n.contextIsExact=!0,Tt(n)}E.set(g.i32_store8,lS);function oS(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.i32,n.contextIsExact=!0,Tt(n)}E.set(g.i32_store16,oS);function uS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,Tt(n)}E.set(g.i32_store,uS);function cS(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i64,n.contextIsExact=!0,Tt(n)}E.set(g.i64_store8,cS);function pS(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.i64,n.contextIsExact=!0,Tt(n)}E.set(g.i64_store16,pS);function fS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i64,n.contextIsExact=!0,Tt(n)}E.set(g.i64_store32,fS);function _S(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,Tt(n)}E.set(g.i64_store,_S);function dS(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,n.contextIsExact=!0,Tt(n)}E.set(g.f32_store,dS);function hS(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,n.contextIsExact=!0,Tt(n)}E.set(g.f64_store,hS);function mS(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,Sr(n)}E.set(g.i32_atomic_load8_u,mS);function yS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,Sr(n)}E.set(g.i32_atomic_load16_u,yS);function gS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,Sr(n)}E.set(g.i32_atomic_load,gS);function bS(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,Sr(n)}E.set(g.i64_atomic_load8_u,bS);function xS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,Sr(n)}E.set(g.i64_atomic_load16_u,xS);function ES(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,Sr(n)}E.set(g.i64_atomic_load32_u,ES);function AS(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,Sr(n)}E.set(g.i64_atomic_load,AS);function TS(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i32,n.contextIsExact=!0,vr(n)}E.set(g.i32_atomic_store8,TS);function SS(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.i32,n.contextIsExact=!0,vr(n)}E.set(g.i32_atomic_store16,SS);function vS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,vr(n)}E.set(g.i32_atomic_store,vS);function IS(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i64,n.contextIsExact=!0,vr(n)}E.set(g.i64_atomic_store8,IS);function kS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,n.contextIsExact=!0,vr(n)}E.set(g.i64_atomic_store16,kS);function FS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i64,n.contextIsExact=!0,vr(n)}E.set(g.i64_atomic_store32,FS);function wS(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,vr(n)}E.set(g.i64_atomic_store,wS);function RS(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,n.contextIsExact=!0,Ir(n)}E.set(g.i32_atomic_rmw8_add_u,RS);function CS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,n.contextIsExact=!0,Ir(n)}E.set(g.i32_atomic_rmw16_add_u,CS);function PS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,Ir(n)}E.set(g.i32_atomic_rmw_add,PS);function NS(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,n.contextIsExact=!0,Ir(n)}E.set(g.i64_atomic_rmw8_add_u,NS);function LS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,n.contextIsExact=!0,Ir(n)}E.set(g.i64_atomic_rmw16_add_u,LS);function BS(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,n.contextIsExact=!0,Ir(n)}E.set(g.i64_atomic_rmw32_add_u,BS);function MS(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,Ir(n)}E.set(g.i64_atomic_rmw_add,MS);function zS(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,n.contextIsExact=!0,kr(n)}E.set(g.i32_atomic_rmw8_sub_u,zS);function DS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,n.contextIsExact=!0,kr(n)}E.set(g.i32_atomic_rmw16_sub_u,DS);function GS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,kr(n)}E.set(g.i32_atomic_rmw_sub,GS);function US(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,n.contextIsExact=!0,kr(n)}E.set(g.i64_atomic_rmw8_sub_u,US);function VS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,n.contextIsExact=!0,kr(n)}E.set(g.i64_atomic_rmw16_sub_u,VS);function OS(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,n.contextIsExact=!0,kr(n)}E.set(g.i64_atomic_rmw32_sub_u,OS);function qS(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,kr(n)}E.set(g.i64_atomic_rmw_sub,qS);function WS(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,n.contextIsExact=!0,Fr(n)}E.set(g.i32_atomic_rmw8_and_u,WS);function KS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,n.contextIsExact=!0,Fr(n)}E.set(g.i32_atomic_rmw16_and_u,KS);function HS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,Fr(n)}E.set(g.i32_atomic_rmw_and,HS);function jS(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,n.contextIsExact=!0,Fr(n)}E.set(g.i64_atomic_rmw8_and_u,jS);function QS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,n.contextIsExact=!0,Fr(n)}E.set(g.i64_atomic_rmw16_and_u,QS);function XS(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,n.contextIsExact=!0,Fr(n)}E.set(g.i64_atomic_rmw32_and_u,XS);function ZS(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,Fr(n)}E.set(g.i64_atomic_rmw_and,ZS);function $S(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,n.contextIsExact=!0,wr(n)}E.set(g.i32_atomic_rmw8_or_u,$S);function YS(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,n.contextIsExact=!0,wr(n)}E.set(g.i32_atomic_rmw16_or_u,YS);function JS(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,wr(n)}E.set(g.i32_atomic_rmw_or,JS);function ev(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,n.contextIsExact=!0,wr(n)}E.set(g.i64_atomic_rmw8_or_u,ev);function tv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,n.contextIsExact=!0,wr(n)}E.set(g.i64_atomic_rmw16_or_u,tv);function rv(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,n.contextIsExact=!0,wr(n)}E.set(g.i64_atomic_rmw32_or_u,rv);function nv(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,wr(n)}E.set(g.i64_atomic_rmw_or,nv);function iv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,n.contextIsExact=!0,Rr(n)}E.set(g.i32_atomic_rmw8_xor_u,iv);function sv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,n.contextIsExact=!0,Rr(n)}E.set(g.i32_atomic_rmw16_xor_u,sv);function av(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,Rr(n)}E.set(g.i32_atomic_rmw_xor,av);function lv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,n.contextIsExact=!0,Rr(n)}E.set(g.i64_atomic_rmw8_xor_u,lv);function ov(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,n.contextIsExact=!0,Rr(n)}E.set(g.i64_atomic_rmw16_xor_u,ov);function uv(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,n.contextIsExact=!0,Rr(n)}E.set(g.i64_atomic_rmw32_xor_u,uv);function cv(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,Rr(n)}E.set(g.i64_atomic_rmw_xor,cv);function pv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,n.contextIsExact=!0,Cr(n)}E.set(g.i32_atomic_rmw8_xchg_u,pv);function fv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,n.contextIsExact=!0,Cr(n)}E.set(g.i32_atomic_rmw16_xchg_u,fv);function _v(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,Cr(n)}E.set(g.i32_atomic_rmw_xchg,_v);function dv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,n.contextIsExact=!0,Cr(n)}E.set(g.i64_atomic_rmw8_xchg_u,dv);function hv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,n.contextIsExact=!0,Cr(n)}E.set(g.i64_atomic_rmw16_xchg_u,hv);function mv(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,n.contextIsExact=!0,Cr(n)}E.set(g.i64_atomic_rmw32_xchg_u,mv);function yv(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,Cr(n)}E.set(g.i64_atomic_rmw_xchg,yv);function gv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,n.contextIsExact=!0,Pr(n)}E.set(g.i32_atomic_rmw8_cmpxchg_u,gv);function bv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,n.contextIsExact=!0,Pr(n)}E.set(g.i32_atomic_rmw16_cmpxchg_u,bv);function xv(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,n.contextIsExact=!0,Pr(n)}E.set(g.i32_atomic_rmw_cmpxchg,xv);function Ev(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i64,n.contextIsExact=!0,Pr(n)}E.set(g.i64_atomic_rmw8_cmpxchg_u,Ev);function Av(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i64,n.contextIsExact=!0,Pr(n)}E.set(g.i64_atomic_rmw16_cmpxchg_u,Av);function Tv(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.i64,n.contextIsExact=!0,Pr(n)}E.set(g.i64_atomic_rmw32_cmpxchg_u,Tv);function Sv(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,n.contextIsExact=!0,Pr(n)}E.set(g.i64_atomic_rmw_cmpxchg,Sv);function vv(n){return F(n),n.typeArguments=[p.i32],Hf(n)}E.set(g.memory_atomic_wait32,vv);function Iv(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i32,Hf(n)}E.set(g.memory_atomic_wait64,Iv);function kv(n){return F(n),n.typeArguments=[p.v128],n.contextualType=p.v128,Ue(n)}E.set(g.v128_load,kv);function Fv(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,un(n)}E.set(g.v128_load8x8_s,Fv);function wv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,un(n)}E.set(g.v128_load8x8_u,wv);function Rv(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,un(n)}E.set(g.v128_load16x4_s,Rv);function Cv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,un(n)}E.set(g.v128_load16x4_u,Cv);function Pv(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,un(n)}E.set(g.v128_load32x2_s,Pv);function Nv(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,un(n)}E.set(g.v128_load32x2_u,Nv);function Lv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,Ys(n)}E.set(g.v128_load8_splat,Lv);function Bv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,Ys(n)}E.set(g.v128_load16_splat,Bv);function Mv(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,Ys(n)}E.set(g.v128_load32_splat,Mv);function zv(n){return F(n),n.typeArguments=[p.u64],n.contextualType=p.v128,Ys(n)}E.set(g.v128_load64_splat,zv);function Dv(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,Qf(n)}E.set(g.v128_load32_zero,Dv);function Gv(n){return F(n),n.typeArguments=[p.u64],n.contextualType=p.v128,Qf(n)}E.set(g.v128_load64_zero,Gv);function Uv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,Js(n)}E.set(g.v128_load8_lane,Uv);function Vv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,Js(n)}E.set(g.v128_load16_lane,Vv);function Ov(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,Js(n)}E.set(g.v128_load32_lane,Ov);function qv(n){return F(n),n.typeArguments=[p.u64],n.contextualType=p.v128,Js(n)}E.set(g.v128_load64_lane,qv);function Wv(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,ea(n)}E.set(g.v128_store8_lane,Wv);function Kv(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,ea(n)}E.set(g.v128_store16_lane,Kv);function Hv(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,ea(n)}E.set(g.v128_store32_lane,Hv);function jv(n){return F(n),n.typeArguments=[p.u64],n.contextualType=p.v128,ea(n)}E.set(g.v128_store64_lane,jv);function Qv(n){return F(n),n.typeArguments=[p.v128],n.contextualType=p.v128,n.contextIsExact=!0,Tt(n)}E.set(g.v128_store,Qv);function Xv(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,an(n)}E.set(g.i8x16_splat,Xv);function Zv(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i32,ar(n)}E.set(g.i8x16_extract_lane_s,Zv);function $v(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.i32,ar(n)}E.set(g.i8x16_extract_lane_u,$v);function Yv(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,ln(n)}E.set(g.i8x16_replace_lane,Yv);function Jv(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,cn(n)}E.set(g.i8x16_add,Jv);function eI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,pn(n)}E.set(g.i8x16_sub,eI);function tI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,lr(n)}E.set(g.i8x16_min_s,tI);function rI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,lr(n)}E.set(g.i8x16_min_u,rI);function nI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,or(n)}E.set(g.i8x16_max_s,nI);function iI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,or(n)}E.set(g.i8x16_max_u,iI);function sI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,Yf(n)}E.set(g.i8x16_avgr_u,sI);function aI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,hn(n)}E.set(g.i8x16_abs,aI);function lI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,dn(n)}E.set(g.i8x16_neg,lI);function oI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,ta(n)}E.set(g.i8x16_add_sat_s,oI);function uI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,ta(n)}E.set(g.i8x16_add_sat_u,uI);function cI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,ra(n)}E.set(g.i8x16_sub_sat_s,cI);function pI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,ra(n)}E.set(g.i8x16_sub_sat_u,pI);function fI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,ia(n)}E.set(g.i8x16_shl,fI);function _I(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,ur(n)}E.set(g.i8x16_shr_s,_I);function dI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,ur(n)}E.set(g.i8x16_shr_u,dI);function hI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i32,sa(n)}E.set(g.i8x16_all_true,hI);function mI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.i32,aa(n)}E.set(g.i8x16_bitmask,mI);function yI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,_x(n)}E.set(g.i8x16_popcnt,yI);function gI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,fn(n)}E.set(g.i8x16_eq,gI);function bI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,_n(n)}E.set(g.i8x16_ne,bI);function xI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,zt(n)}E.set(g.i8x16_lt_s,xI);function EI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,zt(n)}E.set(g.i8x16_lt_u,EI);function AI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,Dt(n)}E.set(g.i8x16_le_s,AI);function TI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,Dt(n)}E.set(g.i8x16_le_u,TI);function SI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,Gt(n)}E.set(g.i8x16_gt_s,SI);function vI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,Gt(n)}E.set(g.i8x16_gt_u,vI);function II(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,Ut(n)}E.set(g.i8x16_ge_s,II);function kI(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,Ut(n)}E.set(g.i8x16_ge_u,kI);function FI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,na(n)}E.set(g.i8x16_narrow_i16x8_s,FI);function wI(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,na(n)}E.set(g.i8x16_narrow_i16x8_u,wI);function RI(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,on(n)}E.set(g.i8x16_shuffle,RI);function CI(n){return F(n),n.typeArguments=null,n.contextualType=p.v128,px(n)}E.set(g.i8x16_swizzle,CI);function PI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,an(n)}E.set(g.i16x8_splat,PI);function NI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.i32,ar(n)}E.set(g.i16x8_extract_lane_s,NI);function LI(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.i32,ar(n)}E.set(g.i16x8_extract_lane_u,LI);function BI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,ln(n)}E.set(g.i16x8_replace_lane,BI);function MI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,cn(n)}E.set(g.i16x8_add,MI);function zI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,pn(n)}E.set(g.i16x8_sub,zI);function DI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,ci(n)}E.set(g.i16x8_mul,DI);function GI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,lr(n)}E.set(g.i16x8_min_s,GI);function UI(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,lr(n)}E.set(g.i16x8_min_u,UI);function VI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,or(n)}E.set(g.i16x8_max_s,VI);function OI(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,or(n)}E.set(g.i16x8_max_u,OI);function qI(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,Yf(n)}E.set(g.i16x8_avgr_u,qI);function WI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,hn(n)}E.set(g.i16x8_abs,WI);function KI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,dn(n)}E.set(g.i16x8_neg,KI);function HI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,ta(n)}E.set(g.i16x8_add_sat_s,HI);function jI(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,ta(n)}E.set(g.i16x8_add_sat_u,jI);function QI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,ra(n)}E.set(g.i16x8_sub_sat_s,QI);function XI(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,ra(n)}E.set(g.i16x8_sub_sat_u,XI);function ZI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,ia(n)}E.set(g.i16x8_shl,ZI);function $I(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,ur(n)}E.set(g.i16x8_shr_s,$I);function YI(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,ur(n)}E.set(g.i16x8_shr_u,YI);function JI(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.i32,sa(n)}E.set(g.i16x8_all_true,JI);function e4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.i32,aa(n)}E.set(g.i16x8_bitmask,e4);function t4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,fn(n)}E.set(g.i16x8_eq,t4);function r4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,_n(n)}E.set(g.i16x8_ne,r4);function n4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,zt(n)}E.set(g.i16x8_lt_s,n4);function i4(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,zt(n)}E.set(g.i16x8_lt_u,i4);function s4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,Dt(n)}E.set(g.i16x8_le_s,s4);function a4(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,Dt(n)}E.set(g.i16x8_le_u,a4);function l4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,Gt(n)}E.set(g.i16x8_gt_s,l4);function o4(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,Gt(n)}E.set(g.i16x8_gt_u,o4);function u4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,Ut(n)}E.set(g.i16x8_ge_s,u4);function c4(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,Ut(n)}E.set(g.i16x8_ge_u,c4);function p4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,na(n)}E.set(g.i16x8_narrow_i32x4_s,p4);function f4(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,na(n)}E.set(g.i16x8_narrow_i32x4_u,f4);function _4(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,mn(n)}E.set(g.i16x8_extend_low_i8x16_s,_4);function d4(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,mn(n)}E.set(g.i16x8_extend_low_i8x16_u,d4);function h4(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,yn(n)}E.set(g.i16x8_extend_high_i8x16_s,h4);function m4(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,yn(n)}E.set(g.i16x8_extend_high_i8x16_u,m4);function y4(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,la(n)}E.set(g.i16x8_extadd_pairwise_i8x16_s,y4);function g4(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,la(n)}E.set(g.i16x8_extadd_pairwise_i8x16_u,g4);function b4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,mx(n)}E.set(g.i16x8_q15mulr_sat_s,b4);function x4(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,gn(n)}E.set(g.i16x8_extmul_low_i8x16_s,x4);function E4(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,gn(n)}E.set(g.i16x8_extmul_low_i8x16_u,E4);function A4(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,bn(n)}E.set(g.i16x8_extmul_high_i8x16_s,A4);function T4(n){return F(n),n.typeArguments=[p.u8],n.contextualType=p.v128,bn(n)}E.set(g.i16x8_extmul_high_i8x16_u,T4);function S4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,on(n)}E.set(g.i16x8_shuffle,S4);function v4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,an(n)}E.set(g.i32x4_splat,v4);function I4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,ar(n)}E.set(g.i32x4_extract_lane,I4);function k4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,ln(n)}E.set(g.i32x4_replace_lane,k4);function F4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,cn(n)}E.set(g.i32x4_add,F4);function w4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,pn(n)}E.set(g.i32x4_sub,w4);function R4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,ci(n)}E.set(g.i32x4_mul,R4);function C4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,lr(n)}E.set(g.i32x4_min_s,C4);function P4(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,lr(n)}E.set(g.i32x4_min_u,P4);function N4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,or(n)}E.set(g.i32x4_max_s,N4);function L4(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,or(n)}E.set(g.i32x4_max_u,L4);function B4(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,fx(n)}E.set(g.i32x4_dot_i16x8_s,B4);function M4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,hn(n)}E.set(g.i32x4_abs,M4);function z4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,dn(n)}E.set(g.i32x4_neg,z4);function D4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,ia(n)}E.set(g.i32x4_shl,D4);function G4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,ur(n)}E.set(g.i32x4_shr_s,G4);function U4(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,ur(n)}E.set(g.i32x4_shr_u,U4);function V4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,sa(n)}E.set(g.i32x4_all_true,V4);function O4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.i32,aa(n)}E.set(g.i32x4_bitmask,O4);function q4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,fn(n)}E.set(g.i32x4_eq,q4);function W4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,_n(n)}E.set(g.i32x4_ne,W4);function K4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,zt(n)}E.set(g.i32x4_lt_s,K4);function H4(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,zt(n)}E.set(g.i32x4_lt_u,H4);function j4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,Dt(n)}E.set(g.i32x4_le_s,j4);function Q4(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,Dt(n)}E.set(g.i32x4_le_u,Q4);function X4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,Gt(n)}E.set(g.i32x4_gt_s,X4);function Z4(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,Gt(n)}E.set(g.i32x4_gt_u,Z4);function $4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,Ut(n)}E.set(g.i32x4_ge_s,$4);function Y4(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,Ut(n)}E.set(g.i32x4_ge_u,Y4);function J4(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,a_(n)}E.set(g.i32x4_trunc_sat_f32x4_s,J4);function e0(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,a_(n)}E.set(g.i32x4_trunc_sat_f32x4_u,e0);function t0(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,l_(n)}E.set(g.i32x4_trunc_sat_f64x2_s_zero,t0);function r0(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,l_(n)}E.set(g.i32x4_trunc_sat_f64x2_u_zero,r0);function n0(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,mn(n)}E.set(g.i32x4_extend_low_i16x8_s,n0);function i0(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,mn(n)}E.set(g.i32x4_extend_low_i16x8_u,i0);function s0(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,yn(n)}E.set(g.i32x4_extend_high_i16x8_s,s0);function a0(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,yn(n)}E.set(g.i32x4_extend_high_i16x8_u,a0);function l0(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,la(n)}E.set(g.i32x4_extadd_pairwise_i16x8_s,l0);function o0(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,la(n)}E.set(g.i32x4_extadd_pairwise_i16x8_u,o0);function u0(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,gn(n)}E.set(g.i32x4_extmul_low_i16x8_s,u0);function c0(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,gn(n)}E.set(g.i32x4_extmul_low_i16x8_u,c0);function p0(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,bn(n)}E.set(g.i32x4_extmul_high_i16x8_s,p0);function f0(n){return F(n),n.typeArguments=[p.u16],n.contextualType=p.v128,bn(n)}E.set(g.i32x4_extmul_high_i16x8_u,f0);function _0(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,on(n)}E.set(g.i32x4_shuffle,_0);function d0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,an(n)}E.set(g.i64x2_splat,d0);function h0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i64,ar(n)}E.set(g.i64x2_extract_lane,h0);function m0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,ln(n)}E.set(g.i64x2_replace_lane,m0);function y0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,cn(n)}E.set(g.i64x2_add,y0);function g0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,pn(n)}E.set(g.i64x2_sub,g0);function b0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,ci(n)}E.set(g.i64x2_mul,b0);function x0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,hn(n)}E.set(g.i64x2_abs,x0);function E0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,dn(n)}E.set(g.i64x2_neg,E0);function A0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,ia(n)}E.set(g.i64x2_shl,A0);function T0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,ur(n)}E.set(g.i64x2_shr_s,T0);function S0(n){return F(n),n.typeArguments=[p.u64],n.contextualType=p.v128,ur(n)}E.set(g.i64x2_shr_u,S0);function v0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i32,sa(n)}E.set(g.i64x2_all_true,v0);function I0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.i32,aa(n)}E.set(g.i64x2_bitmask,I0);function k0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,fn(n)}E.set(g.i64x2_eq,k0);function F0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,_n(n)}E.set(g.i64x2_ne,F0);function w0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,zt(n)}E.set(g.i64x2_lt_s,w0);function R0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,Dt(n)}E.set(g.i64x2_le_s,R0);function C0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,Gt(n)}E.set(g.i64x2_gt_s,C0);function P0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,Ut(n)}E.set(g.i64x2_ge_s,P0);function N0(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,mn(n)}E.set(g.i64x2_extend_low_i32x4_s,N0);function L0(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,mn(n)}E.set(g.i64x2_extend_low_i32x4_u,L0);function B0(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,yn(n)}E.set(g.i64x2_extend_high_i32x4_s,B0);function M0(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,yn(n)}E.set(g.i64x2_extend_high_i32x4_u,M0);function z0(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,gn(n)}E.set(g.i64x2_extmul_low_i32x4_s,z0);function D0(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,gn(n)}E.set(g.i64x2_extmul_low_i32x4_u,D0);function G0(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,bn(n)}E.set(g.i64x2_extmul_high_i32x4_s,G0);function U0(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,bn(n)}E.set(g.i64x2_extmul_high_i32x4_u,U0);function V0(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,on(n)}E.set(g.i64x2_shuffle,V0);function O0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,an(n)}E.set(g.f32x4_splat,O0);function q0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.f32,ar(n)}E.set(g.f32x4_extract_lane,q0);function W0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,ln(n)}E.set(g.f32x4_replace_lane,W0);function K0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,cn(n)}E.set(g.f32x4_add,K0);function H0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,pn(n)}E.set(g.f32x4_sub,H0);function j0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,ci(n)}E.set(g.f32x4_mul,j0);function Q0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,Xf(n)}E.set(g.f32x4_div,Q0);function X0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,dn(n)}E.set(g.f32x4_neg,X0);function Z0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,lr(n)}E.set(g.f32x4_min,Z0);function $0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,or(n)}E.set(g.f32x4_max,$0);function Y0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,Zf(n)}E.set(g.f32x4_pmin,Y0);function J0(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,$f(n)}E.set(g.f32x4_pmax,J0);function ek(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,hn(n)}E.set(g.f32x4_abs,ek);function tk(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,Jf(n)}E.set(g.f32x4_sqrt,tk);function rk(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,e_(n)}E.set(g.f32x4_ceil,rk);function nk(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,t_(n)}E.set(g.f32x4_floor,nk);function ik(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,r_(n)}E.set(g.f32x4_trunc,ik);function sk(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,n_(n)}E.set(g.f32x4_nearest,sk);function ak(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,fn(n)}E.set(g.f32x4_eq,ak);function lk(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,_n(n)}E.set(g.f32x4_ne,lk);function ok(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,zt(n)}E.set(g.f32x4_lt,ok);function uk(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,Dt(n)}E.set(g.f32x4_le,uk);function ck(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,Gt(n)}E.set(g.f32x4_gt,ck);function pk(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,Ut(n)}E.set(g.f32x4_ge,pk);function fk(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,i_(n)}E.set(g.f32x4_convert_i32x4_s,fk);function _k(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,i_(n)}E.set(g.f32x4_convert_i32x4_u,_k);function dk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,dx(n)}E.set(g.f32x4_demote_f64x2_zero,dk);function hk(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,on(n)}E.set(g.f32x4_shuffle,hk);function mk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,an(n)}E.set(g.f64x2_splat,mk);function yk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.f64,ar(n)}E.set(g.f64x2_extract_lane,yk);function gk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,ln(n)}E.set(g.f64x2_replace_lane,gk);function bk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,cn(n)}E.set(g.f64x2_add,bk);function xk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,pn(n)}E.set(g.f64x2_sub,xk);function Ek(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,ci(n)}E.set(g.f64x2_mul,Ek);function Ak(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,Xf(n)}E.set(g.f64x2_div,Ak);function Tk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,dn(n)}E.set(g.f64x2_neg,Tk);function Sk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,lr(n)}E.set(g.f64x2_min,Sk);function vk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,or(n)}E.set(g.f64x2_max,vk);function Ik(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,Zf(n)}E.set(g.f64x2_pmin,Ik);function kk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,$f(n)}E.set(g.f64x2_pmax,kk);function Fk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,hn(n)}E.set(g.f64x2_abs,Fk);function wk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,Jf(n)}E.set(g.f64x2_sqrt,wk);function Rk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,e_(n)}E.set(g.f64x2_ceil,Rk);function Ck(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,t_(n)}E.set(g.f64x2_floor,Ck);function Pk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,r_(n)}E.set(g.f64x2_trunc,Pk);function Nk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,n_(n)}E.set(g.f64x2_nearest,Nk);function Lk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,fn(n)}E.set(g.f64x2_eq,Lk);function Bk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,_n(n)}E.set(g.f64x2_ne,Bk);function Mk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,zt(n)}E.set(g.f64x2_lt,Mk);function zk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,Dt(n)}E.set(g.f64x2_le,zk);function Dk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,Gt(n)}E.set(g.f64x2_gt,Dk);function Gk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,Ut(n)}E.set(g.f64x2_ge,Gk);function Uk(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,s_(n)}E.set(g.f64x2_convert_low_i32x4_s,Uk);function Vk(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,s_(n)}E.set(g.f64x2_convert_low_i32x4_u,Vk);function Ok(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,hx(n)}E.set(g.f64x2_promote_low_f32x4,Ok);function qk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,on(n)}E.set(g.f64x2_shuffle,qk);function Wk(n){return F(n),n.typeArguments=null,n.contextualType=p.v128,yx(n)}E.set(g.i8x16_relaxed_swizzle,Wk);function Kk(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,o_(n)}E.set(g.i32x4_relaxed_trunc_f32x4_s,Kk);function Hk(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,o_(n)}E.set(g.i32x4_relaxed_trunc_f32x4_u,Hk);function jk(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,u_(n)}E.set(g.i32x4_relaxed_trunc_f64x2_s_zero,jk);function Qk(n){return F(n),n.typeArguments=[p.u32],n.contextualType=p.v128,u_(n)}E.set(g.i32x4_relaxed_trunc_f64x2_u_zero,Qk);function Xk(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,c_(n)}E.set(g.f32x4_relaxed_madd,Xk);function Zk(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,p_(n)}E.set(g.f32x4_relaxed_nmadd,Zk);function $k(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,c_(n)}E.set(g.f64x2_relaxed_madd,$k);function Yk(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,p_(n)}E.set(g.f64x2_relaxed_nmadd,Yk);function Jk(n){return F(n),n.typeArguments=[p.i8],n.contextualType=p.v128,oa(n)}E.set(g.i8x16_relaxed_laneselect,Jk);function e3(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,oa(n)}E.set(g.i16x8_relaxed_laneselect,e3);function t3(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,oa(n)}E.set(g.i32x4_relaxed_laneselect,t3);function r3(n){return F(n),n.typeArguments=[p.i64],n.contextualType=p.v128,oa(n)}E.set(g.i64x2_relaxed_laneselect,r3);function n3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,f_(n)}E.set(g.f32x4_relaxed_min,n3);function i3(n){return F(n),n.typeArguments=[p.f32],n.contextualType=p.v128,__(n)}E.set(g.f32x4_relaxed_max,i3);function s3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,f_(n)}E.set(g.f64x2_relaxed_min,s3);function a3(n){return F(n),n.typeArguments=[p.f64],n.contextualType=p.v128,__(n)}E.set(g.f64x2_relaxed_max,a3);function l3(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,gx(n)}E.set(g.i16x8_relaxed_q15mulr_s,l3);function o3(n){return F(n),n.typeArguments=[p.i16],n.contextualType=p.v128,bx(n)}E.set(g.i16x8_relaxed_dot_i8x16_i7x16_s,o3);function u3(n){return F(n),n.typeArguments=[p.i32],n.contextualType=p.v128,xx(n)}E.set(g.i32x4_relaxed_dot_i8x16_i7x16_add_s,u3);function Ex(n){let r=n.module,e=new Array,t=n.options.sizeTypeRef,i=assert(n.program.visitInstance);n.compileFunction(i,!0);for(let s=Map_values(n.program.elementsByName),a=0,l=s.length;a<l;++a){let o=unchecked(s[a]);if(o.kind!=0)continue;let u=o,f=u.type.getClass();if(f&&!f.hasDecorator(16)&&u.is(8388608))if(u.is(33554432)){let _=u.constantIntegerValue;(i64_low(_)||i64_high(_))&&e.push(r.call(i.internalName,[n.options.isWasm64?r.i64(i64_low(_),i64_high(_)):r.i32(i64_low(_)),r.local_get(0,P.I32)],P.None))}else e.push(r.if(r.local_tee(1,r.global_get(u.internalName,t),!1),r.call(i.internalName,[r.local_get(1,t),r.local_get(0,P.I32)],P.None)))}r.addFunction(g.visit_globals,P.I32,P.None,[t],e.length?r.block(null,e):r.nop())}function Ax(n,r){if(assert(r.type.isManaged),r.visitRef)return;let e=n.program,t=n.module,i=e.options.usizeType,s=i.toRef(),a=i.byteSize,l=assert(e.visitInstance),o=new Array,u=r.base;u&&o.push(t.call(`${u.internalName}~visit`,[t.local_get(0,s),t.local_get(1,P.I32)],P.None));let c=!1;if(r.isDeclaredInLibrary){let _=r.getMember("__visit");if(_){assert(_.kind==4);let d=e.resolver.resolveFunction(_,null);if(!d||!n.compileFunction(d))o.push(t.unreachable());else{let m=d.signature,h=assert(m.thisType);assert(m.parameterTypes.length==1&&m.parameterTypes[0]==p.u32&&m.returnType==p.void&&r.type.isStrictlyAssignableTo(h)),o.push(t.call(d.internalName,[t.local_get(0,s),t.local_get(1,P.I32)],P.None))}c=!0}}let f=!1;if(!c){let _=r.members;if(_)for(let d=Map_values(_),m=0,h=d.length;m<h;++m){let b=unchecked(d[m]);if(b.kind!=10)continue;let A=b.instance;if(!A)continue;let S=A.type;if(!A.isField||A.getBoundClassOrInterface()!=r||!S.isManaged)continue;let k=A.memoryOffset;assert(k>=0),f=!0,o.push(t.call(l.internalName,[t.load(a,!1,t.local_get(0,s),s,k),t.local_get(1,P.I32)],P.None))}}r.visitRef=t.addFunction(`${r.internalName}~visit`,it([s,P.I32]),P.None,f?[s]:null,t.flatten(o,P.None)),u&&u.type.isManaged&&Ax(n,u)}function Tx(n){let r=n.program,e=n.module,i=r.options.usizeType.toRef(),s=r.managedClasses,a=assert(r.visitInstance);n.compileFunction(a,!0);let l=new Array,o=new Array,u=0;for(let f=Map_keys(s),_=0,d=f.length;_<d;++_){let m=f[_];assert(m==u++);let h=assert(s.get(m));l[_]=h.internalName,h.isPointerfree?o[_]=e.return():(o[_]=e.block(null,[e.call(`${h.internalName}~visit`,[e.local_get(0,i),e.local_get(1,P.I32)],P.None),e.return()],P.None),Ax(n,h))}let c=e.block(l[0],[e.switch(l,"invalid",e.load(4,!1,i==P.I64?e.binary(26,e.local_get(0,i),e.i64(8)):e.binary(1,e.local_get(0,i),e.i32(8)),P.I32,0))],P.None);for(let f=0,_=l.length-1;f<_;++f)c=e.block(l[f+1],[c,o[f]],P.None);c=e.block("invalid",[c,o[l.length-1]],P.None),e.addFunction(g.visit_members,it([i,P.I32]),P.None,null,e.flatten([c,e.unreachable()]))}function li(n){let r=64*(1<<n.alignLog2);return n.is(1)&&(r|=2048),n.is(8)&&(r|=4096),n.is(512)&&(r|=8192),n.isManaged&&(r|=16384),r/64}function Sx(n){let r=n.program,e=n.module,t=r.managedClasses,i=t.size,s=4+4*i,a=new Uint8Array(s);Se(i,a,0);let l=4,o=r.arrayBufferViewInstance,u=o.prototype,c=r.arrayPrototype,f=r.setPrototype,_=r.mapPrototype,d=r.staticArrayPrototype,m=0;for(let A=Map_keys(t),S=0,k=A.length;S<k;++S){let w=unchecked(A[S]),R=assert(t.get(w));assert(w==m++);let C=0;if(R.isPointerfree&&(C|=32),R!=o&&R.extendsPrototype(u)){let M=R.getArrayValueType();C|=1,C|=64*li(M)}else if(R.extendsPrototype(c)){let M=R.getArrayValueType();C|=2,C|=64*li(M)}else if(R.extendsPrototype(f)){let M=assert(R.getTypeArgumentsTo(f));assert(M.length==1),C|=8,C|=64*li(M[0])}else if(R.extendsPrototype(_)){let M=assert(R.getTypeArgumentsTo(_));assert(M.length==2),C|=16,C|=32768*li(M[0]),C|=64*li(M[1])}else if(R.extendsPrototype(d)){let M=R.getArrayValueType();C|=4,C|=64*li(M)}Se(C,a,l),l+=4,R.rttiFlags=C}assert(l==s);let h=r.options.usizeType,b=n.addAlignedMemorySegment(a);if(h.size==8){let A=b.offset;e.addGlobal(g.rtti_base,P.I64,!1,e.i64(i64_low(A),i64_high(A)))}else e.addGlobal(g.rtti_base,P.I32,!1,e.i32(i64_low(b.offset)))}function Ve(n){let r=n.compiler,e=n.operands,t=n.typeArguments;if(oi=0,e.length==0)return!t||t.length!=1?(r.error(2558,n.reportNode.typeArgumentsRange,"1",t?t.length.toString():"0"),null):t[0];if(e.length==1){if(t&&t.length>0){if(t.length>1)return r.error(2558,n.reportNode.typeArgumentsRange,"1",t.length.toString()),null;oi=r.compileExpression(e[0],t[0],1)}else oi=r.compileExpression(e[0],p.auto);return r.currentType}return t&&t.length>1&&r.error(2558,n.reportNode.typeArgumentsRange,"1",t.length.toString()),r.error(2554,n.reportNode.argumentsRange,"1",e.length.toString()),null}function ke(n,r){let e=n.compiler.module;return oi&&Wo(oi,e.ref)&&(r=e.block(null,[e.maybeDrop(oi),r],fe(r))),r}function _t(n,r){let e=r.module,t;if(r.options.isWasm64){let i=r.compileExpression(n,p.usize64,1),s=e.runExpression(i,1);s?(assert(Ge(s)==0),t=Ne(s)):(r.error(220,n.range),t=-1)}else{let i=r.compileExpression(n,p.usize32,1),s=e.runExpression(i,1);s?t=ae(s):(r.error(220,n.range),t=-1)}return t}function ir(n,r,e){let t=_t(n,e);return t<0?t:t<1||r>16?(e.error(222,n.range,"Alignment","1",r.toString()),-1):Hr(t)?t:(e.error(223,n.range,"Alignment"),-1)}function X(n,r){let e=n.compiler;return e.options.hasFeature(r)?0:(e.error(103,n.reportNode.range,Gn(r)),1)}function Z(n,r=!1){let e=n.compiler,t=n.typeArguments;if(t){let i=t.length;if(i==1)return 0;assert(i),r&&(e.currentType=t[0]),e.error(2558,n.reportNode.typeArgumentsRange,"1",i.toString())}else e.error(2558,n.reportNode.range,"1","0");return 1}function de(n,r=!1){let e=n.typeArguments;if(e){let t=n.compiler,i=e.length;return i==1?0:(assert(i),r&&(t.currentType=e[0]),t.error(2558,n.reportNode.typeArgumentsRange,"1",i.toString()),1)}return 0}function F(n){if(n.typeArguments){let e=n.prototype;return e.program.error(2315,n.reportNode.typeArgumentsRange,e.internalName),1}return 0}function K(n,r){let e=n.operands;return e.length!=r?(n.compiler.error(2554,n.reportNode.range,r.toString(),e.length.toString()),1):0}function Le(n,r,e){let i=n.operands.length;return i<r?(n.compiler.error(2555,n.reportNode.range,r.toString(),i.toString()),1):i>e?(n.compiler.error(2554,n.reportNode.range,e.toString(),i.toString()),1):0}function nn(n,r,e){let t=n.module;if(e!=p.auto&&e.isIntegerValue)switch(e.kind){case 3:{if(i64_is_i32(r))return n.currentType=p.i32,t.i32(i64_low(r));break}case 8:{if(i64_is_u32(r))return n.currentType=p.u32,t.i32(i64_low(r));break}case 4:case 9:return n.currentType=e,t.i64(i64_low(r),i64_high(r))}return n.options.isWasm64?(n.currentType=p.usize64,t.i64(i64_low(r),i64_high(r))):(n.currentType=p.usize32,assert(!i64_high(r)),t.i32(i64_low(r)))}var au=class{constructor(r,e){this.discriminator=r;this.recordExpression=e}},vx=null;function lu(){let n=vx;return n==null&&(vx=n=new Map),n}var m_=class{constructor(){this.stack=new Array;this._currentExpression=0}get currentExpression(){let r=this._currentExpression;if(!r)throw new Error("not walking expressions");return r}get parentExpressionOrNull(){let r=this.stack,e=r.length;return e?r[e-1]:0}visitBlock(r){}visitIf(r){}visitLoop(r){}visitBreak(r){}visitSwitch(r){}visitCallPre(r){}visitCall(r){}visitCallIndirectPre(r){}visitCallIndirect(r){}visitLocalGet(r){}visitLocalSet(r){}visitGlobalGet(r){}visitGlobalSet(r){}visitLoad(r){}visitStore(r){}visitConst(r){}visitUnary(r){}visitBinary(r){}visitSelect(r){}visitDrop(r){}visitReturn(r){}visitMemorySize(r){}visitMemoryGrow(r){}visitNop(r){}visitUnreachable(r){}visitAtomicRMW(r){}visitAtomicCmpxchg(r){}visitAtomicWait(r){}visitAtomicNotify(r){}visitAtomicFence(r){}visitSIMDExtract(r){}visitSIMDReplace(r){}visitSIMDShuffle(r){}visitSIMDTernary(r){}visitSIMDShift(r){}visitSIMDLoad(r){}visitSIMDLoadStoreLane(r){}visitMemoryInit(r){}visitDataDrop(r){}visitMemoryCopy(r){}visitMemoryFill(r){}visitPop(r){}visitRefNull(r){}visitRefIsNull(r){}visitRefFunc(r){}visitRefEq(r){}visitTry(r){}visitThrow(r){}visitRethrow(r){}visitTupleMake(r){}visitTupleExtract(r){}visitRefI31(r){}visitI31Get(r){}visitCallRef(r){}visitRefTest(r){}visitRefCast(r){}visitBrOn(r){}visitStructNew(r){}visitStructGet(r){}visitStructSet(r){}visitArrayNew(r){}visitArrayNewFixed(r){}visitArrayGet(r){}visitArraySet(r){}visitArrayLen(r){}visitArrayCopy(r){}visitRefAs(r){}visitStringNew(r){}visitStringConst(r){}visitStringMeasure(r){}visitStringEncode(r){}visitStringConcat(r){}visitStringEq(r){}visitStringAs(r){}visitStringWTF8Advance(r){}visitStringWTF16Get(r){}visitStringIterNext(r){}visitStringIterMove(r){}visitStringSliceWTF(r){}visitStringSliceIter(r){}visitName(r){}visitLabel(r){}visitIndex(r){}visitTag(r){}visit(r){let e=this._currentExpression;switch(this._currentExpression=assert(r),Kt(r)){case 1:{this.stack.push(r);let t=Pa(r);t&&this.visitLabel(t);for(let i=0,s=Pi(r);i<s;++i)this.visit(Ni(r,i));assert(this.stack.pop()==r),this.visitBlock(r);break}case 2:{this.stack.push(r),this.visit(Li(r)),this.visit(Bi(r));let t=Mi(r);t&&this.visit(t),assert(this.stack.pop()==r),this.visitIf(r);break}case 3:{this.stack.push(r);let t=Na(r);t&&this.visitLabel(t),this.visit(zi(r)),assert(this.stack.pop()==r),this.visitLoop(r);break}case 4:{this.stack.push(r),this.visitLabel(La(r));let t=Di(r);t&&this.visit(t);let i=Uu(r);i&&this.visit(i),assert(this.stack.pop()==r),this.visitBreak(r);break}case 5:{this.stack.push(r);let t=Bd(r);t&&this.visitLabel(t);let i=Nd(r);for(let a=0;a<i;++a)this.visitLabel(Ld(r,a));this.visit(Vu(r));let s=Ou(r);s&&this.visit(s),assert(this.stack.pop()==r),this.visitSwitch(r);break}case 6:{this.visitCallPre(r),this.stack.push(r),this.visitName(Cn(r));let t=hr(r);for(let i=0;i<t;++i)this.visit(mr(r,i));assert(this.stack.pop()==r),this.visitCall(r);break}case 7:{this.visitCallIndirectPre(r),this.stack.push(r),this.visit(qu(r));for(let t=0,i=Gi(r);t<i;++t)this.visit(Ui(r,t));assert(this.stack.pop()==r),this.visitCallIndirect(r);break}case 8:{this.stack.push(r),this.visitIndex(za(r)),assert(this.stack.pop()==r),this.visitLocalGet(r);break}case 9:{this.stack.push(r),this.visitIndex(Pn(r)),this.visit(Gr(r)),assert(this.stack.pop()==r),this.visitLocalSet(r);break}case 10:{this.stack.push(r),this.visitName(Ua(r)),assert(this.stack.pop()==r),this.visitGlobalGet(r);break}case 11:{this.stack.push(r),this.visitName(Qd(r)),this.visit(Wu(r)),assert(this.stack.pop()==r),this.visitGlobalSet(r);break}case 12:{this.stack.push(r),this.visit(Oi(r)),assert(this.stack.pop()==r),this.visitLoad(r);break}case 13:{this.stack.push(r),this.visit(Ur(r)),this.visit(qi(r)),assert(this.stack.pop()==r),this.visitStore(r);break}case 14:{this.visitConst(r);break}case 15:{this.stack.push(r),this.visit(Wi(r)),assert(this.stack.pop()==r),this.visitUnary(r);break}case 16:{this.stack.push(r),this.visit(Ki(r)),this.visit(Hi(r)),assert(this.stack.pop()==r),this.visitBinary(r);break}case 17:{this.stack.push(r),this.visit(ji(r)),this.visit(Qi(r)),this.visit(Xi(r)),assert(this.stack.pop()==r),this.visitSelect(r);break}case 18:{this.stack.push(r),this.visit(Zi(r)),assert(this.stack.pop()==r),this.visitDrop(r);break}case 19:{let t=Vr(r);t&&(this.stack.push(r),this.visit(t),assert(this.stack.pop()==r)),this.visitReturn(r);break}case 20:{this.visitMemorySize(r);break}case 21:{this.stack.push(r),this.visit(Vi(r)),assert(this.stack.pop()==r),this.visitMemoryGrow(r);break}case 22:{this.visitNop(r);break}case 23:{this.visitUnreachable(r);break}case 24:{this.stack.push(r),this.visit(Hu(r)),this.visit(ju(r)),assert(this.stack.pop()==r),this.visitAtomicRMW(r);break}case 25:{this.stack.push(r),this.visit(Qu(r)),this.visit(Xu(r)),this.visit(Zu(r)),assert(this.stack.pop()==r),this.visitAtomicCmpxchg(r);break}case 26:{this.stack.push(r),this.visit($u(r)),this.visit(Yu(r)),this.visit(Ju(r)),assert(this.stack.pop()==r),this.visitAtomicWait(r);break}case 27:{this.stack.push(r),this.visit(ec(r)),this.visit(tc(r)),assert(this.stack.pop()==r),this.visitAtomicNotify(r);break}case 28:{this.visitAtomicFence(r);break}case 30:{this.stack.push(r),this.visit(rc(r)),assert(this.stack.pop()==r),this.visitSIMDExtract(r);break}case 31:{this.stack.push(r),this.visit(nc(r)),this.visit(ic(r)),assert(this.stack.pop()==r),this.visitSIMDReplace(r);break}case 32:{this.stack.push(r),this.visit(sc(r)),this.visit(ac(r)),assert(this.stack.pop()==r),this.visitSIMDShuffle(r);break}case 33:{this.stack.push(r),this.visit(lc(r)),this.visit(oc(r)),this.visit(uc(r)),assert(this.stack.pop()==r),this.visitSIMDTernary(r);break}case 34:{this.stack.push(r),this.visit(cc(r)),this.visit(pc(r)),assert(this.stack.pop()==r),this.visitSIMDShift(r);break}case 35:{this.stack.push(r),this.visit(fc(r)),assert(this.stack.pop()==r),this.visitSIMDLoad(r);break}case 36:{this.stack.push(r),this.visit(_c(r)),this.visit(dc(r)),assert(this.stack.pop()==r),this.visitSIMDLoadStoreLane(r);break}case 37:{this.stack.push(r),this.visit(hc(r)),this.visit(mc(r)),this.visit(yc(r)),assert(this.stack.pop()==r),this.visitMemoryInit(r);break}case 38:{this.visitDataDrop(r);break}case 39:{this.stack.push(r),this.visit(gc(r)),this.visit(bc(r)),this.visit(xc(r)),assert(this.stack.pop()==r),this.visitMemoryCopy(r);break}case 40:{this.stack.push(r),this.visit(Ec(r)),this.visit(Ac(r)),this.visit(Tc(r)),assert(this.stack.pop()==r),this.visitMemoryFill(r);break}case 41:{this.visitPop(r);break}case 42:{this.visitRefNull(r);break}case 43:{this.stack.push(r),this.visit(Sc(r)),assert(this.stack.pop()==r),this.visitRefIsNull(r);break}case 44:{this.stack.push(r),this.visitName(Im(r)),assert(this.stack.pop()==r),this.visitRefFunc(r);break}case 45:{this.stack.push(r),this.visit(kc(r)),this.visit(Fc(r)),assert(this.stack.pop()==r),this.visitRefEq(r);break}case 54:{this.stack.push(r),this.visit(wc(r));let t=Rc(r);for(let i=0;i<t;++i)this.visit(Cc(r,i));assert(this.stack.pop()==r),this.visitTry(r);break}case 56:{this.stack.push(r),this.visitTag(Dm(r));let t=Pc(r);for(let i=0;i<t;++i)this.visit(Nc(r,i));assert(this.stack.pop()==r),this.visitThrow(r);break}case 57:{this.visitRethrow(r);break}case 59:{let t=Lc(r);if(t){this.stack.push(r);for(let i=0;i<t;++i)this.visit(Bc(r,i));assert(this.stack.pop()==r)}this.visitTupleMake(r);break}case 60:{this.stack.push(r),this.visit(Mc(r)),assert(this.stack.pop()==r),this.visitTupleExtract(r);break}case 61:{this.stack.push(r),this.visit(zc(r)),assert(this.stack.pop()==r),this.visitRefI31(r);break}case 62:{this.stack.push(r),this.visit(Dc(r)),assert(this.stack.pop()==r),this.visitI31Get(r);break}case 63:{this.stack.push(r);let t=Gc(r);if(t)for(let i=0;i<t;++i)this.visit(Uc(r,i));this.visit(Vc(r)),assert(this.stack.pop()==r),this.visitCallRef(r);break}case 64:{this.stack.push(r),this.visit(Oc(r)),assert(this.stack.pop()==r),this.visitRefTest(r);break}case 65:{this.stack.push(r),this.visit(qc(r)),assert(this.stack.pop()==r),this.visitRefCast(r);break}case 67:{this.stack.push(r),this.visitLabel(ey(r)),this.visit(Wc(r)),assert(this.stack.pop()==r),this.visitBrOn(r);break}case 68:{let t=Kc(r);if(t){this.stack.push(r);for(let i=0;i<t;++i)this.visit(Hc(r,i));assert(this.stack.pop()==r)}this.visitStructNew(r);break}case 69:{this.stack.push(r),this.visit(jc(r)),this.visitIndex(ny(r)),assert(this.stack.pop()==r),this.visitStructGet(r);break}case 70:{this.stack.push(r),this.visit(Qc(r)),this.visitIndex(sy(r)),this.visit(Xc(r)),assert(this.stack.pop()==r),this.visitStructSet(r);break}case 73:{this.stack.push(r),this.visit($c(r));let t=Zc(r);t&&this.visit(t),assert(this.stack.pop()==r),this.visitArrayNew(r);break}case 76:{let t=Yc(r);if(t){this.stack.push(r);for(let i=0;i<t;++i)this.visit(Jc(r,i));assert(this.stack.pop()==r)}this.visitArrayNewFixed(r);break}case 77:{this.stack.push(r),this.visit(ep(r)),this.visit(tp(r)),assert(this.stack.pop()==r),this.visitArrayGet(r);break}case 78:{this.stack.push(r),this.visit(rp(r)),this.visit(np(r)),this.visit(ip(r)),assert(this.stack.pop()==r),this.visitArraySet(r);break}case 81:{this.stack.push(r),this.visit(sp(r)),assert(this.stack.pop()==r),this.visitArrayLen(r);break}case 82:{this.stack.push(r),this.visit(ap(r)),this.visit(lp(r)),this.visit(op(r)),this.visit(up(r)),this.visit(cp(r)),assert(this.stack.pop()==r),this.visitArrayCopy(r);break}case 88:{this.stack.push(r),this.visit(Ic(r)),assert(this.stack.pop()==r),this.visitRefAs(r);break}case 89:{this.stack.push(r),this.visit(pp(r));let t=fp(r);t&&this.visit(t);let i=_p(r);i&&this.visit(i),assert(this.stack.pop()==r),this.visitStringNew(r);break}case 90:{this.stack.push(r),assert(this.stack.pop()==r),this.visitStringConst(r);break}case 91:{this.stack.push(r),this.visit(dp(r)),assert(this.stack.pop()==r),this.visitStringMeasure(r);break}case 92:{this.stack.push(r),this.visit(hp(r)),this.visit(mp(r));let t=yp(r);t&&this.visit(t),assert(this.stack.pop()==r),this.visitStringEncode(r);break}case 93:{this.stack.push(r),this.visit(gp(r)),this.visit(bp(r)),assert(this.stack.pop()==r),this.visitStringConcat(r);break}case 94:{this.stack.push(r),this.visit(Ep(r)),this.visit(Ap(r)),assert(this.stack.pop()==r),this.visitStringEq(r);break}case 96:{this.stack.push(r),this.visit(Tp(r)),this.visit(Sp(r)),assert(this.stack.pop()==r),this.visitStringWTF16Get(r);break}case 97:{this.stack.push(r),this.visit(vp(r)),this.visit(Ip(r)),this.visit(kp(r)),assert(this.stack.pop()==r),this.visitStringSliceWTF(r);break}default:throw new Error("unexpected expression kind")}this._currentExpression=e}},xn=class extends m_{constructor(e){super();this.module=e;this._currentFunction=0;this._currentGlobal=0}get currentFunction(){let e=this._currentFunction;if(!e)throw new Error("not walking a function");return e}get currentGlobal(){let e=this._currentGlobal;if(!e)throw new Error("not walking a global");return e}walkModule(){this.walkFunctions(),this.walkGlobals()}walkFunctions(){let e=this.module.ref;for(let t=0,i=Dy(e);t<i;++t)this.walkFunction(Gy(e,t))}walkFunction(e){let t=yr(e);t&&(this._currentFunction=e,this.visit(t),this._currentFunction=0)}walkGlobals(){let e=this.module.ref;for(let t=0,i=ng(e);t<i;++t)this.walkGlobal(ig(e,t))}walkGlobal(e){this._currentGlobal=e;let t=$a(e);t&&this.visit(t),this._currentGlobal=0}replaceCurrent(e){let t=this.currentExpression,i=this.currentFunction;if(yr(i)==t)ja(i,e);else{let a=assert(this.parentExpressionOrNull);if(!c3(a,t,e))throw Error("failed to replace expression");xd(a)}}};function c3(n,r,e){switch(Kt(n)){case 1:{let t=Pi(n);for(let i=0;i<t;++i){let s=Ni(n,i);if(s==r)return Ad(n,i,e),s}break}case 2:{let t=Li(n);if(t==r)return Sd(n,e),t;let i=Bi(n);if(i==r)return vd(n,e),i;let s=Mi(n);if(s==r)return Id(n,e),s;break}case 3:{let t=zi(n);if(t==r)return Fd(n,e),t;break}case 4:{let t=Di(n);if(t==r)return Rd(n,e),t;let i=Uu(n);if(i==r)return Cd(n,e),i;break}case 5:{let t=Vu(n);if(t==r)return Md(n,e),t;let i=Ou(n);if(i==r)return zd(n,e),i;break}case 6:{let t=hr(n);for(let i=0;i<t;++i){let s=mr(n,i);if(s==r)return Ba(n,i,e),s}break}case 7:{let t=qu(n);if(t==r)return Vd(n,e),t;let i=Gi(n);for(let s=0;s<i;++s){let a=Ui(n,s);if(a==r)return Ma(n,s,e),a}break}case 8:break;case 9:{let t=Gr(n);if(t==r)return Ga(n,e),t;break}case 10:break;case 11:{let t=Wu(n);if(t==r)return Xd(n,e),t;break}case 12:{let t=Oi(n);if(t==r)return nh(n,e),t;break}case 13:{let t=Ur(n);if(t==r)return qa(n,e),t;let i=qi(n);if(i==r)return ah(n,e),i;break}case 14:break;case 15:{let t=Wi(n);if(t==r)return dh(n,e),t;break}case 16:{let t=Ki(n);if(t==r)return bh(n,e),t;let i=Hi(n);if(i==r)return xh(n,e),i;break}case 17:{let t=ji(n);if(t==r)return Ah(n,e),t;let i=Qi(n);if(i==r)return Th(n,e),i;let s=Xi(n);if(s==r)return Sh(n,e),s;break}case 18:{let t=Zi(n);if(t==r)return vh(n,e),t;break}case 19:{let t=Vr(n);if(t==r)return Wa(n,e),t;break}case 20:break;case 21:{let t=Vi(n);if(t==r)return Yd(n,e),t;break}case 22:break;case 23:break;case 24:{let t=Hu(n);if(t==r)return Rh(n,e),t;let i=ju(n);if(i==r)return Ch(n,e),i;break}case 25:{let t=Qu(n);if(t==r)return Nh(n,e),t;let i=Xu(n);if(i==r)return Lh(n,e),i;let s=Zu(n);if(s==r)return Bh(n,e),s;break}case 26:{let t=$u(n);if(t==r)return zh(n,e),t;let i=Yu(n);if(i==r)return Dh(n,e),i;let s=Ju(n);if(s==r)return Gh(n,e),s;break}case 27:{let t=ec(n);if(t==r)return Vh(n,e),t;let i=tc(n);if(i==r)return Oh(n,e),i;break}case 28:break;case 30:{let t=rc(n);if(t==r)return Kh(n,e),t;break}case 31:{let t=nc(n);if(t==r)return jh(n,e),t;let i=ic(n);if(i==r)return Qh(n,e),i;break}case 32:{let t=sc(n);if(t==r)return Zh(n,e),t;let i=ac(n);if(i==r)return $h(n,e),i;break}case 33:{let t=lc(n);if(t==r)return Jh(n,e),t;let i=oc(n);if(i==r)return em(n,e),i;let s=uc(n);if(s==r)return tm(n,e),s;break}case 34:{let t=cc(n);if(t==r)return nm(n,e),t;let i=pc(n);if(i==r)return im(n,e),i;break}case 35:{let t=fc(n);if(t==r)return am(n,e),t;break}case 36:{let t=_c(n);if(t==r)return om(n,e),t;if(dc(n)==r)return um(n,e),t;break}case 37:{let t=hc(n);if(t==r)return cm(n,e),t;let i=mc(n);if(i==r)return pm(n,e),i;let s=yc(n);if(s==r)return fm(n,e),s;break}case 38:break;case 39:{let t=gc(n);if(t==r)return dm(n,e),t;let i=bc(n);if(i==r)return hm(n,e),i;let s=xc(n);if(s==r)return mm(n,e),s;break}case 40:{let t=Ec(n);if(t==r)return gm(n,e),t;let i=Ac(n);if(i==r)return bm(n,e),i;let s=Tc(n);if(s==r)return xm(n,e),s;break}case 41:break;case 42:break;case 43:{let t=Sc(n);if(t==r)return Tm(n,e),t;break}case 44:break;case 45:{let t=kc(n);if(t==r)return Fm(n,e),t;let i=Fc(n);if(i==r)return wm(n,e),i;break}case 54:{let t=wc(n);if(t==r)return Bm(n,e),t;let i=Rc(n);for(let s=0;s<i;++s){let a=Cc(n,s);if(a==r)return Mm(n,s,e),a}break}case 56:{let t=Pc(n);for(let i=0;i<t;++i){let s=Nc(n,i);if(s==r)return Gm(n,i,e),s}break}case 57:break;case 59:{let t=Lc(n);for(let i=0;i<t;++i){let s=Bc(n,i);if(s==r)return Om(n,i,e),s}break}case 60:{let t=Mc(n);if(t==r)return Wm(n,e),t;break}case 61:{let t=zc(n);if(t==r)return jm(n,e),t;break}case 62:{let t=Dc(n);if(t==r)return Xm(n,e),t;break}case 63:{let t=Gc(n);for(let s=0;s<t;++s){let a=Uc(n,s);if(a==r)return Zm(n,s,e),a}let i=Vc(n);if(i==r)return $m(n,e),i;break}case 64:{let t=Oc(n);if(t==r)return Ym(n,e),t;break}case 65:{let t=qc(n);if(t==r)return Jm(n,e),t;break}case 67:{let t=Wc(n);if(t==r)return ty(n,e),t;break}case 68:{let t=Kc(n);for(let i=0;i<t;++i){let s=Hc(n,i);if(s==r)return ry(n,i,e),s}break}case 69:{let t=jc(n);if(t==r)return iy(n,e),t;break}case 70:{let t=Qc(n);if(t==r)return ay(n,e),t;let i=Xc(n);if(i==r)return ly(n,e),i;break}case 73:{let t=$c(n);if(t==r)return uy(n,e),t;let i=Zc(n);if(i==r)return oy(n,e),i;break}case 76:{let t=Yc(n);for(let i=0;i<t;++i){let s=Jc(n,i);if(s==r)return cy(n,i,e),s}break}case 77:{let t=ep(n);if(t==r)return py(n,e),t;let i=tp(n);if(i==r)return fy(n,e),i;break}case 78:{let t=rp(n);if(t==r)return _y(n,e),t;let i=np(n);if(i==r)return dy(n,e),i;let s=ip(n);if(s==r)return hy(n,e),s;break}case 81:{let t=sp(n);if(t==r)return my(n,e),t;break}case 82:{let t=ap(n);if(t==r)return yy(n,e),t;let i=lp(n);if(i==r)return gy(n,e),i;let s=op(n);if(s==r)return by(n,e),s;let a=up(n);if(a==r)return xy(n,e),a;let l=cp(n);if(l==r)return Ey(n,e),l;break}case 88:{let t=Ic(n);if(t==r)return Sm(n,e),t;break}case 89:{let t=pp(n);if(t==r)return Ay(n,e),t;let i=fp(n);if(i==r)return Ty(n,e),i;let s=_p(n);if(s==r)return Sy(n,e),s;break}case 90:break;case 91:{let t=dp(n);if(t==r)return vy(n,e),t;break}case 92:{let t=hp(n);if(t==r)return Iy(n,e),t;let i=mp(n);if(i==r)return ky(n,e),i;let s=yp(n);if(s==r)return Fy(n,e),s;break}case 93:{let t=gp(n);if(t==r)return wy(n,e),t;let i=bp(n);if(i==r)return Ry(n,e),i;break}case 94:{let t=Ep(n);if(t==r)return Cy(n,e),t;let i=Ap(n);if(i==r)return Py(n,e),i;break}case 96:{let t=Tp(n);if(t==r)return Ny(n,e),t;let i=Sp(n);if(i==r)return Ly(n,e),i;break}case 97:{let t=vp(n);if(t==r)return By(n,e),t;let i=Ip(n);if(i==r)return My(n,e),i;let s=kp(n);if(s==r)return zy(n,e),s;break}default:throw new Error("unexpected expression id")}return 0}var ou=class extends xn{constructor(e){super(e.module);this.seenStores=!1;this.ptrType=e.options.sizeTypeRef}checkRT(){return this.module.readStringCached(Mn(this.currentFunction)).startsWith("~lib/rt/")}visitStore(e){let t=this.module,i=Ur(e),s=Oa(e),a=Va(e);qa(e,t.call("~onstore",[i,t.i32(s),t.i32(a),t.i32(i32(this.checkRT()))],this.ptrType)),this.seenStores=!0}walkModule(){super.walkModule(),this.seenStores&&this.module.addFunctionImport("~onstore","rtrace","onstore",it([this.ptrType,P.I32,P.I32,P.I32]),this.ptrType)}};function Ix(n,r){let e=!1;for(;Kt(r)==6&&n.readStringCached(Cn(r))==g.tostack;)assert(hr(r)==1),r=mr(r,0),e=!0;return e?r:0}function kx(n){return Kt(n)===14?!st(n):!0}var uu=class extends xn{constructor(e){super(e.module);this.slotMaps=new Map;this.tempMaps=new Map;this.exportMap=new Map;this.hasStackCheckFunction=!1;this.callSlotOffset=0;this.callSlotStack=new Array;this.compiler=e}get options(){return this.compiler.options}get ptrType(){return this.options.sizeTypeRef}get ptrSize(){return this.ptrType==P.I64?8:4}get ptrBinaryAdd(){return this.ptrType==P.I64?25:0}get ptrBinarySub(){return this.ptrType==P.I64?26:1}ptrConst(e){return this.ptrType==P.I64?this.module.i64(e):this.module.i32(e)}noteSlot(e,t){let i;if(this.slotMaps.has(e)){if(i=changetype(this.slotMaps.get(e)),i.has(t))return changetype(i.get(t))}else i=new Map,this.slotMaps.set(e,i);let s=i.size;return i.set(t,s),s}noteExport(e,t){t.length&&this.exportMap.set(e,t)}getSharedTemp(e,t){let i;if(this.tempMaps.has(e)){if(i=changetype(this.tempMaps.get(e)),i.has(t))return changetype(i.get(t))}else i=new Map,this.tempMaps.set(e,i);let a=Fp(e)+i.size;return i.set(t,a),a}makeStackOffset(e){assert(e!=0);let t=this.module,i=t.global_set(g.stack_pointer,t.binary(e>=0?this.ptrBinaryAdd:this.ptrBinarySub,t.global_get(g.stack_pointer,this.ptrType),this.ptrConst(abs(e))));return e>0?i:t.block(null,[i,this.makeStackCheck()],P.None)}makeStackFill(e,t){assert(e>0);let i=this.module;if(this.options.hasFeature(8)&&e>16)t.push(i.memory_fill(i.global_get(g.stack_pointer,this.ptrType),i.i32(0),this.ptrConst(e)));else{let s=e;for(;s>=8;)t.push(i.store(8,i.global_get(g.stack_pointer,this.ptrType),i.i64(0),P.I64,e-s)),s-=8;s&&(assert(s==4),t.push(i.store(4,i.global_get(g.stack_pointer,this.ptrType),i.i32(0),P.I32,e-s)))}}makeStackCheck(){let e=this.module;return this.hasStackCheckFunction||(this.hasStackCheckFunction=!0,e.addFunction("~stack_check",P.None,P.None,null,e.if(e.binary(17,e.global_get(g.stack_pointer,this.ptrType),e.global_get(g.data_end,this.ptrType)),this.compiler.makeStaticAbort(this.compiler.ensureStaticString("stack overflow"),Te.native)))),e.call("~stack_check",null,P.None)}updateCallOperands(e){let t=this.module,i=0;for(let s=0,a=e.length;s<a;++s){let l=e[s],o=Ix(t,l);if(!o)continue;if(!kx(o)){e[s]=o;continue}let u=this.currentFunction,c=Fp(u),f=this.noteSlot(u,c+this.callSlotOffset+i),_=this.getSharedTemp(u,this.ptrType),d=new Array;d.push(t.local_set(_,o,!1)),d.push(t.store(this.ptrSize,t.global_get(g.stack_pointer,this.ptrType),t.local_get(_,this.ptrType),this.ptrType,f*this.ptrSize)),d.push(t.local_get(_,this.ptrType)),e[s]=t.block(null,d,this.ptrType),++i}return i}visitCallPre(e){let t=hr(e),i=new Array(t);for(let a=0;a<t;++a)i[a]=mr(e,a);let s=this.updateCallOperands(i);for(let a=0,l=i.length;a<l;++a)Ba(e,a,i[a]);s&&(this.callSlotOffset+=s),this.callSlotStack.push(s)}visitCall(e){let t=this.callSlotStack.pop();t&&(this.callSlotOffset-=t)}visitCallIndirectPre(e){let t=Gi(e),i=new Array(t);for(let a=0;a<t;++a)i[a]=Ui(e,a);let s=this.updateCallOperands(i);for(let a=0,l=i.length;a<l;++a)Ma(e,a,i[a]);s&&(this.callSlotOffset+=s),this.callSlotStack.push(s)}visitCallIndirect(e){let t=this.callSlotStack.pop();t&&(this.callSlotOffset-=t)}visitLocalSet(e){let t=this.module,i=Gr(e),s=Ix(t,i);if(!s)return;if(!kx(s)){Ga(e,s);return}let a=Pn(e),l=this.noteSlot(this.currentFunction,a),o=new Array;o.push(t.store(this.ptrSize,t.global_get(g.stack_pointer,this.ptrType),t.local_tee(a,s,!1),this.ptrType,l*this.ptrSize)),Da(e)?(o.push(t.local_get(a,this.ptrType)),this.replaceCurrent(t.flatten(o,this.ptrType))):this.replaceCurrent(t.flatten(o,P.None))}updateFunction(e){let t=Mn(e),i=Yi(e),s=Ji(e),a=assert(yr(e)),l=Ka(e),o=new Array;for(let d=0;d<l;++d)o[d]=Ha(e,d);let u=this.tempMaps;if(u.has(e)){let d=changetype(u.get(e));for(let m=Map_keys(d),h=0,b=m.length;h<b;++h)o.push(m[h])}let c=this.module.ref;$i(c,t);let f=Ee(o),_=Ln(c,t,i,s,f,o.length,a);if(this.options.sourceMap||this.options.debugInfo){let d=this.compiler.program.searchFunctionByRef(_);d&&d.addDebugInfo(this.module,_)}ie(f)}updateExport(e,t){let i=this.module,s=i.ref;assert(Yy(e)==0);let a=eg(e),l=i.readStringCached(a),o=Jy(e),u=Bn(s,a),c=Yi(u),f=ff(c),_=f.length,d=Ji(u),m=_,h=new Array,b=assert(t.length),A=b*this.ptrSize,S="export:"+l,k=i.allocStringCached(S);if(Bn(s,k)==0){let w=new Array;w.push(this.makeStackOffset(-A));for(let M=0;M<b;++M)w.push(i.store(this.ptrSize,i.global_get(g.stack_pointer,this.ptrType),i.local_get(t[M],this.ptrType),this.ptrType,M*this.ptrSize));let R=new Array(_);for(let M=0;M<_;++M)R[M]=i.local_get(M,f[M]);if(d!=P.None){let M=m++;h.push(d),w.push(i.local_set(M,i.call(l,R,d),!1)),w.push(this.makeStackOffset(+A)),w.push(i.local_get(M,d))}else w.push(i.call(l,R,d)),w.push(this.makeStackOffset(+A));let C=Ee(h);Ln(s,k,c,d,C,h.length,i.block(null,w,d)),ie(C)}Za(s,o),Qa(s,k,o)}walkModule(){super.walkModule();let e=this.module,t=new y_(this);for(let s=Map_keys(this.slotMaps),a=0,l=s.length;a<l;++a){let o=s[a],c=changetype(this.slotMaps.get(o)).size*this.ptrSize;t.frameSize=c,t.walkFunction(o);let f=new Array;f.push(this.makeStackOffset(-c)),this.makeStackFill(c,f);let _=yr(o),d=dr(_);if(d==P.Unreachable)f.push(_);else if(d==P.None)f.push(_),f.push(this.makeStackOffset(+c));else{let m=this.getSharedTemp(o,d);f.push(e.local_set(m,_,!1)),f.push(this.makeStackOffset(+c)),f.push(e.local_get(m,d))}ja(o,e.flatten(f,d))}for(let s=Map_keys(this.tempMaps),a=0,l=s.length;a<l;++a)this.updateFunction(s[a]);let i=this.exportMap;for(let s=Map_keys(i),a=0,l=s.length;a<l;++a){let o=s[a],u=Xa(e.ref,e.allocStringCached(o)),c=changetype(i.get(o));this.updateExport(u,c)}}},y_=class extends xn{constructor(e){super(e.module);this.frameSize=0;this.parentPass=e}visitReturn(e){assert(this.frameSize);let t=this.module,i=Vr(e),s=new Array;if(i){let a=dr(i);if(a==P.Unreachable)return;let l=this.parentPass.getSharedTemp(this.currentFunction,a);s.push(t.local_set(l,i,!1)),s.push(this.parentPass.makeStackOffset(+this.frameSize)),Wa(e,t.local_get(l,a))}else s.push(this.parentPass.makeStackOffset(+this.frameSize));s.push(e),this.replaceCurrent(t.flatten(s,P.Unreachable))}};var pi=class{constructor(r,e=!1){this.seen=new Map;this.program=r,this.includePrivate=e}walk(){for(let r=Map_values(this.program.filesByName),e=0,t=r.length;e<t;++e){let i=unchecked(r[e]);i.source.sourceKind==1&&this.visitFile(i)}}visitFile(r){let e=r.exports;if(e)for(let i=Map_keys(e),s=0,a=i.length;s<a;++s){let l=unchecked(i[s]),o=assert(e.get(l));this.visitElement(l,o)}let t=r.exportsStar;if(t)for(let i=0,s=t.length;i<s;++i){let a=unchecked(t[i]);this.visitFile(a)}}visitElement(r,e){if(e.is(512)&&!this.includePrivate)return;let t=this.seen;if(!e.is(262144)&&t.has(e)){this.visitAlias(r,e,assert(t.get(e)));return}switch(t.set(e,r),e.kind){case 0:{e.is(8388608)&&this.visitGlobal(r,e);break}case 2:{e.is(8388608)&&this.visitEnum(r,e);break}case 3:break;case 4:{this.visitFunctionInstances(r,e);break}case 6:{this.visitClassInstances(r,e);break}case 8:{this.visitInterfaceInstances(r,e);break}case 10:{let i=e.instance;if(!i)break;e=i}case 11:{let i=e,s=i.getterInstance;s&&this.visitFunction(r,s);let a=i.setterInstance;a&&this.visitFunction(r,a);break}case 12:{Fx(e)&&this.visitNamespace(r,e);break}case 14:case 15:break;default:assert(!1)}}visitFunctionInstances(r,e){let t=e.instances;if(t)for(let i=Map_values(t),s=0,a=i.length;s<a;++s){let l=unchecked(i[s]);l.is(8388608)&&this.visitFunction(r,l)}}visitClassInstances(r,e){let t=e.instances;if(t)for(let i=Map_values(t),s=0,a=i.length;s<a;++s){let l=unchecked(i[s]);assert(l.kind==7),l.is(8388608)&&this.visitClass(r,l)}}visitInterfaceInstances(r,e){let t=e.instances;if(t)for(let i=Map_values(t),s=0,a=i.length;s<a;++s){let l=unchecked(i[s]);assert(l.kind==9),l.is(8388608)&&this.visitInterface(r,l)}}};function Fx(n){let r=n.members;if(r)for(let e=Map_values(r),t=0,i=e.length;t<i;++t){let s=unchecked(e[t]);switch(s.kind){case 4:{let a=s.instances;if(a){for(let l=Map_values(a),o=0,u=l.length;o<u;++o)if(unchecked(l[o]).is(8388608))return!0}break}case 6:{let a=s.instances;if(a){for(let l=Map_values(a),o=0,u=l.length;o<u;++o)if(unchecked(l[o]).is(8388608))return!0}break}default:{if(s.is(8388608)||Fx(s))return!0;break}}}return!1}function p3(n){return n=="rtrace"?"#rtrace":n}function f3(n){return n!="rtrace"}var _i=class n extends pi{constructor(e,t,i=!1){super(e,i);this.sb=[];this.indentLevel=0;this.needsLiftBuffer=!1;this.needsLowerBuffer=!1;this.needsLiftString=!1;this.needsLowerString=!1;this.needsLiftArray=!1;this.needsLowerArray=!1;this.needsLiftTypedArray=!1;this.needsLowerTypedArray=!1;this.needsLiftStaticArray=!1;this.needsLowerStaticArray=!1;this.needsLiftInternref=!1;this.needsLowerInternref=!1;this.needsRetain=!1;this.needsRelease=!1;this.needsNotNull=!1;this.needsSetU8=!1;this.needsSetU16=!1;this.needsSetU32=!1;this.needsSetU64=!1;this.needsSetF32=!1;this.needsSetF64=!1;this.needsGetI8=!1;this.needsGetU8=!1;this.needsGetI16=!1;this.needsGetU16=!1;this.needsGetI32=!1;this.needsGetU32=!1;this.needsGetI64=!1;this.needsGetU64=!1;this.needsGetF32=!1;this.needsGetF64=!1;this.deferredLifts=new Set;this.deferredLowers=new Set;this.deferredCode=new Array;this.exports=new Array;this.importMappings=new Map;this.esm=t}static build(e,t=!0){return new n(e,t).build()}visitGlobal(e,t){let i=this.sb,s=t.type;this.exports.push(e),En(s,1)||(W(i,this.indentLevel),i.push(e),i.push(`: {
18
18
  `),W(i,++this.indentLevel),i.push("// "),i.push(t.internalName),i.push(": "),i.push(s.toString()),i.push(`
19
19
  `),W(i,this.indentLevel),i.push(`valueOf() { return this.value; },
20
20
  `),W(i,this.indentLevel),i.push(`get value() {
@@ -29,14 +29,14 @@ var Mu=Object.defineProperty;var H_=Object.getOwnPropertyDescriptor;var kE=Objec
29
29
  `);let s=t.members;if(s)for(let a=Map_values(s),l=0,o=a.length;l<o;++l){let u=a[l];u.kind==3&&(W(i,this.indentLevel),i.push("values[values."),i.push(u.name),u.is(33554432)?(i.push(" = "),i.push(i64_low(u.constantIntegerValue).toString())):(i.push(' = exports["'),i.push(Re(e+"."+u.name,34)),i.push('"].valueOf()')),i.push('] = "'),i.push(Re(u.name,34)),i.push(`",
30
30
  `))}W(i,this.indentLevel),i.push(`values
31
31
  `),W(i,--this.indentLevel),i.push(`))({}),
32
- `),this.visitNamespace(e,t)}makeGlobalImport(e,t,i){let s=this.sb,a=i.type;W(s,this.indentLevel),$e(t)?s.push(t):(s.push('"'),s.push(Re(t,34)),s.push('": '));let l=this.ensureModuleId(e);En(a,0)?(s.push(`(
32
+ `),this.visitNamespace(e,t)}makeGlobalImport(e,t,i){let s=this.sb,a=i.type;W(s,this.indentLevel),Ze(t)?s.push(t):(s.push('"'),s.push(Re(t,34)),s.push('": '));let l=this.ensureModuleId(e);En(a,0)?(s.push(`(
33
33
  `),W(s,this.indentLevel+1),s.push("// "),s.push(i.internalName),s.push(": "),s.push(i.type.toString()),s.push(`
34
34
  `),W(s,this.indentLevel+1),e!="env"&&(s.push("__module"),s.push(l.toString()),s.push(".")),s.push(t),s.push(`
35
35
  `),W(s,this.indentLevel),s.push(")")):(s.push(`{
36
36
  `),W(s,++this.indentLevel),s.push("// "),s.push(i.internalName),s.push(": "),s.push(i.type.toString()),s.push(`
37
37
  `),W(s,this.indentLevel),s.push(`// not supported: cannot lower before instantiate completes
38
38
  `),W(s,--this.indentLevel),s.push("}")),s.push(`,
39
- `)}makeFunctionImport(e,t,i,s=null){let a=this.sb,l=i.signature;if(W(a,this.indentLevel),$e(t)?a.push(t):(a.push('"'),a.push(Re(t,34)),a.push('"')),g_(l,0)&&!s&&$e(t))a.push(`: (
39
+ `)}makeFunctionImport(e,t,i,s=null){let a=this.sb,l=i.signature;if(W(a,this.indentLevel),Ze(t)?a.push(t):(a.push('"'),a.push(Re(t,34)),a.push('"')),g_(l,0)&&!s&&Ze(t))a.push(`: (
40
40
  `),W(a,this.indentLevel+1),a.push("// "),a.push(i.internalName),a.push(i.signature.toString()),a.push(`
41
41
  `),W(a,this.indentLevel+1),e!="env"&&(a.push(e),a.push(".")),a.push(t),a.push(`
42
42
  `),W(a,this.indentLevel),a.push(")");else{a.push("(");let o=l.parameterTypes,u=new Array;for(let _=0,d=o.length;_<d;++_)u.push(i.getParameterName(_));a.push(u.join(", ")),a.push(`) {
@@ -58,18 +58,18 @@ var Mu=Object.defineProperty;var H_=Object.getOwnPropertyDescriptor;var kE=Objec
58
58
  `);for(let c=0,f=o.length;c<f;++c)W(i,this.indentLevel),i.push("__release("),i.push(o[c]),i.push(`);
59
59
  `);W(i,--this.indentLevel),i.push(`}
60
60
  `)}W(i,--this.indentLevel),i.push(`},
61
- `)}this.visitNamespace(e,t)}visitClass(e,t){}visitInterface(e,t){this.visitClass(e,t)}visitNamespace(e,t){}visitAlias(e,t,i){}getExternalCode(e){let t=Zt(11,e.decoratorNodes);if(t){let i=t.args;if(i&&i.length==1){let s=i[0];if(s.kind==18){let a=s;if(a.literalKind==2)return a.value;if(a.literalKind==3){let l=a.parts;if(l.length==1)return l[0]}}}}return null}build(){let e=this.exports,t=this.program.moduleImports,i=this.program,s=i.options,a=this.sb;a.push(""),W(a,this.indentLevel++),this.esm||a.push("export "),a.push(`async function instantiate(module, imports = {}) {
61
+ `)}this.visitNamespace(e,t)}visitClass(e,t){}visitInterface(e,t){this.visitClass(e,t)}visitNamespace(e,t){}visitAlias(e,t,i){}getExternalCode(e){let t=$t(11,e.decoratorNodes);if(t){let i=t.args;if(i&&i.length==1){let s=i[0];if(s.kind==18){let a=s;if(a.literalKind==2)return a.value;if(a.literalKind==3){let l=a.parts;if(l.length==1)return l[0]}}}}return null}build(){let e=this.exports,t=this.program.moduleImports,i=this.program,s=i.options,a=this.sb;a.push(""),W(a,this.indentLevel++),this.esm||a.push("export "),a.push(`async function instantiate(module, imports = {}) {
62
62
  `);let l=a.push("")-1;W(a,this.indentLevel++),a.push(`const adaptedImports = {
63
- `);let o=a.length;for(let h=Map_keys(t),b=0,A=h.length;b<A;++b){let S=h[b],k=this.ensureModuleId(S),w=t.get(S);if(W(a,this.indentLevel),$e(S)?a.push(S):(a.push('"'),a.push(Re(S,34)),a.push('"')),!fk(S)){a.push(": __module"),a.push(k.toString()),a.push(`,
63
+ `);let o=a.length;for(let h=Map_keys(t),b=0,A=h.length;b<A;++b){let S=h[b],k=this.ensureModuleId(S),w=t.get(S);if(W(a,this.indentLevel),Ze(S)?a.push(S):(a.push('"'),a.push(Re(S,34)),a.push('"')),!f3(S)){a.push(": __module"),a.push(k.toString()),a.push(`,
64
64
  `);continue}let R=a.length;a.push(`: Object.setPrototypeOf({
65
- `),++this.indentLevel;let C=0;for(let M=Map_keys(w),O=0,D=M.length;O<D;++O){let Q=M[O],H=assert(w.get(Q));if(H.kind==5){let U=H,V=this.getExternalCode(U);(!g_(U.signature,0)||!$e(Q)||V)&&(this.makeFunctionImport(S,Q,H,V),++C)}else if(H.kind==0){let U=H;(!En(U.type,0)||!$e(Q))&&(this.makeGlobalImport(S,Q,U),++C)}}--this.indentLevel,C?(W(a,this.indentLevel),a.push("}, "),S=="env"?a.push("Object.assign(Object.create(globalThis), imports.env || {})"):(a.push("__module"),a.push(k.toString())),a.push(`),
65
+ `),++this.indentLevel;let C=0;for(let M=Map_keys(w),O=0,D=M.length;O<D;++O){let Q=M[O],H=assert(w.get(Q));if(H.kind==5){let U=H,V=this.getExternalCode(U);(!g_(U.signature,0)||!Ze(Q)||V)&&(this.makeFunctionImport(S,Q,H,V),++C)}else if(H.kind==0){let U=H;(!En(U.type,0)||!Ze(Q))&&(this.makeGlobalImport(S,Q,U),++C)}}--this.indentLevel,C?(W(a,this.indentLevel),a.push("}, "),S=="env"?a.push("Object.assign(Object.create(globalThis), imports.env || {})"):(a.push("__module"),a.push(k.toString())),a.push(`),
66
66
  `)):(a.length=R,S=="env"?a.push(": Object.assign(Object.create(globalThis), imports.env || {})"):(a.push(": __module"),a.push(k.toString())),a.push(`,
67
67
  `))}--this.indentLevel;let u=a.length>o;u?(W(a,this.indentLevel),a.push(`};
68
68
  `)):a.length=o-2;let c=this.importMappings,f=new Array;for(let h=Map_keys(c),b=0,A=h.length;b<A;++b){let S=h[b];if(S=="env")f.push(` const env = imports.env;
69
69
  `);else{let k=c.get(S);S=="rtrace"&&(f.push(` ((rtrace) => {
70
70
  `),f.push(` delete imports.rtrace;
71
71
  `),f.push(" new rtrace.Rtrace({ getMemory() { return memory; }, onerror(err) { console.log(`RTRACE: ${err.stack}`); } }).install(imports);\n"),f.push(` })(imports.rtrace);
72
- `)),f.push(" const __module"),f.push(k.toString()),f.push(" = imports"),$e(S)?(f.push("."),f.push(S)):(f.push('["'),f.push(Re(S,34)),f.push('"]')),f.push(`;
72
+ `)),f.push(" const __module"),f.push(k.toString()),f.push(" = imports"),Ze(S)?(f.push("."),f.push(S)):(f.push('["'),f.push(Re(S,34)),f.push('"]')),f.push(`;
73
73
  `)}}a[l]=f.join(""),W(a,this.indentLevel),a.push("const { exports } = await WebAssembly.instantiate(module"),u?a.push(`, adaptedImports);
74
74
  `):a.push(`, imports);
75
75
  `),W(a,this.indentLevel),a.push(`const memory = exports.memory || imports.env.memory;
@@ -223,8 +223,8 @@ var Mu=Object.defineProperty;var H_=Object.getOwnPropertyDescriptor;var kE=Objec
223
223
  else { return await globalThis.WebAssembly.compileStreaming(globalThis.fetch(url)); }
224
224
  })(), {
225
225
  `);let h=!1,b=new Array;for(let A=Map_keys(c),S=0,k=A.length;S<k;++S){let w=A[S];if(w=="env")W(a,2),a.push(`env: globalThis,
226
- `);else{let R=this.ensureModuleId(w);W(a,2),$e(w)?a.push(w):(a.push('"'),a.push(Re(w,34)),a.push('"')),a.push(": __maybeDefault(__import"),a.push(R.toString()),a.push(`),
227
- `),b.push("import * as __import"),b.push(R.toString()),b.push(' from "'),b.push(Re(pk(w),34)),b.push(`";
226
+ `);else{let R=this.ensureModuleId(w);W(a,2),Ze(w)?a.push(w):(a.push('"'),a.push(Re(w,34)),a.push('"')),a.push(": __maybeDefault(__import"),a.push(R.toString()),a.push(`),
227
+ `),b.push("import * as __import"),b.push(R.toString()),b.push(' from "'),b.push(Re(p3(w),34)),b.push(`";
228
228
  `),h=!0}}a[0]=b.join(""),a.push(` }
229
229
  ))(new URL("${Re(s.basenameHint,34)}.wasm", import.meta.url));
230
230
  `),h&&a.push(`function __maybeDefault(module) {
@@ -265,7 +265,7 @@ var Mu=Object.defineProperty;var H_=Object.getOwnPropertyDescriptor;var kE=Objec
265
265
  return __dataview.${r}(pointer, true);
266
266
  }
267
267
  }
268
- `}var An="",Nr="",pu=15,pa=class{constructor(){this.target=1;this.runtime=2;this.debugInfo=!1;this.noAssert=!1;this.exportMemory=!0;this.importMemory=!1;this.initialMemory=0;this.maximumMemory=0;this.sharedMemory=!1;this.zeroFilledMemory=!1;this.importTable=!1;this.exportTable=!1;this.sourceMap=!1;this.uncheckedBehavior=0;this.exportStart=null;this.memoryBase=0;this.tableBase=0;this.globalAliases=null;this.features=pu;this.noUnsafe=!1;this.pedantic=!1;this.lowMemoryLimit=0;this.exportRuntime=!1;this.stackSize=0;this.bundleMajorVersion=0;this.bundleMinorVersion=0;this.bundlePatchVersion=0;this.optimizeLevelHint=0;this.shrinkLevelHint=0;this.basenameHint="output";this.bindingsHint=!1}get isWasm64(){return this.target==2}get usizeType(){return this.target==2?p.usize64:p.usize32}get isizeType(){return this.target==2?p.isize64:p.isize32}get sizeTypeRef(){return this.target==2?P.I64:P.I32}get willOptimize(){return this.optimizeLevelHint>0||this.shrinkLevelHint>0}setFeature(r,e=!0){e?(r&32768&&(r|=1056),r&16384&&(r|=1024),r&1024&&(r|=256),r&4096&&(r|=16),this.features|=r):(r&256&&(r|=1024),r&1024&&(r|=16384),r&16&&(r|=4096),r&1056&&(r|=32768),this.features&=~r)}hasFeature(r){return(this.features&r)!=0}},jo=(t=>(t[t.Default=0]="Default",t[t.Never=1]="Never",t[t.Always=2]="Always",t))(jo||{}),d_=(l=>(l[l.None=0]="None",l[l.ConvImplicit=1]="ConvImplicit",l[l.ConvExplicit=2]="ConvExplicit",l[l.MustWrap=4]="MustWrap",l[l.WillDrop=8]="WillDrop",l[l.PreferStatic=16]="PreferStatic",l[l.IsThis=32]="IsThis",l))(d_||{}),h_=(o=>(o[o.None=0]="None",o[o.Data=1]="Data",o[o.Stack=2]="Stack",o[o.Heap=4]="Heap",o[o.Rtti=8]="Rtti",o[o.visitGlobals=16]="visitGlobals",o[o.visitMembers=32]="visitMembers",o[o.setArgumentsLength=64]="setArgumentsLength",o))(h_||{}),gi;(t=>(t.DefaultNamespace="env",t.Memory="memory",t.Table="table"))(gi||={});var ca;(i=>(i.Memory="memory",i.Table="table",i.argumentsLength="__argumentsLength",i.setArgumentsLength="__setArgumentsLength"))(ca||={});var di=["__new","__pin","__unpin","__collect"],hi=["__rtti_base"],cu=0,Rx="$closureEnvIn",b_=class{constructor(r,e,t){this.valueIndex=r;this.doneIndex=e;this.expression=t}},fa=class n extends tt{constructor(e){super(e.diagnostics);this.lazyLocals=null;this.currentParent=null;this.currentType=p.void;this.memorySegments=[];this.stringSegments=new Map;this.staticGcObjectOffsets=new Map;this.functionTable=[];this.builtinArgumentsLength=0;this.builtinEnv=0;this.runtimeFeatures=0;this.inlineStack=[];this.lazyFunctions=new Set;this.pendingInstanceOf=new Map;this.overrideStubs=new Set;this.pendingElements=new Set;this.doneModuleExports=new Set;this.hasCustomFunctionExports=!1;this.desiresExportRuntime=!1;this.f32ModInstance=null;this.f64ModInstance=null;this.f32PowInstance=null;this.f64PowInstance=null;this.i32PowInstance=null;this.i64PowInstance=null;this._reusableCallExpression=null;this.sretStackBase=0;this.sretStackLimit=0;this.sretStackGlobal=null;this.sretDestSlot=0;this.sretDiscardMark=null;this.externalTempMark=null;this.externalTempSize=0;this.rootNextOperand=!1;this.sroaSelectId=0;this.program=e;let t=e.module,i=e.options;i.memoryBase?(this.memoryOffset=i64_new(i.memoryBase),t.setLowMemoryUnused(!1)):!i.lowMemoryLimit&&i.optimizeLevelHint>=2?(this.memoryOffset=i64_new(1024),t.setLowMemoryUnused(!0)):(this.memoryOffset=i64_new(8),t.setLowMemoryUnused(!1));let s=0;i.hasFeature(1)&&(s|=32),i.hasFeature(2)&&(s|=2),i.hasFeature(4)&&(s|=4),i.hasFeature(8)&&(s|=16),i.hasFeature(16)&&(s|=8),i.hasFeature(32)&&(s|=1),i.hasFeature(64)&&(s|=64),i.hasFeature(128)&&(s|=128),i.hasFeature(256)&&(s|=256),i.hasFeature(512)&&(s|=512),i.hasFeature(1024)&&(s|=1024),i.hasFeature(2048)&&(s|=2048),i.hasFeature(4096)&&(s|=4096),i.hasFeature(8192)&&(s|=8192),i.hasFeature(16384)&&(s|=16384),i.hasFeature(32768)&&(s|=131072),t.setFeatures(s);let a=e.makeNativeFunction(g.start,fe.create(e,[],p.void));a.internalName=g.start,this.currentFlow=a.flow,this.currentBody=new Array,this.shadowStack=new uu(this)}get module(){return this.program.module}get options(){return this.program.options}get resolver(){return this.program.resolver}static compile(e){return new n(e).compile()}compile(){let e=this.options,t=this.module,i=this.program,s=this.resolver,a=e.stackSize>0;this.initDummyMemory(),this.program.initialize(),t.setClosedWorld(!0);let l=this.currentFlow.targetFunction;assert(l.internalName==g.start);let o=this.currentBody;assert(o.length==0);let u=i.filesByName;for(let A=Map_values(u),S=0,k=A.length;S<k;++S){let w=unchecked(A[S]);w.source.sourceKind==1&&(this.compileFile(w),this.compileModuleExports(w))}if(this.options.exportRuntime||this.options.bindingsHint&&this.desiresExportRuntime){for(let A=0,S=di.length;A<S;++A){let k=di[A],w=i.requireFunction(k);this.compileFunction(w)&&!t.hasExport(k)&&t.addFunctionExport(w.internalName,k)}for(let A=0,S=hi.length;A<S;++A){let k=hi[A],w=i.requireGlobal(k);this.compileGlobal(w)&&!t.hasExport(k)&&t.addGlobalExport(w.internalName,k)}}let c=this.lazyFunctions;do{let A=new Array;for(let S=Set_values(c),k=0,w=S.length;k<w;++k){let R=unchecked(S[k]);A.push(R)}c.clear();for(let S=0,k=A.length;S<k;++S)this.compileFunction(unchecked(A[S]),!0)}while(c.size);let f=this.functionTable,_=this.overrideStubs;for(let A=0,S=f.length;A<S;++A){let k=f[A];k.is(268435456)?(assert(k.is(262144)),f[A]=this.ensureOverrideStub(k)):k.signature.requiredParameters<k.signature.parameterTypes.length&&(f[A]=this.ensureVarargsStub(k))}let d=new Set;do{s.discoveredOverride=!1;for(let A=Set_values(_),S=0,k=A.length;S<k;++S){let w=unchecked(A[S]),R=s.resolveOverrides(w);if(R)for(let C=0,M=R.length;C<M;++C)this.compileFunction(R[C]);d.add(w)}}while(_.size>d.size||s.discoveredOverride);d.clear();for(let A=Set_values(_),S=0,k=A.length;S<k;++S)this.finalizeOverrideStub(A[S]);for(let A=Map_keys(this.pendingInstanceOf),S=0,k=A.length;S<k;++S){let w=A[S],R=assert(this.pendingInstanceOf.get(w));switch(w.kind){case 7:case 9:{this.finalizeInstanceOf(w,R);break}case 6:case 8:{this.finalizeAnyInstanceOf(w,R);break}default:assert(!1)}}t.removeGlobal(g.rtti_base),this.runtimeFeatures&8&&Sx(this),this.runtimeFeatures&16&&Ex(this),this.runtimeFeatures&32&&Tx(this);let m=i64_align(this.memoryOffset,e.usizeType.byteSize);t.removeGlobal(g.data_end),((this.runtimeFeatures&1)!=0||a)&&(e.isWasm64?t.addGlobal(g.data_end,P.I64,!1,t.i64(i64_low(m),i64_high(m))):t.addGlobal(g.data_end,P.I32,!1,t.i32(i64_low(m)))),t.removeGlobal(g.stack_pointer),((this.runtimeFeatures&2)!=0||a)&&(m=i64_align(i64_add(m,i64_new(e.stackSize)),e.usizeType.byteSize),e.isWasm64?t.addGlobal(g.stack_pointer,P.I64,!0,t.i64(i64_low(m),i64_high(m))):t.addGlobal(g.stack_pointer,P.I32,!0,t.i32(i64_low(m)))),t.removeGlobal(g.heap_base),((this.runtimeFeatures&4)!=0||a)&&(e.isWasm64?t.addGlobal(g.heap_base,P.I64,!1,t.i64(i64_low(m),i64_high(m))):t.addGlobal(g.heap_base,P.I32,!1,t.i32(i64_low(m)))),this.initDefaultMemory(m),this.initDefaultTable(),this.runtimeFeatures&64&&(t.addFunction(g.setArgumentsLength,P.I32,P.None,null,t.global_set(this.ensureArgumentsLength(),t.local_get(0,P.I32))),t.addFunctionExport(g.setArgumentsLength,ca.setArgumentsLength));let h=!o.length,b=e.exportStart;if(!h||b!=null){let A=l.signature;!h&&b!=null&&(t.addGlobal(g.started,P.I32,!0,t.i32(0)),o.unshift(t.global_set(g.started,t.i32(1))),o.unshift(t.if(t.global_get(g.started,P.I32),t.return())));let S=t.addFunction(l.internalName,A.paramRefs,A.resultRefs,l.getNonParameterLocalTypeRefs(),t.flatten(o));l.finalize(t,S),b==null?t.setStart(S):!$e(b)||t.hasExport(b)?this.error(110,Te.native.range,b):t.addFunctionExport(l.internalName,b)}return a&&this.shadowStack.walkModule(),i.lookup("ASC_RTRACE")!=null&&new ou(this).walkModule(),t}initDummyMemory(){let e=this.options;this.module.setMemory(0,Jt.UNLIMITED_MEMORY,[],e.target,null,B.DefaultMemory,e.sharedMemory)}initDefaultMemory(e){this.memoryOffset=e;let t=this.options,i=this.module,s=this.memorySegments,a=0,l=Jt.UNLIMITED_MEMORY,o=!1;(t.memoryBase||s.length)&&(a=u32(i64_low(i64_shr_u(i64_align(e,65536),i64_new(16))))),t.initialMemory&&(t.initialMemory<a?this.error(105,null,a.toString()):a=t.initialMemory),t.maximumMemory&&(t.maximumMemory<a?this.error(106,null,a.toString()):l=t.maximumMemory),t.sharedMemory&&(o=!0,t.maximumMemory||(this.error(107,null),o=!1),t.hasFeature(32)||(this.error(108,null),o=!1));let u=t.lowMemoryLimit;if(u){let c=i64_new(u&-16);i64_gt(e,c)&&this.error(104,null,i64_to_string(e),i64_to_string(c))}i.setMemory(a,l,s,t.target,t.exportMemory?ca.Memory:null,B.DefaultMemory,o),t.importMemory&&i.addMemoryImport(B.DefaultMemory,gi.DefaultNamespace,gi.Memory,o)}initDefaultTable(){let e=this.options,t=this.module;e.importTable&&(t.addTableImport(B.DefaultTable,gi.DefaultNamespace,gi.Table),t.setClosedWorld(!1),e.pedantic&&e.willOptimize&&this.pedantic(901,null)),e.exportTable&&(t.addTableExport(B.DefaultTable,ca.Table),t.setClosedWorld(!1),e.pedantic&&e.willOptimize&&this.pedantic(902,null));let i=e.tableBase;i||(i=1);let s=this.functionTable,a=new Array(s.length);for(let u=0,c=s.length;u<c;++u)a[u]=s[u].internalName;let l=i+s.length,o=Jt.UNLIMITED_TABLE;e.importTable||e.exportTable||(o=l,e.willOptimize&&t.setPassArgument("directize-initial-contents-immutable","true")),t.addFunctionTable(B.DefaultTable,l,o,a,t.i32(i))}compileModuleExports(e){let t=e.exports;if(t)for(let s=Map_keys(t),a=0,l=s.length;a<l;++a){let o=unchecked(s[a]),u=assert(t.get(o));this.compileModuleExport(o,u)}let i=e.exportsStar;if(i)for(let s=0,a=i.length;s<a;++s)this.compileModuleExports(i[s])}compileModuleExport(e,t,i=""){let s=this.module;switch(t.kind){case 4:{let a=t;if(!a.is(65536)){let l=this.resolver.resolveFunction(a,null);l&&this.compileModuleExport(e,l,i);return}break}case 5:{let a=t;if(!a.hasDecorator(512)){let l=a.signature;if(l.requiredParameters<l.parameterTypes.length&&(a=this.ensureVarargsStub(a),this.runtimeFeatures|=64),this.compileFunction(a),a.is(8388608)){let o=i+e;if(!s.hasExport(o)){if(s.addFunctionExport(a.internalName,o),this.hasCustomFunctionExports=!0,l.hasManagedOperands&&this.shadowStack.noteExport(o,l.getManagedOperandIndices()),!this.desiresExportRuntime){let c=l.thisType;if(c&&yi(c)||mi(l.returnType))this.desiresExportRuntime=!0;else{let f=l.parameterTypes;for(let _=0,d=f.length;_<d;++_)if(yi(f[_])){this.desiresExportRuntime=!0;break}}}a.signature.returnType.kind==16&&this.module.setClosedWorld(!1)}return}}break}case 0:{let a=t;if(!(a.is(8)||a.is(96))&&!this.options.hasFeature(2)){this.warning(103,a.identifierNode.range,"mutable-globals");return}if(this.compileGlobal(a),a.is(8388608)){let o=i+e;if(!s.hasExport(o)){if(s.addGlobalExport(t.internalName,o),!this.desiresExportRuntime){let u=a.type;(mi(u)||!a.is(8)&&yi(u))&&(this.desiresExportRuntime=!0)}a.type.kind==16&&this.module.setClosedWorld(!1)}a.type==p.v128&&this.warning(112,a.typeNode?assert(a.typeNode).range:a.identifierNode.range,"v128");return}break}case 2:{this.compileEnum(t);let a=t.members;if(a){let l=i+e+es;for(let o=Map_keys(a),u=0,c=o.length;u<c;++u){let f=unchecked(o[u]),_=assert(a.get(f));_.is(512)||this.compileModuleExport(f,_,l)}}return}case 3:{let a=t;if(!a.isImmutable&&!this.options.hasFeature(2)){this.error(103,a.identifierNode.range,"mutable-globals");return}if(a.is(8388608)){let l=i+e;s.hasExport(l)||s.addGlobalExport(t.internalName,l);return}break}}this.warning(235,t.identifierNode.range)}compileFileByPath(e,t){let i,s=this.program.filesByName,a;if(s.has(e))i=assert(s.get(e));else if(s.has(a=e+Qe))i=assert(s.get(a));else{this.error(6054,t.range,e);return}this.compileFile(i)}compileFile(e){if(e.is(8388608))return;e.set(8388608);let t=e.startFunction,i=t.signature,s=this.currentBody,a=new Array;this.currentBody=a;let l=this.currentFlow,o=t.flow;this.currentFlow=o;for(let u=e.source.statements,c=0,f=u.length;c<f;++c)this.compileTopLevelStatement(u[c],a);if(this.currentFlow=l,this.currentBody=s,a.length){let u=this.module,c=t.localsByIndex,f=c.length,_=new Array(f);for(let m=0;m<f;++m)_[m]=c[m].type.toRef();let d=u.addFunction(t.internalName,i.paramRefs,i.resultRefs,_,u.flatten(a));t.finalize(u,d),s.push(u.call(t.internalName,null,P.None))}}compileGlobalLazy(e,t){return e.is(8388608)?!e.is(16777216):e.hasAnyDecorator(1536)||e.is(32768)||this.hasConstantInitializer(e)?this.compileGlobal(e):(this.errorRelated(2448,t.range,e.identifierNode.range,e.internalName),!1)}hasConstantInitializer(e){let t=e.initializerNode;return t!=null&&t.evaluatesToConst}compileGlobal(e){if(e.is(8388608))return!e.is(16777216);e.set(8388608);let t=this.pendingElements;t.add(e);let i=this.module,s=0,a=e.typeNode,l=e.initializerNode;if(!e.is(4194304))if(a){let m=this.resolver.resolveType(a,null,e.parent);if(!m)return e.set(16777216),t.delete(e),!1;if(m==p.void)return this.error(1110,a.range),e.set(16777216),t.delete(e),!1;if(e.setType(m),this.program.checkTypeSupported(m,a),this.program.checkInlineStructValue(m,a,"a global"),!this.checkFixedArrayStoragePosition(m,a,"a global"))return e.set(16777216),t.delete(e),!1}else if(l){let m=this.currentFlow;if(e.hasDecorator(1024)&&(this.currentFlow=e.file.startFunction.flow),s=this.compileExpression(l,p.auto,20),this.currentFlow=m,this.currentType==p.void)return this.error(2322,l.range,this.currentType.toString(),"<auto>"),e.set(16777216),t.delete(e),!1;e.setType(this.currentType),this.program.checkInlineStructValue(this.currentType,l,"a global")}else return this.error(1110,e.identifierNode.range.atEnd),e.set(16777216),t.delete(e),!1;if(e.hasDecorator(512)){let m=e.internalName;return sr.has(m)&&assert(sr.get(m))(new Ws(this,e)),t.delete(e),!0}let o=e.type;!l&&!e.is(16384)&&o.isReference&&!o.isNullableReference&&this.error(238,e.identifierNode.range);let u=o.toRef(),c=e.is(8)||e.is(96),f=e.hasDecorator(64);if(e.is(32768))return c||this.options.hasFeature(2)?(Cx(e,e.declaration),this.program.markModuleImport(An,Nr,e),i.addGlobalImport(e.internalName,An,Nr,u,!c),t.delete(e),!this.desiresExportRuntime&&yi(o)&&(this.desiresExportRuntime=!0),!0):(this.error(103,e.declaration.range,"mutable-globals"),e.set(16777216),t.delete(e),!1);let _=!1;if(l){if(!s){let m=this.currentFlow;e.hasDecorator(1024)&&(this.currentFlow=e.file.startFunction.flow),s=this.compileExpression(l,o,21),this.currentFlow=m}if(!i.isConstExpression(s))if(c){let m=i.runExpression(s,1);m?s=m:_=!0}else _=!0;if(_&&re(s)==10){let m=assert(xs(s));if(!xf(i.getGlobal(m))){let h=this.program.elementsByName;h.has(m)&&assert(h.get(m)).is(32768)&&(_=!1)}}if(f)if(_)this.warning(206,l.range);else{switch(assert(re(s)==14),pe(s)){case P.I32:{e.constantValueKind=1,e.constantIntegerValue=i64_new(ae(s),0);break}case P.I64:{e.constantValueKind=1,e.constantIntegerValue=i64_new(Ne(s),Ge(s));break}case P.F32:{e.constantValueKind=2,e.constantFloatValue=Ce(s);break}case P.F64:{e.constantValueKind=2,e.constantFloatValue=Pe(s);break}default:return assert(!1),e.set(16777216),t.delete(e),!1}e.set(33554432)}}else{if(o.kind==14)return this.error(100,(a||l||e.declaration).range,"a `[T * N]` global without an initializer (a fixed array is a view of storage someone else owns; Landing 5c). Give it a `changetype<[T * N]>(ptr)` initializer, or use `[T *]` for an unknown-length view"),e.set(16777216),t.delete(e),!1;e.is(33554432)?s=this.compileInlineConstant(e,e.type,16):s=this.makeZero(o)}let d=e.internalName;if(_){f&&this.error(212,Zt(9,e.decoratorNodes).range,"inline");let m=o;o.isExternalReference&&!o.is(512)&&(e.set(-2147483648),m=o.asNullable()),i.addGlobal(d,m.toRef(),!0,this.makeZero(m)),this.currentBody.push(i.global_set(d,s))}else f||i.addGlobal(d,u,!c,s);return t.delete(e),!0}compileEnum(e){if(e.is(8388608))return!e.is(16777216);e.set(8388608);let t=this.resolver.resolveEnumType(e),i=this.pendingElements;i.add(e);let s=this.module,a=this.currentParent;this.currentParent=e;let l=null,o=!1,u=e.is(8)||e.hasDecorator(64),c=e.members;if(c)for(let f=Map_values(c),_=0,d=f.length;_<d;++_){let m=unchecked(f[_]);if(m.kind!=3)continue;let h=!1,b=m,A=b.valueNode;b.set(8388608);let S=this.currentFlow;e.hasDecorator(1024)&&(this.currentFlow=e.file.startFunction.flow);let k;if(A){if(k=this.compileExpression(A,t,1),re(k)!=14){let w=s.runExpression(k,1);w?k=w:(e.is(8)&&this.error(2474,A.range),h=!0)}}else if(l==null)k=s.i32(0);else if(o&&this.error(1061,b.identifierNode.range.atEnd),u){let w=i64_add(l.constantIntegerValue,i64_new(1));assert(!i64_high(w)),k=s.i32(i64_low(w))}else{k=s.binary(0,s.global_get(l.internalName,P.I32),s.i32(1));let w=s.runExpression(k,1);w?k=w:(e.is(8)&&this.error(2474,m.declaration.range),h=!0)}if(this.currentFlow=S,h)s.addGlobal(b.internalName,P.I32,!0,s.i32(0)),this.currentBody.push(this.makeGlobalAssignment(b,k,p.i32,!1)),o=!0;else{let w=ae(k);this.enumMemberValueFits(w,t)||this.error(6404,A?A.range:b.identifierNode.range,b.name,t.toString()),u?(b.setConstantIntegerValue(i64_new(w),t),b.is(1048576)&&s.addGlobal(b.internalName,P.I32,!1,k)):s.addGlobal(b.internalName,P.I32,!1,k),b.isImmutable=!0,o=!1}l=b}return this.currentParent=a,i.delete(e),!0}enumMemberValueFits(e,t){switch(t.kind){case 1:return e>=i8.MIN_VALUE&&e<=i8.MAX_VALUE;case 6:return e>=0&&e<=u8.MAX_VALUE;case 2:return e>=i16.MIN_VALUE&&e<=i16.MAX_VALUE;case 7:return e>=0&&e<=u16.MAX_VALUE;default:return!0}}ensureEnumToString(e,t){if(e.toStringFunctionName)return e.toStringFunctionName;if(!this.compileEnum(e))return null;if(e.is(8))return this.errorRelated(2476,t.range,e.identifierNode.range),null;let i=e.members;if(!i)return null;let s=this.module,a=e.hasDecorator(64),l=`${e.internalName}#${B.EnumToString}`;e.toStringFunctionName=l;let o=new Array;for(let u=Map_keys(i),c=Map_values(i),f=1,_=u.length;f<=_;++f){let d=unchecked(u[_-f]),m=unchecked(c[_-f]);if(m.kind!=3)continue;let h=m,b=a?s.i32(i64_low(h.constantIntegerValue)):s.global_get(h.internalName,P.I32),A=s.if(s.binary(15,b,s.local_get(0,P.I32)),s.return(this.ensureStaticString(d)));o.push(A)}return o.push(s.unreachable()),s.addFunction(l,P.I32,P.I32,null,s.block(null,o,P.I32)),l}compileFunction(e,t=!1){if(e.is(16777216))return!1;if(e.is(8388608))return!0;if(!t){if(e.hasDecorator(512))return!0;if(e.hasDecorator(1024))return this.lazyFunctions.add(e),!0}let i=e.prototype.functionTypeNode.parameters,s=i.length;if(s>=2){let d=new Set;d.add(i[0].name.text);for(let m=1;m<s;m++){let h=i[m].name,b=h.text;d.has(b)?this.error(2300,h.range,b):d.add(b)}}e.set(8388608);let a=this.pendingElements;a.add(e);let l=this.currentType,o=this.module,u=e.signature,c=e.prototype.bodyNode,f=e.declaration;if(assert(f.kind==59||f.kind==62),this.checkSignatureSupported(e.signature,f.signature),!this.checkFixedArrayStorageInSignature(e.signature,f.signature))return e.set(16777216),a.delete(e),this.currentType=l,!1;if(u.hasHiddenDestParam&&e.is(268435456)&&this.error(100,f.name.range,"an @inline struct return on a virtual method (the override stub has no destination parameter; deferred)"),u.hasHiddenDestParam&&(e.is(1048576)||e.hasAnyDecorator(384))&&this.error(100,f.name.range,"an @inline struct return across the module boundary (the host would have to pass the destination pointer; that is an ABI version, not this phase)"),e.is(1048576)||e.hasAnyDecorator(384)){let d=u.parameterTypes;for(let m=0,h=d.length;m<h;++m){let b=unchecked(d[m]);if(!u.crossesByValueParam(m))continue;if(fe.fieldCountOf(b)==1){let S=e.prototype.functionTypeNode.parameters[m];this.error(100,S.type.range,"an @inline struct with a single field at a host boundary (the C/WASM tool convention passes a one-scalar struct as the scalar itself, while this compiler passes records as pointers; both are `(param i32)`, so the disagreement is silent. Pass the scalar directly, or use a struct with two or more fields)");break}}}if(e.hasAnyDecorator(384)&&!u.externalBoundary){let d=u.parameterTypes;for(let m=0,h=d.length;m<h;++m)if(this.isInlineStructType(unchecked(d[m]))){let b=e.prototype.functionTypeNode.parameters[m];this.error(100,b.type.range,"an @inline struct as an @external parameter (flattening the record into one WASM parameter per field would make its field list part of the host ABI; the by-value temp is the implemented path, so this declaration did not take it)");break}}if(e.is(1048576)&&!e.hasAnyDecorator(384)&&!u.exportByValParams){let d=u.parameterTypes;for(let m=0,h=d.length;m<h;++m){if(this.isInlineStructType(unchecked(d[m]))){let b=e.prototype.functionTypeNode.parameters[m];this.error(100,b.type.range,"an @inline struct as an export parameter (flattening the record into one WASM parameter per field would make its field list part of the host ABI; the by-value pointer parameter is the implemented path, so this declaration did not take it)");break}if(this.isValueFormFixedArray(unchecked(d[m]))){let b=e.prototype.functionTypeNode.parameters[m];this.error(100,b.type.range,"a `[T * N]` value as an export parameter (one WASM parameter per element leaf would make the extent and layout part of the host ABI). Pass `@unmanaged [T * N]` \u2014 a pointer \u2014 and the count separately");break}}}let _=0;if(c){if(e.is(32768)&&this.error(1183,e.identifierNode.range),e.hasAnyDecorator(384)){let b=e.decoratorNodes,A;(A=Zt(10,b))&&this.error(212,A.range,"external"),(A=Zt(11,b))&&this.error(212,A.range,"external.js")}let d=this.currentFlow,m=e.flow;this.currentFlow=m;let h=new Array;u.exportByValParams&&this.emitExportByValPrologue(e,h),this.compileFunctionBody(e,h)||h.push(o.unreachable()),this.currentFlow=d,_=o.addFunction(e.internalName,u.paramRefs,u.resultRefs,e.getNonParameterLocalTypeRefs(),o.flatten(h,u.resultRefs))}else if(e.is(32768)){if(Cx(e,f),this.program.markModuleImport(An,Nr,e),o.addFunctionImport(e.internalName,An,Nr,u.paramRefs,u.resultRefs),_=o.getFunction(e.internalName),!this.desiresExportRuntime){let d=u.thisType;if(d&&mi(d)||yi(u.returnType))this.desiresExportRuntime=!0;else{let m=u.parameterTypes;for(let h=0,b=m.length;h<b;++h)if(mi(m[h])){this.desiresExportRuntime=!0;break}}}}else if(e.is(128)||e.parent.kind==9)_=o.addFunction(e.internalName,u.paramRefs,u.resultRefs,null,o.unreachable());else{if(e.isAny(6144)){let d=e.declaration.name.text,m=assert(e.parent.getMember(d));assert(m.kind==10);let h=m.instance;h&&h.isField&&(_=e.is(2048)?this.makeBuiltinFieldGetter(h):this.makeBuiltinFieldSetter(h),assert(e.is(8388608)))}_||(this.error(2391,e.identifierNode.range),e.set(16777216))}if((e.is(32768)||e.is(2))&&u.hasVectorValueOperands){let m,h=e.prototype.functionTypeNode;if(u.returnType==p.v128)m=h.returnType.range;else{let b=u.getVectorValueOperandIndices()[0];m=h.parameters[b].range}this.warning(112,m,"v128")}return e.finalize(o,_),this.currentType=l,a.delete(e),!0}compileFunctionBody(e,t){let i=this.module,s=assert(e.prototype.bodyNode),a=e.signature.returnType,l=this.currentFlow,o=e.signature.thisType?assert(l.lookupLocal(B.this_)):null,u=t.length;if(e.prototype.envKind==2){let c=assert(e.prototype.envClass),f=e.declaration.range.source,_=assert(this.program.filesByName.get(f.internalPath)),d=assert(_.getMember(c)),m=d.typeParameterNodes,h=null;if(m!=null&&m.length>0){let S=l.contextualTypeArguments,k=new Array(m.length);for(let w=0,R=m.length;w<R;++w){let C=m[w].name.text,M=S!=null?J(S,C):null;if(M==null)return this.error(1140,e.declaration.range),!1;k[w]=M}h=k}let b=assert(this.resolver.resolveClass(d,h,new Map,1)),A=l.addScopedLocal(Rx,b.type);l.setLocalFlag(A.index,8)}{let c=e.signature.parameterTypes,f=e.prototype.declaration.signature.parameters,_=l.scopedLocals;if(_!=null)for(let d=0,m=c.length;d<m&&!(d>=f.length);++d){let h=f[d].type;if(h==null||h.kind!=72)continue;let b=h.lengthName.text,A=e.getParameterName(d);if(!_.has(b)||!_.has(A))continue;let S=assert(_.get(b)),k=assert(_.get(A));S.isDynamicLength&&(t.push(i.local_set(S.index,i.load(4,!1,i.local_get(k.index,P.I32),P.I32,0,4),!1)),l.setLocalFlag(S.index,8))}}if(s.kind==34)t=this.compileStatements(s.statements,t);else{assert(s.kind==42),assert(e.prototype.arrowKind),assert(!e.isAny(530432));let c=this.compileExpression(s.expression,a,1);l.canOverflow(c,a)||l.set(2),l.isNonnull(c,a)&&l.set(4),t?t.push(c):t=[c],l.is(256)||(l.canOverflow(c,a)||l.set(2),l.isNonnull(c,a)&&l.set(4),l.set(257))}if(e.is(524288)){assert(e.is(262144)),o=assert(o);let c=assert(e.parent);assert(c.kind==7);let f=c;if(l.isAny(8256)||!l.is(256)){let _=new Array;_.push(this.makeConditionalAllocation(f,o.index)),this.makeFieldInitializationInConstructor(f,_);for(let d=t.length-1;d>=u;--d)t[d+1]=t[d];t[u]=i.flatten(_,P.None),l.is(16384)&&this.options.pedantic&&this.pedantic(905,e.identifierNode.range)}l.is(16384)&&!f.hasDecorator(32)&&this.error(231,f.identifierNode.range),l.is(256)||(t.push(i.local_get(o.index,o.type.toRef())),l.set(261)),f.base&&!f.prototype.implicitlyExtendsObject&&!l.is(128)&&this.error(2377,e.prototype.declaration.range)}else if(a!=p.void&&!l.is(256))return this.error(2355,e.prototype.functionTypeNode.returnType.range),!1;if(e.prototype.capturesThis){assert(!l.isInline);let c=assert(l.lookupLocal(B.this_));assert(!e.signature.thisType);let f=i.local_set(c.index,i.global_get(this.ensureEnvGlobal(),this.options.sizeTypeRef),c.type.isManaged);for(let _=t.length-1;_>=u;--_)t[_+1]=t[_];t[u]=f,l.setLocalFlag(c.index,8)}if(e.prototype.envKind==2){let c=assert(l.lookupLocal(Rx)),f=i.local_set(c.index,i.global_get(this.ensureEnvGlobal(),this.options.sizeTypeRef),c.type.isManaged);for(let _=t.length-1;_>=u;--_)t[_+1]=t[_];t[u]=f}return!0}makeBuiltinFieldGetter(e){let t=assert(e.getterInstance),i=this.module,s=e.type,a=s.toRef(),l=this.options.sizeTypeRef;t.set(8388608);let o=i.load(s.byteSize,s.isSignedIntegerValue,i.local_get(0,l),a,e.memoryOffset),u=this.currentFlow,c=t.flow;return this.currentFlow=c,e.is(16384)&&s.isReference&&!s.isNullableReference&&(o=this.makeRuntimeNonNullCheck(o,s,t.identifierNode)),this.currentFlow=u,i.addFunction(t.internalName,l,a,t.getNonParameterLocalTypeRefs(),o)}makeBuiltinFieldSetter(e){let t=assert(e.setterInstance),i=this.module,s=e.type,a=this.options.sizeTypeRef,l=s.toRef(),o=i.store(s.byteSize,i.local_get(0,a),i.local_get(1,l),l,e.memoryOffset);if(s.isManaged){let u=t.parent;if(assert(u.kind==7),u.type.isManaged){let c=this.program.linkInstance;this.compileFunction(c),o=i.block(null,[o,i.call(c.internalName,[i.local_get(0,a),i.local_get(1,l),i.i32(0)],P.None)],P.None)}}return t.set(8388608),i.addFunction(t.internalName,it([a,l]),P.None,null,o)}addAlignedMemorySegment(e,t=16){assert(Hr(t));let i=i64_align(this.memoryOffset,t),s=new ei(e,i);return this.memorySegments.push(s),this.memoryOffset=i64_add(i,i64_new(e.length)),s}addRuntimeMemorySegment(e){let t=this.program.computeBlockStart64(this.memoryOffset),i=new ei(e,t);return this.memorySegments.push(i),this.memoryOffset=i64_add(t,i64_new(e.length)),i}ensureStaticString(e){let t=this.ensureStaticStringPtr(e);return this.currentType=this.program.stringInstance.type,this.module.usize(t)}ensureStaticStringPtr(e){let t=this.program,i=t.totalOverhead,s=assert(t.stringInstance),a,l=this.stringSegments;if(l.has(e))a=assert(l.get(e));else{let c=e.length,f=s.createBuffer(c<<1);for(let _=0;_<c;++_)br(e.charCodeAt(_),f,i+(_<<1));a=this.addRuntimeMemorySegment(f),l.set(e,a)}let o=i64_add(a.offset,i64_new(i)),u=this.staticGcObjectOffsets;if(u.has(i64_high(o)))assert(u.get(i64_high(o))).add(i64_low(o));else{let c=new Set;c.add(i64_low(o)),u.set(i64_high(o),c)}return o}writeStaticBuffer(e,t,i,s){let a=s.length,l=i.byteSize,o=i.toRef();switch(o){case P.I32:{switch(l){case 1:{for(let u=0;u<a;++u){let c=s[u];assert(pe(c)==o),assert(re(c)==14),be(ae(c),e,t),t+=1}break}case 2:{for(let u=0;u<a;++u){let c=s[u];assert(pe(c)==o),assert(re(c)==14),br(ae(c),e,t),t+=2}break}case 4:{for(let u=0;u<a;++u){let c=s[u];assert(pe(c)==o),assert(re(c)==14),Se(ae(c),e,t),t+=4}break}default:assert(!1)}break}case P.I64:{for(let u=0;u<a;++u){let c=s[u];assert(pe(c)==o),assert(re(c)==14),Wn(i64_new(Ne(c),Ge(c)),e,t),t+=8}break}case P.F32:{for(let u=0;u<a;++u){let c=s[u];assert(pe(c)==o),assert(re(c)==14),Wr(Ce(c),e,t),t+=4}break}case P.F64:{for(let u=0;u<a;++u){let c=s[u];assert(pe(c)==o),assert(re(c)==14),Kr(Pe(c),e,t),t+=8}break}case P.V128:{for(let u=0;u<a;++u){let c=s[u];assert(pe(c)==o),assert(re(c)==14),Up(df(c),e,t),t+=16}break}case P.None:break;default:assert(!1)}return t}addStaticBuffer(e,t,i=this.program.arrayBufferInstance.id){let s=this.program,l=s.arrayBufferInstance.createBuffer(t.length*e.byteSize);return this.program.OBJECTInstance.writeField("rtId",i,l,0),this.writeStaticBuffer(l,s.totalOverhead,e,t),this.addRuntimeMemorySegment(l)}addStaticArrayHeader(e,t,i=null){let s=this.program;i||(i=assert(this.resolver.resolveClass(this.program.arrayPrototype,[e])));let a=qn(t.buffer,s.OBJECTInstance.offsetof("rtSize")),l=i32(a/e.byteSize),o=i64_add(t.offset,i64_new(s.totalOverhead)),u=i.createBuffer();return assert(i.writeField("buffer",o,u)),assert(i.writeField("dataStart",o,u)),assert(i.writeField("byteLength",a,u)),assert(i.writeField("length_",l,u)),this.addRuntimeMemorySegment(u)}ensureRuntimeFunction(e){assert(e.is(8388608)&&!e.is(134217728));let t=this.program,i=e.memorySegment;if(!i){let s=this.ensureFunctionTableIndex(e),a=assert(this.resolver.resolveClass(t.functionPrototype,[e.type]));this.assertFunctionLayout(a);let l=a.createBuffer();assert(a.writeField("_index",s,l)),assert(a.writeField("_env",0,l)),e.memorySegment=i=this.addRuntimeMemorySegment(l)}return i64_add(i.offset,i64_new(t.totalOverhead))}ensureFunctionTableIndex(e){let t=e.tableIndex;if(t)return t;this.options.importTable||this.module.ensureFunctionTable(B.DefaultTable);let i=this.functionTable,s=this.options.tableBase;s||(s=1);let a=s+i.length;return i.push(e),e.tableIndex=a,a}compileTopLevelStatement(e,t){switch(e.kind){case 55:{let i=e.members;for(let s=0,a=i.length;s<a;++s)this.compileTopLevelStatement(i[s],t);break}case 56:{let i=this.program.getElementByDeclaration(e);i&&(assert(i.kind==2),i.hasDecorator(1024)||this.compileEnum(i));break}case 63:{let i=e,s=this.program.getElementByDeclaration(i);if(s){let a=this.currentParent;this.currentParent=s;let l=i.members;for(let o=0,u=l.length;o<u;++o)this.compileTopLevelStatement(l[o],t);this.currentParent=a}break}case 51:{let i=e.declarations;for(let s=0,a=i.length;s<a;++s){let l=this.program.getElementByDeclaration(i[s]);l&&(assert(l.kind==0),!l.is(32768)&&!l.hasDecorator(1024)&&this.compileGlobal(l))}break}case 58:{let i=this.program.getElementByDeclaration(e);i&&i.kind==0&&(i.hasDecorator(1024)||this.compileGlobal(i));break}case 39:{let i=e,s=i.internalPath;s!=null&&this.compileFileByPath(s,assert(i.path));break}case 40:{this.compileTopLevelStatement(e.declaration,t);break}case 46:{let i=e;this.compileFileByPath(i.internalPath,i.path);break}case 59:case 62:case 61:case 69:case 64:break;default:{let i=this.compileStatement(e);re(i)!=22&&t.push(i);break}}}compileStatement(e){let t=this.module,i;switch(e.kind){case 34:{i=this.compileBlockStatement(e);break}case 35:{i=this.compileBreakStatement(e);break}case 36:{i=this.compileContinueStatement(e);break}case 37:{i=this.compileDoStatement(e);break}case 38:{i=this.compileEmptyStatement(e);break}case 42:{i=this.compileExpressionStatement(e);break}case 43:{i=this.compileForStatement(e);break}case 44:{i=this.compileForOfStatement(e);break}case 45:{i=this.compileIfStatement(e);break}case 47:{i=this.compileReturnStatement(e);break}case 48:{i=this.compileSwitchStatement(e);break}case 49:{i=this.compileThrowStatement(e);break}case 50:{i=this.compileTryStatement(e);break}case 51:{i=this.compileVariableStatement(e),i||(i=t.nop());break}case 52:{i=this.compileVoidStatement(e);break}case 53:{i=this.compileWhileStatement(e);break}case 64:{i=this.compileTypeDeclaration(e);break}case 54:{i=t.nop();break}default:assert(!1),i=t.unreachable()}return this.options.sourceMap&&this.addDebugLocation(i,e.range),i}compileStatements(e,t=null){let i=e.length;t||(t=new Array(i),t.length=0);let s=this.currentFlow;for(let a=0;a<i;++a){let l=this.compileStatement(e[a]);switch(re(l)){case 1:if(!As(l)){for(let o=0,u=Ts(l);o<u;++o)t.push(Ss(l,o));break}default:t.push(l);case 22:}if(s.isAny(272))break}return t}compileBlockStatement(e){let t=e.statements,i=this.currentFlow,s=i.fork();this.currentFlow=s;let a=this.compileStatements(t);return i.inherit(s),this.currentFlow=i,this.module.flatten(a)}compileTypeDeclaration(e){let t=this.currentFlow,i=e.name.text,s=t.lookupScopedTypeAlias(i);if(s)return this.errorRelated(2300,e.range,s.declaration.range,i),this.module.unreachable();let a=new lt(i,t.sourceFunction,e,0);return t.addScopedTypeAlias(i,a),this.module.nop()}compileBreakStatement(e){let t=this.module,i=e.label;if(i)return this.error(100,i.range,"Break label"),t.unreachable();let s=this.currentFlow,a=s.breakLabel;return a==null?(this.error(1105,e.range),t.unreachable()):(s.set(16),t.br(a))}compileContinueStatement(e){let t=this.module,i=e.label;if(i)return this.error(100,i.range,"Continue label"),t.unreachable();let s=this.currentFlow,a=s.continueLabel;return a==null?(this.error(1104,e.range),t.unreachable()):(s.set(288),t.br(a))}compileDoStatement(e){return this.doCompileDoStatement(e)}doCompileDoStatement(e){let t=this.module,i=this.currentFlow,s=i.targetFunction.localsByIndex.length,a=i.fork(!0),l=a.pushControlFlowLabel(),o=`do-break|${l}`;a.breakLabel=o;let u=`do-continue|${l}`;a.continueLabel=u;let c=`do-loop|${l}`;this.currentFlow=a;let f=new Array,_=e.body;_.kind==34?this.compileStatements(_.statements,f):f.push(this.compileStatement(_)),a.popControlFlowLabel(l);let d=a.isAny(4128),m=a.isAny(2064),h=!a.isAny(272);if(!h&&!d)f.push(t.unreachable()),i.inherit(a),m||i.set(256);else{let A=this.compileExpression(e.condition,p.bool),S=this.makeIsTrueish(A,this.currentType,e.condition),k=this.evaluateCondition(S);if(k!=2&&(d||h)&&i.resetIfNeedsRecompile(a.forkThen(A),s))return this.currentFlow=i,this.doCompileDoStatement(e);d&&(f[0]=t.block(u,f),f.length=1,a.unset(256)),f.push(t.br(c,S)),i.inherit(a),k==1&&!m&&i.set(256)}this.currentFlow=i;let b=t.loop(c,t.flatten(f));return m&&(b=t.block(o,[b])),i.is(256)&&(b=t.block(null,[b,t.unreachable()])),b}compileEmptyStatement(e){return this.module.nop()}compileExpressionStatement(e){return this.compileExpression(e.expression,p.void,1)}compileForStatement(e){return this.doCompileForStatement(e)}doCompileForStatement(e){let t=this.module,i=this.currentFlow,s=i.targetFunction.localsByIndex.length,a=i.fork();this.currentFlow=a;let l=new Array,o=e.initializer;o&&(assert(o.kind==42||o.kind==51),l.push(this.compileStatement(o)));let u,c,f,_=e.condition;if(_){if(u=this.compileExpression(_,p.bool),c=this.makeIsTrueish(u,this.currentType,_),f=this.evaluateCondition(c),f==2)return l.push(t.drop(c)),i.inherit(a),this.currentFlow=i,t.flatten(l)}else u=t.i32(1),c=u,f=1;let d=a.forkThen(u,!0),m=d.pushControlFlowLabel(),h=`for-break${m}`;d.breakLabel=h;let b=`for-continue|${m}`;d.continueLabel=b;let A=`for-loop|${m}`;this.currentFlow=d;let S=new Array,k=e.body;k.kind==34?this.compileStatements(k.statements,S):S.push(this.compileStatement(k)),d.popControlFlowLabel(m),d.breakLabel=null,d.continueLabel=null;let w=!d.isAny(272),R=d.isAny(4128),C=d.isAny(2064);R&&(S[0]=t.block(b,S),S.length=1),f==1?a.inherit(d):a.mergeBranch(d);let M=R||w;if(M){let D=e.incrementor;if(D&&(this.currentFlow=a,S.push(this.compileExpression(D,p.void,9))),S.push(t.br(A)),i.resetIfNeedsRecompile(d.forkThen(u),s))return this.currentFlow=i,this.doCompileForStatement(e)}i.inherit(a),this.currentFlow=i;let O=t.if(c,t.flatten(S));return M&&(O=t.loop(A,O)),C&&(O=t.block(h,[O])),l.push(O),i.is(256)&&l.push(t.unreachable()),t.flatten(l)}compileForOfStatement(e){return this.error(100,e.range,"Iterators"),this.module.unreachable()}compileIfStatement(e){let t=this.module,i=e.ifTrue,s=e.ifFalse,a=this.compileExpression(e.condition,p.bool),l=this.makeIsTrueish(a,this.currentType,e.condition);switch(this.evaluateCondition(l)){case 1:return t.block(null,[t.drop(l),this.compileStatement(i)]);case 2:return s?t.block(null,[t.drop(l),this.compileStatement(s)]):t.drop(l)}let u=this.currentFlow,c=new Array,f=u.forkThen(a);this.currentFlow=f,i.kind==34?this.compileStatements(i.statements,c):c.push(this.compileStatement(i)),this.currentFlow=u;let _=u.forkElse(a);if(s){this.currentFlow=_;let d=new Array;return s.kind==34?this.compileStatements(s.statements,d):d.push(this.compileStatement(s)),u.inheritAlternatives(f,_),this.currentFlow=u,t.if(l,t.flatten(c),t.flatten(d))}else return f.isAny(272)?(u.inherit(_),u.mergeSideEffects(f)):u.inheritAlternatives(f,_),this.currentFlow=u,t.if(l,t.flatten(c))}compileReturnStatement(e){let t=this.module,i=0,s=this.currentFlow,a=s.returnType,l=e.value;if(l){if(this.isInlineStructType(a))return this.compileSretReturnStatement(e,a);if(this.isValueFormFixedArray(a))return this.compileMultivalueReturnStatement(e,a);let o=1;s.sourceFunction.is(1048576)&&(o|=4),i=this.compileExpression(l,a,o),s.canOverflow(i,a)||s.set(2),s.isNonnull(i,a)&&s.set(4),s.sourceFunction.is(524288)&&l.kind!=26&&s.set(16384)}else if(a!=p.void)return this.error(2322,e.range,"void",a.toString()),this.currentType=a,t.unreachable();if(s.set(257),s.isInline){let o=assert(s.inlineReturnLabel);return i?this.currentType==p.void?t.block(null,[i,t.br(o)]):t.br(o,0,i):t.br(o)}return i?this.currentType==p.void?t.block(null,[i,t.return()]):t.return(i):t.return()}compileSwitchStatement(e){let t=this.module,i=e.cases,s=i.length,a=this.compileExpression(e.condition,p.auto),l=this.currentType;if(!s)return t.drop(a);let o=this.currentFlow,c=o.getTempLocal(l).index,f=new Array(1+s);f[0]=t.local_set(c,a,l.isManaged);let _=1,d=-1,m=o.pushControlFlowLabel();for(let S=0;S<s;++S){let k=i[S];if(k.isDefault){d=S;continue}let w=e.condition,R=t.local_get(c,l.toRef()),C=l,M=k.label,O=this.compileExpression(assert(k.label),l,1),D=this.currentType,Q=this.compileCommutativeCompareBinaryExpressionFromParts(77,w,R,C,M,O,D,l,e);f[_++]=t.br(`case${S}|${m}`,Q)}f[_]=t.br(d>=0?`case${d}|${m}`:`break|${m}`);let h=t.block(`case0|${m}`,f,P.None),b=null,A=null;for(let S=0;S<s;++S){let w=i[S].statements,R=w.length,C=o.fork(!0,!1);b&&C.mergeBranch(b),this.currentFlow=C;let M=`break|${m}`;C.breakLabel=M;let O=S==s-1,D=O?M:`case${S+1}|${m}`,Q=new Array(1+R);Q[0]=h;let H=1,U=!0;for(let Y=0;Y<R;++Y){let q=this.compileStatement(w[Y]);if(re(q)!=22&&(Q[H++]=q),C.isAny(272)){U=!1;break}}Q.length=H,b=U?C:null;let V=C.isAny(2064);C.unset(2064),V||O&&U?A?A.inheritAlternatives(A,C):A=C:U||o.mergeSideEffects(C),this.currentFlow=o,h=t.block(D,Q,P.None)}return o.popControlFlowLabel(m),d>=0?A?o.inherit(A):o.set(256):A&&o.mergeBranch(A),this.currentFlow=o,h}compileThrowStatement(e){this.currentFlow.set(264);let i=new Array,s=e.value,a=null;if(s.kind==19){let l=s.args;l.length&&(a=l[0])}return i.push(this.makeAbort(a,e)),this.module.flatten(i)}compileTryStatement(e){return this.error(100,e.range,"Exceptions"),this.module.unreachable()}compileLazyLocal(e,t,i,s){let a=this.module,l=this.resolver,o=e.name.text,u=i.expression,c=null;if(t){if(c=l.resolveType(t,s,s.sourceFunction,me(s.contextualTypeArguments)),!c)return 0;this.program.checkTypeSupported(c,t)}else{if(c=l.resolveExpression(u,s,p.auto,0),!c)return 0;if(c==p.void)return this.error(2322,e.range,c.toString(),"<auto>"),0}if(this.inlineStructFieldsOf(c)!=null)return this.error(100,e.range,"a '@lazy' binding of an @inline struct value"),0;if(s.getScopedLocal(o)!=null)return this.error(2300,e.name.range,o),0;let f=s.addScopedLocal(o,c),_=s.targetFunction.addLocal(p.bool,o+"$lazyDone",null);s.unsetLocalFlag(_.index,-1),s.setLocalFlag(f.index,8),c.isShortIntegerValue&&(s.unsetLocalFlag(f.index,-1),s.setLocalFlag(f.index,10));let d=this.lazyLocals;return d==null&&(d=new Map,this.lazyLocals=d),d.set(f,new b_(f.index,_.index,u)),a.local_set(_.index,a.i32(0),!1)}compileVariableStatement(e){let t=this.module,i=e.declarations,s=i.length,a=this.currentFlow,l=new Array,o=this.resolver;for(let u=0;u<s;++u){let c=i[u],f=c.name.text,_=null,d=0,m=null;c.is(16384)&&this.warning(239,c.name.range);{let k=a.lookupLocal(f);k!=null&&k.isDynamicLength&&this.error(100,c.name.range,"`"+f+"` is bound from the array header; it cannot be shadowed")}let h=c.type,b=c.initializer;if(b!=null&&b.kind==32){let k=this.compileLazyLocal(c,h,b,a);k!=0&&l.push(k);continue}if(h){if(_=o.resolveType(h,a,a.sourceFunction,me(a.contextualTypeArguments)),!_)continue;this.program.checkTypeSupported(_,h);let k=this.inlineStructFieldsOf(_);if(k!=null){this.compileSroaLocal(c,_,k,b,a,l);continue}if(this.isValueFormFixedArray(_)){this.compileSroaValueArrayLocal(c,_,b,a,l);continue}if(b){let w=this.pendingElements,R=a.addScopedDummyLocal(f,_,e);w.add(R),d=this.compileExpression(b,_,1),m=this.currentType,w.delete(R),a.freeScopedDummyLocal(f)}}else if(b){if(b.kind==8){let R=a.lookupLocal(b.text);if(R!=null&&R.fieldLocals!=null){let C=assert(this.inlineStructFieldsOf(R.type));this.compileSroaLocal(c,R.type,C,b,a,l);continue}}let k=this.pendingElements,w=a.addScopedDummyLocal(f,p.auto,e);if(k.add(w),d=this.compileExpression(b,p.auto),m=this.currentType,k.delete(w),a.freeScopedDummyLocal(f),this.currentType==p.void){this.error(2322,c.range,this.currentType.toString(),"<auto>");continue}_=m}else{this.error(1110,c.name.range.atEnd);continue}let A=c.is(8),S=!1;if(A)if(d){let k=t.runExpression(d,1);if(k){d=k;let w=null;switch(pe(d)){case P.I32:{w=new ce(f,-1,_,a.targetFunction),w.setConstantIntegerValue(i64_new(ae(d),0),_);break}case P.I64:{w=new ce(f,-1,_,a.targetFunction),w.setConstantIntegerValue(i64_new(Ne(d),Ge(d)),_);break}case P.F32:{w=new ce(f,-1,_,a.targetFunction),w.setConstantFloatValue(Ce(d),_);break}case P.F64:{w=new ce(f,-1,_,a.targetFunction),w.setConstantFloatValue(Pe(d),_);break}}if(w){let R=a.scopedLocals;if(!R)a.scopedLocals=R=new Map;else if(R.has(f)){let C=assert(R.get(f));return this.errorRelated(2300,c.name.range,C.declaration.name.range,f),this.module.unreachable()}R.set(f,w),S=!0}}}else this.error(1155,c.range);if(!S){let k=this.inlineStructFieldsOf(_);if(k!=null){this.compileSroaLocal(c,_,k,b,a,l);continue}if(this.isValueFormFixedArray(_)){this.compileSroaValueArrayLocal(c,_,b,a,l);continue}if(!this.checkFixedArrayStoragePosition(_,c.name,"a local"))continue;let w;if(c.isAny(24)||a.isInline){let R=a.getScopedLocal(f);R?(R.declaration.range.source.isNative?this.error(2300,c.name.range,f):this.errorRelated(2300,c.name.range,R.declaration.name.range,f),w=R):w=a.addScopedLocal(f,_),A&&a.setLocalFlag(w.index,1)}else{let R=a.lookupLocal(f);if(R){this.errorRelated(2300,c.name.range,R.declaration.name.range,f);continue}w=a.targetFunction.addLocal(_,f,c),a.unsetLocalFlag(w.index,-1),A&&a.setLocalFlag(w.index,1)}if(d){l.push(this.makeLocalAssignment(w,d,m||_,!1));let R=this.dynamicArrayTypeNodeOf(c);if(R!=null){let C=R.lengthName.text;if(a.lookupLocal(C)!=null)this.error(2300,R.lengthName.range,C);else{let O=a.targetFunction.addLocal(p.i32,C,c);O.isDynamicLength=!0,a.setLocalFlag(O.index,8),l.push(t.local_set(O.index,t.load(4,!1,t.local_get(w.index,_.toRef()),P.I32,0,4),!1))}}}else w.type.isShortIntegerValue&&a.setLocalFlag(w.index,2)}}return this.currentType=p.void,l.length==0?0:t.flatten(l)}compileVoidStatement(e){return this.compileExpression(e.expression,p.void,10)}compileWhileStatement(e){return this.doCompileWhileStatement(e)}doCompileWhileStatement(e){let t=this.module,i=this.currentFlow,s=i.targetFunction.localsByIndex.length,a=this.compileExpression(e.condition,p.bool),l=this.makeIsTrueish(a,this.currentType,e.condition),o=this.evaluateCondition(l);if(o==2)return t.drop(l);let u=i.forkThen(a,!0),c=u.pushControlFlowLabel(),f=`while-break|${c}`;u.breakLabel=f;let _=`while-continue|${c}`;u.continueLabel=_,this.currentFlow=u;let d=new Array,m=e.body;m.kind==34?this.compileStatements(m.statements,d):d.push(this.compileStatement(m)),d.push(t.br(_)),u.popControlFlowLabel(c);let h=u.isAny(4128),b=u.isAny(2064),A=!u.isAny(272);if((h||A)&&i.resetIfNeedsRecompile(u,s))return this.currentFlow=i,this.doCompileWhileStatement(e);let k=!1;if(o==1)i.inherit(u),b||(k=!0,i.set(256));else{let R=i.forkElse(a);!A&&!b?(i.inherit(R),i.mergeSideEffects(u)):i.inheritAlternatives(u,R)}this.currentFlow=i;let w=[t.loop(_,t.if(l,t.flatten(d)))];return k&&w.push(t.unreachable()),t.block(f,w)}compileInlineConstant(e,t,i){assert(e.is(37748736));let s=e.type;switch(this.currentType=s,s.kind){case 0:return this.module.i32(e.constantValueKind==1?i64_ne(e.constantIntegerValue,i64_zero):0);case 1:case 2:{let a=s.computeSmallIntegerShift(p.i32);return this.module.i32(e.constantValueKind==1?i64_low(e.constantIntegerValue)<<a>>a:0)}case 6:case 7:{let a=e.type.computeSmallIntegerMask(p.i32);return this.module.i32(e.constantValueKind==1?i64_low(e.constantIntegerValue)&a:0)}case 3:case 8:return this.module.i32(e.constantValueKind==1?i64_low(e.constantIntegerValue):0);case 5:case 10:if(!e.program.options.isWasm64)return this.module.i32(e.constantValueKind==1?i64_low(e.constantIntegerValue):0);case 4:case 9:return e.constantValueKind==1?this.module.i64(i64_low(e.constantIntegerValue),i64_high(e.constantIntegerValue)):this.module.i64(0);case 12:{if(!(e.hasDecorator(512)&&t==p.f32))return this.module.f64(e.constantFloatValue);this.currentType=p.f32}case 11:return this.module.f32(e.constantFloatValue);default:return assert(!1),this.module.unreachable()}}compileExpression(e,t,i=0){for(;e.kind==22;)e=e.expression;this.currentType=t,t==p.void&&(i|=8);let s;switch(e.kind){case 9:{s=this.compileAssertionExpression(e,t,i);break}case 10:{s=this.compileBinaryExpression(e,t,i);break}case 11:{s=this.compileCallExpression(e,t,i);break}case 13:{s=this.compileCommaExpression(e,t,i);break}case 14:{s=this.compileElementAccessExpression(e,t,i);break}case 16:{s=this.compileFunctionExpression(e,t,i);break}case 8:case 15:case 20:case 26:case 25:case 27:{s=this.compileIdentifierExpression(e,t,i);break}case 17:{s=this.compileInstanceOfExpression(e,t,i);break}case 18:{s=this.compileLiteralExpression(e,t,i);break}case 19:{s=this.compileNewExpression(e,t,i);break}case 23:{s=this.compilePropertyAccessExpression(e,t,i);break}case 24:{s=this.compileTernaryExpression(e,t,i);break}case 29:{s=this.compileUnaryPostfixExpression(e,t,i);break}case 30:{s=this.compileUnaryPrefixExpression(e,t,i);break}case 31:{s=this.compileLoweredAwaitExpression(e);break}case 32:{let o=e;this.warning(6398,o.range),s=this.compileExpression(o.expression,t,i);break}case 33:{let o=e;s=o.expr,this.currentType=o.type;break}case 12:{this.error(100,e.range,"Block-scoped class declarations or expressions"),s=this.module.unreachable();break}default:assert(!1),s=this.module.unreachable()}let a=this.currentType,l=(i&4)!=0;return a!=t.nonNullableType&&(i&2?(s=this.convertExpression(s,a,t,!0,e),this.currentType=a=t):i&1&&(s=this.convertExpression(s,a,t,!1,e),this.currentType=a=t)),l&&(s=this.ensureSmallIntegerWrap(s,a)),this.options.sourceMap&&this.addDebugLocation(s,e.range),s}convertExpression(e,t,i,s,a){let l=this.module;if(t.kind==26)return i.kind==26?e:(this.error(2322,a.range,t.toString(),i.toString()),l.unreachable());if(i.kind==26)return l.drop(e);if(t.isReference||i.isReference)return this.currentFlow.isNonnull(e,t)?t=t.nonNullableType:s&&t.isNullableReference&&!i.isNullableReference&&(this.options.noAssert||(e=this.makeRuntimeNonNullCheck(e,t,a)),t=t.nonNullableType),t.isAssignableTo(i)?(assert(i.isExternalReference||t.kind==i.kind),this.currentType=i,e):s&&i.nonNullableType.isAssignableTo(t)?i.isExternalReference?(this.error(100,a.range,"ref.cast"),this.currentType=i,l.unreachable()):(assert(t.kind==i.kind),this.options.noAssert||(e=this.makeRuntimeDowncastCheck(e,t,i,a)),this.currentType=i,e):(this.error(2322,a.range,t.toString(),i.toString()),this.currentType=i,l.unreachable());if(assert(!t.isReference&&!i.isReference),i.kind==t.kind)return(i.kind==14||i.kind==27)&&!i.equals(t)?(this.error(2322,a.range,t.toString(),i.toString()),this.currentType=i,l.unreachable()):(this.currentType=i,e);if(!i.isBooleanValue&&(i.isVectorValue||t.isVectorValue))return this.error(2322,a.range,t.toString(),i.toString()),l.unreachable();if(t.isAssignableTo(i)||s||this.error(200,a.range,t.toString(),i.toString()),t.isFloatValue)if(i.isFloatValue)t.kind==11?i.kind==12&&(e=l.unary(43,e)):i.kind==11&&(e=l.unary(44,e));else if(i.isIntegerValue)if(t.kind==11)if(i.isBooleanValue)e=this.makeIsTrueish(e,p.f32,a);else if(i.isSignedIntegerValue){let o=this.options.hasFeature(4);i.isLongIntegerValue?e=l.unary(o?56:26,e):e=l.unary(o?52:25,e)}else{let o=this.options.hasFeature(4);i.isLongIntegerValue?e=l.unary(o?57:28,e):e=l.unary(o?53:27,e)}else if(i.isBooleanValue)e=this.makeIsTrueish(e,p.f64,a);else if(i.isSignedIntegerValue){let o=this.options.hasFeature(4);i.isLongIntegerValue?e=l.unary(o?58:30,e):e=l.unary(o?54:29,e)}else{let o=this.options.hasFeature(4);i.isLongIntegerValue?e=l.unary(o?59:32,e):e=l.unary(o?55:31,e)}else assert(i.flags==0,"void type expected"),e=l.drop(e);else if(t.isIntegerValue&&i.isFloatValue){e=this.ensureSmallIntegerWrap(e,t);let o;i.kind==11?t.isLongIntegerValue?t.isSignedIntegerValue?o=39:o=41:t.isSignedIntegerValue?o=35:o=37:t.isLongIntegerValue?t.isSignedIntegerValue?o=40:o=42:t.isSignedIntegerValue?o=36:o=38,e=l.unary(o,e)}else t==p.v128&&i.isBooleanValue?e=this.makeIsTrueish(e,p.v128,a):t.isLongIntegerValue?i.isBooleanValue?e=l.binary(41,e,l.i64(0)):i.isLongIntegerValue||(e=l.unary(24,e)):i.isLongIntegerValue?e=l.unary(t.isSignedIntegerValue?22:23,this.ensureSmallIntegerWrap(e,t)):t.isShortIntegerValue?t.size<i.size&&(e=this.ensureSmallIntegerWrap(e,t)):!s&&!this.options.isWasm64&&t.isVaryingIntegerValue&&!i.isVaryingIntegerValue&&this.warning(201,a.range,t.toString(),i.toString());return this.currentType=i,e}compileAssertionExpression(e,t,i){let s=i&-4;switch(e.assertionKind){case 0:case 1:{let a=this.currentFlow,l=this.resolver.resolveType(assert(e.toType),a,a.sourceFunction,me(a.contextualTypeArguments));return l?this.compileExpression(e.expression,l,s|2):this.module.unreachable()}case 2:{assert(!e.toType);let a=this.compileExpression(e.expression,t.exceptVoid,s),l=this.currentType;return this.currentFlow.isNonnull(a,l)?this.info(210,e.expression.range):this.options.noAssert||(a=this.makeRuntimeNonNullCheck(a,l,e)),this.currentType=l.nonNullableType,a}case 3:return this.error(100,e.range,"Const assertion"),this.module.unreachable();default:assert(!1)}return this.module.unreachable()}compileCommutativeCompareBinaryExpression(e,t){let i=e.left,s=this.compileExpression(i,t),a=this.currentType,l=e.right,o=this.compileExpression(l,a),u=this.currentType;return this.compileCommutativeCompareBinaryExpressionFromParts(e.operator,i,s,a,l,o,u,t,e)}compileCommutativeCompareBinaryExpressionFromParts(e,t,i,s,a,l,o,u,c){let f=this.module,_=Le(e),d=Me.fromBinaryToken(e),m=s.lookupOverload(d,this.program),h=o.lookupOverload(d,this.program);if(m&&h&&m!=h)return this.error(240,c.range,_,m.internalName,h.internalName),this.currentType=u,f.unreachable();if(m)return this.compileCommutativeBinaryOverload(m,t,i,s,a,l,o,c);if(h)return this.compileCommutativeBinaryOverload(h,a,l,o,t,i,s,c);let A=p.commonType(s,o,u,!1);if(!A)return this.error(2365,c.range,_,s.toString(),o.toString()),this.currentType=u,f.unreachable();switch(A.isFloatValue&&((Go(f,l)||Go(f,i))&&this.warning(907,c.range),(Do(l)||Do(i))&&this.warning(908,c.range)),i=this.convertExpression(i,s,A,!1,t),s=A,l=this.convertExpression(l,o,A,!1,a),o=A,this.currentType=p.bool,e){case 79:case 77:return this.makeEq(i,l,A,c);case 80:case 78:return this.makeNe(i,l,A,c);default:return assert(!1),f.unreachable()}}compileNonCommutativeCompareBinaryExpression(e,t){let i=this.module,s=e.left,a=e.right,l,o,u,c,f,_=e.operator,d=Le(_);l=this.compileExpression(s,t),o=this.currentType;let m=Me.fromBinaryToken(_),h=o.lookupOverload(m,this.program);if(h)return this.compileBinaryOverload(h,s,l,o,a,e);if(u=this.compileExpression(a,o),c=this.currentType,f=p.commonType(o,c,t,!0),!f||!f.isNumericValue)return this.error(2365,e.range,d,o.toString(),c.toString()),this.currentType=t,i.unreachable();switch(l=this.convertExpression(l,o,f,!1,s),o=f,u=this.convertExpression(u,c,f,!1,a),c=f,this.currentType=p.bool,_){case 73:return this.makeLt(l,u,f);case 74:return this.makeGt(l,u,f);case 75:return this.makeLe(l,u,f);case 76:return this.makeGe(l,u,f);default:return assert(!1),i.unreachable()}}compileBinaryExpression(e,t,i){let s=this.module,a=e.left,l=e.right,o,u,c,f,_,d,m=!1;switch(e.operator){case 73:case 74:case 75:case 76:return this.compileNonCommutativeCompareBinaryExpression(e,t);case 79:case 77:case 80:case 78:return this.compileCommutativeCompareBinaryExpression(e,t);case 102:return this.compileAssignment(a,l,t);case 103:m=!0;case 82:{o=this.compileExpression(a,t),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(5);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isNumericValue)return this.error(2469,e.range,"+",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isNumericValue)return this.error(2365,e.range,"+",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makeAdd(o,c,_);break}case 104:m=!0;case 83:{o=this.compileExpression(a,t),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(6);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isNumericValue)return this.error(2469,e.range,"-",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isNumericValue)return this.error(2365,e.range,"-",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makeSub(o,c,_);break}case 105:m=!0;case 85:{o=this.compileExpression(a,t),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(7);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isNumericValue)return this.error(2469,e.range,"*",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isNumericValue)return this.error(2365,e.range,"*",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makeMul(o,c,_);break}case 106:m=!0;case 84:{o=this.compileExpression(a,t),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(10);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isNumericValue)return this.error(2469,e.range,"**",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isNumericValue)return this.error(2365,e.range,"**",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makePow(o,c,_,e);break}case 107:m=!0;case 86:{o=this.compileExpression(a,t),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(8);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isNumericValue)return this.error(2469,e.range,"/",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isNumericValue)return this.error(2365,e.range,"/",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makeDiv(o,c,_);break}case 108:m=!0;case 87:{o=this.compileExpression(a,t),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(9);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isNumericValue)return this.error(2469,e.range,"%",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isNumericValue)return this.error(2365,e.range,"%",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makeRem(o,c,_,e);break}case 109:m=!0;case 90:{o=this.compileExpression(a,t.intType),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(14);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(!u.isIntegerValue)return this.error(2469,e.range,"<<",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=this.currentType,d=this.makeShl(o,c,f);break}case 110:m=!0;case 91:{o=this.compileExpression(a,t.intType),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(15);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(!u.isIntegerValue)return this.error(2469,e.range,">>",u.toString()),this.module.unreachable();c=this.compileExpression(l,u,1),f=this.currentType,d=this.makeShr(o,c,f);break}case 111:m=!0;case 92:{o=this.compileExpression(a,t.intType),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(16);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(!u.isIntegerValue)return this.error(2469,e.range,">>>",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=this.currentType,d=this.makeShru(o,c,f);break}case 112:m=!0;case 93:{o=this.compileExpression(a,t.intType),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(11);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isIntegerValue)return this.error(2469,e.range,"&",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isIntegerValue)return this.error(2365,e.range,"&",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makeAnd(o,c,_);break}case 113:m=!0;case 94:{o=this.compileExpression(a,t.intType),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(12);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isIntegerValue)return this.error(2469,e.range,"|",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isIntegerValue)return this.error(2365,e.range,"|",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makeOr(o,c,_);break}case 114:m=!0;case 95:{o=this.compileExpression(a,t.intType),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(13);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isIntegerValue)return this.error(2469,e.range,"^",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isIntegerValue)return this.error(2365,e.range,"^",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makeXor(o,c,_);break}case 98:{let k=this.currentFlow,w=i&4;o=this.compileExpression(a,t.exceptVoid,w),u=this.currentType;let R=k.forkThen(o);if(this.currentFlow=R,t==p.bool||t==p.void){o=this.makeIsTrueish(o,u,a);let C=this.evaluateCondition(o);C==2?d=o:(c=this.compileExpression(l,u,w),f=this.currentType,c=this.makeIsTrueish(c,f,l),C==1?(d=c,k.inherit(R)):(d=s.if(o,c,s.i32(0)),k.mergeBranch(R),k.noteThen(d,R))),this.currentFlow=k,this.currentType=p.bool}else{if(c=this.compileExpression(l,u,w),f=this.currentType,_=p.commonType(u,f,t),!_)return this.error(2365,e.range,"&&",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_;let C=s.runExpression(o,1);C&&(o=C),c=this.convertExpression(c,f,_,!1,l),f=_;let M=this.makeIsTrueish(o,this.currentType,a),O=this.evaluateCondition(M);if(O!=0)d=O==1?c:o;else if(d=s.tryCopyTrivialExpression(o))d=s.if(M,c,d);else{let D=k.getTempLocal(u);k.canOverflow(o,u)||k.setLocalFlag(D.index,2),k.isNonnull(o,u)&&k.setLocalFlag(D.index,4),d=s.if(this.makeIsTrueish(s.local_tee(D.index,o,u.isManaged),u,a),c,s.local_get(D.index,u.toRef()))}k.mergeBranch(R),k.noteThen(d,R),this.currentFlow=k,this.currentType=_}break}case 99:{let k=this.currentFlow,w=i&4;o=this.compileExpression(a,t.exceptVoid,w),u=this.currentType;let R=k.forkElse(o);if(this.currentFlow=R,t==p.bool||t==p.void){o=this.makeIsTrueish(o,u,a);let C=this.evaluateCondition(o);C==1?d=o:(c=this.compileExpression(l,u,w),f=this.currentType,c=this.makeIsTrueish(c,f,l),C==2?(d=c,k.inherit(R)):(d=s.if(o,s.i32(1),c),k.mergeBranch(R),k.noteElse(d,R))),this.currentFlow=k,this.currentType=p.bool}else{if(c=this.compileExpression(l,u,w),f=this.currentType,_=p.commonType(u,f,t),!_)return this.error(2365,e.range,"||",u.toString(),f.toString()),this.currentType=t,s.unreachable();let C=u.is(512)&&f.is(512);o=this.convertExpression(o,u,_,!1,a),u=_;let M=s.runExpression(o,1);M&&(o=M),c=this.convertExpression(c,f,_,!1,l),f=_;let O=this.makeIsTrueish(o,this.currentType,a),D=this.evaluateCondition(O);if(D!=0)d=D==1?o:c;else if(d=s.tryCopyTrivialExpression(o))d=s.if(O,d,c);else{let H=k.getTempLocal(u).index;k.canOverflow(o,u)||k.setLocalFlag(H,2),k.isNonnull(o,u)&&k.setLocalFlag(H,4),d=s.if(this.makeIsTrueish(s.local_tee(H,o,u.isManaged),u,a),s.local_get(H,u.toRef()),c)}k.mergeBranch(R),k.noteElse(d,R),this.currentFlow=k,this.currentType=C?_:_.nonNullableType}break}case 29:return this.error(100,e.range,"'in' operator"),this.currentType=p.bool,s.unreachable();default:{assert(!1),d=this.module.unreachable();break}}if(!m)return d;let b=this.resolver;if(a.kind==14){let k=a,w=b.resolveExpression(k.expression,this.currentFlow);if(w&&w.kind==14)return this.compileFixedArrayElementAccess(k,w,!0,t,0,null,d);if(w&&w.kind==27)return this.compileUnmanagedArrayElementAccess(k,w,!0,t,0,null,d);if(w&&w.kind==28)return this.compileDynamicArrayElementAccess(k,w,!0,t,0,null,d);if(w&&this.isManagedDynamicArrayType(w))return this.compileDynamicArrayElementAccess(k,w,!0,t,0,null,d)}let A=b.lookupExpression(a,this.currentFlow);if(!A)return s.unreachable();let S=b.getTypeOfElement(A);return S||(S=p.void),this.currentType.isStrictlyAssignableTo(S)?this.makeAssignment(A,d,this.currentType,l,b.currentThisExpression,b.currentElementExpression,t!=p.void):(this.error(2322,e.range,this.currentType.toString(),S.toString()),s.unreachable())}makeLt(e,t,i){let s=this.module;switch(i.kind){case 1:case 2:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:return s.binary(17,e,t);case 4:return s.binary(42,e,t);case 5:return s.binary(234,e,t);case 0:case 6:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 8:return s.binary(18,e,t);case 9:return s.binary(43,e,t);case 10:return s.binary(235,e,t);case 11:return s.binary(59,e,t);case 12:return s.binary(72,e,t)}return assert(!1),s.unreachable()}makeGt(e,t,i){let s=this.module;switch(i.kind){case 1:case 2:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:return s.binary(21,e,t);case 4:return s.binary(46,e,t);case 5:return s.binary(238,e,t);case 0:case 6:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 8:return s.binary(22,e,t);case 9:return s.binary(47,e,t);case 10:return s.binary(239,e,t);case 11:return s.binary(61,e,t);case 12:return s.binary(74,e,t)}return assert(!1),s.unreachable()}makeLe(e,t,i){let s=this.module;switch(i.kind){case 1:case 2:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:return s.binary(19,e,t);case 4:return s.binary(44,e,t);case 5:return s.binary(236,e,t);case 0:case 6:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 8:return s.binary(20,e,t);case 9:return s.binary(45,e,t);case 10:return s.binary(237,e,t);case 11:return s.binary(60,e,t);case 12:return s.binary(73,e,t)}return assert(!1),s.unreachable()}makeGe(e,t,i){let s=this.module;switch(i.kind){case 1:case 2:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:return s.binary(23,e,t);case 4:return s.binary(48,e,t);case 5:return s.binary(240,e,t);case 0:case 6:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 8:return s.binary(24,e,t);case 9:return s.binary(49,e,t);case 10:return s.binary(241,e,t);case 11:return s.binary(62,e,t);case 12:return s.binary(75,e,t)}return assert(!1),s.unreachable()}makeEq(e,t,i,s){let a=this.module;switch(i.kind){case 0:case 1:case 2:case 6:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:case 8:return a.binary(15,e,t);case 4:case 9:return a.binary(40,e,t);case 5:case 10:return a.binary(232,e,t);case 11:return a.binary(57,e,t);case 12:return a.binary(70,e,t);case 13:return a.unary(70,a.binary(76,e,t));case 18:case 19:case 20:case 21:return a.ref_eq(e,t);case 22:return a.string_eq(e,t);case 23:case 24:case 25:case 16:case 15:case 17:return this.error(203,s.range,"ref.eq",i.toString()),a.unreachable()}return assert(!1),a.unreachable()}makeNe(e,t,i,s){let a=this.module;switch(i.kind){case 0:case 1:case 2:case 6:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:case 8:return a.binary(16,e,t);case 4:case 9:return a.binary(41,e,t);case 5:case 10:return a.binary(233,e,t);case 11:return a.binary(58,e,t);case 12:return a.binary(71,e,t);case 13:return a.unary(67,a.binary(77,e,t));case 18:case 19:case 20:case 21:return a.unary(20,a.ref_eq(e,t));case 22:return a.unary(20,a.string_eq(e,t));case 23:case 24:case 25:case 16:case 15:case 17:return this.error(203,s.range,"ref.eq",i.toString()),a.unreachable()}return assert(!1),a.unreachable()}makeAdd(e,t,i){let s=this.module;switch(i.kind){case 0:case 1:case 2:case 6:case 7:case 3:case 8:return s.binary(0,e,t);case 4:case 9:return s.binary(25,e,t);case 5:case 10:return s.binary(217,e,t);case 11:return s.binary(50,e,t);case 12:return s.binary(63,e,t)}return assert(!1),s.unreachable()}makeSub(e,t,i){let s=this.module;switch(i.kind){case 0:case 1:case 2:case 6:case 7:case 3:case 8:return s.binary(1,e,t);case 4:case 9:return s.binary(26,e,t);case 5:case 10:return s.binary(218,e,t);case 11:return s.binary(51,e,t);case 12:return s.binary(64,e,t)}return assert(!1),s.unreachable()}makeMul(e,t,i){let s=this.module;switch(i.kind){case 0:case 1:case 2:case 6:case 7:case 3:case 8:return s.binary(2,e,t);case 4:case 9:return s.binary(27,e,t);case 5:case 10:return s.binary(219,e,t);case 11:return s.binary(52,e,t);case 12:return s.binary(65,e,t)}return assert(!1),s.unreachable()}makePow(e,t,i,s){let a=this.module;switch(i.kind){case 0:return a.select(a.i32(1),a.binary(15,t,a.i32(0)),e);case 1:case 6:case 2:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:case 8:{if(this.options.willOptimize&&re(e)==14&&re(t)==14){let u=ae(e),c=ae(t);return this.currentType=i,a.i32(i64_low(i64_pow(i64_new(u),i64_new(c))))}let l=this.i32PowInstance;if(!l){let u=this.program.lookup(B.ipow32);if(!u)return this.error(2304,s.range,"ipow32"),a.unreachable();assert(u.kind==4),this.i32PowInstance=l=this.resolver.resolveFunction(u,null)}if(!l||!this.compileFunction(l))return a.unreachable();let o=this.makeCallDirect(l,[e,t],s);return i.size<32&&(o=this.ensureSmallIntegerWrap(o,i)),o}case 4:case 9:{if(this.options.willOptimize&&re(e)==14&&re(t)==14){let o=i64_new(Ne(e),Ge(e)),u=i64_new(Ne(t),Ge(t)),c=i64_pow(o,u);return this.currentType=i,a.i64(i64_low(c),i64_high(c))}let l=this.i64PowInstance;if(!l){let o=this.program.lookup(B.ipow64);if(!o)return this.error(2304,s.range,"ipow64"),a.unreachable();assert(o.kind==4),this.i64PowInstance=l=this.resolver.resolveFunction(o,null)}return!l||!this.compileFunction(l)?a.unreachable():this.makeCallDirect(l,[e,t],s)}case 5:case 10:{let l=this.options.isWasm64;if(this.options.willOptimize&&re(e)==14&&re(t)==14)if(l){let u=i64_new(Ne(e),Ge(e)),c=i64_new(Ne(t),Ge(t)),f=i64_pow(u,c);return this.currentType=i,a.i64(i64_low(f),i64_high(f))}else{let u=ae(e),c=ae(t);return this.currentType=i,a.i32(i64_low(i64_pow(i64_new(u),i64_new(c))))}let o=l?this.i64PowInstance:this.i32PowInstance;if(!o){let u=this.program.lookup(l?B.ipow64:B.ipow32);if(!u)return this.error(2304,s.range,l?"ipow64":"ipow32"),a.unreachable();assert(u.kind==4),o=this.resolver.resolveFunction(u,null),l?this.i64PowInstance=o:this.i32PowInstance=o}return!o||!this.compileFunction(o)?a.unreachable():this.makeCallDirect(o,[e,t],s)}case 11:{if(this.options.willOptimize&&re(e)==14&&re(t)==14){let o=Ce(e),u=Ce(t);return this.currentType=i,a.f32(f32(ol(o,u)))}let l=this.f32PowInstance;if(!l){let o=this.program.lookup(B.Mathf);if(!o)return this.error(2304,s.range,"Mathf"),a.unreachable();let u=o.getMember(B.pow);if(!u)return this.error(2304,s.range,"Mathf.pow"),a.unreachable();assert(u.kind==4),this.f32PowInstance=l=this.resolver.resolveFunction(u,null)}return!l||!this.compileFunction(l)?a.unreachable():this.makeCallDirect(l,[e,t],s)}case 12:{if(this.options.willOptimize&&re(e)==14&&re(t)==14){let o=Pe(e),u=Pe(t);return this.currentType=i,a.f64(ol(o,u))}let l=this.f64PowInstance;if(!l){let o=this.program.lookup(B.Math);if(!o)return this.error(2304,s.range,"Math"),a.unreachable();let u=o.getMember(B.pow);if(!u)return this.error(2304,s.range,"Math.pow"),a.unreachable();assert(u.kind==4),this.f64PowInstance=l=this.resolver.resolveFunction(u,null)}return!l||!this.compileFunction(l)?a.unreachable():this.makeCallDirect(l,[e,t],s)}}return assert(!1),a.unreachable()}makeDiv(e,t,i){let s=this.module;switch(i.kind){case 1:case 2:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:return s.binary(3,e,t);case 4:return s.binary(28,e,t);case 5:return s.binary(220,e,t);case 0:case 6:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 8:return s.binary(4,e,t);case 9:return s.binary(29,e,t);case 10:return s.binary(221,e,t);case 11:return s.binary(53,e,t);case 12:return s.binary(66,e,t)}return assert(!1),s.unreachable()}makeRem(e,t,i,s){let a=this.module;switch(i.kind){case 1:case 2:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:return a.binary(5,e,t);case 4:return a.binary(30,e,t);case 5:return a.binary(222,e,t);case 0:case 6:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 8:return a.binary(6,e,t);case 9:return a.binary(31,e,t);case 10:return a.binary(223,e,t);case 11:{let l=this.f32ModInstance;if(!l){let o=this.program.lookup(B.Mathf);if(!o)return this.error(2304,s.range,"Mathf"),a.unreachable();let u=o.getMember(B.mod);if(!u)return this.error(2304,s.range,"Mathf.mod"),a.unreachable();assert(u.kind==4),this.f32ModInstance=l=this.resolver.resolveFunction(u,null)}return!l||!this.compileFunction(l)?a.unreachable():this.makeCallDirect(l,[e,t],s)}case 12:{let l=this.f64ModInstance;if(!l){let o=this.program.lookup(B.Math);if(!o)return this.error(2304,s.range,"Math"),a.unreachable();let u=o.getMember(B.mod);if(!u)return this.error(2304,s.range,"Math.mod"),a.unreachable();assert(u.kind==4),this.f64ModInstance=l=this.resolver.resolveFunction(u,null)}return!l||!this.compileFunction(l)?a.unreachable():this.makeCallDirect(l,[e,t],s)}}return assert(!1),a.unreachable()}makeShl(e,t,i){let s=this.module;switch(i.kind){case 0:return e;case 1:case 2:case 6:case 7:return s.binary(10,e,s.binary(7,t,s.i32(i.size-1)));case 3:case 8:return s.binary(10,e,t);case 4:case 9:return s.binary(35,e,t);case 5:case 10:return s.binary(227,e,t)}return assert(!1),s.unreachable()}makeShr(e,t,i){let s=this.module;switch(i.kind){case 0:return e;case 1:case 2:return s.binary(11,this.ensureSmallIntegerWrap(e,i),s.binary(7,t,s.i32(i.size-1)));case 6:case 7:return s.binary(12,this.ensureSmallIntegerWrap(e,i),s.binary(7,t,s.i32(i.size-1)));case 3:return s.binary(11,e,t);case 4:return s.binary(36,e,t);case 5:return s.binary(228,e,t);case 8:return s.binary(12,e,t);case 9:return s.binary(37,e,t);case 10:return s.binary(229,e,t)}return assert(!1),s.unreachable()}makeShru(e,t,i){let s=this.module;switch(i.kind){case 0:return e;case 1:case 2:case 6:case 7:return s.binary(12,this.ensureSmallIntegerWrap(e,i),s.binary(7,t,s.i32(i.size-1)));case 3:case 8:return s.binary(12,e,t);case 4:case 9:return s.binary(37,e,t);case 5:case 10:return s.binary(229,e,t)}return assert(!1),s.unreachable()}makeAnd(e,t,i){let s=this.module;switch(i.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:return s.binary(7,e,t);case 4:case 9:return s.binary(32,e,t);case 5:case 10:return s.binary(224,e,t)}return assert(!1),s.unreachable()}makeOr(e,t,i){let s=this.module;switch(i.kind){case 0:case 1:case 2:case 6:case 7:return s.binary(8,e,t);case 3:case 8:return s.binary(8,e,t);case 4:case 9:return s.binary(33,e,t);case 5:case 10:return s.binary(225,e,t)}return assert(!1),s.unreachable()}makeXor(e,t,i){let s=this.module;switch(i.kind){case 0:case 1:case 2:case 6:case 7:return s.binary(9,e,t);case 3:case 8:return s.binary(9,e,t);case 4:case 9:return s.binary(34,e,t);case 5:case 10:return s.binary(226,e,t)}return assert(!1),s.unreachable()}compileUnaryOverload(e,t,i,s){return this.makeCallDirect(e,[i],s,!1)}compileBinaryOverload(e,t,i,s,a,l){let o,u=e.signature,c=u.parameterTypes;e.is(262144)?(i=this.convertExpression(i,s,assert(u.thisType),!1,t),o=c[0]):(i=this.convertExpression(i,s,c[0],!1,t),o=c[1]);let f=this.compileExpression(a,o,1);return this.makeCallDirect(e,[i,f],l)}compileCommutativeBinaryOverload(e,t,i,s,a,l,o,u){let c=e.signature,f=c.parameterTypes;return e.is(262144)?(i=this.convertExpression(i,s,assert(c.thisType),!1,t),l=this.convertExpression(l,o,f[0],!1,a)):(i=this.convertExpression(i,s,f[0],!1,t),l=this.convertExpression(l,o,f[1],!1,a)),this.makeCallDirect(e,[i,l],u)}compileAssignment(e,t,i){let a=this.program.resolver,l=this.currentFlow;if(e.kind==14){let m=e,h=a.resolveExpression(m.expression,l);if(h&&h.kind==14)return this.compileFixedArrayElementAccess(m,h,!0,i,0,t);if(h&&h.kind==27)return this.compileUnmanagedArrayElementAccess(m,h,!0,i,0,t);if(h&&h.kind==28)return this.compileDynamicArrayElementAccess(m,h,!0,i,0,t);if(h&&this.isManagedDynamicArrayType(h))return this.compileDynamicArrayElementAccess(m,h,!0,i,0,t)}{let m=this.resolveSroaReceiver(e),h=this.resolveSroaReceiver(t);if(m!=null&&h!=null){if(!assert(m.type).equals(assert(h.type)))return this.error(2322,t.range,h.type.toString(),m.type.toString()),this.module.unreachable();let b=new Array;return this.copySroaValue(assert(h.fieldLocals),assert(m.fieldLocals),b),this.currentType=p.void,this.module.flatten(b)}}let o=a.lookupExpression(e,l);if(!o)return this.module.unreachable();let u=a.currentThisExpression,c=a.currentElementExpression,f;switch(o.kind){case 0:case 1:{if(o.kind==0){if(!this.compileGlobalLazy(o,e))return this.module.unreachable()}else if(!o.declaredByFlow(l))return this.error(100,e.range,"Closures"),this.module.unreachable();if(this.pendingElements.has(o))return this.error(2448,e.range,o.internalName),this.module.unreachable();f=o.type,o.hasDecorator(8192)&&this.checkUnsafe(e);break}case 10:{let m=o,h=a.resolveProperty(m);if(!h)return this.module.unreachable();o=h}case 11:{let m=o;if(m.isField&&this.pendingElements.has(o))return this.error(2448,e.range,o.internalName),this.module.unreachable();let h=m.setterInstance;if(!h)return this.error(2540,e.range,m.internalName),this.module.unreachable();assert(h.signature.parameterTypes.length==1),f=h.signature.parameterTypes[0],h.hasDecorator(8192)&&this.checkUnsafe(e);break}case 15:{let m=o.parent;assert(m.kind==7);let h=m,b=l.is(32768),A=h.lookupOverload(2,b);if(!A)return h.lookupOverload(1,b)?this.error(2542,e.range,h.internalName):this.error(2329,e.range,h.internalName),this.module.unreachable();let S=A.signature.parameterTypes;assert(S.length==2),f=S[1],A.hasDecorator(8192)&&this.checkUnsafe(e),!b&&this.options.pedantic&&this.pedantic(904,e.range);break}default:return this.error(2540,e.range,o.internalName),this.module.unreachable()}assert(f!=p.void);let _=this.compileExpression(t,f),d=this.currentType;return f.isNullableReference&&this.currentFlow.isNonnull(_,d)&&(f=f.nonNullableType),this.makeAssignment(o,this.convertExpression(_,d,f,!1,t),f,t,u,c,i!=p.void)}makeAssignment(e,t,i,s,a,l,o){let u=this.module,c=this.currentFlow;switch(e.kind){case 1:{let f=e;return f.isDynamicLength?(this.error(100,s.range,"the length name `"+f.name+"` is bound from the array header; it cannot be assigned. Read `.length` for the current value."),this.currentType=o?f.type:p.void,u.unreachable()):c.isLocalFlag(f.index,1,!0)?(this.error(2540,s.range,e.internalName),this.currentType=o?f.type:p.void,u.unreachable()):this.makeLocalAssignment(f,t,i,o)}case 0:{let f=e;return this.compileGlobalLazy(f,s)?e.isAny(72)?(this.error(2540,s.range,e.internalName),this.currentType=o?f.type:p.void,u.unreachable()):this.makeGlobalAssignment(f,t,i,o):u.unreachable()}case 10:{let f=this.resolver.resolveProperty(e);if(!f)return u.unreachable();e=f}case 11:{let f=e;if(a!=null&&a.kind==14){let d=this.compileSroaArrayLeafStoreByRuntimeIndex(a,f,t);if(d!=0)return d}if(a!=null){let d=this.resolveSroaReceiver(a);if(d!=null){let m=assert(d.fieldLocals);if(!m.has(f.name))return this.error(100,s.range,"assigning to a refused field of an @inline struct (the field was refused at declaration)"),u.unreachable();let h=assert(m.get(f.name));if(h.index<0)return this.error(100,s.range,"assigning a nested @inline struct value as a whole (the field is several leaves, not one value; assign one of its fields)"),u.unreachable();let b=u.local_set(h.index,t,!1);return this.currentType=o?h.type:p.void,b}}if(f.isField&&this.isInlineStructType(f.type))return this.error(100,s.range,"assigning a whole value to an @inline struct field (the value has no address, so there is nothing to store; assign the field's own fields, e.g. `w.inner.a = ...`)"),this.currentType=o?f.type:p.void,u.unreachable();if(f.isField){let d=c.sourceFunction.is(524288);if(f.is(64)){let m=f.initializerNode;if(!d||m)return this.error(2540,s.range,f.internalName),u.unreachable()}a=assert(a),d&&a.kind==26&&c.setThisFieldFlag(f,1)}let _=f.setterInstance;if(!_)return this.error(2540,s.range,e.internalName),u.unreachable();if(assert(_.signature.parameterTypes.length==1),assert(_.signature.returnType==p.void),f.is(262144)){let d=assert(_.signature.thisType),m=this.compileExpression(assert(a),d,33);if(!o)return this.makeCallDirect(_,[m,t],s);let h=c.getTempLocal(i),b=i.toRef(),A=u.block(null,[this.makeCallDirect(_,[m,u.local_tee(h.index,t,i.isManaged,b)],s),u.local_get(h.index,b)],b);return this.currentType=i,A}else{if(!o)return this.makeCallDirect(_,[t],s);let d=c.getTempLocal(i),m=i.toRef(),h=u.block(null,[this.makeCallDirect(_,[u.local_tee(d.index,t,i.isManaged,m)],s),u.local_get(d.index,m)],m);return this.currentType=i,h}}case 15:{let _=e.parent;assert(_.kind==7);let d=_;assert(d.kind==7);let m=c.is(32768),h=d.lookupOverload(1,m);if(!h)return this.error(2329,s.range,d.internalName),u.unreachable();let b=d.lookupOverload(2,m);if(!b)return this.error(2542,s.range,d.internalName),this.currentType=o?h.signature.returnType:p.void,u.unreachable();assert(b.signature.parameterTypes.length==2);let A=d.type,S=this.compileExpression(assert(a),A,33),k=b.signature.parameterTypes[0],w=h.signature.parameterTypes[0];if(!k.equals(w))return this.errorRelated(237,h.identifierAndSignatureRange,b.identifierAndSignatureRange,d.internalName),this.currentType=o?h.signature.returnType:p.void,u.unreachable();let R=this.compileExpression(assert(l),k,1),C=this.currentType;if(o){let M=c.getTempLocal(A),O=c.getTempLocal(C),D=h.signature.returnType;return u.block(null,[this.makeCallDirect(b,[u.local_tee(M.index,S,A.isManaged),u.local_tee(O.index,R,C.isManaged),t],s),this.makeCallDirect(h,[u.local_get(M.index,M.type.toRef()),u.local_get(O.index,O.type.toRef())],s)],D.toRef())}else return this.makeCallDirect(b,[S,R,t],s)}default:this.error(2541,s.range)}return u.unreachable()}dynamicArrayTypeNodeOf(e){let t=e.type;if(t!=null&&t.kind==72)return t;let i=e.initializer;if(i!=null&&i.kind==11){let s=i,a=s.expression;if(a.kind==8&&a.text=="changetype"){let l=s.typeArguments;if(l!=null&&l.length==1){let o=unchecked(l[0]);if(o.kind==72)return o}}}return null}makeLocalAssignment(e,t,i,s){let a=this.module,l=this.currentFlow,o=e.type;assert(o!=p.void);let u=e.index;return o.isNullableReference&&(!i.isNullableReference||l.isNonnull(t,o)?l.setLocalFlag(u,4):l.unsetLocalFlag(u,4)),l.setLocalFlag(u,8),o.isShortIntegerValue&&(l.canOverflow(t,o)?l.unsetLocalFlag(u,2):l.setLocalFlag(u,2)),s?(this.currentType=o,a.local_tee(u,t,o.isManaged)):(this.currentType=p.void,a.local_set(u,t,o.isManaged))}makeGlobalAssignment(e,t,i,s){let a=this.module,l=e.type;assert(l!=p.void);let o=l.toRef();return t=this.ensureSmallIntegerWrap(t,l),s?(this.currentType=l,a.block(null,[a.global_set(e.internalName,t),a.global_get(e.internalName,o)],o)):(this.currentType=p.void,a.global_set(e.internalName,t))}checkNoManagedStructCopy(e,t){if(!e.prototype.internalName.startsWith(B.COPY_STRUCT))return!0;let i=e.typeArguments;if(!i)return!0;for(let s=0,a=i.length;s<a;++s){let l=unchecked(i[s]).classReference;if(l!=null&&l.hasDecorator(2048)){let o=t.typeArguments;return this.error(100,o&&o.length>s?unchecked(o[s]).range:t.range,"COPY_STRUCT on an @managed struct (a raw byte copy bypasses the GC write barrier)"),!1}}return!0}compileCallExpression(e,t,i){let s=this.module,a=this.currentFlow;if(e.expression.kind==25){let f=this.currentFlow,_=f.sourceFunction;if(!_.is(524288))return this.error(2337,e.range),s.unreachable();let d=assert(_.parent);assert(d.kind==7);let m=d,h=m.base;if(!h||m.prototype.implicitlyExtendsObject)return this.error(2335,e.expression.range),s.unreachable();let b=assert(f.lookupLocal(B.this_)),A=this.options.sizeTypeRef,S=this.ensureConstructor(h,e);this.checkFieldInitialization(h,e);let k=this.compileCallDirect(S,e.args,e,s.local_get(b.index,A));return f.isAny(8256)?(this.error(17009,e.range),s.unreachable()):(f.set(192),this.currentType=p.void,s.local_set(b.index,k,m.type.isManaged))}let l=this.resolver.lookupExpression(e.expression,a);if(!l)return s.unreachable();let o=this.resolver.currentThisExpression;switch(l.kind){case 4:{let f=l;if(f.hasDecorator(512))return this.compileCallExpressionBuiltin(f,e,t);let _=this.resolver.maybeInferCall(e,f,a);if(!_)return this.module.unreachable();if(!this.checkNoManagedStructCopy(_,e))return this.module.unreachable();l=_}case 5:{let f=l;if(!this.checkNoManagedStructCopy(f,e))return this.module.unreachable();let _=0;return f.is(262144)&&(_=this.compileExpression(assert(o),assert(f.signature.thisType),33)),this.compileCallDirect(f,e.args,e,_,i)}}let u=this.compileExpression(e.expression,p.auto),c=this.currentType.getSignature();if(c)return this.compileCallIndirect(c,u,e.args,e,0,t==p.void);if(this.error(2349,e.range,this.currentType.toString()),l.kind==10){let f=l.getterPrototype;f&&this.infoRelated(6234,e.range,f.identifierNode.range)}return s.unreachable()}compileCallExpressionLike(e,t,i,s,a,l=0){let o=this._reusableCallExpression;return o?(o.expression=e,o.typeArguments=t,o.args=i,o.range=s):this._reusableCallExpression=o=y.createCallExpression(e,t,i,s),this.compileCallExpression(o,a,l)}compileCallExpressionBuiltin(e,t,i){e.hasDecorator(8192)&&this.checkUnsafe(t);let s=null,a=e.typeParameterNodes,l=t.typeArguments;if(t.typeArguments){e.is(65536)||this.error(2315,t.range,e.internalName);let _=e.internalName==g.changetype;_&&(this.resolver.allowInlineView=!0),s=this.resolver.resolveTypeArguments(assert(a),l,this.currentFlow,this.currentFlow.sourceFunction.parent,me(this.currentFlow.contextualTypeArguments),t),_&&(this.resolver.allowInlineView=!1,s!=null&&s.length==1&&l!=null&&l.length==1&&l[0].memoryModel==3&&this.resolver.markViewCall(t))}let o=t.expression,u=new iu(this,e,s,t.args,o.kind==23?o.expression:null,i,t,!1),c;return e.is(262144)?c=`${assert(e.getBoundClassOrInterface()).prototype.internalName}#${e.name}`:c=e.internalName,assert(E.has(c)),assert(E.get(c))(u)}checkCallSignature(e,t,i,s){let a=e.thisType;if(i!=(a!=null))return this.error(2685,s.range),!1;let l=e.hasRest,o=e.requiredParameters,u=e.parameterTypes.length;return t<o?(this.error(o<u?2555:2554,s.range,o.toString(),t.toString()),!1):t>u&&!l?(this.error(2554,s.range,u.toString(),t.toString()),!1):!0}checkUnsafe(e,t=null){this.options.noUnsafe&&!e.range.source.isLibrary&&(t?this.errorRelated(101,e.range,t.range):this.error(101,e.range))}adjustArgumentsForRestParams(e,t,i){if(!t.hasRest)return e;let s=e.length,a=t.parameterTypes.length;if(s<a)return e;let l=e.slice(a-1),o=new ue(l[0].range.start,l[l.length-1].range.end);o.source=i.range.source;let u=new Yr(l,o),c=e.slice(0,a-1);return c.push(u),c}compileCallDirect(e,t,i,s=0,a=0){let l=t.length,o=e.signature;if(!this.checkCallSignature(o,l,s!=0,i))return this.currentType=o.returnType,this.module.unreachable();e.hasDecorator(8192)&&this.checkUnsafe(i);let u=0;o.hasHiddenDestParam&&(u=this.sretDestSlot,this.sretDestSlot=0),t=this.adjustArgumentsForRestParams(t,o,i),l=t.length;let c=this.currentFlow.sourceFunction;if(c.is(524288)&&i.isAccessOnThis){let C=c.parent;assert(C.kind==7),this.checkFieldInitialization(C,i)}let f=e.hasDecorator(64)||this.currentFlow.is(131072);if(!o.hasHiddenDestParam&&f&&(!e.is(268435456)||i.isAccessOnSuper)){assert(!e.is(134217728));let C=this.inlineStack;if(C.includes(e))this.warning(217,i.range,e.internalName);else{let M=o.parameterTypes;assert(l<=M.length);let O=new Array(l);for(let Q=0;Q<l;++Q)O[Q]=this.compileExpression(t[Q],M[Q],1);C.push(e);let D=this.makeCallInline(e,O,s,(a&8)!=0);return C.pop(),D}}let _=o.parameterTypes,d=0;for(let C=0;C<l;++C)d+=o.wasmParamSlotCountOf(C);let m=s?d+1:d,h=o.hasHiddenDestParam;if(this.sretDiscardMark=null,h&&u==0){this.ensureSretStack();let C=this.currentFlow.getTempLocal(p.u32);this.sretDiscardMark=C,u=this.makeSretAddress(C)}let b=m+(h?1:0),A=new Array(b),S=0;s&&(A[0]=s,S=1),h&&(A[S++]=u),this.externalTempMark=null,this.externalTempSize=0;let k=null,w=0,R=0;if(o.byValPointerParams){let C=0;for(let M=0;M<l;++M)o.isByValPointerParam(M)&&(C+=this.sretSizeOf(unchecked(_[M])));C>0&&(this.ensureSretStack(),k=this.currentFlow.getTempLocal(p.u32),R=C)}for(let C=0;C<l;++C){let M=unchecked(_[C]);this.rootNextOperand=!1,k!=null&&o.isByValPointerParam(C)?(A[S++]=this.makeExternalTempArgument(unchecked(t[C]),M,assert(k),w),w+=this.sretSizeOf(M)):o.isViewParam(C)?unchecked(A[S++]=this.compileExpression(unchecked(t[C]),M,1)):S+=this.expandSroaArgument(unchecked(t[C]),M,A,S),this.rootNextOperand&&(this.rootNextOperand=!1,o.isByValPointerParam(C)||unchecked(A[S-1]=this.module.tostack(unchecked(A[S-1]))))}return S!=b&&console.log("DEBUG arity: index="+S.toString()+" numOperands="+b.toString()),assert(S==b),this.externalTempMark=k,this.externalTempSize=R,this.makeCallDirect(e,A,i,(a&8)!=0)}makeCallInline(e,t,i=0,s=!1){let a=this.module,l=t?t.length:0,u=e.signature.parameterTypes,c=u.length,f=this.currentFlow,_=er.createInline(f.targetFunction,e),d=[];if(i){let b=assert(e.parent);assert(b.kind==7);let A=b,S=assert(e.signature.thisType),k=_.addScopedLocal(B.this_,S);d.push(a.local_set(k.index,i,S.isManaged)),_.setLocalFlag(k.index,8);let w=A.base;w&&_.addScopedAlias(B.super_,w.type,k.index)}else assert(!e.signature.thisType);for(let b=0;b<l;++b){let A=t[b],S=u[b],k=_.addScopedLocal(e.getParameterName(b),S);f.canOverflow(A,S)||_.setLocalFlag(k.index,2),_.isNonnull(A,S)&&_.setLocalFlag(k.index,4),d.push(a.local_set(k.index,A,S.isManaged)),_.setLocalFlag(k.index,8)}this.currentFlow=_;let m=e.is(524288);m&&_.set(65536);for(let b=l;b<c;++b){let A=u[b],S=this.compileExpression(assert(e.prototype.functionTypeNode.parameters[b].initializer),A,1),k=_.addScopedLocal(e.getParameterName(b),A);d.push(this.makeLocalAssignment(k,S,A,!1))}if(_.unset(65536),this.compileFunctionBody(e,d),m){let b=e.parent;assert(b.kind==7),this.checkFieldInitializationInFlow(b,_)}let h=_.returnType;return this.currentFlow=f,this.currentType=h,a.block(_.inlineReturnLabel,d,this.resultRefOf(h))}ensureArgumentsLength(){let e=g.argumentsLength;if(!this.builtinArgumentsLength){let t=this.module;this.builtinArgumentsLength=t.addGlobal(e,P.I32,!0,t.i32(0))}return e}ensureEnvGlobal(){let e=g.env;if(!this.builtinEnv){let t=this.module,i=this.options.sizeTypeRef;this.builtinEnv=t.addGlobal(e,i,!0,i==P.I64?t.i64(0):t.i32(0))}return e}ensureVarargsStub(e){let t=e.varargsStub;if(t)return t;let i=e.signature,s=i.parameterTypes,a=e.prototype.functionTypeNode.parameters,l=i.returnType,o=e.is(262144),u=i.requiredParameters,c=u,f=s.length,_=f;o&&(++c,++_);let d=assert(_-c),m=new Array(c),h=0,b=new Array,A=this.module,S=i.thisType;S&&(m[0]=A.local_get(0,S.toRef()),h=1);for(let H=0;H<u;++H,++h){let U=s[H];m[h]=A.local_get(h,U.toRef())}assert(h==c),t=e.newStub("varargs",f),e.varargsStub=t;let k=this.currentFlow,w=t.flow;e.is(524288)&&w.set(65536),this.currentFlow=w;let R=d+1,C=new Array(R),M=`of${d}`;for(let H=0;H<R;++H)C[H]=`${H}${M}`;let O=this.ensureArgumentsLength(),D=A.block(C[0],[A.block("outOfRange",[A.switch(C,"outOfRange",u?A.binary(1,A.global_get(O,P.I32),A.i32(u)):A.global_get(O,P.I32))]),A.unreachable()]);for(let H=0;H<d;++H,++h){let U=s[u+H],V=a[u+H],Y=V.initializer,q;if(V.parameterKind===2){let ne=new Yr([],V.range.atEnd);q=this.compileArrayLiteral(ne,U,2),q=A.local_set(h,q,U.isManaged)}else Y?(q=this.compileExpression(Y,U,1),q=A.local_set(h,q,U.isManaged)):(this.error(215,V.range),q=A.unreachable());D=A.block(C[H+1],[D,q]),m[h]=A.local_get(h,U.toRef())}assert(h==_),b.push(D),b.push(this.makeCallDirect(e,m,e.declaration.name)),this.currentFlow=k;let Q=A.addFunction(t.internalName,t.signature.paramRefs,t.signature.resultRefs,t.getNonParameterLocalTypeRefs(),A.flatten(b,l.toRef()));return t.set(8388608),t.finalize(A,Q),t}ensureOverrideStub(e){let t=e.overrideStub;if(t)return t;t=e.newStub("override"),e.overrideStub=t;let i=this.module;return t.ref=i.addFunction(t.internalName,t.signature.paramRefs,t.signature.resultRefs,null,i.unreachable()),this.overrideStubs.add(e),t}finalizeOverrideStub(e){let t=this.ensureOverrideStub(e);if(t.is(8388608))return;assert(e.parent.kind==7||e.parent.kind==9);let i=this.module,a=this.options.usizeType.toRef(),l=e.signature.parameterTypes,o=e.signature.returnType,u=l.length,c=1+assert(e.signature).wasmParamCount(),f=new ys(this.module,i.load(4,!1,i.binary(a==P.I64?26:1,i.local_get(0,a),a==P.I64?i.i64(8):i.i32(8)),P.I32)),_=this.resolver.resolveOverrides(e);if(_){let b=new Map;for(let A=0,S=_.length;A<S;++A){let k=_[A];if(!k.is(8388608))continue;let w=k.signature,R=e.signature;if(!w.isAssignableTo(R,!0)){this.error(2322,k.identifierNode.range,w.toString(),R.toString());continue}let C=w.parameterTypes,M=C.length,O=new Array(1+M);O[0]=i.local_get(0,a);for(let q=1;q<=u;++q)O[q]=i.local_get(q,l[q-1].toRef());let D=!1;for(let q=u;q<M;++q)O[1+q]=this.makeZero(C[q]),D=!0;let Q=D?this.ensureVarargsStub(k).internalName:k.internalName,H=w.returnType.toRef(),U=new Array;D&&U.push(i.global_set(this.ensureArgumentsLength(),i.i32(u))),o==p.void?(U.push(i.call(Q,O,H)),U.push(i.return())):U.push(i.return(i.call(Q,O,H)));let V=assert(k.getBoundClassOrInterface());f.addCase(V.id,U);let Y=V.extenders;if(Y)for(let q=Set_values(Y),ne=0,j=q.length;ne<j;++ne){let ge=q[ne],oe=ge.prototype.instanceMembers;oe&&oe.has(e.declaration.name.text)||(!b.has(ge)||!assert(b.get(ge)).extends(V))&&(b.set(ge,V),f.addOrReplaceCase(ge.id,U))}}}let d,m=e.getBoundClassOrInterface();if(!e.is(128)&&!(m&&m.kind==9)){let b=new Array(u);b[0]=i.local_get(0,a);for(let A=0,S=l.length;A<S;++A)b[1+A]=i.local_get(1+A,l[A].toRef());d=i.call(e.internalName,b,o.toRef())}else d=i.unreachable();t.ref&&i.removeFunction(t.internalName),t.ref=i.addFunction(t.internalName,t.signature.paramRefs,t.signature.resultRefs,[P.I32],i.block(null,[f.render(c),d],o.toRef())),t.set(8388608)}needToStack(e){let t=this.module.runExpression(e,0);if(t==0)return!0;let i=_f(t,this.options.isWasm64);if(i64_eq(i,i64_zero))return!1;let s=this.staticGcObjectOffsets;return!(s.has(i64_high(i))&&assert(s.get(i64_high(i))).has(i64_low(i)))}operandsTostack(e,t){if(!this.options.stackSize)return;let i=this.module,s=0,a=e.thisType;if(a){if(a.isManaged){let c=t[0];this.needToStack(c)&&(t[s]=i.tostack(c))}++s}let l=e.parameterTypes,o=e.wasmParamCount(),u=0;for(;s<t.length&&!(u>=o);){let c=e.sourceIndexOf(u);if(c<0){++s,++u;continue}if(unchecked(l[c]).isManaged&&!e.isByValPointerParam(c)){let _=t[s];this.needToStack(_)&&(t[s]=i.tostack(_))}++s,++u}}checkCallArity(e,t,i){let s=e.signature,a=s.wasmParamCount()+(s.thisType?1:0),l=t?t.length:0;if(l==a)return!0;let o=this.diagnostics;for(let u=0,c=o.length;u<c;++u)if(o[u].category==3)return!0;return this.error(6412,i.range,e.internalName,l.toString(),a.toString()),!1}makeCallDirect(e,t,i,s=!1){let a=this.sretDiscardMark;this.sretDiscardMark=null;let l=this.externalTempMark,o=this.externalTempSize;if(this.externalTempMark=null,this.externalTempSize=0,e.hasDecorator(64))if(e.is(268435456))this.warning(228,i.range,e.internalName);else{assert(!e.is(134217728));let k=this.inlineStack;if(k.includes(e))this.warning(217,i.range,e.internalName);else{k.push(e);let w;if(e.is(262144)){let R=assert(t);assert(R.length),w=this.makeCallInline(e,R.slice(1),R[0],s)}else w=this.makeCallInline(e,t,0,s);return k.pop(),w}}let u=this.module,c=t?t.length:0,f=c,d=e.signature.requiredParameters,m=e.signature.parameterTypes,h=m.length,b=h;if(e.is(262144)&&(++d,++b,--f),e.signature.hasHiddenDestParam&&(++d,++b,--f),assert(c>=d),!this.compileFunction(e))return u.unreachable();let A=e.signature.returnType;if(c<b){t||(t=new Array(b),t.length=0);let k=e.prototype.functionTypeNode.parameters;assert(k.length==m.length);let w=!0;for(let R=f;R<h;++R){let C=k[R].initializer;if(C){if(C.compilesToConst){t.push(this.compileExpression(C,m[R],1));continue}let M=this.resolver.lookupExpression(C,e.flow,m[R],1);if(M&&M.kind==0){let O=M;if(this.compileGlobalLazy(O,C)&&O.is(33554432)){t.push(this.compileInlineConstant(O,m[R],1));continue}}}t.push(this.makeZero(m[R])),w=!1}if(!w&&!e.is(2097152)){let R=e;if(e=this.ensureVarargsStub(e),!this.compileFunction(e))return u.unreachable();e.flow.flags=R.flow.flags;let C=e.signature.resultRefs,M=t[b-1];assert(!(ks(M,u.ref)&32));let O=m[h-1];if(t[b-1]=u.block(null,[u.global_set(this.ensureArgumentsLength(),u.i32(f)),M],O.toRef()),!this.checkCallArity(e,t,i))return u.unreachable();this.operandsTostack(e.signature,t);let D=u.call(e.internalName,t,C);return C!=P.None&&s?(D=u.drop(D),this.currentType=p.void):this.currentType=A,a!=null&&(D=this.wrapSretCall(assert(a),D,A,i),this.currentType=s?p.void:A),D}}if(e.is(268435456)&&!i.isAccessOnSuper&&(e=this.ensureOverrideStub(e)),!this.checkCallArity(e,t,i))return u.unreachable();t&&this.operandsTostack(e.signature,t);let S=u.call(e.internalName,t,e.signature.resultRefs);return this.currentType=A,a!=null&&(S=this.wrapSretCall(assert(a),S,A,i),this.currentType=s?p.void:A),l!=null&&(S=this.wrapExternalTempCall(assert(l),o,S,A,i),this.currentType=s?p.void:A),S}compileCallIndirect(e,t,i,s,a=0,l=!1){let o=i.length;if(e.hasHiddenDestParam)return this.error(100,s.range,"calling an @inline struct-returning function through a function value (the hidden destination parameter needs a direct call)"),this.currentType=e.returnType,this.module.unreachable();if(!this.checkCallSignature(e,o,a!=0,s))return this.module.unreachable();i=this.adjustArgumentsForRestParams(i,e,s),o=i.length;let u=a?o+1:o,c=new Array(u),f=0;a&&(c[0]=a,f=1);let _=e.parameterTypes;for(let d=0;d<o;++d,++f)c[f]=this.compileExpression(i[d],_[d],1);return assert(f==u),this.makeCallIndirect(e,t,s,c,l)}makeCallIndirect(e,t,i,s=null,a=!1){let l=this.module,o=s?s.length:0,u=o,f=e.requiredParameters,_=e.parameterTypes,d=e.returnType,m=_.length,h=m;if(e.thisType&&(++f,++h,--u),assert(o>=f),o<h){s||(s=new Array(h),s.length=0);let U=e.parameterTypes;for(let V=u;V<m;++V)s.push(this.makeZero(U[V]))}let b=new Array,A=this.options.sizeTypeRef,S=this.currentFlow.getTempLocal(this.options.usizeType),k=this.ensureEnvGlobal(),w=this.options.usizeType.byteSize,R=this.options.usizeType.byteSize,C=this.currentFlow.getTempLocal(this.options.usizeType);b.push(l.local_set(C.index,l.global_get(k,A),!1)),b.push(l.global_set(k,l.load(R,!1,l.local_tee(S.index,t,!0),A,w))),t=l.local_get(S.index,A);let M=this.ensureArgumentsLength(),O=l.block(null,[l.global_set(M,l.i32(u)),l.load(4,!1,t,P.I32,cu)],A);s&&this.operandsTostack(e,s);let D=l.call_indirect(null,O,s,e.paramRefs,e.resultRefs);this.currentType=d;let Q=l.global_set(k,l.local_get(C.index,A));if(d==p.void)return b.push(D),b.push(Q),l.flatten(b,P.None);let H=this.currentFlow.getTempLocal(d);return b.push(l.local_set(H.index,D,d.isManaged)),b.push(Q),b.push(l.local_get(H.index,d.toRef())),l.flatten(b,d.toRef())}compileCommaExpression(e,t,i){let s=e.expressions,a=s.length,l=new Array(a--);for(let o=0;o<a;++o)l[o]=this.compileExpression(s[o],p.void,9);return l[a]=this.compileExpression(s[a],t,i),this.module.flatten(l,this.currentType.toRef())}unmanagedArrayElementSize(e){let t=e.classReference;return t!=null&&(t.hasDecorator(16)||t.hasDecorator(2048))?t.nextMemoryOffset:e.byteSize}isRecordValueType(e){let t=e.classReference;return t!=null&&(t.hasDecorator(16)||t.hasDecorator(2048)||t.hasDecorator(4096))}dynamicArrayElementOf(e){if(e.kind==28)return e.dynamicElementType;let t=e.classReference;if(t!=null&&this.isManagedDynamicArrayType(e)){let i=t.typeArguments;if(i!=null&&i.length>0)return unchecked(i[0])}return assert(!1),p.void}isManagedDynamicArrayType(e){let t=e.classReference;return t==null?!1:t.prototype.internalName==this.program.dynamicArrayPrototype.internalName}dynamicArrayHeaderSize(e){let t=e.alignLog2,i=e.classReference;return i!=null&&(i.hasDecorator(16)||i.hasDecorator(2048))&&(t=i.alignLog2),t>2?1<<t:4}compileDynamicArrayElementAddress(e,t,i){let s=this.module,a=this.dynamicArrayElementOf(i),l=this.unmanagedArrayElementSize(a),o=this.dynamicArrayHeaderSize(a),u=s.binary(219,this.options.isWasm64?s.unary(23,t):t,this.options.isWasm64?s.i64(l):s.i32(l));return s.binary(217,s.binary(217,e,this.options.isWasm64?s.i64(o):s.i32(o)),u)}compileDynamicArrayBoundsCheck(e,t,i){let s=this.module,a=s.load(4,!1,e,P.I32,0,4),l=this.makeAbort(y.createStringLiteralExpression("dynamic array index out of bounds",i.range),i);return s.if(s.binary(24,t,a),l,0)}compileUnmanagedArrayElementAddress(e,t){let i=this.module,s=this.unmanagedArrayElementSize(t.unmanagedArrayElementType),a=this.compileExpression(e.expression,t,1),l=this.compileExpression(e.elementExpression,p.i32,1),o=i.binary(219,this.options.isWasm64?i.unary(23,l):l,this.options.isWasm64?i.i64(s):i.i32(s));return i.binary(217,a,o)}compileUnmanagedArrayElementAccess(e,t,i,s,a,l=null,o=0){let u=this.module,c=t.unmanagedArrayElementType,f=this.unmanagedArrayElementSize(c),_=this.isRecordValueType(c);if(i&&_)return this.error(100,e.range,"whole-record assignment to a `[T *]` element \u2014 `y[i]` of a record is an address, not a value slot; use copyInto(y + i*sizeof(T), v), or write one field with `y[i].field = v`"),this.currentType=p.void,u.unreachable();let d=this.compileUnmanagedArrayElementAddress(e,t);if(this.currentType=c,i){let m=o||this.compileExpression(assert(l),c,1);if(s==p.void)return this.currentType=p.void,u.store(f,d,m,c.toRef(),0,f);let h=this.currentFlow.getTempLocal(c);return this.currentType=c,c.isManaged&&this.currentFlow.setLocalFlag(h.index,8),u.block(null,[u.local_set(h.index,m,c.isManaged),u.store(f,d,u.local_get(h.index,c.toRef()),c.toRef(),0,f),u.local_get(h.index,c.toRef())],c.toRef())}return _?d:u.load(f,c.isSignedIntegerValue,d,c.toRef(),0,f)}compileDynamicArrayElementAccess(e,t,i,s,a,l=null,o=0){let u=this.module,c=this.dynamicArrayElementOf(t),f=this.unmanagedArrayElementSize(c),_=this.isRecordValueType(c);if(i&&_)return this.error(100,e.range,"whole-record assignment to a dynamic array element \u2014 `y[i]` of a record is an address, not a value slot; use copyInto on the element address, or write one field with `y[i].field = v`"),this.currentType=p.void,u.unreachable();let d,m;if(this.isManagedDynamicArrayType(t)){let h=this.compileExpression(e.expression,t,1),b=this.compileExpression(e.elementExpression,p.i32,1),S=assert(t.classReference).members;assert(S!=null),assert(S.has("dataPtr")&&S.has("length"));let k=assert(S.get("dataPtr")).instance.memoryOffset,w=assert(S.get("length")).instance.memoryOffset,R=this.currentFlow.getTempLocal(t),C=this.currentFlow.getTempLocal(p.i32),M=u.local_get(R.index,P.I32),O=u.local_get(C.index,P.I32),D=u.load(4,!1,M,P.I32,k,4),Q=u.load(4,!1,M,P.I32,w,4),H=u.binary(219,this.options.isWasm64?u.unary(23,O):O,this.options.isWasm64?u.i64(f):u.i32(f)),U=this.makeAbort(y.createStringLiteralExpression("dynamic array index out of bounds",e.range),e);m=u.binary(217,D,H),d=u.block(null,[u.local_set(R.index,h,!1),u.local_set(C.index,b,!1),u.if(u.binary(24,u.local_get(C.index,P.I32),Q),U,0)],P.None)}else{let h=this.compileExpression(e.expression,t,1),b=this.compileExpression(e.elementExpression,p.i32,1),A=this.currentFlow.getTempLocal(t),S=this.currentFlow.getTempLocal(p.i32),k=this.compileDynamicArrayBoundsCheck(u.local_get(A.index,P.I32),u.local_get(S.index,P.I32),e);m=this.compileDynamicArrayElementAddress(u.local_get(A.index,P.I32),u.local_get(S.index,P.I32),t),d=u.block(null,[u.local_set(A.index,h,!1),u.local_set(S.index,b,!1),k],P.None)}if(this.currentType=c,i){let h=o||this.compileExpression(assert(l),c,1);if(s==p.void)return this.currentType=p.void,u.block(null,[d,u.store(f,m,h,c.toRef(),0,f)],P.None);let b=this.currentFlow.getTempLocal(c);return this.currentType=c,c.isManaged&&this.currentFlow.setLocalFlag(b.index,8),u.block(null,[d,u.local_set(b.index,h,c.isManaged),u.store(f,m,u.local_get(b.index,c.toRef()),c.toRef(),0,f),u.local_get(b.index,c.toRef())],c.toRef())}return _?u.block(null,[d,m],P.I32):u.block(null,[d,u.load(f,c.isSignedIntegerValue,m,c.toRef(),0,f)],c.toRef())}compileFixedArrayElementAccess(e,t,i,s,a,l=null,o=0){let u=this.module,c=t.fixedArrayElementType,f=this.resolveSroaValueArray(e.expression);if(f!=null)return this.compileSroaValueArrayElementAccess(e,f,i,s,a,l,o);let d=(t.fixedMemoryModel==3||t.fixedMemoryModel==2)&&this.isRecordValueType(c);if(i&&d)return this.error(100,e.range,"whole-record assignment to a `@unmanaged [T * N]` element \u2014 `y[i]` of a record is an address, not a value slot; use copyInto(y + i*sizeof(T), v), or write one field with `y[i].field = v`"),this.currentType=p.void,u.unreachable();let m=c.byteSize,h=this.compileFixedArrayElementAddress(e,t);if(d)return this.currentType=c,h;if(i){let b=o||this.compileExpression(assert(l),c,1);if(s==p.void)return this.currentType=p.void,u.store(m,h,b,c.toRef(),0,m);let A=this.currentFlow.getTempLocal(c);return this.currentType=c,c.isManaged&&this.currentFlow.setLocalFlag(A.index,8),u.block(null,[u.local_set(A.index,b,c.isManaged),u.store(m,h,u.local_get(A.index,c.toRef()),c.toRef(),0,m),u.local_get(A.index,c.toRef())],c.toRef())}return this.currentType=c,u.load(m,c.isSignedIntegerValue,h,c.toRef(),0,m)}compileFixedArrayElementAddress(e,t){let i=this.module,s=t.fixedArrayElementType,a=this.resolver.resolveExpression(e.expression,this.currentFlow);if(!a)return this.module.unreachable();let l=this.compileExpression(e.expression,a,1),o=this.compileExpression(e.elementExpression,p.i32,1),u=s.byteSize,c=s.classReference;c!=null&&(c.hasDecorator(16)||c.hasDecorator(2048))&&(u=c.nextMemoryOffset);let f=u==1<<s.alignLog2,_=this.options.isWasm64?i.unary(23,o):o,d=f?i.binary(227,_,this.options.isWasm64?i.i64(s.alignLog2):i.i32(s.alignLog2)):i.binary(219,_,this.options.isWasm64?i.i64(u):i.i32(u));return i.binary(217,l,d)}compileElementAccessExpression(e,t,i){let s=this.module,a=e.expression,l=this.resolver,o=l.lookupExpression(a,this.currentFlow,p.auto,1);if(o&&o.kind==2){let c=this.compileExpression(e.elementExpression,p.i32,1),f=this.ensureEnumToString(o,e);return this.currentType=this.program.stringInstance.type,f==null?s.unreachable():s.call(f,[c],P.I32)}let u=l.resolveExpression(a,this.currentFlow);if(u){if(u.kind==14)return this.compileFixedArrayElementAccess(e,u,!1,t,i);if(u.kind==27)return this.compileUnmanagedArrayElementAccess(e,u,!1,t,i);if(u.kind==28)return this.compileDynamicArrayElementAccess(e,u,!1,t,i);if(this.isManagedDynamicArrayType(u))return this.compileDynamicArrayElementAccess(e,u,!1,t,i);let c=u.getClassOrWrapper(this.program);if(c){let f=this.currentFlow.is(32768),_=c.lookupOverload(1,f);if(_){let d=assert(_.signature.thisType),m=this.compileExpression(a,d,1);return!f&&this.options.pedantic&&this.pedantic(904,e.range),this.compileCallDirect(_,[e.elementExpression],e,m,i)}}this.error(2329,e.expression.range,u.toString())}return s.unreachable()}compileFunctionExpression(e,t,i){let s=e.declaration.clone();assert(!s.typeParameters);let a=this.currentFlow,l=a.sourceFunction,o=s.name.text.length>0,u=!o||t!=p.void,c=new ot(u?`${o?s.name.text:"anonymous"}|${l.nextAnonymousId++}`:s.name.text,l,s,0),f=J(On(),e);f&&(c.envKind=f.kind,c.envClass=f.envClass);let _,d=me(a.contextualTypeArguments),m=this.module,h=t.signatureReference;if(h){let S=c.functionTypeNode,k=S.parameters,w=k.length,R=h.parameterTypes,C=R.length;if(w>C)return this.error(2554,e.range,C.toString(),w.toString()),m.unreachable();for(let U=0;U<w;++U){let V=k[U];if(!De(V.type)){let Y=this.resolver.resolveType(V.type,a,l.parent,d);if(!Y)return m.unreachable();if(!R[U].isStrictlyAssignableTo(Y))return this.error(2322,V.range,R[U].toString(),Y.toString()),m.unreachable()}}let M=h.returnType;if(!De(S.returnType)){let U=this.resolver.resolveType(S.returnType,a,l.parent,d);if(!U)return m.unreachable();if(M==p.void?U!=p.void:!U.isStrictlyAssignableTo(M))return this.error(2322,S.returnType.range,U.toString(),M.toString()),m.unreachable()}let O=h.thisType,D=S.explicitThisType;if(D){if(!O)return this.error(2332,D.range),m.unreachable();let U=this.resolver.resolveType(D,a,l.parent,d);if(!U)return m.unreachable();if(!O.isStrictlyAssignableTo(U))return this.error(2322,D.range,O.toString(),U.toString()),m.unreachable()}let Q=fe.create(this.program,R,M,O,C);_=new Mt(c.name,c,null,Q,d),_.flow.outer=a;let H=this.compileFunction(_);if(this.currentType=h.type,!H)return m.unreachable()}else{if(_=this.resolver.resolveFunction(c,null,d),!_)return this.module.unreachable();_.flow.outer=a;let S=this.compileFunction(_);if(this.currentType=_.signature.type,!S)return m.unreachable()}let b=this.currentType,A;if(_.prototype.envKind==2)A=this.makeEnvFunctionValue(_,assert(qr().get(e)));else if(_.prototype.capturesThis)A=this.makeCapturingFunctionValue(_);else{let S=this.ensureRuntimeFunction(_);A=this.options.isWasm64?m.i64(i64_low(S),i64_high(S)):m.i32(i64_low(S))}if(this.currentType=b,!u){let S=_.name,k=a.getScopedLocal(S);if(k)k.declaration.range.source.isNative?this.error(2300,s.name.range,S):this.errorRelated(2300,s.name.range,k.declaration.name.range,S);else{let w=_.type,R=a.addScopedLocal(_.name,w);a.setLocalFlag(R.index,9),A=m.local_tee(R.index,A,w.isManaged)}}return A}assertFunctionLayout(e){assert(e.offsetof("_index")==cu),assert(e.offsetof("_env")==this.options.usizeType.byteSize)}makeCapturingFunctionValue(e){let t=this.module,i=this.currentFlow,s=this.resolver,a=assert(s.resolveClass(this.program.functionPrototype,[e.type]));this.assertFunctionLayout(a);let l=assert(i.lookupLocal(B.this_)),o=new Array,u=i.getTempLocal(a.type);o.push(t.local_set(u.index,this.makeAllocation(a),a.type.isManaged));let c=t.local_get(u.index,a.type.toRef());return o.push(t.store(4,c,t.i32(this.ensureFunctionTableIndex(e)),P.I32,cu)),o.push(t.store(this.options.usizeType.byteSize,c,t.local_get(l.index,l.type.toRef()),this.options.sizeTypeRef,this.options.usizeType.byteSize)),o.push(t.local_get(u.index,a.type.toRef())),t.flatten(o,a.type.toRef())}makeEnvFunctionValue(e,t){let i=this.module,s=this.currentFlow,a=this.resolver,l=assert(a.resolveClass(this.program.functionPrototype,[e.type]));this.assertFunctionLayout(l);let o=assert(s.lookupLocal(t)),u=new Array,c=s.getTempLocal(l.type);u.push(i.local_set(c.index,this.makeAllocation(l),l.type.isManaged));let f=i.local_get(c.index,l.type.toRef());return u.push(i.store(4,f,i.i32(this.ensureFunctionTableIndex(e)),P.I32,cu)),u.push(i.store(this.options.usizeType.byteSize,f,i.local_get(o.index,o.type.toRef()),this.options.sizeTypeRef,this.options.usizeType.byteSize)),u.push(i.local_get(c.index,l.type.toRef())),i.flatten(u,l.type.toRef())}maybeCompileEnclosingSource(e){let t=e.range.source.internalPath,i=this.program.filesByName;assert(i.has(t)),assert(i.get(t)).is(8388608)||this.compileFileByPath(t,e)}compileIdentifierExpression(e,t,i){let s=this.module,a=this.currentFlow,l=a.sourceFunction;switch(e.kind){case 20:{let c=this.options;if(t.isReference){let f=t.getClass();if(f)return this.currentType=f.type.asNullable(),c.isWasm64?s.i64(0):s.i32(0);let _=t.getSignature();return _?(this.currentType=_.type.asNullable(),c.isWasm64?s.i64(0):s.i32(0)):this.makeZero(t)}return this.currentType=c.usizeType,this.warning(226,e.range,this.currentType.toString()),c.isWasm64?s.i64(0):s.i32(0)}case 27:return this.currentType=p.bool,s.i32(1);case 15:return this.currentType=p.bool,s.i32(0);case 26:{let c=l.signature.thisType;if(!c){if(l.prototype.capturesThis){let _=assert(a.lookupLocal(B.this_));return a.set(64),this.currentType=_.type,s.local_get(_.index,_.type.toRef())}return this.error(2332,e.range),this.currentType=this.options.usizeType,s.unreachable()}if(l.is(524288)&&(a.is(65536)&&this.error(2333,e.range),!(i&32))){let _=l.parent;assert(_.kind==7),this.checkFieldInitialization(_,e)}let f=assert(a.lookupLocal(B.this_));return a.set(64),this.currentType=c,s.local_get(f.index,c.toRef())}case 25:{if(l.is(524288)&&(a.is(65536)?this.error(2336,e.range):a.is(128)||this.error(17011,e.range)),a.isInline){let c=a.lookupLocal(B.this_);if(c){let _=assert(c.type.getClass()).base;if(_)return this.currentType=_.type,s.local_get(c.index,_.type.toRef())}}if(l.is(262144)){let c=assert(l.parent);assert(c.kind==7);let _=c.base;if(_){let d=_.type;return this.currentType=d,s.local_get(0,d.toRef())}}return this.error(2335,e.range),this.currentType=this.options.usizeType,s.unreachable()}}this.maybeCompileEnclosingSource(e);let o=this.currentParent;o||(o=l);let u=this.resolver.lookupIdentifierExpression(e,a,o);if(!u)return this.currentType==p.void&&(this.currentType=p.i32),s.unreachable();switch(u.kind){case 1:{let c=u,f=c.type;if(assert(f!=p.void),this.pendingElements.has(c))return this.error(2448,e.range,c.internalName),this.currentType=f,s.unreachable();if(c.is(33554432))return this.compileInlineConstant(c,t,i);let _=this.lazyLocals;if(_!=null){let b=J(_,c);if(b!=null)return this.compileLazyLocalRead(c,b,e)}let d=c.index;if(a.isLocalFlag(d,8)||this.error(2454,e.range,c.name),c.isViewLocal)return this.currentType=f,s.local_get(d,P.I32);if(c.fieldLocals!=null||c.isViewParam||d<0)return this.error(100,e.range,"reading an @inline struct value as a whole (a value has no address; read a field, or copy it with `let q: P = p`)"),this.currentType=f,s.unreachable();assert(d>=0);let m=a.isLocalFlag(d,4,!1);if(f.isNullableReference&&m&&(!f.isExternalReference||this.options.hasFeature(1024))?this.currentType=f.nonNullableType:this.currentType=f,!c.declaredByFlow(a))return this.error(100,e.range,"Closures"),s.unreachable();let h=s.local_get(d,f.toRef());return m&&f.isNullableExternalReference&&this.options.hasFeature(1024)&&(h=s.ref_as_nonnull(h)),h}case 0:{let c=u;if(!this.compileGlobalLazy(c,e))return s.unreachable();let f=c.type;if(this.pendingElements.has(c))return this.error(2448,e.range,c.internalName),this.currentType=f,s.unreachable();if(assert(f!=p.void),c.hasDecorator(512))return this.compileIdentifierExpressionBuiltin(c,e,t);if(c.is(33554432))return this.compileInlineConstant(c,t,i);let _=s.global_get(c.internalName,f.toRef());return c.is(16384)&&f.isReference&&!f.isNullableReference&&(_=this.makeRuntimeNonNullCheck(_,f,e)),this.currentType=f,_}case 3:{let c=u;return u.is(8388608)?(this.currentType=p.i32,c.is(33554432)?(assert(c.constantValueKind==1),s.i32(i64_low(c.constantIntegerValue))):s.global_get(c.internalName,P.I32)):(this.error(2651,e.range),this.currentType=p.i32,s.unreachable())}case 4:{let c=u,f=c.typeParameterNodes;if(f&&f.length!=0){this.error(1140,e.range);break}let _=this.resolver.resolveFunction(c,null,me(a.contextualTypeArguments));if(!_||!this.compileFunction(_))return s.unreachable();if(_.hasDecorator(512))return this.error(100,e.range,"First-class built-ins"),this.currentType=_.type,s.unreachable();if(t.isExternalReference)return this.currentType=p.func,s.ref_func(_.internalName,Fs(_.type));let d=this.ensureRuntimeFunction(_);return this.currentType=_.signature.type,this.options.isWasm64?s.i64(i64_low(d),i64_high(d)):s.i32(i64_low(d))}}return this.error(234,e.range),s.unreachable()}compileLazyLocalRead(e,t,i){let s=this.module,a=this.currentFlow,l=e.type,o=t.valueIndex,u=t.doneIndex,c=this.compileExpression(t.expression,l,1);if(!c)return s.unreachable();l.isShortIntegerValue&&(c=this.ensureSmallIntegerWrap(c,l));let f=this.currentType;c=this.convertExpression(c,f,l,!1,t.expression);let _=s.local_set(o,c,l.isManaged),d=s.local_set(u,s.i32(1),!1),m=s.if(s.unary(20,s.local_get(u,P.I32)),s.block(null,[_,d],P.None)),h=o,b=a.isLocalFlag(h,4,!1);return l.isNullableReference&&b&&(!l.isExternalReference||this.options.hasFeature(1024))?this.currentType=l.nonNullableType:this.currentType=l,this.options.sourceMap&&this.addDebugLocation(m,i.range),s.block(null,[m,s.local_get(h,this.currentType.toRef())],this.currentType.toRef())}compileIdentifierExpressionBuiltin(e,t,i){e.hasDecorator(8192)&&this.checkUnsafe(t,e.identifierNode);let s=e.internalName;return assert(At.has(s)),assert(At.get(s))(new Ws(this,e,i,t))}compileLoweredAwaitExpression(e){let t=J(lu(),e);if(!t)return this.error(100,e.range,"the async lowering transform did not run"),this.module.unreachable();let i=this.resolver.resolveExpression(e,this.currentFlow,p.auto,0);if(!i)return this.module.unreachable();if(i==p.void)return this.currentType=p.void,this.module.nop();if(i.isReference)return this.error(100,e.range,"a reference-typed await result"),this.module.unreachable();if(!i.isMemory)return this.error(203,e.range,"await",i.toString()),this.module.unreachable();let s;i==p.f32||i==p.f64||i==p.i64||i==p.u64?s=16:s=8;let a=this.compileExpression(t.recordExpression,p.auto,0);return this.currentType=i,this.module.load(i.byteSize,i.isSignedIntegerValue,a,i.toRef(),s,i.byteSize)}compileInstanceOfExpression(e,t,i){let s=this.currentFlow,a=e.isType;if(a.kind==1){let o=a;if(!(o.isNullable||o.hasTypeArguments)){let u=this.resolver.resolveTypeName(o.name,s,s.sourceFunction,1);if(u&&u.kind==6){let c=u;if(c.is(65536))return this.makeInstanceofClass(e,c)}}}let l=this.resolver.resolveType(e.isType,s,s.sourceFunction,me(s.contextualTypeArguments));return l?this.makeInstanceofType(e,l):(this.currentType=p.bool,this.module.unreachable())}makeInstanceofType(e,t){let i=this.module,s=this.currentFlow,a=this.compileExpression(e.expression,t),l=this.currentType;if(this.currentType=p.bool,t.isValue)return i.maybeDropCondition(a,i.i32(l==t?1:0));if(l.isValue)return i.maybeDropCondition(a,i.i32(0));let o=l.toRef();if(l.isNullableReference&&!t.isNullableReference){if(l.nonNullableType.isAssignableTo(t))return i.binary(o==P.I64?41:16,a,this.makeZero(l));if(l.nonNullableType.hasSubtypeAssignableTo(t))if(l.isUnmanaged||t.isUnmanaged)this.error(2365,e.range,"instanceof",l.toString(),t.toString());else{this.options.pedantic&&this.pedantic(903,e.range);let c=s.getTempLocal(l).index;return i.if(i.unary(o==P.I64?21:20,i.local_tee(c,a,l.isManaged)),i.i32(0),i.call(this.prepareInstanceOf(t.classReference),[i.local_get(c,o)],P.I32))}}else{if(l.isAssignableTo(t))return i.maybeDropCondition(a,i.i32(1));if(l.hasSubtypeAssignableTo(t))if(l.isUnmanaged||t.isUnmanaged)this.error(2365,e.range,"instanceof",l.toString(),t.toString());else{let c=s.getTempLocal(l).index;return i.if(i.unary(o==P.I64?21:20,i.local_tee(c,a,l.isManaged)),i.i32(0),i.call(this.prepareInstanceOf(t.classReference),[i.local_get(c,o)],P.I32))}}return i.maybeDropCondition(a,i.i32(0))}prepareInstanceOf(e){let t=`~instanceof|${e.internalName}`,i=this.pendingInstanceOf;if(i.has(e))return assert(i.get(e));i.set(e,t);let s=this.module;return s.addFunction(t,this.options.sizeTypeRef,P.I32,null,s.unreachable()),t}finalizeInstanceOf(e,t){let i=this.program,s=this.module,a=this.options.sizeTypeRef,l=new Array;l.push(s.local_set(1,s.load(4,!1,s.binary(a==P.I64?26:1,s.local_get(0,a),s.i32(i.totalOverhead-i.OBJECTInstance.offsetof("rtId"))),P.I32),!1));let o;if(e.isInterface)o=e.implementers;else{o=new Set,o.add(e);let u=e.extenders;if(u)for(let c=Set_values(u),f=0,_=c.length;f<_;++f){let d=c[f];o.add(d)}}if(o)for(let u=Set_values(o),c=0,f=u.length;c<f;++c){let _=u[c];l.push(s.br("is_instance",s.binary(15,s.local_get(1,P.I32),s.i32(_.id))))}l.push(s.return(s.i32(0))),l[0]=s.block("is_instance",l,P.None),l.length=1,l.push(s.i32(1)),s.removeFunction(t),s.addFunction(t,a,P.I32,[P.I32],s.block(null,l,P.I32))}makeInstanceofClass(e,t){let i=this.module,s=this.compileExpression(e.expression,p.auto),a=this.currentType,l=a.toRef();this.currentType=p.bool;let o=a.getClass();if(o){if(o.extendsPrototype(t))return a.isNullableReference?i.binary(l==P.I64?41:16,s,this.makeZero(a)):i.maybeDropCondition(s,i.i32(1));if(t.extends(o.prototype)){let f=this.currentFlow.getTempLocal(a).index;return i.if(i.unary(l==P.I64?21:20,i.local_tee(f,s,a.isManaged)),i.i32(0),i.call(this.prepareAnyInstanceOf(t),[i.local_get(f,l)],P.I32))}}return i.maybeDropCondition(s,i.i32(0))}prepareAnyInstanceOf(e){let t=`~anyinstanceof|${e.internalName}`,i=this.pendingInstanceOf;if(i.has(e))return assert(i.get(e));i.set(e,t);let s=this.module;return s.addFunction(t,this.options.sizeTypeRef,P.I32,null,s.unreachable()),t}finalizeAnyInstanceOf(e,t){let i=this.module,s=this.options.sizeTypeRef,a=new Array,l=e.instances;if(l){let o=this.program;a.push(i.local_set(1,i.load(4,!1,i.binary(s==P.I64?26:1,i.local_get(0,s),i.i32(o.totalOverhead-o.OBJECTInstance.offsetof("rtId"))),P.I32),!1));let u=new Set;for(let c=Map_values(l),f=0,_=c.length;f<_;++f){let d=c[f];if(d.isInterface){let m=d.implementers;if(m)for(let h=Set_values(m),b=0,A=h.length;b<A;++b){let S=h[b];u.add(S)}}else{u.add(d);let m=d.extenders;if(m)for(let h=Set_values(m),b=0,A=h.length;b<A;++b){let S=h[b];u.add(S)}}}for(let c=Set_values(u),f=0,_=c.length;f<_;++f){let d=c[f];a.push(i.br("is_instance",i.binary(15,i.local_get(1,P.I32),i.i32(d.id))))}}a.push(i.return(i.i32(0))),a[0]=i.block("is_instance",a,P.None),a.length=1,a.push(i.i32(1)),i.removeFunction(t),i.addFunction(t,s,P.I32,[P.I32],i.block(null,a,P.I32))}compileLiteralExpression(e,t,i,s=!1){let a=this.module;switch(e.literalKind){case 5:return assert(!s),this.compileArrayLiteral(e,t,i);case 0:{let l=e.value;return s&&(l=-l),t==p.f32?a.f32(l):(this.currentType=p.f64,a.f64(l))}case 1:{let l=e,o=this.resolver.determineIntegerLiteralType(l,s,t);this.currentType=o;let u=l.value,c=1;switch(s&&(o.isFloatValue?c=-1:u=i64_neg(u)),o.kind){case 5:if(!this.options.isWasm64)return a.i32(i64_low(u));case 4:return a.i64(i64_low(u),i64_high(u));case 10:if(!this.options.isWasm64)return a.i32(i64_low(u));case 9:return a.i64(i64_low(u),i64_high(u));case 11:return a.f32(c*i64_to_f32(u));case 12:return a.f64(c*i64_to_f64(u));default:return a.i32(i64_low(u))}}case 2:return assert(!s),this.compileStringLiteral(e,i);case 3:return assert(!s),this.compileTemplateLiteral(e,i);case 6:return assert(!s),this.compileObjectLiteral(e,t);case 4:return this.error(100,e.range,"Regular expressions"),this.currentType=t,a.unreachable()}return assert(!1),a.unreachable()}compileStringLiteral(e,t){return this.ensureStaticString(e.value)}compileTemplateLiteral(e,t){let i=e.tag,s=e.parts,a=s.length,l=e.expressions,o=l.length;assert(o==a-1);let u=this.module,c=this.program.stringInstance,f=c.type;if(!i){if(a==1)return this.ensureStaticString(s[0]);if(a==2){let V=l[0],Y=s[0].length,q=s[1].length;if(!Y&&!q)return this.makeToString(this.compileExpression(V,f),this.currentType,V);let ne=Y!=0;if(ne^q!=0){let j,ge,oe=this.makeToString(this.compileExpression(V,f),this.currentType,V);ne?(j=this.ensureStaticString(s[0]),ge=oe):(j=oe,ge=this.ensureStaticString(s[1]));let _e=assert(c.getMethod("concat"));return this.makeCallDirect(_e,[j,ge],V)}}if(a==3&&!s[0].length&&!s[1].length&&!s[2].length){let V=l[0],Y=l[1],q=this.makeToString(this.compileExpression(V,f),this.currentType,V),ne=this.makeToString(this.compileExpression(Y,f),this.currentType,Y),j=assert(c.getMethod("concat"));return this.makeCallDirect(j,[q,ne],e)}let k=new Array(o),w=new Array;s[0].length>0&&w.push(this.ensureStaticString(s[0]));for(let V=1;V<a;++V)k[V-1]=w.length,w.push(u.usize(0)),s[V].length>0&&w.push(this.ensureStaticString(s[V]));let R=assert(this.resolver.resolveClass(this.program.staticArrayPrototype,[f])),C=this.addStaticBuffer(f,w,R.id);this.program.OBJECTInstance.writeField("gcInfo",3,C.buffer,0);let M=i64_add(C.offset,i64_new(this.program.totalOverhead)),O=assert(R.getMethod("join")),D=assert(R.lookupOverload(2,!0)),Q=new Array(2*o+1),H=new Array(o),U=this.currentFlow;for(let V=0;V<o;++V){let Y=l[V],q=U.getTempLocal(f);H[V]=q,Q[V]=u.local_set(q.index,this.makeToString(this.compileExpression(Y,f),this.currentType,Y),!0)}for(let V=0;V<o;++V)Q[o+V]=this.makeCallDirect(D,[u.usize(M),u.i32(k[V]),u.local_get(H[V].index,f.toRef())],e);return Q[2*o]=this.makeCallDirect(O,[u.usize(M),this.ensureStaticString("")],e),u.flatten(Q,f.toRef())}let _=this.program.templateStringsArrayInstance,d=_,m=this.resolver.lookupExpression(i,this.currentFlow,p.auto,1);if(m)switch(m.kind){case 4:{let k=this.resolver.resolveFunction(m,null,new Map,1);if(!k)break;m=k}case 5:{let w=m.signature.parameterTypes;if(w.length){let R=w[0].getClass();R&&!R.extendsPrototype(_.prototype)&&(d=assert(this.resolver.resolveClass(this.program.arrayPrototype,[f])))}break}}let h=e.rawParts;assert(h.length==a);let b=new Array(a);for(let k=0;k<a;++k)b[k]=this.ensureStaticString(s[k]);let A;if(d==_){let k=new Array(a);for(let R=0;R<a;++R)k[R]=this.ensureStaticString(h[R]);A=this.addStaticArrayHeader(f,this.addStaticBuffer(this.options.usizeType,b),d);let w=this.addStaticArrayHeader(f,this.addStaticBuffer(this.options.usizeType,k));d.writeField("raw",i64_add(w.offset,i64_new(this.program.totalOverhead)),A.buffer)}else A=this.addStaticArrayHeader(f,this.addStaticBuffer(this.options.usizeType,b),d);let S=l.slice();return S.unshift(y.createCompiledExpression(u.usize(i64_add(A.offset,i64_new(this.program.totalOverhead))),d.type,Te.native.range)),this.error(100,e.range,"Tagged template literals"),this.compileCallExpressionLike(i,null,S,e.range,f)}compileArrayLiteral(e,t,i){let s=this.module,a=this.currentFlow,l=this.program,o=t.getClass();if(o&&o.extendsPrototype(l.staticArrayPrototype))return this.compileStaticArrayLiteral(e,t,i);let u=this.resolver.lookupExpression(e,a,this.currentType);if(!u)return s.unreachable();assert(u.kind==7);let c=u,f=c.type,_=c.getTypeArgumentsTo(l.arrayPrototype)[0],d=a.getTempLocal(this.options.usizeType),m=e.elementExpressions,h=m.length,b=new Array(h),A=!_.isExternalReference;for(let M=0;M<h;++M){let O=m[M];if(O.kind!=21){let D=this.compileExpression(O,_,1);if(pe(D)!=_.toRef())A=!1;else{let Q=s.runExpression(D,1);Q?D=Q:A=!1}b[M]=D}else b[M]=this.makeZero(_)}if(A){let M=l.totalOverhead,O=this.addStaticBuffer(_,b),D=i64_add(O.offset,i64_new(M));if(i&16){let Q=this.addStaticArrayHeader(_,O),H=i64_add(Q.offset,i64_new(M));return this.currentType=f,l.options.isWasm64?this.module.i64(i64_low(H),i64_high(H)):this.module.i32(i64_low(H))}else return this.makeNewArray(c,h,D,e)}let S=c.lookupOverload(2,!0);if(!S)return this.error(2542,e.range,c.internalName),this.currentType=f,s.unreachable();let k=f.toRef(),w=new Array;w.push(s.local_set(d.index,this.makeNewArray(c,h,i64_new(0),e),f.isManaged));let R=assert(c.getMember("dataStart"));assert(R.kind==10);let C=R.instance;if(!C)return s.unreachable();assert(C.isField&&C.memoryOffset>=0);for(let M=0;M<h;++M)w.push(s.call(S.internalName,[s.local_get(d.index,k),s.i32(M),b[M]],P.None));return w.push(s.local_get(d.index,k)),h&&this.compileFunction(S),this.currentType=f,s.flatten(w,k)}makeNewArray(e,t,i,s){let a=this.program,l=this.module;assert(!e.extendsPrototype(a.staticArrayPrototype));let o=e.getArrayValueType(),u=this.makeCallDirect(a.newArrayInstance,[l.i32(t),a.options.isWasm64?l.i64(o.alignLog2):l.i32(o.alignLog2),l.i32(e.id),a.options.isWasm64?l.i64(i64_low(i),i64_high(i)):l.i32(i64_low(i))],s);return this.currentType=e.type,u}compileStaticArrayLiteral(e,t,i){let s=this.module,a=this.currentFlow,l=this.program,o=assert(t.getClass()),u=o.type,f=assert(o.getTypeArgumentsTo(l.staticArrayPrototype))[0],_=a.getTempLocal(this.options.usizeType),d=e.elementExpressions,m=d.length,h=new Array(m),b=!f.isExternalReference;for(let C=0;C<m;++C){let M=d[C];if(M.kind!=21){let O=this.compileExpression(M,f,1),D=s.runExpression(O,1);D?O=D:b=!1,h[C]=O}else h[C]=this.makeZero(f)}let A=this.options.isWasm64,S=h.length<<f.alignLog2;if(b){let C=this.addStaticBuffer(f,h,o.id),M=i64_add(C.offset,i64_new(l.totalOverhead));if(i&16){let O=this.options.isWasm64?s.i64(i64_low(M),i64_high(M)):s.i32(i64_low(M));return this.currentType=u,O}else{let O=this.makeCallDirect(l.newBufferInstance,[A?s.i64(S):s.i32(S),s.i32(o.id),A?s.i64(i64_low(M),i64_high(M)):s.i32(i64_low(M))],e);return this.currentType=u,O}}let k=o.lookupOverload(2,!0);if(!k)return this.error(2542,e.range,o.internalName),this.currentType=u,s.unreachable();let w=u.toRef(),R=new Array;R.push(s.local_set(_.index,this.makeCallDirect(l.newBufferInstance,[A?s.i64(S):s.i32(S),s.i32(o.id)],e),u.isManaged));for(let C=0;C<m;++C)R.push(s.call(k.internalName,[s.local_get(_.index,w),s.i32(C),h[C]],P.None));return R.push(s.local_get(_.index,w)),m&&this.compileFunction(k),this.currentType=u,s.flatten(R,w)}compileObjectLiteral(e,t){let i=this.module,s=t.getClass();if(!s)return this.error(2322,e.range,"<object>",t.toString()),i.unreachable();let a=s.type;if(this.currentType=a.nonNullableType,s.kind==9)return this.error(100,e.range,"Interface hidden classes"),i.unreachable();if(s.is(128))return this.error(2511,e.range),i.unreachable();let l=s.prototype.constructorPrototype;if(l)return this.errorRelated(216,e.range,l.identifierNode.range,a.toString()),i.unreachable();a.isManaged||this.checkUnsafe(e,Zt(6,s.decoratorNodes));let u=e.names,c=u.length,f=e.values,_=s.members,d=!1,m=new Array,b=this.currentFlow.getTempLocal(a),A=a.toRef();assert(c==f.length);let S=new Set;if(_)for(let R=Map_keys(_),C=0,M=R.length;C<M;++C){let O=R[C],D=assert(_.get(O));if(D&&D.kind==10){let Q=D.instance;Q&&Q.isField&&S.add(Q)}}let k=new Array;for(let R=0;R<c;++R){let C=u[R].text,M=s.getMember(C);if(!M||M.kind!=10){this.error(2339,u[R].range,C,a.toString()),d=!0;continue}if(M.is(512)){this.error(2341,u[R].range,C,a.toString()),d=!0;continue}if(M.is(1024)){this.error(2445,u[R].range,C,a.toString()),d=!0;continue}let O=this.resolver.resolveProperty(M);if(!O)continue;let D=O.setterInstance;if(!D){this.error(2540,u[R].range,C,a.toString()),d=!0;continue}if(S.delete(O),!O.isField){k.push(O);continue}let Q=O.type,H=this.makeCallDirect(D,[i.local_get(b.index,A),this.compileExpression(f[R],Q,1)],D.identifierNode,!0);this.currentType!=p.void&&(H=i.drop(H)),m.push(H)}for(let R=0,C=k.length;R<C;++R){let M=k[R],O=assert(M.setterInstance);m.push(this.makeCallDirect(O,[i.local_get(b.index,A),this.compileExpression(f[R],M.type,1)],O.identifierNode))}if(this.currentType=a.nonNullableType,d)return i.unreachable();for(let R=Set_values(S),C=0,M=R.length;C<M;++C){let O=R[C];assert(O.isField);let D=O.type;if(!O.initializerNode){if(D.isReference&&!D.isNullableReference){this.error(2741,e.range,O.name,"<object>",a.toString()),d=!0;continue}switch(D.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:{m.push(i.store(D.byteSize,i.local_get(b.index,A),this.makeZero(D),D.toRef(),O.memoryOffset));continue}}this.error(2741,e.range,O.name,"<object>",a.toString()),d=!0}}if(d)return i.unreachable();let w=this.ensureConstructor(s,e);return m.unshift(i.local_set(b.index,this.compileInstantiate(w,[],0,e),a.isManaged)),m.push(i.local_get(b.index,A)),this.currentType=a.nonNullableType,i.flatten(m,A)}compileNewExpression(e,t,i){let s=this.module,a=this.currentFlow,l=this.resolver.resolveTypeName(e.typeName,a,a.sourceFunction);if(!l)return s.unreachable();if(l.kind!=6)return this.error(2351,e.typeName.range),this.module.unreachable();if(l.is(128))return this.error(2511,e.typeName.range),this.module.unreachable();let o=l,u=null,c=e.typeArguments,f;if(!c&&(f=t.classReference)&&f.prototype==o&&f.is(65536)?u=this.resolver.resolveClass(o,f.typeArguments,me(a.contextualTypeArguments)):u=this.resolver.resolveClassInclTypeArguments(o,c,a,a.sourceFunction.parent,me(a.contextualTypeArguments),e),!u)return s.unreachable();t==p.void&&(i|=8);let _=this.ensureConstructor(u,e);return _.hasDecorator(64)||this.checkFieldInitialization(u,e),this.compileInstantiate(_,e.args,i,e)}ensureConstructor(e,t){let i=e.constructorInstance;if(i){if(i.is(8388608))return i;i.hasDecorator(64)||this.compileFunction(i)}else{let s=e.base,a=me(e.contextualTypeArguments);if(s){let k=this.ensureConstructor(s,t);this.checkFieldInitialization(s,t),i=new Mt(B.constructor,new ot(B.constructor,e,k.declaration.clone()),null,fe.create(this.program,k.signature.parameterTypes,e.type,e.type,k.signature.requiredParameters,k.signature.hasRest,e.hasDecorator(4096)),a)}else i=new Mt(B.constructor,new ot(B.constructor,e,this.program.makeNativeFunctionDeclaration(B.constructor,786432)),null,fe.create(this.program,[],e.type,e.type,0,!1,e.hasDecorator(4096)),a);i.set(8388608),i.prototype.setResolvedInstance("",i),e.is(1048576)&&i.set(1048576),e.constructorInstance=i;let l=e.members;l||(e.members=l=new Map),l.set(B.constructor,i.prototype);let o=this.currentFlow,u=i.flow;this.currentFlow=u;let c=i.signature,f=this.module,_=this.options.sizeTypeRef,d=new Array;if(d.push(this.makeConditionalAllocation(e,0)),s){let k=c.parameterTypes,w=k.length,R=new Array(1+w);R[0]=f.local_get(0,_);for(let C=1;C<=w;++C)R[C]=f.local_get(C,k[C-1].toRef());d.push(f.local_set(0,this.makeCallDirect(assert(s.constructorInstance),R,t,!1),s.type.isManaged))}this.makeFieldInitializationInConstructor(e,d),d.push(f.local_get(0,_)),this.currentFlow=o;let m=i.localsByIndex,h=new Array,b=1+c.parameterTypes.length,A=m.length;if(A>b)for(let k=b;k<A;++k)h.push(m[k].type.toRef());let S=f.addFunction(i.internalName,c.paramRefs,c.resultRefs,h,f.flatten(d,_));i.finalize(f,S)}return i}checkFieldInitialization(e,t=null){if(e.didCheckFieldInitialization)return;e.didCheckFieldInitialization=!0;let i=assert(e.constructorInstance);this.checkFieldInitializationInFlow(e,i.flow,t)}checkFieldInitializationInFlow(e,t,i=null){let s=e.members;if(s)for(let a=Map_values(s),l=0,o=a.length;l<o;++l){let u=a[l];if(u.kind!=10||u.parent!=e)continue;let c=u.instance;if(!c||!c.isField)continue;let f=c.type;f.kind==14&&(f.fixedMemoryModel==0||f.fixedMemoryModel==1)||(!c.initializerNode&&!t.isThisFieldFlag(c,1)?c.is(16384)||(i?this.errorRelated(2564,c.declaration.name.range,i.range,c.internalName):this.error(2564,c.declaration.name.range,c.internalName)):c.is(16384)&&(c.type.isReference?this.warning(233,c.identifierNode.range,c.internalName):this.pedantic(906,c.identifierNode.range)))}}compileInstantiate(e,t,i,s){assert(e.is(524288));let a=e.parent;assert(a.kind==7);let l=a;(l.type.isUnmanaged||e.hasDecorator(8192))&&this.checkUnsafe(s);let o=this.compileCallDirect(e,t,s,this.makeZero(this.options.usizeType),i);return pe(o)!=P.None&&(this.currentType=l.type),o}compilePropertyAccessExpression(e,t,i){let s=this.module,a=this.currentFlow;this.maybeCompileEnclosingSource(e);let l=this.resolver;{let c=null;if(e.expression.kind==8){let f=a.lookupLocal(e.expression.text);f!=null&&(c=f.type)}if(c!=null&&c.kind==28){if(e.property.text!="length")return this.error(2339,e.property.range,e.property.text,c.toString()),s.unreachable();let f=this.compileExpression(e.expression,c,1);return this.currentType=p.i32,s.load(4,!1,f,P.I32,0,4)}}let o=l.lookupExpression(e,a,t);if(!o)return s.unreachable();let u=l.currentThisExpression;switch(o.hasDecorator(8192)&&this.checkUnsafe(e),o.kind){case 0:{let c=o;if(!this.compileGlobalLazy(c,e))return s.unreachable();let f=c.type;if(assert(f!=p.void),this.pendingElements.has(c))return this.error(2448,e.range,c.internalName),this.currentType=f,s.unreachable();if(c.is(33554432))return this.compileInlineConstant(c,t,i);let _=s.global_get(c.internalName,f.toRef());return c.is(16384)&&f.isReference&&!f.isNullableReference&&(_=this.makeRuntimeNonNullCheck(_,f,e)),this.currentType=f,_}case 3:{let c=o,f=assert(c.parent);assert(f.kind==2);let _=f;return this.compileEnum(_)?(this.currentType=c.type,c.is(33554432)?(assert(c.constantValueKind==1),this.compileInlineConstant(c,t,i)):s.global_get(c.internalName,P.I32)):(this.currentType=_.type,this.module.unreachable())}case 10:{let c=o,f=this.resolver.resolveProperty(c);if(!f)return s.unreachable();o=f}case 11:{let c=o;if(c.isField&&a.sourceFunction.is(524288)&&assert(u).kind==26&&!a.isThisFieldFlag(c,1)&&!c.is(16384)&&this.errorRelated(2565,e.range,c.identifierNode.range,c.internalName),u!=null&&u.kind==14){let m=this.compileSroaArrayLeafByRuntimeIndex(u,c);if(m!=0)return m}let f=u!=null?this.resolveSroaReceiver(u):null;if(f!=null){let m=assert(f.fieldLocals);if(!c.isField||!m.has(c.name))return this.error(100,e.range,"reading this member of an @inline struct (only supported fields are readable; a refused or computed member has no local)"),s.unreachable();let h=assert(m.get(c.name));return h.index<0?(this.error(100,e.range,"reading a nested @inline struct value as a whole (the field is several leaves, not one value; read one of its fields)"),s.unreachable()):(this.currentType=c.type,s.local_get(h.index,h.type.toRef()))}if(u!=null&&c.isField&&this.resolver.isViewCall(u)){let m=c.type,h=this.compileExpression(u,p.auto);return this.currentType=m,this.viewFieldAccess(h,c,m)}if(u!=null&&u.kind==8&&c.isField){let m=a.lookupLocal(u.text);if(m!=null&&(m.isViewParam||m.isViewLocal)){let h=c.type;return this.currentType=h,this.viewFieldAccess(s.local_get(m.index,P.I32),c,h)}}if(u!=null&&u.kind==11&&c.isField){let m=this.resolver.resolveExpression(u,this.currentFlow);if(m!=null&&this.isInlineStructType(m))return this.makeSretCallBlock(u,m,c.type,c,null)}if(c.type.kind==14||c.isField&&this.isInlineStructType(c.type)){let m=this.resolver.resolveExpression(assert(u),this.currentFlow);if(!m)return s.unreachable();let h=this.compileExpression(assert(u),m,33);this.currentType=c.type;let b=c.memoryOffset;return b?s.binary(217,h,this.options.isWasm64?s.i64(b):s.i32(b)):h}let _=c.getterInstance;if(!_)return s.unreachable();let d=0;return _.is(262144)&&(d=this.compileExpression(assert(u),assert(_.signature.thisType),33)),this.compileCallDirect(_,[],e,d)}case 4:{let c=o,f=c.typeParameterNodes;if(f&&f.length!=0){this.error(1140,e.range);break}let _=this.resolver.resolveFunction(c,null);if(!_||!this.compileFunction(_))return s.unreachable();if(this.currentType=_.type,_.hasDecorator(512))return this.error(100,e.range,"First-class built-ins"),s.unreachable();let d=this.ensureRuntimeFunction(_);return this.options.isWasm64?s.i64(i64_low(d),i64_high(d)):s.i32(i64_low(d))}}return this.error(234,e.range),this.module.unreachable()}compileTernaryExpression(e,t,i){let s=this.module,a=e.ifThen,l=e.ifElse,o=this.compileExpression(e.condition,p.bool),u=this.makeIsTrueish(o,this.currentType,e.condition),c=this.evaluateCondition(u);if(c==1)return s.maybeDropCondition(u,this.compileExpression(a,t));if(c==2)return s.maybeDropCondition(u,this.compileExpression(l,t));let f=this.currentFlow,_=f.forkThen(o);this.currentFlow=_;let d=this.compileExpression(a,t),m=this.currentType,h=f.forkElse(o);this.currentFlow=h;let b=this.compileExpression(l,t==p.auto?m:t),A=this.currentType;if(t==p.void)m!=p.void&&(d=s.drop(d),m=p.void),A!=p.void&&(b=s.drop(b),A=p.void),this.currentType=p.void;else{let S=p.commonType(m,A,t);if(!S)return this.error(2322,l.range,A.toString(),m.toString()),this.currentType=t,s.unreachable();d=this.convertExpression(d,m,S,!1,a),m=S,b=this.convertExpression(b,A,S,!1,l),A=S,this.currentType=S}return f.inheritAlternatives(_,h),this.currentFlow=f,s.if(u,d,b)}compileUnaryPostfixExpression(e,t,i){let s=this.module,a=this.currentFlow,l=this.compileExpression(e.operand,t.exceptVoid,0),o,u=null;t!=p.void?(u=a.getTempLocal(this.currentType),o=s.local_tee(u.index,l,this.currentType.isManaged)):o=l;let c;switch(e.operator){case 88:{let h=this.currentType.getClassOrWrapper(this.program);if(h){let b=h.lookupOverload(29);if(b){let A=b.is(262144);if(u&&!A&&(o=l,u=null),c=this.compileUnaryOverload(b,e.operand,o,e),A)break;return c}}if(!this.currentType.isValue)return this.error(2469,e.range,"++",this.currentType.toString()),s.unreachable();switch(this.currentType.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:{c=s.binary(0,o,s.i32(1));break}case 4:case 9:{c=s.binary(25,o,s.i64(1));break}case 5:case 10:{c=s.binary(217,o,this.makeOne(this.currentType));break}case 11:{c=s.binary(50,o,s.f32(1));break}case 12:{c=s.binary(63,o,s.f64(1));break}default:return this.error(2469,e.range,"++",this.currentType.toString()),s.unreachable()}break}case 89:{let h=this.currentType.getClassOrWrapper(this.program);if(h){let b=h.lookupOverload(30);if(b){let A=b.is(262144);if(u&&!A&&(o=l,u=null),c=this.compileUnaryOverload(b,e.operand,o,e),A)break;return c}}if(!this.currentType.isValue)return this.error(2469,e.range,"--",this.currentType.toString()),s.unreachable();switch(this.currentType.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:{c=s.binary(1,o,s.i32(1));break}case 4:case 9:{c=s.binary(26,o,s.i64(1));break}case 5:case 10:{c=s.binary(218,o,this.makeOne(this.currentType));break}case 11:{c=s.binary(51,o,s.f32(1));break}case 12:{c=s.binary(64,o,s.f64(1));break}default:return this.error(2469,e.range,"--",this.currentType.toString()),s.unreachable()}break}default:return assert(!1),s.unreachable()}let f=this.resolver;if(e.operand.kind==14){let h=e.operand,b=f.resolveExpression(h.expression,a);if(b&&b.kind==14){let A=this.compileFixedArrayElementAccess(h,b,!0,t,0,null,c);return u?s.block(null,[A,s.local_get(u.index,this.currentType.toRef())],this.currentType.toRef()):A}if(b&&b.kind==27){let A=this.compileUnmanagedArrayElementAccess(h,b,!0,p.void,0,null,c);return this.currentType=b.unmanagedArrayElementType,u?s.block(null,[A,s.local_get(u.index,this.currentType.toRef())],this.currentType.toRef()):A}if(b&&b.kind==28){let A=this.compileDynamicArrayElementAccess(h,b,!0,p.void,0,null,c);return this.currentType=this.dynamicArrayElementOf(b),u?s.block(null,[A,s.local_get(u.index,this.currentType.toRef())],this.currentType.toRef()):A}if(b&&this.isManagedDynamicArrayType(b)){let A=this.compileDynamicArrayElementAccess(h,b,!0,p.void,0,null,c);return this.currentType=this.dynamicArrayElementOf(b),u?s.block(null,[A,s.local_get(u.index,this.currentType.toRef())],this.currentType.toRef()):A}}let _=f.lookupExpression(e.operand,a);if(!_)return s.unreachable();if(!u)return this.makeAssignment(_,c,this.currentType,e.operand,f.currentThisExpression,f.currentElementExpression,!1);let d=this.makeAssignment(_,c,this.currentType,e.operand,f.currentThisExpression,f.currentElementExpression,!1);this.currentType=u.type;let m=u.type.toRef();return s.block(null,[d,s.local_get(u.index,m)],m)}compileUnaryPrefixExpression(e,t,i){let s=this.module,a=!1,l;switch(e.operator){case 82:{l=this.compileExpression(e.operand,t.exceptVoid,0);let c=this.currentType.getClassOrWrapper(this.program);if(c){let f=c.lookupOverload(23);if(f)return this.compileUnaryOverload(f,e.operand,l,e)}if(!this.currentType.isValue)return this.error(2469,e.range,"+",this.currentType.toString()),s.unreachable();break}case 83:{let c=e.operand;if(c.isNumericLiteral){l=this.compileLiteralExpression(c,t,0,!0),this.options.sourceMap&&this.addDebugLocation(l,e.range);break}l=this.compileExpression(e.operand,t.exceptVoid,0);let f=this.currentType.getClassOrWrapper(this.program);if(f){let _=f.lookupOverload(24);if(_)return this.compileUnaryOverload(_,e.operand,l,e)}if(!this.currentType.isValue)return this.error(2469,e.range,"-",this.currentType.toString()),s.unreachable();switch(this.currentType.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:{l=s.binary(1,s.i32(0),l);break}case 4:case 9:{l=s.binary(26,s.i64(0),l);break}case 5:case 10:{l=s.binary(218,this.makeZero(this.currentType),l);break}case 11:{l=s.unary(6,l);break}case 12:{l=s.unary(7,l);break}default:this.error(2469,e.range,"-",this.currentType.toString()),l=s.unreachable()}break}case 88:{a=!0,l=this.compileExpression(e.operand,t.exceptVoid,0);let c=this.currentType.getClassOrWrapper(this.program);if(c){let f=c.lookupOverload(27);if(f){if(l=this.compileUnaryOverload(f,e.operand,l,e),f.is(262144))break;return l}}if(!this.currentType.isValue)return this.error(2469,e.range,"++",this.currentType.toString()),s.unreachable();switch(this.currentType.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:{l=s.binary(0,l,this.module.i32(1));break}case 4:case 9:{l=s.binary(25,l,s.i64(1));break}case 5:case 10:{l=s.binary(217,l,this.makeOne(this.currentType));break}case 11:{l=s.binary(50,l,s.f32(1));break}case 12:{l=s.binary(63,l,s.f64(1));break}default:this.error(2469,e.range,"++",this.currentType.toString()),l=s.unreachable()}break}case 89:{a=!0,l=this.compileExpression(e.operand,t.exceptVoid,0);let c=this.currentType.getClassOrWrapper(this.program);if(c){let f=c.lookupOverload(28);if(f){if(l=this.compileUnaryOverload(f,e.operand,l,e),f.is(262144))break;return l}}if(!this.currentType.isValue)return this.error(2469,e.range,"--",this.currentType.toString()),s.unreachable();switch(this.currentType.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:{l=s.binary(1,l,s.i32(1));break}case 4:case 9:{l=s.binary(26,l,s.i64(1));break}case 5:case 10:{l=s.binary(218,l,this.makeOne(this.currentType));break}case 11:{l=s.binary(51,l,s.f32(1));break}case 12:{l=s.binary(64,l,s.f64(1));break}default:this.error(2469,e.range,"--",this.currentType.toString()),l=s.unreachable()}break}case 96:{l=this.compileExpression(e.operand,t.exceptVoid,0);let c=this.currentType.getClassOrWrapper(this.program);if(c){let f=c.lookupOverload(25);if(f)return this.compileUnaryOverload(f,e.operand,l,e)}l=s.unary(20,this.makeIsTrueish(l,this.currentType,e.operand)),this.currentType=p.bool;break}case 97:{l=this.compileExpression(e.operand,t==p.void?p.i32:t.isFloatValue?p.i64:t,0);let c=this.currentType.getClassOrWrapper(this.program);if(c){let f=c.lookupOverload(26);if(f)return this.compileUnaryOverload(f,e.operand,l,e)}if(!this.currentType.isValue)return this.error(2469,e.range,"~",this.currentType.toString()),s.unreachable();switch(l=this.convertExpression(l,this.currentType,this.currentType.intType,!1,e.operand),this.currentType.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:{l=s.binary(9,l,s.i32(-1));break}case 4:case 9:{l=s.binary(34,l,s.i64(-1,-1));break}case 5:case 10:{l=s.binary(226,l,this.makeNegOne(this.currentType));break}default:this.error(2469,e.range,"~",this.currentType.toString()),l=s.unreachable()}break}case 57:return this.compileTypeof(e,t,i);case 70:return this.error(100,e.range,"Spread operator"),s.unreachable();default:return assert(!1),s.unreachable()}if(!a)return l;let o=this.resolver;if(e.operand.kind==14){let c=e.operand,f=o.resolveExpression(c.expression,this.currentFlow);if(f&&f.kind==27)return this.currentType=f.unmanagedArrayElementType,this.compileUnmanagedArrayElementAccess(c,f,!0,this.currentType,0,null,l);if(f&&f.kind==28)return this.currentType=this.dynamicArrayElementOf(f),this.compileDynamicArrayElementAccess(c,f,!0,this.currentType,0,null,l);if(f&&this.isManagedDynamicArrayType(f))return this.currentType=this.dynamicArrayElementOf(f),this.compileDynamicArrayElementAccess(c,f,!0,this.currentType,0,null,l)}let u=o.lookupExpression(e.operand,this.currentFlow);return u?this.makeAssignment(u,l,this.currentType,e.operand,o.currentThisExpression,o.currentElementExpression,t!=p.void):s.unreachable()}compileTypeof(e,t,i){let s=e.operand,a=0,l=this.program.stringInstance,o;if(s.kind==20)o="object";else{let u=this.resolver.lookupExpression(s,this.currentFlow,p.auto,1);if(u)switch(u.kind){case 6:case 12:case 2:{o="object";break}case 4:{o="function";break}default:{a=this.compileExpression(s,p.auto);let c=this.currentType;if(a=this.convertExpression(a,c,p.void,!0,s),c.isReference)if(c.getSignature())o="function";else{let _=c.getClass();_?_.prototype==l.prototype?o="string":o="object":o="externref"}else c==p.bool?o="boolean":c.isNumericValue?o="number":o="undefined";break}}else{switch(s.kind){case 8:break;case 23:case 14:if(s=(s.kind==23,s.expression),!this.resolver.resolveExpression(s,this.currentFlow,p.auto,0))return this.currentType=l.type,this.module.unreachable();default:a=this.compileExpression(s,p.auto),a=this.convertExpression(a,this.currentType,p.void,!0,s)}o="undefined"}}return this.currentType=l.type,a?this.module.block(null,[a,this.ensureStaticString(o)],this.options.sizeTypeRef):this.ensureStaticString(o)}ensureSmallIntegerWrap(e,t){let i=this.module,s=this.currentFlow;switch(t.kind){case 0:{s.canOverflow(e,t)&&(e=i.binary(16,e,i.i32(0)));break}case 1:{s.canOverflow(e,t)&&(e=this.options.hasFeature(1)?i.unary(47,e):i.binary(11,i.binary(10,e,i.i32(24)),i.i32(24)));break}case 2:{s.canOverflow(e,t)&&(e=this.options.hasFeature(1)?i.unary(48,e):i.binary(11,i.binary(10,e,i.i32(16)),i.i32(16)));break}case 6:{s.canOverflow(e,t)&&(e=i.binary(7,e,i.i32(255)));break}case 7:{s.canOverflow(e,t)&&(e=i.binary(7,e,i.i32(65535)));break}}return e}addDebugLocation(e,t){let i=this.currentFlow.targetFunction,s=t.source;s.debugInfoIndex<0&&(s.debugInfoIndex=this.module.addDebugInfoFile(s.normalizedPath)),i.debugLocations.set(e,t)}checkSignatureSupported(e,t){let i=!0,s=t.explicitThisType;s&&(this.program.checkTypeSupported(assert(e.thisType),s)||(i=!1));let a=e.parameterTypes,l=t.parameters;for(let o=0,u=a.length;o<u;++o){let c;l.length>o?c=l[o]:c=t,this.program.checkTypeSupported(a[o],c)||(i=!1)}return this.program.checkTypeSupported(e.returnType,t.returnType)||(i=!1),i}checkFixedArrayStorageInSignature(e,t){let i=!0,s=e.parameterTypes,a=t.parameters;for(let o=0,u=s.length;o<u;++o){let c=a.length>o?a[o]:t;this.checkFixedArrayStoragePosition(s[o],c,"a parameter")||(i=!1)}let l=e.returnType;return l.kind==26||this.checkFixedArrayStoragePosition(l,t.returnType,"a return type")||(i=!1),i}checkFixedArrayStoragePosition(e,t,i){return e.kind!=14?!0:e.fixedMemoryModel==2?(this.error(100,t.range,"heap fixed-extent is Landing 5c (GC block, N in type, no length field). Use `@managed @dynamic [T * n]` for a runtime-length heap array (available now)"),!1):e.fixedMemoryModel==3||i=="a parameter"||i=="a return type"?!0:(this.error(100,t.range,i=="a return type"?"cannot return `[T * N]` by value yet \u2014 the callee side works (WebAssembly multivalue, one result per element leaf, measured to 16 results), but the caller cannot hold the result: a tuple has no `Type`, and every local slot in this compiler is typed by one. Landing 5b.3. Use `@unmanaged [T * N]` for a pointer view meanwhile":i=="a parameter"?"cannot pass `[T * N]` by value yet \u2014 Landing 5b.2 (inline bytes have no value-stack representation). Use `@unmanaged [T * N]` for a pointer view":i=="a local"?"cannot declare `[T * N]` as a local value in this position (a local is one WASM local per element leaf; this shape did not take that path). Use `@unmanaged [T * N]` for a pointer view, or `[T *]` for an unknown-length view":"cannot declare `[T * N]` at module scope yet \u2014 Landing 5b.2. Use `@unmanaged [T * N]` for a pointer view, or `[T *]` for an unknown-length view"),!1)}isUnmanagedChangetype(e){if(e.kind!=11)return!1;let t=e,i=t.expression;if(i.kind!=8||i.text!="changetype")return!1;let s=t.typeArguments;return s==null||s.length!=1?!1:unchecked(s[0]).memoryModel==3}isInlineStructType(e){let t=e.classReference;return t!=null&&t.hasDecorator(4096)}viewFieldAccess(e,t,i){let s=this.module,a=t.memoryOffset;return i.kind==14||this.isInlineStructType(i)?a?s.binary(217,e,this.options.isWasm64?s.i64(a):s.i32(a)):e:s.load(i.byteSize,i.isSignedIntegerValue,e,i.toRef(),a)}resultRefOf(e){return this.isInlineStructType(e)?P.None:e.toRef()}evaluateCondition(e){let t=pe(e);if(t==P.Unreachable)return 0;assert(t==P.I32);let s=this.module.runExpression(e,0);return s?ae(s)?1:2:0}expandSroaArrayArgument(e,t,i,s){let a=this.module,l=t.fixedArrayElementType,o=fe.wasmParamCountOf(t),u=e.kind==8?this.currentFlow.lookupLocal(e.text):null;if(u!=null&&u.fieldLocals!=null)return this.pushSroaLeafOperands(assert(u.fieldLocals),i,s);if(e.kind==18&&e.literalKind==5){let f=e.elementExpressions,_=l.getClass()!=null,d=0;for(let m=0,h=f.length;m<h;++m){if(_){this.error(100,unchecked(f[m]).range,"passing a record element of a `[T * N]` value inside an array literal (an element is several leaves, and no literal names them). Construct the array field-by-field in a local and pass that");break}unchecked(i[s+d]=this.compileExpression(unchecked(f[m]),l,1)),++d}for(;d<o;)unchecked(i[s+d]=this.makeZero(l)),++d;return d}this.error(100,e.range,"passing this expression as a `[T * N]` argument (only a local value or an array literal: a value has no address, so there is nothing to hand over)");for(let c=0;c<o;++c)unchecked(i[s+c]=a.unreachable());return o}expandSroaArgument(e,t,i,s){if(t.kind==14&&(t.fixedMemoryModel==0||t.fixedMemoryModel==1))return this.expandSroaArrayArgument(e,t,i,s);if(!fe.isInlineStructRef(t))return unchecked(i[s]=this.compileExpression(e,t,1)),1;let a=fe.fieldCountOf(t),l=e.kind==8?this.currentFlow.lookupLocal(e.text):null;if(l==null||l.fieldLocals==null){this.error(100,e.range,"passing this expression as an @inline struct argument (only a local value can be passed: a value has no address, so there is nothing to hand over)");for(let u=0;u<a;++u)unchecked(i[s+u]=this.module.unreachable());return a}return this.pushSroaLeafOperands(assert(l.fieldLocals),i,s)}pushSroaLeafOperands(e,t,i){let s=0;for(let a=Map_keys(e),l=0,o=a.length;l<o;++l){let u=assert(J(e,unchecked(a[l])));if(u.index<0){let c=u.fieldLocals;c!=null&&(s+=this.pushSroaLeafOperands(c,t,i+s));continue}unchecked(t[i+s]=this.module.local_get(u.index,u.type.toRef())),++s}return s}resolveSroaReceiver(e){let t=new Array,i=e;for(;;)if(i.kind==23)t.push(i),i=i.expression;else if(i.kind==14){let l=i;if(this.constantIndexValue(l.elementExpression)<0)return null;t.push(i),i=l.expression}else break;if(i.kind!=8)return null;let s=this.currentFlow.lookupLocal(i.text);if(s==null||s.fieldLocals==null)return null;let a=s;for(let l=t.length-1;l>=0;--l){let o=a.fieldLocals;if(o==null)return null;let u=t[l],c;if(u.kind==23?c=J(o,u.property.text):c=J(o,this.constantIndexValue(u.elementExpression).toString()),c==null)return null;a=c}return a.fieldLocals!=null?a:null}static{this.SRET_STACK_SIZE=4096}markOperandForRooting(){this.rootNextOperand=!0}ensureSretStack(){if(this.sretStackGlobal!=null)return this.sretStackBase;let e=this.module,t=this.addAlignedMemorySegment(new Uint8Array(n.SRET_STACK_SIZE),16),i=i64_low(t.offset);this.sretStackBase=i,this.sretStackLimit=i+n.SRET_STACK_SIZE;let s="~sretStackPointer";return this.sretStackGlobal=s,e.addGlobal(s,P.I32,!0,e.i32(i)),i}sretSizeOf(e){return assert(e.classReference).nextMemoryOffset+15&-16}makeSretAddress(e){return this.module.local_get(e.index,P.I32)}makeSretFieldLoad(e,t){return this.module.load(t.type.byteSize,!1,e,t.type.toRef(),t.memoryOffset)}makeSretGuard(e,t,i){let s=this.module,a=s.binary(0,s.local_get(e.index,P.I32),s.i32(t));return s.if(s.binary(21,a,s.i32(this.sretStackLimit)),this.makeStaticAbort(this.ensureStaticString("sret stack overflow: the static call-temp region is 4 KB; see --sretStackSize"),i))}emitExportByValPrologue(e,t){let i=this.module,s=e.signature,a=e.flow,l=s.parameterTypes;for(let o=0,u=l.length;o<u;++o){if(!s.isExportByValParam(o))continue;let c=e.getParameterName(o),f=a.lookupLocal(c+"$byval"),_=a.lookupLocal(c);if(f==null||_==null||_.fieldLocals==null)continue;let d=assert(_.fieldLocals),m=assert(this.recordFieldsOf(unchecked(l[o])));for(let h=0,b=m.length;h<b;++h){let A=unchecked(m[h]),S=J(d,A.name);S&&t.push(i.local_set(S.index,i.load(A.type.byteSize,!1,i.local_get(f.index,P.I32),A.type.toRef(),A.memoryOffset),!1))}}}makeSretAddressPlus(e,t){let i=this.module;return i.binary(0,this.makeSretAddress(e),i.i32(t))}emitTempArgumentLeaves(e,t,i,s,a){let l=this.module,o=this.recordFieldsOf(e);if(o!=null)for(let u=0,c=o.length;u<c;++u){let f=unchecked(o[u]),_=J(t,f.name);if(_!=null){if(_.index<0){let d=_.fieldLocals;d!=null&&this.emitTempArgumentLeaves(f.type,d,i,s+f.memoryOffset,a);continue}a.push(l.store(f.type.byteSize,this.makeSretAddressPlus(i,s),l.local_get(_.index,_.type.toRef()),f.type.toRef(),f.memoryOffset))}}}makeExternalTempArgument(e,t,i,s){let a=this.module,l=e.kind==8?this.currentFlow.lookupLocal(e.text):null,o=l!=null?l.fieldLocals:null,u=this.recordFieldsOf(t);if(u==null)return this.error(100,e.range,"passing this expression to a by-value parameter (the temp is filled field by field, which needs a record type)"),a.unreachable();let c=new Array;if(o!=null)this.emitTempArgumentLeaves(t,o,i,s,c);else{if(fe.isInlineStructRef(t))return this.error(100,e.range,"passing this expression as an @inline struct to a by-value parameter (the temp is filled by copying a local's fields; a value has no address, so only a local can be passed)"),a.unreachable();{let f=this.options.usizeType,_=this.compileExpression(e,t,1),d=this.currentFlow.getTempLocal(f),m=f.toRef();c.push(a.local_set(d.index,_,!1));for(let h=0,b=u.length;h<b;++h){let A=unchecked(u[h]);c.push(a.store(A.type.byteSize,this.makeSretAddressPlus(i,s),a.load(A.type.byteSize,!1,a.local_get(d.index,m),A.type.toRef(),A.memoryOffset),A.type.toRef(),A.memoryOffset))}}}return c.push(this.makeSretAddressPlus(i,s)),a.block(null,c,P.I32)}wrapExternalTempCall(e,t,i,s,a){let l=this.module,o=assert(this.sretStackGlobal),u=l.global_set(o,l.local_get(e.index,P.I32)),c=[l.local_set(e.index,l.global_get(o,P.I32),!1),l.global_set(o,l.binary(0,l.local_get(e.index,P.I32),l.i32(t))),this.makeSretGuard(e,t,a)];if(s==p.void)return c.push(i),c.push(u),l.block(null,c);let f=this.currentFlow.getTempLocal(s);return c.push(l.local_set(f.index,i,!1)),c.push(u),c.push(l.local_get(f.index,s.toRef())),l.block(null,c,s.toRef())}wrapSretCall(e,t,i,s){let a=this.module,l=assert(this.sretStackGlobal),o=this.sretSizeOf(i);return a.block(null,[a.local_set(e.index,a.global_get(l,P.I32),!1),a.global_set(l,a.binary(0,a.local_get(e.index,P.I32),a.i32(o))),this.makeSretGuard(e,o,s),t,a.global_set(l,a.local_get(e.index,P.I32))])}makeSretCallBlock(e,t,i,s,a){let l=this.module;this.ensureSretStack();let o=assert(this.sretStackGlobal),u=this.sretSizeOf(t),c=this.currentFlow,f=c.getTempLocal(p.u32),_=new Array;_.push(l.local_set(f.index,l.global_get(o,P.I32),!1)),_.push(l.global_set(o,l.binary(0,l.local_get(f.index,P.I32),l.i32(u)))),_.push(this.makeSretGuard(f,u,e)),this.sretDestSlot=this.makeSretAddress(f);let d=this.compileCallExpression(e,p.auto,0);if(this.sretDestSlot!=0)return this.sretDestSlot=0,this.currentType=i,l.unreachable();_.push(d);let m=i!=p.void?c.getTempLocal(i):null;return s!=null?_.push(l.local_set(assert(m).index,this.makeSretFieldLoad(this.makeSretAddress(f),s),!1)):a!=null&&this.emitSretLoadsInto(t,a,f,0,_),_.push(l.global_set(o,l.local_get(f.index,P.I32))),m!=null?(_.push(l.local_get(m.index,m.type.toRef())),this.currentType=i,l.block(null,_,i.toRef())):(this.currentType=p.void,l.block(null,_))}compileSretReturnStatement(e,t){let i=this.module,s=this.currentFlow,a=assert(e.value);if(a.kind==19&&a.args.length==0){let d=this.module,m=s.sourceFunction.signature.thisType?1:0,h=new Array;return this.emitSroaZerosToLocal(t,m,0,h),h.push(d.return()),s.set(257),this.currentType=t,d.block(null,h)}let o=a.kind==8?s.lookupLocal(a.text):null;if(o==null||o.fieldLocals==null)return this.error(100,a.range,"returning this expression from an @inline struct function (only a local value can be returned: a value has no address, so there is nowhere to write it)"),s.set(257),this.currentType=t,i.unreachable();let u=s.sourceFunction.signature;assert(u.hasHiddenDestParam);let c=u.thisType?1:0,f=assert(o.fieldLocals),_=new Array;return this.emitSroaStoresToLocal(t,f,c,0,_),_.push(i.return()),s.set(257),this.currentType=t,i.block(null,_)}fillSroaFieldLocals(e,t,i,s,a){let l=!1;for(let o=0,u=e.length;o<u;++o){let c=unchecked(e[o]),f=t+"$"+c.name,_=c.type;if(!this.isSroaFieldType(_)){if(fe.isInlineStructRef(_)){let h=new Map;if(!this.fillSroaFieldLocals(this.inlineStructFieldsOf(_),f,i,s,h)){l=!0;continue}let b=new ce(f,-1,_,s.targetFunction,i);b.fieldLocals=h,a.set(c.name,b);continue}let d=assert(c.prototype.fieldDeclaration),m=d.type;this.error(100,m?m.range:d.name.range,_.kind==14?"a T[N] field in an @inline struct (SROA keeps one WASM local per field; array fields are the deep-SROA phase)":"a GC-reference field in an @inline struct (a bare local.set skips the write barrier; deferred)"),l=!0;continue}a.set(c.name,s.targetFunction.addLocal(_,f,i))}return!l}copySroaValue(e,t,i){let s=this.module;for(let a=Map_keys(t),l=0,o=a.length;l<o;++l){let u=unchecked(a[l]),c=J(e,u);if(c==null)continue;let f=assert(J(t,u));if(f.index<0||c.index<0){let _=f.fieldLocals,d=c.fieldLocals;_!=null&&d!=null&&this.copySroaValue(d,_,i);continue}i.push(s.local_set(f.index,s.local_get(c.index,c.type.toRef()),!1))}}emitSroaStoresToLocal(e,t,i,s,a){let l=this.module,o=this.inlineStructFieldsOf(e);if(o!=null)for(let u=0,c=o.length;u<c;++u){let f=unchecked(o[u]),_=J(t,f.name);if(_!=null){if(_.index<0){let d=_.fieldLocals;d!=null&&this.emitSroaStoresToLocal(f.type,d,i,s+f.memoryOffset,a);continue}a.push(l.store(f.type.byteSize,l.local_get(i,P.I32),l.local_get(_.index,_.type.toRef()),f.type.toRef(),s+f.memoryOffset))}}}emitSroaZerosToLocal(e,t,i,s){let a=this.module,l=this.inlineStructFieldsOf(e);if(l!=null)for(let o=0,u=l.length;o<u;++o){let c=unchecked(l[o]);if(fe.isInlineStructRef(c.type)){this.emitSroaZerosToLocal(c.type,t,i+c.memoryOffset,s);continue}this.isSroaFieldType(c.type)&&s.push(a.store(c.type.byteSize,a.local_get(t,P.I32),this.makeZero(c.type),c.type.toRef(),i+c.memoryOffset))}}emitSretLoadsInto(e,t,i,s,a){let l=this.inlineStructFieldsOf(e);if(l!=null)for(let o=0,u=l.length;o<u;++o){let c=unchecked(l[o]),f=J(t,c.name);if(f!=null){if(f.index<0){let _=f.fieldLocals;_!=null&&this.emitSretLoadsInto(c.type,_,i,s+c.memoryOffset,a);continue}a.push(this.module.local_set(f.index,this.module.load(c.type.byteSize,!1,this.makeSretAddress(i),c.type.toRef(),s+c.memoryOffset),!1))}}}sroaTreeOf(e){let t=this.resolveSroaReceiver(e);return t!=null?t.fieldLocals:null}emitSroaStores(e,t,i,s,a){let l=this.module,o=this.inlineStructFieldsOf(e);if(o!=null)for(let u=0,c=o.length;u<c;++u){let f=unchecked(o[u]),_=J(t,f.name);if(_!=null){if(_.index<0){let d=_.fieldLocals;d!=null&&this.emitSroaStores(f.type,d,i,s+f.memoryOffset,a);continue}a.push(l.store(f.type.byteSize,i,l.local_get(_.index,_.type.toRef()),f.type.toRef(),s+f.memoryOffset))}}}isValueFormFixedArray(e){return e.kind!=14?!1:e.fixedMemoryModel==0||e.fixedMemoryModel==1}static{this.VALUE_ARRAY_MAX_RUNTIME_INDEX=8}fillSroaArrayLocals(e,t,i,s,a){let l=e.fixedArrayElementType,o=e.fixedLength,u=this.recordFieldsOf(l),c=!1;for(let f=0;f<o;++f){let _=t+"$"+f.toString();if(u==null){if(!this.isSroaFieldType(l))return this.error(100,i.name.range,"a `[T * N]` value with an element that cannot live in one WASM local (a GC reference needs a write barrier on every assignment; a nested array needs the deep-SROA phase). Use `@unmanaged [T * N]` for a pointer view"),!1;a.set(f.toString(),s.targetFunction.addLocal(l,_,i));continue}let d=new Map;if(!this.fillSroaFieldLocals(u,_,i,s,d)){c=!0;continue}let m=new ce(_,-1,l,s.targetFunction,i);m.fieldLocals=d,a.set(f.toString(),m)}return!c}compileSroaValueArrayLocal(e,t,i,s,a){let l=this.module,o=e.name.text,u=new Map;if(!this.fillSroaArrayLocals(t,o,e,s,u))return!0;let c=new ce(o,-1,t,s.targetFunction,e);c.fieldLocals=u;let f=s.scopedLocals;if(f||(s.scopedLocals=f=new Map),f.has(o))return this.error(2300,e.name.range,o),!0;if(f.set(o,c),e.is(8)&&s.setLocalFlag(c.index,1),!i)return!0;if(i.kind==18&&i.literalKind==5)return this.fillSroaArrayFromLiteral(t,u,i,s,a);if(i.kind==8){let _=this.resolveSroaValueArray(i);if(_!=null&&_.type.equals(t))return this.copySroaValue(assert(_.fieldLocals),u,a),!0}if(i.kind==11){let _=this.resolver.resolveExpression(i,s,p.auto,1);if(_!=null&&_.kind==14&&_.equals(t)){let d=fe.create(this.program,new Array,t).resultRefs,m=this.compileExpression(i,t,1),h=s.getTempLocal(t);h.typeRefOverride=d,a.push(l.local_set(h.index,m,!1));let b=0,S=t.fixedArrayElementType.getClass()!=null;for(let k=0,w=t.fixedLength;k<w;++k){let R=J(u,k.toString());if(R==null)continue;let C=R.fieldLocals;if(S&&C!=null){for(let M=Map_keys(C),O=0,D=M.length;O<D;++O){let Q=assert(J(C,unchecked(M[O])));a.push(l.local_set(Q.index,l.tuple_extract(l.local_get(h.index,d),b),!1)),++b}continue}a.push(l.local_set(R.index,l.tuple_extract(l.local_get(h.index,d),b),!1)),++b}return!0}}return this.error(100,i.range,"initializing a `[T * N]` value from this expression (an array literal `[a, b, c]`, a copy from another `[T * N]` value, and a call returning one are implemented; a caller's address is `@unmanaged [T * N]`)"),!0}fillSroaArrayFromLiteral(e,t,i,s,a){let l=this.module,o=e.fixedArrayElementType,u=e.fixedLength,c=i.elementExpressions;if(c.length>u)return this.error(2322,i.range,"too many elements",e.toString()),!0;for(let f=0,_=c.length;f<_;++f){let d=J(t,f.toString());if(d!=null){if(d.index<0)return this.error(100,unchecked(c[f]).range,"constructing a record element of a `[T * N]` value inside an array literal (an element is several leaves, and no literal names them). Assign its fields instead: `arr[0].x = ...`"),!0;a.push(l.local_set(d.index,this.compileExpression(unchecked(c[f]),o,1),!1))}}return!0}resolveSroaValueArray(e){if(e.kind!=8)return null;let t=this.currentFlow.lookupLocal(e.text);return t==null||t.fieldLocals==null?null:this.isValueFormFixedArray(t.type)?t:null}constantIndexValue(e){if(e.kind!=18)return-1;let t=e;if(t.literalKind!=1)return-1;let i=t.value;return i64_high(i)!=0?-1:i64_low(i)}compileSroaValueArrayElementAccess(e,t,i,s,a,l=null,o=0){let u=this.module,c=t.type,f=c.fixedArrayElementType,_=assert(t.fieldLocals),d=this.constantIndexValue(e.elementExpression);if(d>=0){let h=J(_,d.toString());if(h==null)return this.error(2329,e.elementExpression.range,c.toString()),this.currentType=f,u.unreachable();if(h.index<0)return this.error(100,e.range,"reading or writing a record element of a `[T * N]` value as a whole (an element is several leaves, not one value; read or write one of its fields, `arr[i].x`)"),this.currentType=f,u.unreachable();if(i){let b=o||this.compileExpression(assert(l),f,1);return s==p.void?(this.currentType=p.void,u.local_set(h.index,b,!1)):(this.currentType=f,u.block(null,[u.local_set(h.index,b,!1),u.local_get(h.index,h.type.toRef())],f.toRef()))}return this.currentType=f,u.local_get(h.index,h.type.toRef())}return c.fixedLength>n.VALUE_ARRAY_MAX_RUNTIME_INDEX?(this.error(100,e.range,"a runtime index into a `[T * N]` value with N > 8 (the element is selected by a branch per element, which stops paying for itself past eight). Use a constant index, or `@unmanaged [T * N]` for a pointer view with unlimited runtime indexing"),this.currentType=f,u.unreachable()):f.getClass()!=null?(this.error(100,e.range,"reading or writing a record element of a `[T * N]` value as a whole (an element is several leaves, not one value; read or write one of its fields, `arr[i].x`)"),this.currentType=f,u.unreachable()):this.compileSroaValueArrayRuntimeIndex(e,t,i,s,a,l,o)}compileSroaValueArrayRuntimeIndex(e,t,i,s,a,l,o){let u=this.module,c=t.type,f=c.fixedArrayElementType,_=assert(t.fieldLocals),d=c.fixedLength,m=f.toRef(),h=this.compileExpression(e.elementExpression,p.i32,1),b=i?o||this.compileExpression(assert(l),f,1):0,A=new Array(d);for(let w=0;w<d;++w)unchecked(A[w]=assert(_.get(w.toString())).index);let S=-1;i&&(S=this.currentFlow.getTempLocal(f).index);let k=this.compileLeafIndexSelect(A,h,i?P.None:m,S,m);return i?(this.currentType=s==p.void?p.void:f,s==p.void?u.block(null,[u.local_set(S,b,!1),k]):u.block(null,[u.local_set(S,b,!1),k,u.local_get(S,m)],m)):(this.currentType=f,k)}compileSroaArrayLeafByRuntimeIndex(e,t){let i=this.resolveSroaValueArray(e.expression);if(i==null)return 0;let s=i.type;if(s.fixedArrayElementType.getClass()==null||this.constantIndexValue(e.elementExpression)>=0||!t.isField)return 0;let l=assert(i.fieldLocals),o=s.fixedLength;if(o>n.VALUE_ARRAY_MAX_RUNTIME_INDEX)return this.error(100,e.range,"a runtime index into a `[T * N]` value with N > 8 (the element is selected by a branch per element, which stops paying for itself past eight). Use a constant index, or `@unmanaged [T * N]` for a pointer view with unlimited runtime indexing"),this.module.unreachable();let u=this.module,c=t.type.toRef(),f=(++this.sroaSelectId).toString(),_=new Array(o);for(let S=0;S<o;++S)unchecked(_[S]="sroaLeaf"+S.toString()+"_"+f);let d="sroaLeafOut_"+f,m=this.compileExpression(e.elementExpression,p.i32,1),h=new Array(o);for(let S=0;S<o;++S){let k=J(l,S.toString()),w=k!=null?k.fieldLocals:null;if(w==null)return this.error(100,e.range,"reading this member through a runtime array index (the element field is not a single WASM local; a nested inline value needs the deep-SROA phase)"),u.unreachable();let R=J(w,t.name);if(R==null||R.index<0)return this.error(100,e.range,"reading this member through a runtime array index (only supported fields are readable; a refused or computed member has no local)"),u.unreachable();unchecked(h[S]=R.index)}let b=new Array(o);for(let S=0;S<o;++S)unchecked(b[S]=u.br(d,0,u.local_get(unchecked(h[S]),c)));let A=u.drop(u.switch(_,unchecked(_[o-1]),m));A=u.block(unchecked(_[o-1]),[A]);for(let S=o-2;S>=0;--S)A=u.block(unchecked(_[S]),[A,unchecked(b[S+1]),u.nop()]);return this.currentType=t.type,u.block(d,[A,unchecked(b[0])],c)}compileSroaArrayLeafStoreByRuntimeIndex(e,t,i){let s=this.resolveSroaValueArray(e.expression);if(s==null)return 0;let a=s.type;if(a.fixedArrayElementType.getClass()==null||this.constantIndexValue(e.elementExpression)>=0||!t.isField)return 0;let o=assert(s.fieldLocals),u=a.fixedLength;if(u>n.VALUE_ARRAY_MAX_RUNTIME_INDEX)return this.error(100,e.range,"a runtime index into a `[T * N]` value with N > 8 (the element is selected by a branch per element, which stops paying for itself past eight). Use a constant index, or `@unmanaged [T * N]` for a pointer view with unlimited runtime indexing"),this.module.unreachable();let c=this.module,f=t.type,_=f.toRef(),d=new Array(u);for(let R=0;R<u;++R){let C=J(o,R.toString()),M=C!=null?C.fieldLocals:null,O=M!=null?J(M,t.name):null;if(O==null||O.index<0)return this.error(100,e.range,"assigning this member through a runtime array index (only supported fields are writable; a refused or computed member has no local)"),c.unreachable();unchecked(d[R]=O.index)}let m=(++this.sroaSelectId).toString(),h=new Array(u);for(let R=0;R<u;++R)unchecked(h[R]="sroaStore"+R.toString()+"_"+m);let b="sroaStoreOut_"+m,A=this.compileExpression(e.elementExpression,p.i32,1),S=this.currentFlow.getTempLocal(f).index,k=new Array(u);for(let R=0;R<u;++R)unchecked(k[R]=c.local_set(unchecked(d[R]),c.local_get(S,_),!1));let w=c.drop(c.switch(h,unchecked(h[u-1]),A));w=c.block(unchecked(h[u-1]),[w]);for(let R=u-2;R>=0;--R)w=c.block(unchecked(h[R]),[w,unchecked(k[R+1]),c.br(b)]);return this.currentType=p.void,c.block(b,[c.local_set(S,i,!1),w,unchecked(k[0])])}compileLeafIndexSelect(e,t,i,s,a){let l=this.module,o=e.length,u=s>=0,c=(++this.sroaSelectId).toString(),f=new Array(o);for(let h=0;h<o;++h)unchecked(f[h]="sroaSel"+h.toString()+"_"+c);let _="sroaSelOut_"+c,d=new Array(o);for(let h=0;h<o;++h){let b=unchecked(e[h]);unchecked(d[h]=u?l.local_set(b,l.local_get(s,a),!1):l.br(_,0,l.local_get(b,i)))}let m=l.drop(l.switch(f,unchecked(f[o-1]),t));m=l.block(unchecked(f[o-1]),[m]);for(let h=o-2;h>=0;--h)m=l.block(unchecked(f[h]),[m,unchecked(d[h+1]),u?l.br(_):l.nop()]);return l.block(_,[m,unchecked(d[0])],i)}compileMultivalueReturnStatement(e,t){let i=this.module,s=this.currentFlow,a=e.value,l=a!=null&&a.kind==8?s.lookupLocal(a.text):null;if(l==null||l.fieldLocals==null)return this.error(100,e.range,"returning this expression as a `[T * N]` value (only a local value or an array literal can be returned: a value has no address, so the leaves have to exist as locals)"),s.set(257),this.currentType=t,i.unreachable();let o=new Array,u=this.pushSroaLeafOperands(assert(l.fieldLocals),o,0);return assert(u==fe.wasmParamCountOf(t)),s.set(257),this.currentType=t,i.block(null,[i.return(i.tuple_make(o))])}compileSroaLocal(e,t,i,s,a,l){let o=this.module,u=e.name.text;if(s!=null&&this.isUnmanagedChangetype(s)){let d=a.scopedLocals;d||(a.scopedLocals=d=new Map);let m=d.has(u)?assert(d.get(u)):null,h;if(m!=null&&m.index>=0)h=m,h.type=t;else{let b=a.targetFunction;h=new ce(u,b.localsByIndex.length,t,b,e),b.localsByIndex[h.index]=h,d.set(u,h)}return h.isViewLocal=!0,a.setLocalFlag(h.index,8),e.is(8)&&a.setLocalFlag(h.index,1),l.push(o.local_set(h.index,this.compileExpression(s,p.auto),!1)),!0}let c=new Map;if(!this.fillSroaFieldLocals(i,u,e,a,c))return!0;let f=new ce(u,-1,t,a.targetFunction,e);f.fieldLocals=c;let _=a.scopedLocals;if(_||(a.scopedLocals=_=new Map),_.has(u))return this.error(2300,e.name.range,u),!0;if(_.set(u,f),e.is(8)&&a.setLocalFlag(f.index,1),!s)return!0;if(s.kind==19){let d=s.args;if(d.length>i.length)return this.error(2322,s.range,"too many arguments",t.toString()),!0;for(let m=0,h=d.length;m<h;++m){let b=unchecked(i[m]),A=assert(c.get(b.name));if(A.index<0)return this.error(100,s.range,"constructing an @inline struct with an argument for a nested @inline field (the field is several leaves, not one value; assign its own fields instead)"),!0;let S=this.compileExpression(d[m],b.type,1);l.push(o.local_set(A.index,S,!1))}return!0}if(s!=null&&s.kind==11){let d=this.resolver.resolveExpression(s,this.currentFlow);if(d!=null&&this.isInlineStructType(d))return l.push(this.makeSretCallBlock(s,d,p.void,null,c)),!0}if(s.kind==8){let d=a.lookupLocal(s.text);if(d&&d.fieldLocals)return this.copySroaValue(assert(d.fieldLocals),c,l),!0}return this.error(100,s.range,"initialising an @inline struct local from this expression (only `new P(\u2026)`, another @inline struct value, or no initialiser)"),!0}inlineStructFieldsOf(e){let t=e.classReference;return t==null||!t.hasDecorator(4096)?null:this.recordFieldsOf(e)}recordFieldsOf(e){let t=e.classReference;if(t==null)return null;let i=new Array,s=t.members;if(s)for(let a=Map_values(s),l=0,o=a.length;l<o;++l){let u=unchecked(a[l]);if(u.kind!=10)continue;let c=u.instance;!c||!c.isField||i.push(c)}return i}isSroaFieldType(e){return e.kind==14||fe.isInlineStructRef(e)?!1:!e.isManaged}makeZero(e){let t=this.module;switch(e.kind){default:assert(!1);case 0:case 1:case 2:case 3:case 6:case 7:case 8:return t.i32(0);case 5:case 10:case 27:if(e.size!=64)return t.i32(0);case 14:return t.i32(0);case 4:case 9:return t.i64(0);case 11:return t.f32(0);case 12:return t.f64(0);case 13:return t.v128(jp);case 16:case 15:case 17:case 18:case 19:case 20:case 22:case 23:case 24:case 25:return e.is(512)?t.ref_null(e.toRef()):(assert(!1),t.unreachable());case 21:return e.is(512)?t.ref_null(e.toRef()):t.i31_new(t.i32(0))}}makeOne(e){let t=this.module;switch(e.kind){default:assert(!1);case 0:case 1:case 2:case 3:case 6:case 7:case 8:return t.i32(1);case 5:case 10:if(e.size!=64)return t.i32(1);case 4:case 9:return t.i64(1);case 11:return t.f32(1);case 12:return t.f64(1);case 21:return t.i31_new(t.i32(1))}}makeNegOne(e){let t=this.module;switch(e.kind){default:assert(!1);case 1:case 2:case 3:case 6:case 7:case 8:return t.i32(-1);case 5:case 10:if(e.size!=64)return t.i32(-1);case 4:case 9:return t.i64(-1,-1);case 11:return t.f32(-1);case 12:return t.f64(-1);case 13:return t.v128(Qp);case 21:return t.i31_new(t.i32(-1))}}makeIsTrueish(e,t,i){let s=this.module;switch(t.kind){case 1:case 2:case 6:case 7:e=this.ensureSmallIntegerWrap(e,t);case 0:case 3:case 8:return e;case 4:case 9:return s.binary(41,e,s.i64(0));case 5:case 10:return t.size==64?s.binary(41,e,s.i64(0)):e;case 11:{let a=this.options;return a.shrinkLevelHint>1&&a.hasFeature(4)?s.unary(20,s.unary(20,s.unary(53,s.unary(10,s.unary(8,e))))):s.binary(20,s.binary(1,s.binary(10,s.unary(33,e),s.i32(1)),s.i32(2)),s.i32(4278190078))}case 12:{let a=this.options;return a.shrinkLevelHint>1&&a.hasFeature(4)?s.unary(20,s.unary(20,s.unary(55,s.unary(11,s.unary(9,e))))):s.binary(45,s.binary(26,s.binary(35,s.unary(34,e),s.i64(1)),s.i64(2)),s.i64(4294967294,4292870143))}case 13:return s.unary(67,e);case 16:case 15:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:return s.unary(20,s.ref_is_null(e));case 26:default:return this.error(1345,i.range,t.toString()),s.i32(0)}}makeToString(e,t,i){let s=this.module,a=this.program.stringInstance.type;if(t==a)return e;let l=t.getClassOrWrapper(this.program);if(l){let o=l.getMethod("toString");if(o){let u=o.signature;if(!this.checkCallSignature(u,0,!0,i))return this.currentType=a,s.unreachable();if(!t.isStrictlyAssignableTo(assert(u.thisType))){if(!t.is(512))return this.errorRelated(2685,i.range,o.identifierAndSignatureRange),this.currentType=a,s.unreachable();let f=this.currentFlow.getTempLocal(t);return s.if(s.local_tee(f.index,e,t.isManaged),this.makeToString(s.local_get(f.index,t.toRef()),t.nonNullableType,i),this.ensureStaticString("null"))}let c=u.returnType;return c.isStrictlyAssignableTo(a)?this.makeCallDirect(o,[e],i):(this.errorRelated(2322,i.range,o.identifierAndSignatureRange,c.toString(),a.toString()),this.currentType=a,s.unreachable())}}return this.error(2322,i.range,t.toString(),a.toString()),this.currentType=a,s.unreachable()}makeAllocation(e){let t=this.program;assert(e.program==t);let i=this.module,s=this.options;if(this.currentType=e.type,e.hasDecorator(16)){let a=t.allocInstance;return this.compileFunction(a),i.call(a.internalName,[s.isWasm64?i.i64(e.nextMemoryOffset):i.i32(e.nextMemoryOffset)],s.sizeTypeRef)}else{let a=t.newInstance;return this.compileFunction(a),i.call(a.internalName,[s.isWasm64?i.i64(e.nextMemoryOffset):i.i32(e.nextMemoryOffset),i.i32(e.id)],s.sizeTypeRef)}}makeConditionalAllocation(e,t){let i=this.module,a=e.type.toRef();return assert(a==this.options.sizeTypeRef),i.if(i.unary(a==P.I64?21:20,i.local_get(t,a)),i.local_set(t,this.makeAllocation(e),e.type.isManaged))}makeFieldInitializationInConstructor(e,t=[]){let i=e.members;if(!i)return t;let s=this.module,a=this.currentFlow,l=a.isInline,o=l?a.lookupLocal(B.this_).index:0,u=this.options.sizeTypeRef,c=null;for(let f=Map_values(i),_=0,d=f.length;_<d;++_){let m=unchecked(f[_]);if(m.kind!=10)continue;let h=m.instance;if(!h||!h.isField||h.getBoundClassOrInterface()!=e)continue;if(this.isInlineStructType(h.type)){let C=h.initializerNode,M=e.hasDecorator(16)||e.hasDecorator(2048);if(C!=null&&M){if(C.kind==18&&C.isLiteralKind(6)&&C.names.length==0)continue;this.error(100,C.range,"an initializer on an @inline struct field (the value is stored inline and has no address to copy into; the allocation is already zero, so `= {}` is allowed -- assign the field's own fields after construction)")}continue}assert(!h.isAny(8));let b=h.prototype,A=b.parameterIndex;if(A<0){c||(c=new Array),c.push(h);continue}let k=h.type.toRef();assert(!b.initializerNode);let w=assert(h.setterInstance),R=this.makeCallDirect(w,[s.local_get(o,u),s.local_get(l?a.lookupLocal(h.name).index:1+A,k)],w.identifierNode,!0);this.currentType!=p.void&&(R=s.drop(R)),t.push(R)}if(c)for(let f=0,_=c.length;f<_;++f){let d=unchecked(c[f]),m=d.type,h=d.prototype,b=h.initializerNode;if(assert(h.parameterIndex<0),m.kind==14&&(m.fixedMemoryModel==0||m.fixedMemoryModel==1)){b&&this.error(100,b.range,"an initializer on a `[T * N]` field in a `new`-constructed record (the field is inline bytes; assign its elements after construction instead, `h.arr[0] = ...`)");continue}let A=assert(d.setterInstance),S=this.makeCallDirect(A,[s.local_get(o,u),b?this.compileExpression(b,m,1):this.makeZero(m)],d.identifierNode,!0);this.currentType!=p.void&&(S=s.drop(S)),t.push(S)}return this.currentType=p.void,t}makeAbort(e,t){let i=this.program,s=i.abortInstance;if(!s||!this.compileFunction(s))return this.module.unreachable();let a=i.stringInstance,l;return e?l=this.compileExpression(e,a.type,1):l=this.makeZero(a.type),this.makeStaticAbort(l,t)}makeStaticAbort(e,t){let i=this.program,s=this.module,a=i.abortInstance;if(!a||!this.compileFunction(a))return s.unreachable();let l=this.ensureStaticString(t.range.source.normalizedPath),o=t.range,u=o.source;return s.block(null,[s.call(a.internalName,[e,l,s.i32(u.lineAt(o.start)),s.i32(u.columnAt())],P.None),s.unreachable()])}makeRuntimeNonNullCheck(e,t,i){let s=this.module,a=this.currentFlow,o=a.getTempLocal(t).index;a.canOverflow(e,t)||a.setLocalFlag(o,2),a.setLocalFlag(o,4);let u=this.makeStaticAbort(this.ensureStaticString("Unexpected 'null' (not assigned or failed cast)"),i);if(t.isExternalReference){let c=s.local_get(o,t.toRef());this.options.hasFeature(1024)&&(c=s.ref_as_nonnull(c)),e=s.if(s.ref_is_null(s.local_tee(o,e,!1)),u,c)}else e=s.if(s.local_tee(o,e,t.isManaged),s.local_get(o,t.toRef()),u);return this.currentType=t.nonNullableType,e}makeRuntimeDowncastCheck(e,t,i,s){assert(i.isReference&&i.nonNullableType.isAssignableTo(t));let a=this.module,l=this.currentFlow,u=l.getTempLocal(t).index,c=this.makeStaticAbort(this.ensureStaticString("invalid downcast"),s);return!i.isNullableReference||l.isNonnull(e,t)?e=a.if(a.call(this.prepareInstanceOf(i.classReference),[a.local_tee(u,e,t.isManaged)],P.I32),a.local_get(u,t.toRef()),c):e=a.if(a.unary(20,a.local_tee(u,e,t.isManaged)),a.usize(0),a.if(a.call(this.prepareInstanceOf(i.classReference),[a.local_get(u,t.toRef())],P.I32),a.local_get(u,t.toRef()),c)),this.currentType=i,e}};function Cx(n,r){An=r.range.source.simplePath,Nr=Ke(n.name,n.parent,n.is(262144),!0);let e=r.overriddenModuleName;if(e&&(An=e),!n.hasDecorator(128))return;let t=n.program,i=assert(Zt(10,r.decorators)),s=i.args;if(s&&s.length>0){let a=s[0];a.isLiteralKind(2)?(Nr=a.value,s.length>=2&&(a=s[1],a.isLiteralKind(2)?(An=Nr,Nr=a.value,s.length>2&&t.error(2554,i.range,"2",s.length.toString())):t.error(1141,a.range))):t.error(1141,a.range)}else t.error(2555,i.range,"1","0")}var bi=class n extends pi{constructor(e,t,i=!1){super(e,i);this.sb=[];this.indentLevel=0;this.seenObjectTypes=new Map;this.deferredTypings=new Array;this.esm=t}static build(e,t=!0){return new n(e,t).build()}visitGlobal(e,t){let i=this.sb,s=t.type,a=this.toTypeScriptType(s,1);W(i,this.indentLevel),i.push("/** "),i.push(t.internalName),i.push(` */
268
+ `}var An="",Nr="",pu=15,pa=class{constructor(){this.target=1;this.runtime=2;this.debugInfo=!1;this.noAssert=!1;this.exportMemory=!0;this.importMemory=!1;this.initialMemory=0;this.maximumMemory=0;this.sharedMemory=!1;this.zeroFilledMemory=!1;this.importTable=!1;this.exportTable=!1;this.sourceMap=!1;this.uncheckedBehavior=0;this.exportStart=null;this.memoryBase=0;this.tableBase=0;this.globalAliases=null;this.features=pu;this.noUnsafe=!1;this.pedantic=!1;this.lowMemoryLimit=0;this.exportRuntime=!1;this.stackSize=0;this.bundleMajorVersion=0;this.bundleMinorVersion=0;this.bundlePatchVersion=0;this.optimizeLevelHint=0;this.shrinkLevelHint=0;this.basenameHint="output";this.bindingsHint=!1}get isWasm64(){return this.target==2}get usizeType(){return this.target==2?p.usize64:p.usize32}get isizeType(){return this.target==2?p.isize64:p.isize32}get sizeTypeRef(){return this.target==2?P.I64:P.I32}get willOptimize(){return this.optimizeLevelHint>0||this.shrinkLevelHint>0}setFeature(r,e=!0){e?(r&32768&&(r|=1056),r&16384&&(r|=1024),r&1024&&(r|=256),r&4096&&(r|=16),this.features|=r):(r&256&&(r|=1024),r&1024&&(r|=16384),r&16&&(r|=4096),r&1056&&(r|=32768),this.features&=~r)}hasFeature(r){return(this.features&r)!=0}},jo=(t=>(t[t.Default=0]="Default",t[t.Never=1]="Never",t[t.Always=2]="Always",t))(jo||{}),d_=(l=>(l[l.None=0]="None",l[l.ConvImplicit=1]="ConvImplicit",l[l.ConvExplicit=2]="ConvExplicit",l[l.MustWrap=4]="MustWrap",l[l.WillDrop=8]="WillDrop",l[l.PreferStatic=16]="PreferStatic",l[l.IsThis=32]="IsThis",l))(d_||{}),h_=(o=>(o[o.None=0]="None",o[o.Data=1]="Data",o[o.Stack=2]="Stack",o[o.Heap=4]="Heap",o[o.Rtti=8]="Rtti",o[o.visitGlobals=16]="visitGlobals",o[o.visitMembers=32]="visitMembers",o[o.setArgumentsLength=64]="setArgumentsLength",o))(h_||{}),gi;(t=>(t.DefaultNamespace="env",t.Memory="memory",t.Table="table"))(gi||={});var ca;(i=>(i.Memory="memory",i.Table="table",i.argumentsLength="__argumentsLength",i.setArgumentsLength="__setArgumentsLength"))(ca||={});var di=["__new","__pin","__unpin","__collect"],hi=["__rtti_base"],cu=0,Rx="$closureEnvIn",b_=class{constructor(r,e,t){this.valueIndex=r;this.doneIndex=e;this.expression=t}},fa=class n extends tt{constructor(e){super(e.diagnostics);this.lazyLocals=null;this.currentParent=null;this.currentType=p.void;this.memorySegments=[];this.stringSegments=new Map;this.staticGcObjectOffsets=new Map;this.functionTable=[];this.builtinArgumentsLength=0;this.builtinEnv=0;this.runtimeFeatures=0;this.inlineStack=[];this.lazyFunctions=new Set;this.pendingInstanceOf=new Map;this.overrideStubs=new Set;this.pendingElements=new Set;this.doneModuleExports=new Set;this.hasCustomFunctionExports=!1;this.desiresExportRuntime=!1;this.f32ModInstance=null;this.f64ModInstance=null;this.f32PowInstance=null;this.f64PowInstance=null;this.i32PowInstance=null;this.i64PowInstance=null;this._reusableCallExpression=null;this.sretStackBase=0;this.sretStackLimit=0;this.sretStackGlobal=null;this.sretDestSlot=0;this.sretDiscardMark=null;this.externalTempMark=null;this.externalTempSize=0;this.rootNextOperand=!1;this.sroaSelectId=0;this.program=e;let t=e.module,i=e.options;i.memoryBase?(this.memoryOffset=i64_new(i.memoryBase),t.setLowMemoryUnused(!1)):!i.lowMemoryLimit&&i.optimizeLevelHint>=2?(this.memoryOffset=i64_new(1024),t.setLowMemoryUnused(!0)):(this.memoryOffset=i64_new(8),t.setLowMemoryUnused(!1));let s=0;i.hasFeature(1)&&(s|=32),i.hasFeature(2)&&(s|=2),i.hasFeature(4)&&(s|=4),i.hasFeature(8)&&(s|=16),i.hasFeature(16)&&(s|=8),i.hasFeature(32)&&(s|=1),i.hasFeature(64)&&(s|=64),i.hasFeature(128)&&(s|=128),i.hasFeature(256)&&(s|=256),i.hasFeature(512)&&(s|=512),i.hasFeature(1024)&&(s|=1024),i.hasFeature(2048)&&(s|=2048),i.hasFeature(4096)&&(s|=4096),i.hasFeature(8192)&&(s|=8192),i.hasFeature(16384)&&(s|=16384),i.hasFeature(32768)&&(s|=131072),t.setFeatures(s);let a=e.makeNativeFunction(g.start,oe.create(e,[],p.void));a.internalName=g.start,this.currentFlow=a.flow,this.currentBody=new Array,this.shadowStack=new uu(this)}get module(){return this.program.module}get options(){return this.program.options}get resolver(){return this.program.resolver}static compile(e){return new n(e).compile()}compile(){let e=this.options,t=this.module,i=this.program,s=this.resolver,a=e.stackSize>0;this.initDummyMemory(),this.program.initialize(),t.setClosedWorld(!0);let l=this.currentFlow.targetFunction;assert(l.internalName==g.start);let o=this.currentBody;assert(o.length==0);let u=i.filesByName;for(let A=Map_values(u),S=0,k=A.length;S<k;++S){let w=unchecked(A[S]);w.source.sourceKind==1&&(this.compileFile(w),this.compileModuleExports(w))}if(this.options.exportRuntime||this.options.bindingsHint&&this.desiresExportRuntime){for(let A=0,S=di.length;A<S;++A){let k=di[A],w=i.requireFunction(k);this.compileFunction(w)&&!t.hasExport(k)&&t.addFunctionExport(w.internalName,k)}for(let A=0,S=hi.length;A<S;++A){let k=hi[A],w=i.requireGlobal(k);this.compileGlobal(w)&&!t.hasExport(k)&&t.addGlobalExport(w.internalName,k)}}let c=this.lazyFunctions;do{let A=new Array;for(let S=Set_values(c),k=0,w=S.length;k<w;++k){let R=unchecked(S[k]);A.push(R)}c.clear();for(let S=0,k=A.length;S<k;++S)this.compileFunction(unchecked(A[S]),!0)}while(c.size);let f=this.functionTable,_=this.overrideStubs;for(let A=0,S=f.length;A<S;++A){let k=f[A];k.is(268435456)?(assert(k.is(262144)),f[A]=this.ensureOverrideStub(k)):k.signature.requiredParameters<k.signature.parameterTypes.length&&(f[A]=this.ensureVarargsStub(k))}let d=new Set;do{s.discoveredOverride=!1;for(let A=Set_values(_),S=0,k=A.length;S<k;++S){let w=unchecked(A[S]),R=s.resolveOverrides(w);if(R)for(let C=0,M=R.length;C<M;++C)this.compileFunction(R[C]);d.add(w)}}while(_.size>d.size||s.discoveredOverride);d.clear();for(let A=Set_values(_),S=0,k=A.length;S<k;++S)this.finalizeOverrideStub(A[S]);for(let A=Map_keys(this.pendingInstanceOf),S=0,k=A.length;S<k;++S){let w=A[S],R=assert(this.pendingInstanceOf.get(w));switch(w.kind){case 7:case 9:{this.finalizeInstanceOf(w,R);break}case 6:case 8:{this.finalizeAnyInstanceOf(w,R);break}default:assert(!1)}}t.removeGlobal(g.rtti_base),this.runtimeFeatures&8&&Sx(this),this.runtimeFeatures&16&&Ex(this),this.runtimeFeatures&32&&Tx(this);let m=i64_align(this.memoryOffset,e.usizeType.byteSize);t.removeGlobal(g.data_end),((this.runtimeFeatures&1)!=0||a)&&(e.isWasm64?t.addGlobal(g.data_end,P.I64,!1,t.i64(i64_low(m),i64_high(m))):t.addGlobal(g.data_end,P.I32,!1,t.i32(i64_low(m)))),t.removeGlobal(g.stack_pointer),((this.runtimeFeatures&2)!=0||a)&&(m=i64_align(i64_add(m,i64_new(e.stackSize)),e.usizeType.byteSize),e.isWasm64?t.addGlobal(g.stack_pointer,P.I64,!0,t.i64(i64_low(m),i64_high(m))):t.addGlobal(g.stack_pointer,P.I32,!0,t.i32(i64_low(m)))),t.removeGlobal(g.heap_base),((this.runtimeFeatures&4)!=0||a)&&(e.isWasm64?t.addGlobal(g.heap_base,P.I64,!1,t.i64(i64_low(m),i64_high(m))):t.addGlobal(g.heap_base,P.I32,!1,t.i32(i64_low(m)))),this.initDefaultMemory(m),this.initDefaultTable(),this.runtimeFeatures&64&&(t.addFunction(g.setArgumentsLength,P.I32,P.None,null,t.global_set(this.ensureArgumentsLength(),t.local_get(0,P.I32))),t.addFunctionExport(g.setArgumentsLength,ca.setArgumentsLength));let h=!o.length,b=e.exportStart;if(!h||b!=null){let A=l.signature;!h&&b!=null&&(t.addGlobal(g.started,P.I32,!0,t.i32(0)),o.unshift(t.global_set(g.started,t.i32(1))),o.unshift(t.if(t.global_get(g.started,P.I32),t.return())));let S=t.addFunction(l.internalName,A.paramRefs,A.resultRefs,l.getNonParameterLocalTypeRefs(),t.flatten(o));l.finalize(t,S),b==null?t.setStart(S):!Ze(b)||t.hasExport(b)?this.error(110,Te.native.range,b):t.addFunctionExport(l.internalName,b)}return a&&this.shadowStack.walkModule(),i.lookup("ASC_RTRACE")!=null&&new ou(this).walkModule(),t}initDummyMemory(){let e=this.options;this.module.setMemory(0,Jt.UNLIMITED_MEMORY,[],e.target,null,L.DefaultMemory,e.sharedMemory)}initDefaultMemory(e){this.memoryOffset=e;let t=this.options,i=this.module,s=this.memorySegments,a=0,l=Jt.UNLIMITED_MEMORY,o=!1;(t.memoryBase||s.length)&&(a=u32(i64_low(i64_shr_u(i64_align(e,65536),i64_new(16))))),t.initialMemory&&(t.initialMemory<a?this.error(105,null,a.toString()):a=t.initialMemory),t.maximumMemory&&(t.maximumMemory<a?this.error(106,null,a.toString()):l=t.maximumMemory),t.sharedMemory&&(o=!0,t.maximumMemory||(this.error(107,null),o=!1),t.hasFeature(32)||(this.error(108,null),o=!1));let u=t.lowMemoryLimit;if(u){let c=i64_new(u&-16);i64_gt(e,c)&&this.error(104,null,i64_to_string(e),i64_to_string(c))}i.setMemory(a,l,s,t.target,t.exportMemory?ca.Memory:null,L.DefaultMemory,o),t.importMemory&&i.addMemoryImport(L.DefaultMemory,gi.DefaultNamespace,gi.Memory,o)}initDefaultTable(){let e=this.options,t=this.module;e.importTable&&(t.addTableImport(L.DefaultTable,gi.DefaultNamespace,gi.Table),t.setClosedWorld(!1),e.pedantic&&e.willOptimize&&this.pedantic(901,null)),e.exportTable&&(t.addTableExport(L.DefaultTable,ca.Table),t.setClosedWorld(!1),e.pedantic&&e.willOptimize&&this.pedantic(902,null));let i=e.tableBase;i||(i=1);let s=this.functionTable,a=new Array(s.length);for(let u=0,c=s.length;u<c;++u)a[u]=s[u].internalName;let l=i+s.length,o=Jt.UNLIMITED_TABLE;e.importTable||e.exportTable||(o=l,e.willOptimize&&t.setPassArgument("directize-initial-contents-immutable","true")),t.addFunctionTable(L.DefaultTable,l,o,a,t.i32(i))}compileModuleExports(e){let t=e.exports;if(t)for(let s=Map_keys(t),a=0,l=s.length;a<l;++a){let o=unchecked(s[a]),u=assert(t.get(o));this.compileModuleExport(o,u)}let i=e.exportsStar;if(i)for(let s=0,a=i.length;s<a;++s)this.compileModuleExports(i[s])}compileModuleExport(e,t,i=""){let s=this.module;switch(t.kind){case 4:{let a=t;if(!a.is(65536)){let l=this.resolver.resolveFunction(a,null);l&&this.compileModuleExport(e,l,i);return}break}case 5:{let a=t;if(!a.hasDecorator(512)){let l=a.signature;if(l.requiredParameters<l.parameterTypes.length&&(a=this.ensureVarargsStub(a),this.runtimeFeatures|=64),this.compileFunction(a),a.is(8388608)){let o=i+e;if(!s.hasExport(o)){if(s.addFunctionExport(a.internalName,o),this.hasCustomFunctionExports=!0,l.hasManagedOperands&&this.shadowStack.noteExport(o,l.getManagedOperandIndices()),!this.desiresExportRuntime){let c=l.thisType;if(c&&yi(c)||mi(l.returnType))this.desiresExportRuntime=!0;else{let f=l.parameterTypes;for(let _=0,d=f.length;_<d;++_)if(yi(f[_])){this.desiresExportRuntime=!0;break}}}a.signature.returnType.kind==16&&this.module.setClosedWorld(!1)}return}}break}case 0:{let a=t;if(!(a.is(8)||a.is(96))&&!this.options.hasFeature(2)){this.warning(103,a.identifierNode.range,"mutable-globals");return}if(this.compileGlobal(a),a.is(8388608)){let o=i+e;if(!s.hasExport(o)){if(s.addGlobalExport(t.internalName,o),!this.desiresExportRuntime){let u=a.type;(mi(u)||!a.is(8)&&yi(u))&&(this.desiresExportRuntime=!0)}a.type.kind==16&&this.module.setClosedWorld(!1)}a.type==p.v128&&this.warning(112,a.typeNode?assert(a.typeNode).range:a.identifierNode.range,"v128");return}break}case 2:{this.compileEnum(t);let a=t.members;if(a){let l=i+e+es;for(let o=Map_keys(a),u=0,c=o.length;u<c;++u){let f=unchecked(o[u]),_=assert(a.get(f));_.is(512)||this.compileModuleExport(f,_,l)}}return}case 3:{let a=t;if(!a.isImmutable&&!this.options.hasFeature(2)){this.error(103,a.identifierNode.range,"mutable-globals");return}if(a.is(8388608)){let l=i+e;s.hasExport(l)||s.addGlobalExport(t.internalName,l);return}break}}this.warning(235,t.identifierNode.range)}compileFileByPath(e,t){let i,s=this.program.filesByName,a;if(s.has(e))i=assert(s.get(e));else if(s.has(a=e+Qe))i=assert(s.get(a));else{this.error(6054,t.range,e);return}this.compileFile(i)}compileFile(e){if(e.is(8388608))return;e.set(8388608);let t=e.startFunction,i=t.signature,s=this.currentBody,a=new Array;this.currentBody=a;let l=this.currentFlow,o=t.flow;this.currentFlow=o;for(let u=e.source.statements,c=0,f=u.length;c<f;++c)this.compileTopLevelStatement(u[c],a);if(this.currentFlow=l,this.currentBody=s,a.length){let u=this.module,c=t.localsByIndex,f=c.length,_=new Array(f);for(let m=0;m<f;++m)_[m]=c[m].type.toRef();let d=u.addFunction(t.internalName,i.paramRefs,i.resultRefs,_,u.flatten(a));t.finalize(u,d),s.push(u.call(t.internalName,null,P.None))}}compileGlobalLazy(e,t){return e.is(8388608)?!e.is(16777216):e.hasAnyDecorator(1536)||e.is(32768)||this.hasConstantInitializer(e)?this.compileGlobal(e):(this.errorRelated(2448,t.range,e.identifierNode.range,e.internalName),!1)}hasConstantInitializer(e){let t=e.initializerNode;return t!=null&&t.evaluatesToConst}compileGlobal(e){if(e.is(8388608))return!e.is(16777216);e.set(8388608);let t=this.pendingElements;t.add(e);let i=this.module,s=0,a=e.typeNode,l=e.initializerNode;if(!e.is(4194304))if(a){let m=this.resolver.resolveType(a,null,e.parent);if(!m)return e.set(16777216),t.delete(e),!1;if(m==p.void)return this.error(1110,a.range),e.set(16777216),t.delete(e),!1;if(e.setType(m),this.program.checkTypeSupported(m,a),this.program.checkInlineStructValue(m,a,"a global"),!this.checkFixedArrayStoragePosition(m,a,"a global"))return e.set(16777216),t.delete(e),!1}else if(l){let m=this.currentFlow;if(e.hasDecorator(1024)&&(this.currentFlow=e.file.startFunction.flow),s=this.compileExpression(l,p.auto,20),this.currentFlow=m,this.currentType==p.void)return this.error(2322,l.range,this.currentType.toString(),"<auto>"),e.set(16777216),t.delete(e),!1;e.setType(this.currentType),this.program.checkInlineStructValue(this.currentType,l,"a global")}else return this.error(1110,e.identifierNode.range.atEnd),e.set(16777216),t.delete(e),!1;if(e.hasDecorator(512)){let m=e.internalName;return sr.has(m)&&assert(sr.get(m))(new Ws(this,e)),t.delete(e),!0}let o=e.type;!l&&!e.is(16384)&&o.isReference&&!o.isNullableReference&&this.error(238,e.identifierNode.range);let u=o.toRef(),c=e.is(8)||e.is(96),f=e.hasDecorator(64);if(e.is(32768))return c||this.options.hasFeature(2)?(Cx(e,e.declaration),this.program.markModuleImport(An,Nr,e),i.addGlobalImport(e.internalName,An,Nr,u,!c),t.delete(e),!this.desiresExportRuntime&&yi(o)&&(this.desiresExportRuntime=!0),!0):(this.error(103,e.declaration.range,"mutable-globals"),e.set(16777216),t.delete(e),!1);let _=!1;if(l){if(!s){let m=this.currentFlow;e.hasDecorator(1024)&&(this.currentFlow=e.file.startFunction.flow),s=this.compileExpression(l,o,21),this.currentFlow=m}if(!i.isConstExpression(s))if(c){let m=i.runExpression(s,1);m?s=m:_=!0}else _=!0;if(_&&re(s)==10){let m=assert(xs(s));if(!xf(i.getGlobal(m))){let h=this.program.elementsByName;h.has(m)&&assert(h.get(m)).is(32768)&&(_=!1)}}if(f)if(_)this.warning(206,l.range);else{switch(assert(re(s)==14),fe(s)){case P.I32:{e.constantValueKind=1,e.constantIntegerValue=i64_new(ae(s),0);break}case P.I64:{e.constantValueKind=1,e.constantIntegerValue=i64_new(Ne(s),Ge(s));break}case P.F32:{e.constantValueKind=2,e.constantFloatValue=Ce(s);break}case P.F64:{e.constantValueKind=2,e.constantFloatValue=Pe(s);break}default:return assert(!1),e.set(16777216),t.delete(e),!1}e.set(33554432)}}else{if(o.kind==14)return this.error(100,(a||l||e.declaration).range,"a `[T * N]` global without an initializer (a fixed array is a view of storage someone else owns; Landing 5c). Give it a `changetype<[T * N]>(ptr)` initializer, or use `[T *]` for an unknown-length view"),e.set(16777216),t.delete(e),!1;e.is(33554432)?s=this.compileInlineConstant(e,e.type,16):s=this.makeZero(o)}let d=e.internalName;if(_){f&&this.error(212,$t(9,e.decoratorNodes).range,"inline");let m=o;o.isExternalReference&&!o.is(512)&&(e.set(-2147483648),m=o.asNullable()),i.addGlobal(d,m.toRef(),!0,this.makeZero(m)),this.currentBody.push(i.global_set(d,s))}else f||i.addGlobal(d,u,!c,s);return t.delete(e),!0}compileEnum(e){if(e.is(8388608))return!e.is(16777216);e.set(8388608);let t=this.resolver.resolveEnumType(e),i=this.pendingElements;i.add(e);let s=this.module,a=this.currentParent;this.currentParent=e;let l=null,o=!1,u=e.is(8)||e.hasDecorator(64),c=e.members;if(c)for(let f=Map_values(c),_=0,d=f.length;_<d;++_){let m=unchecked(f[_]);if(m.kind!=3)continue;let h=!1,b=m,A=b.valueNode;b.set(8388608);let S=this.currentFlow;e.hasDecorator(1024)&&(this.currentFlow=e.file.startFunction.flow);let k;if(A){if(k=this.compileExpression(A,t,1),re(k)!=14){let w=s.runExpression(k,1);w?k=w:(e.is(8)&&this.error(2474,A.range),h=!0)}}else if(l==null)k=s.i32(0);else if(o&&this.error(1061,b.identifierNode.range.atEnd),u){let w=i64_add(l.constantIntegerValue,i64_new(1));assert(!i64_high(w)),k=s.i32(i64_low(w))}else{k=s.binary(0,s.global_get(l.internalName,P.I32),s.i32(1));let w=s.runExpression(k,1);w?k=w:(e.is(8)&&this.error(2474,m.declaration.range),h=!0)}if(this.currentFlow=S,h)s.addGlobal(b.internalName,P.I32,!0,s.i32(0)),this.currentBody.push(this.makeGlobalAssignment(b,k,p.i32,!1)),o=!0;else{let w=ae(k);this.enumMemberValueFits(w,t)||this.error(6404,A?A.range:b.identifierNode.range,b.name,t.toString()),u?(b.setConstantIntegerValue(i64_new(w),t),b.is(1048576)&&s.addGlobal(b.internalName,P.I32,!1,k)):s.addGlobal(b.internalName,P.I32,!1,k),b.isImmutable=!0,o=!1}l=b}return this.currentParent=a,i.delete(e),!0}enumMemberValueFits(e,t){switch(t.kind){case 1:return e>=i8.MIN_VALUE&&e<=i8.MAX_VALUE;case 6:return e>=0&&e<=u8.MAX_VALUE;case 2:return e>=i16.MIN_VALUE&&e<=i16.MAX_VALUE;case 7:return e>=0&&e<=u16.MAX_VALUE;default:return!0}}ensureEnumToString(e,t){if(e.toStringFunctionName)return e.toStringFunctionName;if(!this.compileEnum(e))return null;if(e.is(8))return this.errorRelated(2476,t.range,e.identifierNode.range),null;let i=e.members;if(!i)return null;let s=this.module,a=e.hasDecorator(64),l=`${e.internalName}#${L.EnumToString}`;e.toStringFunctionName=l;let o=new Array;for(let u=Map_keys(i),c=Map_values(i),f=1,_=u.length;f<=_;++f){let d=unchecked(u[_-f]),m=unchecked(c[_-f]);if(m.kind!=3)continue;let h=m,b=a?s.i32(i64_low(h.constantIntegerValue)):s.global_get(h.internalName,P.I32),A=s.if(s.binary(15,b,s.local_get(0,P.I32)),s.return(this.ensureStaticString(d)));o.push(A)}return o.push(s.unreachable()),s.addFunction(l,P.I32,P.I32,null,s.block(null,o,P.I32)),l}compileFunction(e,t=!1){if(e.is(16777216))return!1;if(e.is(8388608))return!0;if(!t){if(e.hasDecorator(512))return!0;if(e.hasDecorator(1024))return this.lazyFunctions.add(e),!0}let i=e.prototype.functionTypeNode.parameters,s=i.length;if(s>=2){let d=new Set;d.add(i[0].name.text);for(let m=1;m<s;m++){let h=i[m].name,b=h.text;d.has(b)?this.error(2300,h.range,b):d.add(b)}}e.set(8388608);let a=this.pendingElements;a.add(e);let l=this.currentType,o=this.module,u=e.signature,c=e.prototype.bodyNode,f=e.declaration;if(assert(f.kind==59||f.kind==62),this.checkSignatureSupported(e.signature,f.signature),!this.checkFixedArrayStorageInSignature(e.signature,f.signature))return e.set(16777216),a.delete(e),this.currentType=l,!1;if(u.hasHiddenDestParam&&e.is(268435456)&&this.error(100,f.name.range,"an @inline struct return on a virtual method (the override stub has no destination parameter; deferred)"),u.hasHiddenDestParam&&(e.is(1048576)||e.hasAnyDecorator(384))&&this.error(100,f.name.range,"an @inline struct return across the module boundary (the host would have to pass the destination pointer; that is an ABI version, not this phase)"),e.is(1048576)||e.hasAnyDecorator(384)){let d=u.parameterTypes;for(let m=0,h=d.length;m<h;++m){let b=unchecked(d[m]);if(!u.crossesByValueParam(m))continue;if(oe.fieldCountOf(b)==1){let S=e.prototype.functionTypeNode.parameters[m];this.error(100,S.type.range,"an @inline struct with a single field at a host boundary (the C/WASM tool convention passes a one-scalar struct as the scalar itself, while this compiler passes records as pointers; both are `(param i32)`, so the disagreement is silent. Pass the scalar directly, or use a struct with two or more fields)");break}}}if(e.hasAnyDecorator(384)&&!u.externalBoundary){let d=u.parameterTypes;for(let m=0,h=d.length;m<h;++m)if(this.isInlineStructType(unchecked(d[m]))){let b=e.prototype.functionTypeNode.parameters[m];this.error(100,b.type.range,"an @inline struct as an @external parameter (flattening the record into one WASM parameter per field would make its field list part of the host ABI; the by-value temp is the implemented path, so this declaration did not take it)");break}}if(e.is(1048576)&&!e.hasAnyDecorator(384)&&!u.exportByValParams){let d=u.parameterTypes;for(let m=0,h=d.length;m<h;++m){if(this.isInlineStructType(unchecked(d[m]))){let b=e.prototype.functionTypeNode.parameters[m];this.error(100,b.type.range,"an @inline struct as an export parameter (flattening the record into one WASM parameter per field would make its field list part of the host ABI; the by-value pointer parameter is the implemented path, so this declaration did not take it)");break}if(this.isValueFormFixedArray(unchecked(d[m]))){let b=e.prototype.functionTypeNode.parameters[m];this.error(100,b.type.range,"a `[T * N]` value as an export parameter (one WASM parameter per element leaf would make the extent and layout part of the host ABI). Pass `@unmanaged [T * N]` \u2014 a pointer \u2014 and the count separately");break}}}let _=0;if(c){if(e.is(32768)&&this.error(1183,e.identifierNode.range),e.hasAnyDecorator(384)){let b=e.decoratorNodes,A;(A=$t(10,b))&&this.error(212,A.range,"external"),(A=$t(11,b))&&this.error(212,A.range,"external.js")}let d=this.currentFlow,m=e.flow;this.currentFlow=m;let h=new Array;u.exportByValParams&&this.emitExportByValPrologue(e,h),this.compileFunctionBody(e,h)||h.push(o.unreachable()),this.currentFlow=d,_=o.addFunction(e.internalName,u.paramRefs,u.resultRefs,e.getNonParameterLocalTypeRefs(),o.flatten(h,u.resultRefs))}else if(e.is(32768)){if(Cx(e,f),this.program.markModuleImport(An,Nr,e),o.addFunctionImport(e.internalName,An,Nr,u.paramRefs,u.resultRefs),_=o.getFunction(e.internalName),!this.desiresExportRuntime){let d=u.thisType;if(d&&mi(d)||yi(u.returnType))this.desiresExportRuntime=!0;else{let m=u.parameterTypes;for(let h=0,b=m.length;h<b;++h)if(mi(m[h])){this.desiresExportRuntime=!0;break}}}}else if(e.is(128)||e.parent.kind==9)_=o.addFunction(e.internalName,u.paramRefs,u.resultRefs,null,o.unreachable());else{if(e.isAny(6144)){let d=e.declaration.name.text,m=assert(e.parent.getMember(d));assert(m.kind==10);let h=m.instance;h&&h.isField&&(_=e.is(2048)?this.makeBuiltinFieldGetter(h):this.makeBuiltinFieldSetter(h),assert(e.is(8388608)))}_||(this.error(2391,e.identifierNode.range),e.set(16777216))}if((e.is(32768)||e.is(2))&&u.hasVectorValueOperands){let m,h=e.prototype.functionTypeNode;if(u.returnType==p.v128)m=h.returnType.range;else{let b=u.getVectorValueOperandIndices()[0];m=h.parameters[b].range}this.warning(112,m,"v128")}return e.finalize(o,_),this.currentType=l,a.delete(e),!0}compileFunctionBody(e,t){let i=this.module,s=assert(e.prototype.bodyNode),a=e.signature.returnType,l=this.currentFlow,o=e.signature.thisType?assert(l.lookupLocal(L.this_)):null,u=t.length;if(e.prototype.envKind==2){let c=assert(e.prototype.envClass),f=e.declaration.range.source,_=assert(this.program.filesByName.get(f.internalPath)),d=assert(_.getMember(c)),m=d.typeParameterNodes,h=null;if(m!=null&&m.length>0){let S=l.contextualTypeArguments,k=new Array(m.length);for(let w=0,R=m.length;w<R;++w){let C=m[w].name.text,M=S!=null?J(S,C):null;if(M==null)return this.error(1140,e.declaration.range),!1;k[w]=M}h=k}let b=assert(this.resolver.resolveClass(d,h,new Map,1)),A=l.addScopedLocal(Rx,b.type);l.setLocalFlag(A.index,8)}{let c=e.signature.parameterTypes,f=e.prototype.declaration.signature.parameters,_=l.scopedLocals;if(_!=null)for(let d=0,m=c.length;d<m&&!(d>=f.length);++d){let h=f[d].type;if(h==null||h.kind!=72)continue;let b=h.lengthName.text,A=e.getParameterName(d);if(!_.has(b)||!_.has(A))continue;let S=assert(_.get(b)),k=assert(_.get(A));S.isDynamicLength&&(t.push(i.local_set(S.index,i.load(4,!1,i.local_get(k.index,P.I32),P.I32,0,4),!1)),l.setLocalFlag(S.index,8))}}if(s.kind==34)t=this.compileStatements(s.statements,t);else{assert(s.kind==42),assert(e.prototype.arrowKind),assert(!e.isAny(530432));let c=this.compileExpression(s.expression,a,1);l.canOverflow(c,a)||l.set(2),l.isNonnull(c,a)&&l.set(4),t?t.push(c):t=[c],l.is(256)||(l.canOverflow(c,a)||l.set(2),l.isNonnull(c,a)&&l.set(4),l.set(257))}if(e.is(524288)){assert(e.is(262144)),o=assert(o);let c=assert(e.parent);assert(c.kind==7);let f=c;if(l.isAny(8256)||!l.is(256)){let _=new Array;_.push(this.makeConditionalAllocation(f,o.index)),this.makeFieldInitializationInConstructor(f,_);for(let d=t.length-1;d>=u;--d)t[d+1]=t[d];t[u]=i.flatten(_,P.None),l.is(16384)&&this.options.pedantic&&this.pedantic(905,e.identifierNode.range)}l.is(16384)&&!f.hasDecorator(32)&&this.error(231,f.identifierNode.range),l.is(256)||(t.push(i.local_get(o.index,o.type.toRef())),l.set(261)),f.base&&!f.prototype.implicitlyExtendsObject&&!l.is(128)&&this.error(2377,e.prototype.declaration.range)}else if(a!=p.void&&!l.is(256))return this.error(2355,e.prototype.functionTypeNode.returnType.range),!1;if(e.prototype.capturesThis){assert(!l.isInline);let c=assert(l.lookupLocal(L.this_));assert(!e.signature.thisType);let f=i.local_set(c.index,i.global_get(this.ensureEnvGlobal(),this.options.sizeTypeRef),c.type.isManaged);for(let _=t.length-1;_>=u;--_)t[_+1]=t[_];t[u]=f,l.setLocalFlag(c.index,8)}if(e.prototype.envKind==2){let c=assert(l.lookupLocal(Rx)),f=i.local_set(c.index,i.global_get(this.ensureEnvGlobal(),this.options.sizeTypeRef),c.type.isManaged);for(let _=t.length-1;_>=u;--_)t[_+1]=t[_];t[u]=f}return!0}makeBuiltinFieldGetter(e){let t=assert(e.getterInstance),i=this.module,s=e.type,a=s.toRef(),l=this.options.sizeTypeRef;t.set(8388608);let o=i.load(s.byteSize,s.isSignedIntegerValue,i.local_get(0,l),a,e.memoryOffset),u=this.currentFlow,c=t.flow;return this.currentFlow=c,e.is(16384)&&s.isReference&&!s.isNullableReference&&(o=this.makeRuntimeNonNullCheck(o,s,t.identifierNode)),this.currentFlow=u,i.addFunction(t.internalName,l,a,t.getNonParameterLocalTypeRefs(),o)}makeBuiltinFieldSetter(e){let t=assert(e.setterInstance),i=this.module,s=e.type,a=this.options.sizeTypeRef,l=s.toRef(),o=i.store(s.byteSize,i.local_get(0,a),i.local_get(1,l),l,e.memoryOffset);if(s.isManaged){let u=t.parent;if(assert(u.kind==7),u.type.isManaged){let c=this.program.linkInstance;this.compileFunction(c),o=i.block(null,[o,i.call(c.internalName,[i.local_get(0,a),i.local_get(1,l),i.i32(0)],P.None)],P.None)}}return t.set(8388608),i.addFunction(t.internalName,it([a,l]),P.None,null,o)}addAlignedMemorySegment(e,t=16){assert(Hr(t));let i=i64_align(this.memoryOffset,t),s=new ei(e,i);return this.memorySegments.push(s),this.memoryOffset=i64_add(i,i64_new(e.length)),s}addRuntimeMemorySegment(e){let t=this.program.computeBlockStart64(this.memoryOffset),i=new ei(e,t);return this.memorySegments.push(i),this.memoryOffset=i64_add(t,i64_new(e.length)),i}ensureStaticString(e){let t=this.ensureStaticStringPtr(e);return this.currentType=this.program.stringInstance.type,this.module.usize(t)}ensureStaticStringPtr(e){let t=this.program,i=t.totalOverhead,s=assert(t.stringInstance),a,l=this.stringSegments;if(l.has(e))a=assert(l.get(e));else{let c=e.length,f=s.createBuffer(c<<1);for(let _=0;_<c;++_)br(e.charCodeAt(_),f,i+(_<<1));a=this.addRuntimeMemorySegment(f),l.set(e,a)}let o=i64_add(a.offset,i64_new(i)),u=this.staticGcObjectOffsets;if(u.has(i64_high(o)))assert(u.get(i64_high(o))).add(i64_low(o));else{let c=new Set;c.add(i64_low(o)),u.set(i64_high(o),c)}return o}writeStaticBuffer(e,t,i,s){let a=s.length,l=i.byteSize,o=i.toRef();switch(o){case P.I32:{switch(l){case 1:{for(let u=0;u<a;++u){let c=s[u];assert(fe(c)==o),assert(re(c)==14),be(ae(c),e,t),t+=1}break}case 2:{for(let u=0;u<a;++u){let c=s[u];assert(fe(c)==o),assert(re(c)==14),br(ae(c),e,t),t+=2}break}case 4:{for(let u=0;u<a;++u){let c=s[u];assert(fe(c)==o),assert(re(c)==14),Se(ae(c),e,t),t+=4}break}default:assert(!1)}break}case P.I64:{for(let u=0;u<a;++u){let c=s[u];assert(fe(c)==o),assert(re(c)==14),Wn(i64_new(Ne(c),Ge(c)),e,t),t+=8}break}case P.F32:{for(let u=0;u<a;++u){let c=s[u];assert(fe(c)==o),assert(re(c)==14),Wr(Ce(c),e,t),t+=4}break}case P.F64:{for(let u=0;u<a;++u){let c=s[u];assert(fe(c)==o),assert(re(c)==14),Kr(Pe(c),e,t),t+=8}break}case P.V128:{for(let u=0;u<a;++u){let c=s[u];assert(fe(c)==o),assert(re(c)==14),Up(df(c),e,t),t+=16}break}case P.None:break;default:assert(!1)}return t}addStaticBuffer(e,t,i=this.program.arrayBufferInstance.id){let s=this.program,l=s.arrayBufferInstance.createBuffer(t.length*e.byteSize);return this.program.OBJECTInstance.writeField("rtId",i,l,0),this.writeStaticBuffer(l,s.totalOverhead,e,t),this.addRuntimeMemorySegment(l)}addStaticArrayHeader(e,t,i=null){let s=this.program;i||(i=assert(this.resolver.resolveClass(this.program.arrayPrototype,[e])));let a=qn(t.buffer,s.OBJECTInstance.offsetof("rtSize")),l=i32(a/e.byteSize),o=i64_add(t.offset,i64_new(s.totalOverhead)),u=i.createBuffer();return assert(i.writeField("buffer",o,u)),assert(i.writeField("dataStart",o,u)),assert(i.writeField("byteLength",a,u)),assert(i.writeField("length_",l,u)),this.addRuntimeMemorySegment(u)}ensureRuntimeFunction(e){assert(e.is(8388608)&&!e.is(134217728));let t=this.program,i=e.memorySegment;if(!i){let s=this.ensureFunctionTableIndex(e),a=assert(this.resolver.resolveClass(t.functionPrototype,[e.type]));this.assertFunctionLayout(a);let l=a.createBuffer();assert(a.writeField("_index",s,l)),assert(a.writeField("_env",0,l)),e.memorySegment=i=this.addRuntimeMemorySegment(l)}return i64_add(i.offset,i64_new(t.totalOverhead))}ensureFunctionTableIndex(e){let t=e.tableIndex;if(t)return t;this.options.importTable||this.module.ensureFunctionTable(L.DefaultTable);let i=this.functionTable,s=this.options.tableBase;s||(s=1);let a=s+i.length;return i.push(e),e.tableIndex=a,a}compileTopLevelStatement(e,t){switch(e.kind){case 55:{let i=e.members;for(let s=0,a=i.length;s<a;++s)this.compileTopLevelStatement(i[s],t);break}case 56:{let i=this.program.getElementByDeclaration(e);i&&(assert(i.kind==2),i.hasDecorator(1024)||this.compileEnum(i));break}case 63:{let i=e,s=this.program.getElementByDeclaration(i);if(s){let a=this.currentParent;this.currentParent=s;let l=i.members;for(let o=0,u=l.length;o<u;++o)this.compileTopLevelStatement(l[o],t);this.currentParent=a}break}case 51:{let i=e.declarations;for(let s=0,a=i.length;s<a;++s){let l=this.program.getElementByDeclaration(i[s]);l&&(assert(l.kind==0),!l.is(32768)&&!l.hasDecorator(1024)&&this.compileGlobal(l))}break}case 58:{let i=this.program.getElementByDeclaration(e);i&&i.kind==0&&(i.hasDecorator(1024)||this.compileGlobal(i));break}case 39:{let i=e,s=i.internalPath;s!=null&&this.compileFileByPath(s,assert(i.path));break}case 40:{this.compileTopLevelStatement(e.declaration,t);break}case 46:{let i=e;this.compileFileByPath(i.internalPath,i.path);break}case 59:case 62:case 61:case 69:case 64:break;default:{let i=this.compileStatement(e);re(i)!=22&&t.push(i);break}}}compileStatement(e){let t=this.module,i;switch(e.kind){case 34:{i=this.compileBlockStatement(e);break}case 35:{i=this.compileBreakStatement(e);break}case 36:{i=this.compileContinueStatement(e);break}case 37:{i=this.compileDoStatement(e);break}case 38:{i=this.compileEmptyStatement(e);break}case 42:{i=this.compileExpressionStatement(e);break}case 43:{i=this.compileForStatement(e);break}case 44:{i=this.compileForOfStatement(e);break}case 45:{i=this.compileIfStatement(e);break}case 47:{i=this.compileReturnStatement(e);break}case 48:{i=this.compileSwitchStatement(e);break}case 49:{i=this.compileThrowStatement(e);break}case 50:{i=this.compileTryStatement(e);break}case 51:{i=this.compileVariableStatement(e),i||(i=t.nop());break}case 52:{i=this.compileVoidStatement(e);break}case 53:{i=this.compileWhileStatement(e);break}case 64:{i=this.compileTypeDeclaration(e);break}case 54:{i=t.nop();break}default:assert(!1),i=t.unreachable()}return this.options.sourceMap&&this.addDebugLocation(i,e.range),i}compileStatements(e,t=null){let i=e.length;t||(t=new Array(i),t.length=0);let s=this.currentFlow;for(let a=0;a<i;++a){let l=this.compileStatement(e[a]);switch(re(l)){case 1:if(!As(l)){for(let o=0,u=Ts(l);o<u;++o)t.push(Ss(l,o));break}default:t.push(l);case 22:}if(s.isAny(272))break}return t}compileBlockStatement(e){let t=e.statements,i=this.currentFlow,s=i.fork();this.currentFlow=s;let a=this.compileStatements(t);return i.inherit(s),this.currentFlow=i,this.module.flatten(a)}compileTypeDeclaration(e){let t=this.currentFlow,i=e.name.text,s=t.lookupScopedTypeAlias(i);if(s)return this.errorRelated(2300,e.range,s.declaration.range,i),this.module.unreachable();let a=new lt(i,t.sourceFunction,e,0);return t.addScopedTypeAlias(i,a),this.module.nop()}compileBreakStatement(e){let t=this.module,i=e.label;if(i)return this.error(100,i.range,"Break label"),t.unreachable();let s=this.currentFlow,a=s.breakLabel;return a==null?(this.error(1105,e.range),t.unreachable()):(s.set(16),t.br(a))}compileContinueStatement(e){let t=this.module,i=e.label;if(i)return this.error(100,i.range,"Continue label"),t.unreachable();let s=this.currentFlow,a=s.continueLabel;return a==null?(this.error(1104,e.range),t.unreachable()):(s.set(288),t.br(a))}compileDoStatement(e){return this.doCompileDoStatement(e)}doCompileDoStatement(e){let t=this.module,i=this.currentFlow,s=i.targetFunction.localsByIndex.length,a=i.fork(!0),l=a.pushControlFlowLabel(),o=`do-break|${l}`;a.breakLabel=o;let u=`do-continue|${l}`;a.continueLabel=u;let c=`do-loop|${l}`;this.currentFlow=a;let f=new Array,_=e.body;_.kind==34?this.compileStatements(_.statements,f):f.push(this.compileStatement(_)),a.popControlFlowLabel(l);let d=a.isAny(4128),m=a.isAny(2064),h=!a.isAny(272);if(!h&&!d)f.push(t.unreachable()),i.inherit(a),m||i.set(256);else{let A=this.compileExpression(e.condition,p.bool),S=this.makeIsTrueish(A,this.currentType,e.condition),k=this.evaluateCondition(S);if(k!=2&&(d||h)&&i.resetIfNeedsRecompile(a.forkThen(A),s))return this.currentFlow=i,this.doCompileDoStatement(e);d&&(f[0]=t.block(u,f),f.length=1,a.unset(256)),f.push(t.br(c,S)),i.inherit(a),k==1&&!m&&i.set(256)}this.currentFlow=i;let b=t.loop(c,t.flatten(f));return m&&(b=t.block(o,[b])),i.is(256)&&(b=t.block(null,[b,t.unreachable()])),b}compileEmptyStatement(e){return this.module.nop()}compileExpressionStatement(e){return this.compileExpression(e.expression,p.void,1)}compileForStatement(e){return this.doCompileForStatement(e)}doCompileForStatement(e){let t=this.module,i=this.currentFlow,s=i.targetFunction.localsByIndex.length,a=i.fork();this.currentFlow=a;let l=new Array,o=e.initializer;o&&(assert(o.kind==42||o.kind==51),l.push(this.compileStatement(o)));let u,c,f,_=e.condition;if(_){if(u=this.compileExpression(_,p.bool),c=this.makeIsTrueish(u,this.currentType,_),f=this.evaluateCondition(c),f==2)return l.push(t.drop(c)),i.inherit(a),this.currentFlow=i,t.flatten(l)}else u=t.i32(1),c=u,f=1;let d=a.forkThen(u,!0),m=d.pushControlFlowLabel(),h=`for-break${m}`;d.breakLabel=h;let b=`for-continue|${m}`;d.continueLabel=b;let A=`for-loop|${m}`;this.currentFlow=d;let S=new Array,k=e.body;k.kind==34?this.compileStatements(k.statements,S):S.push(this.compileStatement(k)),d.popControlFlowLabel(m),d.breakLabel=null,d.continueLabel=null;let w=!d.isAny(272),R=d.isAny(4128),C=d.isAny(2064);R&&(S[0]=t.block(b,S),S.length=1),f==1?a.inherit(d):a.mergeBranch(d);let M=R||w;if(M){let D=e.incrementor;if(D&&(this.currentFlow=a,S.push(this.compileExpression(D,p.void,9))),S.push(t.br(A)),i.resetIfNeedsRecompile(d.forkThen(u),s))return this.currentFlow=i,this.doCompileForStatement(e)}i.inherit(a),this.currentFlow=i;let O=t.if(c,t.flatten(S));return M&&(O=t.loop(A,O)),C&&(O=t.block(h,[O])),l.push(O),i.is(256)&&l.push(t.unreachable()),t.flatten(l)}compileForOfStatement(e){return this.error(100,e.range,"Iterators"),this.module.unreachable()}compileIfStatement(e){let t=this.module,i=e.ifTrue,s=e.ifFalse,a=this.compileExpression(e.condition,p.bool),l=this.makeIsTrueish(a,this.currentType,e.condition);switch(this.evaluateCondition(l)){case 1:return t.block(null,[t.drop(l),this.compileStatement(i)]);case 2:return s?t.block(null,[t.drop(l),this.compileStatement(s)]):t.drop(l)}let u=this.currentFlow,c=new Array,f=u.forkThen(a);this.currentFlow=f,i.kind==34?this.compileStatements(i.statements,c):c.push(this.compileStatement(i)),this.currentFlow=u;let _=u.forkElse(a);if(s){this.currentFlow=_;let d=new Array;return s.kind==34?this.compileStatements(s.statements,d):d.push(this.compileStatement(s)),u.inheritAlternatives(f,_),this.currentFlow=u,t.if(l,t.flatten(c),t.flatten(d))}else return f.isAny(272)?(u.inherit(_),u.mergeSideEffects(f)):u.inheritAlternatives(f,_),this.currentFlow=u,t.if(l,t.flatten(c))}compileReturnStatement(e){let t=this.module,i=0,s=this.currentFlow,a=s.returnType,l=e.value;if(l){if(this.isInlineStructType(a))return this.compileSretReturnStatement(e,a);if(this.isValueFormFixedArray(a))return this.compileMultivalueReturnStatement(e,a);let o=1;s.sourceFunction.is(1048576)&&(o|=4),i=this.compileExpression(l,a,o),s.canOverflow(i,a)||s.set(2),s.isNonnull(i,a)&&s.set(4),s.sourceFunction.is(524288)&&l.kind!=26&&s.set(16384)}else if(a!=p.void)return this.error(2322,e.range,"void",a.toString()),this.currentType=a,t.unreachable();if(s.set(257),s.isInline){let o=assert(s.inlineReturnLabel);return i?this.currentType==p.void?t.block(null,[i,t.br(o)]):t.br(o,0,i):t.br(o)}return i?this.currentType==p.void?t.block(null,[i,t.return()]):t.return(i):t.return()}compileSwitchStatement(e){let t=this.module,i=e.cases,s=i.length,a=this.compileExpression(e.condition,p.auto),l=this.currentType;if(!s)return t.drop(a);let o=this.currentFlow,c=o.getTempLocal(l).index,f=new Array(1+s);f[0]=t.local_set(c,a,l.isManaged);let _=1,d=-1,m=o.pushControlFlowLabel();for(let S=0;S<s;++S){let k=i[S];if(k.isDefault){d=S;continue}let w=e.condition,R=t.local_get(c,l.toRef()),C=l,M=k.label,O=this.compileExpression(assert(k.label),l,1),D=this.currentType,Q=this.compileCommutativeCompareBinaryExpressionFromParts(77,w,R,C,M,O,D,l,e);f[_++]=t.br(`case${S}|${m}`,Q)}f[_]=t.br(d>=0?`case${d}|${m}`:`break|${m}`);let h=t.block(`case0|${m}`,f,P.None),b=null,A=null;for(let S=0;S<s;++S){let w=i[S].statements,R=w.length,C=o.fork(!0,!1);b&&C.mergeBranch(b),this.currentFlow=C;let M=`break|${m}`;C.breakLabel=M;let O=S==s-1,D=O?M:`case${S+1}|${m}`,Q=new Array(1+R);Q[0]=h;let H=1,U=!0;for(let Y=0;Y<R;++Y){let q=this.compileStatement(w[Y]);if(re(q)!=22&&(Q[H++]=q),C.isAny(272)){U=!1;break}}Q.length=H,b=U?C:null;let V=C.isAny(2064);C.unset(2064),V||O&&U?A?A.inheritAlternatives(A,C):A=C:U||o.mergeSideEffects(C),this.currentFlow=o,h=t.block(D,Q,P.None)}return o.popControlFlowLabel(m),d>=0?A?o.inherit(A):o.set(256):A&&o.mergeBranch(A),this.currentFlow=o,h}compileThrowStatement(e){this.currentFlow.set(264);let i=new Array,s=e.value,a=null;if(s.kind==19){let l=s.args;l.length&&(a=l[0])}return i.push(this.makeAbort(a,e)),this.module.flatten(i)}compileTryStatement(e){return this.error(100,e.range,"Exceptions"),this.module.unreachable()}compileLazyLocal(e,t,i,s){let a=this.module,l=this.resolver,o=e.name.text,u=i.expression,c=null;if(t){if(c=l.resolveType(t,s,s.sourceFunction,me(s.contextualTypeArguments)),!c)return 0;this.program.checkTypeSupported(c,t)}else{if(c=l.resolveExpression(u,s,p.auto,0),!c)return 0;if(c==p.void)return this.error(2322,e.range,c.toString(),"<auto>"),0}if(this.inlineStructFieldsOf(c)!=null)return this.error(100,e.range,"a '@lazy' binding of an @inline struct value"),0;if(s.getScopedLocal(o)!=null)return this.error(2300,e.name.range,o),0;let f=s.addScopedLocal(o,c),_=s.targetFunction.addLocal(p.bool,o+"$lazyDone",null);s.unsetLocalFlag(_.index,-1),s.setLocalFlag(f.index,8),c.isShortIntegerValue&&(s.unsetLocalFlag(f.index,-1),s.setLocalFlag(f.index,10));let d=this.lazyLocals;return d==null&&(d=new Map,this.lazyLocals=d),d.set(f,new b_(f.index,_.index,u)),a.local_set(_.index,a.i32(0),!1)}compileVariableStatement(e){let t=this.module,i=e.declarations,s=i.length,a=this.currentFlow,l=new Array,o=this.resolver;for(let u=0;u<s;++u){let c=i[u],f=c.name.text,_=null,d=0,m=null;c.is(16384)&&this.warning(239,c.name.range);{let k=a.lookupLocal(f);k!=null&&k.isDynamicLength&&this.error(100,c.name.range,"`"+f+"` is bound from the array header; it cannot be shadowed")}let h=c.type,b=c.initializer;if(b!=null&&b.kind==32){let k=this.compileLazyLocal(c,h,b,a);k!=0&&l.push(k);continue}if(h){if(_=o.resolveType(h,a,a.sourceFunction,me(a.contextualTypeArguments)),!_)continue;this.program.checkTypeSupported(_,h);let k=this.inlineStructFieldsOf(_);if(k!=null){this.compileSroaLocal(c,_,k,b,a,l);continue}if(this.isValueFormFixedArray(_)){this.compileSroaValueArrayLocal(c,_,b,a,l);continue}if(b){let w=this.pendingElements,R=a.addScopedDummyLocal(f,_,e);w.add(R),d=this.compileExpression(b,_,1),m=this.currentType,w.delete(R),a.freeScopedDummyLocal(f)}}else if(b){if(b.kind==8){let R=a.lookupLocal(b.text);if(R!=null&&R.fieldLocals!=null){let C=assert(this.inlineStructFieldsOf(R.type));this.compileSroaLocal(c,R.type,C,b,a,l);continue}}let k=this.pendingElements,w=a.addScopedDummyLocal(f,p.auto,e);if(k.add(w),d=this.compileExpression(b,p.auto),m=this.currentType,k.delete(w),a.freeScopedDummyLocal(f),this.currentType==p.void){this.error(2322,c.range,this.currentType.toString(),"<auto>");continue}_=m}else{this.error(1110,c.name.range.atEnd);continue}let A=c.is(8),S=!1;if(A)if(d){let k=t.runExpression(d,1);if(k){d=k;let w=null;switch(fe(d)){case P.I32:{w=new pe(f,-1,_,a.targetFunction),w.setConstantIntegerValue(i64_new(ae(d),0),_);break}case P.I64:{w=new pe(f,-1,_,a.targetFunction),w.setConstantIntegerValue(i64_new(Ne(d),Ge(d)),_);break}case P.F32:{w=new pe(f,-1,_,a.targetFunction),w.setConstantFloatValue(Ce(d),_);break}case P.F64:{w=new pe(f,-1,_,a.targetFunction),w.setConstantFloatValue(Pe(d),_);break}}if(w){let R=a.scopedLocals;if(!R)a.scopedLocals=R=new Map;else if(R.has(f)){let C=assert(R.get(f));return this.errorRelated(2300,c.name.range,C.declaration.name.range,f),this.module.unreachable()}R.set(f,w),S=!0}}}else this.error(1155,c.range);if(!S){let k=this.inlineStructFieldsOf(_);if(k!=null){this.compileSroaLocal(c,_,k,b,a,l);continue}if(this.isValueFormFixedArray(_)){this.compileSroaValueArrayLocal(c,_,b,a,l);continue}if(!this.checkFixedArrayStoragePosition(_,c.name,"a local"))continue;let w;if(c.isAny(24)||a.isInline){let R=a.getScopedLocal(f);R?(R.declaration.range.source.isNative?this.error(2300,c.name.range,f):this.errorRelated(2300,c.name.range,R.declaration.name.range,f),w=R):w=a.addScopedLocal(f,_),A&&a.setLocalFlag(w.index,1)}else{let R=a.lookupLocal(f);if(R){this.errorRelated(2300,c.name.range,R.declaration.name.range,f);continue}w=a.targetFunction.addLocal(_,f,c),a.unsetLocalFlag(w.index,-1),A&&a.setLocalFlag(w.index,1)}if(d){l.push(this.makeLocalAssignment(w,d,m||_,!1));let R=this.dynamicArrayTypeNodeOf(c);if(R!=null){let C=R.lengthName.text;if(a.lookupLocal(C)!=null)this.error(2300,R.lengthName.range,C);else{let O=a.targetFunction.addLocal(p.i32,C,c);O.isDynamicLength=!0,a.setLocalFlag(O.index,8),l.push(t.local_set(O.index,t.load(4,!1,t.local_get(w.index,_.toRef()),P.I32,0,4),!1))}}}else w.type.isShortIntegerValue&&a.setLocalFlag(w.index,2)}}return this.currentType=p.void,l.length==0?0:t.flatten(l)}compileVoidStatement(e){return this.compileExpression(e.expression,p.void,10)}compileWhileStatement(e){return this.doCompileWhileStatement(e)}doCompileWhileStatement(e){let t=this.module,i=this.currentFlow,s=i.targetFunction.localsByIndex.length,a=this.compileExpression(e.condition,p.bool),l=this.makeIsTrueish(a,this.currentType,e.condition),o=this.evaluateCondition(l);if(o==2)return t.drop(l);let u=i.forkThen(a,!0),c=u.pushControlFlowLabel(),f=`while-break|${c}`;u.breakLabel=f;let _=`while-continue|${c}`;u.continueLabel=_,this.currentFlow=u;let d=new Array,m=e.body;m.kind==34?this.compileStatements(m.statements,d):d.push(this.compileStatement(m)),d.push(t.br(_)),u.popControlFlowLabel(c);let h=u.isAny(4128),b=u.isAny(2064),A=!u.isAny(272);if((h||A)&&i.resetIfNeedsRecompile(u,s))return this.currentFlow=i,this.doCompileWhileStatement(e);let k=!1;if(o==1)i.inherit(u),b||(k=!0,i.set(256));else{let R=i.forkElse(a);!A&&!b?(i.inherit(R),i.mergeSideEffects(u)):i.inheritAlternatives(u,R)}this.currentFlow=i;let w=[t.loop(_,t.if(l,t.flatten(d)))];return k&&w.push(t.unreachable()),t.block(f,w)}compileInlineConstant(e,t,i){assert(e.is(37748736));let s=e.type;switch(this.currentType=s,s.kind){case 0:return this.module.i32(e.constantValueKind==1?i64_ne(e.constantIntegerValue,i64_zero):0);case 1:case 2:{let a=s.computeSmallIntegerShift(p.i32);return this.module.i32(e.constantValueKind==1?i64_low(e.constantIntegerValue)<<a>>a:0)}case 6:case 7:{let a=e.type.computeSmallIntegerMask(p.i32);return this.module.i32(e.constantValueKind==1?i64_low(e.constantIntegerValue)&a:0)}case 3:case 8:return this.module.i32(e.constantValueKind==1?i64_low(e.constantIntegerValue):0);case 5:case 10:if(!e.program.options.isWasm64)return this.module.i32(e.constantValueKind==1?i64_low(e.constantIntegerValue):0);case 4:case 9:return e.constantValueKind==1?this.module.i64(i64_low(e.constantIntegerValue),i64_high(e.constantIntegerValue)):this.module.i64(0);case 12:{if(!(e.hasDecorator(512)&&t==p.f32))return this.module.f64(e.constantFloatValue);this.currentType=p.f32}case 11:return this.module.f32(e.constantFloatValue);default:return assert(!1),this.module.unreachable()}}compileExpression(e,t,i=0){for(;e.kind==22;)e=e.expression;this.currentType=t,t==p.void&&(i|=8);let s;switch(e.kind){case 9:{s=this.compileAssertionExpression(e,t,i);break}case 10:{s=this.compileBinaryExpression(e,t,i);break}case 11:{s=this.compileCallExpression(e,t,i);break}case 13:{s=this.compileCommaExpression(e,t,i);break}case 14:{s=this.compileElementAccessExpression(e,t,i);break}case 16:{s=this.compileFunctionExpression(e,t,i);break}case 8:case 15:case 20:case 26:case 25:case 27:{s=this.compileIdentifierExpression(e,t,i);break}case 17:{s=this.compileInstanceOfExpression(e,t,i);break}case 18:{s=this.compileLiteralExpression(e,t,i);break}case 19:{s=this.compileNewExpression(e,t,i);break}case 23:{s=this.compilePropertyAccessExpression(e,t,i);break}case 24:{s=this.compileTernaryExpression(e,t,i);break}case 29:{s=this.compileUnaryPostfixExpression(e,t,i);break}case 30:{s=this.compileUnaryPrefixExpression(e,t,i);break}case 31:{s=this.compileLoweredAwaitExpression(e);break}case 32:{let o=e;this.warning(6398,o.range),s=this.compileExpression(o.expression,t,i);break}case 33:{let o=e;s=o.expr,this.currentType=o.type;break}case 12:{this.error(100,e.range,"Block-scoped class declarations or expressions"),s=this.module.unreachable();break}default:assert(!1),s=this.module.unreachable()}let a=this.currentType,l=(i&4)!=0;return a!=t.nonNullableType&&(i&2?(s=this.convertExpression(s,a,t,!0,e),this.currentType=a=t):i&1&&(s=this.convertExpression(s,a,t,!1,e),this.currentType=a=t)),l&&(s=this.ensureSmallIntegerWrap(s,a)),this.options.sourceMap&&this.addDebugLocation(s,e.range),s}convertExpression(e,t,i,s,a){let l=this.module;if(t.kind==26)return i.kind==26?e:(this.error(2322,a.range,t.toString(),i.toString()),l.unreachable());if(i.kind==26)return l.drop(e);if(t.isReference||i.isReference)return this.currentFlow.isNonnull(e,t)?t=t.nonNullableType:s&&t.isNullableReference&&!i.isNullableReference&&(this.options.noAssert||(e=this.makeRuntimeNonNullCheck(e,t,a)),t=t.nonNullableType),t.isAssignableTo(i)?(assert(i.isExternalReference||t.kind==i.kind),this.currentType=i,e):s&&i.nonNullableType.isAssignableTo(t)?i.isExternalReference?(this.error(100,a.range,"ref.cast"),this.currentType=i,l.unreachable()):(assert(t.kind==i.kind),this.options.noAssert||(e=this.makeRuntimeDowncastCheck(e,t,i,a)),this.currentType=i,e):(this.error(2322,a.range,t.toString(),i.toString()),this.currentType=i,l.unreachable());if(assert(!t.isReference&&!i.isReference),i.kind==t.kind)return(i.kind==14||i.kind==27)&&!i.equals(t)?(this.error(2322,a.range,t.toString(),i.toString()),this.currentType=i,l.unreachable()):(this.currentType=i,e);if(!i.isBooleanValue&&(i.isVectorValue||t.isVectorValue))return this.error(2322,a.range,t.toString(),i.toString()),l.unreachable();if(t.isAssignableTo(i)||s||this.error(200,a.range,t.toString(),i.toString()),t.isFloatValue)if(i.isFloatValue)t.kind==11?i.kind==12&&(e=l.unary(43,e)):i.kind==11&&(e=l.unary(44,e));else if(i.isIntegerValue)if(t.kind==11)if(i.isBooleanValue)e=this.makeIsTrueish(e,p.f32,a);else if(i.isSignedIntegerValue){let o=this.options.hasFeature(4);i.isLongIntegerValue?e=l.unary(o?56:26,e):e=l.unary(o?52:25,e)}else{let o=this.options.hasFeature(4);i.isLongIntegerValue?e=l.unary(o?57:28,e):e=l.unary(o?53:27,e)}else if(i.isBooleanValue)e=this.makeIsTrueish(e,p.f64,a);else if(i.isSignedIntegerValue){let o=this.options.hasFeature(4);i.isLongIntegerValue?e=l.unary(o?58:30,e):e=l.unary(o?54:29,e)}else{let o=this.options.hasFeature(4);i.isLongIntegerValue?e=l.unary(o?59:32,e):e=l.unary(o?55:31,e)}else assert(i.flags==0,"void type expected"),e=l.drop(e);else if(t.isIntegerValue&&i.isFloatValue){e=this.ensureSmallIntegerWrap(e,t);let o;i.kind==11?t.isLongIntegerValue?t.isSignedIntegerValue?o=39:o=41:t.isSignedIntegerValue?o=35:o=37:t.isLongIntegerValue?t.isSignedIntegerValue?o=40:o=42:t.isSignedIntegerValue?o=36:o=38,e=l.unary(o,e)}else t==p.v128&&i.isBooleanValue?e=this.makeIsTrueish(e,p.v128,a):t.isLongIntegerValue?i.isBooleanValue?e=l.binary(41,e,l.i64(0)):i.isLongIntegerValue||(e=l.unary(24,e)):i.isLongIntegerValue?e=l.unary(t.isSignedIntegerValue?22:23,this.ensureSmallIntegerWrap(e,t)):t.isShortIntegerValue?t.size<i.size&&(e=this.ensureSmallIntegerWrap(e,t)):!s&&!this.options.isWasm64&&t.isVaryingIntegerValue&&!i.isVaryingIntegerValue&&this.warning(201,a.range,t.toString(),i.toString());return this.currentType=i,e}compileAssertionExpression(e,t,i){let s=i&-4;switch(e.assertionKind){case 0:case 1:{let a=this.currentFlow,l=this.resolver.resolveType(assert(e.toType),a,a.sourceFunction,me(a.contextualTypeArguments));return l?this.compileExpression(e.expression,l,s|2):this.module.unreachable()}case 2:{assert(!e.toType);let a=this.compileExpression(e.expression,t.exceptVoid,s),l=this.currentType;return this.currentFlow.isNonnull(a,l)?this.info(210,e.expression.range):this.options.noAssert||(a=this.makeRuntimeNonNullCheck(a,l,e)),this.currentType=l.nonNullableType,a}case 3:return this.error(100,e.range,"Const assertion"),this.module.unreachable();default:assert(!1)}return this.module.unreachable()}compileCommutativeCompareBinaryExpression(e,t){let i=e.left,s=this.compileExpression(i,t),a=this.currentType,l=e.right,o=this.compileExpression(l,a),u=this.currentType;return this.compileCommutativeCompareBinaryExpressionFromParts(e.operator,i,s,a,l,o,u,t,e)}compileCommutativeCompareBinaryExpressionFromParts(e,t,i,s,a,l,o,u,c){let f=this.module,_=Be(e),d=Me.fromBinaryToken(e),m=s.lookupOverload(d,this.program),h=o.lookupOverload(d,this.program);if(m&&h&&m!=h)return this.error(240,c.range,_,m.internalName,h.internalName),this.currentType=u,f.unreachable();if(m)return this.compileCommutativeBinaryOverload(m,t,i,s,a,l,o,c);if(h)return this.compileCommutativeBinaryOverload(h,a,l,o,t,i,s,c);let A=p.commonType(s,o,u,!1);if(!A)return this.error(2365,c.range,_,s.toString(),o.toString()),this.currentType=u,f.unreachable();switch(A.isFloatValue&&((Go(f,l)||Go(f,i))&&this.warning(907,c.range),(Do(l)||Do(i))&&this.warning(908,c.range)),i=this.convertExpression(i,s,A,!1,t),s=A,l=this.convertExpression(l,o,A,!1,a),o=A,this.currentType=p.bool,e){case 79:case 77:return this.makeEq(i,l,A,c);case 80:case 78:return this.makeNe(i,l,A,c);default:return assert(!1),f.unreachable()}}compileNonCommutativeCompareBinaryExpression(e,t){let i=this.module,s=e.left,a=e.right,l,o,u,c,f,_=e.operator,d=Be(_);l=this.compileExpression(s,t),o=this.currentType;let m=Me.fromBinaryToken(_),h=o.lookupOverload(m,this.program);if(h)return this.compileBinaryOverload(h,s,l,o,a,e);if(u=this.compileExpression(a,o),c=this.currentType,f=p.commonType(o,c,t,!0),!f||!f.isNumericValue)return this.error(2365,e.range,d,o.toString(),c.toString()),this.currentType=t,i.unreachable();switch(l=this.convertExpression(l,o,f,!1,s),o=f,u=this.convertExpression(u,c,f,!1,a),c=f,this.currentType=p.bool,_){case 73:return this.makeLt(l,u,f);case 74:return this.makeGt(l,u,f);case 75:return this.makeLe(l,u,f);case 76:return this.makeGe(l,u,f);default:return assert(!1),i.unreachable()}}compileBinaryExpression(e,t,i){let s=this.module,a=e.left,l=e.right,o,u,c,f,_,d,m=!1;switch(e.operator){case 73:case 74:case 75:case 76:return this.compileNonCommutativeCompareBinaryExpression(e,t);case 79:case 77:case 80:case 78:return this.compileCommutativeCompareBinaryExpression(e,t);case 102:return this.compileAssignment(a,l,t);case 103:m=!0;case 82:{o=this.compileExpression(a,t),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(5);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isNumericValue)return this.error(2469,e.range,"+",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isNumericValue)return this.error(2365,e.range,"+",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makeAdd(o,c,_);break}case 104:m=!0;case 83:{o=this.compileExpression(a,t),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(6);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isNumericValue)return this.error(2469,e.range,"-",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isNumericValue)return this.error(2365,e.range,"-",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makeSub(o,c,_);break}case 105:m=!0;case 85:{o=this.compileExpression(a,t),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(7);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isNumericValue)return this.error(2469,e.range,"*",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isNumericValue)return this.error(2365,e.range,"*",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makeMul(o,c,_);break}case 106:m=!0;case 84:{o=this.compileExpression(a,t),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(10);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isNumericValue)return this.error(2469,e.range,"**",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isNumericValue)return this.error(2365,e.range,"**",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makePow(o,c,_,e);break}case 107:m=!0;case 86:{o=this.compileExpression(a,t),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(8);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isNumericValue)return this.error(2469,e.range,"/",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isNumericValue)return this.error(2365,e.range,"/",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makeDiv(o,c,_);break}case 108:m=!0;case 87:{o=this.compileExpression(a,t),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(9);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isNumericValue)return this.error(2469,e.range,"%",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isNumericValue)return this.error(2365,e.range,"%",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makeRem(o,c,_,e);break}case 109:m=!0;case 90:{o=this.compileExpression(a,t.intType),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(14);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(!u.isIntegerValue)return this.error(2469,e.range,"<<",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=this.currentType,d=this.makeShl(o,c,f);break}case 110:m=!0;case 91:{o=this.compileExpression(a,t.intType),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(15);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(!u.isIntegerValue)return this.error(2469,e.range,">>",u.toString()),this.module.unreachable();c=this.compileExpression(l,u,1),f=this.currentType,d=this.makeShr(o,c,f);break}case 111:m=!0;case 92:{o=this.compileExpression(a,t.intType),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(16);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(!u.isIntegerValue)return this.error(2469,e.range,">>>",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=this.currentType,d=this.makeShru(o,c,f);break}case 112:m=!0;case 93:{o=this.compileExpression(a,t.intType),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(11);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isIntegerValue)return this.error(2469,e.range,"&",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isIntegerValue)return this.error(2365,e.range,"&",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makeAnd(o,c,_);break}case 113:m=!0;case 94:{o=this.compileExpression(a,t.intType),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(12);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isIntegerValue)return this.error(2469,e.range,"|",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isIntegerValue)return this.error(2365,e.range,"|",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makeOr(o,c,_);break}case 114:m=!0;case 95:{o=this.compileExpression(a,t.intType),u=this.currentType;let k=u.getClassOrWrapper(this.program);if(k){let w=k.lookupOverload(13);if(w){d=this.compileBinaryOverload(w,a,o,u,l,e);break}}if(m){if(!u.isIntegerValue)return this.error(2469,e.range,"^",u.toString()),s.unreachable();c=this.compileExpression(l,u,1),f=_=this.currentType}else{if(c=this.compileExpression(l,u),f=this.currentType,_=p.commonType(u,f,t),!_||!_.isIntegerValue)return this.error(2365,e.range,"^",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_,c=this.convertExpression(c,f,_,!1,l),f=_}d=this.makeXor(o,c,_);break}case 98:{let k=this.currentFlow,w=i&4;o=this.compileExpression(a,t.exceptVoid,w),u=this.currentType;let R=k.forkThen(o);if(this.currentFlow=R,t==p.bool||t==p.void){o=this.makeIsTrueish(o,u,a);let C=this.evaluateCondition(o);C==2?d=o:(c=this.compileExpression(l,u,w),f=this.currentType,c=this.makeIsTrueish(c,f,l),C==1?(d=c,k.inherit(R)):(d=s.if(o,c,s.i32(0)),k.mergeBranch(R),k.noteThen(d,R))),this.currentFlow=k,this.currentType=p.bool}else{if(c=this.compileExpression(l,u,w),f=this.currentType,_=p.commonType(u,f,t),!_)return this.error(2365,e.range,"&&",u.toString(),f.toString()),this.currentType=t,s.unreachable();o=this.convertExpression(o,u,_,!1,a),u=_;let C=s.runExpression(o,1);C&&(o=C),c=this.convertExpression(c,f,_,!1,l),f=_;let M=this.makeIsTrueish(o,this.currentType,a),O=this.evaluateCondition(M);if(O!=0)d=O==1?c:o;else if(d=s.tryCopyTrivialExpression(o))d=s.if(M,c,d);else{let D=k.getTempLocal(u);k.canOverflow(o,u)||k.setLocalFlag(D.index,2),k.isNonnull(o,u)&&k.setLocalFlag(D.index,4),d=s.if(this.makeIsTrueish(s.local_tee(D.index,o,u.isManaged),u,a),c,s.local_get(D.index,u.toRef()))}k.mergeBranch(R),k.noteThen(d,R),this.currentFlow=k,this.currentType=_}break}case 99:{let k=this.currentFlow,w=i&4;o=this.compileExpression(a,t.exceptVoid,w),u=this.currentType;let R=k.forkElse(o);if(this.currentFlow=R,t==p.bool||t==p.void){o=this.makeIsTrueish(o,u,a);let C=this.evaluateCondition(o);C==1?d=o:(c=this.compileExpression(l,u,w),f=this.currentType,c=this.makeIsTrueish(c,f,l),C==2?(d=c,k.inherit(R)):(d=s.if(o,s.i32(1),c),k.mergeBranch(R),k.noteElse(d,R))),this.currentFlow=k,this.currentType=p.bool}else{if(c=this.compileExpression(l,u,w),f=this.currentType,_=p.commonType(u,f,t),!_)return this.error(2365,e.range,"||",u.toString(),f.toString()),this.currentType=t,s.unreachable();let C=u.is(512)&&f.is(512);o=this.convertExpression(o,u,_,!1,a),u=_;let M=s.runExpression(o,1);M&&(o=M),c=this.convertExpression(c,f,_,!1,l),f=_;let O=this.makeIsTrueish(o,this.currentType,a),D=this.evaluateCondition(O);if(D!=0)d=D==1?o:c;else if(d=s.tryCopyTrivialExpression(o))d=s.if(O,d,c);else{let H=k.getTempLocal(u).index;k.canOverflow(o,u)||k.setLocalFlag(H,2),k.isNonnull(o,u)&&k.setLocalFlag(H,4),d=s.if(this.makeIsTrueish(s.local_tee(H,o,u.isManaged),u,a),s.local_get(H,u.toRef()),c)}k.mergeBranch(R),k.noteElse(d,R),this.currentFlow=k,this.currentType=C?_:_.nonNullableType}break}case 29:return this.error(100,e.range,"'in' operator"),this.currentType=p.bool,s.unreachable();default:{assert(!1),d=this.module.unreachable();break}}if(!m)return d;let b=this.resolver;if(a.kind==14){let k=a,w=b.resolveExpression(k.expression,this.currentFlow);if(w&&w.kind==14)return this.compileFixedArrayElementAccess(k,w,!0,t,0,null,d);if(w&&w.kind==27)return this.compileUnmanagedArrayElementAccess(k,w,!0,t,0,null,d);if(w&&w.kind==28)return this.compileDynamicArrayElementAccess(k,w,!0,t,0,null,d);if(w&&this.isManagedDynamicArrayType(w))return this.compileDynamicArrayElementAccess(k,w,!0,t,0,null,d)}let A=b.lookupExpression(a,this.currentFlow);if(!A)return s.unreachable();let S=b.getTypeOfElement(A);return S||(S=p.void),this.currentType.isStrictlyAssignableTo(S)?this.makeAssignment(A,d,this.currentType,l,b.currentThisExpression,b.currentElementExpression,t!=p.void):(this.error(2322,e.range,this.currentType.toString(),S.toString()),s.unreachable())}makeLt(e,t,i){let s=this.module;switch(i.kind){case 1:case 2:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:return s.binary(17,e,t);case 4:return s.binary(42,e,t);case 5:return s.binary(234,e,t);case 0:case 6:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 8:return s.binary(18,e,t);case 9:return s.binary(43,e,t);case 10:return s.binary(235,e,t);case 11:return s.binary(59,e,t);case 12:return s.binary(72,e,t)}return assert(!1),s.unreachable()}makeGt(e,t,i){let s=this.module;switch(i.kind){case 1:case 2:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:return s.binary(21,e,t);case 4:return s.binary(46,e,t);case 5:return s.binary(238,e,t);case 0:case 6:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 8:return s.binary(22,e,t);case 9:return s.binary(47,e,t);case 10:return s.binary(239,e,t);case 11:return s.binary(61,e,t);case 12:return s.binary(74,e,t)}return assert(!1),s.unreachable()}makeLe(e,t,i){let s=this.module;switch(i.kind){case 1:case 2:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:return s.binary(19,e,t);case 4:return s.binary(44,e,t);case 5:return s.binary(236,e,t);case 0:case 6:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 8:return s.binary(20,e,t);case 9:return s.binary(45,e,t);case 10:return s.binary(237,e,t);case 11:return s.binary(60,e,t);case 12:return s.binary(73,e,t)}return assert(!1),s.unreachable()}makeGe(e,t,i){let s=this.module;switch(i.kind){case 1:case 2:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:return s.binary(23,e,t);case 4:return s.binary(48,e,t);case 5:return s.binary(240,e,t);case 0:case 6:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 8:return s.binary(24,e,t);case 9:return s.binary(49,e,t);case 10:return s.binary(241,e,t);case 11:return s.binary(62,e,t);case 12:return s.binary(75,e,t)}return assert(!1),s.unreachable()}makeEq(e,t,i,s){let a=this.module;switch(i.kind){case 0:case 1:case 2:case 6:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:case 8:return a.binary(15,e,t);case 4:case 9:return a.binary(40,e,t);case 5:case 10:return a.binary(232,e,t);case 11:return a.binary(57,e,t);case 12:return a.binary(70,e,t);case 13:return a.unary(70,a.binary(76,e,t));case 18:case 19:case 20:case 21:return a.ref_eq(e,t);case 22:return a.string_eq(e,t);case 23:case 24:case 25:case 16:case 15:case 17:return this.error(203,s.range,"ref.eq",i.toString()),a.unreachable()}return assert(!1),a.unreachable()}makeNe(e,t,i,s){let a=this.module;switch(i.kind){case 0:case 1:case 2:case 6:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:case 8:return a.binary(16,e,t);case 4:case 9:return a.binary(41,e,t);case 5:case 10:return a.binary(233,e,t);case 11:return a.binary(58,e,t);case 12:return a.binary(71,e,t);case 13:return a.unary(67,a.binary(77,e,t));case 18:case 19:case 20:case 21:return a.unary(20,a.ref_eq(e,t));case 22:return a.unary(20,a.string_eq(e,t));case 23:case 24:case 25:case 16:case 15:case 17:return this.error(203,s.range,"ref.eq",i.toString()),a.unreachable()}return assert(!1),a.unreachable()}makeAdd(e,t,i){let s=this.module;switch(i.kind){case 0:case 1:case 2:case 6:case 7:case 3:case 8:return s.binary(0,e,t);case 4:case 9:return s.binary(25,e,t);case 5:case 10:return s.binary(217,e,t);case 11:return s.binary(50,e,t);case 12:return s.binary(63,e,t)}return assert(!1),s.unreachable()}makeSub(e,t,i){let s=this.module;switch(i.kind){case 0:case 1:case 2:case 6:case 7:case 3:case 8:return s.binary(1,e,t);case 4:case 9:return s.binary(26,e,t);case 5:case 10:return s.binary(218,e,t);case 11:return s.binary(51,e,t);case 12:return s.binary(64,e,t)}return assert(!1),s.unreachable()}makeMul(e,t,i){let s=this.module;switch(i.kind){case 0:case 1:case 2:case 6:case 7:case 3:case 8:return s.binary(2,e,t);case 4:case 9:return s.binary(27,e,t);case 5:case 10:return s.binary(219,e,t);case 11:return s.binary(52,e,t);case 12:return s.binary(65,e,t)}return assert(!1),s.unreachable()}makePow(e,t,i,s){let a=this.module;switch(i.kind){case 0:return a.select(a.i32(1),a.binary(15,t,a.i32(0)),e);case 1:case 6:case 2:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:case 8:{if(this.options.willOptimize&&re(e)==14&&re(t)==14){let u=ae(e),c=ae(t);return this.currentType=i,a.i32(i64_low(i64_pow(i64_new(u),i64_new(c))))}let l=this.i32PowInstance;if(!l){let u=this.program.lookup(L.ipow32);if(!u)return this.error(2304,s.range,"ipow32"),a.unreachable();assert(u.kind==4),this.i32PowInstance=l=this.resolver.resolveFunction(u,null)}if(!l||!this.compileFunction(l))return a.unreachable();let o=this.makeCallDirect(l,[e,t],s);return i.size<32&&(o=this.ensureSmallIntegerWrap(o,i)),o}case 4:case 9:{if(this.options.willOptimize&&re(e)==14&&re(t)==14){let o=i64_new(Ne(e),Ge(e)),u=i64_new(Ne(t),Ge(t)),c=i64_pow(o,u);return this.currentType=i,a.i64(i64_low(c),i64_high(c))}let l=this.i64PowInstance;if(!l){let o=this.program.lookup(L.ipow64);if(!o)return this.error(2304,s.range,"ipow64"),a.unreachable();assert(o.kind==4),this.i64PowInstance=l=this.resolver.resolveFunction(o,null)}return!l||!this.compileFunction(l)?a.unreachable():this.makeCallDirect(l,[e,t],s)}case 5:case 10:{let l=this.options.isWasm64;if(this.options.willOptimize&&re(e)==14&&re(t)==14)if(l){let u=i64_new(Ne(e),Ge(e)),c=i64_new(Ne(t),Ge(t)),f=i64_pow(u,c);return this.currentType=i,a.i64(i64_low(f),i64_high(f))}else{let u=ae(e),c=ae(t);return this.currentType=i,a.i32(i64_low(i64_pow(i64_new(u),i64_new(c))))}let o=l?this.i64PowInstance:this.i32PowInstance;if(!o){let u=this.program.lookup(l?L.ipow64:L.ipow32);if(!u)return this.error(2304,s.range,l?"ipow64":"ipow32"),a.unreachable();assert(u.kind==4),o=this.resolver.resolveFunction(u,null),l?this.i64PowInstance=o:this.i32PowInstance=o}return!o||!this.compileFunction(o)?a.unreachable():this.makeCallDirect(o,[e,t],s)}case 11:{if(this.options.willOptimize&&re(e)==14&&re(t)==14){let o=Ce(e),u=Ce(t);return this.currentType=i,a.f32(f32(ol(o,u)))}let l=this.f32PowInstance;if(!l){let o=this.program.lookup(L.Mathf);if(!o)return this.error(2304,s.range,"Mathf"),a.unreachable();let u=o.getMember(L.pow);if(!u)return this.error(2304,s.range,"Mathf.pow"),a.unreachable();assert(u.kind==4),this.f32PowInstance=l=this.resolver.resolveFunction(u,null)}return!l||!this.compileFunction(l)?a.unreachable():this.makeCallDirect(l,[e,t],s)}case 12:{if(this.options.willOptimize&&re(e)==14&&re(t)==14){let o=Pe(e),u=Pe(t);return this.currentType=i,a.f64(ol(o,u))}let l=this.f64PowInstance;if(!l){let o=this.program.lookup(L.Math);if(!o)return this.error(2304,s.range,"Math"),a.unreachable();let u=o.getMember(L.pow);if(!u)return this.error(2304,s.range,"Math.pow"),a.unreachable();assert(u.kind==4),this.f64PowInstance=l=this.resolver.resolveFunction(u,null)}return!l||!this.compileFunction(l)?a.unreachable():this.makeCallDirect(l,[e,t],s)}}return assert(!1),a.unreachable()}makeDiv(e,t,i){let s=this.module;switch(i.kind){case 1:case 2:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:return s.binary(3,e,t);case 4:return s.binary(28,e,t);case 5:return s.binary(220,e,t);case 0:case 6:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 8:return s.binary(4,e,t);case 9:return s.binary(29,e,t);case 10:return s.binary(221,e,t);case 11:return s.binary(53,e,t);case 12:return s.binary(66,e,t)}return assert(!1),s.unreachable()}makeRem(e,t,i,s){let a=this.module;switch(i.kind){case 1:case 2:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 3:return a.binary(5,e,t);case 4:return a.binary(30,e,t);case 5:return a.binary(222,e,t);case 0:case 6:case 7:e=this.ensureSmallIntegerWrap(e,i),t=this.ensureSmallIntegerWrap(t,i);case 8:return a.binary(6,e,t);case 9:return a.binary(31,e,t);case 10:return a.binary(223,e,t);case 11:{let l=this.f32ModInstance;if(!l){let o=this.program.lookup(L.Mathf);if(!o)return this.error(2304,s.range,"Mathf"),a.unreachable();let u=o.getMember(L.mod);if(!u)return this.error(2304,s.range,"Mathf.mod"),a.unreachable();assert(u.kind==4),this.f32ModInstance=l=this.resolver.resolveFunction(u,null)}return!l||!this.compileFunction(l)?a.unreachable():this.makeCallDirect(l,[e,t],s)}case 12:{let l=this.f64ModInstance;if(!l){let o=this.program.lookup(L.Math);if(!o)return this.error(2304,s.range,"Math"),a.unreachable();let u=o.getMember(L.mod);if(!u)return this.error(2304,s.range,"Math.mod"),a.unreachable();assert(u.kind==4),this.f64ModInstance=l=this.resolver.resolveFunction(u,null)}return!l||!this.compileFunction(l)?a.unreachable():this.makeCallDirect(l,[e,t],s)}}return assert(!1),a.unreachable()}makeShl(e,t,i){let s=this.module;switch(i.kind){case 0:return e;case 1:case 2:case 6:case 7:return s.binary(10,e,s.binary(7,t,s.i32(i.size-1)));case 3:case 8:return s.binary(10,e,t);case 4:case 9:return s.binary(35,e,t);case 5:case 10:return s.binary(227,e,t)}return assert(!1),s.unreachable()}makeShr(e,t,i){let s=this.module;switch(i.kind){case 0:return e;case 1:case 2:return s.binary(11,this.ensureSmallIntegerWrap(e,i),s.binary(7,t,s.i32(i.size-1)));case 6:case 7:return s.binary(12,this.ensureSmallIntegerWrap(e,i),s.binary(7,t,s.i32(i.size-1)));case 3:return s.binary(11,e,t);case 4:return s.binary(36,e,t);case 5:return s.binary(228,e,t);case 8:return s.binary(12,e,t);case 9:return s.binary(37,e,t);case 10:return s.binary(229,e,t)}return assert(!1),s.unreachable()}makeShru(e,t,i){let s=this.module;switch(i.kind){case 0:return e;case 1:case 2:case 6:case 7:return s.binary(12,this.ensureSmallIntegerWrap(e,i),s.binary(7,t,s.i32(i.size-1)));case 3:case 8:return s.binary(12,e,t);case 4:case 9:return s.binary(37,e,t);case 5:case 10:return s.binary(229,e,t)}return assert(!1),s.unreachable()}makeAnd(e,t,i){let s=this.module;switch(i.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:return s.binary(7,e,t);case 4:case 9:return s.binary(32,e,t);case 5:case 10:return s.binary(224,e,t)}return assert(!1),s.unreachable()}makeOr(e,t,i){let s=this.module;switch(i.kind){case 0:case 1:case 2:case 6:case 7:return s.binary(8,e,t);case 3:case 8:return s.binary(8,e,t);case 4:case 9:return s.binary(33,e,t);case 5:case 10:return s.binary(225,e,t)}return assert(!1),s.unreachable()}makeXor(e,t,i){let s=this.module;switch(i.kind){case 0:case 1:case 2:case 6:case 7:return s.binary(9,e,t);case 3:case 8:return s.binary(9,e,t);case 4:case 9:return s.binary(34,e,t);case 5:case 10:return s.binary(226,e,t)}return assert(!1),s.unreachable()}compileUnaryOverload(e,t,i,s){return this.makeCallDirect(e,[i],s,!1)}compileBinaryOverload(e,t,i,s,a,l){let o,u=e.signature,c=u.parameterTypes;e.is(262144)?(i=this.convertExpression(i,s,assert(u.thisType),!1,t),o=c[0]):(i=this.convertExpression(i,s,c[0],!1,t),o=c[1]);let f=this.compileExpression(a,o,1);return this.makeCallDirect(e,[i,f],l)}compileCommutativeBinaryOverload(e,t,i,s,a,l,o,u){let c=e.signature,f=c.parameterTypes;return e.is(262144)?(i=this.convertExpression(i,s,assert(c.thisType),!1,t),l=this.convertExpression(l,o,f[0],!1,a)):(i=this.convertExpression(i,s,f[0],!1,t),l=this.convertExpression(l,o,f[1],!1,a)),this.makeCallDirect(e,[i,l],u)}compileAssignment(e,t,i){let a=this.program.resolver,l=this.currentFlow;if(e.kind==14){let m=e,h=a.resolveExpression(m.expression,l);if(h&&h.kind==14)return this.compileFixedArrayElementAccess(m,h,!0,i,0,t);if(h&&h.kind==27)return this.compileUnmanagedArrayElementAccess(m,h,!0,i,0,t);if(h&&h.kind==28)return this.compileDynamicArrayElementAccess(m,h,!0,i,0,t);if(h&&this.isManagedDynamicArrayType(h))return this.compileDynamicArrayElementAccess(m,h,!0,i,0,t)}{let m=this.resolveSroaReceiver(e),h=this.resolveSroaReceiver(t);if(m!=null&&h!=null){if(!assert(m.type).equals(assert(h.type)))return this.error(2322,t.range,h.type.toString(),m.type.toString()),this.module.unreachable();let b=new Array;return this.copySroaValue(assert(h.fieldLocals),assert(m.fieldLocals),b),this.currentType=p.void,this.module.flatten(b)}}let o=a.lookupExpression(e,l);if(!o)return this.module.unreachable();let u=a.currentThisExpression,c=a.currentElementExpression,f;switch(o.kind){case 0:case 1:{if(o.kind==0){if(!this.compileGlobalLazy(o,e))return this.module.unreachable()}else if(!o.declaredByFlow(l))return this.error(100,e.range,"Closures"),this.module.unreachable();if(this.pendingElements.has(o))return this.error(2448,e.range,o.internalName),this.module.unreachable();f=o.type,o.hasDecorator(8192)&&this.checkUnsafe(e);break}case 10:{let m=o,h=a.resolveProperty(m);if(!h)return this.module.unreachable();o=h}case 11:{let m=o;if(m.isField&&this.pendingElements.has(o))return this.error(2448,e.range,o.internalName),this.module.unreachable();let h=m.setterInstance;if(!h)return this.error(2540,e.range,m.internalName),this.module.unreachable();assert(h.signature.parameterTypes.length==1),f=h.signature.parameterTypes[0],h.hasDecorator(8192)&&this.checkUnsafe(e);break}case 15:{let m=o.parent;assert(m.kind==7);let h=m,b=l.is(32768),A=h.lookupOverload(2,b);if(!A)return h.lookupOverload(1,b)?this.error(2542,e.range,h.internalName):this.error(2329,e.range,h.internalName),this.module.unreachable();let S=A.signature.parameterTypes;assert(S.length==2),f=S[1],A.hasDecorator(8192)&&this.checkUnsafe(e),!b&&this.options.pedantic&&this.pedantic(904,e.range);break}default:return this.error(2540,e.range,o.internalName),this.module.unreachable()}assert(f!=p.void);let _=this.compileExpression(t,f),d=this.currentType;return f.isNullableReference&&this.currentFlow.isNonnull(_,d)&&(f=f.nonNullableType),this.makeAssignment(o,this.convertExpression(_,d,f,!1,t),f,t,u,c,i!=p.void)}makeAssignment(e,t,i,s,a,l,o){let u=this.module,c=this.currentFlow;switch(e.kind){case 1:{let f=e;return f.isDynamicLength?(this.error(100,s.range,"the length name `"+f.name+"` is bound from the array header; it cannot be assigned. Read `.length` for the current value."),this.currentType=o?f.type:p.void,u.unreachable()):c.isLocalFlag(f.index,1,!0)?(this.error(2540,s.range,e.internalName),this.currentType=o?f.type:p.void,u.unreachable()):this.makeLocalAssignment(f,t,i,o)}case 0:{let f=e;return this.compileGlobalLazy(f,s)?e.isAny(72)?(this.error(2540,s.range,e.internalName),this.currentType=o?f.type:p.void,u.unreachable()):this.makeGlobalAssignment(f,t,i,o):u.unreachable()}case 10:{let f=this.resolver.resolveProperty(e);if(!f)return u.unreachable();e=f}case 11:{let f=e;if(a!=null&&a.kind==14){let d=this.compileSroaArrayLeafStoreByRuntimeIndex(a,f,t);if(d!=0)return d}if(a!=null){let d=this.resolveSroaReceiver(a);if(d!=null){let m=assert(d.fieldLocals);if(!m.has(f.name))return this.error(100,s.range,"assigning to a refused field of an @inline struct (the field was refused at declaration)"),u.unreachable();let h=assert(m.get(f.name));if(h.index<0)return this.error(100,s.range,"assigning a nested @inline struct value as a whole (the field is several leaves, not one value; assign one of its fields)"),u.unreachable();let b=u.local_set(h.index,t,!1);return this.currentType=o?h.type:p.void,b}}if(f.isField&&this.isInlineStructType(f.type))return this.error(100,s.range,"assigning a whole value to an @inline struct field (the value has no address, so there is nothing to store; assign the field's own fields, e.g. `w.inner.a = ...`)"),this.currentType=o?f.type:p.void,u.unreachable();if(f.isField){let d=c.sourceFunction.is(524288);if(f.is(64)){let m=f.initializerNode;if(!d||m)return this.error(2540,s.range,f.internalName),u.unreachable()}a=assert(a),d&&a.kind==26&&c.setThisFieldFlag(f,1)}let _=f.setterInstance;if(!_)return this.error(2540,s.range,e.internalName),u.unreachable();if(assert(_.signature.parameterTypes.length==1),assert(_.signature.returnType==p.void),f.is(262144)){let d=assert(_.signature.thisType),m=this.compileExpression(assert(a),d,33);if(!o)return this.makeCallDirect(_,[m,t],s);let h=c.getTempLocal(i),b=i.toRef(),A=u.block(null,[this.makeCallDirect(_,[m,u.local_tee(h.index,t,i.isManaged,b)],s),u.local_get(h.index,b)],b);return this.currentType=i,A}else{if(!o)return this.makeCallDirect(_,[t],s);let d=c.getTempLocal(i),m=i.toRef(),h=u.block(null,[this.makeCallDirect(_,[u.local_tee(d.index,t,i.isManaged,m)],s),u.local_get(d.index,m)],m);return this.currentType=i,h}}case 15:{let _=e.parent;assert(_.kind==7);let d=_;assert(d.kind==7);let m=c.is(32768),h=d.lookupOverload(1,m);if(!h)return this.error(2329,s.range,d.internalName),u.unreachable();let b=d.lookupOverload(2,m);if(!b)return this.error(2542,s.range,d.internalName),this.currentType=o?h.signature.returnType:p.void,u.unreachable();assert(b.signature.parameterTypes.length==2);let A=d.type,S=this.compileExpression(assert(a),A,33),k=b.signature.parameterTypes[0],w=h.signature.parameterTypes[0];if(!k.equals(w))return this.errorRelated(237,h.identifierAndSignatureRange,b.identifierAndSignatureRange,d.internalName),this.currentType=o?h.signature.returnType:p.void,u.unreachable();let R=this.compileExpression(assert(l),k,1),C=this.currentType;if(o){let M=c.getTempLocal(A),O=c.getTempLocal(C),D=h.signature.returnType;return u.block(null,[this.makeCallDirect(b,[u.local_tee(M.index,S,A.isManaged),u.local_tee(O.index,R,C.isManaged),t],s),this.makeCallDirect(h,[u.local_get(M.index,M.type.toRef()),u.local_get(O.index,O.type.toRef())],s)],D.toRef())}else return this.makeCallDirect(b,[S,R,t],s)}default:this.error(2541,s.range)}return u.unreachable()}dynamicArrayTypeNodeOf(e){let t=e.type;if(t!=null&&t.kind==72)return t;let i=e.initializer;if(i!=null&&i.kind==11){let s=i,a=s.expression;if(a.kind==8&&a.text=="changetype"){let l=s.typeArguments;if(l!=null&&l.length==1){let o=unchecked(l[0]);if(o.kind==72)return o}}}return null}makeLocalAssignment(e,t,i,s){let a=this.module,l=this.currentFlow,o=e.type;assert(o!=p.void);let u=e.index;return o.isNullableReference&&(!i.isNullableReference||l.isNonnull(t,o)?l.setLocalFlag(u,4):l.unsetLocalFlag(u,4)),l.setLocalFlag(u,8),o.isShortIntegerValue&&(l.canOverflow(t,o)?l.unsetLocalFlag(u,2):l.setLocalFlag(u,2)),s?(this.currentType=o,a.local_tee(u,t,o.isManaged)):(this.currentType=p.void,a.local_set(u,t,o.isManaged))}makeGlobalAssignment(e,t,i,s){let a=this.module,l=e.type;assert(l!=p.void);let o=l.toRef();return t=this.ensureSmallIntegerWrap(t,l),s?(this.currentType=l,a.block(null,[a.global_set(e.internalName,t),a.global_get(e.internalName,o)],o)):(this.currentType=p.void,a.global_set(e.internalName,t))}checkNoManagedStructCopy(e,t){if(!e.prototype.internalName.startsWith(L.COPY_STRUCT))return!0;let i=e.typeArguments;if(!i)return!0;for(let s=0,a=i.length;s<a;++s){let l=unchecked(i[s]).classReference;if(l!=null&&l.hasDecorator(2048)){let o=t.typeArguments;return this.error(100,o&&o.length>s?unchecked(o[s]).range:t.range,"COPY_STRUCT on an @managed struct (a raw byte copy bypasses the GC write barrier)"),!1}}return!0}compileCallExpression(e,t,i){let s=this.module,a=this.currentFlow;if(e.expression.kind==25){let f=this.currentFlow,_=f.sourceFunction;if(!_.is(524288))return this.error(2337,e.range),s.unreachable();let d=assert(_.parent);assert(d.kind==7);let m=d,h=m.base;if(!h||m.prototype.implicitlyExtendsObject)return this.error(2335,e.expression.range),s.unreachable();let b=assert(f.lookupLocal(L.this_)),A=this.options.sizeTypeRef,S=this.ensureConstructor(h,e);this.checkFieldInitialization(h,e);let k=this.compileCallDirect(S,e.args,e,s.local_get(b.index,A));return f.isAny(8256)?(this.error(17009,e.range),s.unreachable()):(f.set(192),this.currentType=p.void,s.local_set(b.index,k,m.type.isManaged))}let l=this.resolver.lookupExpression(e.expression,a);if(!l)return s.unreachable();let o=this.resolver.currentThisExpression;switch(l.kind){case 4:{let f=l;if(f.hasDecorator(512))return this.compileCallExpressionBuiltin(f,e,t);let _=this.resolver.maybeInferCall(e,f,a);if(!_)return this.module.unreachable();if(!this.checkNoManagedStructCopy(_,e))return this.module.unreachable();l=_}case 5:{let f=l;if(!this.checkNoManagedStructCopy(f,e))return this.module.unreachable();let _=0;return f.is(262144)&&(_=this.compileExpression(assert(o),assert(f.signature.thisType),33)),this.compileCallDirect(f,e.args,e,_,i)}}let u=this.compileExpression(e.expression,p.auto),c=this.currentType.getSignature();if(c)return this.compileCallIndirect(c,u,e.args,e,0,t==p.void);if(this.error(2349,e.range,this.currentType.toString()),l.kind==10){let f=l.getterPrototype;f&&this.infoRelated(6234,e.range,f.identifierNode.range)}return s.unreachable()}compileCallExpressionLike(e,t,i,s,a,l=0){let o=this._reusableCallExpression;return o?(o.expression=e,o.typeArguments=t,o.args=i,o.range=s):this._reusableCallExpression=o=y.createCallExpression(e,t,i,s),this.compileCallExpression(o,a,l)}compileCallExpressionBuiltin(e,t,i){e.hasDecorator(8192)&&this.checkUnsafe(t);let s=null,a=e.typeParameterNodes,l=t.typeArguments;if(t.typeArguments){e.is(65536)||this.error(2315,t.range,e.internalName);let _=e.internalName==g.changetype;_&&(this.resolver.allowInlineView=!0),s=this.resolver.resolveTypeArguments(assert(a),l,this.currentFlow,this.currentFlow.sourceFunction.parent,me(this.currentFlow.contextualTypeArguments),t),_&&(this.resolver.allowInlineView=!1,s!=null&&s.length==1&&l!=null&&l.length==1&&l[0].memoryModel==3&&this.resolver.markViewCall(t))}let o=t.expression,u=new iu(this,e,s,t.args,o.kind==23?o.expression:null,i,t,!1),c;return e.is(262144)?c=`${assert(e.getBoundClassOrInterface()).prototype.internalName}#${e.name}`:c=e.internalName,assert(E.has(c)),assert(E.get(c))(u)}checkCallSignature(e,t,i,s){let a=e.thisType;if(i!=(a!=null))return this.error(2685,s.range),!1;let l=e.hasRest,o=e.requiredParameters,u=e.parameterTypes.length;return t<o?(this.error(o<u?2555:2554,s.range,o.toString(),t.toString()),!1):t>u&&!l?(this.error(2554,s.range,u.toString(),t.toString()),!1):!0}checkUnsafe(e,t=null){this.options.noUnsafe&&!e.range.source.isLibrary&&(t?this.errorRelated(101,e.range,t.range):this.error(101,e.range))}adjustArgumentsForRestParams(e,t,i){if(!t.hasRest)return e;let s=e.length,a=t.parameterTypes.length;if(s<a)return e;let l=e.slice(a-1),o=new ce(l[0].range.start,l[l.length-1].range.end);o.source=i.range.source;let u=new Yr(l,o),c=e.slice(0,a-1);return c.push(u),c}compileCallDirect(e,t,i,s=0,a=0){let l=t.length,o=e.signature;if(!this.checkCallSignature(o,l,s!=0,i))return this.currentType=o.returnType,this.module.unreachable();e.hasDecorator(8192)&&this.checkUnsafe(i);let u=0;o.hasHiddenDestParam&&(u=this.sretDestSlot,this.sretDestSlot=0),t=this.adjustArgumentsForRestParams(t,o,i),l=t.length;let c=this.currentFlow.sourceFunction;if(c.is(524288)&&i.isAccessOnThis){let C=c.parent;assert(C.kind==7),this.checkFieldInitialization(C,i)}let f=e.hasDecorator(64)||this.currentFlow.is(131072);if(!o.hasHiddenDestParam&&f&&(!e.is(268435456)||i.isAccessOnSuper)){assert(!e.is(134217728));let C=this.inlineStack;if(C.includes(e))this.warning(217,i.range,e.internalName);else{let M=o.parameterTypes;assert(l<=M.length);let O=new Array(l);for(let Q=0;Q<l;++Q)O[Q]=this.compileExpression(t[Q],M[Q],1);C.push(e);let D=this.makeCallInline(e,O,s,(a&8)!=0);return C.pop(),D}}let _=o.parameterTypes,d=0;for(let C=0;C<l;++C)d+=o.wasmParamSlotCountOf(C);let m=s?d+1:d,h=o.hasHiddenDestParam;if(this.sretDiscardMark=null,h&&u==0){this.ensureSretStack();let C=this.currentFlow.getTempLocal(p.u32);this.sretDiscardMark=C,u=this.makeSretAddress(C)}let b=m+(h?1:0),A=new Array(b),S=0;s&&(A[0]=s,S=1),h&&(A[S++]=u),this.externalTempMark=null,this.externalTempSize=0;let k=null,w=0,R=0;if(o.byValPointerParams){let C=0;for(let M=0;M<l;++M)o.isByValPointerParam(M)&&(C+=this.sretSizeOf(unchecked(_[M])));C>0&&(this.ensureSretStack(),k=this.currentFlow.getTempLocal(p.u32),R=C)}for(let C=0;C<l;++C){let M=unchecked(_[C]);this.rootNextOperand=!1,k!=null&&o.isByValPointerParam(C)?(A[S++]=this.makeExternalTempArgument(unchecked(t[C]),M,assert(k),w),w+=this.sretSizeOf(M)):o.isViewParam(C)?unchecked(A[S++]=this.compileExpression(unchecked(t[C]),M,1)):S+=this.expandSroaArgument(unchecked(t[C]),M,A,S),this.rootNextOperand&&(this.rootNextOperand=!1,o.isByValPointerParam(C)||unchecked(A[S-1]=this.module.tostack(unchecked(A[S-1]))))}return S!=b&&console.log("DEBUG arity: index="+S.toString()+" numOperands="+b.toString()),assert(S==b),this.externalTempMark=k,this.externalTempSize=R,this.makeCallDirect(e,A,i,(a&8)!=0)}makeCallInline(e,t,i=0,s=!1){let a=this.module,l=t?t.length:0,u=e.signature.parameterTypes,c=u.length,f=this.currentFlow,_=er.createInline(f.targetFunction,e),d=[];if(i){let b=assert(e.parent);assert(b.kind==7);let A=b,S=assert(e.signature.thisType),k=_.addScopedLocal(L.this_,S);d.push(a.local_set(k.index,i,S.isManaged)),_.setLocalFlag(k.index,8);let w=A.base;w&&_.addScopedAlias(L.super_,w.type,k.index)}else assert(!e.signature.thisType);for(let b=0;b<l;++b){let A=t[b],S=u[b],k=_.addScopedLocal(e.getParameterName(b),S);f.canOverflow(A,S)||_.setLocalFlag(k.index,2),_.isNonnull(A,S)&&_.setLocalFlag(k.index,4),d.push(a.local_set(k.index,A,S.isManaged)),_.setLocalFlag(k.index,8)}this.currentFlow=_;let m=e.is(524288);m&&_.set(65536);for(let b=l;b<c;++b){let A=u[b],S=this.compileExpression(assert(e.prototype.functionTypeNode.parameters[b].initializer),A,1),k=_.addScopedLocal(e.getParameterName(b),A);d.push(this.makeLocalAssignment(k,S,A,!1))}if(_.unset(65536),this.compileFunctionBody(e,d),m){let b=e.parent;assert(b.kind==7),this.checkFieldInitializationInFlow(b,_)}let h=_.returnType;return this.currentFlow=f,this.currentType=h,a.block(_.inlineReturnLabel,d,this.resultRefOf(h))}ensureArgumentsLength(){let e=g.argumentsLength;if(!this.builtinArgumentsLength){let t=this.module;this.builtinArgumentsLength=t.addGlobal(e,P.I32,!0,t.i32(0))}return e}ensureEnvGlobal(){let e=g.env;if(!this.builtinEnv){let t=this.module,i=this.options.sizeTypeRef;this.builtinEnv=t.addGlobal(e,i,!0,i==P.I64?t.i64(0):t.i32(0))}return e}ensureVarargsStub(e){let t=e.varargsStub;if(t)return t;let i=e.signature,s=i.parameterTypes,a=e.prototype.functionTypeNode.parameters,l=i.returnType,o=e.is(262144),u=i.requiredParameters,c=u,f=s.length,_=f;o&&(++c,++_);let d=assert(_-c),m=new Array(c),h=0,b=new Array,A=this.module,S=i.thisType;S&&(m[0]=A.local_get(0,S.toRef()),h=1);for(let H=0;H<u;++H,++h){let U=s[H];m[h]=A.local_get(h,U.toRef())}assert(h==c),t=e.newStub("varargs",f),e.varargsStub=t;let k=this.currentFlow,w=t.flow;e.is(524288)&&w.set(65536),this.currentFlow=w;let R=d+1,C=new Array(R),M=`of${d}`;for(let H=0;H<R;++H)C[H]=`${H}${M}`;let O=this.ensureArgumentsLength(),D=A.block(C[0],[A.block("outOfRange",[A.switch(C,"outOfRange",u?A.binary(1,A.global_get(O,P.I32),A.i32(u)):A.global_get(O,P.I32))]),A.unreachable()]);for(let H=0;H<d;++H,++h){let U=s[u+H],V=a[u+H],Y=V.initializer,q;if(V.parameterKind===2){let ne=new Yr([],V.range.atEnd);q=this.compileArrayLiteral(ne,U,2),q=A.local_set(h,q,U.isManaged)}else Y?(q=this.compileExpression(Y,U,1),q=A.local_set(h,q,U.isManaged)):(this.error(215,V.range),q=A.unreachable());D=A.block(C[H+1],[D,q]),m[h]=A.local_get(h,U.toRef())}assert(h==_),b.push(D),b.push(this.makeCallDirect(e,m,e.declaration.name)),this.currentFlow=k;let Q=A.addFunction(t.internalName,t.signature.paramRefs,t.signature.resultRefs,t.getNonParameterLocalTypeRefs(),A.flatten(b,l.toRef()));return t.set(8388608),t.finalize(A,Q),t}ensureOverrideStub(e){let t=e.overrideStub;if(t)return t;t=e.newStub("override"),e.overrideStub=t;let i=this.module;return t.ref=i.addFunction(t.internalName,t.signature.paramRefs,t.signature.resultRefs,null,i.unreachable()),this.overrideStubs.add(e),t}finalizeOverrideStub(e){let t=this.ensureOverrideStub(e);if(t.is(8388608))return;assert(e.parent.kind==7||e.parent.kind==9);let i=this.module,a=this.options.usizeType.toRef(),l=e.signature.parameterTypes,o=e.signature.returnType,u=l.length,c=1+assert(e.signature).wasmParamCount(),f=new ys(this.module,i.load(4,!1,i.binary(a==P.I64?26:1,i.local_get(0,a),a==P.I64?i.i64(8):i.i32(8)),P.I32)),_=this.resolver.resolveOverrides(e);if(_){let b=new Map;for(let A=0,S=_.length;A<S;++A){let k=_[A];if(!k.is(8388608))continue;let w=k.signature,R=e.signature;if(!w.isAssignableTo(R,!0)){this.error(2322,k.identifierNode.range,w.toString(),R.toString());continue}let C=w.parameterTypes,M=C.length,O=new Array(1+M);O[0]=i.local_get(0,a);for(let q=1;q<=u;++q)O[q]=i.local_get(q,l[q-1].toRef());let D=!1;for(let q=u;q<M;++q)O[1+q]=this.makeZero(C[q]),D=!0;let Q=D?this.ensureVarargsStub(k).internalName:k.internalName,H=w.returnType.toRef(),U=new Array;D&&U.push(i.global_set(this.ensureArgumentsLength(),i.i32(u))),o==p.void?(U.push(i.call(Q,O,H)),U.push(i.return())):U.push(i.return(i.call(Q,O,H)));let V=assert(k.getBoundClassOrInterface());f.addCase(V.id,U);let Y=V.extenders;if(Y)for(let q=Set_values(Y),ne=0,j=q.length;ne<j;++ne){let ge=q[ne],ue=ge.prototype.instanceMembers;ue&&ue.has(e.declaration.name.text)||(!b.has(ge)||!assert(b.get(ge)).extends(V))&&(b.set(ge,V),f.addOrReplaceCase(ge.id,U))}}}let d,m=e.getBoundClassOrInterface();if(!e.is(128)&&!(m&&m.kind==9)){let b=new Array(u);b[0]=i.local_get(0,a);for(let A=0,S=l.length;A<S;++A)b[1+A]=i.local_get(1+A,l[A].toRef());d=i.call(e.internalName,b,o.toRef())}else d=i.unreachable();t.ref&&i.removeFunction(t.internalName),t.ref=i.addFunction(t.internalName,t.signature.paramRefs,t.signature.resultRefs,[P.I32],i.block(null,[f.render(c),d],o.toRef())),t.set(8388608)}needToStack(e){let t=this.module.runExpression(e,0);if(t==0)return!0;let i=_f(t,this.options.isWasm64);if(i64_eq(i,i64_zero))return!1;let s=this.staticGcObjectOffsets;return!(s.has(i64_high(i))&&assert(s.get(i64_high(i))).has(i64_low(i)))}operandsTostack(e,t){if(!this.options.stackSize)return;let i=this.module,s=0,a=e.thisType;if(a){if(a.isManaged){let c=t[0];this.needToStack(c)&&(t[s]=i.tostack(c))}++s}let l=e.parameterTypes,o=e.wasmParamCount(),u=0;for(;s<t.length&&!(u>=o);){let c=e.sourceIndexOf(u);if(c<0){++s,++u;continue}if(unchecked(l[c]).isManaged&&!e.isByValPointerParam(c)){let _=t[s];this.needToStack(_)&&(t[s]=i.tostack(_))}++s,++u}}checkCallArity(e,t,i){let s=e.signature,a=s.wasmParamCount()+(s.thisType?1:0),l=t?t.length:0;if(l==a)return!0;let o=this.diagnostics;for(let u=0,c=o.length;u<c;++u)if(o[u].category==3)return!0;return this.error(6412,i.range,e.internalName,l.toString(),a.toString()),!1}makeCallDirect(e,t,i,s=!1){let a=this.sretDiscardMark;this.sretDiscardMark=null;let l=this.externalTempMark,o=this.externalTempSize;if(this.externalTempMark=null,this.externalTempSize=0,e.hasDecorator(64))if(e.is(268435456))this.warning(228,i.range,e.internalName);else{assert(!e.is(134217728));let k=this.inlineStack;if(k.includes(e))this.warning(217,i.range,e.internalName);else{k.push(e);let w;if(e.is(262144)){let R=assert(t);assert(R.length),w=this.makeCallInline(e,R.slice(1),R[0],s)}else w=this.makeCallInline(e,t,0,s);return k.pop(),w}}let u=this.module,c=t?t.length:0,f=c,d=e.signature.requiredParameters,m=e.signature.parameterTypes,h=m.length,b=h;if(e.is(262144)&&(++d,++b,--f),e.signature.hasHiddenDestParam&&(++d,++b,--f),assert(c>=d),!this.compileFunction(e))return u.unreachable();let A=e.signature.returnType;if(c<b){t||(t=new Array(b),t.length=0);let k=e.prototype.functionTypeNode.parameters;assert(k.length==m.length);let w=!0;for(let R=f;R<h;++R){let C=k[R].initializer;if(C){if(C.compilesToConst){t.push(this.compileExpression(C,m[R],1));continue}let M=this.resolver.lookupExpression(C,e.flow,m[R],1);if(M&&M.kind==0){let O=M;if(this.compileGlobalLazy(O,C)&&O.is(33554432)){t.push(this.compileInlineConstant(O,m[R],1));continue}}}t.push(this.makeZero(m[R])),w=!1}if(!w&&!e.is(2097152)){let R=e;if(e=this.ensureVarargsStub(e),!this.compileFunction(e))return u.unreachable();e.flow.flags=R.flow.flags;let C=e.signature.resultRefs,M=t[b-1];assert(!(ks(M,u.ref)&32));let O=m[h-1];if(t[b-1]=u.block(null,[u.global_set(this.ensureArgumentsLength(),u.i32(f)),M],O.toRef()),!this.checkCallArity(e,t,i))return u.unreachable();this.operandsTostack(e.signature,t);let D=u.call(e.internalName,t,C);return C!=P.None&&s?(D=u.drop(D),this.currentType=p.void):this.currentType=A,a!=null&&(D=this.wrapSretCall(assert(a),D,A,i),this.currentType=s?p.void:A),D}}if(e.is(268435456)&&!i.isAccessOnSuper&&(e=this.ensureOverrideStub(e)),!this.checkCallArity(e,t,i))return u.unreachable();t&&this.operandsTostack(e.signature,t);let S=u.call(e.internalName,t,e.signature.resultRefs);return this.currentType=A,a!=null&&(S=this.wrapSretCall(assert(a),S,A,i),this.currentType=s?p.void:A),l!=null&&(S=this.wrapExternalTempCall(assert(l),o,S,A,i),this.currentType=s?p.void:A),S}compileCallIndirect(e,t,i,s,a=0,l=!1){let o=i.length;if(e.hasHiddenDestParam)return this.error(100,s.range,"calling an @inline struct-returning function through a function value (the hidden destination parameter needs a direct call)"),this.currentType=e.returnType,this.module.unreachable();if(!this.checkCallSignature(e,o,a!=0,s))return this.module.unreachable();i=this.adjustArgumentsForRestParams(i,e,s),o=i.length;let u=a?o+1:o,c=new Array(u),f=0;a&&(c[0]=a,f=1);let _=e.parameterTypes;for(let d=0;d<o;++d,++f)c[f]=this.compileExpression(i[d],_[d],1);return assert(f==u),this.makeCallIndirect(e,t,s,c,l)}makeCallIndirect(e,t,i,s=null,a=!1){let l=this.module,o=s?s.length:0,u=o,f=e.requiredParameters,_=e.parameterTypes,d=e.returnType,m=_.length,h=m;if(e.thisType&&(++f,++h,--u),assert(o>=f),o<h){s||(s=new Array(h),s.length=0);let U=e.parameterTypes;for(let V=u;V<m;++V)s.push(this.makeZero(U[V]))}let b=new Array,A=this.options.sizeTypeRef,S=this.currentFlow.getTempLocal(this.options.usizeType),k=this.ensureEnvGlobal(),w=this.options.usizeType.byteSize,R=this.options.usizeType.byteSize,C=this.currentFlow.getTempLocal(this.options.usizeType);b.push(l.local_set(C.index,l.global_get(k,A),!1)),b.push(l.global_set(k,l.load(R,!1,l.local_tee(S.index,t,!0),A,w))),t=l.local_get(S.index,A);let M=this.ensureArgumentsLength(),O=l.block(null,[l.global_set(M,l.i32(u)),l.load(4,!1,t,P.I32,cu)],A);s&&this.operandsTostack(e,s);let D=l.call_indirect(null,O,s,e.paramRefs,e.resultRefs);this.currentType=d;let Q=l.global_set(k,l.local_get(C.index,A));if(d==p.void)return b.push(D),b.push(Q),l.flatten(b,P.None);let H=this.currentFlow.getTempLocal(d);return b.push(l.local_set(H.index,D,d.isManaged)),b.push(Q),b.push(l.local_get(H.index,d.toRef())),l.flatten(b,d.toRef())}compileCommaExpression(e,t,i){let s=e.expressions,a=s.length,l=new Array(a--);for(let o=0;o<a;++o)l[o]=this.compileExpression(s[o],p.void,9);return l[a]=this.compileExpression(s[a],t,i),this.module.flatten(l,this.currentType.toRef())}unmanagedArrayElementSize(e){let t=e.classReference;return t!=null&&(t.hasDecorator(16)||t.hasDecorator(2048))?t.nextMemoryOffset:e.byteSize}isRecordValueType(e){let t=e.classReference;return t!=null&&(t.hasDecorator(16)||t.hasDecorator(2048)||t.hasDecorator(4096))}dynamicArrayElementOf(e){if(e.kind==28)return e.dynamicElementType;let t=e.classReference;if(t!=null&&this.isManagedDynamicArrayType(e)){let i=t.typeArguments;if(i!=null&&i.length>0)return unchecked(i[0])}return assert(!1),p.void}isManagedDynamicArrayType(e){let t=e.classReference;return t==null?!1:t.prototype.internalName==this.program.dynamicArrayPrototype.internalName}dynamicArrayHeaderSize(e){let t=e.alignLog2,i=e.classReference;return i!=null&&(i.hasDecorator(16)||i.hasDecorator(2048))&&(t=i.alignLog2),t>2?1<<t:4}compileDynamicArrayElementAddress(e,t,i){let s=this.module,a=this.dynamicArrayElementOf(i),l=this.unmanagedArrayElementSize(a),o=this.dynamicArrayHeaderSize(a),u=s.binary(219,this.options.isWasm64?s.unary(23,t):t,this.options.isWasm64?s.i64(l):s.i32(l));return s.binary(217,s.binary(217,e,this.options.isWasm64?s.i64(o):s.i32(o)),u)}compileDynamicArrayBoundsCheck(e,t,i){let s=this.module,a=s.load(4,!1,e,P.I32,0,4),l=this.makeAbort(y.createStringLiteralExpression("dynamic array index out of bounds",i.range),i);return s.if(s.binary(24,t,a),l,0)}compileUnmanagedArrayElementAddress(e,t){let i=this.module,s=this.unmanagedArrayElementSize(t.unmanagedArrayElementType),a=this.compileExpression(e.expression,t,1),l=this.compileExpression(e.elementExpression,p.i32,1),o=i.binary(219,this.options.isWasm64?i.unary(23,l):l,this.options.isWasm64?i.i64(s):i.i32(s));return i.binary(217,a,o)}compileUnmanagedArrayElementAccess(e,t,i,s,a,l=null,o=0){let u=this.module,c=t.unmanagedArrayElementType,f=this.unmanagedArrayElementSize(c),_=this.isRecordValueType(c);if(i&&_)return this.error(100,e.range,"whole-record assignment to a `[T *]` element \u2014 `y[i]` of a record is an address, not a value slot; use copyInto(y + i*sizeof(T), v), or write one field with `y[i].field = v`"),this.currentType=p.void,u.unreachable();let d=this.compileUnmanagedArrayElementAddress(e,t);if(this.currentType=c,i){let m=o||this.compileExpression(assert(l),c,1);if(s==p.void)return this.currentType=p.void,u.store(f,d,m,c.toRef(),0,f);let h=this.currentFlow.getTempLocal(c);return this.currentType=c,c.isManaged&&this.currentFlow.setLocalFlag(h.index,8),u.block(null,[u.local_set(h.index,m,c.isManaged),u.store(f,d,u.local_get(h.index,c.toRef()),c.toRef(),0,f),u.local_get(h.index,c.toRef())],c.toRef())}return _?d:u.load(f,c.isSignedIntegerValue,d,c.toRef(),0,f)}compileDynamicArrayElementAccess(e,t,i,s,a,l=null,o=0){let u=this.module,c=this.dynamicArrayElementOf(t),f=this.unmanagedArrayElementSize(c),_=this.isRecordValueType(c);if(i&&_)return this.error(100,e.range,"whole-record assignment to a dynamic array element \u2014 `y[i]` of a record is an address, not a value slot; use copyInto on the element address, or write one field with `y[i].field = v`"),this.currentType=p.void,u.unreachable();let d,m;if(this.isManagedDynamicArrayType(t)){let h=this.compileExpression(e.expression,t,1),b=this.compileExpression(e.elementExpression,p.i32,1),S=assert(t.classReference).members;assert(S!=null),assert(S.has("dataPtr")&&S.has("length"));let k=assert(S.get("dataPtr")).instance.memoryOffset,w=assert(S.get("length")).instance.memoryOffset,R=this.currentFlow.getTempLocal(t),C=this.currentFlow.getTempLocal(p.i32),M=u.local_get(R.index,P.I32),O=u.local_get(C.index,P.I32),D=u.load(4,!1,M,P.I32,k,4),Q=u.load(4,!1,M,P.I32,w,4),H=u.binary(219,this.options.isWasm64?u.unary(23,O):O,this.options.isWasm64?u.i64(f):u.i32(f)),U=this.makeAbort(y.createStringLiteralExpression("dynamic array index out of bounds",e.range),e);m=u.binary(217,D,H),d=u.block(null,[u.local_set(R.index,h,!1),u.local_set(C.index,b,!1),u.if(u.binary(24,u.local_get(C.index,P.I32),Q),U,0)],P.None)}else{let h=this.compileExpression(e.expression,t,1),b=this.compileExpression(e.elementExpression,p.i32,1),A=this.currentFlow.getTempLocal(t),S=this.currentFlow.getTempLocal(p.i32),k=this.compileDynamicArrayBoundsCheck(u.local_get(A.index,P.I32),u.local_get(S.index,P.I32),e);m=this.compileDynamicArrayElementAddress(u.local_get(A.index,P.I32),u.local_get(S.index,P.I32),t),d=u.block(null,[u.local_set(A.index,h,!1),u.local_set(S.index,b,!1),k],P.None)}if(this.currentType=c,i){let h=o||this.compileExpression(assert(l),c,1);if(s==p.void)return this.currentType=p.void,u.block(null,[d,u.store(f,m,h,c.toRef(),0,f)],P.None);let b=this.currentFlow.getTempLocal(c);return this.currentType=c,c.isManaged&&this.currentFlow.setLocalFlag(b.index,8),u.block(null,[d,u.local_set(b.index,h,c.isManaged),u.store(f,m,u.local_get(b.index,c.toRef()),c.toRef(),0,f),u.local_get(b.index,c.toRef())],c.toRef())}return _?u.block(null,[d,m],P.I32):u.block(null,[d,u.load(f,c.isSignedIntegerValue,m,c.toRef(),0,f)],c.toRef())}compileFixedArrayElementAccess(e,t,i,s,a,l=null,o=0){let u=this.module,c=t.fixedArrayElementType,f=this.resolveSroaValueArray(e.expression);if(f!=null)return this.compileSroaValueArrayElementAccess(e,f,i,s,a,l,o);let d=(t.fixedMemoryModel==3||t.fixedMemoryModel==2)&&this.isRecordValueType(c);if(i&&d)return this.error(100,e.range,"whole-record assignment to a `@unmanaged [T * N]` element \u2014 `y[i]` of a record is an address, not a value slot; use copyInto(y + i*sizeof(T), v), or write one field with `y[i].field = v`"),this.currentType=p.void,u.unreachable();let m=c.byteSize,h=this.compileFixedArrayElementAddress(e,t);if(d)return this.currentType=c,h;if(i){let b=o||this.compileExpression(assert(l),c,1);if(s==p.void)return this.currentType=p.void,u.store(m,h,b,c.toRef(),0,m);let A=this.currentFlow.getTempLocal(c);return this.currentType=c,c.isManaged&&this.currentFlow.setLocalFlag(A.index,8),u.block(null,[u.local_set(A.index,b,c.isManaged),u.store(m,h,u.local_get(A.index,c.toRef()),c.toRef(),0,m),u.local_get(A.index,c.toRef())],c.toRef())}return this.currentType=c,u.load(m,c.isSignedIntegerValue,h,c.toRef(),0,m)}compileFixedArrayElementAddress(e,t){let i=this.module,s=t.fixedArrayElementType,a=this.resolver.resolveExpression(e.expression,this.currentFlow);if(!a)return this.module.unreachable();let l=this.compileExpression(e.expression,a,1),o=this.compileExpression(e.elementExpression,p.i32,1),u=s.byteSize,c=s.classReference;c!=null&&(c.hasDecorator(16)||c.hasDecorator(2048))&&(u=c.nextMemoryOffset);let f=u==1<<s.alignLog2,_=this.options.isWasm64?i.unary(23,o):o,d=f?i.binary(227,_,this.options.isWasm64?i.i64(s.alignLog2):i.i32(s.alignLog2)):i.binary(219,_,this.options.isWasm64?i.i64(u):i.i32(u));return i.binary(217,l,d)}compileElementAccessExpression(e,t,i){let s=this.module,a=e.expression,l=this.resolver,o=l.lookupExpression(a,this.currentFlow,p.auto,1);if(o&&o.kind==2){let c=this.compileExpression(e.elementExpression,p.i32,1),f=this.ensureEnumToString(o,e);return this.currentType=this.program.stringInstance.type,f==null?s.unreachable():s.call(f,[c],P.I32)}let u=l.resolveExpression(a,this.currentFlow);if(u){if(u.kind==14)return this.compileFixedArrayElementAccess(e,u,!1,t,i);if(u.kind==27)return this.compileUnmanagedArrayElementAccess(e,u,!1,t,i);if(u.kind==28)return this.compileDynamicArrayElementAccess(e,u,!1,t,i);if(this.isManagedDynamicArrayType(u))return this.compileDynamicArrayElementAccess(e,u,!1,t,i);let c=u.getClassOrWrapper(this.program);if(c){let f=this.currentFlow.is(32768),_=c.lookupOverload(1,f);if(_){let d=assert(_.signature.thisType),m=this.compileExpression(a,d,1);return!f&&this.options.pedantic&&this.pedantic(904,e.range),this.compileCallDirect(_,[e.elementExpression],e,m,i)}}this.error(2329,e.expression.range,u.toString())}return s.unreachable()}compileFunctionExpression(e,t,i){let s=e.declaration.clone();assert(!s.typeParameters);let a=this.currentFlow,l=a.sourceFunction,o=s.name.text.length>0,u=!o||t!=p.void,c=new ot(u?`${o?s.name.text:"anonymous"}|${l.nextAnonymousId++}`:s.name.text,l,s,0),f=J(On(),e);f&&(c.envKind=f.kind,c.envClass=f.envClass);let _,d=me(a.contextualTypeArguments),m=this.module,h=t.signatureReference;if(h){let S=c.functionTypeNode,k=S.parameters,w=k.length,R=h.parameterTypes,C=R.length;if(w>C)return this.error(2554,e.range,C.toString(),w.toString()),m.unreachable();for(let U=0;U<w;++U){let V=k[U];if(!De(V.type)){let Y=this.resolver.resolveType(V.type,a,l.parent,d);if(!Y)return m.unreachable();if(!R[U].isStrictlyAssignableTo(Y))return this.error(2322,V.range,R[U].toString(),Y.toString()),m.unreachable()}}let M=h.returnType;if(!De(S.returnType)){let U=this.resolver.resolveType(S.returnType,a,l.parent,d);if(!U)return m.unreachable();if(M==p.void?U!=p.void:!U.isStrictlyAssignableTo(M))return this.error(2322,S.returnType.range,U.toString(),M.toString()),m.unreachable()}let O=h.thisType,D=S.explicitThisType;if(D){if(!O)return this.error(2332,D.range),m.unreachable();let U=this.resolver.resolveType(D,a,l.parent,d);if(!U)return m.unreachable();if(!O.isStrictlyAssignableTo(U))return this.error(2322,D.range,O.toString(),U.toString()),m.unreachable()}let Q=oe.create(this.program,R,M,O,C);_=new Mt(c.name,c,null,Q,d),_.flow.outer=a;let H=this.compileFunction(_);if(this.currentType=h.type,!H)return m.unreachable()}else{if(_=this.resolver.resolveFunction(c,null,d),!_)return this.module.unreachable();_.flow.outer=a;let S=this.compileFunction(_);if(this.currentType=_.signature.type,!S)return m.unreachable()}let b=this.currentType,A;if(_.prototype.envKind==2)A=this.makeEnvFunctionValue(_,assert(qr().get(e)));else if(_.prototype.capturesThis)A=this.makeCapturingFunctionValue(_);else{let S=this.ensureRuntimeFunction(_);A=this.options.isWasm64?m.i64(i64_low(S),i64_high(S)):m.i32(i64_low(S))}if(this.currentType=b,!u){let S=_.name,k=a.getScopedLocal(S);if(k)k.declaration.range.source.isNative?this.error(2300,s.name.range,S):this.errorRelated(2300,s.name.range,k.declaration.name.range,S);else{let w=_.type,R=a.addScopedLocal(_.name,w);a.setLocalFlag(R.index,9),A=m.local_tee(R.index,A,w.isManaged)}}return A}assertFunctionLayout(e){assert(e.offsetof("_index")==cu),assert(e.offsetof("_env")==this.options.usizeType.byteSize)}makeCapturingFunctionValue(e){let t=this.module,i=this.currentFlow,s=this.resolver,a=assert(s.resolveClass(this.program.functionPrototype,[e.type]));this.assertFunctionLayout(a);let l=assert(i.lookupLocal(L.this_)),o=new Array,u=i.getTempLocal(a.type);o.push(t.local_set(u.index,this.makeAllocation(a),a.type.isManaged));let c=t.local_get(u.index,a.type.toRef());return o.push(t.store(4,c,t.i32(this.ensureFunctionTableIndex(e)),P.I32,cu)),o.push(t.store(this.options.usizeType.byteSize,c,t.local_get(l.index,l.type.toRef()),this.options.sizeTypeRef,this.options.usizeType.byteSize)),o.push(t.local_get(u.index,a.type.toRef())),t.flatten(o,a.type.toRef())}makeEnvFunctionValue(e,t){let i=this.module,s=this.currentFlow,a=this.resolver,l=assert(a.resolveClass(this.program.functionPrototype,[e.type]));this.assertFunctionLayout(l);let o=assert(s.lookupLocal(t)),u=new Array,c=s.getTempLocal(l.type);u.push(i.local_set(c.index,this.makeAllocation(l),l.type.isManaged));let f=i.local_get(c.index,l.type.toRef());return u.push(i.store(4,f,i.i32(this.ensureFunctionTableIndex(e)),P.I32,cu)),u.push(i.store(this.options.usizeType.byteSize,f,i.local_get(o.index,o.type.toRef()),this.options.sizeTypeRef,this.options.usizeType.byteSize)),u.push(i.local_get(c.index,l.type.toRef())),i.flatten(u,l.type.toRef())}maybeCompileEnclosingSource(e){let t=e.range.source.internalPath,i=this.program.filesByName;assert(i.has(t)),assert(i.get(t)).is(8388608)||this.compileFileByPath(t,e)}compileIdentifierExpression(e,t,i){let s=this.module,a=this.currentFlow,l=a.sourceFunction;switch(e.kind){case 20:{let c=this.options;if(t.isReference){let f=t.getClass();if(f)return this.currentType=f.type.asNullable(),c.isWasm64?s.i64(0):s.i32(0);let _=t.getSignature();return _?(this.currentType=_.type.asNullable(),c.isWasm64?s.i64(0):s.i32(0)):this.makeZero(t)}return this.currentType=c.usizeType,this.warning(226,e.range,this.currentType.toString()),c.isWasm64?s.i64(0):s.i32(0)}case 27:return this.currentType=p.bool,s.i32(1);case 15:return this.currentType=p.bool,s.i32(0);case 26:{let c=l.signature.thisType;if(!c){if(l.prototype.capturesThis){let _=assert(a.lookupLocal(L.this_));return a.set(64),this.currentType=_.type,s.local_get(_.index,_.type.toRef())}return this.error(2332,e.range),this.currentType=this.options.usizeType,s.unreachable()}if(l.is(524288)&&(a.is(65536)&&this.error(2333,e.range),!(i&32))){let _=l.parent;assert(_.kind==7),this.checkFieldInitialization(_,e)}let f=assert(a.lookupLocal(L.this_));return a.set(64),this.currentType=c,s.local_get(f.index,c.toRef())}case 25:{if(l.is(524288)&&(a.is(65536)?this.error(2336,e.range):a.is(128)||this.error(17011,e.range)),a.isInline){let c=a.lookupLocal(L.this_);if(c){let _=assert(c.type.getClass()).base;if(_)return this.currentType=_.type,s.local_get(c.index,_.type.toRef())}}if(l.is(262144)){let c=assert(l.parent);assert(c.kind==7);let _=c.base;if(_){let d=_.type;return this.currentType=d,s.local_get(0,d.toRef())}}return this.error(2335,e.range),this.currentType=this.options.usizeType,s.unreachable()}}this.maybeCompileEnclosingSource(e);let o=this.currentParent;o||(o=l);let u=this.resolver.lookupIdentifierExpression(e,a,o);if(!u)return this.currentType==p.void&&(this.currentType=p.i32),s.unreachable();switch(u.kind){case 1:{let c=u,f=c.type;if(assert(f!=p.void),this.pendingElements.has(c))return this.error(2448,e.range,c.internalName),this.currentType=f,s.unreachable();if(c.is(33554432))return this.compileInlineConstant(c,t,i);let _=this.lazyLocals;if(_!=null){let b=J(_,c);if(b!=null)return this.compileLazyLocalRead(c,b,e)}let d=c.index;if(a.isLocalFlag(d,8)||this.error(2454,e.range,c.name),c.isViewLocal)return this.currentType=f,s.local_get(d,P.I32);if(c.fieldLocals!=null||c.isViewParam||d<0)return this.error(100,e.range,"reading an @inline struct value as a whole (a value has no address; read a field, or copy it with `let q: P = p`)"),this.currentType=f,s.unreachable();assert(d>=0);let m=a.isLocalFlag(d,4,!1);if(f.isNullableReference&&m&&(!f.isExternalReference||this.options.hasFeature(1024))?this.currentType=f.nonNullableType:this.currentType=f,!c.declaredByFlow(a))return this.error(100,e.range,"Closures"),s.unreachable();let h=s.local_get(d,f.toRef());return m&&f.isNullableExternalReference&&this.options.hasFeature(1024)&&(h=s.ref_as_nonnull(h)),h}case 0:{let c=u;if(!this.compileGlobalLazy(c,e))return s.unreachable();let f=c.type;if(this.pendingElements.has(c))return this.error(2448,e.range,c.internalName),this.currentType=f,s.unreachable();if(assert(f!=p.void),c.hasDecorator(512))return this.compileIdentifierExpressionBuiltin(c,e,t);if(c.is(33554432))return this.compileInlineConstant(c,t,i);let _=s.global_get(c.internalName,f.toRef());return c.is(16384)&&f.isReference&&!f.isNullableReference&&(_=this.makeRuntimeNonNullCheck(_,f,e)),this.currentType=f,_}case 3:{let c=u;return u.is(8388608)?(this.currentType=p.i32,c.is(33554432)?(assert(c.constantValueKind==1),s.i32(i64_low(c.constantIntegerValue))):s.global_get(c.internalName,P.I32)):(this.error(2651,e.range),this.currentType=p.i32,s.unreachable())}case 4:{let c=u,f=c.typeParameterNodes;if(f&&f.length!=0){this.error(1140,e.range);break}let _=this.resolver.resolveFunction(c,null,me(a.contextualTypeArguments));if(!_||!this.compileFunction(_))return s.unreachable();if(_.hasDecorator(512))return this.error(100,e.range,"First-class built-ins"),this.currentType=_.type,s.unreachable();if(t.isExternalReference)return this.currentType=p.func,s.ref_func(_.internalName,Fs(_.type));let d=this.ensureRuntimeFunction(_);return this.currentType=_.signature.type,this.options.isWasm64?s.i64(i64_low(d),i64_high(d)):s.i32(i64_low(d))}}return this.error(234,e.range),s.unreachable()}compileLazyLocalRead(e,t,i){let s=this.module,a=this.currentFlow,l=e.type,o=t.valueIndex,u=t.doneIndex,c=this.compileExpression(t.expression,l,1);if(!c)return s.unreachable();l.isShortIntegerValue&&(c=this.ensureSmallIntegerWrap(c,l));let f=this.currentType;c=this.convertExpression(c,f,l,!1,t.expression);let _=s.local_set(o,c,l.isManaged),d=s.local_set(u,s.i32(1),!1),m=s.if(s.unary(20,s.local_get(u,P.I32)),s.block(null,[_,d],P.None)),h=o,b=a.isLocalFlag(h,4,!1);return l.isNullableReference&&b&&(!l.isExternalReference||this.options.hasFeature(1024))?this.currentType=l.nonNullableType:this.currentType=l,this.options.sourceMap&&this.addDebugLocation(m,i.range),s.block(null,[m,s.local_get(h,this.currentType.toRef())],this.currentType.toRef())}compileIdentifierExpressionBuiltin(e,t,i){e.hasDecorator(8192)&&this.checkUnsafe(t,e.identifierNode);let s=e.internalName;return assert(At.has(s)),assert(At.get(s))(new Ws(this,e,i,t))}compileLoweredAwaitExpression(e){let t=J(lu(),e);if(!t)return this.error(100,e.range,"the async lowering transform did not run"),this.module.unreachable();let i=this.resolver.resolveExpression(e,this.currentFlow,p.auto,0);if(!i)return this.module.unreachable();if(i==p.void)return this.currentType=p.void,this.module.nop();if(i.isReference)return this.error(100,e.range,"a reference-typed await result"),this.module.unreachable();if(!i.isMemory)return this.error(203,e.range,"await",i.toString()),this.module.unreachable();let s;i==p.f32||i==p.f64||i==p.i64||i==p.u64?s=16:s=8;let a=this.compileExpression(t.recordExpression,p.auto,0);return this.currentType=i,this.module.load(i.byteSize,i.isSignedIntegerValue,a,i.toRef(),s,i.byteSize)}compileInstanceOfExpression(e,t,i){let s=this.currentFlow,a=e.isType;if(a.kind==1){let o=a;if(!(o.isNullable||o.hasTypeArguments)){let u=this.resolver.resolveTypeName(o.name,s,s.sourceFunction,1);if(u&&u.kind==6){let c=u;if(c.is(65536))return this.makeInstanceofClass(e,c)}}}let l=this.resolver.resolveType(e.isType,s,s.sourceFunction,me(s.contextualTypeArguments));return l?this.makeInstanceofType(e,l):(this.currentType=p.bool,this.module.unreachable())}makeInstanceofType(e,t){let i=this.module,s=this.currentFlow,a=this.compileExpression(e.expression,t),l=this.currentType;if(this.currentType=p.bool,t.isValue)return i.maybeDropCondition(a,i.i32(l==t?1:0));if(l.isValue)return i.maybeDropCondition(a,i.i32(0));let o=l.toRef();if(l.isNullableReference&&!t.isNullableReference){if(l.nonNullableType.isAssignableTo(t))return i.binary(o==P.I64?41:16,a,this.makeZero(l));if(l.nonNullableType.hasSubtypeAssignableTo(t))if(l.isUnmanaged||t.isUnmanaged)this.error(2365,e.range,"instanceof",l.toString(),t.toString());else{this.options.pedantic&&this.pedantic(903,e.range);let c=s.getTempLocal(l).index;return i.if(i.unary(o==P.I64?21:20,i.local_tee(c,a,l.isManaged)),i.i32(0),i.call(this.prepareInstanceOf(t.classReference),[i.local_get(c,o)],P.I32))}}else{if(l.isAssignableTo(t))return i.maybeDropCondition(a,i.i32(1));if(l.hasSubtypeAssignableTo(t))if(l.isUnmanaged||t.isUnmanaged)this.error(2365,e.range,"instanceof",l.toString(),t.toString());else{let c=s.getTempLocal(l).index;return i.if(i.unary(o==P.I64?21:20,i.local_tee(c,a,l.isManaged)),i.i32(0),i.call(this.prepareInstanceOf(t.classReference),[i.local_get(c,o)],P.I32))}}return i.maybeDropCondition(a,i.i32(0))}prepareInstanceOf(e){let t=`~instanceof|${e.internalName}`,i=this.pendingInstanceOf;if(i.has(e))return assert(i.get(e));i.set(e,t);let s=this.module;return s.addFunction(t,this.options.sizeTypeRef,P.I32,null,s.unreachable()),t}finalizeInstanceOf(e,t){let i=this.program,s=this.module,a=this.options.sizeTypeRef,l=new Array;l.push(s.local_set(1,s.load(4,!1,s.binary(a==P.I64?26:1,s.local_get(0,a),s.i32(i.totalOverhead-i.OBJECTInstance.offsetof("rtId"))),P.I32),!1));let o;if(e.isInterface)o=e.implementers;else{o=new Set,o.add(e);let u=e.extenders;if(u)for(let c=Set_values(u),f=0,_=c.length;f<_;++f){let d=c[f];o.add(d)}}if(o)for(let u=Set_values(o),c=0,f=u.length;c<f;++c){let _=u[c];l.push(s.br("is_instance",s.binary(15,s.local_get(1,P.I32),s.i32(_.id))))}l.push(s.return(s.i32(0))),l[0]=s.block("is_instance",l,P.None),l.length=1,l.push(s.i32(1)),s.removeFunction(t),s.addFunction(t,a,P.I32,[P.I32],s.block(null,l,P.I32))}makeInstanceofClass(e,t){let i=this.module,s=this.compileExpression(e.expression,p.auto),a=this.currentType,l=a.toRef();this.currentType=p.bool;let o=a.getClass();if(o){if(o.extendsPrototype(t))return a.isNullableReference?i.binary(l==P.I64?41:16,s,this.makeZero(a)):i.maybeDropCondition(s,i.i32(1));if(t.extends(o.prototype)){let f=this.currentFlow.getTempLocal(a).index;return i.if(i.unary(l==P.I64?21:20,i.local_tee(f,s,a.isManaged)),i.i32(0),i.call(this.prepareAnyInstanceOf(t),[i.local_get(f,l)],P.I32))}}return i.maybeDropCondition(s,i.i32(0))}prepareAnyInstanceOf(e){let t=`~anyinstanceof|${e.internalName}`,i=this.pendingInstanceOf;if(i.has(e))return assert(i.get(e));i.set(e,t);let s=this.module;return s.addFunction(t,this.options.sizeTypeRef,P.I32,null,s.unreachable()),t}finalizeAnyInstanceOf(e,t){let i=this.module,s=this.options.sizeTypeRef,a=new Array,l=e.instances;if(l){let o=this.program;a.push(i.local_set(1,i.load(4,!1,i.binary(s==P.I64?26:1,i.local_get(0,s),i.i32(o.totalOverhead-o.OBJECTInstance.offsetof("rtId"))),P.I32),!1));let u=new Set;for(let c=Map_values(l),f=0,_=c.length;f<_;++f){let d=c[f];if(d.isInterface){let m=d.implementers;if(m)for(let h=Set_values(m),b=0,A=h.length;b<A;++b){let S=h[b];u.add(S)}}else{u.add(d);let m=d.extenders;if(m)for(let h=Set_values(m),b=0,A=h.length;b<A;++b){let S=h[b];u.add(S)}}}for(let c=Set_values(u),f=0,_=c.length;f<_;++f){let d=c[f];a.push(i.br("is_instance",i.binary(15,i.local_get(1,P.I32),i.i32(d.id))))}}a.push(i.return(i.i32(0))),a[0]=i.block("is_instance",a,P.None),a.length=1,a.push(i.i32(1)),i.removeFunction(t),i.addFunction(t,s,P.I32,[P.I32],i.block(null,a,P.I32))}compileLiteralExpression(e,t,i,s=!1){let a=this.module;switch(e.literalKind){case 5:return assert(!s),this.compileArrayLiteral(e,t,i);case 0:{let l=e.value;return s&&(l=-l),t==p.f32?a.f32(l):(this.currentType=p.f64,a.f64(l))}case 1:{let l=e,o=this.resolver.determineIntegerLiteralType(l,s,t);this.currentType=o;let u=l.value,c=1;switch(s&&(o.isFloatValue?c=-1:u=i64_neg(u)),o.kind){case 5:if(!this.options.isWasm64)return a.i32(i64_low(u));case 4:return a.i64(i64_low(u),i64_high(u));case 10:if(!this.options.isWasm64)return a.i32(i64_low(u));case 9:return a.i64(i64_low(u),i64_high(u));case 11:return a.f32(c*i64_to_f32(u));case 12:return a.f64(c*i64_to_f64(u));default:return a.i32(i64_low(u))}}case 2:return assert(!s),this.compileStringLiteral(e,i);case 3:return assert(!s),this.compileTemplateLiteral(e,i);case 6:return assert(!s),this.compileObjectLiteral(e,t);case 4:return this.error(100,e.range,"Regular expressions"),this.currentType=t,a.unreachable()}return assert(!1),a.unreachable()}compileStringLiteral(e,t){return this.ensureStaticString(e.value)}compileTemplateLiteral(e,t){let i=e.tag,s=e.parts,a=s.length,l=e.expressions,o=l.length;assert(o==a-1);let u=this.module,c=this.program.stringInstance,f=c.type;if(!i){if(a==1)return this.ensureStaticString(s[0]);if(a==2){let V=l[0],Y=s[0].length,q=s[1].length;if(!Y&&!q)return this.makeToString(this.compileExpression(V,f),this.currentType,V);let ne=Y!=0;if(ne^q!=0){let j,ge,ue=this.makeToString(this.compileExpression(V,f),this.currentType,V);ne?(j=this.ensureStaticString(s[0]),ge=ue):(j=ue,ge=this.ensureStaticString(s[1]));let _e=assert(c.getMethod("concat"));return this.makeCallDirect(_e,[j,ge],V)}}if(a==3&&!s[0].length&&!s[1].length&&!s[2].length){let V=l[0],Y=l[1],q=this.makeToString(this.compileExpression(V,f),this.currentType,V),ne=this.makeToString(this.compileExpression(Y,f),this.currentType,Y),j=assert(c.getMethod("concat"));return this.makeCallDirect(j,[q,ne],e)}let k=new Array(o),w=new Array;s[0].length>0&&w.push(this.ensureStaticString(s[0]));for(let V=1;V<a;++V)k[V-1]=w.length,w.push(u.usize(0)),s[V].length>0&&w.push(this.ensureStaticString(s[V]));let R=assert(this.resolver.resolveClass(this.program.staticArrayPrototype,[f])),C=this.addStaticBuffer(f,w,R.id);this.program.OBJECTInstance.writeField("gcInfo",3,C.buffer,0);let M=i64_add(C.offset,i64_new(this.program.totalOverhead)),O=assert(R.getMethod("join")),D=assert(R.lookupOverload(2,!0)),Q=new Array(2*o+1),H=new Array(o),U=this.currentFlow;for(let V=0;V<o;++V){let Y=l[V],q=U.getTempLocal(f);H[V]=q,Q[V]=u.local_set(q.index,this.makeToString(this.compileExpression(Y,f),this.currentType,Y),!0)}for(let V=0;V<o;++V)Q[o+V]=this.makeCallDirect(D,[u.usize(M),u.i32(k[V]),u.local_get(H[V].index,f.toRef())],e);return Q[2*o]=this.makeCallDirect(O,[u.usize(M),this.ensureStaticString("")],e),u.flatten(Q,f.toRef())}let _=this.program.templateStringsArrayInstance,d=_,m=this.resolver.lookupExpression(i,this.currentFlow,p.auto,1);if(m)switch(m.kind){case 4:{let k=this.resolver.resolveFunction(m,null,new Map,1);if(!k)break;m=k}case 5:{let w=m.signature.parameterTypes;if(w.length){let R=w[0].getClass();R&&!R.extendsPrototype(_.prototype)&&(d=assert(this.resolver.resolveClass(this.program.arrayPrototype,[f])))}break}}let h=e.rawParts;assert(h.length==a);let b=new Array(a);for(let k=0;k<a;++k)b[k]=this.ensureStaticString(s[k]);let A;if(d==_){let k=new Array(a);for(let R=0;R<a;++R)k[R]=this.ensureStaticString(h[R]);A=this.addStaticArrayHeader(f,this.addStaticBuffer(this.options.usizeType,b),d);let w=this.addStaticArrayHeader(f,this.addStaticBuffer(this.options.usizeType,k));d.writeField("raw",i64_add(w.offset,i64_new(this.program.totalOverhead)),A.buffer)}else A=this.addStaticArrayHeader(f,this.addStaticBuffer(this.options.usizeType,b),d);let S=l.slice();return S.unshift(y.createCompiledExpression(u.usize(i64_add(A.offset,i64_new(this.program.totalOverhead))),d.type,Te.native.range)),this.error(100,e.range,"Tagged template literals"),this.compileCallExpressionLike(i,null,S,e.range,f)}compileArrayLiteral(e,t,i){let s=this.module,a=this.currentFlow,l=this.program,o=t.getClass();if(o&&o.extendsPrototype(l.staticArrayPrototype))return this.compileStaticArrayLiteral(e,t,i);let u=this.resolver.lookupExpression(e,a,this.currentType);if(!u)return s.unreachable();assert(u.kind==7);let c=u,f=c.type,_=c.getTypeArgumentsTo(l.arrayPrototype)[0],d=a.getTempLocal(this.options.usizeType),m=e.elementExpressions,h=m.length,b=new Array(h),A=!_.isExternalReference;for(let M=0;M<h;++M){let O=m[M];if(O.kind!=21){let D=this.compileExpression(O,_,1);if(fe(D)!=_.toRef())A=!1;else{let Q=s.runExpression(D,1);Q?D=Q:A=!1}b[M]=D}else b[M]=this.makeZero(_)}if(A){let M=l.totalOverhead,O=this.addStaticBuffer(_,b),D=i64_add(O.offset,i64_new(M));if(i&16){let Q=this.addStaticArrayHeader(_,O),H=i64_add(Q.offset,i64_new(M));return this.currentType=f,l.options.isWasm64?this.module.i64(i64_low(H),i64_high(H)):this.module.i32(i64_low(H))}else return this.makeNewArray(c,h,D,e)}let S=c.lookupOverload(2,!0);if(!S)return this.error(2542,e.range,c.internalName),this.currentType=f,s.unreachable();let k=f.toRef(),w=new Array;w.push(s.local_set(d.index,this.makeNewArray(c,h,i64_new(0),e),f.isManaged));let R=assert(c.getMember("dataStart"));assert(R.kind==10);let C=R.instance;if(!C)return s.unreachable();assert(C.isField&&C.memoryOffset>=0);for(let M=0;M<h;++M)w.push(s.call(S.internalName,[s.local_get(d.index,k),s.i32(M),b[M]],P.None));return w.push(s.local_get(d.index,k)),h&&this.compileFunction(S),this.currentType=f,s.flatten(w,k)}makeNewArray(e,t,i,s){let a=this.program,l=this.module;assert(!e.extendsPrototype(a.staticArrayPrototype));let o=e.getArrayValueType(),u=this.makeCallDirect(a.newArrayInstance,[l.i32(t),a.options.isWasm64?l.i64(o.alignLog2):l.i32(o.alignLog2),l.i32(e.id),a.options.isWasm64?l.i64(i64_low(i),i64_high(i)):l.i32(i64_low(i))],s);return this.currentType=e.type,u}compileStaticArrayLiteral(e,t,i){let s=this.module,a=this.currentFlow,l=this.program,o=assert(t.getClass()),u=o.type,f=assert(o.getTypeArgumentsTo(l.staticArrayPrototype))[0],_=a.getTempLocal(this.options.usizeType),d=e.elementExpressions,m=d.length,h=new Array(m),b=!f.isExternalReference;for(let C=0;C<m;++C){let M=d[C];if(M.kind!=21){let O=this.compileExpression(M,f,1),D=s.runExpression(O,1);D?O=D:b=!1,h[C]=O}else h[C]=this.makeZero(f)}let A=this.options.isWasm64,S=h.length<<f.alignLog2;if(b){let C=this.addStaticBuffer(f,h,o.id),M=i64_add(C.offset,i64_new(l.totalOverhead));if(i&16){let O=this.options.isWasm64?s.i64(i64_low(M),i64_high(M)):s.i32(i64_low(M));return this.currentType=u,O}else{let O=this.makeCallDirect(l.newBufferInstance,[A?s.i64(S):s.i32(S),s.i32(o.id),A?s.i64(i64_low(M),i64_high(M)):s.i32(i64_low(M))],e);return this.currentType=u,O}}let k=o.lookupOverload(2,!0);if(!k)return this.error(2542,e.range,o.internalName),this.currentType=u,s.unreachable();let w=u.toRef(),R=new Array;R.push(s.local_set(_.index,this.makeCallDirect(l.newBufferInstance,[A?s.i64(S):s.i32(S),s.i32(o.id)],e),u.isManaged));for(let C=0;C<m;++C)R.push(s.call(k.internalName,[s.local_get(_.index,w),s.i32(C),h[C]],P.None));return R.push(s.local_get(_.index,w)),m&&this.compileFunction(k),this.currentType=u,s.flatten(R,w)}compileObjectLiteral(e,t){let i=this.module,s=t.getClass();if(!s)return this.error(2322,e.range,"<object>",t.toString()),i.unreachable();let a=s.type;if(this.currentType=a.nonNullableType,s.kind==9)return this.error(100,e.range,"Interface hidden classes"),i.unreachable();if(s.is(128))return this.error(2511,e.range),i.unreachable();let l=s.prototype.constructorPrototype;if(l)return this.errorRelated(216,e.range,l.identifierNode.range,a.toString()),i.unreachable();a.isManaged||this.checkUnsafe(e,$t(6,s.decoratorNodes));let u=e.names,c=u.length,f=e.values,_=s.members,d=!1,m=new Array,b=this.currentFlow.getTempLocal(a),A=a.toRef();assert(c==f.length);let S=new Set;if(_)for(let R=Map_keys(_),C=0,M=R.length;C<M;++C){let O=R[C],D=assert(_.get(O));if(D&&D.kind==10){let Q=D.instance;Q&&Q.isField&&S.add(Q)}}let k=new Array;for(let R=0;R<c;++R){let C=u[R].text,M=s.getMember(C);if(!M||M.kind!=10){this.error(2339,u[R].range,C,a.toString()),d=!0;continue}if(M.is(512)){this.error(2341,u[R].range,C,a.toString()),d=!0;continue}if(M.is(1024)){this.error(2445,u[R].range,C,a.toString()),d=!0;continue}let O=this.resolver.resolveProperty(M);if(!O)continue;let D=O.setterInstance;if(!D){this.error(2540,u[R].range,C,a.toString()),d=!0;continue}if(S.delete(O),!O.isField){k.push(O);continue}let Q=O.type,H=this.makeCallDirect(D,[i.local_get(b.index,A),this.compileExpression(f[R],Q,1)],D.identifierNode,!0);this.currentType!=p.void&&(H=i.drop(H)),m.push(H)}for(let R=0,C=k.length;R<C;++R){let M=k[R],O=assert(M.setterInstance);m.push(this.makeCallDirect(O,[i.local_get(b.index,A),this.compileExpression(f[R],M.type,1)],O.identifierNode))}if(this.currentType=a.nonNullableType,d)return i.unreachable();for(let R=Set_values(S),C=0,M=R.length;C<M;++C){let O=R[C];assert(O.isField);let D=O.type;if(!O.initializerNode){if(D.isReference&&!D.isNullableReference){this.error(2741,e.range,O.name,"<object>",a.toString()),d=!0;continue}switch(D.kind){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:{m.push(i.store(D.byteSize,i.local_get(b.index,A),this.makeZero(D),D.toRef(),O.memoryOffset));continue}}this.error(2741,e.range,O.name,"<object>",a.toString()),d=!0}}if(d)return i.unreachable();let w=this.ensureConstructor(s,e);return m.unshift(i.local_set(b.index,this.compileInstantiate(w,[],0,e),a.isManaged)),m.push(i.local_get(b.index,A)),this.currentType=a.nonNullableType,i.flatten(m,A)}compileNewExpression(e,t,i){let s=this.module,a=this.currentFlow,l=this.resolver.resolveTypeName(e.typeName,a,a.sourceFunction);if(!l)return s.unreachable();if(l.kind!=6)return this.error(2351,e.typeName.range),this.module.unreachable();if(l.is(128))return this.error(2511,e.typeName.range),this.module.unreachable();let o=l,u=null,c=e.typeArguments,f;if(!c&&(f=t.classReference)&&f.prototype==o&&f.is(65536)?u=this.resolver.resolveClass(o,f.typeArguments,me(a.contextualTypeArguments)):u=this.resolver.resolveClassInclTypeArguments(o,c,a,a.sourceFunction.parent,me(a.contextualTypeArguments),e),!u)return s.unreachable();t==p.void&&(i|=8);let _=this.ensureConstructor(u,e);return _.hasDecorator(64)||this.checkFieldInitialization(u,e),this.compileInstantiate(_,e.args,i,e)}ensureConstructor(e,t){let i=e.constructorInstance;if(i){if(i.is(8388608))return i;i.hasDecorator(64)||this.compileFunction(i)}else{let s=e.base,a=me(e.contextualTypeArguments);if(s){let k=this.ensureConstructor(s,t);this.checkFieldInitialization(s,t),i=new Mt(L.constructor,new ot(L.constructor,e,k.declaration.clone()),null,oe.create(this.program,k.signature.parameterTypes,e.type,e.type,k.signature.requiredParameters,k.signature.hasRest,e.hasDecorator(4096)),a)}else i=new Mt(L.constructor,new ot(L.constructor,e,this.program.makeNativeFunctionDeclaration(L.constructor,786432)),null,oe.create(this.program,[],e.type,e.type,0,!1,e.hasDecorator(4096)),a);i.set(8388608),i.prototype.setResolvedInstance("",i),e.is(1048576)&&i.set(1048576),e.constructorInstance=i;let l=e.members;l||(e.members=l=new Map),l.set(L.constructor,i.prototype);let o=this.currentFlow,u=i.flow;this.currentFlow=u;let c=i.signature,f=this.module,_=this.options.sizeTypeRef,d=new Array;if(d.push(this.makeConditionalAllocation(e,0)),s){let k=c.parameterTypes,w=k.length,R=new Array(1+w);R[0]=f.local_get(0,_);for(let C=1;C<=w;++C)R[C]=f.local_get(C,k[C-1].toRef());d.push(f.local_set(0,this.makeCallDirect(assert(s.constructorInstance),R,t,!1),s.type.isManaged))}this.makeFieldInitializationInConstructor(e,d),d.push(f.local_get(0,_)),this.currentFlow=o;let m=i.localsByIndex,h=new Array,b=1+c.parameterTypes.length,A=m.length;if(A>b)for(let k=b;k<A;++k)h.push(m[k].type.toRef());let S=f.addFunction(i.internalName,c.paramRefs,c.resultRefs,h,f.flatten(d,_));i.finalize(f,S)}return i}checkFieldInitialization(e,t=null){if(e.didCheckFieldInitialization)return;e.didCheckFieldInitialization=!0;let i=assert(e.constructorInstance);this.checkFieldInitializationInFlow(e,i.flow,t)}checkFieldInitializationInFlow(e,t,i=null){let s=e.members;if(s)for(let a=Map_values(s),l=0,o=a.length;l<o;++l){let u=a[l];if(u.kind!=10||u.parent!=e)continue;let c=u.instance;if(!c||!c.isField)continue;let f=c.type;f.kind==14&&(f.fixedMemoryModel==0||f.fixedMemoryModel==1)||(!c.initializerNode&&!t.isThisFieldFlag(c,1)?c.is(16384)||(i?this.errorRelated(2564,c.declaration.name.range,i.range,c.internalName):this.error(2564,c.declaration.name.range,c.internalName)):c.is(16384)&&(c.type.isReference?this.warning(233,c.identifierNode.range,c.internalName):this.pedantic(906,c.identifierNode.range)))}}compileInstantiate(e,t,i,s){assert(e.is(524288));let a=e.parent;assert(a.kind==7);let l=a;(l.type.isUnmanaged||e.hasDecorator(8192))&&this.checkUnsafe(s);let o=this.compileCallDirect(e,t,s,this.makeZero(this.options.usizeType),i);return fe(o)!=P.None&&(this.currentType=l.type),o}compilePropertyAccessExpression(e,t,i){let s=this.module,a=this.currentFlow;this.maybeCompileEnclosingSource(e);let l=this.resolver;{let c=null;if(e.expression.kind==8){let f=a.lookupLocal(e.expression.text);f!=null&&(c=f.type)}if(c!=null&&c.kind==28){if(e.property.text!="length")return this.error(2339,e.property.range,e.property.text,c.toString()),s.unreachable();let f=this.compileExpression(e.expression,c,1);return this.currentType=p.i32,s.load(4,!1,f,P.I32,0,4)}}let o=l.lookupExpression(e,a,t);if(!o)return s.unreachable();let u=l.currentThisExpression;switch(o.hasDecorator(8192)&&this.checkUnsafe(e),o.kind){case 0:{let c=o;if(!this.compileGlobalLazy(c,e))return s.unreachable();let f=c.type;if(assert(f!=p.void),this.pendingElements.has(c))return this.error(2448,e.range,c.internalName),this.currentType=f,s.unreachable();if(c.is(33554432))return this.compileInlineConstant(c,t,i);let _=s.global_get(c.internalName,f.toRef());return c.is(16384)&&f.isReference&&!f.isNullableReference&&(_=this.makeRuntimeNonNullCheck(_,f,e)),this.currentType=f,_}case 3:{let c=o,f=assert(c.parent);assert(f.kind==2);let _=f;return this.compileEnum(_)?(this.currentType=c.type,c.is(33554432)?(assert(c.constantValueKind==1),this.compileInlineConstant(c,t,i)):s.global_get(c.internalName,P.I32)):(this.currentType=_.type,this.module.unreachable())}case 10:{let c=o,f=this.resolver.resolveProperty(c);if(!f)return s.unreachable();o=f}case 11:{let c=o;if(c.isField&&a.sourceFunction.is(524288)&&assert(u).kind==26&&!a.isThisFieldFlag(c,1)&&!c.is(16384)&&this.errorRelated(2565,e.range,c.identifierNode.range,c.internalName),u!=null&&u.kind==14){let m=this.compileSroaArrayLeafByRuntimeIndex(u,c);if(m!=0)return m}let f=u!=null?this.resolveSroaReceiver(u):null;if(f!=null){let m=assert(f.fieldLocals);if(!c.isField||!m.has(c.name))return this.error(100,e.range,"reading this member of an @inline struct (only supported fields are readable; a refused or computed member has no local)"),s.unreachable();let h=assert(m.get(c.name));return h.index<0?(this.error(100,e.range,"reading a nested @inline struct value as a whole (the field is several leaves, not one value; read one of its fields)"),s.unreachable()):(this.currentType=c.type,s.local_get(h.index,h.type.toRef()))}if(u!=null&&c.isField&&this.resolver.isViewCall(u)){let m=c.type,h=this.compileExpression(u,p.auto);return this.currentType=m,this.viewFieldAccess(h,c,m)}if(u!=null&&u.kind==8&&c.isField){let m=a.lookupLocal(u.text);if(m!=null&&(m.isViewParam||m.isViewLocal)){let h=c.type;return this.currentType=h,this.viewFieldAccess(s.local_get(m.index,P.I32),c,h)}}if(u!=null&&u.kind==11&&c.isField){let m=this.resolver.resolveExpression(u,this.currentFlow);if(m!=null&&this.isInlineStructType(m))return this.makeSretCallBlock(u,m,c.type,c,null)}if(c.type.kind==14||c.isField&&this.isInlineStructType(c.type)){let m=this.resolver.resolveExpression(assert(u),this.currentFlow);if(!m)return s.unreachable();let h=this.compileExpression(assert(u),m,33);this.currentType=c.type;let b=c.memoryOffset;return b?s.binary(217,h,this.options.isWasm64?s.i64(b):s.i32(b)):h}let _=c.getterInstance;if(!_)return s.unreachable();let d=0;return _.is(262144)&&(d=this.compileExpression(assert(u),assert(_.signature.thisType),33)),this.compileCallDirect(_,[],e,d)}case 4:{let c=o,f=c.typeParameterNodes;if(f&&f.length!=0){this.error(1140,e.range);break}let _=this.resolver.resolveFunction(c,null);if(!_||!this.compileFunction(_))return s.unreachable();if(this.currentType=_.type,_.hasDecorator(512))return this.error(100,e.range,"First-class built-ins"),s.unreachable();let d=this.ensureRuntimeFunction(_);return this.options.isWasm64?s.i64(i64_low(d),i64_high(d)):s.i32(i64_low(d))}}return this.error(234,e.range),this.module.unreachable()}compileTernaryExpression(e,t,i){let s=this.module,a=e.ifThen,l=e.ifElse,o=this.compileExpression(e.condition,p.bool),u=this.makeIsTrueish(o,this.currentType,e.condition),c=this.evaluateCondition(u);if(c==1)return s.maybeDropCondition(u,this.compileExpression(a,t));if(c==2)return s.maybeDropCondition(u,this.compileExpression(l,t));let f=this.currentFlow,_=f.forkThen(o);this.currentFlow=_;let d=this.compileExpression(a,t),m=this.currentType,h=f.forkElse(o);this.currentFlow=h;let b=this.compileExpression(l,t==p.auto?m:t),A=this.currentType;if(t==p.void)m!=p.void&&(d=s.drop(d),m=p.void),A!=p.void&&(b=s.drop(b),A=p.void),this.currentType=p.void;else{let S=p.commonType(m,A,t);if(!S)return this.error(2322,l.range,A.toString(),m.toString()),this.currentType=t,s.unreachable();d=this.convertExpression(d,m,S,!1,a),m=S,b=this.convertExpression(b,A,S,!1,l),A=S,this.currentType=S}return f.inheritAlternatives(_,h),this.currentFlow=f,s.if(u,d,b)}compileUnaryPostfixExpression(e,t,i){let s=this.module,a=this.currentFlow,l=this.compileExpression(e.operand,t.exceptVoid,0),o,u=null;t!=p.void?(u=a.getTempLocal(this.currentType),o=s.local_tee(u.index,l,this.currentType.isManaged)):o=l;let c;switch(e.operator){case 88:{let h=this.currentType.getClassOrWrapper(this.program);if(h){let b=h.lookupOverload(29);if(b){let A=b.is(262144);if(u&&!A&&(o=l,u=null),c=this.compileUnaryOverload(b,e.operand,o,e),A)break;return c}}if(!this.currentType.isValue)return this.error(2469,e.range,"++",this.currentType.toString()),s.unreachable();switch(this.currentType.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:{c=s.binary(0,o,s.i32(1));break}case 4:case 9:{c=s.binary(25,o,s.i64(1));break}case 5:case 10:{c=s.binary(217,o,this.makeOne(this.currentType));break}case 11:{c=s.binary(50,o,s.f32(1));break}case 12:{c=s.binary(63,o,s.f64(1));break}default:return this.error(2469,e.range,"++",this.currentType.toString()),s.unreachable()}break}case 89:{let h=this.currentType.getClassOrWrapper(this.program);if(h){let b=h.lookupOverload(30);if(b){let A=b.is(262144);if(u&&!A&&(o=l,u=null),c=this.compileUnaryOverload(b,e.operand,o,e),A)break;return c}}if(!this.currentType.isValue)return this.error(2469,e.range,"--",this.currentType.toString()),s.unreachable();switch(this.currentType.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:{c=s.binary(1,o,s.i32(1));break}case 4:case 9:{c=s.binary(26,o,s.i64(1));break}case 5:case 10:{c=s.binary(218,o,this.makeOne(this.currentType));break}case 11:{c=s.binary(51,o,s.f32(1));break}case 12:{c=s.binary(64,o,s.f64(1));break}default:return this.error(2469,e.range,"--",this.currentType.toString()),s.unreachable()}break}default:return assert(!1),s.unreachable()}let f=this.resolver;if(e.operand.kind==14){let h=e.operand,b=f.resolveExpression(h.expression,a);if(b&&b.kind==14){let A=this.compileFixedArrayElementAccess(h,b,!0,t,0,null,c);return u?s.block(null,[A,s.local_get(u.index,this.currentType.toRef())],this.currentType.toRef()):A}if(b&&b.kind==27){let A=this.compileUnmanagedArrayElementAccess(h,b,!0,p.void,0,null,c);return this.currentType=b.unmanagedArrayElementType,u?s.block(null,[A,s.local_get(u.index,this.currentType.toRef())],this.currentType.toRef()):A}if(b&&b.kind==28){let A=this.compileDynamicArrayElementAccess(h,b,!0,p.void,0,null,c);return this.currentType=this.dynamicArrayElementOf(b),u?s.block(null,[A,s.local_get(u.index,this.currentType.toRef())],this.currentType.toRef()):A}if(b&&this.isManagedDynamicArrayType(b)){let A=this.compileDynamicArrayElementAccess(h,b,!0,p.void,0,null,c);return this.currentType=this.dynamicArrayElementOf(b),u?s.block(null,[A,s.local_get(u.index,this.currentType.toRef())],this.currentType.toRef()):A}}let _=f.lookupExpression(e.operand,a);if(!_)return s.unreachable();if(!u)return this.makeAssignment(_,c,this.currentType,e.operand,f.currentThisExpression,f.currentElementExpression,!1);let d=this.makeAssignment(_,c,this.currentType,e.operand,f.currentThisExpression,f.currentElementExpression,!1);this.currentType=u.type;let m=u.type.toRef();return s.block(null,[d,s.local_get(u.index,m)],m)}compileUnaryPrefixExpression(e,t,i){let s=this.module,a=!1,l;switch(e.operator){case 82:{l=this.compileExpression(e.operand,t.exceptVoid,0);let c=this.currentType.getClassOrWrapper(this.program);if(c){let f=c.lookupOverload(23);if(f)return this.compileUnaryOverload(f,e.operand,l,e)}if(!this.currentType.isValue)return this.error(2469,e.range,"+",this.currentType.toString()),s.unreachable();break}case 83:{let c=e.operand;if(c.isNumericLiteral){l=this.compileLiteralExpression(c,t,0,!0),this.options.sourceMap&&this.addDebugLocation(l,e.range);break}l=this.compileExpression(e.operand,t.exceptVoid,0);let f=this.currentType.getClassOrWrapper(this.program);if(f){let _=f.lookupOverload(24);if(_)return this.compileUnaryOverload(_,e.operand,l,e)}if(!this.currentType.isValue)return this.error(2469,e.range,"-",this.currentType.toString()),s.unreachable();switch(this.currentType.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:{l=s.binary(1,s.i32(0),l);break}case 4:case 9:{l=s.binary(26,s.i64(0),l);break}case 5:case 10:{l=s.binary(218,this.makeZero(this.currentType),l);break}case 11:{l=s.unary(6,l);break}case 12:{l=s.unary(7,l);break}default:this.error(2469,e.range,"-",this.currentType.toString()),l=s.unreachable()}break}case 88:{a=!0,l=this.compileExpression(e.operand,t.exceptVoid,0);let c=this.currentType.getClassOrWrapper(this.program);if(c){let f=c.lookupOverload(27);if(f){if(l=this.compileUnaryOverload(f,e.operand,l,e),f.is(262144))break;return l}}if(!this.currentType.isValue)return this.error(2469,e.range,"++",this.currentType.toString()),s.unreachable();switch(this.currentType.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:{l=s.binary(0,l,this.module.i32(1));break}case 4:case 9:{l=s.binary(25,l,s.i64(1));break}case 5:case 10:{l=s.binary(217,l,this.makeOne(this.currentType));break}case 11:{l=s.binary(50,l,s.f32(1));break}case 12:{l=s.binary(63,l,s.f64(1));break}default:this.error(2469,e.range,"++",this.currentType.toString()),l=s.unreachable()}break}case 89:{a=!0,l=this.compileExpression(e.operand,t.exceptVoid,0);let c=this.currentType.getClassOrWrapper(this.program);if(c){let f=c.lookupOverload(28);if(f){if(l=this.compileUnaryOverload(f,e.operand,l,e),f.is(262144))break;return l}}if(!this.currentType.isValue)return this.error(2469,e.range,"--",this.currentType.toString()),s.unreachable();switch(this.currentType.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:{l=s.binary(1,l,s.i32(1));break}case 4:case 9:{l=s.binary(26,l,s.i64(1));break}case 5:case 10:{l=s.binary(218,l,this.makeOne(this.currentType));break}case 11:{l=s.binary(51,l,s.f32(1));break}case 12:{l=s.binary(64,l,s.f64(1));break}default:this.error(2469,e.range,"--",this.currentType.toString()),l=s.unreachable()}break}case 96:{l=this.compileExpression(e.operand,t.exceptVoid,0);let c=this.currentType.getClassOrWrapper(this.program);if(c){let f=c.lookupOverload(25);if(f)return this.compileUnaryOverload(f,e.operand,l,e)}l=s.unary(20,this.makeIsTrueish(l,this.currentType,e.operand)),this.currentType=p.bool;break}case 97:{l=this.compileExpression(e.operand,t==p.void?p.i32:t.isFloatValue?p.i64:t,0);let c=this.currentType.getClassOrWrapper(this.program);if(c){let f=c.lookupOverload(26);if(f)return this.compileUnaryOverload(f,e.operand,l,e)}if(!this.currentType.isValue)return this.error(2469,e.range,"~",this.currentType.toString()),s.unreachable();switch(l=this.convertExpression(l,this.currentType,this.currentType.intType,!1,e.operand),this.currentType.kind){case 0:case 1:case 2:case 3:case 6:case 7:case 8:{l=s.binary(9,l,s.i32(-1));break}case 4:case 9:{l=s.binary(34,l,s.i64(-1,-1));break}case 5:case 10:{l=s.binary(226,l,this.makeNegOne(this.currentType));break}default:this.error(2469,e.range,"~",this.currentType.toString()),l=s.unreachable()}break}case 57:return this.compileTypeof(e,t,i);case 70:return this.error(100,e.range,"Spread operator"),s.unreachable();default:return assert(!1),s.unreachable()}if(!a)return l;let o=this.resolver;if(e.operand.kind==14){let c=e.operand,f=o.resolveExpression(c.expression,this.currentFlow);if(f&&f.kind==27)return this.currentType=f.unmanagedArrayElementType,this.compileUnmanagedArrayElementAccess(c,f,!0,this.currentType,0,null,l);if(f&&f.kind==28)return this.currentType=this.dynamicArrayElementOf(f),this.compileDynamicArrayElementAccess(c,f,!0,this.currentType,0,null,l);if(f&&this.isManagedDynamicArrayType(f))return this.currentType=this.dynamicArrayElementOf(f),this.compileDynamicArrayElementAccess(c,f,!0,this.currentType,0,null,l)}let u=o.lookupExpression(e.operand,this.currentFlow);return u?this.makeAssignment(u,l,this.currentType,e.operand,o.currentThisExpression,o.currentElementExpression,t!=p.void):s.unreachable()}compileTypeof(e,t,i){let s=e.operand,a=0,l=this.program.stringInstance,o;if(s.kind==20)o="object";else{let u=this.resolver.lookupExpression(s,this.currentFlow,p.auto,1);if(u)switch(u.kind){case 6:case 12:case 2:{o="object";break}case 4:{o="function";break}default:{a=this.compileExpression(s,p.auto);let c=this.currentType;if(a=this.convertExpression(a,c,p.void,!0,s),c.isReference)if(c.getSignature())o="function";else{let _=c.getClass();_?_.prototype==l.prototype?o="string":o="object":o="externref"}else c==p.bool?o="boolean":c.isNumericValue?o="number":o="undefined";break}}else{switch(s.kind){case 8:break;case 23:case 14:if(s=(s.kind==23,s.expression),!this.resolver.resolveExpression(s,this.currentFlow,p.auto,0))return this.currentType=l.type,this.module.unreachable();default:a=this.compileExpression(s,p.auto),a=this.convertExpression(a,this.currentType,p.void,!0,s)}o="undefined"}}return this.currentType=l.type,a?this.module.block(null,[a,this.ensureStaticString(o)],this.options.sizeTypeRef):this.ensureStaticString(o)}ensureSmallIntegerWrap(e,t){let i=this.module,s=this.currentFlow;switch(t.kind){case 0:{s.canOverflow(e,t)&&(e=i.binary(16,e,i.i32(0)));break}case 1:{s.canOverflow(e,t)&&(e=this.options.hasFeature(1)?i.unary(47,e):i.binary(11,i.binary(10,e,i.i32(24)),i.i32(24)));break}case 2:{s.canOverflow(e,t)&&(e=this.options.hasFeature(1)?i.unary(48,e):i.binary(11,i.binary(10,e,i.i32(16)),i.i32(16)));break}case 6:{s.canOverflow(e,t)&&(e=i.binary(7,e,i.i32(255)));break}case 7:{s.canOverflow(e,t)&&(e=i.binary(7,e,i.i32(65535)));break}}return e}addDebugLocation(e,t){let i=this.currentFlow.targetFunction,s=t.source;s.debugInfoIndex<0&&(s.debugInfoIndex=this.module.addDebugInfoFile(s.normalizedPath)),i.debugLocations.set(e,t)}checkSignatureSupported(e,t){let i=!0,s=t.explicitThisType;s&&(this.program.checkTypeSupported(assert(e.thisType),s)||(i=!1));let a=e.parameterTypes,l=t.parameters;for(let o=0,u=a.length;o<u;++o){let c;l.length>o?c=l[o]:c=t,this.program.checkTypeSupported(a[o],c)||(i=!1)}return this.program.checkTypeSupported(e.returnType,t.returnType)||(i=!1),i}checkFixedArrayStorageInSignature(e,t){let i=!0,s=e.parameterTypes,a=t.parameters;for(let o=0,u=s.length;o<u;++o){let c=a.length>o?a[o]:t;this.checkFixedArrayStoragePosition(s[o],c,"a parameter")||(i=!1)}let l=e.returnType;return l.kind==26||this.checkFixedArrayStoragePosition(l,t.returnType,"a return type")||(i=!1),i}checkFixedArrayStoragePosition(e,t,i){return e.kind!=14?!0:e.fixedMemoryModel==2?(this.error(100,t.range,"heap fixed-extent is Landing 5c (GC block, N in type, no length field). Use `@managed @dynamic [T * n]` for a runtime-length heap array (available now)"),!1):e.fixedMemoryModel==3||i=="a parameter"||i=="a return type"?!0:(this.error(100,t.range,i=="a return type"?"cannot return `[T * N]` by value yet \u2014 the callee side works (WebAssembly multivalue, one result per element leaf, measured to 16 results), but the caller cannot hold the result: a tuple has no `Type`, and every local slot in this compiler is typed by one. Landing 5b.3. Use `@unmanaged [T * N]` for a pointer view meanwhile":i=="a parameter"?"cannot pass `[T * N]` by value yet \u2014 Landing 5b.2 (inline bytes have no value-stack representation). Use `@unmanaged [T * N]` for a pointer view":i=="a local"?"cannot declare `[T * N]` as a local value in this position (a local is one WASM local per element leaf; this shape did not take that path). Use `@unmanaged [T * N]` for a pointer view, or `[T *]` for an unknown-length view":"cannot declare `[T * N]` at module scope yet \u2014 Landing 5b.2. Use `@unmanaged [T * N]` for a pointer view, or `[T *]` for an unknown-length view"),!1)}isUnmanagedChangetype(e){if(e.kind!=11)return!1;let t=e,i=t.expression;if(i.kind!=8||i.text!="changetype")return!1;let s=t.typeArguments;return s==null||s.length!=1?!1:unchecked(s[0]).memoryModel==3}isInlineStructType(e){let t=e.classReference;return t!=null&&t.hasDecorator(4096)}viewFieldAccess(e,t,i){let s=this.module,a=t.memoryOffset;return i.kind==14||this.isInlineStructType(i)?a?s.binary(217,e,this.options.isWasm64?s.i64(a):s.i32(a)):e:s.load(i.byteSize,i.isSignedIntegerValue,e,i.toRef(),a)}resultRefOf(e){return this.isInlineStructType(e)?P.None:e.toRef()}evaluateCondition(e){let t=fe(e);if(t==P.Unreachable)return 0;assert(t==P.I32);let s=this.module.runExpression(e,0);return s?ae(s)?1:2:0}expandSroaArrayArgument(e,t,i,s){let a=this.module,l=oe.wasmParamCountOf(t),o=e.kind==8?this.currentFlow.lookupLocal(e.text):null;if(o!=null&&o.fieldLocals!=null)return this.pushSroaLeafOperands(assert(o.fieldLocals),i,s);if(e.kind==18&&e.literalKind==5)return this.pushSroaArrayLiteralOperands(e,t,i,s,"passing");this.error(100,e.range,"passing this expression as a `[T * N]` argument (only a local value or an array literal: a value has no address, so there is nothing to hand over)");for(let u=0;u<l;++u)unchecked(i[s+u]=a.unreachable());return l}pushSroaArrayLiteralOperands(e,t,i,s,a){let l=oe.wasmParamCountOf(t),o=new Array;this.emitSroaArrayLiteralLeaves(e,t,o,a);let u=0;for(let c=0,f=o.length;c<f;++c)unchecked(i[s+u]=unchecked(o[c])),++u;if(u<l){let c=new Array;for(oe.leafTypesOf(t,c),assert(c.length==l);u<l;)unchecked(i[s+u]=this.makeZero(unchecked(c[u]))),++u}return u}emitSroaArrayLiteralLeaves(e,t,i,s){let a=t.fixedArrayElementType,l=oe.wasmParamCountOf(t),o=e.elementExpressions,u=a.getClass(),c=u!=null&&u.hasDecorator(16)?this.recordFieldsOf(a):null,f=c!=null?oe.leafCountOf(a):1,_=s=="passing"?"pass":s=="returning"?"return":"initialise";for(let d=0,m=o.length;d<m;++d){if(i.length+f>l){this.error(2322,e.range,"too many elements",t.toString());return}let h=unchecked(o[d]);if(c!=null){if(!this.emitSroaObjectElementLeaves(h,a,c,i,s))return;continue}if(u!=null){this.error(100,h.range,s+" a record element of a `[T * N]` value inside an array literal (an element is several leaves, and no literal names them). Construct the array field-by-field in a local and "+_+" that");return}i.push(this.compileExpression(h,a,1))}}emitSroaObjectElementLeaves(e,t,i,s,a){let l=assert(t.getClass());if(e.kind!=18||e.literalKind!=6)return this.error(100,e.range,a+" a record element of a `[T * N]` value inside an array literal (an element is several leaves, and a local names one pointer; write an object literal `{ x: 1.0, y: 2.0 }`, or construct the array field-by-field in a local)"),!1;let o=e,u=o.names,c=o.values;for(let f=0,_=u.length;f<_;++f){let d=unchecked(u[f]),m=l.getMember(d.text),h=m!=null&&m.kind==10?m.instance:null;(h==null||!h.isField)&&this.error(2339,d.range,d.text,t.toString())}for(let f=0,_=i.length;f<_;++f){let d=unchecked(i[f]),m=d.type;if(oe.isInlineStructRef(m))return this.error(100,e.range,"a nested `@inline struct` field inside a `[T * N]` element object literal (its value is a second set of leaves; assign the fields instead)"),!1;let h=-1;for(let A=0,S=u.length;A<S;++A)unchecked(u[A]).text==d.name&&(h=A);if(h>=0){s.push(this.compileExpression(unchecked(c[h]),m,1));continue}let b=d.initializerNode;if(b==null){s.push(this.makeZero(m));continue}if(b.kind!=18)return this.error(100,b.range,"an omitted field whose default initialiser is not a constant (the class path evaluates it in the record's constructor, which a leaf emission has no instance for; name the field in the object literal)"),!1;s.push(this.compileExpression(b,m,1))}return!0}expandSroaArgument(e,t,i,s){if(t.kind==14&&(t.fixedMemoryModel==0||t.fixedMemoryModel==1))return this.expandSroaArrayArgument(e,t,i,s);if(!oe.isInlineStructRef(t))return unchecked(i[s]=this.compileExpression(e,t,1)),1;let a=oe.fieldCountOf(t),l=e.kind==8?this.currentFlow.lookupLocal(e.text):null;if(l==null||l.fieldLocals==null){this.error(100,e.range,"passing this expression as an @inline struct argument (only a local value can be passed: a value has no address, so there is nothing to hand over)");for(let u=0;u<a;++u)unchecked(i[s+u]=this.module.unreachable());return a}return this.pushSroaLeafOperands(assert(l.fieldLocals),i,s)}pushSroaLeafOperands(e,t,i){let s=new Array;this.collectSroaLeafLocals(e,s);let a=0;for(let l=0,o=s.length;l<o;++l){let u=unchecked(s[l]);unchecked(t[i+a]=this.module.local_get(u.index,u.type.toRef())),++a}return a}collectSroaLeafLocals(e,t){for(let i=Map_keys(e),s=0,a=i.length;s<a;++s){let l=assert(J(e,unchecked(i[s])));if(l.index<0){let o=l.fieldLocals;o!=null&&this.collectSroaLeafLocals(o,t);continue}t.push(l)}}resolveSroaReceiver(e){let t=new Array,i=e;for(;;)if(i.kind==23)t.push(i),i=i.expression;else if(i.kind==14){let l=i;if(this.constantIndexValue(l.elementExpression)<0)return null;t.push(i),i=l.expression}else break;if(i.kind!=8)return null;let s=this.currentFlow.lookupLocal(i.text);if(s==null||s.fieldLocals==null)return null;let a=s;for(let l=t.length-1;l>=0;--l){let o=a.fieldLocals;if(o==null)return null;let u=t[l],c;if(u.kind==23?c=J(o,u.property.text):c=J(o,this.constantIndexValue(u.elementExpression).toString()),c==null)return null;a=c}return a.fieldLocals!=null?a:null}static{this.SRET_STACK_SIZE=4096}markOperandForRooting(){this.rootNextOperand=!0}ensureSretStack(){if(this.sretStackGlobal!=null)return this.sretStackBase;let e=this.module,t=this.addAlignedMemorySegment(new Uint8Array(n.SRET_STACK_SIZE),16),i=i64_low(t.offset);this.sretStackBase=i,this.sretStackLimit=i+n.SRET_STACK_SIZE;let s="~sretStackPointer";return this.sretStackGlobal=s,e.addGlobal(s,P.I32,!0,e.i32(i)),i}sretSizeOf(e){return assert(e.classReference).nextMemoryOffset+15&-16}makeSretAddress(e){return this.module.local_get(e.index,P.I32)}makeSretFieldLoad(e,t){return this.module.load(t.type.byteSize,!1,e,t.type.toRef(),t.memoryOffset)}makeSretGuard(e,t,i){let s=this.module,a=s.binary(0,s.local_get(e.index,P.I32),s.i32(t));return s.if(s.binary(21,a,s.i32(this.sretStackLimit)),this.makeStaticAbort(this.ensureStaticString("sret stack overflow: the static call-temp region is 4 KB; see --sretStackSize"),i))}emitExportByValPrologue(e,t){let i=this.module,s=e.signature,a=e.flow,l=s.parameterTypes;for(let o=0,u=l.length;o<u;++o){if(!s.isExportByValParam(o))continue;let c=e.getParameterName(o),f=a.lookupLocal(c+"$byval"),_=a.lookupLocal(c);if(f==null||_==null||_.fieldLocals==null)continue;let d=assert(_.fieldLocals),m=assert(this.recordFieldsOf(unchecked(l[o])));for(let h=0,b=m.length;h<b;++h){let A=unchecked(m[h]),S=J(d,A.name);S&&t.push(i.local_set(S.index,i.load(A.type.byteSize,!1,i.local_get(f.index,P.I32),A.type.toRef(),A.memoryOffset),!1))}}}makeSretAddressPlus(e,t){let i=this.module;return i.binary(0,this.makeSretAddress(e),i.i32(t))}emitTempArgumentLeaves(e,t,i,s,a){let l=this.module,o=this.recordFieldsOf(e);if(o!=null)for(let u=0,c=o.length;u<c;++u){let f=unchecked(o[u]),_=J(t,f.name);if(_!=null){if(_.index<0){let d=_.fieldLocals;d!=null&&this.emitTempArgumentLeaves(f.type,d,i,s+f.memoryOffset,a);continue}a.push(l.store(f.type.byteSize,this.makeSretAddressPlus(i,s),l.local_get(_.index,_.type.toRef()),f.type.toRef(),f.memoryOffset))}}}makeExternalTempArgument(e,t,i,s){let a=this.module,l=e.kind==8?this.currentFlow.lookupLocal(e.text):null,o=l!=null?l.fieldLocals:null,u=this.recordFieldsOf(t);if(u==null)return this.error(100,e.range,"passing this expression to a by-value parameter (the temp is filled field by field, which needs a record type)"),a.unreachable();let c=new Array;if(o!=null)this.emitTempArgumentLeaves(t,o,i,s,c);else{if(oe.isInlineStructRef(t))return this.error(100,e.range,"passing this expression as an @inline struct to a by-value parameter (the temp is filled by copying a local's fields; a value has no address, so only a local can be passed)"),a.unreachable();{let f=this.options.usizeType,_=this.compileExpression(e,t,1),d=this.currentFlow.getTempLocal(f),m=f.toRef();c.push(a.local_set(d.index,_,!1));for(let h=0,b=u.length;h<b;++h){let A=unchecked(u[h]);c.push(a.store(A.type.byteSize,this.makeSretAddressPlus(i,s),a.load(A.type.byteSize,!1,a.local_get(d.index,m),A.type.toRef(),A.memoryOffset),A.type.toRef(),A.memoryOffset))}}}return c.push(this.makeSretAddressPlus(i,s)),a.block(null,c,P.I32)}wrapExternalTempCall(e,t,i,s,a){let l=this.module,o=assert(this.sretStackGlobal),u=l.global_set(o,l.local_get(e.index,P.I32)),c=[l.local_set(e.index,l.global_get(o,P.I32),!1),l.global_set(o,l.binary(0,l.local_get(e.index,P.I32),l.i32(t))),this.makeSretGuard(e,t,a)];if(s==p.void)return c.push(i),c.push(u),l.block(null,c);let f=this.currentFlow.getTempLocal(s);return c.push(l.local_set(f.index,i,!1)),c.push(u),c.push(l.local_get(f.index,s.toRef())),l.block(null,c,s.toRef())}wrapSretCall(e,t,i,s){let a=this.module,l=assert(this.sretStackGlobal),o=this.sretSizeOf(i);return a.block(null,[a.local_set(e.index,a.global_get(l,P.I32),!1),a.global_set(l,a.binary(0,a.local_get(e.index,P.I32),a.i32(o))),this.makeSretGuard(e,o,s),t,a.global_set(l,a.local_get(e.index,P.I32))])}makeSretCallBlock(e,t,i,s,a){let l=this.module;this.ensureSretStack();let o=assert(this.sretStackGlobal),u=this.sretSizeOf(t),c=this.currentFlow,f=c.getTempLocal(p.u32),_=new Array;_.push(l.local_set(f.index,l.global_get(o,P.I32),!1)),_.push(l.global_set(o,l.binary(0,l.local_get(f.index,P.I32),l.i32(u)))),_.push(this.makeSretGuard(f,u,e)),this.sretDestSlot=this.makeSretAddress(f);let d=this.compileCallExpression(e,p.auto,0);if(this.sretDestSlot!=0)return this.sretDestSlot=0,this.currentType=i,l.unreachable();_.push(d);let m=i!=p.void?c.getTempLocal(i):null;return s!=null?_.push(l.local_set(assert(m).index,this.makeSretFieldLoad(this.makeSretAddress(f),s),!1)):a!=null&&this.emitSretLoadsInto(t,a,f,0,_),_.push(l.global_set(o,l.local_get(f.index,P.I32))),m!=null?(_.push(l.local_get(m.index,m.type.toRef())),this.currentType=i,l.block(null,_,i.toRef())):(this.currentType=p.void,l.block(null,_))}compileSretReturnStatement(e,t){let i=this.module,s=this.currentFlow,a=assert(e.value);if(a.kind==19&&a.args.length==0){let d=this.module,m=s.sourceFunction.signature.thisType?1:0,h=new Array;return this.emitSroaZerosToLocal(t,m,0,h),h.push(d.return()),s.set(257),this.currentType=t,d.block(null,h)}let o=a.kind==8?s.lookupLocal(a.text):null;if(o==null||o.fieldLocals==null)return this.error(100,a.range,"returning this expression from an @inline struct function (only a local value can be returned: a value has no address, so there is nowhere to write it)"),s.set(257),this.currentType=t,i.unreachable();let u=s.sourceFunction.signature;assert(u.hasHiddenDestParam);let c=u.thisType?1:0,f=assert(o.fieldLocals),_=new Array;return this.emitSroaStoresToLocal(t,f,c,0,_),_.push(i.return()),s.set(257),this.currentType=t,i.block(null,_)}fillSroaFieldLocals(e,t,i,s,a){let l=!1;for(let o=0,u=e.length;o<u;++o){let c=unchecked(e[o]),f=t+"$"+c.name,_=c.type;if(!this.isSroaFieldType(_)){if(oe.isInlineStructRef(_)){let h=new Map;if(!this.fillSroaFieldLocals(this.inlineStructFieldsOf(_),f,i,s,h)){l=!0;continue}let b=new pe(f,-1,_,s.targetFunction,i);b.fieldLocals=h,a.set(c.name,b);continue}let d=assert(c.prototype.fieldDeclaration),m=d.type;this.error(100,m?m.range:d.name.range,_.kind==14?"a T[N] field in an @inline struct (SROA keeps one WASM local per field; array fields are the deep-SROA phase)":"a GC-reference field in an @inline struct (a bare local.set skips the write barrier; deferred)"),l=!0;continue}a.set(c.name,s.targetFunction.addLocal(_,f,i))}return!l}copySroaValue(e,t,i){let s=this.module;for(let a=Map_keys(t),l=0,o=a.length;l<o;++l){let u=unchecked(a[l]),c=J(e,u);if(c==null)continue;let f=assert(J(t,u));if(f.index<0||c.index<0){let _=f.fieldLocals,d=c.fieldLocals;_!=null&&d!=null&&this.copySroaValue(d,_,i);continue}i.push(s.local_set(f.index,s.local_get(c.index,c.type.toRef()),!1))}}emitSroaStoresToLocal(e,t,i,s,a){let l=this.module,o=this.inlineStructFieldsOf(e);if(o!=null)for(let u=0,c=o.length;u<c;++u){let f=unchecked(o[u]),_=J(t,f.name);if(_!=null){if(_.index<0){let d=_.fieldLocals;d!=null&&this.emitSroaStoresToLocal(f.type,d,i,s+f.memoryOffset,a);continue}a.push(l.store(f.type.byteSize,l.local_get(i,P.I32),l.local_get(_.index,_.type.toRef()),f.type.toRef(),s+f.memoryOffset))}}}emitSroaZerosToLocal(e,t,i,s){let a=this.module,l=this.inlineStructFieldsOf(e);if(l!=null)for(let o=0,u=l.length;o<u;++o){let c=unchecked(l[o]);if(oe.isInlineStructRef(c.type)){this.emitSroaZerosToLocal(c.type,t,i+c.memoryOffset,s);continue}this.isSroaFieldType(c.type)&&s.push(a.store(c.type.byteSize,a.local_get(t,P.I32),this.makeZero(c.type),c.type.toRef(),i+c.memoryOffset))}}emitSretLoadsInto(e,t,i,s,a){let l=this.inlineStructFieldsOf(e);if(l!=null)for(let o=0,u=l.length;o<u;++o){let c=unchecked(l[o]),f=J(t,c.name);if(f!=null){if(f.index<0){let _=f.fieldLocals;_!=null&&this.emitSretLoadsInto(c.type,_,i,s+c.memoryOffset,a);continue}a.push(this.module.local_set(f.index,this.module.load(c.type.byteSize,!1,this.makeSretAddress(i),c.type.toRef(),s+c.memoryOffset),!1))}}}sroaTreeOf(e){let t=this.resolveSroaReceiver(e);return t!=null?t.fieldLocals:null}emitSroaStores(e,t,i,s,a){let l=this.module,o=this.inlineStructFieldsOf(e);if(o!=null)for(let u=0,c=o.length;u<c;++u){let f=unchecked(o[u]),_=J(t,f.name);if(_!=null){if(_.index<0){let d=_.fieldLocals;d!=null&&this.emitSroaStores(f.type,d,i,s+f.memoryOffset,a);continue}a.push(l.store(f.type.byteSize,i,l.local_get(_.index,_.type.toRef()),f.type.toRef(),s+f.memoryOffset))}}}isValueFormFixedArray(e){return e.kind!=14?!1:e.fixedMemoryModel==0||e.fixedMemoryModel==1}static{this.VALUE_ARRAY_MAX_RUNTIME_INDEX=8}fillSroaArrayLocals(e,t,i,s,a){let l=e.fixedArrayElementType,o=e.fixedLength,u=this.recordFieldsOf(l),c=!1;for(let f=0;f<o;++f){let _=t+"$"+f.toString();if(u==null){if(!this.isSroaFieldType(l))return this.error(100,i.name.range,"a `[T * N]` value with an element that cannot live in one WASM local (a GC reference needs a write barrier on every assignment; a nested array needs the deep-SROA phase). Use `@unmanaged [T * N]` for a pointer view"),!1;a.set(f.toString(),s.targetFunction.addLocal(l,_,i));continue}let d=new Map;if(!this.fillSroaFieldLocals(u,_,i,s,d)){c=!0;continue}let m=new pe(_,-1,l,s.targetFunction,i);m.fieldLocals=d,a.set(f.toString(),m)}return!c}compileSroaValueArrayLocal(e,t,i,s,a){let l=this.module,o=e.name.text,u=new Map;if(!this.fillSroaArrayLocals(t,o,e,s,u))return!0;let c=new pe(o,-1,t,s.targetFunction,e);c.fieldLocals=u;let f=s.scopedLocals;if(f||(s.scopedLocals=f=new Map),f.has(o))return this.error(2300,e.name.range,o),!0;if(f.set(o,c),e.is(8)&&s.setLocalFlag(c.index,1),!i)return!0;if(i.kind==18&&i.literalKind==5)return this.fillSroaArrayFromLiteral(t,u,i,a);if(i.kind==8){let _=this.resolveSroaValueArray(i);if(_!=null&&_.type.equals(t))return this.copySroaValue(assert(_.fieldLocals),u,a),!0}if(i.kind==11){let _=this.resolver.resolveExpression(i,s,p.auto,1);if(_!=null&&_.kind==14&&_.equals(t)){let d=oe.create(this.program,new Array,t).resultRefs,m=this.compileExpression(i,t,1),h=s.getTempLocal(t);h.typeRefOverride=d,a.push(l.local_set(h.index,m,!1));let b=0,S=t.fixedArrayElementType.getClass()!=null;for(let k=0,w=t.fixedLength;k<w;++k){let R=J(u,k.toString());if(R==null)continue;let C=R.fieldLocals;if(S&&C!=null){for(let M=Map_keys(C),O=0,D=M.length;O<D;++O){let Q=assert(J(C,unchecked(M[O])));a.push(l.local_set(Q.index,l.tuple_extract(l.local_get(h.index,d),b),!1)),++b}continue}a.push(l.local_set(R.index,l.tuple_extract(l.local_get(h.index,d),b),!1)),++b}return!0}}return this.error(100,i.range,"initializing a `[T * N]` value from this expression (an array literal `[a, b, c]`, a copy from another `[T * N]` value, and a call returning one are implemented; a caller's address is `@unmanaged [T * N]`)"),!0}fillSroaArrayFromLiteral(e,t,i,s){let a=this.module,l=new Array;this.emitSroaArrayLiteralLeaves(i,e,l,"initializing");let o=new Array;this.collectSroaLeafLocals(t,o),assert(l.length<=o.length);for(let u=0,c=l.length;u<c;++u)s.push(a.local_set(unchecked(o[u]).index,unchecked(l[u]),!1));return!0}resolveSroaValueArray(e){if(e.kind!=8)return null;let t=this.currentFlow.lookupLocal(e.text);return t==null||t.fieldLocals==null?null:this.isValueFormFixedArray(t.type)?t:null}constantIndexValue(e){if(e.kind!=18)return-1;let t=e;if(t.literalKind!=1)return-1;let i=t.value;return i64_high(i)!=0?-1:i64_low(i)}compileSroaValueArrayElementAccess(e,t,i,s,a,l=null,o=0){let u=this.module,c=t.type,f=c.fixedArrayElementType,_=assert(t.fieldLocals),d=this.constantIndexValue(e.elementExpression);if(d>=0){let h=J(_,d.toString());if(h==null)return this.error(2329,e.elementExpression.range,c.toString()),this.currentType=f,u.unreachable();if(h.index<0)return this.error(100,e.range,"reading or writing a record element of a `[T * N]` value as a whole (an element is several leaves, not one value; read or write one of its fields, `arr[i].x`)"),this.currentType=f,u.unreachable();if(i){let b=o||this.compileExpression(assert(l),f,1);return s==p.void?(this.currentType=p.void,u.local_set(h.index,b,!1)):(this.currentType=f,u.block(null,[u.local_set(h.index,b,!1),u.local_get(h.index,h.type.toRef())],f.toRef()))}return this.currentType=f,u.local_get(h.index,h.type.toRef())}return c.fixedLength>n.VALUE_ARRAY_MAX_RUNTIME_INDEX?(this.error(100,e.range,"a runtime index into a `[T * N]` value with N > 8 (the element is selected by a branch per element, which stops paying for itself past eight). Use a constant index, or `@unmanaged [T * N]` for a pointer view with unlimited runtime indexing"),this.currentType=f,u.unreachable()):f.getClass()!=null?(this.error(100,e.range,"reading or writing a record element of a `[T * N]` value as a whole (an element is several leaves, not one value; read or write one of its fields, `arr[i].x`)"),this.currentType=f,u.unreachable()):this.compileSroaValueArrayRuntimeIndex(e,t,i,s,a,l,o)}compileSroaValueArrayRuntimeIndex(e,t,i,s,a,l,o){let u=this.module,c=t.type,f=c.fixedArrayElementType,_=assert(t.fieldLocals),d=c.fixedLength,m=f.toRef(),h=this.compileExpression(e.elementExpression,p.i32,1),b=i?o||this.compileExpression(assert(l),f,1):0,A=new Array(d);for(let w=0;w<d;++w)unchecked(A[w]=assert(_.get(w.toString())).index);let S=-1;i&&(S=this.currentFlow.getTempLocal(f).index);let k=this.compileLeafIndexSelect(A,h,i?P.None:m,S,m);return i?(this.currentType=s==p.void?p.void:f,s==p.void?u.block(null,[u.local_set(S,b,!1),k]):u.block(null,[u.local_set(S,b,!1),k,u.local_get(S,m)],m)):(this.currentType=f,k)}compileSroaArrayLeafByRuntimeIndex(e,t){let i=this.resolveSroaValueArray(e.expression);if(i==null)return 0;let s=i.type;if(s.fixedArrayElementType.getClass()==null||this.constantIndexValue(e.elementExpression)>=0||!t.isField)return 0;let l=assert(i.fieldLocals),o=s.fixedLength;if(o>n.VALUE_ARRAY_MAX_RUNTIME_INDEX)return this.error(100,e.range,"a runtime index into a `[T * N]` value with N > 8 (the element is selected by a branch per element, which stops paying for itself past eight). Use a constant index, or `@unmanaged [T * N]` for a pointer view with unlimited runtime indexing"),this.module.unreachable();let u=this.module,c=t.type.toRef(),f=(++this.sroaSelectId).toString(),_=new Array(o);for(let S=0;S<o;++S)unchecked(_[S]="sroaLeaf"+S.toString()+"_"+f);let d="sroaLeafOut_"+f,m=this.compileExpression(e.elementExpression,p.i32,1),h=new Array(o);for(let S=0;S<o;++S){let k=J(l,S.toString()),w=k!=null?k.fieldLocals:null;if(w==null)return this.error(100,e.range,"reading this member through a runtime array index (the element field is not a single WASM local; a nested inline value needs the deep-SROA phase)"),u.unreachable();let R=J(w,t.name);if(R==null||R.index<0)return this.error(100,e.range,"reading this member through a runtime array index (only supported fields are readable; a refused or computed member has no local)"),u.unreachable();unchecked(h[S]=R.index)}let b=new Array(o);for(let S=0;S<o;++S)unchecked(b[S]=u.br(d,0,u.local_get(unchecked(h[S]),c)));let A=u.drop(u.switch(_,unchecked(_[o-1]),m));A=u.block(unchecked(_[o-1]),[A]);for(let S=o-2;S>=0;--S)A=u.block(unchecked(_[S]),[A,unchecked(b[S+1]),u.nop()]);return this.currentType=t.type,u.block(d,[A,unchecked(b[0])],c)}compileSroaArrayLeafStoreByRuntimeIndex(e,t,i){let s=this.resolveSroaValueArray(e.expression);if(s==null)return 0;let a=s.type;if(a.fixedArrayElementType.getClass()==null||this.constantIndexValue(e.elementExpression)>=0||!t.isField)return 0;let o=assert(s.fieldLocals),u=a.fixedLength;if(u>n.VALUE_ARRAY_MAX_RUNTIME_INDEX)return this.error(100,e.range,"a runtime index into a `[T * N]` value with N > 8 (the element is selected by a branch per element, which stops paying for itself past eight). Use a constant index, or `@unmanaged [T * N]` for a pointer view with unlimited runtime indexing"),this.module.unreachable();let c=this.module,f=t.type,_=f.toRef(),d=new Array(u);for(let R=0;R<u;++R){let C=J(o,R.toString()),M=C!=null?C.fieldLocals:null,O=M!=null?J(M,t.name):null;if(O==null||O.index<0)return this.error(100,e.range,"assigning this member through a runtime array index (only supported fields are writable; a refused or computed member has no local)"),c.unreachable();unchecked(d[R]=O.index)}let m=(++this.sroaSelectId).toString(),h=new Array(u);for(let R=0;R<u;++R)unchecked(h[R]="sroaStore"+R.toString()+"_"+m);let b="sroaStoreOut_"+m,A=this.compileExpression(e.elementExpression,p.i32,1),S=this.currentFlow.getTempLocal(f).index,k=new Array(u);for(let R=0;R<u;++R)unchecked(k[R]=c.local_set(unchecked(d[R]),c.local_get(S,_),!1));let w=c.drop(c.switch(h,unchecked(h[u-1]),A));w=c.block(unchecked(h[u-1]),[w]);for(let R=u-2;R>=0;--R)w=c.block(unchecked(h[R]),[w,unchecked(k[R+1]),c.br(b)]);return this.currentType=p.void,c.block(b,[c.local_set(S,i,!1),w,unchecked(k[0])])}compileLeafIndexSelect(e,t,i,s,a){let l=this.module,o=e.length,u=s>=0,c=(++this.sroaSelectId).toString(),f=new Array(o);for(let h=0;h<o;++h)unchecked(f[h]="sroaSel"+h.toString()+"_"+c);let _="sroaSelOut_"+c,d=new Array(o);for(let h=0;h<o;++h){let b=unchecked(e[h]);unchecked(d[h]=u?l.local_set(b,l.local_get(s,a),!1):l.br(_,0,l.local_get(b,i)))}let m=l.drop(l.switch(f,unchecked(f[o-1]),t));m=l.block(unchecked(f[o-1]),[m]);for(let h=o-2;h>=0;--h)m=l.block(unchecked(f[h]),[m,unchecked(d[h+1]),u?l.br(_):l.nop()]);return l.block(_,[m,unchecked(d[0])],i)}compileMultivalueReturnStatement(e,t){let i=this.module,s=this.currentFlow,a=e.value,l=a!=null&&a.kind==8?s.lookupLocal(a.text):null,o=oe.wasmParamCountOf(t),u=new Array(o),c;if(l!=null&&l.fieldLocals!=null)c=this.pushSroaLeafOperands(assert(l.fieldLocals),u,0);else if(a!=null&&a.kind==18&&a.literalKind==5)c=this.pushSroaArrayLiteralOperands(a,t,u,0,"returning");else return this.error(100,e.range,"returning this expression as a `[T * N]` value (only a local value or an array literal can be returned: a value has no address, so the leaves have to exist as locals)"),s.set(257),this.currentType=t,i.unreachable();return assert(c==o),s.set(257),this.currentType=t,i.block(null,[i.return(i.tuple_make(u))])}compileSroaLocal(e,t,i,s,a,l){let o=this.module,u=e.name.text;if(s!=null&&this.isUnmanagedChangetype(s)){let d=a.scopedLocals;d||(a.scopedLocals=d=new Map);let m=d.has(u)?assert(d.get(u)):null,h;if(m!=null&&m.index>=0)h=m,h.type=t;else{let b=a.targetFunction;h=new pe(u,b.localsByIndex.length,t,b,e),b.localsByIndex[h.index]=h,d.set(u,h)}return h.isViewLocal=!0,a.setLocalFlag(h.index,8),e.is(8)&&a.setLocalFlag(h.index,1),l.push(o.local_set(h.index,this.compileExpression(s,p.auto),!1)),!0}let c=new Map;if(!this.fillSroaFieldLocals(i,u,e,a,c))return!0;let f=new pe(u,-1,t,a.targetFunction,e);f.fieldLocals=c;let _=a.scopedLocals;if(_||(a.scopedLocals=_=new Map),_.has(u))return this.error(2300,e.name.range,u),!0;if(_.set(u,f),e.is(8)&&a.setLocalFlag(f.index,1),!s)return!0;if(s.kind==19){let d=s.args;if(d.length>i.length)return this.error(2322,s.range,"too many arguments",t.toString()),!0;for(let m=0,h=d.length;m<h;++m){let b=unchecked(i[m]),A=assert(c.get(b.name));if(A.index<0)return this.error(100,s.range,"constructing an @inline struct with an argument for a nested @inline field (the field is several leaves, not one value; assign its own fields instead)"),!0;let S=this.compileExpression(d[m],b.type,1);l.push(o.local_set(A.index,S,!1))}return!0}if(s!=null&&s.kind==11){let d=this.resolver.resolveExpression(s,this.currentFlow);if(d!=null&&this.isInlineStructType(d))return l.push(this.makeSretCallBlock(s,d,p.void,null,c)),!0}if(s.kind==8){let d=a.lookupLocal(s.text);if(d&&d.fieldLocals)return this.copySroaValue(assert(d.fieldLocals),c,l),!0}return this.error(100,s.range,"initialising an @inline struct local from this expression (only `new P(\u2026)`, another @inline struct value, or no initialiser)"),!0}inlineStructFieldsOf(e){let t=e.classReference;return t==null||!t.hasDecorator(4096)?null:this.recordFieldsOf(e)}recordFieldsOf(e){let t=e.classReference;if(t==null)return null;let i=new Array,s=t.members;if(s)for(let a=Map_values(s),l=0,o=a.length;l<o;++l){let u=unchecked(a[l]);if(u.kind!=10)continue;let c=u.instance;!c||!c.isField||i.push(c)}return i}isSroaFieldType(e){return e.kind==14||oe.isInlineStructRef(e)?!1:!e.isManaged}makeZero(e){let t=this.module;switch(e.kind){default:assert(!1);case 0:case 1:case 2:case 3:case 6:case 7:case 8:return t.i32(0);case 5:case 10:case 27:if(e.size!=64)return t.i32(0);case 14:return t.i32(0);case 4:case 9:return t.i64(0);case 11:return t.f32(0);case 12:return t.f64(0);case 13:return t.v128(jp);case 16:case 15:case 17:case 18:case 19:case 20:case 22:case 23:case 24:case 25:return e.is(512)?t.ref_null(e.toRef()):(assert(!1),t.unreachable());case 21:return e.is(512)?t.ref_null(e.toRef()):t.i31_new(t.i32(0))}}makeOne(e){let t=this.module;switch(e.kind){default:assert(!1);case 0:case 1:case 2:case 3:case 6:case 7:case 8:return t.i32(1);case 5:case 10:if(e.size!=64)return t.i32(1);case 4:case 9:return t.i64(1);case 11:return t.f32(1);case 12:return t.f64(1);case 21:return t.i31_new(t.i32(1))}}makeNegOne(e){let t=this.module;switch(e.kind){default:assert(!1);case 1:case 2:case 3:case 6:case 7:case 8:return t.i32(-1);case 5:case 10:if(e.size!=64)return t.i32(-1);case 4:case 9:return t.i64(-1,-1);case 11:return t.f32(-1);case 12:return t.f64(-1);case 13:return t.v128(Qp);case 21:return t.i31_new(t.i32(-1))}}makeIsTrueish(e,t,i){let s=this.module;switch(t.kind){case 1:case 2:case 6:case 7:e=this.ensureSmallIntegerWrap(e,t);case 0:case 3:case 8:return e;case 4:case 9:return s.binary(41,e,s.i64(0));case 5:case 10:return t.size==64?s.binary(41,e,s.i64(0)):e;case 11:{let a=this.options;return a.shrinkLevelHint>1&&a.hasFeature(4)?s.unary(20,s.unary(20,s.unary(53,s.unary(10,s.unary(8,e))))):s.binary(20,s.binary(1,s.binary(10,s.unary(33,e),s.i32(1)),s.i32(2)),s.i32(4278190078))}case 12:{let a=this.options;return a.shrinkLevelHint>1&&a.hasFeature(4)?s.unary(20,s.unary(20,s.unary(55,s.unary(11,s.unary(9,e))))):s.binary(45,s.binary(26,s.binary(35,s.unary(34,e),s.i64(1)),s.i64(2)),s.i64(4294967294,4292870143))}case 13:return s.unary(67,e);case 16:case 15:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:case 25:return s.unary(20,s.ref_is_null(e));case 26:default:return this.error(1345,i.range,t.toString()),s.i32(0)}}makeToString(e,t,i){let s=this.module,a=this.program.stringInstance.type;if(t==a)return e;let l=t.getClassOrWrapper(this.program);if(l){let o=l.getMethod("toString");if(o){let u=o.signature;if(!this.checkCallSignature(u,0,!0,i))return this.currentType=a,s.unreachable();if(!t.isStrictlyAssignableTo(assert(u.thisType))){if(!t.is(512))return this.errorRelated(2685,i.range,o.identifierAndSignatureRange),this.currentType=a,s.unreachable();let f=this.currentFlow.getTempLocal(t);return s.if(s.local_tee(f.index,e,t.isManaged),this.makeToString(s.local_get(f.index,t.toRef()),t.nonNullableType,i),this.ensureStaticString("null"))}let c=u.returnType;return c.isStrictlyAssignableTo(a)?this.makeCallDirect(o,[e],i):(this.errorRelated(2322,i.range,o.identifierAndSignatureRange,c.toString(),a.toString()),this.currentType=a,s.unreachable())}}return this.error(2322,i.range,t.toString(),a.toString()),this.currentType=a,s.unreachable()}makeAllocation(e){let t=this.program;assert(e.program==t);let i=this.module,s=this.options;if(this.currentType=e.type,e.hasDecorator(16)){let a=t.allocInstance;return this.compileFunction(a),i.call(a.internalName,[s.isWasm64?i.i64(e.nextMemoryOffset):i.i32(e.nextMemoryOffset)],s.sizeTypeRef)}else{let a=t.newInstance;return this.compileFunction(a),i.call(a.internalName,[s.isWasm64?i.i64(e.nextMemoryOffset):i.i32(e.nextMemoryOffset),i.i32(e.id)],s.sizeTypeRef)}}makeConditionalAllocation(e,t){let i=this.module,a=e.type.toRef();return assert(a==this.options.sizeTypeRef),i.if(i.unary(a==P.I64?21:20,i.local_get(t,a)),i.local_set(t,this.makeAllocation(e),e.type.isManaged))}makeFieldInitializationInConstructor(e,t=[]){let i=e.members;if(!i)return t;let s=this.module,a=this.currentFlow,l=a.isInline,o=l?a.lookupLocal(L.this_).index:0,u=this.options.sizeTypeRef,c=null;for(let f=Map_values(i),_=0,d=f.length;_<d;++_){let m=unchecked(f[_]);if(m.kind!=10)continue;let h=m.instance;if(!h||!h.isField||h.getBoundClassOrInterface()!=e)continue;if(this.isInlineStructType(h.type)){let C=h.initializerNode,M=e.hasDecorator(16)||e.hasDecorator(2048);if(C!=null&&M){if(C.kind==18&&C.isLiteralKind(6)&&C.names.length==0)continue;this.error(100,C.range,"an initializer on an @inline struct field (the value is stored inline and has no address to copy into; the allocation is already zero, so `= {}` is allowed -- assign the field's own fields after construction)")}continue}assert(!h.isAny(8));let b=h.prototype,A=b.parameterIndex;if(A<0){c||(c=new Array),c.push(h);continue}let k=h.type.toRef();assert(!b.initializerNode);let w=assert(h.setterInstance),R=this.makeCallDirect(w,[s.local_get(o,u),s.local_get(l?a.lookupLocal(h.name).index:1+A,k)],w.identifierNode,!0);this.currentType!=p.void&&(R=s.drop(R)),t.push(R)}if(c)for(let f=0,_=c.length;f<_;++f){let d=unchecked(c[f]),m=d.type,h=d.prototype,b=h.initializerNode;if(assert(h.parameterIndex<0),m.kind==14&&(m.fixedMemoryModel==0||m.fixedMemoryModel==1)){b&&this.error(100,b.range,"an initializer on a `[T * N]` field in a `new`-constructed record (the field is inline bytes; assign its elements after construction instead, `h.arr[0] = ...`)");continue}let A=assert(d.setterInstance),S=this.makeCallDirect(A,[s.local_get(o,u),b?this.compileExpression(b,m,1):this.makeZero(m)],d.identifierNode,!0);this.currentType!=p.void&&(S=s.drop(S)),t.push(S)}return this.currentType=p.void,t}makeAbort(e,t){let i=this.program,s=i.abortInstance;if(!s||!this.compileFunction(s))return this.module.unreachable();let a=i.stringInstance,l;return e?l=this.compileExpression(e,a.type,1):l=this.makeZero(a.type),this.makeStaticAbort(l,t)}makeStaticAbort(e,t){let i=this.program,s=this.module,a=i.abortInstance;if(!a||!this.compileFunction(a))return s.unreachable();let l=this.ensureStaticString(t.range.source.normalizedPath),o=t.range,u=o.source;return s.block(null,[s.call(a.internalName,[e,l,s.i32(u.lineAt(o.start)),s.i32(u.columnAt())],P.None),s.unreachable()])}makeRuntimeNonNullCheck(e,t,i){let s=this.module,a=this.currentFlow,o=a.getTempLocal(t).index;a.canOverflow(e,t)||a.setLocalFlag(o,2),a.setLocalFlag(o,4);let u=this.makeStaticAbort(this.ensureStaticString("Unexpected 'null' (not assigned or failed cast)"),i);if(t.isExternalReference){let c=s.local_get(o,t.toRef());this.options.hasFeature(1024)&&(c=s.ref_as_nonnull(c)),e=s.if(s.ref_is_null(s.local_tee(o,e,!1)),u,c)}else e=s.if(s.local_tee(o,e,t.isManaged),s.local_get(o,t.toRef()),u);return this.currentType=t.nonNullableType,e}makeRuntimeDowncastCheck(e,t,i,s){assert(i.isReference&&i.nonNullableType.isAssignableTo(t));let a=this.module,l=this.currentFlow,u=l.getTempLocal(t).index,c=this.makeStaticAbort(this.ensureStaticString("invalid downcast"),s);return!i.isNullableReference||l.isNonnull(e,t)?e=a.if(a.call(this.prepareInstanceOf(i.classReference),[a.local_tee(u,e,t.isManaged)],P.I32),a.local_get(u,t.toRef()),c):e=a.if(a.unary(20,a.local_tee(u,e,t.isManaged)),a.usize(0),a.if(a.call(this.prepareInstanceOf(i.classReference),[a.local_get(u,t.toRef())],P.I32),a.local_get(u,t.toRef()),c)),this.currentType=i,e}};function Cx(n,r){An=r.range.source.simplePath,Nr=Ke(n.name,n.parent,n.is(262144),!0);let e=r.overriddenModuleName;if(e&&(An=e),!n.hasDecorator(128))return;let t=n.program,i=assert($t(10,r.decorators)),s=i.args;if(s&&s.length>0){let a=s[0];a.isLiteralKind(2)?(Nr=a.value,s.length>=2&&(a=s[1],a.isLiteralKind(2)?(An=Nr,Nr=a.value,s.length>2&&t.error(2554,i.range,"2",s.length.toString())):t.error(1141,a.range))):t.error(1141,a.range)}else t.error(2555,i.range,"1","0")}var bi=class n extends pi{constructor(e,t,i=!1){super(e,i);this.sb=[];this.indentLevel=0;this.seenObjectTypes=new Map;this.deferredTypings=new Array;this.esm=t}static build(e,t=!0){return new n(e,t).build()}visitGlobal(e,t){let i=this.sb,s=t.type,a=this.toTypeScriptType(s,1);W(i,this.indentLevel),i.push("/** "),i.push(t.internalName),i.push(` */
269
269
  `),W(i,this.indentLevel),i.push("export "),this.esm&&i.push("declare "),i.push("const "),i.push(e),i.push(`: {
270
270
  `),W(i,++this.indentLevel),i.push("/** @type `"),i.push(s.toString()),i.push("` */\n"),W(i,this.indentLevel),i.push("get value(): "),i.push(a),t.is(8)?i.push(`
271
271
  `):(i.push(`;
@@ -293,7 +293,7 @@ var Mu=Object.defineProperty;var H_=Object.getOwnPropertyDescriptor;var kE=Objec
293
293
  `)),this.walk(),this.esm||(--this.indentLevel,e.push(`}
294
294
  `));let t=this.deferredTypings;for(let i=0,s=t.length;i<s;++i)e.push(t[i]);if(!this.esm){e.push(`/** Instantiates the compiled WebAssembly module with the given imports. */
295
295
  `),e.push(`export declare function instantiate(module: WebAssembly.Module, imports: {
296
- `);let i=this.program.moduleImports;for(let s=Map_keys(i),a=0,l=s.length;a<l;++a){let o=s[a];e.push(" "),$e(o)?e.push(o):(e.push('"'),e.push(Re(o,34)),e.push('"')),e.push(`: unknown,
296
+ `);let i=this.program.moduleImports;for(let s=Map_keys(i),a=0,l=s.length;a<l;++a){let o=s[a];e.push(" "),Ze(o)?e.push(o):(e.push('"'),e.push(Re(o,34)),e.push('"')),e.push(`: unknown,
297
297
  `)}e.push(`}): Promise<typeof __AdaptedExports>;
298
298
  `)}return e.join("")}isPlainObject(e){if(e.base&&!e.prototype.implicitlyExtendsObject)return!1;let t=e.members;if(t)for(let i=Map_values(t),s=0,a=i.length;s<a;++s){let l=i[s];if(l.isAny(1536)||l.is(524288)&&l.declaration.range!=Te.native.range)return!1}return!0}toTypeScriptType(e,t){if(e.isInternalReference){let i=new Array,s=assert(e.getClassOrWrapper(this.program));if(s.extendsPrototype(this.program.arrayBufferInstance.prototype))i.push("ArrayBuffer");else if(s.extendsPrototype(this.program.stringInstance.prototype))i.push("string");else if(s.extendsPrototype(this.program.arrayPrototype)){let a=s.getArrayValueType();i.push("Array<"),i.push(this.toTypeScriptType(a,t)),i.push(">")}else if(s.extendsPrototype(this.program.staticArrayPrototype)){let a=s.getArrayValueType();i.push("ArrayLike<"),i.push(this.toTypeScriptType(a,t)),i.push(">")}else if(s.extendsPrototype(this.program.arrayBufferViewInstance.prototype)){let a=s.getArrayValueType();a==p.i8?i.push("Int8Array"):a==p.u8?s.extendsPrototype(this.program.uint8ClampedArrayPrototype)?i.push("Uint8ClampedArray"):i.push("Uint8Array"):a==p.i16?i.push("Int16Array"):a==p.u16?i.push("Uint16Array"):a==p.i32?i.push("Int32Array"):a==p.u32?i.push("Uint32Array"):a==p.i64?i.push("BigInt64Array"):a==p.u64?i.push("BigUint64Array"):a==p.f32?i.push("Float32Array"):a==p.f64?i.push("Float64Array"):i.push("unknown")}else{let a=this.seenObjectTypes,l;if(a.has(s))l=assert(a.get(s)),i.push(l),this.isPlainObject(s)&&i.push(t==1?"<never>":"<undefined>");else{let o=this.isPlainObject(s);l=`${o?"__Record":"__Internref"}${s.id}`,i.push(l),a.set(s,l),o?(i.push(t==1?"<never>":"<undefined>"),this.deferredTypings.push(this.makeRecordType(s,t))):this.deferredTypings.push(this.makeInternrefType(s))}}return e.is(512)&&i.push(" | null"),i.join("")}else{if(e==p.bool)return"boolean";if(e==p.void)return"void";if(e.isNumericValue)return e.isLongIntegerValue?"bigint":"number"}return"unknown"}makeRecordType(e,t){let i=new Array,s=e.members;if(i.push("/** "),i.push(e.internalName),i.push(` */
299
299
  declare interface __Record`),i.push(e.id.toString()),i.push(`<TOmittable> {
@@ -303,10 +303,10 @@ declare interface __Record`),i.push(e.id.toString()),i.push(`<TOmittable> {
303
303
  `),t.push("declare class __Internref"),t.push(e.id.toString()),t.push(` extends Number {
304
304
  `);let i=e;do t.push(" private __nominal"),t.push(i.id.toString()),t.push(`: symbol;
305
305
  `),i=i.base;while(i);return t.push(`}
306
- `),t.join("")}};function ct(n,r,e=0){if(n==null)return null;switch(n.kind){case 18:{switch(n.literalKind){case 1:return Br("i32",n);case 0:return Br("f64",n);case 2:case 3:return Br("string",n)}return null}case 27:case 15:return Br("bool",n);case 22:return ct(n.expression,r,e);case 19:{let t=n;return y.createNamedType(t.typeName,t.typeArguments,!1,t.range)}case 9:{let t=n;return t.assertionKind!=2&&t.toType!=null?t.toType:ct(t.expression,r,e)}case 11:{let t=n,i=t.expression;if(i.kind==8&&i.text=="changetype"){let s=t.typeArguments;if(s!=null&&s.length==1)return s[0]}return null}case 8:{if(r==null||e>8)return null;let t=n.text,i=J(r,t);return i??null}case 30:{let t=n;switch(t.operator){case 96:return Br("bool",n);case 83:case 82:case 97:{let i=ct(t.operand,r,e+1);return _a(i)?i:null}}return null}case 29:{let t=ct(n.operand,r,e+1);return _a(t)?t:null}case 10:{let t=n;switch(t.operator){case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:return Br("bool",n);case 90:case 91:case 92:{let i=ct(t.left,r,e+1);return _a(i)?i:null}case 98:case 99:{let i=ct(t.left,r,e+1),s=ct(t.right,r,e+1);return xi(i,"bool")&&xi(s,"bool")?Br("bool",n):null}case 82:case 83:case 85:case 86:case 87:case 93:case 94:case 95:case 84:{let i=ct(t.left,r,e+1),s=ct(t.right,r,e+1);return!_a(i)||!_a(s)?null:xi(i,"f64")||xi(s,"f64")?!xi(i,"f32")&&!xi(s,"f32")?Br("f64",n):null:_k(i,s)?i:null}}return null}}return null}function Br(n,r){let e=y.createSimpleTypeName(n,r.range);return y.createNamedType(e,null,!1,r.range)}function _a(n){if(n==null||n.kind!=1)return!1;let e=n.name.identifier.text;return e=="i8"||e=="i16"||e=="i32"||e=="i64"||e=="u8"||e=="u16"||e=="u32"||e=="u64"||e=="isize"||e=="usize"||e=="f32"||e=="f64"}function x_(n){let r=n.typeArguments;return r!=null&&r.length>0}function xi(n,r){if(n==null||n.kind!=1)return!1;let e=n;return e.name.identifier.text==r&&!x_(e)}function _k(n,r){if(n==null||r==null||n.kind!=1||r.kind!=1)return!1;let e=n,t=r;return x_(e)||x_(t)?!1:e.name.identifier.text==t.name.identifier.text}var ha="$closureEnv",du="$closureEnvIn",hu="$init$",Px="$Env",dk="__closureInit",Ei="$this",da="$parent",hk="$env",Nx="$awaited";function mk(n){let r=n.length;if(r==0)return!1;if(fu(n,ha)&&(r==ha.length||n.charCodeAt(ha.length)==36)||fu(n,du)||n==Ei||n==da||n==hk||fu(n,hu))return!0;if(fu(n,Nx)){let e=Nx.length;if(e>=r)return!1;for(let t=e;t<r;++t){let i=n.charCodeAt(t);if(i<48||i>57)return!1}return!0}return!1}function fu(n,r){let e=r.length;if(n.length<e)return!1;for(let t=0;t<e;++t)if(n.charCodeAt(t)!=r.charCodeAt(t))return!1;return!0}var gu=class{constructor(r,e,t,i,s,a,l){this.name=r;this.kind=e;this.envClass=t;this.ownEnv=i;this.receivesEnv=s;this.parentClass=a;this.needed=l}},ga=class{constructor(){this.analyses=null}afterParse(r){let e=this.program.sources;this.analyses=null;let t=!1,i=new A_;for(let s=0,a=e.length;s<a;++s){let l=e[s];l.isLibrary||(this.collectStatementList(l.statements,r)&&(t=!0),i.visitStatements(l.statements))}if(i.sawAsync&&(t=!0),!(t&&i.refuse(r)))for(let s=0,a=e.length;s<a;++s){let l=e[s];l.isLibrary||this.lowerStatementList(l,l.statements,r)}}dumpEnvAnalysis(){let r=new Array,e=this.analyses;if(e==null)return r;for(let t of e.values()){let i=t.allInfos;for(let s=0,a=i.length;s<a;++s)r.push(t.describe(i[s],s))}return r}recordAnalysis(r,e){let t=this.analyses;t==null&&(t=new Map,this.analyses=t),t.set(r,e)}collectStatementList(r,e){let t=!1;for(let i=0,s=r.length;i<s;++i){let a=r[i];switch(a.kind){case 59:{let l=a;if(l.body==null)break;let o=new ya(this,e,l);o.run(),this.recordAnalysis(l,o),o.hasCaptures()&&!o.refused&&(t=!0);break}case 63:{this.collectStatementList(a.members,e)&&(t=!0);break}case 55:{let l=a.name.text,o=a.members;for(let u=0,c=o.length;u<c;++u){if(o[u].kind!=62)continue;let f=o[u];if(f.body==null||f.is(32))continue;let _=new ya(this,e,f,yu(l,f.range),a);_.run(),this.recordAnalysis(f,_),_.hasCaptures()&&!_.refused&&(t=!0)}break}case 51:{let l=a.declarations;for(let o=0,u=l.length;o<u;++o){let c=l[o].initializer;if(c==null||c.kind!=16)continue;let f=c;if(f.declaration.body==null)continue;let _=new ya(this,e,f.declaration);_.run(),this.recordAnalysis(f.declaration,_),_.hasCaptures()&&!_.refused&&_.refuse(f.declaration.range,"a capture from a top-level function expression (closures lowering)")}break}default:break}}return t}lowerStatementList(r,e,t){let i=new Array,s=!1;for(let a=0,l=e.length;a<l;++a){let o=e[a];switch(o.kind){case 59:{let u=o;if(u.body==null){i.push(o);break}let c=assert(assert(this.analyses).get(u));if(!c.hasCaptures()){i.push(o);break}if(c.refused){i.push(o);break}let f=c.makeEnvClasses();for(let _=0,d=f.length;_<d;++_)i.push(f[_]);c.rewrite(),i.push(o),s=!0;break}case 63:{this.lowerStatementList(r,o.members,t),i.push(o);break}case 55:{let u=o,c=this.lowerMethods(u,t);for(let f=0,_=c.length;f<_;++f)i.push(c[f]);c.length>0&&(s=!0),i.push(o);break}case 51:{i.push(o);break}default:{i.push(o);break}}}if(s){e.length=0;for(let a=0,l=i.length;a<l;++a)e.push(i[a])}}lowerMethods(r,e){let t=new Array,i=r.members;for(let s=0,a=i.length;s<a;++s){let l=i[s];if(l.kind!=62)continue;let o=l;if(o.body==null||o.is(32))continue;let u=assert(assert(this.analyses).get(o));if(!u.hasCaptures()||u.refused)continue;let c=u.makeEnvClasses();for(let f=0,_=c.length;f<_;++f)t.push(c[f]);u.rewrite()}return t}},E_=class{constructor(r,e){this.name=r;this.range=e}},A_=class{constructor(){this.hits=null;this.sawAsync=!1}check(r,e){if(!mk(r))return;let t=this.hits;if(t==null)t=new Array,this.hits=t;else for(let i=0,s=t.length;i<s;++i)if(t[i].name==r)return;t.push(new E_(r,e))}refuse(r){let e=this.hits;if(e==null)return!1;for(let t=0,i=e.length;t<i;++t)r.error(100,e[t].range,"a user identifier named '"+e[t].name+"' (closures lowering)");return!0}visitStatements(r){for(let e=0,t=r.length;e<t;++e)this.visitStatement(r[e])}visitStatement(r){switch(r.kind){case 34:{this.visitStatements(r.statements);break}case 37:{let e=r;this.visitStatement(e.body),this.visitExpression(e.condition);break}case 42:{this.visitExpression(r.expression);break}case 43:{let e=r,t=e.initializer;t!=null&&this.visitStatement(t);let i=e.condition;i!=null&&this.visitExpression(i);let s=e.incrementor;s!=null&&this.visitExpression(s),this.visitStatement(e.body);break}case 44:{let e=r;this.visitStatement(e.variable),this.visitExpression(e.iterable),this.visitStatement(e.body);break}case 45:{let e=r;this.visitExpression(e.condition),this.visitStatement(e.ifTrue),e.ifFalse!=null&&this.visitStatement(assert(e.ifFalse));break}case 47:{let e=r.value;e!=null&&this.visitExpression(e);break}case 48:{let e=r;this.visitExpression(e.condition);let t=e.cases;for(let i=0,s=t.length;i<s;++i){let a=t[i].label;a!=null&&this.visitExpression(a),this.visitStatements(t[i].statements)}break}case 49:{this.visitExpression(r.value);break}case 50:{let e=r;this.visitStatements(e.bodyStatements);let t=e.catchVariable;t!=null&&this.check(t.text,t.range),e.catchStatements!=null&&this.visitStatements(assert(e.catchStatements)),e.finallyStatements!=null&&this.visitStatements(assert(e.finallyStatements));break}case 51:{let e=r.declarations;for(let t=0,i=e.length;t<i;++t){let s=e[t];this.check(s.name.text,s.name.range),s.initializer!=null&&this.visitExpression(assert(s.initializer))}break}case 53:{let e=r;this.visitExpression(e.condition),this.visitStatement(e.body);break}case 59:case 62:{this.visitFunction(r);break}case 55:{this.visitClass(r);break}case 56:{let e=r;this.check(e.name.text,e.name.range);let t=e.values;for(let i=0,s=t.length;i<s;++i){this.check(t[i].name.text,t[i].name.range);let a=t[i].initializer;a!=null&&this.visitExpression(a)}break}case 63:{let e=r;this.check(e.name.text,e.name.range),this.visitStatements(e.members);break}case 64:{let e=r;this.check(e.name.text,e.name.range);break}default:break}}visitFunction(r){let e=r.name;e.text.length!=0&&this.check(e.text,e.range),r.isAsync&&(this.sawAsync=!0);let t=r.signature.parameters;for(let s=0,a=t.length;s<a;++s){let l=t[s];this.check(l.name.text,l.name.range),l.initializer!=null&&this.visitExpression(assert(l.initializer))}let i=r.body;i!=null&&this.visitStatement(i)}visitClass(r){let e=r.name;e.text.length!=0&&this.check(e.text,e.range);let t=r.members;for(let i=0,s=t.length;i<s;++i){let a=t[i];switch(a.kind){case 58:{let l=a;this.check(l.name.text,l.name.range),l.initializer!=null&&this.visitExpression(assert(l.initializer));break}case 62:{this.visitFunction(a);break}default:break}}}visitExpression(r){switch(r.kind){case 9:{this.visitExpression(r.expression);break}case 10:{let e=r;this.visitExpression(e.left),this.visitExpression(e.right);break}case 11:{let e=r;this.visitExpression(e.expression);let t=e.args;for(let i=0,s=t.length;i<s;++i)this.visitExpression(t[i]);break}case 12:{this.visitClass(r.declaration);break}case 13:{let e=r.expressions;for(let t=0,i=e.length;t<i;++t)this.visitExpression(e[t]);break}case 14:{let e=r;this.visitExpression(e.expression),this.visitExpression(e.elementExpression);break}case 16:{this.visitFunction(r.declaration);break}case 17:{this.visitExpression(r.expression);break}case 18:{let e=r;switch(e.literalKind){case 3:{let t=e.expressions;for(let i=0,s=t.length;i<s;++i)this.visitExpression(t[i]);break}case 5:{let t=e.elementExpressions;for(let i=0,s=t.length;i<s;++i)this.visitExpression(t[i]);break}case 6:{let t=e.values;for(let i=0,s=t.length;i<s;++i)this.visitExpression(t[i]);break}default:break}break}case 19:{let e=r.args;for(let t=0,i=e.length;t<i;++t)this.visitExpression(e[t]);break}case 22:{this.visitExpression(r.expression);break}case 23:{this.visitExpression(r.expression);break}case 24:{let e=r;this.visitExpression(e.condition),this.visitExpression(e.ifThen),this.visitExpression(e.ifElse);break}case 30:{this.visitExpression(r.operand);break}case 29:{this.visitExpression(r.operand);break}case 31:{this.visitExpression(r.operand);break}case 32:{this.visitExpression(r.expression);break}default:break}}};var ma=class{constructor(r,e,t,i,s){this.name=r;this.type=e;this.scope=t;this.declaration=i;this.hasInitializer=s;this.captured=!1;this.hasInitFlag=!1;this.isParam=!1;this.isLoopHeader=!1;this.isLoopHeaderOf=null;this.closureValue=null;this.isConst=!1}},Ot=class{constructor(r,e,t,i){this.kind=r;this.parent=e;this.ownerFunction=t;this.range=i;this.bindings=new Map;this.functionValues=new Map;this.captured=new Array;this.localName=null;this.className=null;this.needsThis=!1;this.isLoopHeader=!1}resolveFunctionValue(r){let e=this;for(;e!=null;){let t=J(e.functionValues,r);if(t)return t;e=e.parent}return null}knownTypes(){let r=new Map,e=this;for(;e!=null;){let t=e.bindings,i=Map_keys(t);for(let s=0,a=i.length;s<a;++s){let l=unchecked(i[s]);if(r.has(l))continue;let u=assert(t.get(l)).type;u!=null&&r.set(l,u)}e=e.parent}return r}resolve(r){let e=this;for(;e!=null;){let t=J(e.bindings,r);if(t)return t;e=e.parent}return null}},T_=class{constructor(r,e,t){this.expression=r;this.arrows=e;this.receiver=t}},S_=class{constructor(r,e){this.declaration=r;this.range=e}},v_=class{constructor(r,e,t){this.identifier=r;this.binding=e;this.write=t}},I_=class{constructor(r,e,t,i,s){this.node=r;this.expression=e;this.isArrow=t;this.isAsync=i;this.parent=s;this.children=new Array;this.directCaptures=null;this.neededScopes=null;this.needed=null;this.displayName="";this.ownEnv=!1;this.bodyParent=null;this.usesThis=!1;this.capturesLocal=!1;this.ownsScope=null}recordCapture(r){let e=this.directCaptures;if(e==null)e=new Array,this.directCaptures=e;else if(e.includes(r))return;e.push(r)}recordNeed(r){let e=this.neededScopes;if(e==null)e=new Array,this.neededScopes=e;else if(e.includes(r))return;e.push(r);let t=this.needed;(t==null||ba(r)>ba(t))&&(this.needed=r)}resetNeeds(){this.neededScopes=null,this.needed=null}};function mu(n){return n.captured.length>0||n.needsThis}function _u(n){let r=n.parent;for(;r!=null;){if(mu(r))return r;r=r.parent}return null}function yk(n){let r=n.ownerFunction.name.text,e=n.kind==0?"$body":"$block";return r+e+":"+ba(n).toString()}function ba(n){let r=0,e=n;for(;e!=null;)++r,e=e.parent;return r}var ya=class{constructor(r,e,t,i=null,s=null){this.transform=r;this.parser=e;this.owner=t;this.refs=new Map;this.writes=new Set;this.allRefs=new Array;this.infos=new Map;this.scopes=new Array;this.scopeOfBlock=new Map;this.scopeOfCase=new Map;this.scopeOfLoop=new Map;this.plainBlocks=new Set;this.allInfos=new Array;this.bindingOf=new Map;this.captures=!1;this.refused=!1;this.typeParameters=new Set;this.classTypeParameters=new Set;this.envTypeParameters=new Array;this.thisUses=new Array;this.ownerBodyUsesThis=!1;this.hostCallbackCandidates=new Array;this.ownerNames=new Map;this.classNames=new Set;this.anonymousOwners=0;this.structFunctions=new Set;this.thisRefs=new Map;this.ownerThisType=i??t.signature.explicitThisType;let a=t.typeParameters;if(a)for(let o=0,u=a.length;o<u;++o)this.typeParameters.add(a[o].name.text);if(s!=null){let o=s.typeParameters;if(o)for(let u=0,c=o.length;u<c;++u){let f=o[u].name.text;this.classTypeParameters.add(f),this.envTypeParameters.push(f)}}let l=t.typeParameters;if(l)for(let o=0,u=l.length;o<u;++o){let c=l[o].name.text;this.typeParameters.add(c),this.classTypeParameters.has(c)||this.envTypeParameters.push(c)}}hasCaptures(){return this.captures||this.thisRefs.size>0}refuse(r,e){this.refused||(this.refused=!0,this.parser.error(100,r,e))}isPlainBlock(r){return this.plainBlocks.has(r)}describe(r,e){let t=new Array,i=r.neededScopes;if(i!=null){let l=new Array;for(let o=0,u=i.length;o<u;++o)l.push(i[o]);for(let o=1,u=l.length;o<u;++o){let c=l[o],f=ba(c),_=o-1;for(;_>=0&&ba(l[_])<f;)l[_+1]=l[_],--_;l[_+1]=c}for(let o=0,u=l.length;o<u;++o)t.push(yk(l[o]))}let s=r.needed!=null?"struct":r.usesThis?"receiver":"none",a=r.node.name.text;return a.length==0&&(a=r.displayName),a.length==0&&(a="$anonymous"+e.toString()),new gu(a,s,r.needed!=null?r.needed.className:null,r.ownEnv,r.needed!=null,r.bodyParent!=null?r.bodyParent.className:null,t)}attributeThis(){let r=this.thisUses;for(let e=0,t=r.length;e<t;++e){let i=r[e],s=i.arrows[0],a=i.receiver.ownsScope;if(a==null)continue;let l=s.needed;if(l==null){if(!i.receiver.isAsync)continue;s.recordCapture(a),s.recordNeed(a),a.needsThis=!0,this.thisRefs.set(i.expression,a);continue}if(this.ownerThisType==null){this.refuse(i.expression.range,"this in a capturing arrow (closures lowering)");continue}let o;l.ownerFunction===a.ownerFunction?(l.needsThis=!0,o=l):(a.needsThis=!0,o=a),this.thisRefs.set(i.expression,o)}if(this.ownerBodyUsesThis&&this.owner.isAsync&&this.ownerThisType!=null){let e=J(this.infos,this.owner),t=e!=null?e.ownsScope:null;t!=null&&mu(t)&&(t.needsThis=!0)}}ownerPrefix(r){let e=J(this.infos,r);if(e==null)return r.name.text;let t=new Array,i=e;for(;i!=null;)t.push(this.ownerNameOf(i)),i=i.parent;let s="";for(let a=t.length-1;a>=0;--a)s.length!=0&&(s+="$"),s+=t[a];return s}ownerNameOf(r){let e=J(this.ownerNames,r.node);if(e!=null)return e;let t=r.node.name.text;return t.length==0&&(t=r.displayName),t.length==0&&(++this.anonymousOwners,t="$anon"+this.anonymousOwners.toString()),this.ownerNames.set(r.node,t),t}uniqueClassName(r,e){let t=r,i=0;for(;this.classNames.has(t);)++i,t=r+"$"+i.toString();return this.classNames.add(t),t}finalizeNeeds(){let r=this.scopes,e=this.allInfos;for(let t=0,i=e.length;t<i;++t)e[t].ownEnv=!1,e[t].bodyParent=null;for(let t=0,i=r.length;t<i;++t){let s=r[t];if(!mu(s))continue;let a=J(this.infos,s.ownerFunction);a!=null&&(a.ownEnv=!0)}for(let t=e.length-1;t>=0;--t){let i=e[t];i.resetNeeds();let s=i.directCaptures;if(s!=null)for(let o=0,u=s.length;o<u;++o)i.recordNeed(s[o]);let a=i.children;for(let o=0,u=a.length;o<u;++o){let c=a[o].needed;c!=null&&this.isDeliverable(i,c)&&i.recordNeed(c)}let l=i.ownsScope;if(l!=null&&l.captured.length>0){let o=_u(l);o!=null&&(i.bodyParent=o,i.recordNeed(o))}}}run(){let r=this.analyzeFunction(this.owner,null,!1,null,null),e=this.allRefs;for(let s=0,a=e.length;s<a;++s){let l=e[s];l.binding.captured&&(this.refs.set(l.identifier,l.binding),l.write&&this.writes.add(l.identifier))}this.finalizeNeeds(),this.attributeThis(),this.finalizeNeeds();let t=this.hostCallbackCandidates;for(let s=0,a=t.length;s<a;++s){let l=t[s],o=J(this.infos,l.declaration);if(o!=null&&o.needed!=null){this.refuse(l.range,"a closure captured by a host callback (closures lowering)");break}}let i=0;for(let s=0,a=this.scopes.length;s<a;++s){let l=this.scopes[s];if(!mu(l))continue;if(l.kind==1&&!this.isPlainBlock(l)&&!l.isLoopHeader){this.refuse(l.range,"a capture from a switch or try scope (closures lowering)");continue}let o=this.ownerPrefix(l.ownerFunction);l.kind==0?(l.localName=ha,l.className=this.uniqueClassName(o+Px,l.range)):(++i,l.localName=ha+"$"+i.toString(),l.className=this.uniqueClassName(o+Px+"$"+i.toString(),l.range))}for(let s=0,a=this.allInfos.length;s<a;++s){let l=this.allInfos[s],o=l.ownsScope;o==null||o.className==null||sl.set(l.node,new ts(0,o.className,!0,!1,l.bodyParent!=null?assert(l.bodyParent).className:null,o.needsThis))}r.needed!=null&&this.refuse(this.owner.range,"a top-level function that captures (closures lowering)")}analyzeFunction(r,e,t,i,s){let a=new I_(r,e,t,r.isAsync,s);this.infos.set(r,a),this.allInfos.push(a),s&&s.children.push(a);let l=new Ot(0,i,r,r.range);a.ownsScope=l,this.scopes.push(l);let o=r.signature.parameters;for(let c=0,f=o.length;c<f;++c){let _=o[c],d=new ma(_.name.text,_.type,l,_,!0);d.isParam=!0,l.bindings.set(d.name,d)}let u=r.body;u!=null&&(u.kind==34?this.walkStatements(u.statements,l,a):this.walkStatement(u,l,a)),a.needed!=null&&e!=null&&this.structFunctions.add(e);for(let c=0,f=a.children.length;c<f;++c){let d=a.children[c].needed;d!=null&&this.isDeliverable(a,d)&&a.recordNeed(d)}return a}isDeliverable(r,e){if(e.ownerFunction===r.node)return!1;let t=r.ownsScope,i=e;for(;i!=null;){if(i===t)return!1;i=i.parent}return!0}walkStatements(r,e,t){for(let i=0,s=r.length;i<s;++i)this.walkStatement(r[i],e,t)}walkStatement(r,e,t){switch(r.kind){case 34:{let i=r,s=new Ot(1,e,t.node,i.range);this.scopeOfBlock.set(i,s),this.plainBlocks.add(s),this.scopes.push(s),this.walkStatements(i.statements,s,t);break}case 51:{let i=r.declarations;for(let s=0,a=i.length;s<a;++s)this.declare(i[s],e,!1,t);break}case 42:{let i=r.expression;if(this.walkExpression(i,e,t,!1),i.kind==16){let s=i,a=s.declaration.name;a.text.length>0&&e.functionValues.set(a.text,s)}break}case 47:{let i=r.value;i!=null&&this.walkExpression(i,e,t,!1);break}case 45:{let i=r;this.walkExpression(i.condition,e,t,!1),this.walkStatement(i.ifTrue,e,t),i.ifFalse!=null&&this.walkStatement(assert(i.ifFalse),e,t);break}case 53:{let i=r;this.walkExpression(i.condition,e,t,!1),this.walkStatement(i.body,e,t);break}case 37:{let i=r;this.walkStatement(i.body,e,t),this.walkExpression(i.condition,e,t,!1);break}case 43:{let i=r,s=new Ot(1,e,t.node,i.range);this.scopeOfLoop.set(i,s),this.scopes.push(s);let a=i.initializer;if(a!=null)if(a.kind==51){let u=a.declarations;for(let c=0,f=u.length;c<f;++c)this.declare(u[c],s,!0,t,i)}else this.walkStatement(a,s,t);let l=i.condition;l!=null&&this.walkExpression(l,s,t,!1);let o=i.incrementor;o!=null&&this.walkExpression(o,s,t,!1),this.walkStatement(i.body,s,t);break}case 44:{let i=r;this.walkExpression(i.iterable,e,t,!1);let s=new Ot(1,e,t.node,i.range);if(this.scopes.push(s),i.variable.kind==51){let a=i.variable.declarations;for(let l=0,o=a.length;l<o;++l)this.declare(a[l],s,!0,t)}else this.walkStatement(i.variable,s,t);this.walkStatement(i.body,s,t);break}case 48:{let i=r;this.walkExpression(i.condition,e,t,!1);let s=i.cases;for(let a=0,l=s.length;a<l;++a){let o=s[a],u=o.label;u!=null&&this.walkExpression(u,e,t,!1);let c=new Ot(1,e,t.node,o.range);this.scopeOfCase.set(o,c),this.scopes.push(c),this.walkStatements(o.statements,c,t)}break}case 50:{let i=r,s=new Ot(1,e,t.node,i.range);if(this.scopes.push(s),this.walkStatements(i.bodyStatements,s,t),i.catchStatements!=null){let a=new Ot(1,e,t.node,i.range);this.scopes.push(a);let l=i.catchVariable;if(l!=null){let o=new ma(l.text,null,a,l,!0);a.bindings.set(o.name,o)}this.walkStatements(assert(i.catchStatements),a,t)}if(i.finallyStatements!=null){let a=new Ot(1,e,t.node,i.range);this.scopes.push(a),this.walkStatements(assert(i.finallyStatements),a,t)}break}case 49:{this.walkExpression(r.value,e,t,!1);break}case 35:case 36:case 38:case 64:break;default:break}}declare(r,e,t,i,s=null){let a=r.initializer;a!=null&&this.walkExpression(a,e,i,!1);let l=new ma(r.name.text,r.type,e,r,a!=null);if(l.isLoopHeader=t,l.isLoopHeaderOf=s,a!=null&&a.kind==16){let o=a;this.structFunctions.has(o)&&(l.closureValue=o);let u=J(this.infos,o.declaration);u!=null&&(u.displayName=r.name.text)}l.isConst=(r.flags&8)!=0,e.bindings.set(l.name,l),this.bindingOf.set(r,l)}walkExpression(r,e,t,i){switch(r.kind){case 8:{let s=r,a=e.resolve(s.text);if(a==null)return;this.allRefs.push(new v_(s,a,i)),a.scope.ownerFunction!==t.node&&this.capture(a,s,t,i);return}case 26:{t.node===this.owner?this.ownerBodyUsesThis=!0:this.markThis(r,t);return}case 25:{t.isArrow&&this.refuse(r.range,"super in a capturing arrow (closures lowering)");return}case 27:case 15:case 20:return;case 16:{let s=r,a=s.declaration;this.analyzeFunction(a,s,a.arrowKind!=0,e,t);return}case 18:{let s=r;switch(s.literalKind){case 3:{let a=s.expressions;for(let l=0,o=a.length;l<o;++l)this.walkExpression(a[l],e,t,!1);break}case 5:{let a=s.elementExpressions;for(let l=0,o=a.length;l<o;++l)this.walkExpression(a[l],e,t,!1);break}case 6:{let a=s.values;for(let l=0,o=a.length;l<o;++l)this.walkExpression(a[l],e,t,!1);break}default:break}return}case 10:{let s=r,a=Bx(s.operator);this.walkExpression(s.left,e,t,a),this.walkExpression(s.right,e,t,!1);return}case 30:{let s=r,a=s.operator==88||s.operator==89;this.walkExpression(s.operand,e,t,a);return}case 29:{let s=r,a=s.operator==88||s.operator==89;this.walkExpression(s.operand,e,t,a);return}case 11:{let s=r;this.walkExpression(s.expression,e,t,!1);let a=s.args;for(let l=0,o=a.length;l<o;++l)this.walkExpression(a[l],e,t,!1);if(gk(s))for(let l=0,o=a.length;l<o;++l){let u=this.closureValueIn(a[l],e);if(u!=null){let c=J(this.infos,u.declaration);c!=null&&c.needed!=null?this.refuse(u.range,"a closure captured by a host callback (closures lowering)"):this.hostCallbackCandidates.push(new S_(u.declaration,u.range))}}return}case 13:{let s=r.expressions;for(let a=0,l=s.length;a<l;++a)this.walkExpression(s[a],e,t,a==l-1?i:!1);return}case 14:{let s=r;this.walkExpression(s.expression,e,t,!1),this.walkExpression(s.elementExpression,e,t,!1);return}case 17:{this.walkExpression(r.expression,e,t,!1);return}case 19:{let s=r.args;for(let a=0,l=s.length;a<l;++a)this.walkExpression(s[a],e,t,!1);return}case 22:{this.walkExpression(r.expression,e,t,i);return}case 23:{this.walkExpression(r.expression,e,t,!1);return}case 24:{let s=r;this.walkExpression(s.condition,e,t,!1),this.walkExpression(s.ifThen,e,t,i),this.walkExpression(s.ifElse,e,t,i);return}case 9:{this.walkExpression(r.expression,e,t,i);return}case 31:{this.walkExpression(r.operand,e,t,!1);return}case 32:{this.walkExpression(r.expression,e,t,!1);return}default:return}}capture(r,e,t,i){if(this.captures=!0,r.captured=!0,r.hasInitializer||(r.hasInitFlag=!0),r.isLoopHeader&&(r.isLoopHeaderOf==null?this.refuse(e.range,"a captured for-of or for-in binding (closures lowering)"):r.scope.isLoopHeader=!0),r.type==null){let s=null,a=r.declaration;a.kind==65&&(s=a.initializer);let l=ct(s,r.scope.knownTypes(),0);l!=null?(r.type=l,a.kind==65&&(a.type=l)):this.refuse(e.range,"a captured local without a declared type (closures lowering)")}r.type!=null&&(k_(assert(r.type),this.typeParameters)||k_(assert(r.type),this.classTypeParameters))&&xk(r.scope)&&this.refuse(e.range,"a captured local typed by a type parameter in an async body (closures lowering)"),i&&r.isConst&&this.refuse(e.range,"an assignment to a captured constant (closures lowering)"),t.capturesLocal=!0,t.recordCapture(r.scope),t.recordNeed(r.scope),r.scope.captured.includes(r)||r.scope.captured.push(r)}closureValueIn(r,e){if(r.kind==16)return r;if(r.kind==8){let t=r.text,i=e.resolveFunctionValue(t);if(i!=null)return i;let s=e.resolve(t);if(s!=null&&s.closureValue!=null)return s.closureValue}return null}structClosureIn(r,e){if(r.kind==16){let t=r;return this.structFunctions.has(t)?t:null}if(r.kind==8){let t=r.text,i=e.resolveFunctionValue(t);if(i!=null)return this.structFunctions.has(i)?i:null;let s=e.resolve(t);if(s!=null&&s.closureValue!=null)return s.closureValue}return null}markThis(r,e){let t=new Array,i=e;for(;i!=null&&i.isArrow;)i.usesThis=!0,t.push(i),i=i.parent;t.length>0&&i!=null&&this.thisUses.push(new T_(r,t,i))}makeEnvClasses(){let r=new Array;for(let e=0,t=this.scopes.length;e<t;++e){let i=this.scopes[e];i.className!=null&&r.push(this.makeEnvClass(i))}return r}envTypeArgs(r){let e=this.envTypeParameters,t=e.length;if(t==0)return null;let i=new Array(t);for(let s=0;s<t;++s)i[s]=y.createNamedType(y.createSimpleTypeName(e[s],r),null,!1,r);return i}makeEnvClass(r){let e=new Array,t=r.range,i=r.captured;if(r.needsThis){let o=assert(this.ownerThisType);e.push(y.createFieldDeclaration(y.createIdentifierExpression(Ei,t),null,262144,o,y.createCallExpression(y.createIdentifierExpression("changetype",t),[o],[y.createIntegerLiteralExpression(i64_new(0),t)],t),t))}for(let o=0,u=i.length;o<u;++o){let c=i[o].type,f=null;c!=null&&bk(c)&&(f=y.createCallExpression(y.createIdentifierExpression("changetype",t),[c],[y.createIntegerLiteralExpression(i64_new(0),t)],t)),e.push(y.createFieldDeclaration(y.createIdentifierExpression(i[o].name,t),null,262144,c,f,t))}for(let o=0,u=i.length;o<u;++o)i[o].hasInitFlag&&e.push(y.createFieldDeclaration(y.createIdentifierExpression(hu+i[o].name,t),null,262144,yu("bool",t),null,t));let s=_u(r);if(s!=null&&e.push(y.createFieldDeclaration(y.createIdentifierExpression(da,t),null,262144,y.createNamedType(y.createSimpleTypeName(assert(s.className),t),this.envTypeArgs(t),!0,t),y.createNullExpression(t),t)),r.isLoopHeader||s!=null){let o=assert(r.className),u="source",c="parent",f=new Array;r.isLoopHeader&&f.push(y.createParameter(1,y.createIdentifierExpression(u,t),y.createNamedType(y.createSimpleTypeName(o,t),this.envTypeArgs(t),!0,t),y.createNullExpression(t),t)),s!=null&&f.push(y.createParameter(1,y.createIdentifierExpression(c,t),y.createNamedType(y.createSimpleTypeName(assert(s.className),t),this.envTypeArgs(t),!0,t),y.createNullExpression(t),t));let _=new Array;if(_.push(y.createExpressionStatement(y.createCallExpression(y.createSuperExpression(t),null,[],t))),s!=null){let h;r.isLoopHeader?h=y.createTernaryExpression(y.createBinaryExpression(78,y.createIdentifierExpression(u,t),y.createNullExpression(t),t),this.fieldOn(u,da,t),y.createIdentifierExpression(c,t),t):h=y.createIdentifierExpression(c,t),_.push(y.createExpressionStatement(this.assign(this.fieldOn("this",da,t),h,t)))}let d=new Array,m=new Array;r.needsThis&&m.push(Ei);for(let h=0,b=i.length;h<b;++h)m.push(i[h].name),i[h].hasInitFlag&&m.push(hu+i[h].name);if(r.isLoopHeader)for(let h=0,b=m.length;h<b;++h)d.push(y.createExpressionStatement(this.assign(this.fieldOn("this",m[h],t),this.fieldOn(u,m[h],t),t)));d.length>0&&_.push(y.createIfStatement(y.createBinaryExpression(78,y.createIdentifierExpression(u,t),y.createNullExpression(t),t),y.createBlockStatement(d,t),null,t)),e.push(y.createMethodDeclaration(y.createConstructorExpression(t),null,786432,null,y.createFunctionType(f,yu("void",t),null,!1,t),y.createBlockStatement(_,t),t))}let a=null,l=this.envTypeParameters;if(l.length>0){a=new Array(l.length);for(let o=0,u=l.length;o<u;++o)a[o]=y.createTypeParameter(y.createIdentifierExpression(l[o],t),null,null,t)}return y.createClassDeclaration(y.createIdentifierExpression(assert(r.className),t),null,a!=null?65536:0,a,yu("TaskEnv",t),null,e,t)}rewrite(){let r=assert(this.infos.get(this.owner));this.rewriteFunctionBody(r)}rewriteFunctionBody(r){let e=r.node.body;if(e==null)return;let t=assert(r.ownsScope),i,s=null;e.kind==34?i=e.statements:(s=e,i=[s]);let a=this.rewriteStatements(i,t,r.node);if(s!=null)if(a.length==1&&a[0].kind==42)r.node.body=a[0];else{let l=new Array,o=null;if(a.length!=0){let u=a.length-1;o=a[u];for(let c=0;c<u;++c)l.push(a[c])}o!=null&&o.kind==42?l.push(y.createReturnStatement(o.expression,o.range)):o!=null&&l.push(o),r.node.body=y.createBlockStatement(l,s.range)}else{let l=e;l.statements.length=0;for(let o=0,u=a.length;o<u;++o)l.statements.push(a[o])}}rewriteStatements(r,e,t,i=null){let s=new Array;if(e.localName!=null){s.push(this.makeEnvAllocation(e)),e.needsThis&&s.push(y.createExpressionStatement(this.assign(this.fieldOn(assert(e.localName),Ei,e.range),y.createThisExpression(e.range),e.range)));let a=e.captured;for(let l=0,o=a.length;l<o;++l){let u=a[l];u.isParam&&s.push(y.createExpressionStatement(this.assign(this.fieldOf(e,u,e.range),y.createIdentifierExpression(u.name,e.range),e.range)))}}for(let a=0,l=r.length;a<l;++a){let o=this.rewriteStatement(r[a],e,t,i);o!=null&&s.push(o)}return s}makeEnvAllocation(r){let e=assert(r.className),t=new Array;r.isLoopHeader&&t.push(y.createNullExpression(r.range));let i=_u(r);return i!=null&&t.push(i.ownerFunction===r.ownerFunction?y.createIdentifierExpression(assert(i.localName),r.range):y.createIdentifierExpression(du,r.range)),y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(assert(r.localName),r.range),null,16,y.createNamedType(y.createSimpleTypeName(e,r.range),this.envTypeArgs(r.range),!1,r.range),y.createNewExpression(y.createSimpleTypeName(e,r.range),this.envTypeArgs(r.range),t,r.range),r.range)],r.range)}rewriteStatement(r,e,t,i=null){switch(r.kind){case 34:{let s=r,a=J(this.scopeOfBlock,s),l=a??e,o=this.rewriteStatements(s.statements,l,t,i);return y.createBlockStatement(o,s.range)}case 51:{let s=r,a=new Array,l=new Array,o=s.declarations;for(let u=0,c=o.length;u<c;++u){let f=o[u],_=J(this.bindingOf,f);if(_!=null&&_.captured){let m=f.initializer;m!=null&&l.push(y.createExpressionStatement(this.assign(this.fieldOf(_.scope,_,f.name.range),this.rewriteExpression(m,e,t),f.range)));continue}let d=f.initializer;d!=null&&(f.initializer=this.rewriteExpression(d,e,t)),a.push(f)}return a.length>0&&l.unshift(y.createVariableStatement(s.decorators,a,s.range)),l.length==0?null:l.length==1?l[0]:y.createBlockStatement(l,s.range)}case 42:{let s=r;return y.createExpressionStatement(this.rewriteExpression(s.expression,e,t))}case 47:{let s=r,a=s.value;return y.createReturnStatement(a!=null?this.rewriteExpression(a,e,t):null,s.range)}case 45:{let s=r;return y.createIfStatement(this.rewriteExpression(s.condition,e,t),assert(this.rewriteStatement(s.ifTrue,e,t,i)),s.ifFalse!=null?this.rewriteStatement(assert(s.ifFalse),e,t,i):null,s.range)}case 53:{let s=r;return y.createWhileStatement(this.rewriteExpression(s.condition,e,t),assert(this.rewriteStatement(s.body,e,t,null)),s.range)}case 37:{let s=r;return y.createDoStatement(assert(this.rewriteStatement(s.body,e,t,null)),this.rewriteExpression(s.condition,e,t),s.range)}case 43:{let s=r,a=J(this.scopeOfLoop,s),l=a??e;if(!(a!=null&&a.localName!=null&&a.isLoopHeader)){let u=s.initializer;return y.createForStatement(u!=null?this.rewriteStatement(u,l,t):null,s.condition!=null?this.rewriteExpression(assert(s.condition),l,t):null,s.incrementor!=null?this.rewriteExpression(assert(s.incrementor),l,t):null,assert(this.rewriteStatement(s.body,l,t,null)),s.range)}return this.rewriteHeaderLoop(s,assert(a),t)}case 44:{let s=r,a=this.rewriteStatement(s.variable,e,t);return y.createForOfStatement(assert(a),this.rewriteExpression(s.iterable,e,t),assert(this.rewriteStatement(s.body,e,t)),s.range)}case 48:{let s=r,a=new Array,l=s.cases;for(let o=0,u=l.length;o<u;++o){let c=l[o],f=e,_=new Array;for(let d=0,m=c.statements.length;d<m;++d){let h=this.rewriteStatement(c.statements[d],f,t);h!=null&&_.push(h)}a.push(y.createSwitchCase(c.label!=null?this.rewriteExpression(assert(c.label),e,t):null,_,c.range))}return y.createSwitchStatement(this.rewriteExpression(s.condition,e,t),a,s.range)}case 50:{let s=r,a=new Array;for(let f=0,_=s.bodyStatements.length;f<_;++f){let d=this.rewriteStatement(s.bodyStatements[f],e,t);d!=null&&a.push(d)}let l=null,o=s.catchStatements;if(o!=null){l=new Array;for(let f=0,_=o.length;f<_;++f){let d=this.rewriteStatement(o[f],e,t);d!=null&&l.push(d)}}let u=null,c=s.finallyStatements;if(c!=null){u=new Array;for(let f=0,_=c.length;f<_;++f){let d=this.rewriteStatement(c[f],e,t);d!=null&&u.push(d)}}return y.createTryStatement(a,s.catchVariable,l,u,s.range)}case 36:return i==null?r:y.createBlockStatement([i,y.createContinueStatement(r.label,r.range)],r.range);case 49:{let s=r;return y.createThrowStatement(this.rewriteExpression(s.value,e,t),s.range)}default:return r}}rewriteHeaderLoop(r,e,t){let i=new Array;i.push(this.makeEnvAllocation(e)),e.needsThis&&i.push(y.createExpressionStatement(this.assign(this.fieldOn(assert(e.localName),Ei,r.range),y.createThisExpression(r.range),r.range)));let s=null,a=r.initializer;if(a!=null)if(a.kind==51){let f=a,_=new Array,d=f.declarations;for(let m=0,h=d.length;m<h;++m){let b=d[m],A=J(this.bindingOf,b);if(A!=null&&A.captured){let S=b.initializer;S!=null&&i.push(y.createExpressionStatement(this.assign(this.fieldOf(e,A,b.name.range),this.rewriteExpression(S,e,t),b.range)))}else{let S=b.initializer;S!=null&&(b.initializer=this.rewriteExpression(S,e,t)),_.push(b)}}_.length>0&&(s=y.createVariableStatement(f.decorators,_,f.range))}else s=this.rewriteStatement(a,e,t,null);let l=this.rewriteStatement(r.body,e,t,this.makeCloneStatement(e)),o=assert(l),u=o.kind==34?o.statements:[o];u.push(this.makeCloneStatement(e));let c=y.createForStatement(s,r.condition!=null?this.rewriteExpression(assert(r.condition),e,t):null,r.incrementor!=null?this.rewriteExpression(assert(r.incrementor),e,t):null,y.createBlockStatement(u,r.body.range),r.range);return i.push(c),y.createBlockStatement(i,r.range)}makeCloneStatement(r){let e=assert(r.localName),t=assert(r.className);return y.createExpressionStatement(this.assign(y.createIdentifierExpression(e,r.range),y.createNewExpression(y.createSimpleTypeName(t,r.range),this.envTypeArgs(r.range),[y.createIdentifierExpression(e,r.range)],r.range),r.range))}rewriteExpression(r,e,t){switch(r.kind){case 26:{let i=J(this.thisRefs,r);return i==null?r:this.fieldFrom(this.envExprForScope(i,t,r.range),Ei,r.range)}case 8:{let i=r,s=J(this.refs,i);if(s==null)return r;let a=this.fieldOfFor(s,t,i.range);return s.hasInitFlag?y.createCommaExpression([this.guard(s,a,t,i.range),a],i.range):a}case 10:{let i=r;if(Bx(i.operator)&&i.left.kind==8){let s=i.left,a=J(this.refs,s);if(a!=null){let l=this.fieldOfFor(a,t,i.left.range),o=this.rewriteExpression(i.right,e,t);if(i.operator==102)return a.hasInitFlag?y.createCommaExpression([this.assign(this.flagField(a,t,i.range),y.createTrueExpression(i.range),i.range),this.assign(l,o,i.range)],i.range):this.assign(l,o,i.range);let u=new Array;return a.hasInitFlag&&(u.push(this.guard(a,l,t,i.range)),u.push(this.assign(this.flagField(a,t,i.range),y.createTrueExpression(i.range),i.range))),u.push(y.createBinaryExpression(i.operator,l,o,i.range)),u.length==1?u[0]:y.createCommaExpression(u,i.range)}}return y.createBinaryExpression(i.operator,this.rewriteExpression(i.left,e,t),this.rewriteExpression(i.right,e,t),i.range)}case 30:{let i=r,s=i.operand.kind==8?J(this.refs,i.operand):null;if(s!=null){let a=this.fieldOfFor(s,t,i.range),l=new Array;return s.hasInitFlag&&(l.push(this.guard(s,a,t,i.range)),l.push(this.assign(this.flagField(s,t,i.range),y.createTrueExpression(i.range),i.range))),l.push(y.createUnaryPrefixExpression(i.operator,a,i.range)),l.length==1?l[0]:y.createCommaExpression(l,i.range)}return y.createUnaryPrefixExpression(i.operator,this.rewriteExpression(i.operand,e,t),i.range)}case 29:{let i=r,s=i.operand.kind==8?J(this.refs,i.operand):null;if(s!=null){let a=this.fieldOfFor(s,t,i.range),l=new Array;return s.hasInitFlag&&(l.push(this.guard(s,a,t,i.range)),l.push(this.assign(this.flagField(s,t,i.range),y.createTrueExpression(i.range),i.range))),l.push(y.createUnaryPostfixExpression(i.operator,a,i.range)),l.length==1?l[0]:y.createCommaExpression(l,i.range)}return y.createUnaryPostfixExpression(i.operator,this.rewriteExpression(i.operand,e,t),i.range)}case 11:{let i=r,s=new Array;for(let a=0,l=i.args.length;a<l;++a)s.push(this.rewriteExpression(i.args[a],e,t));return y.createCallExpression(this.rewriteExpression(i.expression,e,t),i.typeArguments,s,i.range)}case 16:{let i=r,s=J(this.infos,i.declaration);if(s!=null){this.rewriteFunctionBody(s);let a=s.needed;if(a!=null){let l=assert(a.className),o=s.bodyParent!=null?assert(s.bodyParent).className:null;On().set(i,new ts(2,l,s.ownEnv,!0,o,a.needsThis));let u=a.ownerFunction===t?a:null;qr().set(i,u!=null?assert(u.localName):du)}}return r}case 18:{let i=r;switch(i.literalKind){case 3:{let s=i.expressions;for(let a=0,l=s.length;a<l;++a)s[a]=this.rewriteExpression(s[a],e,t);break}case 5:{let s=i.elementExpressions;for(let a=0,l=s.length;a<l;++a)s[a]=this.rewriteExpression(s[a],e,t);break}case 6:{let s=i.values;for(let a=0,l=s.length;a<l;++a)s[a]=this.rewriteExpression(s[a],e,t);break}default:break}return i}case 13:{let i=r,s=new Array;for(let a=0,l=i.expressions.length;a<l;++a)s.push(this.rewriteExpression(i.expressions[a],e,t));return y.createCommaExpression(s,i.range)}case 14:{let i=r;return y.createElementAccessExpression(this.rewriteExpression(i.expression,e,t),this.rewriteExpression(i.elementExpression,e,t),i.range)}case 17:{let i=r;return y.createInstanceOfExpression(this.rewriteExpression(i.expression,e,t),i.isType,i.range)}case 19:{let i=r,s=new Array;for(let a=0,l=i.args.length;a<l;++a)s.push(this.rewriteExpression(i.args[a],e,t));return y.createNewExpression(i.typeName,i.typeArguments,s,i.range)}case 22:{let i=r;return y.createParenthesizedExpression(this.rewriteExpression(i.expression,e,t),i.range)}case 23:{let i=r;return y.createPropertyAccessExpression(this.rewriteExpression(i.expression,e,t),i.property,i.range)}case 24:{let i=r;return y.createTernaryExpression(this.rewriteExpression(i.condition,e,t),this.rewriteExpression(i.ifThen,e,t),this.rewriteExpression(i.ifElse,e,t),i.range)}case 9:{let i=r;return i.expression=this.rewriteExpression(i.expression,e,t),i}case 31:{let i=r;return i.operand=this.rewriteExpression(i.operand,e,t),i}case 32:{let i=r;return i.expression=this.rewriteExpression(i.expression,e,t),i}default:return r}}fieldOfFor(r,e,t){return this.fieldFrom(this.envExprFor(r,e,t),r.name,t)}envExprFor(r,e,t){return this.envExprForScope(r.scope,e,t)}envExprForScope(r,e,t){if(r.ownerFunction===e)return y.createIdentifierExpression(assert(r.localName),t);let i=assert(this.infos.get(e)),s=assert(i.needed),a=y.createIdentifierExpression(du,t),l=s;for(;l!==r;)a=y.createAssertionExpression(2,this.fieldFrom(a,da,t),null,t),l=assert(_u(l));return a}fieldFrom(r,e,t){return y.createPropertyAccessExpression(r,y.createIdentifierExpression(e,t),t)}fieldOf(r,e,t){return this.fieldOn(assert(r.localName),e.name,t)}fieldOn(r,e,t){return y.createPropertyAccessExpression(y.createIdentifierExpression(r,t),y.createIdentifierExpression(e,t),t)}flagField(r,e,t){return this.fieldFrom(this.envExprFor(r,e,t),hu+r.name,t)}guard(r,e,t,i){return y.createCallExpression(y.createIdentifierExpression(dk,i),[assert(r.type)],[e,this.flagField(r,t,i),y.createStringLiteralExpression(r.name,i)],i)}assign(r,e,t){return y.createBinaryExpression(102,r,e,t)}};function yu(n,r){return y.createNamedType(y.createSimpleTypeName(n,r),null,!1,r)}function gk(n){let r=n.expression;return(r.kind==8?r.text:r.kind==23?r.property.text:"")=="makeCallbacks"}function Bx(n){switch(n){case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:return!0;default:return!1}}function bk(n){if(n.kind!=1)return!0;let r=n,e=r.typeArguments;if(e!=null&&e.length>0)return!0;let t=r.name.identifier.text;return!(t=="i8"||t=="i16"||t=="i32"||t=="i64"||t=="u8"||t=="u16"||t=="u32"||t=="u64"||t=="isize"||t=="usize"||t=="bool"||t=="f32"||t=="f64"||t=="v128")}function xk(n){let r=n;for(;r!=null;){if(r.ownerFunction.isAsync)return!0;r=r.parent}return!1}function k_(n,r){if(r.size==0)return!1;if(n.kind==1){let e=n;if(r.has(e.name.identifier.text))return!0;let t=e.typeArguments;if(t!=null){for(let i=0,s=t.length;i<s;++i)if(k_(t[i],r))return!0}}return!1}var Ek="$lazyDone",Ak="$lazyTask",Tk="spawn",w_=class{constructor(r,e,t,i,s){this.name=r;this.doneName=e;this.awaitOperand=t;this.declaration=i;this.range=s;this.taskName=null;this.taskCall=null}},xu=class{afterParse(r){this.parser=r;let e=this.program.sources;for(let t=0,i=e.length;t<i;++t){let s=e[t];s.isLibrary||this.walkFunctions(s.statements)}}walkFunctions(r){for(let e=0,t=r.length;e<t;++e){let i=r[e];switch(i.kind){case 59:{this.rewriteBodyStatement(i.body);break}case 55:{let s=i.members;if(s!=null)for(let a=0,l=s.length;a<l;++a){let o=s[a];(o.kind==62||o.kind==59)&&this.rewriteBodyStatement(o.body)}break}case 63:{this.walkFunctions(i.members);break}case 40:{let s=i.declaration;s!=null&&this.walkFunctions([s]);break}default:break}}}rewriteBodyStatement(r){r==null||r.kind!=34||this.rewriteBody(r)}rewriteBody(r){if(r==null)return;let e=r.statements;r.statements=this.rewriteList(e,new Map),this.walkFunctions(r.statements),this.rewriteNestedFunctionExpressions(r.statements)}rewriteList(r,e){let t=new Array;for(let i=0,s=r.length;i<s;++i){let a=r[i];if(a.kind==42){let o=a,u=o.expression;if(F_(u)){this.parser.warning(6401,u.range);let c=bu(u);c!=null&&(o.expression=c)}}else if(a.kind==51){let o=a.declarations;for(let u=0,c=o.length;u<c;++u){let f=o[u].initializer;if(f!=null&&F_(f)){let _=bu(f);_!=null&&(o[u].initializer=_)}}}if(a.kind==51){let o=this.rewriteDeclaration(a,e);if(o!=null){for(let u=0,c=o.length;u<c;++u)t.push(o[u]);continue}}this.recurseInto(a,e);let l=this.collectOwnReads(a,e,new Array);for(let o=0,u=l.length;o<u;++o)t.push(this.makeGuard(assert(J(e,l[o])),a.range));t.push(a)}return t}rewriteDeclaration(r,e){let t=r.declarations,i=null,s=null;for(let o=0,u=t.length;o<u;++o){let c=t[o],f=c.initializer;if(f==null||f.kind!=32)continue;let _=f;if(_.expression.kind!=31)continue;if(t.length!=1)return this.parser.error(100,c.range,"a '@lazy await' binding in a multi-declarator statement"),this.degrade(c,_),null;let d=c.type;if(d==null)return this.parser.error(6399,c.name.range,c.name.text),this.degrade(c,_),null;let m=c.name.text;if(J(e,m)!=null)return this.parser.error(100,c.name.range,"a redeclared '@lazy await' binding in one block"),null;let h=m+Ek,b=_.expression.operand,A=null;if(F_(b)){if(bu(b)==null)return this.parser.error(100,b.range,"a 'spawn' whose argument is not a call or a function name"),this.degrade(c,_),null;A=m+Ak,b=y.createIdentifierExpression(A,b.range)}s=new w_(m,h,b,c,c.range),s.taskName=A,A!=null&&(s.taskCall=bu(_.expression.operand)),i=y.createVariableDeclaration(c.name,c.decorators,c.flags,d,null,c.range);break}if(s==null||i==null)return null;e.set(s.name,s);let a=new Array,l=s.taskName;if(l!=null){let o=y.createNamedType(y.createSimpleTypeName("Task",s.range),[assert(s.declaration.type)],!1,s.range);a.push(y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(l,s.range),null,16,o,s.taskCall,s.range)],s.range))}return a.push(y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(s.doneName,s.range),null,16,null,y.createFalseExpression(s.range),s.range)],s.range)),a.push(y.createVariableStatement(null,[i],r.range)),a}degrade(r,e){let t=e.expression;r.initializer=t.kind==31?t.operand:t}makeGuard(r,e){let t=y.createIdentifierExpression(r.doneName,e);return y.createIfStatement(y.createUnaryPrefixExpression(96,t,e),y.createBlockStatement([y.createExpressionStatement(y.createBinaryExpression(102,y.createIdentifierExpression(r.name,e),y.createAwaitExpression(r.awaitOperand,e),e)),y.createExpressionStatement(y.createBinaryExpression(102,y.createIdentifierExpression(r.doneName,e),y.createTrueExpression(e),e))],e),null,e)}recurseInto(r,e){switch(r.kind){case 34:{let t=r;t.statements=this.rewriteList(t.statements,e);break}case 45:{let t=r;t.ifTrue=this.rewriteSingleBody(t.ifTrue,e),t.ifFalse!=null&&(t.ifFalse=this.rewriteSingleBody(assert(t.ifFalse),e));break}case 53:{let t=r;t.body=this.rewriteSingleBody(t.body,e);break}case 37:{let t=r;t.body=this.rewriteSingleBody(t.body,e);break}case 43:{let t=r;t.body=this.rewriteSingleBody(t.body,e);break}case 44:{let t=r;t.body=this.rewriteSingleBody(t.body,e);break}case 48:{let i=r.cases;for(let s=0,a=i.length;s<a;++s){let l=i[s];l.statements=this.rewriteList(l.statements,e)}break}case 50:{let t=r;t.bodyStatements=this.rewriteList(t.bodyStatements,e);let i=t.catchStatements;i!=null&&(t.catchStatements=this.rewriteList(i,e));let s=t.finallyStatements;s!=null&&(t.finallyStatements=this.rewriteList(s,e));break}default:break}}rewriteSingleBody(r,e){if(r.kind==34)return this.recurseInto(r,e),r;let t=this.rewriteList([r],e);return t.length==1?t[0]:y.createBlockStatement(t,r.range)}collectOwnReads(r,e,t){switch(r.kind){case 42:{this.collectReads(r.expression,e,t);break}case 51:{let i=r.declarations;for(let s=0,a=i.length;s<a;++s){let l=i[s].initializer;l!=null&&this.collectReads(l,e,t)}break}case 47:{let i=r.value;i!=null&&this.collectReads(i,e,t);break}case 45:{this.collectReads(r.condition,e,t);break}case 53:{this.collectReads(r.condition,e,t);break}case 37:{this.collectReads(r.condition,e,t);break}case 43:{let i=r,s=i.initializer;s!=null&&s.kind!=51&&this.collectOwnReads(s,e,t);let a=i.condition;a!=null&&this.collectReads(a,e,t);let l=i.incrementor;l!=null&&this.collectReads(l,e,t);break}case 48:{this.collectReads(r.condition,e,t);break}case 49:{this.collectReads(r.value,e,t);break}case 52:{this.collectReads(r.expression,e,t);break}default:break}return t}collectReads(r,e,t){switch(r.kind){case 8:{let i=r.text;J(e,i)!=null&&!t.includes(i)&&t.push(i);break}case 11:{let i=r;this.collectReads(i.expression,e,t);let s=i.args;for(let a=0,l=s.length;a<l;++a)this.collectReads(s[a],e,t);break}case 10:{let i=r;this.collectReads(i.left,e,t),this.collectReads(i.right,e,t);break}case 30:{this.collectReads(r.operand,e,t);break}case 29:{this.collectReads(r.operand,e,t);break}case 13:{let s=r.expressions;for(let a=0,l=s.length;a<l;++a)this.collectReads(s[a],e,t);break}case 24:{let i=r;this.collectReads(i.condition,e,t),this.collectReads(i.ifThen,e,t),this.collectReads(i.ifElse,e,t);break}case 23:{this.collectReads(r.expression,e,t);break}case 14:{let i=r;this.collectReads(i.expression,e,t),this.collectReads(i.elementExpression,e,t);break}case 9:{this.collectReads(r.expression,e,t);break}case 22:{this.collectReads(r.expression,e,t);break}case 31:{this.collectReads(r.operand,e,t);break}case 32:{this.collectReads(r.expression,e,t);break}case 19:{let s=r.args;if(s!=null)for(let a=0,l=s.length;a<l;++a)this.collectReads(s[a],e,t);break}case 17:{this.collectReads(r.expression,e,t);break}case 16:{let i=new Array;this.collectReadsInFunctionBody(r,e,i);for(let s=0,a=i.length;s<a;++s)this.parser.error(6400,r.range,i[s]);break}default:break}}collectReadsInFunctionBody(r,e,t){let i=r.declaration.body;if(i==null||i.kind!=34)return;let s=i.statements;for(let a=0,l=s.length;a<l;++a)this.collectOwnReads(s[a],e,t),this.recurseCollect(s[a],e,t)}recurseCollect(r,e,t){switch(r.kind){case 34:{let i=r.statements;for(let s=0,a=i.length;s<a;++s)this.collectOwnReads(i[s],e,t),this.recurseCollect(i[s],e,t);break}case 45:{let i=r;this.recurseCollect(i.ifTrue,e,t),i.ifFalse!=null&&this.recurseCollect(assert(i.ifFalse),e,t);break}case 53:{this.recurseCollect(r.body,e,t);break}case 37:{this.recurseCollect(r.body,e,t);break}case 43:{this.recurseCollect(r.body,e,t);break}case 44:{this.recurseCollect(r.body,e,t);break}case 48:{let i=r.cases;for(let s=0,a=i.length;s<a;++s){let l=i[s].statements;for(let o=0,u=l.length;o<u;++o)this.recurseCollect(l[o],e,t)}break}default:break}}rewriteNestedFunctionExpressions(r){for(let e=0,t=r.length;e<t;++e){let i=r[e];if(i.kind==51){let s=i.declarations;for(let a=0,l=s.length;a<l;++a){let o=s[a].initializer;if(o!=null&&o.kind==16){let u=o.declaration.body;u!=null&&u.kind==34&&this.rewriteBody(u)}}}}}};function F_(n){if(n.kind!=11)return!1;let r=n.expression;return r.kind==8&&r.text==Tk}function bu(n){let r=n.args;if(r.length!=1)return null;let e=r[0];return e.kind==11?e:e.kind==8?y.createCallExpression(e,null,[],n.range):null}var xa="async arrow functions (async lowering)",Ea="async function expressions (async lowering)",Lx="an async function nested in a non-async body (async lowering)",Sk="an async export default function (async lowering)";function Mx(n,r,e){Tn(n.statements,r,e)}function Tn(n,r,e){for(let t=0,i=n.length;t<i;++t)pt(n[t],r,e)}function pt(n,r,e){switch(n.kind){case 59:case 62:{zx(n,r,e);return}case 55:{Dx(n,r,e);return}case 63:{Tn(n.members,r,e);return}case 34:{Tn(n.statements,r,e);return}case 37:{let t=n;pt(t.body,r,e),se(t.condition,r,e);return}case 42:{let t=n.expression;if(t.kind==16){let i=t.declaration;if(i.isAsync&&i.arrowKind==0){Eu(r,t,Lx,e);return}}se(t,r,e);return}case 43:{let t=n,i=t.initializer;i!=null&&pt(i,r,e);let s=t.condition;s!=null&&se(s,r,e);let a=t.incrementor;a!=null&&se(a,r,e),pt(t.body,r,e);return}case 44:{let t=n;pt(t.variable,r,e),se(t.iterable,r,e),pt(t.body,r,e);return}case 45:{let t=n;se(t.condition,r,e),pt(t.ifTrue,r,e);let i=t.ifFalse;i!=null&&pt(i,r,e);return}case 47:{let t=n.value;t!=null&&se(t,r,e);return}case 48:{let t=n;se(t.condition,r,e);let i=t.cases;for(let s=0,a=i.length;s<a;++s){let l=i[s].label;l!=null&&se(l,r,e),Tn(i[s].statements,r,e)}return}case 49:{se(n.value,r,e);return}case 50:{let t=n;Tn(t.bodyStatements,r,e);let i=t.catchStatements;i!=null&&Tn(i,r,e);let s=t.finallyStatements;s!=null&&Tn(s,r,e);return}case 51:{let t=n.declarations;for(let i=0,s=t.length;i<s;++i){let a=t[i];Ai(a.decorators,r,e);let l=a.initializer;l!=null&&se(l,r,e)}return}case 52:{se(n.expression,r,e);return}case 53:{let t=n;se(t.condition,r,e),pt(t.body,r,e);return}case 56:{let t=n.values;for(let i=0,s=t.length;i<s;++i)pt(t[i],r,e);return}case 57:{let t=n.initializer;t!=null&&se(t,r,e);return}case 58:{let t=n;Ai(t.decorators,r,e);let i=t.initializer;i!=null&&se(i,r,e);return}case 40:{let t=n.declaration;if(t.kind==59&&t.isAsync){Eu(r,t,Sk,e);return}pt(t,r,e);return}default:return}}function zx(n,r,e){if(n.isAsync){Eu(r,n,Lx,e);return}Ai(n.decorators,r,e);let t=n.signature.parameters;for(let s=0,a=t.length;s<a;++s){let l=t[s].initializer;l!=null&&se(l,r,e)}let i=n.body;i!=null&&pt(i,r,e)}function Dx(n,r,e){Ai(n.decorators,r,e);let t=n.members;for(let i=0,s=t.length;i<s;++i){let a=t[i];switch(a.kind){case 59:case 62:{zx(a,r,e);break}case 58:{let l=a;Ai(l.decorators,r,e);let o=l.initializer;o!=null&&se(o,r,e);break}default:break}}}function Ai(n,r,e){if(n!=null)for(let t=0,i=n.length;t<i;++t){let s=n[t];se(s.name,r,e);let a=s.args;if(a!=null)for(let l=0,o=a.length;l<o;++l)se(a[l],r,e)}}function se(n,r,e){switch(n.kind){case 16:{let t=n,i=t.declaration;if(i.isAsync){Eu(r,t,i.arrowKind!=0?xa:Ea,e);return}Ai(i.decorators,r,e);let s=i.signature.parameters;for(let l=0,o=s.length;l<o;++l){let u=s[l].initializer;u!=null&&se(u,r,e)}let a=i.body;a!=null&&pt(a,r,e);return}case 12:{Dx(n.declaration,r,e);return}case 9:{se(n.expression,r,e);return}case 31:{se(n.operand,r,e);return}case 10:{let t=n;se(t.left,r,e),se(t.right,r,e);return}case 11:{let t=n;se(t.expression,r,e);let i=t.args;for(let s=0,a=i.length;s<a;++s)se(i[s],r,e);return}case 13:{let t=n.expressions;for(let i=0,s=t.length;i<s;++i)se(t[i],r,e);return}case 14:{let t=n;se(t.expression,r,e),se(t.elementExpression,r,e);return}case 17:{se(n.expression,r,e);return}case 19:{let t=n.args;for(let i=0,s=t.length;i<s;++i)se(t[i],r,e);return}case 22:{se(n.expression,r,e);return}case 23:{se(n.expression,r,e);return}case 24:{let t=n;se(t.condition,r,e),se(t.ifThen,r,e),se(t.ifElse,r,e);return}case 29:{se(n.operand,r,e);return}case 30:{se(n.operand,r,e);return}case 18:{let t=n;switch(t.literalKind){case 3:{let i=t.expressions;for(let s=0,a=i.length;s<a;++s)se(i[s],r,e);return}case 5:{let i=t.elementExpressions;for(let s=0,a=i.length;s<a;++s)se(i[s],r,e);return}case 6:{let i=t.values;for(let s=0,a=i.length;s<a;++s)se(i[s],r,e);return}default:return}}default:return}}function Eu(n,r,e,t){t!=null&&t.has(r.range.start)||n.error(100,r.range,e)}var vk="$State",Ik="$resume",Gx="TaskState",Ux="TaskEnv",kk="__taskPark",Fk="__taskSettled",wk="__taskRegister",Rk="__asyncZero",jx="__taskComplete",Ck="__taskCompleteResult",Vx="_record",Qx="$awaited",Pk="__taskRegistered",wu="resumePoint",vu="handle",Nk="resume",In="$env",Si="$closureEnv",Au="$closureEnvIn",Fa="$this",R_="$parent",Ox="$cond",wa=class{constructor(){this.refusals=null;this.currentConstruct=null}afterParse(r){let e=this.program.sources;for(let t=0,i=e.length;t<i;++t){let s=e[t];if(this.program.stdSources.has(s))continue;this.lowerStatementList(s,s.statements,r);let a=this.refusals,l=a!=null?J(a,s):null;Mx(s,r,l??null)}}lowerStatementList(r,e,t){if(!zk(e))return;let i=new Array;for(let a=0,l=e.length;a<l;++a){let o=Dk(e[a]);o!=null&&i.push(o)}let s=new Array;for(let a=0,l=e.length;a<l;++a){let o=e[a];switch(o.kind){case 59:{let u=o;if(u.isAsync){let c=new Array,f=this.lowerAsyncFunction(r,u,i,t,c);if(f){for(let _=0,d=f.length;_<d;++_)s.push(f[_]);for(let _=0,d=c.length;_<d;++_)s.push(c[_])}else s.push(o)}else s.push(o);break}case 63:{let u=o;this.lowerStatementList(r,u.members,t),s.push(o);break}case 55:{let u=o,c=this.lowerAsyncMethods(r,u,i,t);for(let f=0,_=c.length;f<_;++f)s.push(c[f]);s.push(o);break}case 51:{let u=o.declarations;for(let c=0,f=u.length;c<f;++c){let _=u[c].initializer;_&&this.refuseAsyncFunctionExpression(_,t)}s.push(o);break}default:{s.push(o);break}}}e.length=0;for(let a=0,l=s.length;a<l;++a)e.push(s[a])}lowerAsyncFunction(r,e,t,i,s,a=null,l=null){let o=this.currentConstruct;this.currentConstruct=e;let u=this.lowerAsyncFunctionInner(r,e,t,i,s,a,l);return this.currentConstruct=o,u==null&&this.recordRefusal(e),u}lowerAsyncFunctionInner(r,e,t,i,s,a,l){let o=e.signature,u=e.name.text,c=e.range;if(e.arrowKind!=0)return this.refuse(i,e.range,xa),null;if(e.typeParameters!=null)return this.refuse(i,e.range,"async generic functions (async lowering)"),null;a==null&&o.explicitThisType!=null&&(a=o.explicitThisType);let f=null;l!=null&&(f=J(On(),l));let _=f??null,d=_!=null&&_.kind==2?_.envClass:null,m=J(sl,e),h=m??null,b=h!=null&&h.ownEnv?h.envClass:null,A=b!=null&&h!=null&&assert(h).hasThis,S=h!=null?h.parentClass:null,k=b!=null&&A,w=!k&&a!=null,R=!k&&!w&&d!=null,C=o.parameters;for(let Z=0,le=C.length;Z<le;++Z){let te=C[Z];if(te.parameterKind!=0)return this.refuse(i,te.range,"optional or rest parameters in an async function (async lowering)"),null;if(Kx(te.name.text))return this.refuse(i,te.name.range,"a parameter whose name is reserved by the state struct (async lowering)"),null}let M=o.returnType;if(M==null||jk(M))return this.refuse(i,e.name.range,"an async function without a declared return type (async lowering)"),null;let O=e.body;if(!O||O.kind!=34)return this.refuse(i,e.range,"an async function without a block body (async lowering)"),null;let D=O,Q=w?u+"$ThisEnv":"",H=null;if(w){let Z=assert(a),le=y.createFieldDeclaration(y.createIdentifierExpression(Fa,c),null,262144,Z,y.createCallExpression(y.createIdentifierExpression("changetype",c),[Z],[St(0,c)],c),c),te="source",wi=new Array;wi.push(y.createParameter(0,y.createIdentifierExpression(te,c),Z,null,c));let wn=new Array;wn.push(le);let Rn=new Array;if(Rn.push(y.createExpressionStatement(y.createCallExpression(y.createSuperExpression(c),null,[],c))),Rn.push(y.createExpressionStatement(y.createBinaryExpression(102,y.createPropertyAccessExpression(y.createThisExpression(c),y.createIdentifierExpression(Fa,c),c),y.createIdentifierExpression(te,c),c))),d!=null){let Ca="parent";wi.push(y.createParameter(0,y.createIdentifierExpression(Ca,c),ve(d,c),null,c)),wn.push(y.createFieldDeclaration(y.createIdentifierExpression(R_,c),null,262144,y.createNamedType(y.createSimpleTypeName(d,c),null,!0,c),y.createNullExpression(c),c)),Rn.push(y.createExpressionStatement(y.createBinaryExpression(102,y.createPropertyAccessExpression(y.createThisExpression(c),y.createIdentifierExpression(R_,c),c),y.createIdentifierExpression(Ca,c),c)))}let Lu=y.createMethodDeclaration(y.createConstructorExpression(c),null,786432,null,y.createFunctionType(wi,ve("void",c),null,!1,c),y.createBlockStatement(Rn,c),c);wn.push(Lu),H=y.createClassDeclaration(y.createIdentifierExpression(Q,c),null,0,null,ve(Ux,c),null,wn,c)}if(k&&qk(D),k||w){let Z=k?assert(b):Q;z_(D.statements,Z,Ok(D,C))}let U=new V_;Sn(D,U.declaredTypes);let V=new Ru,Y=this.planSeq(i,D.statements,V,!1,r,s,t,U);if(!Y)return null;let q=V.next-1;if(q!=0&&this.liftCreationEnvs(D,U),this.collectLifting(i,Y,U),q!=0){let Z=new Set;va(Y,Z);for(let le=0,te=C.length;le<te;++le)Z.has(C[le].name.text)&&U.liftParameter(C[le].name.text,C[le].name.range)}let ne=u+vk,j=u+Ik;for(let Z=0,le=t.length;Z<le;++Z){let te=t[Z];if(te==ne||te==j)return this.refuse(i,e.name.range,"an async function whose synthesized name is taken (async lowering)"),null}let ge=new Set;zr(D,ge);let oe=M_(C,D),_e=y.createIdentifierExpression(oe,c),It=y.createThisExpression(c),Fe=new Array;for(let Z=0,le=C.length;Z<le;++Z){let te=C[Z];Fe.push(y.createFieldDeclaration(y.createIdentifierExpression(te.name.text,te.name.range),null,262144,te.type,null,te.name.range))}Fe.push(y.createFieldDeclaration(y.createIdentifierExpression(In,c),null,262144,y.createNamedType(y.createSimpleTypeName(Ux,c),null,!0,c),y.createNullExpression(c),c));for(let Z=0,le=U.locals.length;Z<le;++Z){let te=U.locals[Z];Fe.push(y.createFieldDeclaration(y.createIdentifierExpression(te.name,te.declaration.name.range),null,262144,te.type,null,te.declaration.name.range))}Fe.push(y.createFieldDeclaration(y.createIdentifierExpression(wu,c),null,262144,ve("i32",c),null,c));let vi=!Qk(M),qt=new Array;Sa(Y,qt);for(let Z=0,le=qt.length;Z<le;++Z)Fe.push(y.createFieldDeclaration(y.createIdentifierExpression(qt[Z],c),null,278528,ve("TaskRecord",c),null,c));let Dr=Xk(M,c);Fe.push(y.createFieldDeclaration(y.createIdentifierExpression(vu,c),null,278528,Dr,null,c));let kn=new Array,je=new Array;je.push(y.createExpressionStatement(y.createCallExpression(y.createSuperExpression(c),null,[],c)));for(let Z=0,le=C.length;Z<le;++Z){let te=C[Z];kn.push(y.createParameter(0,y.createIdentifierExpression(te.name.text,te.name.range),te.type,null,te.range)),je.push(y.createExpressionStatement(Lr(It,te.name.text,y.createIdentifierExpression(te.name.text,te.range),te.range)))}je.push(y.createExpressionStatement(Lr(It,wu,St(0,c),c)));for(let Z=0,le=U.locals.length;Z<le;++Z){let te=U.locals[Z];je.push(y.createExpressionStatement(Lr(It,te.name,y.createCallExpression(y.createIdentifierExpression(Rk,te.declaration.name.range),[te.type],[],te.declaration.name.range),te.declaration.name.range)))}Fe.push(y.createMethodDeclaration(y.createConstructorExpression(c),null,786432,null,y.createFunctionType(kn,ve("void",c),null,!1,c),y.createBlockStatement(je,c),c));let Fn=y.createClassDeclaration(y.createIdentifierExpression(ne,e.name.range),null,0,null,ve(Gx,c),null,Fe,c),dt=y.createIdentifierExpression(j,c),fr=new Array;for(let Z=0,le=C.length;Z<le;++Z)fr.push(y.createIdentifierExpression(C[Z].name.text,C[Z].range));let Ii=y.createPropertyAccessExpression(_e,y.createIdentifierExpression(vu,c),c),Oe=new Array;if(Oe.push(y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(oe,c),null,8,ve(ne,c),y.createNewExpression(y.createSimpleTypeName(ne,c),null,fr,c),c)],c)),k){let Z=assert(b),le=new Array;S!=null&&(le.push(y.createNullExpression(c)),le.push(y.createIdentifierExpression(Au,c))),Oe.push(y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(Si,c),null,16,ve(Z,c),y.createNewExpression(y.createSimpleTypeName(Z,c),null,le,c),c)],c)),A&&Oe.push(y.createExpressionStatement(Lr(y.createIdentifierExpression(Si,c),Fa,y.createThisExpression(c),c))),Oe.push(y.createExpressionStatement(Lr(_e,In,y.createIdentifierExpression(Si,c),c)))}else if(w){let Z=new Array;Z.push(y.createThisExpression(c)),d!=null&&Z.push(y.createIdentifierExpression(Au,c)),Oe.push(y.createExpressionStatement(Lr(_e,In,y.createNewExpression(y.createSimpleTypeName(Q,c),null,Z,c),c)))}else R&&Oe.push(y.createExpressionStatement(Lr(_e,In,y.createIdentifierExpression(Au,c),c)));Oe.push(y.createExpressionStatement(Lr(_e,vu,y.createNewExpression(y.createSimpleTypeName("Task",c),[M],[],c),c))),Oe.push(y.createExpressionStatement(y.createBinaryExpression(102,y.createPropertyAccessExpression(Ii,y.createIdentifierExpression(Vx,c),c),y.createCallExpression(y.createIdentifierExpression(wk,c),null,[_e],c),c))),Oe.push(y.createIfStatement(y.createUnaryPrefixExpression(96,y.createCallExpression(y.createIdentifierExpression(Pk,c),null,[_e],c),c),y.createBlockStatement([y.createReturnStatement(Ii,c)],c),null,c)),Oe.push(y.createExpressionStatement(y.createBinaryExpression(102,y.createPropertyAccessExpression(_e,y.createIdentifierExpression(Nk,c),c),y.createCallExpression(y.createIdentifierExpression("changetype",c),[y.createFunctionType([y.createParameter(0,y.createIdentifierExpression("state",c),ve(Gx,c),null,c)],ve("void",c),null,!1,c)],[dt],c),c))),Oe.push(y.createExpressionStatement(y.createCallExpression(dt,null,[_e],c))),Oe.push(y.createReturnStatement(Ii,c)),e.body=y.createBlockStatement(Oe,c),e.signature.returnType=Dr,e.isAsync=!1;let ht=M_(C,D),ki=new Array;Ia(Y,ki);for(let Z=0,le=ki.length;Z<le;++Z){let te=ki[Z];lu().set(te.node,new au(te.discriminator,Kk(ht,te.fieldName,te.node.range)))}let Wt=new Array,Fi=y.createPropertyAccessExpression(y.createIdentifierExpression(ht,c),y.createIdentifierExpression(In,c),c),Cu=k?assert(b):Q,Pu=y.createCallExpression(y.createIdentifierExpression("changetype",c),[ve(Cu,c)],[Fi],c),Nu=R?Fi:y.createAssertionExpression(2,y.createPropertyAccessExpression(Pu,y.createIdentifierExpression(R_,c),c),null,c);if(d!=null){let Z=ve(d,c);Wt.push(y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(Au,c),null,8,Z,y.createCallExpression(y.createIdentifierExpression("changetype",c),[Z],[Nu],c),c)],c))}if(k){let Z=assert(b);Wt.push(y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(Si,c),null,8,ve(Z,c),y.createCallExpression(y.createIdentifierExpression("changetype",c),[ve(Z,c)],[Fi],c),c)],c))}for(let Z=0,le=C.length;Z<le;++Z){let te=C[Z];Wt.push(Wx(te.name.text,te.name.range,ht))}for(let Z=0,le=U.locals.length;Z<le;++Z){let te=U.locals[Z];Wt.push(Wx(te.name,te.declaration.name.range,ht))}let Bu=new L_(U,ht,q+1,vi,ge,M,q!=0);if(Ti(Wt,this.emitSeq(Y,Bu)),!Mk(Y)){let Z=new Array;Z.push(y.createExpressionStatement(Fu(ht,St(q+1,c),c))),Z.push(y.createExpressionStatement(y.createCallExpression(y.createIdentifierExpression(jx,c),null,[y.createIdentifierExpression(ht,c)],c))),Wt.push(y.createIfStatement(cr(He(ht,c),c),y.createBlockStatement(Z,c),null,c))}let Ra=y.createFunctionDeclaration(y.createIdentifierExpression(j,e.name.range),null,0,null,y.createFunctionType([y.createParameter(0,y.createIdentifierExpression(ht,c),ve(ne,c),null,c)],ve("void",c),null,!1,c),y.createBlockStatement(Wt,c),0,c);return H!=null?[H,Fn,e,Ra]:[Fn,e,Ra]}liftCreationEnvs(r,e){let t=new Set;Mr(r.statements,t),t.size!=0&&Iu(r.statements,t,e)}planSeq(r,e,t,i,s,a,l,o){let u=new N_;for(let c=0,f=e.length;c<f;++c){let _=this.planStatement(r,e[c],t,i,s,a,l,o);if(!_)return null;u.add(_)}return u}planStatement(r,e,t,i,s,a,l,o){let u=new P_(e);switch(e.kind){case 38:return u;case 42:{let c=e.expression;if(c.kind==16){let f=c.declaration;if(f.isAsync){let _=this.lowerAsyncFunction(s,f,l,r,a,null,c);if(!_)return null;for(let d=0,m=_.length;d<m;++d)_[d]!==e&&a.push(_[d])}return u.kind=0,u.nestedFunction=!0,u}return this.planLeaf(r,u,t,o)}case 51:case 47:return this.planLeaf(r,u,t,o);case 34:{let c=e,f=this.planSeq(r,c.statements,t,i,s,a,l,o);return f?(u.kind=1,u.statements=f,u.lo=f.lo,u.hi=f.hi,f.lo!=0&&this.liftDeclaredIn(r,f,o),u.all=Ta(f),u):null}case 45:{let c=e;if(!this.walkExpression(r,c.condition,u.all,null,!1))return null;let f=this.planBranch(r,c.ifTrue,t,i,s,a,l,o);if(!f)return null;let _=null;return c.ifFalse!=null&&(_=this.planBranch(r,assert(c.ifFalse),t,i,s,a,l,o),!_)?null:(u.kind=2,u.cond=c.condition,u.thenSeq=f,u.elseSeq=_,u.lo=Bk(f,_),u.hi=Lk(f,_),u.lo!=0&&(this.liftDeclaredIn(r,f,o),_!=null&&this.liftDeclaredIn(r,assert(_),o)),u.all=Aa(u.all,Aa(Ta(f),_?Ta(_):new vt)),u)}case 53:{let c=e;if(!this.walkExpression(r,c.condition,u.all,null,!1))return null;let f=this.planBranch(r,c.body,t,i,s,a,l,o);return f?(u.kind=3,u.cond=c.condition,u.body=f,u.lo=f.lo,u.hi=f.hi,f.lo!=0&&this.liftDeclaredIn(r,f,o),u.all=Aa(u.all,Ta(f)),u):null}case 43:{let c=e,f=this.planBranch(r,c.body,t,i,s,a,l,o);if(!f)return null;f.lo!=0&&this.liftDeclaredIn(r,f,o);let _=c.initializer;if(f.lo!=0&&_!=null&&_.kind==51){let h=_.declarations;for(let b=0,A=h.length;b<A;++b)if(!this.liftDeclarator(r,h[b],o))return null}if(_!=null){let h=this.planStatement(r,_,new Ru,!1,s,a,l,o);if(!h)return null;if(h.info!=null)return this.refuse(r,_.range,"await in a for initializer (async lowering)"),null;if(h.lo!=0)return null}let d=c.condition;if(d!=null&&!this.walkExpression(r,d,u.all,null,!1))return null;let m=c.incrementor;return m!=null&&!this.walkExpression(r,m,u.all,null,!1)?null:(u.kind=4,u.init=_,u.cond=c.condition,u.incr=c.incrementor,u.body=f,u.lo=f.lo,u.hi=f.hi,u.all=Aa(u.all,Ta(f)),u)}case 35:case 36:return u.kind=0,u;case 59:{let c=e;if(c.isAsync){let f=this.lowerAsyncFunction(s,c,l,r,a);if(!f)return null;for(let _=0,d=f.length;_<d;++_)f[_]!==e&&a.push(f[_])}return u.kind=0,u}default:return this.refuse(r,e.range,C_(e)),null}}planBranch(r,e,t,i,s,a,l,o){let u;return e.kind==34?u=e.statements:u=[e],this.planSeq(r,u,t,i,s,a,l,o)}planLeaf(r,e,t,i){let s=e.node;if(s.kind==42){let l=s.expression;if(l.kind==31)return this.planAwait(r,e,l,t,i);if(l.kind==10){let o=l;if(o.operator==102&&o.right.kind==31)return this.planAwait(r,e,o.right,t,i,o.left)}}if(s.kind==51){let l=s.declarations;if(l.length==1){let o=l[0],u=o.initializer;if(u!=null&&u.kind==31)return this.liftDeclarator(r,o,i)?this.planAwait(r,e,u,t,i):null}}if(s.kind==47){let l=s.value;if(l!=null&&l.kind==31)return this.planAwait(r,e,l,t,i)}let a=new Array;switch(s.kind){case 42:{if(!this.walkExpression(r,s.expression,e.all,a,!1))return null;break}case 51:{let l=s.declarations;for(let o=0,u=l.length;o<u;++o){let c=l[o];e.declarations.push(c);let f=c.initializer;if(f&&!this.walkExpression(r,f,e.all,a,!1))return null}break}case 47:{let l=s.value;if(l&&!this.walkExpression(r,l,e.all,a,!1))return null;break}}if(a.length){let l=a.length>1?"more than one await in one statement (async lowering)":"await in an unsupported position (async lowering)";return this.refuse(r,a[0].range,l),null}return e}planAwait(r,e,t,i,s,a=null){let l=i.next++,o=t.operand,u=new vt;if(!this.walkExpression(r,o,u,null,!1))return null;let c=new vt;return a!=null&&!this.walkExpression(r,a,c,null,!0)?null:(e.kind=0,e.info=new B_(t,o,l,Qx+l.toString(),l),e.lo=l,e.hi=l,e.before=u,e.after=c,e.all=Aa(u,c),e)}liftDeclarator(r,e,t){let i=e.name.text;if(t.hasLocal(i))return!0;if(Kx(i))return this.refuse(r,e.name.range,"a local whose name is reserved by the state struct (async lowering)"),!1;let s=e.type;if(s==null){let a=ct(e.initializer,t.knownTypes(),0);if(a!=null)e.type=a,s=a;else return this.refuse(r,e.name.range,"a local without a declared type that crosses an await (async lowering)"),!1}return t.liftLocal(i,s,e),!0}liftDeclaredIn(r,e,t){let i=e.plans;for(let s=0,a=i.length;s<a;++s){let l=i[s],o=l.declarations;for(let u=0,c=o.length;u<c;++u)if(!this.liftDeclarator(r,o[u],t))return!1;if(l.kind==1&&l.lo!=0){if(!this.liftDeclaredIn(r,assert(l.statements),t))return!1}else if(l.kind==2&&l.lo!=0){if(!this.liftDeclaredIn(r,assert(l.thenSeq),t)||l.elseSeq!=null&&!this.liftDeclaredIn(r,assert(l.elseSeq),t))return!1}else if((l.kind==3||l.kind==4)&&l.lo!=0&&!this.liftDeclaredIn(r,assert(l.body),t))return!1}return!0}collectLifting(r,e,t){let i=new Array,s=e.plans;for(let a=0,l=s.length;a<l;++a){let o=s[a];if(o.lo!=0){let c=new vt;et(c.reads,o.after.reads),et(c.writes,o.after.writes),et(c.reads,o.all.reads),et(c.writes,o.all.writes);for(let f=a+1,_=s.length;f<_;++f)et(c.reads,s[f].all.reads),et(c.writes,s[f].all.writes);for(let f=0,_=i.length;f<_;++f){let d=i[f],m=d.name.text;if((c.reads.has(m)||c.writes.has(m))&&!this.liftDeclarator(r,d,t))return}}let u=o.declarations;for(let c=0,f=u.length;c<f;++c){let _=u[c];t.hasLocal(_.name.text)||i.push(_)}switch(o.kind){case 1:{this.collectLifting(r,assert(o.statements),t);break}case 2:{this.collectLifting(r,assert(o.thenSeq),t),o.elseSeq!=null&&this.collectLifting(r,assert(o.elseSeq),t);break}case 3:case 4:{this.collectLifting(r,assert(o.body),t);break}}}}emitSeq(r,e){let t=new Array,i=r.plans,s=new Array;for(let a=0,l=i.length;a<l;++a){let o=i[a];if(e.guarded&&o.kind==0&&o.lo==0&&o.info==null&&!o.nestedFunction&&o.node.kind!=59){Ti(s,ka(o.node,e));continue}this.flushRun(s,t,e),Ti(t,this.emitPlan(o,e))}return this.flushRun(s,t,e),t}flushRun(r,e,t){r.length!=0&&(e.push(y.createIfStatement(cr(He(t.stateName,r[0].range),r[0].range),y.createBlockStatement(r.slice(0),r[0].range),null,r[0].range)),r.length=0)}emitPlan(r,e){let t=new Array,i=r.node,s=i.range;switch(r.kind){case 0:{if(r.nestedFunction||i.kind==59)return t.push(i),t;if(r.info!=null){let a=assert(r.info),l=new Array;l.push(y.createExpressionStatement(y.createBinaryExpression(102,ku(e.stateName,a.fieldName,s),y.createPropertyAccessExpression(a.operand,y.createIdentifierExpression(Vx,s),s),s))),l.push(y.createExpressionStatement(Fu(e.stateName,St(a.discriminator,s),s)));let o=new Array;Ti(o,Uk(e.lifting,e.stateName,s)),o.push(y.createExpressionStatement(y.createCallExpression(y.createIdentifierExpression(kk,s),null,[y.createIdentifierExpression(e.stateName,s),ku(e.stateName,a.fieldName,s)],s))),o.push(y.createReturnStatement(null,s)),l.push(y.createIfStatement(y.createUnaryPrefixExpression(96,y.createCallExpression(y.createIdentifierExpression(Fk,s),null,[ku(e.stateName,a.fieldName,s)],s),s),y.createBlockStatement(o,s),null,s)),t.push(y.createIfStatement(cr(He(e.stateName,s),s),y.createBlockStatement(l,s),null,s));let u=new Array;return u.push(y.createExpressionStatement(Fu(e.stateName,St(0,s),s))),Ti(u,ka(i,e)),t.push(y.createIfStatement(Hk(He(e.stateName,s),St(a.discriminator,s),s),y.createBlockStatement(u,s),null,s)),t}if(r.lo==0){let a=ka(i,e);e.guarded?t.push(y.createIfStatement(cr(He(e.stateName,s),s),y.createBlockStatement(a,s),null,s)):Ti(t,a)}return t}case 1:{let a=this.emitSeq(assert(r.statements),e);return r.lo==0?Tu(pr(i,e),e,s):(t.push(y.createIfStatement(Su(e.stateName,r.lo,r.hi,s),y.createBlockStatement(a,s),null,s)),t)}case 2:{if(r.lo==0)return Tu(pr(i,e),e,s);let a=this.emitSeq(assert(r.thenSeq),e),l=r.elseSeq!=null?this.emitSeq(assert(r.elseSeq),e):new Array,o=e.freshTemp(s),u=new Array;return u.push(y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(o,s),null,16,ve("bool",s),y.createFalseExpression(s),s)],s)),u.push(y.createIfStatement(cr(He(e.stateName,s),s),y.createBlockStatement([y.createExpressionStatement(D_(o,assert(r.cond),s))],s),y.createBlockStatement([y.createExpressionStatement(D_(o,Xx(e.stateName,r.thenSeq!=null?assert(r.thenSeq).lo:0,r.thenSeq!=null?assert(r.thenSeq).hi:0,s),s))],s),s)),u.push(y.createIfStatement(y.createIdentifierExpression(o,s),y.createBlockStatement(a,s),l.length?y.createBlockStatement(l,s):null,s)),t.push(y.createIfStatement(Su(e.stateName,r.lo,r.hi,s),y.createBlockStatement(u,s),null,s)),t}case 3:{if(r.lo==0)return Tu(pr(i,e),e,s);let a=this.emitSeq(assert(r.body),e),l=r.cond,o=y.createBinaryExpression(99,Hx(He(e.stateName,s),s),l??y.createTrueExpression(s),s);return t.push(y.createIfStatement(Su(e.stateName,r.lo,r.hi,s),y.createBlockStatement([y.createWhileStatement(o,y.createBlockStatement(a,s),s)],s),null,s)),t}case 4:{if(r.lo==0)return Tu(pr(i,e),e,s);let a=this.emitSeq(assert(r.body),e),l=new Array;r.init!=null&&l.push(y.createIfStatement(cr(He(e.stateName,s),s),y.createBlockStatement(ka(assert(r.init),e),s),null,s));let o=r.cond;return l.push(y.createForStatement(null,y.createBinaryExpression(99,Hx(He(e.stateName,s),s),o??y.createTrueExpression(s),s),r.incr!=null?assert(r.incr):null,y.createBlockStatement(a,s),s)),t.push(y.createIfStatement(Su(e.stateName,r.lo,r.hi,s),y.createBlockStatement(l,s),null,s)),t}}return t}walkExpression(r,e,t,i,s){switch(e.kind){case 8:{if(t){let a=e.text;s?t.writes.add(a):t.reads.add(a)}return!0}case 27:case 15:case 20:return!0;case 16:{let a=e.declaration;return a.isAsync?(this.refuse(r,e.range,a.arrowKind!=0?xa:Ea),!1):!0}case 26:return this.refuse(r,e.range,"this in an async function body (async lowering)"),!1;case 25:return this.refuse(r,e.range,"super in an async function body (async lowering)"),!1;case 31:{let a=e;return i?(i.push(a),!0):(this.refuse(r,a.range,"await in an unsupported position (async lowering)"),!1)}case 18:{let a=e;switch(a.literalKind){case 0:case 1:case 2:case 4:return!0;case 3:{let l=a.expressions;for(let o=0,u=l.length;o<u;++o)if(!this.walkExpression(r,l[o],t,i,!1))return!1;return!0}case 5:{let l=a.elementExpressions;for(let o=0,u=l.length;o<u;++o)if(!this.walkExpression(r,l[o],t,i,!1))return!1;return!0}case 6:{let l=a.values;for(let o=0,u=l.length;o<u;++o)if(!this.walkExpression(r,l[o],t,i,!1))return!1;return!0}default:return this.refuse(r,e.range,C_(e)),!1}}case 9:{let a=e;return this.walkExpression(r,a.expression,t,i,s)?a.toType!=null?(this.refuse(r,a.range,"a type argument in an async body (async lowering)"),!1):!0:!1}case 10:{let a=e,l=$k(a.operator);return this.walkExpression(r,a.left,t,i,l?!0:s)?this.walkExpression(r,a.right,t,i,!1):!1}case 11:{let a=e;if(!this.walkExpression(r,a.expression,t,i,!1))return!1;let l=a.args;for(let o=0,u=l.length;o<u;++o)if(!this.walkExpression(r,l[o],t,i,!1))return!1;return!0}case 13:{let a=e.expressions;for(let l=0,o=a.length;l<o;++l)if(!this.walkExpression(r,a[l],t,i,l==o-1?s:!1))return!1;return!0}case 14:{let a=e;return this.walkExpression(r,a.expression,t,i,!1)?this.walkExpression(r,a.elementExpression,t,i,!1):!1}case 17:return this.walkExpression(r,e.expression,t,i,!1);case 19:{let a=e.args;for(let l=0,o=a.length;l<o;++l)if(!this.walkExpression(r,a[l],t,i,!1))return!1;return!0}case 22:return this.walkExpression(r,e.expression,t,i,s);case 23:return this.walkExpression(r,e.expression,t,i,!1);case 24:{let a=e;return!this.walkExpression(r,a.condition,t,i,!1)||!this.walkExpression(r,a.ifThen,t,i,s)?!1:this.walkExpression(r,a.ifElse,t,i,s)}case 29:{let a=e,l=a.operator==88||a.operator==89;return this.walkExpression(r,a.operand,t,i,l?!0:s)}case 30:{let a=e,l=a.operator==88||a.operator==89;return this.walkExpression(r,a.operand,t,i,l?!0:s)}default:return this.refuse(r,e.range,C_(e)),!1}}lowerAsyncMethods(r,e,t,i){let s=new Array,a=e.members;for(let l=0,o=a.length;l<o;++l){let u=a[l];if(u.kind==62){let c=u;if(!c.isAsync)continue;if(c.is(32)){this.refuse(i,c.range,"async static methods (async lowering)",c);continue}if(c.body==null)continue;let f=this.lowerAsyncFunction(r,c,t,i,s,ve(e.name.text,c.range));if(f)for(let _=0,d=f.length;_<d;++_)f[_]!==c&&s.push(f[_])}else if(u.kind==58){let c=u.initializer;c&&this.refuseAsyncFunctionExpression(c,i)}}return s}refuseAsyncFunctionExpression(r,e){if(r.kind!=16)return;let t=r.declaration;t.isAsync&&this.refuse(e,t.range,t.arrowKind!=0?xa:Ea,r)}refuse(r,e,t,i=null){let s=i??this.currentConstruct;s!=null?this.recordRefusalStart(s.range.source,s.range.start):this.recordRefusalStart(e.source,e.start),r.error(100,e,t)}recordRefusal(r){this.recordRefusalStart(r.range.source,r.range.start)}recordRefusalStart(r,e){let t=this.refusals;t==null&&(t=new Map,this.refusals=t);let i=J(t,r);i==null&&(i=new Set,t.set(r,i)),i.add(e)}};var P_=class{constructor(r){this.node=r;this.kind=0;this.lo=0;this.hi=0;this.info=null;this.before=new vt;this.after=new vt;this.all=new vt;this.statements=null;this.cond=null;this.thenSeq=null;this.elseSeq=null;this.body=null;this.init=null;this.incr=null;this.declarations=new Array;this.nestedFunction=!1;this.range=r.range}},N_=class{constructor(){this.plans=new Array;this.lo=0;this.hi=0}add(r){r.lo!=0&&((this.lo==0||r.lo<this.lo)&&(this.lo=r.lo),r.hi>this.hi&&(this.hi=r.hi)),this.plans.push(r)}},Ru=class{constructor(){this.next=1}},B_=class{constructor(r,e,t,i,s){this.node=r;this.operand=e;this.discriminator=t;this.fieldName=i;this.ordinal=s}},vt=class{constructor(){this.reads=new Set;this.writes=new Set}},L_=class{constructor(r,e,t,i,s,a=null,l=!0,o=null){this.lifting=r;this.stateName=e;this.terminal=t;this.returnsValue=i;this.localNames=s;this.returnType=a;this.guarded=l;this.hoisted=o;this.tempCount=0}freshTemp(r){let e=Ox;for(;this.localNames.has(e);)e=Ox+(++this.tempCount).toString();return this.localNames.add(e),e}};function et(n,r){for(let e=Set_values(r),t=0,i=e.length;t<i;++t)n.add(unchecked(e[t]))}function Aa(n,r){let e=new vt;return et(e.reads,n.reads),et(e.writes,n.writes),et(e.reads,r.reads),et(e.writes,r.writes),e}function Ta(n){let r=new vt,e=n.plans;for(let t=0,i=e.length;t<i;++t)et(r.reads,e[t].all.reads),et(r.writes,e[t].all.writes);return r}function Bk(n,r){let e=0;return n!=null&&n.lo!=0&&(e=n.lo),r!=null&&r.lo!=0&&(e==0||r.lo<e)&&(e=r.lo),e}function Lk(n,r){let e=0;return n!=null&&n.hi>e&&(e=n.hi),r!=null&&r.hi>e&&(e=r.hi),e}function Sa(n,r){let e=n.plans;for(let t=0,i=e.length;t<i;++t){let s=e[t];s.info!=null&&r.push(assert(s.info).fieldName),s.statements!=null&&Sa(assert(s.statements),r),s.thenSeq!=null&&Sa(assert(s.thenSeq),r),s.elseSeq!=null&&Sa(assert(s.elseSeq),r),s.body!=null&&Sa(assert(s.body),r)}}function va(n,r){let e=n.plans;for(let t=0,i=e.length;t<i;++t){let s=e[t];et(r,s.all.writes),et(r,s.before.writes),s.statements!=null&&va(assert(s.statements),r),s.thenSeq!=null&&va(assert(s.thenSeq),r),s.elseSeq!=null&&va(assert(s.elseSeq),r),s.body!=null&&va(assert(s.body),r)}}function Ia(n,r){let e=n.plans;for(let t=0,i=e.length;t<i;++t){let s=e[t];s.info!=null&&r.push(assert(s.info)),s.statements!=null&&Ia(assert(s.statements),r),s.thenSeq!=null&&Ia(assert(s.thenSeq),r),s.elseSeq!=null&&Ia(assert(s.elseSeq),r),s.body!=null&&Ia(assert(s.body),r)}}function Mk(n){let r=n.plans;if(!r.length)return!1;let e=r[r.length-1];return e.kind==0&&e.node.kind==47}function zk(n){for(let r=0,e=n.length;r<e;++r){let t=n[r].kind;if(t==59){if(n[r].isAsync)return!0}else{if(t==63||t==55)return!0;if(t==51){let i=n[r].declarations;for(let s=0,a=i.length;s<a;++s){let l=i[s].initializer;if(l!=null&&l.kind==16&&l.declaration.isAsync)return!0}}}}return!1}function Mr(n,r){for(let e=0,t=n.length;e<t;++e){let i=n[e];switch(i.kind){case 42:{let s=i.expression;if(s.kind==16){let a=J(qr(),s);a!=null&&r.add(a)}break}case 51:{let s=i.declarations;for(let a=0,l=s.length;a<l;++a){let o=s[a].initializer;if(o!=null&&o.kind==16){let u=J(qr(),o);u!=null&&r.add(u)}}break}case 34:{Mr(i.statements,r);break}case 45:{let s=i;Mr([s.ifTrue],r),s.ifFalse!=null&&Mr([assert(s.ifFalse)],r);break}case 53:{Mr([i.body],r);break}case 37:{Mr([i.body],r);break}case 43:{let s=i;s.initializer!=null&&Mr([assert(s.initializer)],r),Mr([s.body],r);break}default:break}}}function Iu(n,r,e){for(let t=0,i=n.length;t<i;++t){let s=n[t];switch(s.kind){case 51:{let a=s.declarations;for(let l=0,o=a.length;l<o;++l){let u=a[l],c=u.name.text;if(!r.has(c)||e.hasLocal(c))continue;let f=u.type;f!=null&&e.liftLocal(c,f,u)}break}case 34:{Iu(s.statements,r,e);break}case 45:{let a=s;Iu([a.ifTrue],r,e),a.ifFalse!=null&&Iu([assert(a.ifFalse)],r,e);break}default:break}}}function zr(n,r){switch(n.kind){case 34:{let e=n.statements;for(let t=0,i=e.length;t<i;++t)zr(e[t],r);break}case 45:{let e=n;zr(e.ifTrue,r),e.ifFalse!=null&&zr(assert(e.ifFalse),r);break}case 53:{zr(n.body,r);break}case 43:{let e=n;e.initializer!=null&&zr(assert(e.initializer),r),zr(e.body,r);break}case 51:{let e=n.declarations;for(let t=0,i=e.length;t<i;++t)r.add(e[t].name.text);break}default:break}}function Sn(n,r){switch(n.kind){case 34:{let e=n.statements;for(let t=0,i=e.length;t<i;++t)Sn(e[t],r);break}case 45:{let e=n;Sn(e.ifTrue,r),e.ifFalse!=null&&Sn(assert(e.ifFalse),r);break}case 53:{Sn(n.body,r);break}case 43:{let e=n;e.initializer!=null&&Sn(assert(e.initializer),r),Sn(e.body,r);break}case 51:{let e=n.declarations;for(let t=0,i=e.length;t<i;++t){let s=e[t],a=s.type;a!=null&&r.set(s.name.text,a)}break}default:break}}function Dk(n){switch(n.kind){case 59:case 62:case 55:case 56:case 61:case 63:case 64:return n.name.text;case 51:{let r=n.declarations;return r.length?r[0].name.text:null}default:return null}}function qx(n,r){return y.createExpressionStatement(y.createCallExpression(y.createIdentifierExpression(jx,r),null,[y.createIdentifierExpression(n,r)],r))}function Wx(n,r,e){return y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(n,r),null,16,null,y.createPropertyAccessExpression(y.createIdentifierExpression(e,r),y.createIdentifierExpression(n,r),r),r)],r)}function ka(n,r){let e=r.stateName;if(n.kind==47){let t=n,i=t.value,s=t.range,a=new Array;return i!=null?r.returnsValue?a.push(y.createExpressionStatement(y.createCallExpression(y.createIdentifierExpression(Ck,s),[assert(r.returnType)],[y.createIdentifierExpression(e,s),i],s))):(a.push(y.createExpressionStatement(i)),a.push(qx(e,s))):a.push(qx(e,s)),a.push(y.createExpressionStatement(Fu(e,St(r.terminal,s),s))),a.push(y.createReturnStatement(null,s)),a}if(n.kind==51){let t=n.declarations,i=!1;for(let a=0,l=t.length;a<l;++a){let o=t[a].name.text;if(r.lifting.hasLocal(o)||r.hoisted!=null&&assert(r.hoisted).has(o)){i=!0;break}}if(!i)return[n];let s=new Array;for(let a=0,l=t.length;a<l;++a){let o=t[a],u=o.name.text;if(!r.lifting.hasLocal(u)&&(r.hoisted==null||!assert(r.hoisted).has(u))){s.push(y.createVariableStatement(null,[o],o.range));continue}let c=o.initializer;c!=null&&s.push(y.createExpressionStatement(D_(u,c,o.range)))}return s}return[n]}function pr(n,r){switch(n.kind){case 34:{let e=n,t=new Array,i=e.statements;for(let s=0,a=i.length;s<a;++s){let l=pr(i[s],r);if(l.kind==34&&i[s].kind!=34){let o=l.statements;for(let u=0,c=o.length;u<c;++u)t.push(o[u])}else t.push(l)}return y.createBlockStatement(t,e.range)}case 45:{let e=n;return y.createIfStatement(e.condition,pr(e.ifTrue,r),e.ifFalse!=null?pr(assert(e.ifFalse),r):null,e.range)}case 53:{let e=n;return y.createWhileStatement(e.condition,pr(e.body,r),e.range)}case 43:{let e=n;return y.createForStatement(e.initializer,e.condition,e.incrementor,pr(e.body,r),e.range)}case 47:{let e=ka(n,r);return e.length==1?e[0]:y.createBlockStatement(e,n.range)}default:return n}}function Tu(n,r,e){return r.guarded?Gk(n,r,e):[n]}function Gk(n,r,e){return[y.createIfStatement(cr(He(r.stateName,e),e),y.createBlockStatement([n],e),null,e)]}function Ti(n,r){for(let e=0,t=r.length;e<t;++e)n.push(r[e])}function Uk(n,r,e){let t=new Array,i=n.parameterNames;for(let s=0,a=i.length;s<a;++s){let l=i[s],o=n.parameterRange(l);t.push(y.createExpressionStatement(G_(y.createPropertyAccessExpression(y.createIdentifierExpression(r,o),y.createIdentifierExpression(l,o),o),y.createIdentifierExpression(l,o),o)))}for(let s=0,a=n.locals.length;s<a;++s){let l=n.locals[s],o=l.declaration.name.range;t.push(y.createExpressionStatement(G_(y.createPropertyAccessExpression(y.createIdentifierExpression(r,o),y.createIdentifierExpression(l.name,o),o),y.createIdentifierExpression(l.name,o),o)))}return t}function C_(n){switch(n.kind){case 31:return"await in an unsupported position (async lowering)";case 16:return n.declaration.isAsync?Ea:"a nested function in an async function body (async lowering)";case 12:return"a nested class in an async function body (async lowering)";case 26:return"this in an async function body (async lowering)";case 25:return"super in an async function body (async lowering)";case 49:return"throw in an async function body (async lowering)";case 50:return"try/catch in an async function body (async lowering)";case 48:return"switch in an async function body (async lowering)";case 45:return"if in an async function body (async lowering)";case 43:return"for in an async function body (async lowering)";case 44:return"for-of in an async function body (async lowering)";case 53:return"while in an async function body (async lowering)";case 37:return"do in an async function body (async lowering)";case 34:return"a nested block in an async function body (async lowering)";default:return"this async body (async lowering)"}}function M_(n,r){let e="state";for(;Vk(n,r,e);)e="$"+e;return e}function Vk(n,r,e){for(let i=0,s=n.length;i<s;++i)if(n[i].name.text==e)return!0;let t=new Set;return zr(r,t),t.has(e)}function Ok(n,r){return M_(r,n)}function qk(n){let r=n.statements,e=r.length>0?r[0]:null;if(e==null||e.kind!=51)return;let t=e.declarations;if(t.length!=1||t[0].name.text!=Si)return;r.shift();let i=r.length>0?r[0]:null;if(i==null||i.kind!=42)return;let s=i.expression;if(s.kind!=10)return;let a=s;if(a.operator!=102||a.left.kind!=23)return;let l=a.left;l.expression.kind==8&&l.expression.text==Si&&l.property.text==Fa&&r.shift()}function z_(n,r,e){for(let t=0,i=n.length;t<i;++t)vn(n[t],r,e)}function vn(n,r,e){switch(n.kind){case 42:{let t=n.expression;n.expression=he(t,r,e);break}case 47:{let t=n.value;t!=null&&(n.value=he(t,r,e));break}case 51:{let t=n.declarations;for(let i=0,s=t.length;i<s;++i){let a=t[i].initializer;a!=null&&(t[i].initializer=he(a,r,e))}break}case 34:{z_(n.statements,r,e);break}case 45:{let t=n;t.condition=he(t.condition,r,e),vn(t.ifTrue,r,e),t.ifFalse!=null&&vn(assert(t.ifFalse),r,e);break}case 53:{let t=n;t.condition=he(t.condition,r,e),vn(t.body,r,e);break}case 37:{let t=n;vn(t.body,r,e),t.condition=he(t.condition,r,e);break}case 43:{let t=n,i=t.initializer;i!=null&&vn(i,r,e);let s=t.condition;s!=null&&(t.condition=he(s,r,e));let a=t.incrementor;a!=null&&(t.incrementor=he(a,r,e)),vn(t.body,r,e);break}case 48:{let t=n;t.condition=he(t.condition,r,e);let i=t.cases;for(let s=0,a=i.length;s<a;++s)i[s].label!=null&&(i[s].label=he(assert(i[s].label),r,e)),z_(i[s].statements,r,e);break}default:break}}function he(n,r,e){switch(n.kind){case 26:return y.createPropertyAccessExpression(y.createCallExpression(y.createIdentifierExpression("changetype",n.range),[ve(r,n.range)],[y.createPropertyAccessExpression(y.createIdentifierExpression(e,n.range),y.createIdentifierExpression(In,n.range),n.range)],n.range),y.createIdentifierExpression(Fa,n.range),n.range);case 10:{let t=n;return t.left=he(t.left,r,e),t.right=he(t.right,r,e),t}case 11:{let t=n;t.expression=he(t.expression,r,e);let i=t.args;for(let s=0,a=i.length;s<a;++s)i[s]=he(i[s],r,e);return t}case 23:{let t=n;return t.expression=he(t.expression,r,e),t}case 22:{let t=n;return t.expression=he(t.expression,r,e),t}case 30:{let t=n;return t.operand=he(t.operand,r,e),t}case 29:{let t=n;return t.operand=he(t.operand,r,e),t}case 14:{let t=n;return t.expression=he(t.expression,r,e),t.elementExpression=he(t.elementExpression,r,e),t}case 24:{let t=n;return t.condition=he(t.condition,r,e),t.ifThen=he(t.ifThen,r,e),t.ifElse=he(t.ifElse,r,e),t}case 13:{let t=n,i=t.expressions;for(let s=0,a=i.length;s<a;++s)i[s]=he(i[s],r,e);return t}case 19:{let t=n,i=t.args;for(let s=0,a=i.length;s<a;++s)i[s]=he(i[s],r,e);return t}case 17:{let t=n;return t.expression=he(t.expression,r,e),t}case 9:{let t=n;return t.expression=he(t.expression,r,e),t}case 31:{let t=n;return t.operand=he(t.operand,r,e),t}default:return n}}function Kx(n){return n==wu||n==vu||n==In||n=="record"?!0:n.startsWith(Qx)}function Wk(n,r,e){return y.createPropertyAccessExpression(n,y.createIdentifierExpression(r,e),e)}function ku(n,r,e){return Wk(y.createIdentifierExpression(n,e),r,e)}function Kk(n,r,e){return ku(n,r,e)}function He(n,r){return y.createPropertyAccessExpression(y.createIdentifierExpression(n,r),y.createIdentifierExpression(wu,r),r)}function Fu(n,r,e){return y.createBinaryExpression(102,He(n,e),r,e)}function Su(n,r,e,t){return r==0?cr(He(n,t),t):y.createBinaryExpression(99,cr(He(n,t),t),Xx(n,r,e,t),t)}function Xx(n,r,e,t){return r==0?y.createFalseExpression(t):y.createBinaryExpression(98,y.createBinaryExpression(76,He(n,t),St(r,t),t),y.createBinaryExpression(75,He(n,t),St(e,t),t),t)}function cr(n,r){return y.createBinaryExpression(77,n,St(0,r),r)}function Hx(n,r){return y.createBinaryExpression(78,n,St(0,r),r)}function Hk(n,r,e){return y.createBinaryExpression(77,n,r,e)}function D_(n,r,e){return G_(y.createIdentifierExpression(n,e),r,e)}function G_(n,r,e){return y.createBinaryExpression(102,n,r,e)}function jk(n){return n.kind==1&&n.name.identifier.text==""}var U_=class{constructor(r,e,t){this.name=r;this.type=e;this.declaration=t}},V_=class{constructor(){this.locals=new Array;this.parameters=new Set;this.parameterNames=new Array;this.parameterRanges=new Map;this.declaredTypes=new Map}liftParameter(r,e){this.parameters.has(r)||(this.parameters.add(r),this.parameterNames.push(r),this.parameterRanges.set(r,e))}parameterRange(r){return assert(this.parameterRanges.get(r))}liftLocal(r,e,t){this.hasLocal(r)||this.locals.push(new U_(r,e,t))}knownTypes(){let r=new Map,e=this.declaredTypes,t=Map_keys(e);for(let i=0,s=t.length;i<s;++i){let a=unchecked(t[i]);r.set(a,assert(e.get(a)))}for(let i=0,s=this.locals.length;i<s;++i){let a=this.locals[i];r.set(a.name,a.type)}return r}hasLocal(r){for(let e=0,t=this.locals.length;e<t;++e)if(this.locals[e].name==r)return!0;return!1}};function Qk(n){return n.kind==1&&n.name.identifier.text=="void"}function Xk(n,r){return y.createNamedType(y.createSimpleTypeName("Task",r),[n],!1,r)}function ve(n,r){return y.createNamedType(y.createSimpleTypeName(n,r),null,!1,r)}function $k(n){switch(n){case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 114:case 113:return!0;default:return!1}}function St(n,r){return y.createIntegerLiteralExpression(i64_new(n),r)}function Lr(n,r,e,t){return y.createBinaryExpression(102,y.createPropertyAccessExpression(n,y.createIdentifierExpression(r,t),t),e,t)}function $x(n){let r=new xu;r.program=n,r.afterParse(n.parser);let e=new ga;e.program=n,e.afterParse(n.parser);let t=new wa;t.program=n,t.afterParse(n.parser)}function Zk(){return new pa}function Yk(n,r){n.target=r}function Jk(n,r){n.runtime=r}function eF(n,r){n.noAssert=r}function tF(n,r){n.exportMemory=r}function rF(n,r){n.importMemory=r}function nF(n,r){n.initialMemory=r}function iF(n,r){n.maximumMemory=r}function sF(n,r){n.sharedMemory=r}function aF(n,r){n.importTable=r}function lF(n,r){n.exportTable=r}function oF(n,r){n.sourceMap=r}function uF(n,r){n.uncheckedBehavior=r}function cF(n,r){n.memoryBase=r}function pF(n,r){n.tableBase=r}function fF(n,r,e){let t=n.globalAliases;t||(n.globalAliases=t=new Map),t.set(r,e)}function _F(n,r){let e=n.globalAliases;e&&e.delete(r)}function dF(n,r){n.exportStart=r}function hF(n,r){n.noUnsafe=r}function mF(n,r){n.lowMemoryLimit=r}function yF(n,r){n.exportRuntime=r}var gF=32768;function bF(n,r){n.stackSize=r}function xF(n,r,e,t){n.bundleMajorVersion=r,n.bundleMinorVersion=e,n.bundlePatchVersion=t}var EF=1,AF=2,TF=4,SF=8,vF=16,IF=32,kF=64,FF=128,wF=256,RF=512,CF=1024,PF=2048,NF=4096,BF=8192,LF=16384,MF=32768,zF=65535,DF=pu;function GF(n,r,e){n.setFeature(r,e)}function UF(n,r,e){n.optimizeLevelHint=r,n.shrinkLevelHint=e}function VF(n,r){n.basenameHint=r}function OF(n,r){n.bindingsHint=r}function qF(n,r){n.pedantic=r}function WF(n,r){n.debugInfo=r}function KF(n){return new Ds(n)}function HF(n){return n.diagnosticsOffset<n.diagnostics.length?n.diagnostics[n.diagnosticsOffset++]:null}function jF(n,r){return n.getSource(r)}function QF(n){return n.code}function XF(n){return n.category}function $F(n){return n.message}function ZF(n){return n.range}function YF(n){return n.relatedRange}function JF(n){return n.start}function ew(n){return n.end}function tw(n){return n.source}function rw(n){return n.normalizedPath}function nw(n){return n.category==1}function iw(n){return n.category==2}function sw(n){return n.category==3}function aw(n,r,e,t=!1){n.parser.parseFile(r,e,t)}function lw(n){return n.parser.nextFile()}function ow(n,r){return n.parser.getDependee(r)}function uw(n){n.initialize()}function cw(n){return n.parser.finish(),new fa(n).compile()}function pw(n,r){return bi.build(n,r)}function fw(n,r){return _i.build(n,r)}function _w(n){return n.ref}function dw(n){return n.validate()}function hw(n,r,e,t=!1,i=!1){n.optimize(r,e,t,i)}var O_=class n{constructor(){this.sb=[];this.indentLevel=0}static build(r){let e=new n;return e.visitNode(r),e.finish()}visitNode(r){switch(r.kind){case 0:{this.visitSource(r);break}case 1:{this.visitNamedTypeNode(r);break}case 2:{this.visitFunctionTypeNode(r);break}case 3:{this.visitTupleTypeNode(r);break}case 6:{this.visitTypeParameter(r);break}case 15:case 20:case 25:case 26:case 27:case 28:case 8:{this.visitIdentifierExpression(r);break}case 9:{this.visitAssertionExpression(r);break}case 10:{this.visitBinaryExpression(r);break}case 11:{this.visitCallExpression(r);break}case 12:{this.visitClassExpression(r);break}case 13:{this.visitCommaExpression(r);break}case 14:{this.visitElementAccessExpression(r);break}case 16:{this.visitFunctionExpression(r);break}case 17:{this.visitInstanceOfExpression(r);break}case 18:{this.visitLiteralExpression(r);break}case 19:{this.visitNewExpression(r);break}case 22:{this.visitParenthesizedExpression(r);break}case 23:{this.visitPropertyAccessExpression(r);break}case 24:{this.visitTernaryExpression(r);break}case 29:{this.visitUnaryPostfixExpression(r);break}case 30:{this.visitUnaryPrefixExpression(r);break}case 31:{this.visitAwaitExpression(r);break}case 34:{this.visitBlockStatement(r);break}case 35:{this.visitBreakStatement(r);break}case 36:{this.visitContinueStatement(r);break}case 37:{this.visitDoStatement(r);break}case 38:{this.visitEmptyStatement(r);break}case 39:{this.visitExportStatement(r);break}case 40:{this.visitExportDefaultStatement(r);break}case 41:{this.visitExportImportStatement(r);break}case 42:{this.visitExpressionStatement(r);break}case 43:{this.visitForStatement(r);break}case 44:{this.visitForOfStatement(r);break}case 45:{this.visitIfStatement(r);break}case 46:{this.visitImportStatement(r);break}case 47:{this.visitReturnStatement(r);break}case 48:{this.visitSwitchStatement(r);break}case 49:{this.visitThrowStatement(r);break}case 50:{this.visitTryStatement(r);break}case 51:{this.visitVariableStatement(r);break}case 53:{this.visitWhileStatement(r);break}case 54:{this.visitModuleDeclaration(r);break}case 55:{this.visitClassDeclaration(r);break}case 56:{this.visitEnumDeclaration(r);break}case 57:{this.visitEnumValueDeclaration(r);break}case 58:{this.visitFieldDeclaration(r);break}case 59:{this.visitFunctionDeclaration(r);break}case 60:{this.visitImportDeclaration(r);break}case 61:{this.visitInterfaceDeclaration(r);break}case 62:{this.visitMethodDeclaration(r);break}case 63:{this.visitNamespaceDeclaration(r);break}case 64:{this.visitTypeDeclaration(r);break}case 65:{this.visitVariableDeclaration(r);break}case 66:{this.serializeDecorator(r);break}case 67:{this.visitExportMember(r);break}case 7:{this.serializeParameter(r);break}case 68:{this.visitSwitchCase(r);break}case 69:{this.visitIndexSignature(r);break}default:assert(!1)}}visitSource(r){let e=r.statements;for(let t=0,i=e.length;t<i;++t)this.visitNodeAndTerminate(e[t])}visitTypeNode(r){switch(r.kind){case 1:{this.visitNamedTypeNode(r);break}case 2:{this.visitFunctionTypeNode(r);break}case 3:{this.visitTupleTypeNode(r);break}default:assert(!1)}}visitTypeName(r){this.visitIdentifierExpression(r.identifier);let e=this.sb,t=r.next;for(;t;)e.push("."),this.visitIdentifierExpression(t.identifier),t=t.next}visitNamedTypeNode(r){this.visitTypeName(r.name);let e=r.typeArguments;if(e){let t=e.length,i=this.sb;if(t){i.push("<"),this.visitTypeNode(e[0]);for(let s=1;s<t;++s)i.push(", "),this.visitTypeNode(e[s]);i.push(">")}r.isNullable&&i.push(" | null")}this.visitTypeAttributes(r)}visitTypeAttributes(r){let e=r.attributes;if(!e)return;let t=this.sb;for(let i=0,s=e.length;i<s;++i){let a=e[i];t.push(" @"),this.visitNode(a.name);let l=a.args;if(l){t.push("(");let o=l.length;if(o){this.visitNode(l[0]);for(let u=1;u<o;++u)t.push(", "),this.visitNode(l[u])}t.push(")")}}}visitFunctionTypeNode(r){let e=r.isNullable,t=this.sb;t.push(e?"((":"(");let i=r.explicitThisType;i&&(t.push("this: "),this.visitTypeNode(i));let s=r.parameters,a=s.length;if(a){i&&t.push(", "),this.serializeParameter(s[0]);for(let o=1;o<a;++o)t.push(", "),this.serializeParameter(s[o])}let l=r.returnType;l?(t.push(") => "),this.visitTypeNode(l)):t.push(") => void"),e&&t.push(") | null"),this.visitTypeAttributes(r)}visitTupleTypeNode(r){let e=this.sb;e.push("[");let t=r.elements,i=r.elementNames,s=t.length;if(s){let a=i?i[0]:null;a&&(this.visitIdentifierExpression(a),e.push(": ")),this.visitTypeNode(t[0]);for(let l=1;l<s;++l)e.push(", "),a=i?i[l]:null,a&&(this.visitIdentifierExpression(a),e.push(": ")),this.visitTypeNode(t[l])}e.push("]"),r.isNullable&&e.push(" | null"),this.visitTypeAttributes(r)}visitTypeParameter(r){this.visitIdentifierExpression(r.name);let e=r.extendsType;e&&(this.sb.push(" extends "),this.visitTypeNode(e));let t=r.defaultType;t&&(this.sb.push("="),this.visitTypeNode(t))}visitIdentifierExpression(r){r.isQuoted?this.visitStringLiteral(r.text):this.sb.push(r.text)}visitArrayLiteralExpression(r){let e=this.sb;e.push("[");let t=r.elementExpressions,i=t.length;if(i){let s=t[0];s&&this.visitNode(s);for(let a=1;a<i;++a)s=t[a],e.push(", "),s&&this.visitNode(s)}e.push("]")}visitObjectLiteralExpression(r){let e=this.sb,t=r.names,i=r.values,s=t.length;if(assert(s==i.length),s){e.push(`{
306
+ `),t.join("")}};function ct(n,r,e=0){if(n==null)return null;switch(n.kind){case 18:{switch(n.literalKind){case 1:return Lr("i32",n);case 0:return Lr("f64",n);case 2:case 3:return Lr("string",n)}return null}case 27:case 15:return Lr("bool",n);case 22:return ct(n.expression,r,e);case 19:{let t=n;return y.createNamedType(t.typeName,t.typeArguments,!1,t.range)}case 9:{let t=n;return t.assertionKind!=2&&t.toType!=null?t.toType:ct(t.expression,r,e)}case 11:{let t=n,i=t.expression;if(i.kind==8&&i.text=="changetype"){let s=t.typeArguments;if(s!=null&&s.length==1)return s[0]}return null}case 8:{if(r==null||e>8)return null;let t=n.text,i=J(r,t);return i??null}case 30:{let t=n;switch(t.operator){case 96:return Lr("bool",n);case 83:case 82:case 97:{let i=ct(t.operand,r,e+1);return _a(i)?i:null}}return null}case 29:{let t=ct(n.operand,r,e+1);return _a(t)?t:null}case 10:{let t=n;switch(t.operator){case 73:case 74:case 75:case 76:case 77:case 78:case 79:case 80:return Lr("bool",n);case 90:case 91:case 92:{let i=ct(t.left,r,e+1);return _a(i)?i:null}case 98:case 99:{let i=ct(t.left,r,e+1),s=ct(t.right,r,e+1);return xi(i,"bool")&&xi(s,"bool")?Lr("bool",n):null}case 82:case 83:case 85:case 86:case 87:case 93:case 94:case 95:case 84:{let i=ct(t.left,r,e+1),s=ct(t.right,r,e+1);return!_a(i)||!_a(s)?null:xi(i,"f64")||xi(s,"f64")?!xi(i,"f32")&&!xi(s,"f32")?Lr("f64",n):null:_3(i,s)?i:null}}return null}}return null}function Lr(n,r){let e=y.createSimpleTypeName(n,r.range);return y.createNamedType(e,null,!1,r.range)}function _a(n){if(n==null||n.kind!=1)return!1;let e=n.name.identifier.text;return e=="i8"||e=="i16"||e=="i32"||e=="i64"||e=="u8"||e=="u16"||e=="u32"||e=="u64"||e=="isize"||e=="usize"||e=="f32"||e=="f64"}function x_(n){let r=n.typeArguments;return r!=null&&r.length>0}function xi(n,r){if(n==null||n.kind!=1)return!1;let e=n;return e.name.identifier.text==r&&!x_(e)}function _3(n,r){if(n==null||r==null||n.kind!=1||r.kind!=1)return!1;let e=n,t=r;return x_(e)||x_(t)?!1:e.name.identifier.text==t.name.identifier.text}var ha="$closureEnv",du="$closureEnvIn",hu="$init$",Px="$Env",d3="__closureInit",Ei="$this",da="$parent",h3="$env",Nx="$awaited";function m3(n){let r=n.length;if(r==0)return!1;if(fu(n,ha)&&(r==ha.length||n.charCodeAt(ha.length)==36)||fu(n,du)||n==Ei||n==da||n==h3||fu(n,hu))return!0;if(fu(n,Nx)){let e=Nx.length;if(e>=r)return!1;for(let t=e;t<r;++t){let i=n.charCodeAt(t);if(i<48||i>57)return!1}return!0}return!1}function fu(n,r){let e=r.length;if(n.length<e)return!1;for(let t=0;t<e;++t)if(n.charCodeAt(t)!=r.charCodeAt(t))return!1;return!0}var gu=class{constructor(r,e,t,i,s,a,l){this.name=r;this.kind=e;this.envClass=t;this.ownEnv=i;this.receivesEnv=s;this.parentClass=a;this.needed=l}},ga=class{constructor(){this.analyses=null}afterParse(r){let e=this.program.sources;this.analyses=null;let t=!1,i=new A_;for(let s=0,a=e.length;s<a;++s){let l=e[s];l.isLibrary||(this.collectStatementList(l.statements,r)&&(t=!0),i.visitStatements(l.statements))}if(i.sawAsync&&(t=!0),!(t&&i.refuse(r)))for(let s=0,a=e.length;s<a;++s){let l=e[s];l.isLibrary||this.lowerStatementList(l,l.statements,r)}}dumpEnvAnalysis(){let r=new Array,e=this.analyses;if(e==null)return r;for(let t of e.values()){let i=t.allInfos;for(let s=0,a=i.length;s<a;++s)r.push(t.describe(i[s],s))}return r}recordAnalysis(r,e){let t=this.analyses;t==null&&(t=new Map,this.analyses=t),t.set(r,e)}collectStatementList(r,e){let t=!1;for(let i=0,s=r.length;i<s;++i){let a=r[i];switch(a.kind){case 59:{let l=a;if(l.body==null)break;let o=new ya(this,e,l);o.run(),this.recordAnalysis(l,o),o.hasCaptures()&&!o.refused&&(t=!0);break}case 63:{this.collectStatementList(a.members,e)&&(t=!0);break}case 55:{let l=a.name.text,o=a.members;for(let u=0,c=o.length;u<c;++u){if(o[u].kind!=62)continue;let f=o[u];if(f.body==null||f.is(32))continue;let _=new ya(this,e,f,yu(l,f.range),a);_.run(),this.recordAnalysis(f,_),_.hasCaptures()&&!_.refused&&(t=!0)}break}case 51:{let l=a.declarations;for(let o=0,u=l.length;o<u;++o){let c=l[o].initializer;if(c==null||c.kind!=16)continue;let f=c;if(f.declaration.body==null)continue;let _=new ya(this,e,f.declaration);_.run(),this.recordAnalysis(f.declaration,_),_.hasCaptures()&&!_.refused&&_.refuse(f.declaration.range,"a capture from a top-level function expression (closures lowering)")}break}default:break}}return t}lowerStatementList(r,e,t){let i=new Array,s=!1;for(let a=0,l=e.length;a<l;++a){let o=e[a];switch(o.kind){case 59:{let u=o;if(u.body==null){i.push(o);break}let c=assert(assert(this.analyses).get(u));if(!c.hasCaptures()){i.push(o);break}if(c.refused){i.push(o);break}let f=c.makeEnvClasses();for(let _=0,d=f.length;_<d;++_)i.push(f[_]);c.rewrite(),i.push(o),s=!0;break}case 63:{this.lowerStatementList(r,o.members,t),i.push(o);break}case 55:{let u=o,c=this.lowerMethods(u,t);for(let f=0,_=c.length;f<_;++f)i.push(c[f]);c.length>0&&(s=!0),i.push(o);break}case 51:{i.push(o);break}default:{i.push(o);break}}}if(s){e.length=0;for(let a=0,l=i.length;a<l;++a)e.push(i[a])}}lowerMethods(r,e){let t=new Array,i=r.members;for(let s=0,a=i.length;s<a;++s){let l=i[s];if(l.kind!=62)continue;let o=l;if(o.body==null||o.is(32))continue;let u=assert(assert(this.analyses).get(o));if(!u.hasCaptures()||u.refused)continue;let c=u.makeEnvClasses();for(let f=0,_=c.length;f<_;++f)t.push(c[f]);u.rewrite()}return t}},E_=class{constructor(r,e){this.name=r;this.range=e}},A_=class{constructor(){this.hits=null;this.sawAsync=!1}check(r,e){if(!m3(r))return;let t=this.hits;if(t==null)t=new Array,this.hits=t;else for(let i=0,s=t.length;i<s;++i)if(t[i].name==r)return;t.push(new E_(r,e))}refuse(r){let e=this.hits;if(e==null)return!1;for(let t=0,i=e.length;t<i;++t)r.error(100,e[t].range,"a user identifier named '"+e[t].name+"' (closures lowering)");return!0}visitStatements(r){for(let e=0,t=r.length;e<t;++e)this.visitStatement(r[e])}visitStatement(r){switch(r.kind){case 34:{this.visitStatements(r.statements);break}case 37:{let e=r;this.visitStatement(e.body),this.visitExpression(e.condition);break}case 42:{this.visitExpression(r.expression);break}case 43:{let e=r,t=e.initializer;t!=null&&this.visitStatement(t);let i=e.condition;i!=null&&this.visitExpression(i);let s=e.incrementor;s!=null&&this.visitExpression(s),this.visitStatement(e.body);break}case 44:{let e=r;this.visitStatement(e.variable),this.visitExpression(e.iterable),this.visitStatement(e.body);break}case 45:{let e=r;this.visitExpression(e.condition),this.visitStatement(e.ifTrue),e.ifFalse!=null&&this.visitStatement(assert(e.ifFalse));break}case 47:{let e=r.value;e!=null&&this.visitExpression(e);break}case 48:{let e=r;this.visitExpression(e.condition);let t=e.cases;for(let i=0,s=t.length;i<s;++i){let a=t[i].label;a!=null&&this.visitExpression(a),this.visitStatements(t[i].statements)}break}case 49:{this.visitExpression(r.value);break}case 50:{let e=r;this.visitStatements(e.bodyStatements);let t=e.catchVariable;t!=null&&this.check(t.text,t.range),e.catchStatements!=null&&this.visitStatements(assert(e.catchStatements)),e.finallyStatements!=null&&this.visitStatements(assert(e.finallyStatements));break}case 51:{let e=r.declarations;for(let t=0,i=e.length;t<i;++t){let s=e[t];this.check(s.name.text,s.name.range),s.initializer!=null&&this.visitExpression(assert(s.initializer))}break}case 53:{let e=r;this.visitExpression(e.condition),this.visitStatement(e.body);break}case 59:case 62:{this.visitFunction(r);break}case 55:{this.visitClass(r);break}case 56:{let e=r;this.check(e.name.text,e.name.range);let t=e.values;for(let i=0,s=t.length;i<s;++i){this.check(t[i].name.text,t[i].name.range);let a=t[i].initializer;a!=null&&this.visitExpression(a)}break}case 63:{let e=r;this.check(e.name.text,e.name.range),this.visitStatements(e.members);break}case 64:{let e=r;this.check(e.name.text,e.name.range);break}default:break}}visitFunction(r){let e=r.name;e.text.length!=0&&this.check(e.text,e.range),r.isAsync&&(this.sawAsync=!0);let t=r.signature.parameters;for(let s=0,a=t.length;s<a;++s){let l=t[s];this.check(l.name.text,l.name.range),l.initializer!=null&&this.visitExpression(assert(l.initializer))}let i=r.body;i!=null&&this.visitStatement(i)}visitClass(r){let e=r.name;e.text.length!=0&&this.check(e.text,e.range);let t=r.members;for(let i=0,s=t.length;i<s;++i){let a=t[i];switch(a.kind){case 58:{let l=a;this.check(l.name.text,l.name.range),l.initializer!=null&&this.visitExpression(assert(l.initializer));break}case 62:{this.visitFunction(a);break}default:break}}}visitExpression(r){switch(r.kind){case 9:{this.visitExpression(r.expression);break}case 10:{let e=r;this.visitExpression(e.left),this.visitExpression(e.right);break}case 11:{let e=r;this.visitExpression(e.expression);let t=e.args;for(let i=0,s=t.length;i<s;++i)this.visitExpression(t[i]);break}case 12:{this.visitClass(r.declaration);break}case 13:{let e=r.expressions;for(let t=0,i=e.length;t<i;++t)this.visitExpression(e[t]);break}case 14:{let e=r;this.visitExpression(e.expression),this.visitExpression(e.elementExpression);break}case 16:{this.visitFunction(r.declaration);break}case 17:{this.visitExpression(r.expression);break}case 18:{let e=r;switch(e.literalKind){case 3:{let t=e.expressions;for(let i=0,s=t.length;i<s;++i)this.visitExpression(t[i]);break}case 5:{let t=e.elementExpressions;for(let i=0,s=t.length;i<s;++i)this.visitExpression(t[i]);break}case 6:{let t=e.values;for(let i=0,s=t.length;i<s;++i)this.visitExpression(t[i]);break}default:break}break}case 19:{let e=r.args;for(let t=0,i=e.length;t<i;++t)this.visitExpression(e[t]);break}case 22:{this.visitExpression(r.expression);break}case 23:{this.visitExpression(r.expression);break}case 24:{let e=r;this.visitExpression(e.condition),this.visitExpression(e.ifThen),this.visitExpression(e.ifElse);break}case 30:{this.visitExpression(r.operand);break}case 29:{this.visitExpression(r.operand);break}case 31:{this.visitExpression(r.operand);break}case 32:{this.visitExpression(r.expression);break}default:break}}};var ma=class{constructor(r,e,t,i,s){this.name=r;this.type=e;this.scope=t;this.declaration=i;this.hasInitializer=s;this.captured=!1;this.hasInitFlag=!1;this.isParam=!1;this.isLoopHeader=!1;this.isLoopHeaderOf=null;this.closureValue=null;this.isConst=!1}},Ot=class{constructor(r,e,t,i){this.kind=r;this.parent=e;this.ownerFunction=t;this.range=i;this.bindings=new Map;this.functionValues=new Map;this.captured=new Array;this.localName=null;this.className=null;this.needsThis=!1;this.isLoopHeader=!1}resolveFunctionValue(r){let e=this;for(;e!=null;){let t=J(e.functionValues,r);if(t)return t;e=e.parent}return null}knownTypes(){let r=new Map,e=this;for(;e!=null;){let t=e.bindings,i=Map_keys(t);for(let s=0,a=i.length;s<a;++s){let l=unchecked(i[s]);if(r.has(l))continue;let u=assert(t.get(l)).type;u!=null&&r.set(l,u)}e=e.parent}return r}resolve(r){let e=this;for(;e!=null;){let t=J(e.bindings,r);if(t)return t;e=e.parent}return null}},T_=class{constructor(r,e,t){this.expression=r;this.arrows=e;this.receiver=t}},S_=class{constructor(r,e){this.declaration=r;this.range=e}},v_=class{constructor(r,e,t){this.identifier=r;this.binding=e;this.write=t}},I_=class{constructor(r,e,t,i,s){this.node=r;this.expression=e;this.isArrow=t;this.isAsync=i;this.parent=s;this.children=new Array;this.directCaptures=null;this.neededScopes=null;this.needed=null;this.displayName="";this.ownEnv=!1;this.bodyParent=null;this.usesThis=!1;this.capturesLocal=!1;this.ownsScope=null}recordCapture(r){let e=this.directCaptures;if(e==null)e=new Array,this.directCaptures=e;else if(e.includes(r))return;e.push(r)}recordNeed(r){let e=this.neededScopes;if(e==null)e=new Array,this.neededScopes=e;else if(e.includes(r))return;e.push(r);let t=this.needed;(t==null||ba(r)>ba(t))&&(this.needed=r)}resetNeeds(){this.neededScopes=null,this.needed=null}};function mu(n){return n.captured.length>0||n.needsThis}function _u(n){let r=n.parent;for(;r!=null;){if(mu(r))return r;r=r.parent}return null}function y3(n){let r=n.ownerFunction.name.text,e=n.kind==0?"$body":"$block";return r+e+":"+ba(n).toString()}function ba(n){let r=0,e=n;for(;e!=null;)++r,e=e.parent;return r}var ya=class{constructor(r,e,t,i=null,s=null){this.transform=r;this.parser=e;this.owner=t;this.refs=new Map;this.writes=new Set;this.allRefs=new Array;this.infos=new Map;this.scopes=new Array;this.scopeOfBlock=new Map;this.scopeOfCase=new Map;this.scopeOfLoop=new Map;this.plainBlocks=new Set;this.allInfos=new Array;this.bindingOf=new Map;this.captures=!1;this.refused=!1;this.typeParameters=new Set;this.classTypeParameters=new Set;this.envTypeParameters=new Array;this.thisUses=new Array;this.ownerBodyUsesThis=!1;this.hostCallbackCandidates=new Array;this.ownerNames=new Map;this.classNames=new Set;this.anonymousOwners=0;this.structFunctions=new Set;this.thisRefs=new Map;this.ownerThisType=i??t.signature.explicitThisType;let a=t.typeParameters;if(a)for(let o=0,u=a.length;o<u;++o)this.typeParameters.add(a[o].name.text);if(s!=null){let o=s.typeParameters;if(o)for(let u=0,c=o.length;u<c;++u){let f=o[u].name.text;this.classTypeParameters.add(f),this.envTypeParameters.push(f)}}let l=t.typeParameters;if(l)for(let o=0,u=l.length;o<u;++o){let c=l[o].name.text;this.typeParameters.add(c),this.classTypeParameters.has(c)||this.envTypeParameters.push(c)}}hasCaptures(){return this.captures||this.thisRefs.size>0}refuse(r,e){this.refused||(this.refused=!0,this.parser.error(100,r,e))}isPlainBlock(r){return this.plainBlocks.has(r)}describe(r,e){let t=new Array,i=r.neededScopes;if(i!=null){let l=new Array;for(let o=0,u=i.length;o<u;++o)l.push(i[o]);for(let o=1,u=l.length;o<u;++o){let c=l[o],f=ba(c),_=o-1;for(;_>=0&&ba(l[_])<f;)l[_+1]=l[_],--_;l[_+1]=c}for(let o=0,u=l.length;o<u;++o)t.push(y3(l[o]))}let s=r.needed!=null?"struct":r.usesThis?"receiver":"none",a=r.node.name.text;return a.length==0&&(a=r.displayName),a.length==0&&(a="$anonymous"+e.toString()),new gu(a,s,r.needed!=null?r.needed.className:null,r.ownEnv,r.needed!=null,r.bodyParent!=null?r.bodyParent.className:null,t)}attributeThis(){let r=this.thisUses;for(let e=0,t=r.length;e<t;++e){let i=r[e],s=i.arrows[0],a=i.receiver.ownsScope;if(a==null)continue;let l=s.needed;if(l==null){if(!i.receiver.isAsync)continue;s.recordCapture(a),s.recordNeed(a),a.needsThis=!0,this.thisRefs.set(i.expression,a);continue}if(this.ownerThisType==null){this.refuse(i.expression.range,"this in a capturing arrow (closures lowering)");continue}let o;l.ownerFunction===a.ownerFunction?(l.needsThis=!0,o=l):(a.needsThis=!0,o=a),this.thisRefs.set(i.expression,o)}if(this.ownerBodyUsesThis&&this.owner.isAsync&&this.ownerThisType!=null){let e=J(this.infos,this.owner),t=e!=null?e.ownsScope:null;t!=null&&mu(t)&&(t.needsThis=!0)}}ownerPrefix(r){let e=J(this.infos,r);if(e==null)return r.name.text;let t=new Array,i=e;for(;i!=null;)t.push(this.ownerNameOf(i)),i=i.parent;let s="";for(let a=t.length-1;a>=0;--a)s.length!=0&&(s+="$"),s+=t[a];return s}ownerNameOf(r){let e=J(this.ownerNames,r.node);if(e!=null)return e;let t=r.node.name.text;return t.length==0&&(t=r.displayName),t.length==0&&(++this.anonymousOwners,t="$anon"+this.anonymousOwners.toString()),this.ownerNames.set(r.node,t),t}uniqueClassName(r,e){let t=r,i=0;for(;this.classNames.has(t);)++i,t=r+"$"+i.toString();return this.classNames.add(t),t}finalizeNeeds(){let r=this.scopes,e=this.allInfos;for(let t=0,i=e.length;t<i;++t)e[t].ownEnv=!1,e[t].bodyParent=null;for(let t=0,i=r.length;t<i;++t){let s=r[t];if(!mu(s))continue;let a=J(this.infos,s.ownerFunction);a!=null&&(a.ownEnv=!0)}for(let t=e.length-1;t>=0;--t){let i=e[t];i.resetNeeds();let s=i.directCaptures;if(s!=null)for(let o=0,u=s.length;o<u;++o)i.recordNeed(s[o]);let a=i.children;for(let o=0,u=a.length;o<u;++o){let c=a[o].needed;c!=null&&this.isDeliverable(i,c)&&i.recordNeed(c)}let l=i.ownsScope;if(l!=null&&l.captured.length>0){let o=_u(l);o!=null&&(i.bodyParent=o,i.recordNeed(o))}}}run(){let r=this.analyzeFunction(this.owner,null,!1,null,null),e=this.allRefs;for(let s=0,a=e.length;s<a;++s){let l=e[s];l.binding.captured&&(this.refs.set(l.identifier,l.binding),l.write&&this.writes.add(l.identifier))}this.finalizeNeeds(),this.attributeThis(),this.finalizeNeeds();let t=this.hostCallbackCandidates;for(let s=0,a=t.length;s<a;++s){let l=t[s],o=J(this.infos,l.declaration);if(o!=null&&o.needed!=null){this.refuse(l.range,"a closure captured by a host callback (closures lowering)");break}}let i=0;for(let s=0,a=this.scopes.length;s<a;++s){let l=this.scopes[s];if(!mu(l))continue;if(l.kind==1&&!this.isPlainBlock(l)&&!l.isLoopHeader){this.refuse(l.range,"a capture from a switch or try scope (closures lowering)");continue}let o=this.ownerPrefix(l.ownerFunction);l.kind==0?(l.localName=ha,l.className=this.uniqueClassName(o+Px,l.range)):(++i,l.localName=ha+"$"+i.toString(),l.className=this.uniqueClassName(o+Px+"$"+i.toString(),l.range))}for(let s=0,a=this.allInfos.length;s<a;++s){let l=this.allInfos[s],o=l.ownsScope;o==null||o.className==null||sl.set(l.node,new ts(0,o.className,!0,!1,l.bodyParent!=null?assert(l.bodyParent).className:null,o.needsThis))}r.needed!=null&&this.refuse(this.owner.range,"a top-level function that captures (closures lowering)")}analyzeFunction(r,e,t,i,s){let a=new I_(r,e,t,r.isAsync,s);this.infos.set(r,a),this.allInfos.push(a),s&&s.children.push(a);let l=new Ot(0,i,r,r.range);a.ownsScope=l,this.scopes.push(l);let o=r.signature.parameters;for(let c=0,f=o.length;c<f;++c){let _=o[c],d=new ma(_.name.text,_.type,l,_,!0);d.isParam=!0,l.bindings.set(d.name,d)}let u=r.body;u!=null&&(u.kind==34?this.walkStatements(u.statements,l,a):this.walkStatement(u,l,a)),a.needed!=null&&e!=null&&this.structFunctions.add(e);for(let c=0,f=a.children.length;c<f;++c){let d=a.children[c].needed;d!=null&&this.isDeliverable(a,d)&&a.recordNeed(d)}return a}isDeliverable(r,e){if(e.ownerFunction===r.node)return!1;let t=r.ownsScope,i=e;for(;i!=null;){if(i===t)return!1;i=i.parent}return!0}walkStatements(r,e,t){for(let i=0,s=r.length;i<s;++i)this.walkStatement(r[i],e,t)}walkStatement(r,e,t){switch(r.kind){case 34:{let i=r,s=new Ot(1,e,t.node,i.range);this.scopeOfBlock.set(i,s),this.plainBlocks.add(s),this.scopes.push(s),this.walkStatements(i.statements,s,t);break}case 51:{let i=r.declarations;for(let s=0,a=i.length;s<a;++s)this.declare(i[s],e,!1,t);break}case 42:{let i=r.expression;if(this.walkExpression(i,e,t,!1),i.kind==16){let s=i,a=s.declaration.name;a.text.length>0&&e.functionValues.set(a.text,s)}break}case 47:{let i=r.value;i!=null&&this.walkExpression(i,e,t,!1);break}case 45:{let i=r;this.walkExpression(i.condition,e,t,!1),this.walkStatement(i.ifTrue,e,t),i.ifFalse!=null&&this.walkStatement(assert(i.ifFalse),e,t);break}case 53:{let i=r;this.walkExpression(i.condition,e,t,!1),this.walkStatement(i.body,e,t);break}case 37:{let i=r;this.walkStatement(i.body,e,t),this.walkExpression(i.condition,e,t,!1);break}case 43:{let i=r,s=new Ot(1,e,t.node,i.range);this.scopeOfLoop.set(i,s),this.scopes.push(s);let a=i.initializer;if(a!=null)if(a.kind==51){let u=a.declarations;for(let c=0,f=u.length;c<f;++c)this.declare(u[c],s,!0,t,i)}else this.walkStatement(a,s,t);let l=i.condition;l!=null&&this.walkExpression(l,s,t,!1);let o=i.incrementor;o!=null&&this.walkExpression(o,s,t,!1),this.walkStatement(i.body,s,t);break}case 44:{let i=r;this.walkExpression(i.iterable,e,t,!1);let s=new Ot(1,e,t.node,i.range);if(this.scopes.push(s),i.variable.kind==51){let a=i.variable.declarations;for(let l=0,o=a.length;l<o;++l)this.declare(a[l],s,!0,t)}else this.walkStatement(i.variable,s,t);this.walkStatement(i.body,s,t);break}case 48:{let i=r;this.walkExpression(i.condition,e,t,!1);let s=i.cases;for(let a=0,l=s.length;a<l;++a){let o=s[a],u=o.label;u!=null&&this.walkExpression(u,e,t,!1);let c=new Ot(1,e,t.node,o.range);this.scopeOfCase.set(o,c),this.scopes.push(c),this.walkStatements(o.statements,c,t)}break}case 50:{let i=r,s=new Ot(1,e,t.node,i.range);if(this.scopes.push(s),this.walkStatements(i.bodyStatements,s,t),i.catchStatements!=null){let a=new Ot(1,e,t.node,i.range);this.scopes.push(a);let l=i.catchVariable;if(l!=null){let o=new ma(l.text,null,a,l,!0);a.bindings.set(o.name,o)}this.walkStatements(assert(i.catchStatements),a,t)}if(i.finallyStatements!=null){let a=new Ot(1,e,t.node,i.range);this.scopes.push(a),this.walkStatements(assert(i.finallyStatements),a,t)}break}case 49:{this.walkExpression(r.value,e,t,!1);break}case 35:case 36:case 38:case 64:break;default:break}}declare(r,e,t,i,s=null){let a=r.initializer;a!=null&&this.walkExpression(a,e,i,!1);let l=new ma(r.name.text,r.type,e,r,a!=null);if(l.isLoopHeader=t,l.isLoopHeaderOf=s,a!=null&&a.kind==16){let o=a;this.structFunctions.has(o)&&(l.closureValue=o);let u=J(this.infos,o.declaration);u!=null&&(u.displayName=r.name.text)}l.isConst=(r.flags&8)!=0,e.bindings.set(l.name,l),this.bindingOf.set(r,l)}walkExpression(r,e,t,i){switch(r.kind){case 8:{let s=r,a=e.resolve(s.text);if(a==null)return;this.allRefs.push(new v_(s,a,i)),a.scope.ownerFunction!==t.node&&this.capture(a,s,t,i);return}case 26:{t.node===this.owner?this.ownerBodyUsesThis=!0:this.markThis(r,t);return}case 25:{t.isArrow&&this.refuse(r.range,"super in a capturing arrow (closures lowering)");return}case 27:case 15:case 20:return;case 16:{let s=r,a=s.declaration;this.analyzeFunction(a,s,a.arrowKind!=0,e,t);return}case 18:{let s=r;switch(s.literalKind){case 3:{let a=s.expressions;for(let l=0,o=a.length;l<o;++l)this.walkExpression(a[l],e,t,!1);break}case 5:{let a=s.elementExpressions;for(let l=0,o=a.length;l<o;++l)this.walkExpression(a[l],e,t,!1);break}case 6:{let a=s.values;for(let l=0,o=a.length;l<o;++l)this.walkExpression(a[l],e,t,!1);break}default:break}return}case 10:{let s=r,a=Lx(s.operator);this.walkExpression(s.left,e,t,a),this.walkExpression(s.right,e,t,!1);return}case 30:{let s=r,a=s.operator==88||s.operator==89;this.walkExpression(s.operand,e,t,a);return}case 29:{let s=r,a=s.operator==88||s.operator==89;this.walkExpression(s.operand,e,t,a);return}case 11:{let s=r;this.walkExpression(s.expression,e,t,!1);let a=s.args;for(let l=0,o=a.length;l<o;++l)this.walkExpression(a[l],e,t,!1);if(g3(s))for(let l=0,o=a.length;l<o;++l){let u=this.closureValueIn(a[l],e);if(u!=null){let c=J(this.infos,u.declaration);c!=null&&c.needed!=null?this.refuse(u.range,"a closure captured by a host callback (closures lowering)"):this.hostCallbackCandidates.push(new S_(u.declaration,u.range))}}return}case 13:{let s=r.expressions;for(let a=0,l=s.length;a<l;++a)this.walkExpression(s[a],e,t,a==l-1?i:!1);return}case 14:{let s=r;this.walkExpression(s.expression,e,t,!1),this.walkExpression(s.elementExpression,e,t,!1);return}case 17:{this.walkExpression(r.expression,e,t,!1);return}case 19:{let s=r.args;for(let a=0,l=s.length;a<l;++a)this.walkExpression(s[a],e,t,!1);return}case 22:{this.walkExpression(r.expression,e,t,i);return}case 23:{this.walkExpression(r.expression,e,t,!1);return}case 24:{let s=r;this.walkExpression(s.condition,e,t,!1),this.walkExpression(s.ifThen,e,t,i),this.walkExpression(s.ifElse,e,t,i);return}case 9:{this.walkExpression(r.expression,e,t,i);return}case 31:{this.walkExpression(r.operand,e,t,!1);return}case 32:{this.walkExpression(r.expression,e,t,!1);return}default:return}}capture(r,e,t,i){if(this.captures=!0,r.captured=!0,r.hasInitializer||(r.hasInitFlag=!0),r.isLoopHeader&&(r.isLoopHeaderOf==null?this.refuse(e.range,"a captured for-of or for-in binding (closures lowering)"):r.scope.isLoopHeader=!0),r.type==null){let s=null,a=r.declaration;a.kind==65&&(s=a.initializer);let l=ct(s,r.scope.knownTypes(),0);l!=null?(r.type=l,a.kind==65&&(a.type=l)):this.refuse(e.range,"a captured local without a declared type (closures lowering)")}r.type!=null&&(k_(assert(r.type),this.typeParameters)||k_(assert(r.type),this.classTypeParameters))&&x3(r.scope)&&this.refuse(e.range,"a captured local typed by a type parameter in an async body (closures lowering)"),i&&r.isConst&&this.refuse(e.range,"an assignment to a captured constant (closures lowering)"),t.capturesLocal=!0,t.recordCapture(r.scope),t.recordNeed(r.scope),r.scope.captured.includes(r)||r.scope.captured.push(r)}closureValueIn(r,e){if(r.kind==16)return r;if(r.kind==8){let t=r.text,i=e.resolveFunctionValue(t);if(i!=null)return i;let s=e.resolve(t);if(s!=null&&s.closureValue!=null)return s.closureValue}return null}structClosureIn(r,e){if(r.kind==16){let t=r;return this.structFunctions.has(t)?t:null}if(r.kind==8){let t=r.text,i=e.resolveFunctionValue(t);if(i!=null)return this.structFunctions.has(i)?i:null;let s=e.resolve(t);if(s!=null&&s.closureValue!=null)return s.closureValue}return null}markThis(r,e){let t=new Array,i=e;for(;i!=null&&i.isArrow;)i.usesThis=!0,t.push(i),i=i.parent;t.length>0&&i!=null&&this.thisUses.push(new T_(r,t,i))}makeEnvClasses(){let r=new Array;for(let e=0,t=this.scopes.length;e<t;++e){let i=this.scopes[e];i.className!=null&&r.push(this.makeEnvClass(i))}return r}envTypeArgs(r){let e=this.envTypeParameters,t=e.length;if(t==0)return null;let i=new Array(t);for(let s=0;s<t;++s)i[s]=y.createNamedType(y.createSimpleTypeName(e[s],r),null,!1,r);return i}makeEnvClass(r){let e=new Array,t=r.range,i=r.captured;if(r.needsThis){let o=assert(this.ownerThisType);e.push(y.createFieldDeclaration(y.createIdentifierExpression(Ei,t),null,262144,o,y.createCallExpression(y.createIdentifierExpression("changetype",t),[o],[y.createIntegerLiteralExpression(i64_new(0),t)],t),t))}for(let o=0,u=i.length;o<u;++o){let c=i[o].type,f=null;c!=null&&b3(c)&&(f=y.createCallExpression(y.createIdentifierExpression("changetype",t),[c],[y.createIntegerLiteralExpression(i64_new(0),t)],t)),e.push(y.createFieldDeclaration(y.createIdentifierExpression(i[o].name,t),null,262144,c,f,t))}for(let o=0,u=i.length;o<u;++o)i[o].hasInitFlag&&e.push(y.createFieldDeclaration(y.createIdentifierExpression(hu+i[o].name,t),null,262144,yu("bool",t),null,t));let s=_u(r);if(s!=null&&e.push(y.createFieldDeclaration(y.createIdentifierExpression(da,t),null,262144,y.createNamedType(y.createSimpleTypeName(assert(s.className),t),this.envTypeArgs(t),!0,t),y.createNullExpression(t),t)),r.isLoopHeader||s!=null){let o=assert(r.className),u="source",c="parent",f=new Array;r.isLoopHeader&&f.push(y.createParameter(1,y.createIdentifierExpression(u,t),y.createNamedType(y.createSimpleTypeName(o,t),this.envTypeArgs(t),!0,t),y.createNullExpression(t),t)),s!=null&&f.push(y.createParameter(1,y.createIdentifierExpression(c,t),y.createNamedType(y.createSimpleTypeName(assert(s.className),t),this.envTypeArgs(t),!0,t),y.createNullExpression(t),t));let _=new Array;if(_.push(y.createExpressionStatement(y.createCallExpression(y.createSuperExpression(t),null,[],t))),s!=null){let h;r.isLoopHeader?h=y.createTernaryExpression(y.createBinaryExpression(78,y.createIdentifierExpression(u,t),y.createNullExpression(t),t),this.fieldOn(u,da,t),y.createIdentifierExpression(c,t),t):h=y.createIdentifierExpression(c,t),_.push(y.createExpressionStatement(this.assign(this.fieldOn("this",da,t),h,t)))}let d=new Array,m=new Array;r.needsThis&&m.push(Ei);for(let h=0,b=i.length;h<b;++h)m.push(i[h].name),i[h].hasInitFlag&&m.push(hu+i[h].name);if(r.isLoopHeader)for(let h=0,b=m.length;h<b;++h)d.push(y.createExpressionStatement(this.assign(this.fieldOn("this",m[h],t),this.fieldOn(u,m[h],t),t)));d.length>0&&_.push(y.createIfStatement(y.createBinaryExpression(78,y.createIdentifierExpression(u,t),y.createNullExpression(t),t),y.createBlockStatement(d,t),null,t)),e.push(y.createMethodDeclaration(y.createConstructorExpression(t),null,786432,null,y.createFunctionType(f,yu("void",t),null,!1,t),y.createBlockStatement(_,t),t))}let a=null,l=this.envTypeParameters;if(l.length>0){a=new Array(l.length);for(let o=0,u=l.length;o<u;++o)a[o]=y.createTypeParameter(y.createIdentifierExpression(l[o],t),null,null,t)}return y.createClassDeclaration(y.createIdentifierExpression(assert(r.className),t),null,a!=null?65536:0,a,yu("TaskEnv",t),null,e,t)}rewrite(){let r=assert(this.infos.get(this.owner));this.rewriteFunctionBody(r)}rewriteFunctionBody(r){let e=r.node.body;if(e==null)return;let t=assert(r.ownsScope),i,s=null;e.kind==34?i=e.statements:(s=e,i=[s]);let a=this.rewriteStatements(i,t,r.node);if(s!=null)if(a.length==1&&a[0].kind==42)r.node.body=a[0];else{let l=new Array,o=null;if(a.length!=0){let u=a.length-1;o=a[u];for(let c=0;c<u;++c)l.push(a[c])}o!=null&&o.kind==42?l.push(y.createReturnStatement(o.expression,o.range)):o!=null&&l.push(o),r.node.body=y.createBlockStatement(l,s.range)}else{let l=e;l.statements.length=0;for(let o=0,u=a.length;o<u;++o)l.statements.push(a[o])}}rewriteStatements(r,e,t,i=null){let s=new Array;if(e.localName!=null){s.push(this.makeEnvAllocation(e)),e.needsThis&&s.push(y.createExpressionStatement(this.assign(this.fieldOn(assert(e.localName),Ei,e.range),y.createThisExpression(e.range),e.range)));let a=e.captured;for(let l=0,o=a.length;l<o;++l){let u=a[l];u.isParam&&s.push(y.createExpressionStatement(this.assign(this.fieldOf(e,u,e.range),y.createIdentifierExpression(u.name,e.range),e.range)))}}for(let a=0,l=r.length;a<l;++a){let o=this.rewriteStatement(r[a],e,t,i);o!=null&&s.push(o)}return s}makeEnvAllocation(r){let e=assert(r.className),t=new Array;r.isLoopHeader&&t.push(y.createNullExpression(r.range));let i=_u(r);return i!=null&&t.push(i.ownerFunction===r.ownerFunction?y.createIdentifierExpression(assert(i.localName),r.range):y.createIdentifierExpression(du,r.range)),y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(assert(r.localName),r.range),null,16,y.createNamedType(y.createSimpleTypeName(e,r.range),this.envTypeArgs(r.range),!1,r.range),y.createNewExpression(y.createSimpleTypeName(e,r.range),this.envTypeArgs(r.range),t,r.range),r.range)],r.range)}rewriteStatement(r,e,t,i=null){switch(r.kind){case 34:{let s=r,a=J(this.scopeOfBlock,s),l=a??e,o=this.rewriteStatements(s.statements,l,t,i);return y.createBlockStatement(o,s.range)}case 51:{let s=r,a=new Array,l=new Array,o=s.declarations;for(let u=0,c=o.length;u<c;++u){let f=o[u],_=J(this.bindingOf,f);if(_!=null&&_.captured){let m=f.initializer;m!=null&&l.push(y.createExpressionStatement(this.assign(this.fieldOf(_.scope,_,f.name.range),this.rewriteExpression(m,e,t),f.range)));continue}let d=f.initializer;d!=null&&(f.initializer=this.rewriteExpression(d,e,t)),a.push(f)}return a.length>0&&l.unshift(y.createVariableStatement(s.decorators,a,s.range)),l.length==0?null:l.length==1?l[0]:y.createBlockStatement(l,s.range)}case 42:{let s=r;return y.createExpressionStatement(this.rewriteExpression(s.expression,e,t))}case 47:{let s=r,a=s.value;return y.createReturnStatement(a!=null?this.rewriteExpression(a,e,t):null,s.range)}case 45:{let s=r;return y.createIfStatement(this.rewriteExpression(s.condition,e,t),assert(this.rewriteStatement(s.ifTrue,e,t,i)),s.ifFalse!=null?this.rewriteStatement(assert(s.ifFalse),e,t,i):null,s.range)}case 53:{let s=r;return y.createWhileStatement(this.rewriteExpression(s.condition,e,t),assert(this.rewriteStatement(s.body,e,t,null)),s.range)}case 37:{let s=r;return y.createDoStatement(assert(this.rewriteStatement(s.body,e,t,null)),this.rewriteExpression(s.condition,e,t),s.range)}case 43:{let s=r,a=J(this.scopeOfLoop,s),l=a??e;if(!(a!=null&&a.localName!=null&&a.isLoopHeader)){let u=s.initializer;return y.createForStatement(u!=null?this.rewriteStatement(u,l,t):null,s.condition!=null?this.rewriteExpression(assert(s.condition),l,t):null,s.incrementor!=null?this.rewriteExpression(assert(s.incrementor),l,t):null,assert(this.rewriteStatement(s.body,l,t,null)),s.range)}return this.rewriteHeaderLoop(s,assert(a),t)}case 44:{let s=r,a=this.rewriteStatement(s.variable,e,t);return y.createForOfStatement(assert(a),this.rewriteExpression(s.iterable,e,t),assert(this.rewriteStatement(s.body,e,t)),s.range)}case 48:{let s=r,a=new Array,l=s.cases;for(let o=0,u=l.length;o<u;++o){let c=l[o],f=e,_=new Array;for(let d=0,m=c.statements.length;d<m;++d){let h=this.rewriteStatement(c.statements[d],f,t);h!=null&&_.push(h)}a.push(y.createSwitchCase(c.label!=null?this.rewriteExpression(assert(c.label),e,t):null,_,c.range))}return y.createSwitchStatement(this.rewriteExpression(s.condition,e,t),a,s.range)}case 50:{let s=r,a=new Array;for(let f=0,_=s.bodyStatements.length;f<_;++f){let d=this.rewriteStatement(s.bodyStatements[f],e,t);d!=null&&a.push(d)}let l=null,o=s.catchStatements;if(o!=null){l=new Array;for(let f=0,_=o.length;f<_;++f){let d=this.rewriteStatement(o[f],e,t);d!=null&&l.push(d)}}let u=null,c=s.finallyStatements;if(c!=null){u=new Array;for(let f=0,_=c.length;f<_;++f){let d=this.rewriteStatement(c[f],e,t);d!=null&&u.push(d)}}return y.createTryStatement(a,s.catchVariable,l,u,s.range)}case 36:return i==null?r:y.createBlockStatement([i,y.createContinueStatement(r.label,r.range)],r.range);case 49:{let s=r;return y.createThrowStatement(this.rewriteExpression(s.value,e,t),s.range)}default:return r}}rewriteHeaderLoop(r,e,t){let i=new Array;i.push(this.makeEnvAllocation(e)),e.needsThis&&i.push(y.createExpressionStatement(this.assign(this.fieldOn(assert(e.localName),Ei,r.range),y.createThisExpression(r.range),r.range)));let s=null,a=r.initializer;if(a!=null)if(a.kind==51){let f=a,_=new Array,d=f.declarations;for(let m=0,h=d.length;m<h;++m){let b=d[m],A=J(this.bindingOf,b);if(A!=null&&A.captured){let S=b.initializer;S!=null&&i.push(y.createExpressionStatement(this.assign(this.fieldOf(e,A,b.name.range),this.rewriteExpression(S,e,t),b.range)))}else{let S=b.initializer;S!=null&&(b.initializer=this.rewriteExpression(S,e,t)),_.push(b)}}_.length>0&&(s=y.createVariableStatement(f.decorators,_,f.range))}else s=this.rewriteStatement(a,e,t,null);let l=this.rewriteStatement(r.body,e,t,this.makeCloneStatement(e)),o=assert(l),u=o.kind==34?o.statements:[o];u.push(this.makeCloneStatement(e));let c=y.createForStatement(s,r.condition!=null?this.rewriteExpression(assert(r.condition),e,t):null,r.incrementor!=null?this.rewriteExpression(assert(r.incrementor),e,t):null,y.createBlockStatement(u,r.body.range),r.range);return i.push(c),y.createBlockStatement(i,r.range)}makeCloneStatement(r){let e=assert(r.localName),t=assert(r.className);return y.createExpressionStatement(this.assign(y.createIdentifierExpression(e,r.range),y.createNewExpression(y.createSimpleTypeName(t,r.range),this.envTypeArgs(r.range),[y.createIdentifierExpression(e,r.range)],r.range),r.range))}rewriteExpression(r,e,t){switch(r.kind){case 26:{let i=J(this.thisRefs,r);return i==null?r:this.fieldFrom(this.envExprForScope(i,t,r.range),Ei,r.range)}case 8:{let i=r,s=J(this.refs,i);if(s==null)return r;let a=this.fieldOfFor(s,t,i.range);return s.hasInitFlag?y.createCommaExpression([this.guard(s,a,t,i.range),a],i.range):a}case 10:{let i=r;if(Lx(i.operator)&&i.left.kind==8){let s=i.left,a=J(this.refs,s);if(a!=null){let l=this.fieldOfFor(a,t,i.left.range),o=this.rewriteExpression(i.right,e,t);if(i.operator==102)return a.hasInitFlag?y.createCommaExpression([this.assign(this.flagField(a,t,i.range),y.createTrueExpression(i.range),i.range),this.assign(l,o,i.range)],i.range):this.assign(l,o,i.range);let u=new Array;return a.hasInitFlag&&(u.push(this.guard(a,l,t,i.range)),u.push(this.assign(this.flagField(a,t,i.range),y.createTrueExpression(i.range),i.range))),u.push(y.createBinaryExpression(i.operator,l,o,i.range)),u.length==1?u[0]:y.createCommaExpression(u,i.range)}}return y.createBinaryExpression(i.operator,this.rewriteExpression(i.left,e,t),this.rewriteExpression(i.right,e,t),i.range)}case 30:{let i=r,s=i.operand.kind==8?J(this.refs,i.operand):null;if(s!=null){let a=this.fieldOfFor(s,t,i.range),l=new Array;return s.hasInitFlag&&(l.push(this.guard(s,a,t,i.range)),l.push(this.assign(this.flagField(s,t,i.range),y.createTrueExpression(i.range),i.range))),l.push(y.createUnaryPrefixExpression(i.operator,a,i.range)),l.length==1?l[0]:y.createCommaExpression(l,i.range)}return y.createUnaryPrefixExpression(i.operator,this.rewriteExpression(i.operand,e,t),i.range)}case 29:{let i=r,s=i.operand.kind==8?J(this.refs,i.operand):null;if(s!=null){let a=this.fieldOfFor(s,t,i.range),l=new Array;return s.hasInitFlag&&(l.push(this.guard(s,a,t,i.range)),l.push(this.assign(this.flagField(s,t,i.range),y.createTrueExpression(i.range),i.range))),l.push(y.createUnaryPostfixExpression(i.operator,a,i.range)),l.length==1?l[0]:y.createCommaExpression(l,i.range)}return y.createUnaryPostfixExpression(i.operator,this.rewriteExpression(i.operand,e,t),i.range)}case 11:{let i=r,s=new Array;for(let a=0,l=i.args.length;a<l;++a)s.push(this.rewriteExpression(i.args[a],e,t));return y.createCallExpression(this.rewriteExpression(i.expression,e,t),i.typeArguments,s,i.range)}case 16:{let i=r,s=J(this.infos,i.declaration);if(s!=null){this.rewriteFunctionBody(s);let a=s.needed;if(a!=null){let l=assert(a.className),o=s.bodyParent!=null?assert(s.bodyParent).className:null;On().set(i,new ts(2,l,s.ownEnv,!0,o,a.needsThis));let u=a.ownerFunction===t?a:null;qr().set(i,u!=null?assert(u.localName):du)}}return r}case 18:{let i=r;switch(i.literalKind){case 3:{let s=i.expressions;for(let a=0,l=s.length;a<l;++a)s[a]=this.rewriteExpression(s[a],e,t);break}case 5:{let s=i.elementExpressions;for(let a=0,l=s.length;a<l;++a)s[a]=this.rewriteExpression(s[a],e,t);break}case 6:{let s=i.values;for(let a=0,l=s.length;a<l;++a)s[a]=this.rewriteExpression(s[a],e,t);break}default:break}return i}case 13:{let i=r,s=new Array;for(let a=0,l=i.expressions.length;a<l;++a)s.push(this.rewriteExpression(i.expressions[a],e,t));return y.createCommaExpression(s,i.range)}case 14:{let i=r;return y.createElementAccessExpression(this.rewriteExpression(i.expression,e,t),this.rewriteExpression(i.elementExpression,e,t),i.range)}case 17:{let i=r;return y.createInstanceOfExpression(this.rewriteExpression(i.expression,e,t),i.isType,i.range)}case 19:{let i=r,s=new Array;for(let a=0,l=i.args.length;a<l;++a)s.push(this.rewriteExpression(i.args[a],e,t));return y.createNewExpression(i.typeName,i.typeArguments,s,i.range)}case 22:{let i=r;return y.createParenthesizedExpression(this.rewriteExpression(i.expression,e,t),i.range)}case 23:{let i=r;return y.createPropertyAccessExpression(this.rewriteExpression(i.expression,e,t),i.property,i.range)}case 24:{let i=r;return y.createTernaryExpression(this.rewriteExpression(i.condition,e,t),this.rewriteExpression(i.ifThen,e,t),this.rewriteExpression(i.ifElse,e,t),i.range)}case 9:{let i=r;return i.expression=this.rewriteExpression(i.expression,e,t),i}case 31:{let i=r;return i.operand=this.rewriteExpression(i.operand,e,t),i}case 32:{let i=r;return i.expression=this.rewriteExpression(i.expression,e,t),i}default:return r}}fieldOfFor(r,e,t){return this.fieldFrom(this.envExprFor(r,e,t),r.name,t)}envExprFor(r,e,t){return this.envExprForScope(r.scope,e,t)}envExprForScope(r,e,t){if(r.ownerFunction===e)return y.createIdentifierExpression(assert(r.localName),t);let i=assert(this.infos.get(e)),s=assert(i.needed),a=y.createIdentifierExpression(du,t),l=s;for(;l!==r;)a=y.createAssertionExpression(2,this.fieldFrom(a,da,t),null,t),l=assert(_u(l));return a}fieldFrom(r,e,t){return y.createPropertyAccessExpression(r,y.createIdentifierExpression(e,t),t)}fieldOf(r,e,t){return this.fieldOn(assert(r.localName),e.name,t)}fieldOn(r,e,t){return y.createPropertyAccessExpression(y.createIdentifierExpression(r,t),y.createIdentifierExpression(e,t),t)}flagField(r,e,t){return this.fieldFrom(this.envExprFor(r,e,t),hu+r.name,t)}guard(r,e,t,i){return y.createCallExpression(y.createIdentifierExpression(d3,i),[assert(r.type)],[e,this.flagField(r,t,i),y.createStringLiteralExpression(r.name,i)],i)}assign(r,e,t){return y.createBinaryExpression(102,r,e,t)}};function yu(n,r){return y.createNamedType(y.createSimpleTypeName(n,r),null,!1,r)}function g3(n){let r=n.expression;return(r.kind==8?r.text:r.kind==23?r.property.text:"")=="makeCallbacks"}function Lx(n){switch(n){case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 113:case 114:return!0;default:return!1}}function b3(n){if(n.kind!=1)return!0;let r=n,e=r.typeArguments;if(e!=null&&e.length>0)return!0;let t=r.name.identifier.text;return!(t=="i8"||t=="i16"||t=="i32"||t=="i64"||t=="u8"||t=="u16"||t=="u32"||t=="u64"||t=="isize"||t=="usize"||t=="bool"||t=="f32"||t=="f64"||t=="v128")}function x3(n){let r=n;for(;r!=null;){if(r.ownerFunction.isAsync)return!0;r=r.parent}return!1}function k_(n,r){if(r.size==0)return!1;if(n.kind==1){let e=n;if(r.has(e.name.identifier.text))return!0;let t=e.typeArguments;if(t!=null){for(let i=0,s=t.length;i<s;++i)if(k_(t[i],r))return!0}}return!1}var E3="$lazyDone",A3="$lazyTask",T3="spawn",w_=class{constructor(r,e,t,i,s){this.name=r;this.doneName=e;this.awaitOperand=t;this.declaration=i;this.range=s;this.taskName=null;this.taskCall=null}},xu=class{afterParse(r){this.parser=r;let e=this.program.sources;for(let t=0,i=e.length;t<i;++t){let s=e[t];s.isLibrary||this.walkFunctions(s.statements)}}walkFunctions(r){for(let e=0,t=r.length;e<t;++e){let i=r[e];switch(i.kind){case 59:{this.rewriteBodyStatement(i.body);break}case 55:{let s=i.members;if(s!=null)for(let a=0,l=s.length;a<l;++a){let o=s[a];(o.kind==62||o.kind==59)&&this.rewriteBodyStatement(o.body)}break}case 63:{this.walkFunctions(i.members);break}case 40:{let s=i.declaration;s!=null&&this.walkFunctions([s]);break}default:break}}}rewriteBodyStatement(r){r==null||r.kind!=34||this.rewriteBody(r)}rewriteBody(r){if(r==null)return;let e=r.statements;r.statements=this.rewriteList(e,new Map),this.walkFunctions(r.statements),this.rewriteNestedFunctionExpressions(r.statements)}rewriteList(r,e){let t=new Array;for(let i=0,s=r.length;i<s;++i){let a=r[i];if(a.kind==42){let o=a,u=o.expression;if(F_(u)){this.parser.warning(6401,u.range);let c=bu(u);c!=null&&(o.expression=c)}}else if(a.kind==51){let o=a.declarations;for(let u=0,c=o.length;u<c;++u){let f=o[u].initializer;if(f!=null&&F_(f)){let _=bu(f);_!=null&&(o[u].initializer=_)}}}if(a.kind==51){let o=this.rewriteDeclaration(a,e);if(o!=null){for(let u=0,c=o.length;u<c;++u)t.push(o[u]);continue}}this.recurseInto(a,e);let l=this.collectOwnReads(a,e,new Array);for(let o=0,u=l.length;o<u;++o)t.push(this.makeGuard(assert(J(e,l[o])),a.range));t.push(a)}return t}rewriteDeclaration(r,e){let t=r.declarations,i=null,s=null;for(let o=0,u=t.length;o<u;++o){let c=t[o],f=c.initializer;if(f==null||f.kind!=32)continue;let _=f;if(_.expression.kind!=31)continue;if(t.length!=1)return this.parser.error(100,c.range,"a '@lazy await' binding in a multi-declarator statement"),this.degrade(c,_),null;let d=c.type;if(d==null)return this.parser.error(6399,c.name.range,c.name.text),this.degrade(c,_),null;let m=c.name.text;if(J(e,m)!=null)return this.parser.error(100,c.name.range,"a redeclared '@lazy await' binding in one block"),null;let h=m+E3,b=_.expression.operand,A=null;if(F_(b)){if(bu(b)==null)return this.parser.error(100,b.range,"a 'spawn' whose argument is not a call or a function name"),this.degrade(c,_),null;A=m+A3,b=y.createIdentifierExpression(A,b.range)}s=new w_(m,h,b,c,c.range),s.taskName=A,A!=null&&(s.taskCall=bu(_.expression.operand)),i=y.createVariableDeclaration(c.name,c.decorators,c.flags,d,null,c.range);break}if(s==null||i==null)return null;e.set(s.name,s);let a=new Array,l=s.taskName;if(l!=null){let o=y.createNamedType(y.createSimpleTypeName("Task",s.range),[assert(s.declaration.type)],!1,s.range);a.push(y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(l,s.range),null,16,o,s.taskCall,s.range)],s.range))}return a.push(y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(s.doneName,s.range),null,16,null,y.createFalseExpression(s.range),s.range)],s.range)),a.push(y.createVariableStatement(null,[i],r.range)),a}degrade(r,e){let t=e.expression;r.initializer=t.kind==31?t.operand:t}makeGuard(r,e){let t=y.createIdentifierExpression(r.doneName,e);return y.createIfStatement(y.createUnaryPrefixExpression(96,t,e),y.createBlockStatement([y.createExpressionStatement(y.createBinaryExpression(102,y.createIdentifierExpression(r.name,e),y.createAwaitExpression(r.awaitOperand,e),e)),y.createExpressionStatement(y.createBinaryExpression(102,y.createIdentifierExpression(r.doneName,e),y.createTrueExpression(e),e))],e),null,e)}recurseInto(r,e){switch(r.kind){case 34:{let t=r;t.statements=this.rewriteList(t.statements,e);break}case 45:{let t=r;t.ifTrue=this.rewriteSingleBody(t.ifTrue,e),t.ifFalse!=null&&(t.ifFalse=this.rewriteSingleBody(assert(t.ifFalse),e));break}case 53:{let t=r;t.body=this.rewriteSingleBody(t.body,e);break}case 37:{let t=r;t.body=this.rewriteSingleBody(t.body,e);break}case 43:{let t=r;t.body=this.rewriteSingleBody(t.body,e);break}case 44:{let t=r;t.body=this.rewriteSingleBody(t.body,e);break}case 48:{let i=r.cases;for(let s=0,a=i.length;s<a;++s){let l=i[s];l.statements=this.rewriteList(l.statements,e)}break}case 50:{let t=r;t.bodyStatements=this.rewriteList(t.bodyStatements,e);let i=t.catchStatements;i!=null&&(t.catchStatements=this.rewriteList(i,e));let s=t.finallyStatements;s!=null&&(t.finallyStatements=this.rewriteList(s,e));break}default:break}}rewriteSingleBody(r,e){if(r.kind==34)return this.recurseInto(r,e),r;let t=this.rewriteList([r],e);return t.length==1?t[0]:y.createBlockStatement(t,r.range)}collectOwnReads(r,e,t){switch(r.kind){case 42:{this.collectReads(r.expression,e,t);break}case 51:{let i=r.declarations;for(let s=0,a=i.length;s<a;++s){let l=i[s].initializer;l!=null&&this.collectReads(l,e,t)}break}case 47:{let i=r.value;i!=null&&this.collectReads(i,e,t);break}case 45:{this.collectReads(r.condition,e,t);break}case 53:{this.collectReads(r.condition,e,t);break}case 37:{this.collectReads(r.condition,e,t);break}case 43:{let i=r,s=i.initializer;s!=null&&s.kind!=51&&this.collectOwnReads(s,e,t);let a=i.condition;a!=null&&this.collectReads(a,e,t);let l=i.incrementor;l!=null&&this.collectReads(l,e,t);break}case 48:{this.collectReads(r.condition,e,t);break}case 49:{this.collectReads(r.value,e,t);break}case 52:{this.collectReads(r.expression,e,t);break}default:break}return t}collectReads(r,e,t){switch(r.kind){case 8:{let i=r.text;J(e,i)!=null&&!t.includes(i)&&t.push(i);break}case 11:{let i=r;this.collectReads(i.expression,e,t);let s=i.args;for(let a=0,l=s.length;a<l;++a)this.collectReads(s[a],e,t);break}case 10:{let i=r;this.collectReads(i.left,e,t),this.collectReads(i.right,e,t);break}case 30:{this.collectReads(r.operand,e,t);break}case 29:{this.collectReads(r.operand,e,t);break}case 13:{let s=r.expressions;for(let a=0,l=s.length;a<l;++a)this.collectReads(s[a],e,t);break}case 24:{let i=r;this.collectReads(i.condition,e,t),this.collectReads(i.ifThen,e,t),this.collectReads(i.ifElse,e,t);break}case 23:{this.collectReads(r.expression,e,t);break}case 14:{let i=r;this.collectReads(i.expression,e,t),this.collectReads(i.elementExpression,e,t);break}case 9:{this.collectReads(r.expression,e,t);break}case 22:{this.collectReads(r.expression,e,t);break}case 31:{this.collectReads(r.operand,e,t);break}case 32:{this.collectReads(r.expression,e,t);break}case 19:{let s=r.args;if(s!=null)for(let a=0,l=s.length;a<l;++a)this.collectReads(s[a],e,t);break}case 17:{this.collectReads(r.expression,e,t);break}case 16:{let i=new Array;this.collectReadsInFunctionBody(r,e,i);for(let s=0,a=i.length;s<a;++s)this.parser.error(6400,r.range,i[s]);break}default:break}}collectReadsInFunctionBody(r,e,t){let i=r.declaration.body;if(i==null||i.kind!=34)return;let s=i.statements;for(let a=0,l=s.length;a<l;++a)this.collectOwnReads(s[a],e,t),this.recurseCollect(s[a],e,t)}recurseCollect(r,e,t){switch(r.kind){case 34:{let i=r.statements;for(let s=0,a=i.length;s<a;++s)this.collectOwnReads(i[s],e,t),this.recurseCollect(i[s],e,t);break}case 45:{let i=r;this.recurseCollect(i.ifTrue,e,t),i.ifFalse!=null&&this.recurseCollect(assert(i.ifFalse),e,t);break}case 53:{this.recurseCollect(r.body,e,t);break}case 37:{this.recurseCollect(r.body,e,t);break}case 43:{this.recurseCollect(r.body,e,t);break}case 44:{this.recurseCollect(r.body,e,t);break}case 48:{let i=r.cases;for(let s=0,a=i.length;s<a;++s){let l=i[s].statements;for(let o=0,u=l.length;o<u;++o)this.recurseCollect(l[o],e,t)}break}default:break}}rewriteNestedFunctionExpressions(r){for(let e=0,t=r.length;e<t;++e){let i=r[e];if(i.kind==51){let s=i.declarations;for(let a=0,l=s.length;a<l;++a){let o=s[a].initializer;if(o!=null&&o.kind==16){let u=o.declaration.body;u!=null&&u.kind==34&&this.rewriteBody(u)}}}}}};function F_(n){if(n.kind!=11)return!1;let r=n.expression;return r.kind==8&&r.text==T3}function bu(n){let r=n.args;if(r.length!=1)return null;let e=r[0];return e.kind==11?e:e.kind==8?y.createCallExpression(e,null,[],n.range):null}var xa="async arrow functions (async lowering)",Ea="async function expressions (async lowering)",Bx="an async function nested in a non-async body (async lowering)",S3="an async export default function (async lowering)";function Mx(n,r,e){Tn(n.statements,r,e)}function Tn(n,r,e){for(let t=0,i=n.length;t<i;++t)pt(n[t],r,e)}function pt(n,r,e){switch(n.kind){case 59:case 62:{zx(n,r,e);return}case 55:{Dx(n,r,e);return}case 63:{Tn(n.members,r,e);return}case 34:{Tn(n.statements,r,e);return}case 37:{let t=n;pt(t.body,r,e),se(t.condition,r,e);return}case 42:{let t=n.expression;if(t.kind==16){let i=t.declaration;if(i.isAsync&&i.arrowKind==0){Eu(r,t,Bx,e);return}}se(t,r,e);return}case 43:{let t=n,i=t.initializer;i!=null&&pt(i,r,e);let s=t.condition;s!=null&&se(s,r,e);let a=t.incrementor;a!=null&&se(a,r,e),pt(t.body,r,e);return}case 44:{let t=n;pt(t.variable,r,e),se(t.iterable,r,e),pt(t.body,r,e);return}case 45:{let t=n;se(t.condition,r,e),pt(t.ifTrue,r,e);let i=t.ifFalse;i!=null&&pt(i,r,e);return}case 47:{let t=n.value;t!=null&&se(t,r,e);return}case 48:{let t=n;se(t.condition,r,e);let i=t.cases;for(let s=0,a=i.length;s<a;++s){let l=i[s].label;l!=null&&se(l,r,e),Tn(i[s].statements,r,e)}return}case 49:{se(n.value,r,e);return}case 50:{let t=n;Tn(t.bodyStatements,r,e);let i=t.catchStatements;i!=null&&Tn(i,r,e);let s=t.finallyStatements;s!=null&&Tn(s,r,e);return}case 51:{let t=n.declarations;for(let i=0,s=t.length;i<s;++i){let a=t[i];Ai(a.decorators,r,e);let l=a.initializer;l!=null&&se(l,r,e)}return}case 52:{se(n.expression,r,e);return}case 53:{let t=n;se(t.condition,r,e),pt(t.body,r,e);return}case 56:{let t=n.values;for(let i=0,s=t.length;i<s;++i)pt(t[i],r,e);return}case 57:{let t=n.initializer;t!=null&&se(t,r,e);return}case 58:{let t=n;Ai(t.decorators,r,e);let i=t.initializer;i!=null&&se(i,r,e);return}case 40:{let t=n.declaration;if(t.kind==59&&t.isAsync){Eu(r,t,S3,e);return}pt(t,r,e);return}default:return}}function zx(n,r,e){if(n.isAsync){Eu(r,n,Bx,e);return}Ai(n.decorators,r,e);let t=n.signature.parameters;for(let s=0,a=t.length;s<a;++s){let l=t[s].initializer;l!=null&&se(l,r,e)}let i=n.body;i!=null&&pt(i,r,e)}function Dx(n,r,e){Ai(n.decorators,r,e);let t=n.members;for(let i=0,s=t.length;i<s;++i){let a=t[i];switch(a.kind){case 59:case 62:{zx(a,r,e);break}case 58:{let l=a;Ai(l.decorators,r,e);let o=l.initializer;o!=null&&se(o,r,e);break}default:break}}}function Ai(n,r,e){if(n!=null)for(let t=0,i=n.length;t<i;++t){let s=n[t];se(s.name,r,e);let a=s.args;if(a!=null)for(let l=0,o=a.length;l<o;++l)se(a[l],r,e)}}function se(n,r,e){switch(n.kind){case 16:{let t=n,i=t.declaration;if(i.isAsync){Eu(r,t,i.arrowKind!=0?xa:Ea,e);return}Ai(i.decorators,r,e);let s=i.signature.parameters;for(let l=0,o=s.length;l<o;++l){let u=s[l].initializer;u!=null&&se(u,r,e)}let a=i.body;a!=null&&pt(a,r,e);return}case 12:{Dx(n.declaration,r,e);return}case 9:{se(n.expression,r,e);return}case 31:{se(n.operand,r,e);return}case 10:{let t=n;se(t.left,r,e),se(t.right,r,e);return}case 11:{let t=n;se(t.expression,r,e);let i=t.args;for(let s=0,a=i.length;s<a;++s)se(i[s],r,e);return}case 13:{let t=n.expressions;for(let i=0,s=t.length;i<s;++i)se(t[i],r,e);return}case 14:{let t=n;se(t.expression,r,e),se(t.elementExpression,r,e);return}case 17:{se(n.expression,r,e);return}case 19:{let t=n.args;for(let i=0,s=t.length;i<s;++i)se(t[i],r,e);return}case 22:{se(n.expression,r,e);return}case 23:{se(n.expression,r,e);return}case 24:{let t=n;se(t.condition,r,e),se(t.ifThen,r,e),se(t.ifElse,r,e);return}case 29:{se(n.operand,r,e);return}case 30:{se(n.operand,r,e);return}case 18:{let t=n;switch(t.literalKind){case 3:{let i=t.expressions;for(let s=0,a=i.length;s<a;++s)se(i[s],r,e);return}case 5:{let i=t.elementExpressions;for(let s=0,a=i.length;s<a;++s)se(i[s],r,e);return}case 6:{let i=t.values;for(let s=0,a=i.length;s<a;++s)se(i[s],r,e);return}default:return}}default:return}}function Eu(n,r,e,t){t!=null&&t.has(r.range.start)||n.error(100,r.range,e)}var v3="$State",I3="$resume",Gx="TaskState",Ux="TaskEnv",k3="__taskPark",F3="__taskSettled",w3="__taskRegister",R3="__asyncZero",jx="__taskComplete",C3="__taskCompleteResult",Vx="_record",Qx="$awaited",P3="__taskRegistered",wu="resumePoint",vu="handle",N3="resume",In="$env",Si="$closureEnv",Au="$closureEnvIn",Fa="$this",R_="$parent",Ox="$cond",wa=class{constructor(){this.refusals=null;this.currentConstruct=null}afterParse(r){let e=this.program.sources;for(let t=0,i=e.length;t<i;++t){let s=e[t];if(this.program.stdSources.has(s))continue;this.lowerStatementList(s,s.statements,r);let a=this.refusals,l=a!=null?J(a,s):null;Mx(s,r,l??null)}}lowerStatementList(r,e,t){if(!z3(e))return;let i=new Array;for(let a=0,l=e.length;a<l;++a){let o=D3(e[a]);o!=null&&i.push(o)}let s=new Array;for(let a=0,l=e.length;a<l;++a){let o=e[a];switch(o.kind){case 59:{let u=o;if(u.isAsync){let c=new Array,f=this.lowerAsyncFunction(r,u,i,t,c);if(f){for(let _=0,d=f.length;_<d;++_)s.push(f[_]);for(let _=0,d=c.length;_<d;++_)s.push(c[_])}else s.push(o)}else s.push(o);break}case 63:{let u=o;this.lowerStatementList(r,u.members,t),s.push(o);break}case 55:{let u=o,c=this.lowerAsyncMethods(r,u,i,t);for(let f=0,_=c.length;f<_;++f)s.push(c[f]);s.push(o);break}case 51:{let u=o.declarations;for(let c=0,f=u.length;c<f;++c){let _=u[c].initializer;_&&this.refuseAsyncFunctionExpression(_,t)}s.push(o);break}default:{s.push(o);break}}}e.length=0;for(let a=0,l=s.length;a<l;++a)e.push(s[a])}lowerAsyncFunction(r,e,t,i,s,a=null,l=null){let o=this.currentConstruct;this.currentConstruct=e;let u=this.lowerAsyncFunctionInner(r,e,t,i,s,a,l);return this.currentConstruct=o,u==null&&this.recordRefusal(e),u}lowerAsyncFunctionInner(r,e,t,i,s,a,l){let o=e.signature,u=e.name.text,c=e.range;if(e.arrowKind!=0)return this.refuse(i,e.range,xa),null;if(e.typeParameters!=null)return this.refuse(i,e.range,"async generic functions (async lowering)"),null;a==null&&o.explicitThisType!=null&&(a=o.explicitThisType);let f=null;l!=null&&(f=J(On(),l));let _=f??null,d=_!=null&&_.kind==2?_.envClass:null,m=J(sl,e),h=m??null,b=h!=null&&h.ownEnv?h.envClass:null,A=b!=null&&h!=null&&assert(h).hasThis,S=h!=null?h.parentClass:null,k=b!=null&&A,w=!k&&a!=null,R=!k&&!w&&d!=null,C=o.parameters;for(let $=0,le=C.length;$<le;++$){let te=C[$];if(te.parameterKind!=0)return this.refuse(i,te.range,"optional or rest parameters in an async function (async lowering)"),null;if(Kx(te.name.text))return this.refuse(i,te.name.range,"a parameter whose name is reserved by the state struct (async lowering)"),null}let M=o.returnType;if(M==null||j3(M))return this.refuse(i,e.name.range,"an async function without a declared return type (async lowering)"),null;let O=e.body;if(!O||O.kind!=34)return this.refuse(i,e.range,"an async function without a block body (async lowering)"),null;let D=O,Q=w?u+"$ThisEnv":"",H=null;if(w){let $=assert(a),le=y.createFieldDeclaration(y.createIdentifierExpression(Fa,c),null,262144,$,y.createCallExpression(y.createIdentifierExpression("changetype",c),[$],[St(0,c)],c),c),te="source",wi=new Array;wi.push(y.createParameter(0,y.createIdentifierExpression(te,c),$,null,c));let wn=new Array;wn.push(le);let Rn=new Array;if(Rn.push(y.createExpressionStatement(y.createCallExpression(y.createSuperExpression(c),null,[],c))),Rn.push(y.createExpressionStatement(y.createBinaryExpression(102,y.createPropertyAccessExpression(y.createThisExpression(c),y.createIdentifierExpression(Fa,c),c),y.createIdentifierExpression(te,c),c))),d!=null){let Ca="parent";wi.push(y.createParameter(0,y.createIdentifierExpression(Ca,c),ve(d,c),null,c)),wn.push(y.createFieldDeclaration(y.createIdentifierExpression(R_,c),null,262144,y.createNamedType(y.createSimpleTypeName(d,c),null,!0,c),y.createNullExpression(c),c)),Rn.push(y.createExpressionStatement(y.createBinaryExpression(102,y.createPropertyAccessExpression(y.createThisExpression(c),y.createIdentifierExpression(R_,c),c),y.createIdentifierExpression(Ca,c),c)))}let Bu=y.createMethodDeclaration(y.createConstructorExpression(c),null,786432,null,y.createFunctionType(wi,ve("void",c),null,!1,c),y.createBlockStatement(Rn,c),c);wn.push(Bu),H=y.createClassDeclaration(y.createIdentifierExpression(Q,c),null,0,null,ve(Ux,c),null,wn,c)}if(k&&q3(D),k||w){let $=k?assert(b):Q;z_(D.statements,$,O3(D,C))}let U=new V_;Sn(D,U.declaredTypes);let V=new Ru,Y=this.planSeq(i,D.statements,V,!1,r,s,t,U);if(!Y)return null;let q=V.next-1;if(q!=0&&this.liftCreationEnvs(D,U),this.collectLifting(i,Y,U),q!=0){let $=new Set;va(Y,$);for(let le=0,te=C.length;le<te;++le)$.has(C[le].name.text)&&U.liftParameter(C[le].name.text,C[le].name.range)}let ne=u+v3,j=u+I3;for(let $=0,le=t.length;$<le;++$){let te=t[$];if(te==ne||te==j)return this.refuse(i,e.name.range,"an async function whose synthesized name is taken (async lowering)"),null}let ge=new Set;zr(D,ge);let ue=M_(C,D),_e=y.createIdentifierExpression(ue,c),It=y.createThisExpression(c),Fe=new Array;for(let $=0,le=C.length;$<le;++$){let te=C[$];Fe.push(y.createFieldDeclaration(y.createIdentifierExpression(te.name.text,te.name.range),null,262144,te.type,null,te.name.range))}Fe.push(y.createFieldDeclaration(y.createIdentifierExpression(In,c),null,262144,y.createNamedType(y.createSimpleTypeName(Ux,c),null,!0,c),y.createNullExpression(c),c));for(let $=0,le=U.locals.length;$<le;++$){let te=U.locals[$];Fe.push(y.createFieldDeclaration(y.createIdentifierExpression(te.name,te.declaration.name.range),null,262144,te.type,null,te.declaration.name.range))}Fe.push(y.createFieldDeclaration(y.createIdentifierExpression(wu,c),null,262144,ve("i32",c),null,c));let vi=!Q3(M),qt=new Array;Sa(Y,qt);for(let $=0,le=qt.length;$<le;++$)Fe.push(y.createFieldDeclaration(y.createIdentifierExpression(qt[$],c),null,278528,ve("TaskRecord",c),null,c));let Dr=X3(M,c);Fe.push(y.createFieldDeclaration(y.createIdentifierExpression(vu,c),null,278528,Dr,null,c));let kn=new Array,je=new Array;je.push(y.createExpressionStatement(y.createCallExpression(y.createSuperExpression(c),null,[],c)));for(let $=0,le=C.length;$<le;++$){let te=C[$];kn.push(y.createParameter(0,y.createIdentifierExpression(te.name.text,te.name.range),te.type,null,te.range)),je.push(y.createExpressionStatement(Br(It,te.name.text,y.createIdentifierExpression(te.name.text,te.range),te.range)))}je.push(y.createExpressionStatement(Br(It,wu,St(0,c),c)));for(let $=0,le=U.locals.length;$<le;++$){let te=U.locals[$];je.push(y.createExpressionStatement(Br(It,te.name,y.createCallExpression(y.createIdentifierExpression(R3,te.declaration.name.range),[te.type],[],te.declaration.name.range),te.declaration.name.range)))}Fe.push(y.createMethodDeclaration(y.createConstructorExpression(c),null,786432,null,y.createFunctionType(kn,ve("void",c),null,!1,c),y.createBlockStatement(je,c),c));let Fn=y.createClassDeclaration(y.createIdentifierExpression(ne,e.name.range),null,0,null,ve(Gx,c),null,Fe,c),dt=y.createIdentifierExpression(j,c),fr=new Array;for(let $=0,le=C.length;$<le;++$)fr.push(y.createIdentifierExpression(C[$].name.text,C[$].range));let Ii=y.createPropertyAccessExpression(_e,y.createIdentifierExpression(vu,c),c),Oe=new Array;if(Oe.push(y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(ue,c),null,8,ve(ne,c),y.createNewExpression(y.createSimpleTypeName(ne,c),null,fr,c),c)],c)),k){let $=assert(b),le=new Array;S!=null&&(le.push(y.createNullExpression(c)),le.push(y.createIdentifierExpression(Au,c))),Oe.push(y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(Si,c),null,16,ve($,c),y.createNewExpression(y.createSimpleTypeName($,c),null,le,c),c)],c)),A&&Oe.push(y.createExpressionStatement(Br(y.createIdentifierExpression(Si,c),Fa,y.createThisExpression(c),c))),Oe.push(y.createExpressionStatement(Br(_e,In,y.createIdentifierExpression(Si,c),c)))}else if(w){let $=new Array;$.push(y.createThisExpression(c)),d!=null&&$.push(y.createIdentifierExpression(Au,c)),Oe.push(y.createExpressionStatement(Br(_e,In,y.createNewExpression(y.createSimpleTypeName(Q,c),null,$,c),c)))}else R&&Oe.push(y.createExpressionStatement(Br(_e,In,y.createIdentifierExpression(Au,c),c)));Oe.push(y.createExpressionStatement(Br(_e,vu,y.createNewExpression(y.createSimpleTypeName("Task",c),[M],[],c),c))),Oe.push(y.createExpressionStatement(y.createBinaryExpression(102,y.createPropertyAccessExpression(Ii,y.createIdentifierExpression(Vx,c),c),y.createCallExpression(y.createIdentifierExpression(w3,c),null,[_e],c),c))),Oe.push(y.createIfStatement(y.createUnaryPrefixExpression(96,y.createCallExpression(y.createIdentifierExpression(P3,c),null,[_e],c),c),y.createBlockStatement([y.createReturnStatement(Ii,c)],c),null,c)),Oe.push(y.createExpressionStatement(y.createBinaryExpression(102,y.createPropertyAccessExpression(_e,y.createIdentifierExpression(N3,c),c),y.createCallExpression(y.createIdentifierExpression("changetype",c),[y.createFunctionType([y.createParameter(0,y.createIdentifierExpression("state",c),ve(Gx,c),null,c)],ve("void",c),null,!1,c)],[dt],c),c))),Oe.push(y.createExpressionStatement(y.createCallExpression(dt,null,[_e],c))),Oe.push(y.createReturnStatement(Ii,c)),e.body=y.createBlockStatement(Oe,c),e.signature.returnType=Dr,e.isAsync=!1;let ht=M_(C,D),ki=new Array;Ia(Y,ki);for(let $=0,le=ki.length;$<le;++$){let te=ki[$];lu().set(te.node,new au(te.discriminator,K3(ht,te.fieldName,te.node.range)))}let Wt=new Array,Fi=y.createPropertyAccessExpression(y.createIdentifierExpression(ht,c),y.createIdentifierExpression(In,c),c),Cu=k?assert(b):Q,Pu=y.createCallExpression(y.createIdentifierExpression("changetype",c),[ve(Cu,c)],[Fi],c),Nu=R?Fi:y.createAssertionExpression(2,y.createPropertyAccessExpression(Pu,y.createIdentifierExpression(R_,c),c),null,c);if(d!=null){let $=ve(d,c);Wt.push(y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(Au,c),null,8,$,y.createCallExpression(y.createIdentifierExpression("changetype",c),[$],[Nu],c),c)],c))}if(k){let $=assert(b);Wt.push(y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(Si,c),null,8,ve($,c),y.createCallExpression(y.createIdentifierExpression("changetype",c),[ve($,c)],[Fi],c),c)],c))}for(let $=0,le=C.length;$<le;++$){let te=C[$];Wt.push(Wx(te.name.text,te.name.range,ht))}for(let $=0,le=U.locals.length;$<le;++$){let te=U.locals[$];Wt.push(Wx(te.name,te.declaration.name.range,ht))}let Lu=new B_(U,ht,q+1,vi,ge,M,q!=0);if(Ti(Wt,this.emitSeq(Y,Lu)),!M3(Y)){let $=new Array;$.push(y.createExpressionStatement(Fu(ht,St(q+1,c),c))),$.push(y.createExpressionStatement(y.createCallExpression(y.createIdentifierExpression(jx,c),null,[y.createIdentifierExpression(ht,c)],c))),Wt.push(y.createIfStatement(cr(He(ht,c),c),y.createBlockStatement($,c),null,c))}let Ra=y.createFunctionDeclaration(y.createIdentifierExpression(j,e.name.range),null,0,null,y.createFunctionType([y.createParameter(0,y.createIdentifierExpression(ht,c),ve(ne,c),null,c)],ve("void",c),null,!1,c),y.createBlockStatement(Wt,c),0,c);return H!=null?[H,Fn,e,Ra]:[Fn,e,Ra]}liftCreationEnvs(r,e){let t=new Set;Mr(r.statements,t),t.size!=0&&Iu(r.statements,t,e)}planSeq(r,e,t,i,s,a,l,o){let u=new N_;for(let c=0,f=e.length;c<f;++c){let _=this.planStatement(r,e[c],t,i,s,a,l,o);if(!_)return null;u.add(_)}return u}planStatement(r,e,t,i,s,a,l,o){let u=new P_(e);switch(e.kind){case 38:return u;case 42:{let c=e.expression;if(c.kind==16){let f=c.declaration;if(f.isAsync){let _=this.lowerAsyncFunction(s,f,l,r,a,null,c);if(!_)return null;for(let d=0,m=_.length;d<m;++d)_[d]!==e&&a.push(_[d])}return u.kind=0,u.nestedFunction=!0,u}return this.planLeaf(r,u,t,o)}case 51:case 47:return this.planLeaf(r,u,t,o);case 34:{let c=e,f=this.planSeq(r,c.statements,t,i,s,a,l,o);return f?(u.kind=1,u.statements=f,u.lo=f.lo,u.hi=f.hi,f.lo!=0&&this.liftDeclaredIn(r,f,o),u.all=Ta(f),u):null}case 45:{let c=e;if(!this.walkExpression(r,c.condition,u.all,null,!1))return null;let f=this.planBranch(r,c.ifTrue,t,i,s,a,l,o);if(!f)return null;let _=null;return c.ifFalse!=null&&(_=this.planBranch(r,assert(c.ifFalse),t,i,s,a,l,o),!_)?null:(u.kind=2,u.cond=c.condition,u.thenSeq=f,u.elseSeq=_,u.lo=L3(f,_),u.hi=B3(f,_),u.lo!=0&&(this.liftDeclaredIn(r,f,o),_!=null&&this.liftDeclaredIn(r,assert(_),o)),u.all=Aa(u.all,Aa(Ta(f),_?Ta(_):new vt)),u)}case 53:{let c=e;if(!this.walkExpression(r,c.condition,u.all,null,!1))return null;let f=this.planBranch(r,c.body,t,i,s,a,l,o);return f?(u.kind=3,u.cond=c.condition,u.body=f,u.lo=f.lo,u.hi=f.hi,f.lo!=0&&this.liftDeclaredIn(r,f,o),u.all=Aa(u.all,Ta(f)),u):null}case 43:{let c=e,f=this.planBranch(r,c.body,t,i,s,a,l,o);if(!f)return null;f.lo!=0&&this.liftDeclaredIn(r,f,o);let _=c.initializer;if(f.lo!=0&&_!=null&&_.kind==51){let h=_.declarations;for(let b=0,A=h.length;b<A;++b)if(!this.liftDeclarator(r,h[b],o))return null}if(_!=null){let h=this.planStatement(r,_,new Ru,!1,s,a,l,o);if(!h)return null;if(h.info!=null)return this.refuse(r,_.range,"await in a for initializer (async lowering)"),null;if(h.lo!=0)return null}let d=c.condition;if(d!=null&&!this.walkExpression(r,d,u.all,null,!1))return null;let m=c.incrementor;return m!=null&&!this.walkExpression(r,m,u.all,null,!1)?null:(u.kind=4,u.init=_,u.cond=c.condition,u.incr=c.incrementor,u.body=f,u.lo=f.lo,u.hi=f.hi,u.all=Aa(u.all,Ta(f)),u)}case 35:case 36:return u.kind=0,u;case 59:{let c=e;if(c.isAsync){let f=this.lowerAsyncFunction(s,c,l,r,a);if(!f)return null;for(let _=0,d=f.length;_<d;++_)f[_]!==e&&a.push(f[_])}return u.kind=0,u}default:return this.refuse(r,e.range,C_(e)),null}}planBranch(r,e,t,i,s,a,l,o){let u;return e.kind==34?u=e.statements:u=[e],this.planSeq(r,u,t,i,s,a,l,o)}planLeaf(r,e,t,i){let s=e.node;if(s.kind==42){let l=s.expression;if(l.kind==31)return this.planAwait(r,e,l,t,i);if(l.kind==10){let o=l;if(o.operator==102&&o.right.kind==31)return this.planAwait(r,e,o.right,t,i,o.left)}}if(s.kind==51){let l=s.declarations;if(l.length==1){let o=l[0],u=o.initializer;if(u!=null&&u.kind==31)return this.liftDeclarator(r,o,i)?this.planAwait(r,e,u,t,i):null}}if(s.kind==47){let l=s.value;if(l!=null&&l.kind==31)return this.planAwait(r,e,l,t,i)}let a=new Array;switch(s.kind){case 42:{if(!this.walkExpression(r,s.expression,e.all,a,!1))return null;break}case 51:{let l=s.declarations;for(let o=0,u=l.length;o<u;++o){let c=l[o];e.declarations.push(c);let f=c.initializer;if(f&&!this.walkExpression(r,f,e.all,a,!1))return null}break}case 47:{let l=s.value;if(l&&!this.walkExpression(r,l,e.all,a,!1))return null;break}}if(a.length){let l=a.length>1?"more than one await in one statement (async lowering)":"await in an unsupported position (async lowering)";return this.refuse(r,a[0].range,l),null}return e}planAwait(r,e,t,i,s,a=null){let l=i.next++,o=t.operand,u=new vt;if(!this.walkExpression(r,o,u,null,!1))return null;let c=new vt;return a!=null&&!this.walkExpression(r,a,c,null,!0)?null:(e.kind=0,e.info=new L_(t,o,l,Qx+l.toString(),l),e.lo=l,e.hi=l,e.before=u,e.after=c,e.all=Aa(u,c),e)}liftDeclarator(r,e,t){let i=e.name.text;if(t.hasLocal(i))return!0;if(Kx(i))return this.refuse(r,e.name.range,"a local whose name is reserved by the state struct (async lowering)"),!1;let s=e.type;if(s==null){let a=ct(e.initializer,t.knownTypes(),0);if(a!=null)e.type=a,s=a;else return this.refuse(r,e.name.range,"a local without a declared type that crosses an await (async lowering)"),!1}return t.liftLocal(i,s,e),!0}liftDeclaredIn(r,e,t){let i=e.plans;for(let s=0,a=i.length;s<a;++s){let l=i[s],o=l.declarations;for(let u=0,c=o.length;u<c;++u)if(!this.liftDeclarator(r,o[u],t))return!1;if(l.kind==1&&l.lo!=0){if(!this.liftDeclaredIn(r,assert(l.statements),t))return!1}else if(l.kind==2&&l.lo!=0){if(!this.liftDeclaredIn(r,assert(l.thenSeq),t)||l.elseSeq!=null&&!this.liftDeclaredIn(r,assert(l.elseSeq),t))return!1}else if((l.kind==3||l.kind==4)&&l.lo!=0&&!this.liftDeclaredIn(r,assert(l.body),t))return!1}return!0}collectLifting(r,e,t){let i=new Array,s=e.plans;for(let a=0,l=s.length;a<l;++a){let o=s[a];if(o.lo!=0){let c=new vt;et(c.reads,o.after.reads),et(c.writes,o.after.writes),et(c.reads,o.all.reads),et(c.writes,o.all.writes);for(let f=a+1,_=s.length;f<_;++f)et(c.reads,s[f].all.reads),et(c.writes,s[f].all.writes);for(let f=0,_=i.length;f<_;++f){let d=i[f],m=d.name.text;if((c.reads.has(m)||c.writes.has(m))&&!this.liftDeclarator(r,d,t))return}}let u=o.declarations;for(let c=0,f=u.length;c<f;++c){let _=u[c];t.hasLocal(_.name.text)||i.push(_)}switch(o.kind){case 1:{this.collectLifting(r,assert(o.statements),t);break}case 2:{this.collectLifting(r,assert(o.thenSeq),t),o.elseSeq!=null&&this.collectLifting(r,assert(o.elseSeq),t);break}case 3:case 4:{this.collectLifting(r,assert(o.body),t);break}}}}emitSeq(r,e){let t=new Array,i=r.plans,s=new Array;for(let a=0,l=i.length;a<l;++a){let o=i[a];if(e.guarded&&o.kind==0&&o.lo==0&&o.info==null&&!o.nestedFunction&&o.node.kind!=59){Ti(s,ka(o.node,e));continue}this.flushRun(s,t,e),Ti(t,this.emitPlan(o,e))}return this.flushRun(s,t,e),t}flushRun(r,e,t){r.length!=0&&(e.push(y.createIfStatement(cr(He(t.stateName,r[0].range),r[0].range),y.createBlockStatement(r.slice(0),r[0].range),null,r[0].range)),r.length=0)}emitPlan(r,e){let t=new Array,i=r.node,s=i.range;switch(r.kind){case 0:{if(r.nestedFunction||i.kind==59)return t.push(i),t;if(r.info!=null){let a=assert(r.info),l=new Array;l.push(y.createExpressionStatement(y.createBinaryExpression(102,ku(e.stateName,a.fieldName,s),y.createPropertyAccessExpression(a.operand,y.createIdentifierExpression(Vx,s),s),s))),l.push(y.createExpressionStatement(Fu(e.stateName,St(a.discriminator,s),s)));let o=new Array;Ti(o,U3(e.lifting,e.stateName,s)),o.push(y.createExpressionStatement(y.createCallExpression(y.createIdentifierExpression(k3,s),null,[y.createIdentifierExpression(e.stateName,s),ku(e.stateName,a.fieldName,s)],s))),o.push(y.createReturnStatement(null,s)),l.push(y.createIfStatement(y.createUnaryPrefixExpression(96,y.createCallExpression(y.createIdentifierExpression(F3,s),null,[ku(e.stateName,a.fieldName,s)],s),s),y.createBlockStatement(o,s),null,s)),t.push(y.createIfStatement(cr(He(e.stateName,s),s),y.createBlockStatement(l,s),null,s));let u=new Array;return u.push(y.createExpressionStatement(Fu(e.stateName,St(0,s),s))),Ti(u,ka(i,e)),t.push(y.createIfStatement(H3(He(e.stateName,s),St(a.discriminator,s),s),y.createBlockStatement(u,s),null,s)),t}if(r.lo==0){let a=ka(i,e);e.guarded?t.push(y.createIfStatement(cr(He(e.stateName,s),s),y.createBlockStatement(a,s),null,s)):Ti(t,a)}return t}case 1:{let a=this.emitSeq(assert(r.statements),e);return r.lo==0?Tu(pr(i,e),e,s):(t.push(y.createIfStatement(Su(e.stateName,r.lo,r.hi,s),y.createBlockStatement(a,s),null,s)),t)}case 2:{if(r.lo==0)return Tu(pr(i,e),e,s);let a=this.emitSeq(assert(r.thenSeq),e),l=r.elseSeq!=null?this.emitSeq(assert(r.elseSeq),e):new Array,o=e.freshTemp(s),u=new Array;return u.push(y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(o,s),null,16,ve("bool",s),y.createFalseExpression(s),s)],s)),u.push(y.createIfStatement(cr(He(e.stateName,s),s),y.createBlockStatement([y.createExpressionStatement(D_(o,assert(r.cond),s))],s),y.createBlockStatement([y.createExpressionStatement(D_(o,Xx(e.stateName,r.thenSeq!=null?assert(r.thenSeq).lo:0,r.thenSeq!=null?assert(r.thenSeq).hi:0,s),s))],s),s)),u.push(y.createIfStatement(y.createIdentifierExpression(o,s),y.createBlockStatement(a,s),l.length?y.createBlockStatement(l,s):null,s)),t.push(y.createIfStatement(Su(e.stateName,r.lo,r.hi,s),y.createBlockStatement(u,s),null,s)),t}case 3:{if(r.lo==0)return Tu(pr(i,e),e,s);let a=this.emitSeq(assert(r.body),e),l=r.cond,o=y.createBinaryExpression(99,Hx(He(e.stateName,s),s),l??y.createTrueExpression(s),s);return t.push(y.createIfStatement(Su(e.stateName,r.lo,r.hi,s),y.createBlockStatement([y.createWhileStatement(o,y.createBlockStatement(a,s),s)],s),null,s)),t}case 4:{if(r.lo==0)return Tu(pr(i,e),e,s);let a=this.emitSeq(assert(r.body),e),l=new Array;r.init!=null&&l.push(y.createIfStatement(cr(He(e.stateName,s),s),y.createBlockStatement(ka(assert(r.init),e),s),null,s));let o=r.cond;return l.push(y.createForStatement(null,y.createBinaryExpression(99,Hx(He(e.stateName,s),s),o??y.createTrueExpression(s),s),r.incr!=null?assert(r.incr):null,y.createBlockStatement(a,s),s)),t.push(y.createIfStatement(Su(e.stateName,r.lo,r.hi,s),y.createBlockStatement(l,s),null,s)),t}}return t}walkExpression(r,e,t,i,s){switch(e.kind){case 8:{if(t){let a=e.text;s?t.writes.add(a):t.reads.add(a)}return!0}case 27:case 15:case 20:return!0;case 16:{let a=e.declaration;return a.isAsync?(this.refuse(r,e.range,a.arrowKind!=0?xa:Ea),!1):!0}case 26:return this.refuse(r,e.range,"this in an async function body (async lowering)"),!1;case 25:return this.refuse(r,e.range,"super in an async function body (async lowering)"),!1;case 31:{let a=e;return i?(i.push(a),!0):(this.refuse(r,a.range,"await in an unsupported position (async lowering)"),!1)}case 18:{let a=e;switch(a.literalKind){case 0:case 1:case 2:case 4:return!0;case 3:{let l=a.expressions;for(let o=0,u=l.length;o<u;++o)if(!this.walkExpression(r,l[o],t,i,!1))return!1;return!0}case 5:{let l=a.elementExpressions;for(let o=0,u=l.length;o<u;++o)if(!this.walkExpression(r,l[o],t,i,!1))return!1;return!0}case 6:{let l=a.values;for(let o=0,u=l.length;o<u;++o)if(!this.walkExpression(r,l[o],t,i,!1))return!1;return!0}default:return this.refuse(r,e.range,C_(e)),!1}}case 9:{let a=e;return this.walkExpression(r,a.expression,t,i,s)?a.toType!=null?(this.refuse(r,a.range,"a type argument in an async body (async lowering)"),!1):!0:!1}case 10:{let a=e,l=Z3(a.operator);return this.walkExpression(r,a.left,t,i,l?!0:s)?this.walkExpression(r,a.right,t,i,!1):!1}case 11:{let a=e;if(!this.walkExpression(r,a.expression,t,i,!1))return!1;let l=a.args;for(let o=0,u=l.length;o<u;++o)if(!this.walkExpression(r,l[o],t,i,!1))return!1;return!0}case 13:{let a=e.expressions;for(let l=0,o=a.length;l<o;++l)if(!this.walkExpression(r,a[l],t,i,l==o-1?s:!1))return!1;return!0}case 14:{let a=e;return this.walkExpression(r,a.expression,t,i,!1)?this.walkExpression(r,a.elementExpression,t,i,!1):!1}case 17:return this.walkExpression(r,e.expression,t,i,!1);case 19:{let a=e.args;for(let l=0,o=a.length;l<o;++l)if(!this.walkExpression(r,a[l],t,i,!1))return!1;return!0}case 22:return this.walkExpression(r,e.expression,t,i,s);case 23:return this.walkExpression(r,e.expression,t,i,!1);case 24:{let a=e;return!this.walkExpression(r,a.condition,t,i,!1)||!this.walkExpression(r,a.ifThen,t,i,s)?!1:this.walkExpression(r,a.ifElse,t,i,s)}case 29:{let a=e,l=a.operator==88||a.operator==89;return this.walkExpression(r,a.operand,t,i,l?!0:s)}case 30:{let a=e,l=a.operator==88||a.operator==89;return this.walkExpression(r,a.operand,t,i,l?!0:s)}default:return this.refuse(r,e.range,C_(e)),!1}}lowerAsyncMethods(r,e,t,i){let s=new Array,a=e.members;for(let l=0,o=a.length;l<o;++l){let u=a[l];if(u.kind==62){let c=u;if(!c.isAsync)continue;if(c.is(32)){this.refuse(i,c.range,"async static methods (async lowering)",c);continue}if(c.body==null)continue;let f=this.lowerAsyncFunction(r,c,t,i,s,ve(e.name.text,c.range));if(f)for(let _=0,d=f.length;_<d;++_)f[_]!==c&&s.push(f[_])}else if(u.kind==58){let c=u.initializer;c&&this.refuseAsyncFunctionExpression(c,i)}}return s}refuseAsyncFunctionExpression(r,e){if(r.kind!=16)return;let t=r.declaration;t.isAsync&&this.refuse(e,t.range,t.arrowKind!=0?xa:Ea,r)}refuse(r,e,t,i=null){let s=i??this.currentConstruct;s!=null?this.recordRefusalStart(s.range.source,s.range.start):this.recordRefusalStart(e.source,e.start),r.error(100,e,t)}recordRefusal(r){this.recordRefusalStart(r.range.source,r.range.start)}recordRefusalStart(r,e){let t=this.refusals;t==null&&(t=new Map,this.refusals=t);let i=J(t,r);i==null&&(i=new Set,t.set(r,i)),i.add(e)}};var P_=class{constructor(r){this.node=r;this.kind=0;this.lo=0;this.hi=0;this.info=null;this.before=new vt;this.after=new vt;this.all=new vt;this.statements=null;this.cond=null;this.thenSeq=null;this.elseSeq=null;this.body=null;this.init=null;this.incr=null;this.declarations=new Array;this.nestedFunction=!1;this.range=r.range}},N_=class{constructor(){this.plans=new Array;this.lo=0;this.hi=0}add(r){r.lo!=0&&((this.lo==0||r.lo<this.lo)&&(this.lo=r.lo),r.hi>this.hi&&(this.hi=r.hi)),this.plans.push(r)}},Ru=class{constructor(){this.next=1}},L_=class{constructor(r,e,t,i,s){this.node=r;this.operand=e;this.discriminator=t;this.fieldName=i;this.ordinal=s}},vt=class{constructor(){this.reads=new Set;this.writes=new Set}},B_=class{constructor(r,e,t,i,s,a=null,l=!0,o=null){this.lifting=r;this.stateName=e;this.terminal=t;this.returnsValue=i;this.localNames=s;this.returnType=a;this.guarded=l;this.hoisted=o;this.tempCount=0}freshTemp(r){let e=Ox;for(;this.localNames.has(e);)e=Ox+(++this.tempCount).toString();return this.localNames.add(e),e}};function et(n,r){for(let e=Set_values(r),t=0,i=e.length;t<i;++t)n.add(unchecked(e[t]))}function Aa(n,r){let e=new vt;return et(e.reads,n.reads),et(e.writes,n.writes),et(e.reads,r.reads),et(e.writes,r.writes),e}function Ta(n){let r=new vt,e=n.plans;for(let t=0,i=e.length;t<i;++t)et(r.reads,e[t].all.reads),et(r.writes,e[t].all.writes);return r}function L3(n,r){let e=0;return n!=null&&n.lo!=0&&(e=n.lo),r!=null&&r.lo!=0&&(e==0||r.lo<e)&&(e=r.lo),e}function B3(n,r){let e=0;return n!=null&&n.hi>e&&(e=n.hi),r!=null&&r.hi>e&&(e=r.hi),e}function Sa(n,r){let e=n.plans;for(let t=0,i=e.length;t<i;++t){let s=e[t];s.info!=null&&r.push(assert(s.info).fieldName),s.statements!=null&&Sa(assert(s.statements),r),s.thenSeq!=null&&Sa(assert(s.thenSeq),r),s.elseSeq!=null&&Sa(assert(s.elseSeq),r),s.body!=null&&Sa(assert(s.body),r)}}function va(n,r){let e=n.plans;for(let t=0,i=e.length;t<i;++t){let s=e[t];et(r,s.all.writes),et(r,s.before.writes),s.statements!=null&&va(assert(s.statements),r),s.thenSeq!=null&&va(assert(s.thenSeq),r),s.elseSeq!=null&&va(assert(s.elseSeq),r),s.body!=null&&va(assert(s.body),r)}}function Ia(n,r){let e=n.plans;for(let t=0,i=e.length;t<i;++t){let s=e[t];s.info!=null&&r.push(assert(s.info)),s.statements!=null&&Ia(assert(s.statements),r),s.thenSeq!=null&&Ia(assert(s.thenSeq),r),s.elseSeq!=null&&Ia(assert(s.elseSeq),r),s.body!=null&&Ia(assert(s.body),r)}}function M3(n){let r=n.plans;if(!r.length)return!1;let e=r[r.length-1];return e.kind==0&&e.node.kind==47}function z3(n){for(let r=0,e=n.length;r<e;++r){let t=n[r].kind;if(t==59){if(n[r].isAsync)return!0}else{if(t==63||t==55)return!0;if(t==51){let i=n[r].declarations;for(let s=0,a=i.length;s<a;++s){let l=i[s].initializer;if(l!=null&&l.kind==16&&l.declaration.isAsync)return!0}}}}return!1}function Mr(n,r){for(let e=0,t=n.length;e<t;++e){let i=n[e];switch(i.kind){case 42:{let s=i.expression;if(s.kind==16){let a=J(qr(),s);a!=null&&r.add(a)}break}case 51:{let s=i.declarations;for(let a=0,l=s.length;a<l;++a){let o=s[a].initializer;if(o!=null&&o.kind==16){let u=J(qr(),o);u!=null&&r.add(u)}}break}case 34:{Mr(i.statements,r);break}case 45:{let s=i;Mr([s.ifTrue],r),s.ifFalse!=null&&Mr([assert(s.ifFalse)],r);break}case 53:{Mr([i.body],r);break}case 37:{Mr([i.body],r);break}case 43:{let s=i;s.initializer!=null&&Mr([assert(s.initializer)],r),Mr([s.body],r);break}default:break}}}function Iu(n,r,e){for(let t=0,i=n.length;t<i;++t){let s=n[t];switch(s.kind){case 51:{let a=s.declarations;for(let l=0,o=a.length;l<o;++l){let u=a[l],c=u.name.text;if(!r.has(c)||e.hasLocal(c))continue;let f=u.type;f!=null&&e.liftLocal(c,f,u)}break}case 34:{Iu(s.statements,r,e);break}case 45:{let a=s;Iu([a.ifTrue],r,e),a.ifFalse!=null&&Iu([assert(a.ifFalse)],r,e);break}default:break}}}function zr(n,r){switch(n.kind){case 34:{let e=n.statements;for(let t=0,i=e.length;t<i;++t)zr(e[t],r);break}case 45:{let e=n;zr(e.ifTrue,r),e.ifFalse!=null&&zr(assert(e.ifFalse),r);break}case 53:{zr(n.body,r);break}case 43:{let e=n;e.initializer!=null&&zr(assert(e.initializer),r),zr(e.body,r);break}case 51:{let e=n.declarations;for(let t=0,i=e.length;t<i;++t)r.add(e[t].name.text);break}default:break}}function Sn(n,r){switch(n.kind){case 34:{let e=n.statements;for(let t=0,i=e.length;t<i;++t)Sn(e[t],r);break}case 45:{let e=n;Sn(e.ifTrue,r),e.ifFalse!=null&&Sn(assert(e.ifFalse),r);break}case 53:{Sn(n.body,r);break}case 43:{let e=n;e.initializer!=null&&Sn(assert(e.initializer),r),Sn(e.body,r);break}case 51:{let e=n.declarations;for(let t=0,i=e.length;t<i;++t){let s=e[t],a=s.type;a!=null&&r.set(s.name.text,a)}break}default:break}}function D3(n){switch(n.kind){case 59:case 62:case 55:case 56:case 61:case 63:case 64:return n.name.text;case 51:{let r=n.declarations;return r.length?r[0].name.text:null}default:return null}}function qx(n,r){return y.createExpressionStatement(y.createCallExpression(y.createIdentifierExpression(jx,r),null,[y.createIdentifierExpression(n,r)],r))}function Wx(n,r,e){return y.createVariableStatement(null,[y.createVariableDeclaration(y.createIdentifierExpression(n,r),null,16,null,y.createPropertyAccessExpression(y.createIdentifierExpression(e,r),y.createIdentifierExpression(n,r),r),r)],r)}function ka(n,r){let e=r.stateName;if(n.kind==47){let t=n,i=t.value,s=t.range,a=new Array;return i!=null?r.returnsValue?a.push(y.createExpressionStatement(y.createCallExpression(y.createIdentifierExpression(C3,s),[assert(r.returnType)],[y.createIdentifierExpression(e,s),i],s))):(a.push(y.createExpressionStatement(i)),a.push(qx(e,s))):a.push(qx(e,s)),a.push(y.createExpressionStatement(Fu(e,St(r.terminal,s),s))),a.push(y.createReturnStatement(null,s)),a}if(n.kind==51){let t=n.declarations,i=!1;for(let a=0,l=t.length;a<l;++a){let o=t[a].name.text;if(r.lifting.hasLocal(o)||r.hoisted!=null&&assert(r.hoisted).has(o)){i=!0;break}}if(!i)return[n];let s=new Array;for(let a=0,l=t.length;a<l;++a){let o=t[a],u=o.name.text;if(!r.lifting.hasLocal(u)&&(r.hoisted==null||!assert(r.hoisted).has(u))){s.push(y.createVariableStatement(null,[o],o.range));continue}let c=o.initializer;c!=null&&s.push(y.createExpressionStatement(D_(u,c,o.range)))}return s}return[n]}function pr(n,r){switch(n.kind){case 34:{let e=n,t=new Array,i=e.statements;for(let s=0,a=i.length;s<a;++s){let l=pr(i[s],r);if(l.kind==34&&i[s].kind!=34){let o=l.statements;for(let u=0,c=o.length;u<c;++u)t.push(o[u])}else t.push(l)}return y.createBlockStatement(t,e.range)}case 45:{let e=n;return y.createIfStatement(e.condition,pr(e.ifTrue,r),e.ifFalse!=null?pr(assert(e.ifFalse),r):null,e.range)}case 53:{let e=n;return y.createWhileStatement(e.condition,pr(e.body,r),e.range)}case 43:{let e=n;return y.createForStatement(e.initializer,e.condition,e.incrementor,pr(e.body,r),e.range)}case 47:{let e=ka(n,r);return e.length==1?e[0]:y.createBlockStatement(e,n.range)}default:return n}}function Tu(n,r,e){return r.guarded?G3(n,r,e):[n]}function G3(n,r,e){return[y.createIfStatement(cr(He(r.stateName,e),e),y.createBlockStatement([n],e),null,e)]}function Ti(n,r){for(let e=0,t=r.length;e<t;++e)n.push(r[e])}function U3(n,r,e){let t=new Array,i=n.parameterNames;for(let s=0,a=i.length;s<a;++s){let l=i[s],o=n.parameterRange(l);t.push(y.createExpressionStatement(G_(y.createPropertyAccessExpression(y.createIdentifierExpression(r,o),y.createIdentifierExpression(l,o),o),y.createIdentifierExpression(l,o),o)))}for(let s=0,a=n.locals.length;s<a;++s){let l=n.locals[s],o=l.declaration.name.range;t.push(y.createExpressionStatement(G_(y.createPropertyAccessExpression(y.createIdentifierExpression(r,o),y.createIdentifierExpression(l.name,o),o),y.createIdentifierExpression(l.name,o),o)))}return t}function C_(n){switch(n.kind){case 31:return"await in an unsupported position (async lowering)";case 16:return n.declaration.isAsync?Ea:"a nested function in an async function body (async lowering)";case 12:return"a nested class in an async function body (async lowering)";case 26:return"this in an async function body (async lowering)";case 25:return"super in an async function body (async lowering)";case 49:return"throw in an async function body (async lowering)";case 50:return"try/catch in an async function body (async lowering)";case 48:return"switch in an async function body (async lowering)";case 45:return"if in an async function body (async lowering)";case 43:return"for in an async function body (async lowering)";case 44:return"for-of in an async function body (async lowering)";case 53:return"while in an async function body (async lowering)";case 37:return"do in an async function body (async lowering)";case 34:return"a nested block in an async function body (async lowering)";default:return"this async body (async lowering)"}}function M_(n,r){let e="state";for(;V3(n,r,e);)e="$"+e;return e}function V3(n,r,e){for(let i=0,s=n.length;i<s;++i)if(n[i].name.text==e)return!0;let t=new Set;return zr(r,t),t.has(e)}function O3(n,r){return M_(r,n)}function q3(n){let r=n.statements,e=r.length>0?r[0]:null;if(e==null||e.kind!=51)return;let t=e.declarations;if(t.length!=1||t[0].name.text!=Si)return;r.shift();let i=r.length>0?r[0]:null;if(i==null||i.kind!=42)return;let s=i.expression;if(s.kind!=10)return;let a=s;if(a.operator!=102||a.left.kind!=23)return;let l=a.left;l.expression.kind==8&&l.expression.text==Si&&l.property.text==Fa&&r.shift()}function z_(n,r,e){for(let t=0,i=n.length;t<i;++t)vn(n[t],r,e)}function vn(n,r,e){switch(n.kind){case 42:{let t=n.expression;n.expression=he(t,r,e);break}case 47:{let t=n.value;t!=null&&(n.value=he(t,r,e));break}case 51:{let t=n.declarations;for(let i=0,s=t.length;i<s;++i){let a=t[i].initializer;a!=null&&(t[i].initializer=he(a,r,e))}break}case 34:{z_(n.statements,r,e);break}case 45:{let t=n;t.condition=he(t.condition,r,e),vn(t.ifTrue,r,e),t.ifFalse!=null&&vn(assert(t.ifFalse),r,e);break}case 53:{let t=n;t.condition=he(t.condition,r,e),vn(t.body,r,e);break}case 37:{let t=n;vn(t.body,r,e),t.condition=he(t.condition,r,e);break}case 43:{let t=n,i=t.initializer;i!=null&&vn(i,r,e);let s=t.condition;s!=null&&(t.condition=he(s,r,e));let a=t.incrementor;a!=null&&(t.incrementor=he(a,r,e)),vn(t.body,r,e);break}case 48:{let t=n;t.condition=he(t.condition,r,e);let i=t.cases;for(let s=0,a=i.length;s<a;++s)i[s].label!=null&&(i[s].label=he(assert(i[s].label),r,e)),z_(i[s].statements,r,e);break}default:break}}function he(n,r,e){switch(n.kind){case 26:return y.createPropertyAccessExpression(y.createCallExpression(y.createIdentifierExpression("changetype",n.range),[ve(r,n.range)],[y.createPropertyAccessExpression(y.createIdentifierExpression(e,n.range),y.createIdentifierExpression(In,n.range),n.range)],n.range),y.createIdentifierExpression(Fa,n.range),n.range);case 10:{let t=n;return t.left=he(t.left,r,e),t.right=he(t.right,r,e),t}case 11:{let t=n;t.expression=he(t.expression,r,e);let i=t.args;for(let s=0,a=i.length;s<a;++s)i[s]=he(i[s],r,e);return t}case 23:{let t=n;return t.expression=he(t.expression,r,e),t}case 22:{let t=n;return t.expression=he(t.expression,r,e),t}case 30:{let t=n;return t.operand=he(t.operand,r,e),t}case 29:{let t=n;return t.operand=he(t.operand,r,e),t}case 14:{let t=n;return t.expression=he(t.expression,r,e),t.elementExpression=he(t.elementExpression,r,e),t}case 24:{let t=n;return t.condition=he(t.condition,r,e),t.ifThen=he(t.ifThen,r,e),t.ifElse=he(t.ifElse,r,e),t}case 13:{let t=n,i=t.expressions;for(let s=0,a=i.length;s<a;++s)i[s]=he(i[s],r,e);return t}case 19:{let t=n,i=t.args;for(let s=0,a=i.length;s<a;++s)i[s]=he(i[s],r,e);return t}case 17:{let t=n;return t.expression=he(t.expression,r,e),t}case 9:{let t=n;return t.expression=he(t.expression,r,e),t}case 31:{let t=n;return t.operand=he(t.operand,r,e),t}default:return n}}function Kx(n){return n==wu||n==vu||n==In||n=="record"?!0:n.startsWith(Qx)}function W3(n,r,e){return y.createPropertyAccessExpression(n,y.createIdentifierExpression(r,e),e)}function ku(n,r,e){return W3(y.createIdentifierExpression(n,e),r,e)}function K3(n,r,e){return ku(n,r,e)}function He(n,r){return y.createPropertyAccessExpression(y.createIdentifierExpression(n,r),y.createIdentifierExpression(wu,r),r)}function Fu(n,r,e){return y.createBinaryExpression(102,He(n,e),r,e)}function Su(n,r,e,t){return r==0?cr(He(n,t),t):y.createBinaryExpression(99,cr(He(n,t),t),Xx(n,r,e,t),t)}function Xx(n,r,e,t){return r==0?y.createFalseExpression(t):y.createBinaryExpression(98,y.createBinaryExpression(76,He(n,t),St(r,t),t),y.createBinaryExpression(75,He(n,t),St(e,t),t),t)}function cr(n,r){return y.createBinaryExpression(77,n,St(0,r),r)}function Hx(n,r){return y.createBinaryExpression(78,n,St(0,r),r)}function H3(n,r,e){return y.createBinaryExpression(77,n,r,e)}function D_(n,r,e){return G_(y.createIdentifierExpression(n,e),r,e)}function G_(n,r,e){return y.createBinaryExpression(102,n,r,e)}function j3(n){return n.kind==1&&n.name.identifier.text==""}var U_=class{constructor(r,e,t){this.name=r;this.type=e;this.declaration=t}},V_=class{constructor(){this.locals=new Array;this.parameters=new Set;this.parameterNames=new Array;this.parameterRanges=new Map;this.declaredTypes=new Map}liftParameter(r,e){this.parameters.has(r)||(this.parameters.add(r),this.parameterNames.push(r),this.parameterRanges.set(r,e))}parameterRange(r){return assert(this.parameterRanges.get(r))}liftLocal(r,e,t){this.hasLocal(r)||this.locals.push(new U_(r,e,t))}knownTypes(){let r=new Map,e=this.declaredTypes,t=Map_keys(e);for(let i=0,s=t.length;i<s;++i){let a=unchecked(t[i]);r.set(a,assert(e.get(a)))}for(let i=0,s=this.locals.length;i<s;++i){let a=this.locals[i];r.set(a.name,a.type)}return r}hasLocal(r){for(let e=0,t=this.locals.length;e<t;++e)if(this.locals[e].name==r)return!0;return!1}};function Q3(n){return n.kind==1&&n.name.identifier.text=="void"}function X3(n,r){return y.createNamedType(y.createSimpleTypeName("Task",r),[n],!1,r)}function ve(n,r){return y.createNamedType(y.createSimpleTypeName(n,r),null,!1,r)}function Z3(n){switch(n){case 102:case 103:case 104:case 105:case 106:case 107:case 108:case 109:case 110:case 111:case 112:case 114:case 113:return!0;default:return!1}}function St(n,r){return y.createIntegerLiteralExpression(i64_new(n),r)}function Br(n,r,e,t){return y.createBinaryExpression(102,y.createPropertyAccessExpression(n,y.createIdentifierExpression(r,t),t),e,t)}function Zx(n){let r=new xu;r.program=n,r.afterParse(n.parser);let e=new ga;e.program=n,e.afterParse(n.parser);let t=new wa;t.program=n,t.afterParse(n.parser)}function $3(){return new pa}function Y3(n,r){n.target=r}function J3(n,r){n.runtime=r}function eF(n,r){n.noAssert=r}function tF(n,r){n.exportMemory=r}function rF(n,r){n.importMemory=r}function nF(n,r){n.initialMemory=r}function iF(n,r){n.maximumMemory=r}function sF(n,r){n.sharedMemory=r}function aF(n,r){n.importTable=r}function lF(n,r){n.exportTable=r}function oF(n,r){n.sourceMap=r}function uF(n,r){n.uncheckedBehavior=r}function cF(n,r){n.memoryBase=r}function pF(n,r){n.tableBase=r}function fF(n,r,e){let t=n.globalAliases;t||(n.globalAliases=t=new Map),t.set(r,e)}function _F(n,r){let e=n.globalAliases;e&&e.delete(r)}function dF(n,r){n.exportStart=r}function hF(n,r){n.noUnsafe=r}function mF(n,r){n.lowMemoryLimit=r}function yF(n,r){n.exportRuntime=r}var gF=32768;function bF(n,r){n.stackSize=r}function xF(n,r,e,t){n.bundleMajorVersion=r,n.bundleMinorVersion=e,n.bundlePatchVersion=t}var EF=1,AF=2,TF=4,SF=8,vF=16,IF=32,kF=64,FF=128,wF=256,RF=512,CF=1024,PF=2048,NF=4096,LF=8192,BF=16384,MF=32768,zF=65535,DF=pu;function GF(n,r,e){n.setFeature(r,e)}function UF(n,r,e){n.optimizeLevelHint=r,n.shrinkLevelHint=e}function VF(n,r){n.basenameHint=r}function OF(n,r){n.bindingsHint=r}function qF(n,r){n.pedantic=r}function WF(n,r){n.debugInfo=r}function KF(n){return new Ds(n)}function HF(n){return n.diagnosticsOffset<n.diagnostics.length?n.diagnostics[n.diagnosticsOffset++]:null}function jF(n,r){return n.getSource(r)}function QF(n){return n.code}function XF(n){return n.category}function ZF(n){return n.message}function $F(n){return n.range}function YF(n){return n.relatedRange}function JF(n){return n.start}function ew(n){return n.end}function tw(n){return n.source}function rw(n){return n.normalizedPath}function nw(n){return n.category==1}function iw(n){return n.category==2}function sw(n){return n.category==3}function aw(n,r,e,t=!1){n.parser.parseFile(r,e,t)}function lw(n){return n.parser.nextFile()}function ow(n,r){return n.parser.getDependee(r)}function uw(n){n.initialize()}function cw(n){return n.parser.finish(),new fa(n).compile()}function pw(n,r){return bi.build(n,r)}function fw(n,r){return _i.build(n,r)}function _w(n){return n.ref}function dw(n){return n.validate()}function hw(n,r,e,t=!1,i=!1){n.optimize(r,e,t,i)}var O_=class n{constructor(){this.sb=[];this.indentLevel=0}static build(r){let e=new n;return e.visitNode(r),e.finish()}visitNode(r){switch(r.kind){case 0:{this.visitSource(r);break}case 1:{this.visitNamedTypeNode(r);break}case 2:{this.visitFunctionTypeNode(r);break}case 3:{this.visitTupleTypeNode(r);break}case 6:{this.visitTypeParameter(r);break}case 15:case 20:case 25:case 26:case 27:case 28:case 8:{this.visitIdentifierExpression(r);break}case 9:{this.visitAssertionExpression(r);break}case 10:{this.visitBinaryExpression(r);break}case 11:{this.visitCallExpression(r);break}case 12:{this.visitClassExpression(r);break}case 13:{this.visitCommaExpression(r);break}case 14:{this.visitElementAccessExpression(r);break}case 16:{this.visitFunctionExpression(r);break}case 17:{this.visitInstanceOfExpression(r);break}case 18:{this.visitLiteralExpression(r);break}case 19:{this.visitNewExpression(r);break}case 22:{this.visitParenthesizedExpression(r);break}case 23:{this.visitPropertyAccessExpression(r);break}case 24:{this.visitTernaryExpression(r);break}case 29:{this.visitUnaryPostfixExpression(r);break}case 30:{this.visitUnaryPrefixExpression(r);break}case 31:{this.visitAwaitExpression(r);break}case 34:{this.visitBlockStatement(r);break}case 35:{this.visitBreakStatement(r);break}case 36:{this.visitContinueStatement(r);break}case 37:{this.visitDoStatement(r);break}case 38:{this.visitEmptyStatement(r);break}case 39:{this.visitExportStatement(r);break}case 40:{this.visitExportDefaultStatement(r);break}case 41:{this.visitExportImportStatement(r);break}case 42:{this.visitExpressionStatement(r);break}case 43:{this.visitForStatement(r);break}case 44:{this.visitForOfStatement(r);break}case 45:{this.visitIfStatement(r);break}case 46:{this.visitImportStatement(r);break}case 47:{this.visitReturnStatement(r);break}case 48:{this.visitSwitchStatement(r);break}case 49:{this.visitThrowStatement(r);break}case 50:{this.visitTryStatement(r);break}case 51:{this.visitVariableStatement(r);break}case 53:{this.visitWhileStatement(r);break}case 54:{this.visitModuleDeclaration(r);break}case 55:{this.visitClassDeclaration(r);break}case 56:{this.visitEnumDeclaration(r);break}case 57:{this.visitEnumValueDeclaration(r);break}case 58:{this.visitFieldDeclaration(r);break}case 59:{this.visitFunctionDeclaration(r);break}case 60:{this.visitImportDeclaration(r);break}case 61:{this.visitInterfaceDeclaration(r);break}case 62:{this.visitMethodDeclaration(r);break}case 63:{this.visitNamespaceDeclaration(r);break}case 64:{this.visitTypeDeclaration(r);break}case 65:{this.visitVariableDeclaration(r);break}case 66:{this.serializeDecorator(r);break}case 67:{this.visitExportMember(r);break}case 7:{this.serializeParameter(r);break}case 68:{this.visitSwitchCase(r);break}case 69:{this.visitIndexSignature(r);break}default:assert(!1)}}visitSource(r){let e=r.statements;for(let t=0,i=e.length;t<i;++t)this.visitNodeAndTerminate(e[t])}visitTypeNode(r){switch(r.kind){case 1:{this.visitNamedTypeNode(r);break}case 2:{this.visitFunctionTypeNode(r);break}case 3:{this.visitTupleTypeNode(r);break}default:assert(!1)}}visitTypeName(r){this.visitIdentifierExpression(r.identifier);let e=this.sb,t=r.next;for(;t;)e.push("."),this.visitIdentifierExpression(t.identifier),t=t.next}visitNamedTypeNode(r){this.visitTypeName(r.name);let e=r.typeArguments;if(e){let t=e.length,i=this.sb;if(t){i.push("<"),this.visitTypeNode(e[0]);for(let s=1;s<t;++s)i.push(", "),this.visitTypeNode(e[s]);i.push(">")}r.isNullable&&i.push(" | null")}this.visitTypeAttributes(r)}visitTypeAttributes(r){let e=r.attributes;if(!e)return;let t=this.sb;for(let i=0,s=e.length;i<s;++i){let a=e[i];t.push(" @"),this.visitNode(a.name);let l=a.args;if(l){t.push("(");let o=l.length;if(o){this.visitNode(l[0]);for(let u=1;u<o;++u)t.push(", "),this.visitNode(l[u])}t.push(")")}}}visitFunctionTypeNode(r){let e=r.isNullable,t=this.sb;t.push(e?"((":"(");let i=r.explicitThisType;i&&(t.push("this: "),this.visitTypeNode(i));let s=r.parameters,a=s.length;if(a){i&&t.push(", "),this.serializeParameter(s[0]);for(let o=1;o<a;++o)t.push(", "),this.serializeParameter(s[o])}let l=r.returnType;l?(t.push(") => "),this.visitTypeNode(l)):t.push(") => void"),e&&t.push(") | null"),this.visitTypeAttributes(r)}visitTupleTypeNode(r){let e=this.sb;e.push("[");let t=r.elements,i=r.elementNames,s=t.length;if(s){let a=i?i[0]:null;a&&(this.visitIdentifierExpression(a),e.push(": ")),this.visitTypeNode(t[0]);for(let l=1;l<s;++l)e.push(", "),a=i?i[l]:null,a&&(this.visitIdentifierExpression(a),e.push(": ")),this.visitTypeNode(t[l])}e.push("]"),r.isNullable&&e.push(" | null"),this.visitTypeAttributes(r)}visitTypeParameter(r){this.visitIdentifierExpression(r.name);let e=r.extendsType;e&&(this.sb.push(" extends "),this.visitTypeNode(e));let t=r.defaultType;t&&(this.sb.push("="),this.visitTypeNode(t))}visitIdentifierExpression(r){r.isQuoted?this.visitStringLiteral(r.text):this.sb.push(r.text)}visitArrayLiteralExpression(r){let e=this.sb;e.push("[");let t=r.elementExpressions,i=t.length;if(i){let s=t[0];s&&this.visitNode(s);for(let a=1;a<i;++a)s=t[a],e.push(", "),s&&this.visitNode(s)}e.push("]")}visitObjectLiteralExpression(r){let e=this.sb,t=r.names,i=r.values,s=t.length;if(assert(s==i.length),s){e.push(`{
307
307
  `),W(e,++this.indentLevel),this.visitNode(t[0]),e.push(": "),this.visitNode(i[0]);for(let a=1;a<s;++a){e.push(`,
308
308
  `),W(e,this.indentLevel);let l=t[a],o=i[a];l==o?this.visitNode(l):(this.visitNode(l),e.push(": "),this.visitNode(o))}e.push(`
309
- `),W(e,--this.indentLevel),e.push("}")}else e.push("{}")}visitAssertionExpression(r){let e=this.sb;switch(r.assertionKind){case 0:{e.push("<"),this.visitTypeNode(assert(r.toType)),e.push(">"),this.visitNode(r.expression);break}case 1:{this.visitNode(r.expression),e.push(" as "),this.visitTypeNode(assert(r.toType));break}case 2:{this.visitNode(r.expression),e.push("!");break}case 3:{this.visitNode(r.expression),e.push(" as const");break}default:assert(!1)}}visitBinaryExpression(r){let e=this.sb;this.visitNode(r.left),e.push(" "),e.push(Le(r.operator)),e.push(" "),this.visitNode(r.right)}visitCallExpression(r){this.visitNode(r.expression),this.visitArguments(r.typeArguments,r.args)}visitArguments(r,e){let t=this.sb;if(r){let s=r.length;if(s){t.push("<"),this.visitTypeNode(r[0]);for(let a=1;a<s;++a)t.push(", "),this.visitTypeNode(r[a]);t.push(">(")}}else t.push("(");let i=e.length;if(i){this.visitNode(e[0]);for(let s=1;s<i;++s)t.push(", "),this.visitNode(e[s])}t.push(")")}visitClassExpression(r){let e=r.declaration;this.visitClassDeclaration(e)}visitCommaExpression(r){let e=r.expressions,t=assert(e.length);this.visitNode(e[0]);let i=this.sb;for(let s=1;s<t;++s)i.push(","),this.visitNode(e[s])}visitElementAccessExpression(r){let e=this.sb;this.visitNode(r.expression),e.push("["),this.visitNode(r.elementExpression),e.push("]")}visitFunctionExpression(r){let e=r.declaration;e.isAsync&&this.sb.push("async "),e.arrowKind?assert(e.name.text.length==0):e.name.text.length?this.sb.push("function "):this.sb.push("function"),this.visitFunctionCommon(e)}visitLiteralExpression(r){switch(r.literalKind){case 0:{this.visitFloatLiteralExpression(r);break}case 1:{this.visitIntegerLiteralExpression(r);break}case 2:{this.visitStringLiteralExpression(r);break}case 3:{this.visitTemplateLiteralExpression(r);break}case 4:{this.visitRegexpLiteralExpression(r);break}case 5:{this.visitArrayLiteralExpression(r);break}case 6:{this.visitObjectLiteralExpression(r);break}default:{assert(!1);break}}}visitFloatLiteralExpression(r){this.sb.push(r.value.toString())}visitInstanceOfExpression(r){this.visitNode(r.expression),this.sb.push(" instanceof "),this.visitTypeNode(r.isType)}visitIntegerLiteralExpression(r){let e=r.range,t=e.source.text.startsWith("-",e.start);this.sb.push(i64_to_string(r.value,!t))}visitStringLiteral(r){let e=this.sb;e.push('"'),e.push(Re(r,34)),e.push('"')}visitStringLiteralExpression(r){this.visitStringLiteral(r.value)}visitTemplateLiteralExpression(r){let e=this.sb,t=r.tag,i=r.parts,s=r.expressions;t&&this.visitNode(t),e.push("`"),e.push(Re(i[0],96)),assert(i.length==s.length+1);for(let a=0,l=s.length;a<l;++a)e.push("${"),this.visitNode(s[a]),e.push("}"),e.push(Re(i[a+1],96));e.push("`")}visitRegexpLiteralExpression(r){let e=this.sb;e.push("/"),e.push(r.pattern),e.push("/"),e.push(r.patternFlags)}visitNewExpression(r){this.sb.push("new "),this.visitTypeName(r.typeName),this.visitArguments(r.typeArguments,r.args)}visitParenthesizedExpression(r){let e=this.sb;e.push("("),this.visitNode(r.expression),e.push(")")}visitPropertyAccessExpression(r){this.visitNode(r.expression),this.sb.push("."),this.visitIdentifierExpression(r.property)}visitTernaryExpression(r){let e=this.sb;this.visitNode(r.condition),e.push(" ? "),this.visitNode(r.ifThen),e.push(" : "),this.visitNode(r.ifElse)}visitUnaryExpression(r){switch(r.kind){case 29:{this.visitUnaryPostfixExpression(r);break}case 30:{this.visitUnaryPrefixExpression(r);break}default:assert(!1)}}visitUnaryPostfixExpression(r){this.visitNode(r.operand),this.sb.push(Le(r.operator))}visitUnaryPrefixExpression(r){this.sb.push(Le(r.operator)),this.visitNode(r.operand)}visitAwaitExpression(r){this.sb.push("await "),this.visitNode(r.operand)}visitNodeAndTerminate(r){this.visitNode(r);let e=this.sb;if(!e.length||r.kind==51||r.kind==42)e.push(`;
309
+ `),W(e,--this.indentLevel),e.push("}")}else e.push("{}")}visitAssertionExpression(r){let e=this.sb;switch(r.assertionKind){case 0:{e.push("<"),this.visitTypeNode(assert(r.toType)),e.push(">"),this.visitNode(r.expression);break}case 1:{this.visitNode(r.expression),e.push(" as "),this.visitTypeNode(assert(r.toType));break}case 2:{this.visitNode(r.expression),e.push("!");break}case 3:{this.visitNode(r.expression),e.push(" as const");break}default:assert(!1)}}visitBinaryExpression(r){let e=this.sb;this.visitNode(r.left),e.push(" "),e.push(Be(r.operator)),e.push(" "),this.visitNode(r.right)}visitCallExpression(r){this.visitNode(r.expression),this.visitArguments(r.typeArguments,r.args)}visitArguments(r,e){let t=this.sb;if(r){let s=r.length;if(s){t.push("<"),this.visitTypeNode(r[0]);for(let a=1;a<s;++a)t.push(", "),this.visitTypeNode(r[a]);t.push(">(")}}else t.push("(");let i=e.length;if(i){this.visitNode(e[0]);for(let s=1;s<i;++s)t.push(", "),this.visitNode(e[s])}t.push(")")}visitClassExpression(r){let e=r.declaration;this.visitClassDeclaration(e)}visitCommaExpression(r){let e=r.expressions,t=assert(e.length);this.visitNode(e[0]);let i=this.sb;for(let s=1;s<t;++s)i.push(","),this.visitNode(e[s])}visitElementAccessExpression(r){let e=this.sb;this.visitNode(r.expression),e.push("["),this.visitNode(r.elementExpression),e.push("]")}visitFunctionExpression(r){let e=r.declaration;e.isAsync&&this.sb.push("async "),e.arrowKind?assert(e.name.text.length==0):e.name.text.length?this.sb.push("function "):this.sb.push("function"),this.visitFunctionCommon(e)}visitLiteralExpression(r){switch(r.literalKind){case 0:{this.visitFloatLiteralExpression(r);break}case 1:{this.visitIntegerLiteralExpression(r);break}case 2:{this.visitStringLiteralExpression(r);break}case 3:{this.visitTemplateLiteralExpression(r);break}case 4:{this.visitRegexpLiteralExpression(r);break}case 5:{this.visitArrayLiteralExpression(r);break}case 6:{this.visitObjectLiteralExpression(r);break}default:{assert(!1);break}}}visitFloatLiteralExpression(r){this.sb.push(r.value.toString())}visitInstanceOfExpression(r){this.visitNode(r.expression),this.sb.push(" instanceof "),this.visitTypeNode(r.isType)}visitIntegerLiteralExpression(r){let e=r.range,t=e.source.text.startsWith("-",e.start);this.sb.push(i64_to_string(r.value,!t))}visitStringLiteral(r){let e=this.sb;e.push('"'),e.push(Re(r,34)),e.push('"')}visitStringLiteralExpression(r){this.visitStringLiteral(r.value)}visitTemplateLiteralExpression(r){let e=this.sb,t=r.tag,i=r.parts,s=r.expressions;t&&this.visitNode(t),e.push("`"),e.push(Re(i[0],96)),assert(i.length==s.length+1);for(let a=0,l=s.length;a<l;++a)e.push("${"),this.visitNode(s[a]),e.push("}"),e.push(Re(i[a+1],96));e.push("`")}visitRegexpLiteralExpression(r){let e=this.sb;e.push("/"),e.push(r.pattern),e.push("/"),e.push(r.patternFlags)}visitNewExpression(r){this.sb.push("new "),this.visitTypeName(r.typeName),this.visitArguments(r.typeArguments,r.args)}visitParenthesizedExpression(r){let e=this.sb;e.push("("),this.visitNode(r.expression),e.push(")")}visitPropertyAccessExpression(r){this.visitNode(r.expression),this.sb.push("."),this.visitIdentifierExpression(r.property)}visitTernaryExpression(r){let e=this.sb;this.visitNode(r.condition),e.push(" ? "),this.visitNode(r.ifThen),e.push(" : "),this.visitNode(r.ifElse)}visitUnaryExpression(r){switch(r.kind){case 29:{this.visitUnaryPostfixExpression(r);break}case 30:{this.visitUnaryPrefixExpression(r);break}default:assert(!1)}}visitUnaryPostfixExpression(r){this.visitNode(r.operand),this.sb.push(Be(r.operator))}visitUnaryPrefixExpression(r){this.sb.push(Be(r.operator)),this.visitNode(r.operand)}visitAwaitExpression(r){this.sb.push("await "),this.visitNode(r.operand)}visitNodeAndTerminate(r){this.visitNode(r);let e=this.sb;if(!e.length||r.kind==51||r.kind==42)e.push(`;
310
310
  `);else{let t=e[e.length-1],i=t.length-1;i>=0&&(t.charCodeAt(i)==125||t.charCodeAt(i)==59)?e.push(`
311
311
  `):e.push(`;
312
312
  `)}}visitBlockStatement(r){let e=this.sb,t=r.statements,i=t.length;if(i){e.push(`{
@@ -333,5 +333,5 @@ declare interface __Record`),i.push(e.id.toString()),i.push(`<TOmittable> {
333
333
  `);let l=r.catchStatements;if(l)for(let o=0,u=l.length;o<u;++o)W(e,t),this.visitNodeAndTerminate(l[o])}let a=r.finallyStatements;if(a){W(e,t-1),e.push(`} finally {
334
334
  `);for(let l=0,o=a.length;l<o;++l)W(e,t),this.visitNodeAndTerminate(a[l])}W(e,t-1),e.push("}")}visitTypeDeclaration(r){let e=r.decorators;if(e)for(let s=0,a=e.length;s<a;++s)this.serializeDecorator(e[s]);let t=this.sb;this.serializeExternalModifiers(r),t.push("type "),this.visitIdentifierExpression(r.name);let i=r.typeParameters;if(i){let s=i.length;if(s){t.push("<");for(let a=0;a<s;++a)this.visitTypeParameter(i[a]);t.push(">")}}t.push(" = "),this.visitTypeNode(r.type)}visitModuleDeclaration(r){let e=this.sb;r.flags&4&&e.push("declare "),e.push('module "'),e.push(Re(r.moduleName,34)),e.push('"')}visitVariableDeclaration(r){this.visitIdentifierExpression(r.name);let e=r.type,t=this.sb;r.flags&16384&&t.push("!"),e&&(t.push(": "),this.visitTypeNode(e));let i=r.initializer;i&&(t.push(" = "),this.visitNode(i))}visitVariableStatement(r){let e=r.decorators;if(e)for(let l=0,o=e.length;l<o;++l)this.serializeDecorator(e[l]);let t=this.sb,i=r.declarations,s=assert(i.length),a=i[0];this.serializeExternalModifiers(a),t.push(a.is(8)?"const ":a.is(16)?"let ":"var "),this.visitVariableDeclaration(r.declarations[0]);for(let l=1;l<s;++l)t.push(", "),this.visitVariableDeclaration(r.declarations[l])}visitWhileStatement(r){let e=this.sb;e.push("while ("),this.visitNode(r.condition);let t=r.body;t.isEmpty?e.push(")"):(e.push(") "),this.visitNode(t))}serializeDecorator(r){let e=this.sb;e.push("@"),this.visitNode(r.name);let t=r.args;if(t){e.push("(");let i=t.length;if(i){this.visitNode(t[0]);for(let s=1;s<i;++s)e.push(", "),this.visitNode(t[s])}e.push(`)
335
335
  `)}else e.push(`
336
- `);W(e,this.indentLevel)}serializeParameter(r){let e=this.sb,t=r.parameterKind,i=r.implicitFieldDeclaration;i&&this.serializeAccessModifiers(i),t==2&&e.push("..."),this.visitIdentifierExpression(r.name);let s=r.type,a=r.initializer;s&&(t==1&&!a&&e.push("?"),De(s)||(e.push(": "),this.visitTypeNode(s))),a&&(e.push(" = "),this.visitNode(a))}serializeExternalModifiers(r){let e=this.sb;r.is(2)?e.push("export "):r.is(1)?e.push("import "):r.is(4)&&e.push("declare ")}serializeAccessModifiers(r){let e=this.sb;r.is(4)&&e.push("declare "),r.is(256)?e.push("public "):r.is(512)?e.push("private "):r.is(1024)&&e.push("protected "),r.is(32)?e.push("static "):r.is(128)&&e.push("abstract "),r.is(64)&&e.push("readonly ")}finish(){let r=this.sb.join("");return this.sb=[],r}};var fee=q_;export{O_ as ASTBuilder,Yr as ArrayLiteralExpression,$t as ArrowKind,vl as AssertionExpression,Xt as AssertionKind,wa as AsyncLowerTransform,sf as AtomicRMWOp,Yl as AwaitExpression,Il as BinaryExpression,Lo as BinaryModule,ti as BinaryOp,zs as BindResult,ro as BlockStatement,Hb as BrOnOp,no as BreakStatement,kl as CallExpression,Ar as Class,cs as ClassDeclaration,Fl as ClassExpression,qs as ClassPrototype,ga as ClosureLowerTransform,wl as CommaExpression,ef as CommentKind,Sl as CommentNode,ze as CommonFlags,B as CommonNames,eo as CompiledExpression,fa as Compiler,Tf as ConditionKind,wf as ConstantValueKind,d_ as Constraints,Rl as ConstructorExpression,io as ContinueStatement,gF as DEFAULT_STACK_SIZE,nt as DeclarationStatement,Tr as DeclaredElement,Lt as DecoratorFlags,Ct as DecoratorKind,Tl as DecoratorNode,ls as DiagnosticCategory,Xe as DiagnosticCode,tt as DiagnosticEmitter,ml as DiagnosticMessage,so as DoStatement,El as DynamicArrayTypeNode,Gs as Element,Cl as ElementAccessExpression,Et as ElementKind,ao as EmptyStatement,tu as Enum,lo as EnumDeclaration,ru as EnumValue,oo as EnumValueDeclaration,gu as EnvAnalysisRecord,fo as ExportDefaultStatement,uo as ExportImportStatement,co as ExportMember,ca as ExportNames,po as ExportStatement,xe as Expression,en as ExpressionId,zo as ExpressionRunnerFlags,_o as ExpressionStatement,nf as ExternalKind,zF as FEATURES_ALL,DF as FEATURES_DEFAULT,SF as FEATURE_BULK_MEMORY,kF as FEATURE_EXCEPTION_HANDLING,BF as FEATURE_EXTENDED_CONST,CF as FEATURE_GC,PF as FEATURE_MEMORY64,RF as FEATURE_MULTI_VALUE,AF as FEATURE_MUTABLE_GLOBALS,TF as FEATURE_NONTRAPPING_F2I,wF as FEATURE_REFERENCE_TYPES,NF as FEATURE_RELAXED_SIMD,MF as FEATURE_SHARED_EVERYTHING,EF as FEATURE_SIGN_EXTENSION,vF as FEATURE_SIMD,LF as FEATURE_STRINGREF,FF as FEATURE_TAIL_CALLS,IF as FEATURE_THREADS,Xl as FalseExpression,Ft as Feature,Mo as FeatureFlags,ho as FieldDeclaration,Af as FieldFlags,Vs as File,bl as FixedArrayTypeNode,Pl as FloatLiteralExpression,er as Flow,Ho as FlowFlags,yo as ForOfStatement,mo as ForStatement,Mt as Function,ps as FunctionDeclaration,Nl as FunctionExpression,ot as FunctionPrototype,Zr as FunctionTypeNode,nl as GETTER_PREFIX,tn as Global,Ie as HeapTypeRef,Qe as INDEX_SUFFIX,zp as INNER_DELIMITER,Mp as INSTANCE_DELIMITER,rt as IdentifierExpression,Yp as IdentifierHandling,go as IfStatement,bo as ImportDeclaration,gi as ImportNames,fs as ImportStatement,Ps as IndexSignature,to as IndexSignatureNode,Bl as InstanceOfExpression,Ll as IntegerLiteralExpression,Ns as Interface,xo as InterfaceDeclaration,nu as InterfacePrototype,_i as JSBuilder,wt as LIBRARY_PREFIX,Rb as LIBRARY_SUBST,Jl as LazyExpression,Rt as LiteralExpression,ft as LiteralKind,ce as Local,ws as LocalFlags,_s as MemoryModel,ii as MemoryModelCode,Ob as MemoryOrder,ei as MemorySegment,Jr as MethodDeclaration,Jt as Module,ko as ModuleDeclaration,$r as NamedTypeNode,Os as Namespace,Eo as NamespaceDeclaration,Ml as NewExpression,y as Node,Ze as NodeKind,zl as NullExpression,Dl as ObjectLiteralExpression,Gl as OmittedExpression,Me as OperatorKind,pa as Options,GE as PARENT_SUBST,mt as PATH_DELIMITER,ms as PackedType,If as Parameter,Qt as ParameterKind,Zn as ParameterNode,Ul as ParenthesizedExpression,Ms as Parser,nx as Precedence,Ds as Program,Cs as Property,Vl as PropertyAccessExpression,ai as PropertyPrototype,ue as Range,qb as RefAsOp,Ol as RegexpLiteralExpression,Bo as Relooper,Zo as ReportMode,Rs as Resolver,Ao as ReturnStatement,tl as Runtime,h_ as RuntimeFeatures,il as SETTER_PREFIX,af as SIMDExtractOp,uf as SIMDLoadOp,cf as SIMDLoadStoreLaneOp,lf as SIMDReplaceOp,of as SIMDShiftOp,pf as SIMDTernaryOp,es as STATIC_DELIMITER,Dp as STUB_DELIMITER,Ef as SideEffects,fe as Signature,Te as Source,Jn as SourceKind,yl as State,ye as Statement,Xb as StringEncodeOp,$b as StringEqOp,Wl as StringLiteralExpression,Qb as StringMeasureOp,jb as StringNewOp,Kl as SuperExpression,ys as SwitchBuilder,To as SwitchCase,So as SwitchStatement,bi as TSDBuilder,Un as Target,Hl as TemplateLiteralExpression,ql as TernaryExpression,jl as ThisExpression,vo as ThrowStatement,bt as Token,os as Tokenizer,Ql as TrueExpression,Io as TryStatement,gl as TupleTypeNode,p as Type,rf as TypeBuilderErrorReason,Fo as TypeDeclaration,lt as TypeDefinition,Bt as TypeFlags,Er as TypeKind,$n as TypeName,jt as TypeNode,Al as TypeParameterNode,P as TypeRef,nr as TypedElement,Vn as Typeinfo,rl as TypeinfoFlags,us as UnaryExpression,gs as UnaryOp,$l as UnaryPostfixExpression,Zl as UnaryPrefixExpression,jo as UncheckedBehavior,xl as UnmanagedArrayTypeNode,wo as VariableDeclaration,Yn as VariableLikeDeclarationStatement,rn as VariableLikeElement,Ro as VariableStatement,Co as VoidStatement,Po as WhileStatement,Wb as WideIntAddSubOp,Kb as WideIntMulOp,fF as addGlobalAlias,Ee as allocPtrArray,$x as applyInTreeTransforms,fw as buildJS,pw as buildTSD,cw as compile,it as createType,fee as default,pu as defaultFeatures,Db as diagnosticCategoryToColor,$p as diagnosticCategoryToString,al as diagnosticCodeToString,Fs as ensureType,ff as expandType,Gn as featureToString,Zt as findDecorator,Gb as formatDiagnostic,Gb as formatDiagnosticMessage,at as getBinaryLeft,ri as getBinaryOp,We as getBinaryRight,_w as getBinaryenModuleRef,Ss as getBlockChildAt,Ts as getBlockChildCount,As as getBlockName,x1 as getBreakCondition,b1 as getBreakName,Je as getCallOperandAt,Nt as getCallOperandCount,Is as getCallTarget,Ce as getConstValueF32,Pe as getConstValueF64,ae as getConstValueI32,Ge as getConstValueI64High,Ne as getConstValueI64Low,_f as getConstValueInteger,df as getConstValueV128,lx as getDefaultParameterName,ow as getDependee,XF as getDiagnosticCategory,QF as getDiagnosticCode,$F as getDiagnosticMessage,ZF as getDiagnosticRange,YF as getDiagnosticRelatedRange,A1 as getDropValue,re as getExpressionId,pe as getExpressionType,v1 as getFunctionBody,bf as getFunctionName,I1 as getFunctionParams,k1 as getFunctionResults,F1 as getFunctionVars,xs as getGlobalGetName,C1 as getGlobalInit,w1 as getGlobalName,R1 as getGlobalType,qo as getIfCondition,ni as getIfFalse,vs as getIfTrue,hf as getLoadBytes,p1 as getLoadOffset,f1 as getLoadPtr,Pt as getLocalGetIndex,Uo as getLocalSetIndex,Vo as getLocalSetValue,g1 as getLoopBody,y1 as getLoopName,S1 as getMemoryGrowDelta,ew as getRangeEnd,tw as getRangeSource,JF as getRangeStart,T1 as getReturnValue,E1 as getSelectCondition,gf as getSelectElse,yf as getSelectThen,ks as getSideEffects,jF as getSource,rw as getSourceNormalizedPath,_1 as getStoreBytes,d1 as getStoreOffset,h1 as getStorePtr,m1 as getStoreValue,P1 as getTagName,N1 as getTagParams,B1 as getTagResults,Es as getUnaryOp,Oo as getUnaryValue,uw as initializeProgram,Go as isConstExpressionNaN,c1 as isConstNaN,Do as isConstNegZero,xt as isConstNonZero,st as isConstZero,Us as isDeclaredElement,sw as isError,xf as isGlobalMutable,Jp as isIllegalVariableIdentifier,nw as isInfo,mf as isLoadSigned,bs as isLocalTee,Zb as isNullableType,De as isTypeOmitted,Xo as isTypedElement,iw as isWarning,Ke as mangleInternalName,ds as mangleInternalPath,Wo as mustPreserveSideEffects,Zk as newOptions,KF as newProgram,HF as nextDiagnostic,lw as nextFile,Le as operatorTokenToString,hw as optimize,aw as parse,Ye as readString,_F as removeGlobalAlias,di as runtimeFunctions,hi as runtimeGlobals,VF as setBasenameHint,OF as setBindingsHint,xF as setBundleVersion,WF as setDebugInfo,tF as setExportMemory,yF as setExportRuntime,dF as setExportStart,lF as setExportTable,GF as setFeature,rF as setImportMemory,aF as setImportTable,nF as setInitialMemory,mF as setLowMemoryLimit,iF as setMaximumMemory,cF as setMemoryBase,eF as setNoAssert,hF as setNoUnsafe,UF as setOptimizeLevelHints,qF as setPedantic,Jk as setRuntime,sF as setSharedMemory,oF as setSourceMap,bF as setStackSize,pF as setTableBase,Yk as setTarget,uF as setUncheckedBehavior,Ub as tokenFromKeyword,Vb as tokenIsAlsoIdentifier,$1 as typesToRefs,$o as typesToString,Xp as util,dw as validate};
336
+ `);W(e,this.indentLevel)}serializeParameter(r){let e=this.sb,t=r.parameterKind,i=r.implicitFieldDeclaration;i&&this.serializeAccessModifiers(i),t==2&&e.push("..."),this.visitIdentifierExpression(r.name);let s=r.type,a=r.initializer;s&&(t==1&&!a&&e.push("?"),De(s)||(e.push(": "),this.visitTypeNode(s))),a&&(e.push(" = "),this.visitNode(a))}serializeExternalModifiers(r){let e=this.sb;r.is(2)?e.push("export "):r.is(1)?e.push("import "):r.is(4)&&e.push("declare ")}serializeAccessModifiers(r){let e=this.sb;r.is(4)&&e.push("declare "),r.is(256)?e.push("public "):r.is(512)?e.push("private "):r.is(1024)&&e.push("protected "),r.is(32)?e.push("static "):r.is(128)&&e.push("abstract "),r.is(64)&&e.push("readonly ")}finish(){let r=this.sb.join("");return this.sb=[],r}};var fee=q_;export{O_ as ASTBuilder,Yr as ArrayLiteralExpression,Zt as ArrowKind,vl as AssertionExpression,Xt as AssertionKind,wa as AsyncLowerTransform,sf as AtomicRMWOp,Yl as AwaitExpression,Il as BinaryExpression,Bo as BinaryModule,ti as BinaryOp,zs as BindResult,ro as BlockStatement,Hb as BrOnOp,no as BreakStatement,kl as CallExpression,Ar as Class,cs as ClassDeclaration,Fl as ClassExpression,qs as ClassPrototype,ga as ClosureLowerTransform,wl as CommaExpression,ef as CommentKind,Sl as CommentNode,ze as CommonFlags,L as CommonNames,eo as CompiledExpression,fa as Compiler,Tf as ConditionKind,wf as ConstantValueKind,d_ as Constraints,Rl as ConstructorExpression,io as ContinueStatement,gF as DEFAULT_STACK_SIZE,nt as DeclarationStatement,Tr as DeclaredElement,Bt as DecoratorFlags,Ct as DecoratorKind,Tl as DecoratorNode,ls as DiagnosticCategory,Xe as DiagnosticCode,tt as DiagnosticEmitter,ml as DiagnosticMessage,so as DoStatement,El as DynamicArrayTypeNode,Gs as Element,Cl as ElementAccessExpression,Et as ElementKind,ao as EmptyStatement,tu as Enum,lo as EnumDeclaration,ru as EnumValue,oo as EnumValueDeclaration,gu as EnvAnalysisRecord,fo as ExportDefaultStatement,uo as ExportImportStatement,co as ExportMember,ca as ExportNames,po as ExportStatement,xe as Expression,en as ExpressionId,zo as ExpressionRunnerFlags,_o as ExpressionStatement,nf as ExternalKind,zF as FEATURES_ALL,DF as FEATURES_DEFAULT,SF as FEATURE_BULK_MEMORY,kF as FEATURE_EXCEPTION_HANDLING,LF as FEATURE_EXTENDED_CONST,CF as FEATURE_GC,PF as FEATURE_MEMORY64,RF as FEATURE_MULTI_VALUE,AF as FEATURE_MUTABLE_GLOBALS,TF as FEATURE_NONTRAPPING_F2I,wF as FEATURE_REFERENCE_TYPES,NF as FEATURE_RELAXED_SIMD,MF as FEATURE_SHARED_EVERYTHING,EF as FEATURE_SIGN_EXTENSION,vF as FEATURE_SIMD,BF as FEATURE_STRINGREF,FF as FEATURE_TAIL_CALLS,IF as FEATURE_THREADS,Xl as FalseExpression,Ft as Feature,Mo as FeatureFlags,ho as FieldDeclaration,Af as FieldFlags,Vs as File,bl as FixedArrayTypeNode,Pl as FloatLiteralExpression,er as Flow,Ho as FlowFlags,yo as ForOfStatement,mo as ForStatement,Mt as Function,ps as FunctionDeclaration,Nl as FunctionExpression,ot as FunctionPrototype,$r as FunctionTypeNode,nl as GETTER_PREFIX,tn as Global,Ie as HeapTypeRef,Qe as INDEX_SUFFIX,zp as INNER_DELIMITER,Mp as INSTANCE_DELIMITER,rt as IdentifierExpression,Yp as IdentifierHandling,go as IfStatement,bo as ImportDeclaration,gi as ImportNames,fs as ImportStatement,Ps as IndexSignature,to as IndexSignatureNode,Ll as InstanceOfExpression,Bl as IntegerLiteralExpression,Ns as Interface,xo as InterfaceDeclaration,nu as InterfacePrototype,_i as JSBuilder,wt as LIBRARY_PREFIX,Rb as LIBRARY_SUBST,Jl as LazyExpression,Rt as LiteralExpression,ft as LiteralKind,pe as Local,ws as LocalFlags,_s as MemoryModel,ii as MemoryModelCode,Ob as MemoryOrder,ei as MemorySegment,Jr as MethodDeclaration,Jt as Module,ko as ModuleDeclaration,Zr as NamedTypeNode,Os as Namespace,Eo as NamespaceDeclaration,Ml as NewExpression,y as Node,$e as NodeKind,zl as NullExpression,Dl as ObjectLiteralExpression,Gl as OmittedExpression,Me as OperatorKind,pa as Options,GE as PARENT_SUBST,mt as PATH_DELIMITER,ms as PackedType,If as Parameter,Qt as ParameterKind,$n as ParameterNode,Ul as ParenthesizedExpression,Ms as Parser,nx as Precedence,Ds as Program,Cs as Property,Vl as PropertyAccessExpression,ai as PropertyPrototype,ce as Range,qb as RefAsOp,Ol as RegexpLiteralExpression,Lo as Relooper,$o as ReportMode,Rs as Resolver,Ao as ReturnStatement,tl as Runtime,h_ as RuntimeFeatures,il as SETTER_PREFIX,af as SIMDExtractOp,uf as SIMDLoadOp,cf as SIMDLoadStoreLaneOp,lf as SIMDReplaceOp,of as SIMDShiftOp,pf as SIMDTernaryOp,es as STATIC_DELIMITER,Dp as STUB_DELIMITER,Ef as SideEffects,oe as Signature,Te as Source,Jn as SourceKind,yl as State,ye as Statement,Xb as StringEncodeOp,Zb as StringEqOp,Wl as StringLiteralExpression,Qb as StringMeasureOp,jb as StringNewOp,Kl as SuperExpression,ys as SwitchBuilder,To as SwitchCase,So as SwitchStatement,bi as TSDBuilder,Un as Target,Hl as TemplateLiteralExpression,ql as TernaryExpression,jl as ThisExpression,vo as ThrowStatement,bt as Token,os as Tokenizer,Ql as TrueExpression,Io as TryStatement,gl as TupleTypeNode,p as Type,rf as TypeBuilderErrorReason,Fo as TypeDeclaration,lt as TypeDefinition,Lt as TypeFlags,Er as TypeKind,Zn as TypeName,jt as TypeNode,Al as TypeParameterNode,P as TypeRef,nr as TypedElement,Vn as Typeinfo,rl as TypeinfoFlags,us as UnaryExpression,gs as UnaryOp,Zl as UnaryPostfixExpression,$l as UnaryPrefixExpression,jo as UncheckedBehavior,xl as UnmanagedArrayTypeNode,wo as VariableDeclaration,Yn as VariableLikeDeclarationStatement,rn as VariableLikeElement,Ro as VariableStatement,Co as VoidStatement,Po as WhileStatement,Wb as WideIntAddSubOp,Kb as WideIntMulOp,fF as addGlobalAlias,Ee as allocPtrArray,Zx as applyInTreeTransforms,fw as buildJS,pw as buildTSD,cw as compile,it as createType,fee as default,pu as defaultFeatures,Db as diagnosticCategoryToColor,Zp as diagnosticCategoryToString,al as diagnosticCodeToString,Fs as ensureType,ff as expandType,Gn as featureToString,$t as findDecorator,Gb as formatDiagnostic,Gb as formatDiagnosticMessage,at as getBinaryLeft,ri as getBinaryOp,We as getBinaryRight,_w as getBinaryenModuleRef,Ss as getBlockChildAt,Ts as getBlockChildCount,As as getBlockName,x1 as getBreakCondition,b1 as getBreakName,Je as getCallOperandAt,Nt as getCallOperandCount,Is as getCallTarget,Ce as getConstValueF32,Pe as getConstValueF64,ae as getConstValueI32,Ge as getConstValueI64High,Ne as getConstValueI64Low,_f as getConstValueInteger,df as getConstValueV128,lx as getDefaultParameterName,ow as getDependee,XF as getDiagnosticCategory,QF as getDiagnosticCode,ZF as getDiagnosticMessage,$F as getDiagnosticRange,YF as getDiagnosticRelatedRange,A1 as getDropValue,re as getExpressionId,fe as getExpressionType,v1 as getFunctionBody,bf as getFunctionName,I1 as getFunctionParams,k1 as getFunctionResults,F1 as getFunctionVars,xs as getGlobalGetName,C1 as getGlobalInit,w1 as getGlobalName,R1 as getGlobalType,qo as getIfCondition,ni as getIfFalse,vs as getIfTrue,hf as getLoadBytes,p1 as getLoadOffset,f1 as getLoadPtr,Pt as getLocalGetIndex,Uo as getLocalSetIndex,Vo as getLocalSetValue,g1 as getLoopBody,y1 as getLoopName,S1 as getMemoryGrowDelta,ew as getRangeEnd,tw as getRangeSource,JF as getRangeStart,T1 as getReturnValue,E1 as getSelectCondition,gf as getSelectElse,yf as getSelectThen,ks as getSideEffects,jF as getSource,rw as getSourceNormalizedPath,_1 as getStoreBytes,d1 as getStoreOffset,h1 as getStorePtr,m1 as getStoreValue,P1 as getTagName,N1 as getTagParams,L1 as getTagResults,Es as getUnaryOp,Oo as getUnaryValue,uw as initializeProgram,Go as isConstExpressionNaN,c1 as isConstNaN,Do as isConstNegZero,xt as isConstNonZero,st as isConstZero,Us as isDeclaredElement,sw as isError,xf as isGlobalMutable,Jp as isIllegalVariableIdentifier,nw as isInfo,mf as isLoadSigned,bs as isLocalTee,$b as isNullableType,De as isTypeOmitted,Xo as isTypedElement,iw as isWarning,Ke as mangleInternalName,ds as mangleInternalPath,Wo as mustPreserveSideEffects,$3 as newOptions,KF as newProgram,HF as nextDiagnostic,lw as nextFile,Be as operatorTokenToString,hw as optimize,aw as parse,Ye as readString,_F as removeGlobalAlias,di as runtimeFunctions,hi as runtimeGlobals,VF as setBasenameHint,OF as setBindingsHint,xF as setBundleVersion,WF as setDebugInfo,tF as setExportMemory,yF as setExportRuntime,dF as setExportStart,lF as setExportTable,GF as setFeature,rF as setImportMemory,aF as setImportTable,nF as setInitialMemory,mF as setLowMemoryLimit,iF as setMaximumMemory,cF as setMemoryBase,eF as setNoAssert,hF as setNoUnsafe,UF as setOptimizeLevelHints,qF as setPedantic,J3 as setRuntime,sF as setSharedMemory,oF as setSourceMap,bF as setStackSize,pF as setTableBase,Y3 as setTarget,uF as setUncheckedBehavior,Ub as tokenFromKeyword,Vb as tokenIsAlsoIdentifier,Z1 as typesToRefs,Zo as typesToString,Xp as util,dw as validate};
337
337
  //# sourceMappingURL=assemblyscript.js.map