@nekzus/liop 2.1.0-beta.1 → 2.1.0-beta.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.
@@ -1,26 +1,26 @@
1
- import {b as b$2,a as a$4}from'./chunk-2MGFSIXN.js';import {b as b$1,a as a$3}from'./chunk-SB5XJXKV.js';import {a,b}from'./chunk-V5MKJT6S.js';import {a as a$2}from'./chunk-DQ6UW6L7.js';import {a as a$1}from'./chunk-S6RJHZV2.js';import {Buffer}from'buffer';import de from'crypto';import*as j from'fs';import {createRequire}from'module';import Se from'path';import {fileURLToPath,pathToFileURL}from'url';import*as H from'@grpc/grpc-js';import {createMlKem768}from'mlkem';import {Piscina,FixedQueue}from'piscina';import*as _e from'jose';import ur from'oidc-provider';var Ct=Symbol("Let zodToJsonSchema decide on which parser to use");var Pt={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:true,rejectedAdditionalProperties:false,definitionPath:"definitions",target:"jsonSchema7",strictUnions:false,definitions:{},errorMessages:false,markdownDescription:false,patternStrategy:"escape",applyRegexFlags:false,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},It=e=>({...Pt,...e});var Tt=e=>{let t=It(e),i=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return {...t,flags:{hasReferencedOpenAiAnyType:false},currentPath:i,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,s])=>[s._def,{def:s._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}};function et(e,t,i,r){r?.errorMessages&&i&&(e.errorMessage={...e.errorMessage,[t]:i});}function P(e,t,i,r,s){e[t]=i,et(e,t,r,s);}var Re=(e,t)=>{let i=0;for(;i<e.length&&i<t.length&&e[i]===t[i];i++);return [(e.length-i).toString(),...t.slice(i)].join("/")};function R(e){if(e.target!=="openAi")return {};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=true,{$ref:e.$refStrategy==="relative"?Re(t,e.currentPath):t.join("/")}}function Nt(e,t){let i={type:"array"};return e.type?._def&&e.type?._def?.typeName!==a$4.ZodAny&&(i.items=v(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&P(i,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&P(i,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(P(i,"minItems",e.exactLength.value,e.exactLength.message,t),P(i,"maxItems",e.exactLength.value,e.exactLength.message,t)),i}function Rt(e,t){let i={type:"integer",format:"int64"};if(!e.checks)return i;for(let r of e.checks)switch(r.kind){case "min":t.target==="jsonSchema7"?r.inclusive?P(i,"minimum",r.value,r.message,t):P(i,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(i.exclusiveMinimum=true),P(i,"minimum",r.value,r.message,t));break;case "max":t.target==="jsonSchema7"?r.inclusive?P(i,"maximum",r.value,r.message,t):P(i,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(i.exclusiveMaximum=true),P(i,"maximum",r.value,r.message,t));break;case "multipleOf":P(i,"multipleOf",r.value,r.message,t);break}return i}function Lt(){return {type:"boolean"}}function Le(e,t){return v(e.type._def,t)}var Ot=(e,t)=>v(e.innerType._def,t);function tt(e,t,i){let r=i??t.dateStrategy;if(Array.isArray(r))return {anyOf:r.map((s,n)=>tt(e,t,s))};switch(r){case "string":case "format:date-time":return {type:"string",format:"date-time"};case "format:date":return {type:"string",format:"date"};case "integer":return Xi(e,t)}}var Xi=(e,t)=>{let i={type:"integer",format:"unix-time"};if(t.target==="openApi3")return i;for(let r of e.checks)switch(r.kind){case "min":P(i,"minimum",r.value,r.message,t);break;case "max":P(i,"maximum",r.value,r.message,t);break}return i};function Dt(e,t){return {...v(e.innerType._def,t),default:e.defaultValue()}}function Mt(e,t){return t.effectStrategy==="input"?v(e.schema._def,t):R(t)}function Ft(e){return {type:"string",enum:Array.from(e.values)}}var er=e=>"type"in e&&e.type==="string"?false:"allOf"in e;function Vt(e,t){let i=[v(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),v(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(n=>!!n),r=t.target==="jsonSchema2019-09"?{unevaluatedProperties:false}:void 0,s=[];return i.forEach(n=>{if(er(n))s.push(...n.allOf),n.unevaluatedProperties===void 0&&(r=void 0);else {let a=n;if("additionalProperties"in n&&n.additionalProperties===false){let{additionalProperties:u,...c}=n;a=c;}else r=void 0;s.push(a);}}),s.length?{allOf:s,...r}:void 0}function jt(e,t){let i=typeof e.value;return i!=="bigint"&&i!=="number"&&i!=="boolean"&&i!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:i==="bigint"?"integer":i,enum:[e.value]}:{type:i==="bigint"?"integer":i,const:e.value}}var it,te={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(it===void 0&&(it=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),it),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Oe(e,t){let i={type:"string"};if(e.checks)for(let r of e.checks)switch(r.kind){case "min":P(i,"minLength",typeof i.minLength=="number"?Math.max(i.minLength,r.value):r.value,r.message,t);break;case "max":P(i,"maxLength",typeof i.maxLength=="number"?Math.min(i.maxLength,r.value):r.value,r.message,t);break;case "email":switch(t.emailStrategy){case "format:email":ie(i,"email",r.message,t);break;case "format:idn-email":ie(i,"idn-email",r.message,t);break;case "pattern:zod":U(i,te.email,r.message,t);break}break;case "url":ie(i,"uri",r.message,t);break;case "uuid":ie(i,"uuid",r.message,t);break;case "regex":U(i,r.regex,r.message,t);break;case "cuid":U(i,te.cuid,r.message,t);break;case "cuid2":U(i,te.cuid2,r.message,t);break;case "startsWith":U(i,RegExp(`^${rt(r.value,t)}`),r.message,t);break;case "endsWith":U(i,RegExp(`${rt(r.value,t)}$`),r.message,t);break;case "datetime":ie(i,"date-time",r.message,t);break;case "date":ie(i,"date",r.message,t);break;case "time":ie(i,"time",r.message,t);break;case "duration":ie(i,"duration",r.message,t);break;case "length":P(i,"minLength",typeof i.minLength=="number"?Math.max(i.minLength,r.value):r.value,r.message,t),P(i,"maxLength",typeof i.maxLength=="number"?Math.min(i.maxLength,r.value):r.value,r.message,t);break;case "includes":{U(i,RegExp(rt(r.value,t)),r.message,t);break}case "ip":{r.version!=="v6"&&ie(i,"ipv4",r.message,t),r.version!=="v4"&&ie(i,"ipv6",r.message,t);break}case "base64url":U(i,te.base64url,r.message,t);break;case "jwt":U(i,te.jwt,r.message,t);break;case "cidr":{r.version!=="v6"&&U(i,te.ipv4Cidr,r.message,t),r.version!=="v4"&&U(i,te.ipv6Cidr,r.message,t);break}case "emoji":U(i,te.emoji(),r.message,t);break;case "ulid":{U(i,te.ulid,r.message,t);break}case "base64":{switch(t.base64Strategy){case "format:binary":{ie(i,"binary",r.message,t);break}case "contentEncoding:base64":{P(i,"contentEncoding","base64",r.message,t);break}case "pattern:zod":{U(i,te.base64,r.message,t);break}}break}case "nanoid":U(i,te.nanoid,r.message,t);}return i}function rt(e,t){return t.patternStrategy==="escape"?ir(e):e}var tr=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function ir(e){let t="";for(let i=0;i<e.length;i++)tr.has(e[i])||(t+="\\"),t+=e[i];return t}function ie(e,t,i,r){e.format||e.anyOf?.some(s=>s.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...i&&r.errorMessages&&{errorMessage:{format:i}}})):P(e,"format",t,i,r);}function U(e,t,i,r){e.pattern||e.allOf?.some(s=>s.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:Bt(t,r),...i&&r.errorMessages&&{errorMessage:{pattern:i}}})):P(e,"pattern",Bt(t,r),i,r);}function Bt(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let i={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=i.i?e.source.toLowerCase():e.source,s="",n=false,a=false,u=false;for(let c=0;c<r.length;c++){if(n){s+=r[c],n=false;continue}if(i.i){if(a){if(r[c].match(/[a-z]/)){u?(s+=r[c],s+=`${r[c-2]}-${r[c]}`.toUpperCase(),u=false):r[c+1]==="-"&&r[c+2]?.match(/[a-z]/)?(s+=r[c],u=true):s+=`${r[c]}${r[c].toUpperCase()}`;continue}}else if(r[c].match(/[a-z]/)){s+=`[${r[c]}${r[c].toUpperCase()}]`;continue}}if(i.m){if(r[c]==="^"){s+=`(^|(?<=[\r
1
+ import {b as b$3,a as a$4}from'./chunk-2MGFSIXN.js';import {b as b$2,a as a$3}from'./chunk-SB5XJXKV.js';import {a,b as b$1}from'./chunk-V5MKJT6S.js';import {a as a$2}from'./chunk-DQ6UW6L7.js';import {a as a$1}from'./chunk-S6RJHZV2.js';import {Buffer}from'buffer';import me from'crypto';import*as R from'fs';import {createRequire}from'module';import le from'path';import {fileURLToPath,pathToFileURL}from'url';import*as Z from'@grpc/grpc-js';import {createMlKem768}from'mlkem';import {Piscina,FixedQueue}from'piscina';import*as Ee from'jose';import ur from'oidc-provider';var Ct=Symbol("Let zodToJsonSchema decide on which parser to use");var Pt={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:true,rejectedAdditionalProperties:false,definitionPath:"definitions",target:"jsonSchema7",strictUnions:false,definitions:{},errorMessages:false,markdownDescription:false,patternStrategy:"escape",applyRegexFlags:false,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},It=e=>({...Pt,...e});var Tt=e=>{let t=It(e),i=t.name!==void 0?[...t.basePath,t.definitionPath,t.name]:t.basePath;return {...t,flags:{hasReferencedOpenAiAnyType:false},currentPath:i,propertyPath:void 0,seen:new Map(Object.entries(t.definitions).map(([r,s])=>[s._def,{def:s._def,path:[...t.basePath,t.definitionPath,r],jsonSchema:void 0}]))}};function et(e,t,i,r){r?.errorMessages&&i&&(e.errorMessage={...e.errorMessage,[t]:i});}function P(e,t,i,r,s){e[t]=i,et(e,t,r,s);}var Re=(e,t)=>{let i=0;for(;i<e.length&&i<t.length&&e[i]===t[i];i++);return [(e.length-i).toString(),...t.slice(i)].join("/")};function L(e){if(e.target!=="openAi")return {};let t=[...e.basePath,e.definitionPath,e.openAiAnyTypeName];return e.flags.hasReferencedOpenAiAnyType=true,{$ref:e.$refStrategy==="relative"?Re(t,e.currentPath):t.join("/")}}function Nt(e,t){let i={type:"array"};return e.type?._def&&e.type?._def?.typeName!==a$4.ZodAny&&(i.items=b(e.type._def,{...t,currentPath:[...t.currentPath,"items"]})),e.minLength&&P(i,"minItems",e.minLength.value,e.minLength.message,t),e.maxLength&&P(i,"maxItems",e.maxLength.value,e.maxLength.message,t),e.exactLength&&(P(i,"minItems",e.exactLength.value,e.exactLength.message,t),P(i,"maxItems",e.exactLength.value,e.exactLength.message,t)),i}function Rt(e,t){let i={type:"integer",format:"int64"};if(!e.checks)return i;for(let r of e.checks)switch(r.kind){case "min":t.target==="jsonSchema7"?r.inclusive?P(i,"minimum",r.value,r.message,t):P(i,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(i.exclusiveMinimum=true),P(i,"minimum",r.value,r.message,t));break;case "max":t.target==="jsonSchema7"?r.inclusive?P(i,"maximum",r.value,r.message,t):P(i,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(i.exclusiveMaximum=true),P(i,"maximum",r.value,r.message,t));break;case "multipleOf":P(i,"multipleOf",r.value,r.message,t);break}return i}function Lt(){return {type:"boolean"}}function Le(e,t){return b(e.type._def,t)}var Ot=(e,t)=>b(e.innerType._def,t);function tt(e,t,i){let r=i??t.dateStrategy;if(Array.isArray(r))return {anyOf:r.map((s,n)=>tt(e,t,s))};switch(r){case "string":case "format:date-time":return {type:"string",format:"date-time"};case "format:date":return {type:"string",format:"date"};case "integer":return Xi(e,t)}}var Xi=(e,t)=>{let i={type:"integer",format:"unix-time"};if(t.target==="openApi3")return i;for(let r of e.checks)switch(r.kind){case "min":P(i,"minimum",r.value,r.message,t);break;case "max":P(i,"maximum",r.value,r.message,t);break}return i};function Dt(e,t){return {...b(e.innerType._def,t),default:e.defaultValue()}}function Mt(e,t){return t.effectStrategy==="input"?b(e.schema._def,t):L(t)}function Ft(e){return {type:"string",enum:Array.from(e.values)}}var er=e=>"type"in e&&e.type==="string"?false:"allOf"in e;function Vt(e,t){let i=[b(e.left._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),b(e.right._def,{...t,currentPath:[...t.currentPath,"allOf","1"]})].filter(n=>!!n),r=t.target==="jsonSchema2019-09"?{unevaluatedProperties:false}:void 0,s=[];return i.forEach(n=>{if(er(n))s.push(...n.allOf),n.unevaluatedProperties===void 0&&(r=void 0);else {let a=n;if("additionalProperties"in n&&n.additionalProperties===false){let{additionalProperties:u,...c}=n;a=c;}else r=void 0;s.push(a);}}),s.length?{allOf:s,...r}:void 0}function jt(e,t){let i=typeof e.value;return i!=="bigint"&&i!=="number"&&i!=="boolean"&&i!=="string"?{type:Array.isArray(e.value)?"array":"object"}:t.target==="openApi3"?{type:i==="bigint"?"integer":i,enum:[e.value]}:{type:i==="bigint"?"integer":i,const:e.value}}var it,te={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(it===void 0&&(it=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),it),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};function Oe(e,t){let i={type:"string"};if(e.checks)for(let r of e.checks)switch(r.kind){case "min":P(i,"minLength",typeof i.minLength=="number"?Math.max(i.minLength,r.value):r.value,r.message,t);break;case "max":P(i,"maxLength",typeof i.maxLength=="number"?Math.min(i.maxLength,r.value):r.value,r.message,t);break;case "email":switch(t.emailStrategy){case "format:email":ie(i,"email",r.message,t);break;case "format:idn-email":ie(i,"idn-email",r.message,t);break;case "pattern:zod":z(i,te.email,r.message,t);break}break;case "url":ie(i,"uri",r.message,t);break;case "uuid":ie(i,"uuid",r.message,t);break;case "regex":z(i,r.regex,r.message,t);break;case "cuid":z(i,te.cuid,r.message,t);break;case "cuid2":z(i,te.cuid2,r.message,t);break;case "startsWith":z(i,RegExp(`^${rt(r.value,t)}`),r.message,t);break;case "endsWith":z(i,RegExp(`${rt(r.value,t)}$`),r.message,t);break;case "datetime":ie(i,"date-time",r.message,t);break;case "date":ie(i,"date",r.message,t);break;case "time":ie(i,"time",r.message,t);break;case "duration":ie(i,"duration",r.message,t);break;case "length":P(i,"minLength",typeof i.minLength=="number"?Math.max(i.minLength,r.value):r.value,r.message,t),P(i,"maxLength",typeof i.maxLength=="number"?Math.min(i.maxLength,r.value):r.value,r.message,t);break;case "includes":{z(i,RegExp(rt(r.value,t)),r.message,t);break}case "ip":{r.version!=="v6"&&ie(i,"ipv4",r.message,t),r.version!=="v4"&&ie(i,"ipv6",r.message,t);break}case "base64url":z(i,te.base64url,r.message,t);break;case "jwt":z(i,te.jwt,r.message,t);break;case "cidr":{r.version!=="v6"&&z(i,te.ipv4Cidr,r.message,t),r.version!=="v4"&&z(i,te.ipv6Cidr,r.message,t);break}case "emoji":z(i,te.emoji(),r.message,t);break;case "ulid":{z(i,te.ulid,r.message,t);break}case "base64":{switch(t.base64Strategy){case "format:binary":{ie(i,"binary",r.message,t);break}case "contentEncoding:base64":{P(i,"contentEncoding","base64",r.message,t);break}case "pattern:zod":{z(i,te.base64,r.message,t);break}}break}case "nanoid":z(i,te.nanoid,r.message,t);}return i}function rt(e,t){return t.patternStrategy==="escape"?ir(e):e}var tr=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789");function ir(e){let t="";for(let i=0;i<e.length;i++)tr.has(e[i])||(t+="\\"),t+=e[i];return t}function ie(e,t,i,r){e.format||e.anyOf?.some(s=>s.format)?(e.anyOf||(e.anyOf=[]),e.format&&(e.anyOf.push({format:e.format,...e.errorMessage&&r.errorMessages&&{errorMessage:{format:e.errorMessage.format}}}),delete e.format,e.errorMessage&&(delete e.errorMessage.format,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.anyOf.push({format:t,...i&&r.errorMessages&&{errorMessage:{format:i}}})):P(e,"format",t,i,r);}function z(e,t,i,r){e.pattern||e.allOf?.some(s=>s.pattern)?(e.allOf||(e.allOf=[]),e.pattern&&(e.allOf.push({pattern:e.pattern,...e.errorMessage&&r.errorMessages&&{errorMessage:{pattern:e.errorMessage.pattern}}}),delete e.pattern,e.errorMessage&&(delete e.errorMessage.pattern,Object.keys(e.errorMessage).length===0&&delete e.errorMessage)),e.allOf.push({pattern:Bt(t,r),...i&&r.errorMessages&&{errorMessage:{pattern:i}}})):P(e,"pattern",Bt(t,r),i,r);}function Bt(e,t){if(!t.applyRegexFlags||!e.flags)return e.source;let i={i:e.flags.includes("i"),m:e.flags.includes("m"),s:e.flags.includes("s")},r=i.i?e.source.toLowerCase():e.source,s="",n=false,a=false,u=false;for(let c=0;c<r.length;c++){if(n){s+=r[c],n=false;continue}if(i.i){if(a){if(r[c].match(/[a-z]/)){u?(s+=r[c],s+=`${r[c-2]}-${r[c]}`.toUpperCase(),u=false):r[c+1]==="-"&&r[c+2]?.match(/[a-z]/)?(s+=r[c],u=true):s+=`${r[c]}${r[c].toUpperCase()}`;continue}}else if(r[c].match(/[a-z]/)){s+=`[${r[c]}${r[c].toUpperCase()}]`;continue}}if(i.m){if(r[c]==="^"){s+=`(^|(?<=[\r
2
2
  ]))`;continue}else if(r[c]==="$"){s+=`($|(?=[\r
3
3
  ]))`;continue}}if(i.s&&r[c]==="."){s+=a?`${r[c]}\r
4
4
  `:`[${r[c]}\r
5
- ]`;continue}s+=r[c],r[c]==="\\"?n=true:a&&r[c]==="]"?a=false:!a&&r[c]==="["&&(a=true);}try{new RegExp(s);}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return s}function De(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===a$4.ZodEnum)return {type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((r,s)=>({...r,[s]:v(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",s]})??R(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let i={type:"object",additionalProperties:v(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return i;if(e.keyType?._def.typeName===a$4.ZodString&&e.keyType._def.checks?.length){let{type:r,...s}=Oe(e.keyType._def,t);return {...i,propertyNames:s}}else {if(e.keyType?._def.typeName===a$4.ZodEnum)return {...i,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===a$4.ZodBranded&&e.keyType._def.type._def.typeName===a$4.ZodString&&e.keyType._def.type._def.checks?.length){let{type:r,...s}=Le(e.keyType._def,t);return {...i,propertyNames:s}}}return i}function Ut(e,t){if(t.mapStrategy==="record")return De(e,t);let i=v(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||R(t),r=v(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||R(t);return {type:"array",maxItems:125,items:{type:"array",items:[i,r],minItems:2,maxItems:2}}}function zt(e){let t=e.values,r=Object.keys(e.values).filter(n=>typeof t[t[n]]!="number").map(n=>t[n]),s=Array.from(new Set(r.map(n=>typeof n)));return {type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:r}}function Wt(e){return e.target==="openAi"?void 0:{not:R({...e,currentPath:[...e.currentPath,"not"]})}}function $t(e){return e.target==="openApi3"?{enum:["null"],nullable:true}:{type:"null"}}var Ae={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Zt(e,t){if(t.target==="openApi3")return Ht(e,t);let i=e.options instanceof Map?Array.from(e.options.values()):e.options;if(i.every(r=>r._def.typeName in Ae&&(!r._def.checks||!r._def.checks.length))){let r=i.reduce((s,n)=>{let a=Ae[n._def.typeName];return a&&!s.includes(a)?[...s,a]:s},[]);return {type:r.length>1?r:r[0]}}else if(i.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){let r=i.reduce((s,n)=>{let a=typeof n._def.value;switch(a){case "string":case "number":case "boolean":return [...s,a];case "bigint":return [...s,"integer"];case "object":if(n._def.value===null)return [...s,"null"];default:return s}},[]);if(r.length===i.length){let s=r.filter((n,a,u)=>u.indexOf(n)===a);return {type:s.length>1?s:s[0],enum:i.reduce((n,a)=>n.includes(a._def.value)?n:[...n,a._def.value],[])}}}else if(i.every(r=>r._def.typeName==="ZodEnum"))return {type:"string",enum:i.reduce((r,s)=>[...r,...s._def.values.filter(n=>!r.includes(n))],[])};return Ht(e,t)}var Ht=(e,t)=>{let i=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,s)=>v(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${s}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return i.length?{anyOf:i}:void 0};function Kt(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:Ae[e.innerType._def.typeName],nullable:true}:{type:[Ae[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let r=v(e.innerType._def,{...t,currentPath:[...t.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:true}:r&&{...r,nullable:true}}let i=v(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return i&&{anyOf:[i,{type:"null"}]}}function Gt(e,t){let i={type:"number"};if(!e.checks)return i;for(let r of e.checks)switch(r.kind){case "int":i.type="integer",et(i,"type",r.message,t);break;case "min":t.target==="jsonSchema7"?r.inclusive?P(i,"minimum",r.value,r.message,t):P(i,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(i.exclusiveMinimum=true),P(i,"minimum",r.value,r.message,t));break;case "max":t.target==="jsonSchema7"?r.inclusive?P(i,"maximum",r.value,r.message,t):P(i,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(i.exclusiveMaximum=true),P(i,"maximum",r.value,r.message,t));break;case "multipleOf":P(i,"multipleOf",r.value,r.message,t);break}return i}function qt(e,t){let i=t.target==="openAi",r={type:"object",properties:{}},s=[],n=e.shape();for(let u in n){let c=n[u];if(c===void 0||c._def===void 0)continue;let l=sr(c);l&&i&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),l=false);let p=v(c._def,{...t,currentPath:[...t.currentPath,"properties",u],propertyPath:[...t.currentPath,"properties",u]});p!==void 0&&(r.properties[u]=p,l||s.push(u));}s.length&&(r.required=s);let a=rr(e,t);return a!==void 0&&(r.additionalProperties=a),r}function rr(e,t){if(e.catchall._def.typeName!=="ZodNever")return v(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case "passthrough":return t.allowedAdditionalProperties;case "strict":return t.rejectedAdditionalProperties;case "strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function sr(e){try{return e.isOptional()}catch{return true}}var Jt=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return v(e.innerType._def,t);let i=v(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return i?{anyOf:[{not:R(t)},i]}:R(t)};var Yt=(e,t)=>{if(t.pipeStrategy==="input")return v(e.in._def,t);if(t.pipeStrategy==="output")return v(e.out._def,t);let i=v(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=v(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",i?"1":"0"]});return {allOf:[i,r].filter(s=>s!==void 0)}};function Qt(e,t){return v(e.type._def,t)}function Xt(e,t){let r={type:"array",uniqueItems:true,items:v(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&P(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&P(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}function ei(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((i,r)=>v(i._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((i,r)=>r===void 0?i:[...i,r],[]),additionalItems:v(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((i,r)=>v(i._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((i,r)=>r===void 0?i:[...i,r],[])}}function ti(e){return {not:R(e)}}function ii(e){return R(e)}var ri=(e,t)=>v(e.innerType._def,t);var si=(e,t,i)=>{switch(t){case a$4.ZodString:return Oe(e,i);case a$4.ZodNumber:return Gt(e,i);case a$4.ZodObject:return qt(e,i);case a$4.ZodBigInt:return Rt(e,i);case a$4.ZodBoolean:return Lt();case a$4.ZodDate:return tt(e,i);case a$4.ZodUndefined:return ti(i);case a$4.ZodNull:return $t(i);case a$4.ZodArray:return Nt(e,i);case a$4.ZodUnion:case a$4.ZodDiscriminatedUnion:return Zt(e,i);case a$4.ZodIntersection:return Vt(e,i);case a$4.ZodTuple:return ei(e,i);case a$4.ZodRecord:return De(e,i);case a$4.ZodLiteral:return jt(e,i);case a$4.ZodEnum:return Ft(e);case a$4.ZodNativeEnum:return zt(e);case a$4.ZodNullable:return Kt(e,i);case a$4.ZodOptional:return Jt(e,i);case a$4.ZodMap:return Ut(e,i);case a$4.ZodSet:return Xt(e,i);case a$4.ZodLazy:return ()=>e.getter()._def;case a$4.ZodPromise:return Qt(e,i);case a$4.ZodNaN:case a$4.ZodNever:return Wt(i);case a$4.ZodEffects:return Mt(e,i);case a$4.ZodAny:return R(i);case a$4.ZodUnknown:return ii(i);case a$4.ZodDefault:return Dt(e,i);case a$4.ZodBranded:return Le(e,i);case a$4.ZodReadonly:return ri(e,i);case a$4.ZodCatch:return Ot(e,i);case a$4.ZodPipeline:return Yt(e,i);case a$4.ZodFunction:case a$4.ZodVoid:case a$4.ZodSymbol:return;default:return (r=>{})()}};function v(e,t,i=false){let r=t.seen.get(e);if(t.override){let u=t.override?.(e,t,r,i);if(u!==Ct)return u}if(r&&!i){let u=nr(r,t);if(u!==void 0)return u}let s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);let n=si(e,e.typeName,t),a=typeof n=="function"?v(n(),t):n;if(a&&ar(e,t,a),t.postProcess){let u=t.postProcess(a,e,t);return s.jsonSchema=a,u}return s.jsonSchema=a,a}var nr=(e,t)=>{switch(t.$refStrategy){case "root":return {$ref:e.path.join("/")};case "relative":return {$ref:Re(t.currentPath,e.path)};case "none":case "seen":return e.path.length<t.currentPath.length&&e.path.every((i,r)=>t.currentPath[r]===i)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),R(t)):t.$refStrategy==="seen"?R(t):void 0}},ar=(e,t,i)=>(e.description&&(i.description=e.description,t.markdownDescription&&(i.markdownDescription=e.description)),i);var st=(e,t)=>{let i=Tt(t),r=void 0,s=t?.name,n=v(e._def,i,false)??R(i);i.flags.hasReferencedOpenAiAnyType&&(r||(r={}),r[i.openAiAnyTypeName]||(r[i.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:i.$refStrategy==="relative"?"1":[...i.basePath,i.definitionPath,i.openAiAnyTypeName].join("/")}}));let u=s===void 0?r?{...n,[i.definitionPath]:r}:n:{$ref:[...i.$refStrategy==="relative"?[]:i.basePath,i.definitionPath,s].join("/"),[i.definitionPath]:{...r,[s]:n}};return i.target==="jsonSchema7"?u.$schema="http://json-schema.org/draft-07/schema#":(i.target==="jsonSchema2019-09"||i.target==="openAi")&&(u.$schema="https://json-schema.org/draft/2019-09/schema#"),i.target==="openAi"&&("anyOf"in u||"oneOf"in u||"allOf"in u||"type"in u&&Array.isArray(u.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),u};var or={"grpc.keepalive_time_ms":3e4,"grpc.keepalive_timeout_ms":1e4,"grpc.keepalive_permit_without_calls":1,"grpc.max_send_message_length":-1,"grpc.max_receive_message_length":-1,"grpc.enable_retries":1},Me=class{server;constructor(){this.server=new H.Server(or);}addService(t){this.server.addService(a.LogicMesh.service,{NegotiateIntent:t.negotiateIntent,ExecuteLogic:t.executeLogic});}async listen(t=50051,i){let r=b(i);return new Promise((s,n)=>{this.server.bindAsync(`0.0.0.0:${t}`,r,(a,u)=>{if(a){n(a);return}a$1.info(`[LIOP-RPC] Server listening on port ${u}`),s(u);});})}async stop(){return new Promise(t=>{this.server.tryShutdown(()=>{a$1.info("[LIOP-RPC] Server shut down"),t();});})}};var le={audience:"urn:liop:mesh:api",tokenTtlSeconds:3600,jwksCacheTtlMs:6e5,jwksCooldownMs:3e4,clockToleranceSec:5,signingAlgorithm:"EdDSA"};var Pe=class{jwksResolver;issuer;audience;constructor(t,i,r){this.issuer=t,this.audience=i,r instanceof URL?this.jwksResolver=_e.createRemoteJWKSet(r,{cacheMaxAge:le.jwksCacheTtlMs,cooldownDuration:le.jwksCooldownMs}):this.jwksResolver=_e.createLocalJWKSet(r);}async validate(t){let i=this.buildIssuerAliases(),{payload:r}=await _e.jwtVerify(t,this.jwksResolver,{issuer:i.length>1?i:this.issuer,audience:this.audience,algorithms:[le.signingAlgorithm,"ES256"],clockTolerance:le.clockToleranceSec,requiredClaims:["sub","scope"]});return {token:t,clientId:r.sub??"unknown",scopes:typeof r.scope=="string"?r.scope.split(" "):[],expiresAt:r.exp}}buildIssuerAliases(){let t=[this.issuer],i=this.issuer.endsWith("/")?this.issuer.slice(0,-1):this.issuer,r=["nexus:3000","liop-nexus:3000","127.0.0.1:3000","localhost:3000","127.0.0.1:13000","localhost:13000","127.0.0.1:13001","localhost:13001"],s="";try{let u=new URL(i);s=`${u.hostname}:${u.port||"3000"}`;}catch{return t}if(!r.some(u=>s===u))return t;let a=i.replace(/^https?:\/\/[^/]+/,"");for(let u of r){let c=`http://${u}${a}`;t.includes(c)||t.push(c);}if(a)for(let u of r){let c=`http://${u}`;t.includes(c)||t.push(c);}else for(let u of r){let c=`http://${u}/oidc`;t.includes(c)||t.push(c);}return t}getIssuer(){return this.issuer}getAudience(){return this.audience}};function ai(e){let{privateKey:t,publicKey:i}=de.generateKeyPairSync("ed25519"),r=t.export({format:"jwk"}),s=i.export({format:"jwk"}),n=de.createHash("sha256").update(s.x||"").digest("hex").slice(0,16),a={...r,kid:n,use:"sig",alg:"EdDSA"},u={...s,kid:n,use:"sig",alg:"EdDSA"},c={keys:[a]},l={keys:[u]},p={scopes:["openid","offline_access",...b$1],clients:e.clients.map(k=>({client_id:k.client_id,client_secret:k.client_secret,grant_types:["client_credentials"],response_types:[],redirect_uris:[],scope:k.scope,token_endpoint_auth_method:"client_secret_post",id_token_signed_response_alg:"EdDSA"})),features:{clientCredentials:{enabled:true},devInteractions:{enabled:false},resourceIndicators:{enabled:true,useGrantedResource:()=>true,getResourceServerInfo:(k,g,_)=>({scope:_.scope||"",accessTokenFormat:"jwt",jwt:{sign:{alg:"EdDSA"}}})}},formats:{AccessToken:"jwt"},interactions:{url:()=>{throw new Error("InteractionsNotSupportedException: This Authorization Server is strictly configured for Machine-to-Machine flows.")}},jwks:c,ttl:{ClientCredentials:3600},cookies:{keys:[de.randomBytes(32).toString("hex")]},extraTokenClaims:(k,g)=>g.kind==="AccessToken"?{scope:g.scope}:{}},x=e.issuer.endsWith("/")?e.issuer.slice(0,-1):e.issuer,d=new ur(x,p);return d.proxy=true,{provider:d,jwks:l}}var cr=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],hi=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],lr="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",fi="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",at={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ot="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",pr={5:ot,"5module":ot+" export import",6:ot+" const class extends export import super"},di=/^in(stanceof)?$/,hr=new RegExp("["+fi+"]"),fr=new RegExp("["+fi+lr+"]");function ct(e,t){for(var i=65536,r=0;r<t.length;r+=2){if(i+=t[r],i>e)return false;if(i+=t[r+1],i>=e)return true}return false}function se(e,t){return e<65?e===36:e<91?true:e<97?e===95:e<123?true:e<=65535?e>=170&&hr.test(String.fromCharCode(e)):t===false?false:ct(e,hi)}function he(e,t){return e<48?e===36:e<58?true:e<65?false:e<91?true:e<97?e===95:e<123?true:e<=65535?e>=170&&fr.test(String.fromCharCode(e)):t===false?false:ct(e,hi)||ct(e,cr)}var I=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null;};function G(e,t){return new I(e,{beforeExpr:true,binop:t})}var q={beforeExpr:true},W={startsExpr:true},ft={};function C(e,t){return t===void 0&&(t={}),t.keyword=e,ft[e]=new I(e,t)}var o={num:new I("num",W),regexp:new I("regexp",W),string:new I("string",W),name:new I("name",W),privateId:new I("privateId",W),eof:new I("eof"),bracketL:new I("[",{beforeExpr:true,startsExpr:true}),bracketR:new I("]"),braceL:new I("{",{beforeExpr:true,startsExpr:true}),braceR:new I("}"),parenL:new I("(",{beforeExpr:true,startsExpr:true}),parenR:new I(")"),comma:new I(",",q),semi:new I(";",q),colon:new I(":",q),dot:new I("."),question:new I("?",q),questionDot:new I("?."),arrow:new I("=>",q),template:new I("template"),invalidTemplate:new I("invalidTemplate"),ellipsis:new I("...",q),backQuote:new I("`",W),dollarBraceL:new I("${",{beforeExpr:true,startsExpr:true}),eq:new I("=",{beforeExpr:true,isAssign:true}),assign:new I("_=",{beforeExpr:true,isAssign:true}),incDec:new I("++/--",{prefix:true,postfix:true,startsExpr:true}),prefix:new I("!/~",{beforeExpr:true,prefix:true,startsExpr:true}),logicalOR:G("||",1),logicalAND:G("&&",2),bitwiseOR:G("|",3),bitwiseXOR:G("^",4),bitwiseAND:G("&",5),equality:G("==/!=/===/!==",6),relational:G("</>/<=/>=",7),bitShift:G("<</>>/>>>",8),plusMin:new I("+/-",{beforeExpr:true,binop:9,prefix:true,startsExpr:true}),modulo:G("%",10),star:G("*",10),slash:G("/",10),starstar:new I("**",{beforeExpr:true}),coalesce:G("??",1),_break:C("break"),_case:C("case",q),_catch:C("catch"),_continue:C("continue"),_debugger:C("debugger"),_default:C("default",q),_do:C("do",{isLoop:true,beforeExpr:true}),_else:C("else",q),_finally:C("finally"),_for:C("for",{isLoop:true}),_function:C("function",W),_if:C("if"),_return:C("return",q),_switch:C("switch"),_throw:C("throw",q),_try:C("try"),_var:C("var"),_const:C("const"),_while:C("while",{isLoop:true}),_with:C("with"),_new:C("new",{beforeExpr:true,startsExpr:true}),_this:C("this",W),_super:C("super",W),_class:C("class",W),_extends:C("extends",q),_export:C("export"),_import:C("import",W),_null:C("null",W),_true:C("true",W),_false:C("false",W),_in:C("in",{beforeExpr:true,binop:7}),_instanceof:C("instanceof",{beforeExpr:true,binop:7}),_typeof:C("typeof",{beforeExpr:true,prefix:true,startsExpr:true}),_void:C("void",{beforeExpr:true,prefix:true,startsExpr:true}),_delete:C("delete",{beforeExpr:true,prefix:true,startsExpr:true})},$=/\r\n?|\n|\u2028|\u2029/,dr=new RegExp($.source,"g");function Ee(e){return e===10||e===13||e===8232||e===8233}function mi(e,t,i){i===void 0&&(i=e.length);for(var r=t;r<i;r++){var s=e.charCodeAt(r);if(Ee(s))return r<i-1&&s===13&&e.charCodeAt(r+1)===10?r+2:r+1}return -1}var gi=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,F=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,xi=Object.prototype,mr=xi.hasOwnProperty,gr=xi.toString,we=Object.hasOwn||(function(e,t){return mr.call(e,t)}),oi=Array.isArray||(function(e){return gr.call(e)==="[object Array]"}),ui=Object.create(null);function pe(e){return ui[e]||(ui[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function oe(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var xr=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Ie=function(t,i){this.line=t,this.column=i;};Ie.prototype.offset=function(t){return new Ie(this.line,this.column+t)};var ze=function(t,i,r){this.start=i,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile);};function yi(e,t){for(var i=1,r=0;;){var s=mi(e,r,t);if(s<0)return new Ie(i,t-r);++i,r=s;}}var lt={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:false,allowImportExportEverywhere:false,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:false,checkPrivateFields:true,locations:false,onToken:null,onComment:null,ranges:false,program:null,sourceFile:null,directSourceFile:null,preserveParens:false},ci=false;function yr(e){var t={};for(var i in lt)t[i]=e&&we(e,i)?e[i]:lt[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!ci&&typeof console=="object"&&console.warn&&(ci=true,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
6
- Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),oi(t.onToken)){var r=t.onToken;t.onToken=function(s){return r.push(s)};}if(oi(t.onComment)&&(t.onComment=vr(t,t.onComment)),t.sourceType==="commonjs"&&t.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}function vr(e,t){return function(i,r,s,n,a,u){var c={type:i?"Block":"Line",value:r,start:s,end:n};e.locations&&(c.loc=new ze(this,a,u)),e.ranges&&(c.range=[s,n]),t.push(c);}}var xe=1,ye=2,dt=4,vi=8,mt=16,bi=32,We=64,Si=128,ve=256,Te=512,_i=1024,$e=xe|ye|ve;function gt(e,t){return ye|(e?dt:0)|(t?vi:0)}var Ve=0,xt=1,ce=2,Ei=3,wi=4,ki=5,O=function(t,i,r){this.options=t=yr(t),this.sourceFile=t.sourceFile,this.keywords=pe(pr[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var s="";t.allowReserved!==true&&(s=at[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(s+=" await")),this.reservedWords=pe(s);var n=(s?s+" ":"")+at.strict;this.reservedWordsStrict=pe(n),this.reservedWordsStrictBind=pe(n+" "+at.strictBind),this.input=String(i),this.containsEsc=false,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(`
7
- `,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split($).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=o.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=true,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=false,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?ye:xe),this.regexpState=null,this.privateNameStack=[];},Y={inFunction:{configurable:true},inGenerator:{configurable:true},inAsync:{configurable:true},canAwait:{configurable:true},allowReturn:{configurable:true},allowSuper:{configurable:true},allowDirectSuper:{configurable:true},treatFunctionsAsVar:{configurable:true},allowNewDotTarget:{configurable:true},allowUsing:{configurable:true},inClassStaticBlock:{configurable:true}};O.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};Y.inFunction.get=function(){return (this.currentVarScope().flags&ye)>0};Y.inGenerator.get=function(){return (this.currentVarScope().flags&vi)>0};Y.inAsync.get=function(){return (this.currentVarScope().flags&dt)>0};Y.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(ve|Te))return false;if(i&ye)return (i&dt)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Y.allowReturn.get=function(){return !!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&xe)};Y.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return (t&We)>0||this.options.allowSuperOutsideMethod};Y.allowDirectSuper.get=function(){return (this.currentThisScope().flags&Si)>0};Y.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Y.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(ve|Te)||i&ye&&!(i&mt))return true}return false};Y.allowUsing.get=function(){var e=this.currentScope(),t=e.flags;return !(t&_i||!this.inModule&&t&xe)};Y.inClassStaticBlock.get=function(){return (this.currentVarScope().flags&ve)>0};O.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var r=this,s=0;s<t.length;s++)r=t[s](r);return r};O.parse=function(t,i){return new this(i,t).parse()};O.parseExpressionAt=function(t,i,r){var s=new this(r,t,i);return s.nextToken(),s.parseExpression()};O.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(O.prototype,Y);var z=O.prototype,br=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;z.strictDirective=function(e){if(this.options.ecmaVersion<5)return false;for(;;){F.lastIndex=e,e+=F.exec(this.input)[0].length;var t=br.exec(this.input.slice(e));if(!t)return false;if((t[1]||t[2])==="use strict"){F.lastIndex=e+t[0].length;var i=F.exec(this.input),r=i.index+i[0].length,s=this.input.charAt(r);return s===";"||s==="}"||$.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,F.lastIndex=e,e+=F.exec(this.input)[0].length,this.input[e]===";"&&e++;}};z.eat=function(e){return this.type===e?(this.next(),true):false};z.isContextual=function(e){return this.type===o.name&&this.value===e&&!this.containsEsc};z.eatContextual=function(e){return this.isContextual(e)?(this.next(),true):false};z.expectContextual=function(e){this.eatContextual(e)||this.unexpected();};z.canInsertSemicolon=function(){return this.type===o.eof||this.type===o.braceR||$.test(this.input.slice(this.lastTokEnd,this.start))};z.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),true};z.semicolon=function(){!this.eat(o.semi)&&!this.insertSemicolon()&&this.unexpected();};z.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),true};z.expect=function(e){this.eat(e)||this.unexpected();};z.unexpected=function(e){this.raise(e??this.start,"Unexpected token");};var He=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1;};z.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern");}};z.checkExpressionErrors=function(e,t){if(!e)return false;var i=e.shorthandAssign,r=e.doubleProto;if(!t)return i>=0||r>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property");};z.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value");};z.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var m=O.prototype;m.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==o.eof;){var i=this.parseStatement(null,true,t);e.body.push(i);}if(this.inModule)for(var r=0,s=Object.keys(this.undefinedExports);r<s.length;r+=1){var n=s[r];this.raiseRecoverable(this.undefinedExports[n].start,"Export '"+n+"' is not defined");}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var yt={kind:"loop"},Sr={kind:"switch"};m.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return false;F.lastIndex=this.pos;var t=F.exec(this.input),i=this.pos+t[0].length,r=this.fullCharCodeAt(i);if(r===91||r===92)return true;if(e)return false;if(r===123)return true;if(se(r)){var s=i;do i+=r<=65535?1:2;while(he(r=this.fullCharCodeAt(i)));if(r===92)return true;var n=this.input.slice(s,i);if(!di.test(n))return true}return false};m.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return false;F.lastIndex=this.pos;var e=F.exec(this.input),t=this.pos+e[0].length,i;return !$.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(he(i=this.fullCharCodeAt(t+8))||i===92))};m.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return false;F.lastIndex=this.pos;var i=F.exec(this.input),r=this.pos+i[0].length;if($.test(this.input.slice(this.pos,r)))return false;if(e){var s=r+5,n;if(this.input.slice(r,s)!=="using"||s===this.input.length||he(n=this.fullCharCodeAt(s))||n===92)return false;F.lastIndex=s;var a=F.exec(this.input);if(r=s+a[0].length,a&&$.test(this.input.slice(s,r)))return false}var u=this.fullCharCodeAt(r);if(!se(u)&&u!==92)return false;var c=r;do r+=u<=65535?1:2;while(he(u=this.fullCharCodeAt(r)));if(u===92)return true;var l=this.input.slice(c,r);return !(di.test(l)||t&&l==="of")};m.isAwaitUsing=function(e){return this.isUsingKeyword(true,e)};m.isUsing=function(e){return this.isUsingKeyword(false,e)};m.parseStatement=function(e,t,i){var r=this.type,s=this.startNode(),n;switch(this.isLet(e)&&(r=o._var,n="let"),r){case o._break:case o._continue:return this.parseBreakContinueStatement(s,r.keyword);case o._debugger:return this.parseDebuggerStatement(s);case o._do:return this.parseDoStatement(s);case o._for:return this.parseForStatement(s);case o._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,false,!e);case o._class:return e&&this.unexpected(),this.parseClass(s,true);case o._if:return this.parseIfStatement(s);case o._return:return this.parseReturnStatement(s);case o._switch:return this.parseSwitchStatement(s);case o._throw:return this.parseThrowStatement(s);case o._try:return this.parseTryStatement(s);case o._const:case o._var:return n=n||this.value,e&&n!=="var"&&this.unexpected(),this.parseVarStatement(s,n);case o._while:return this.parseWhileStatement(s);case o._with:return this.parseWithStatement(s);case o.braceL:return this.parseBlock(true,s);case o.semi:return this.parseEmptyStatement(s);case o._export:case o._import:if(this.options.ecmaVersion>10&&r===o._import){F.lastIndex=this.pos;var a=F.exec(this.input),u=this.pos+a[0].length,c=this.input.charCodeAt(u);if(c===40||c===46)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===o._import?this.parseImport(s):this.parseExport(s,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,true,!e);var l=this.isAwaitUsing(false)?"await using":this.isUsing(false)?"using":null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),l==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(s,false,l),this.semicolon(),this.finishNode(s,"VariableDeclaration");var p=this.value,x=this.parseExpression();return r===o.name&&x.type==="Identifier"&&this.eat(o.colon)?this.parseLabeledStatement(s,p,x,e):this.parseExpressionStatement(s,x)}};m.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(o.semi)||this.insertSemicolon()?e.label=null:this.type!==o.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var s=this.labels[r];if((e.label==null||s.name===e.label.name)&&(s.kind!=null&&(i||s.kind==="loop")||e.label&&i))break}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")};m.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};m.parseDoStatement=function(e){return this.next(),this.labels.push(yt),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(o._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(o.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};m.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(yt),this.enterScope(0),this.expect(o.parenL),this.type===o.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===o._var||this.type===o._const||i){var r=this.startNode(),s=i?"let":this.value;return this.next(),this.parseVar(r,true,s),this.finishNode(r,"VariableDeclaration"),this.parseForAfterInit(e,r,t)}var n=this.isContextual("let"),a=false,u=this.isUsing(true)?"using":this.isAwaitUsing(true)?"await using":null;if(u){var c=this.startNode();return this.next(),u==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(c,true,u),this.finishNode(c,"VariableDeclaration"),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,p=new He,x=this.start,d=t>-1?this.parseExprSubscripts(p,"await"):this.parseExpression(true,p);return this.type===o._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===o._in&&this.unexpected(t),e.await=true):a&&this.options.ecmaVersion>=8&&(d.start===x&&!l&&d.type==="Identifier"&&d.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=false)),n&&a&&this.raise(d.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(d,false,p),this.checkLValPattern(d),this.parseForIn(e,d)):(this.checkExpressionErrors(p,true),t>-1&&this.unexpected(t),this.parseFor(e,d))};m.parseForAfterInit=function(e,t,i){return (this.type===o._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===o._in?i>-1&&this.unexpected(i):e.await=i>-1),this.parseForIn(e,t)):(i>-1&&this.unexpected(i),this.parseFor(e,t))};m.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,Ce|(i?0:pt),false,t)};m.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(o._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};m.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(o.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};m.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(o.braceL),this.labels.push(Sr),this.enterScope(_i);for(var t,i=false;this.type!==o.braceR;)if(this.type===o._case||this.type===o._default){var r=this.type===o._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=true,t.test=null),this.expect(o.colon);}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};m.parseThrowStatement=function(e){return this.next(),$.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var _r=[];m.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?bi:0),this.checkLValPattern(e,t?wi:ce),this.expect(o.parenR),e};m.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===o._catch){var t=this.startNode();this.next(),this.eat(o.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(false),this.exitScope(),e.handler=this.finishNode(t,"CatchClause");}return e.finalizer=this.eat(o._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};m.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,false,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")};m.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(yt),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};m.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};m.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};m.parseLabeledStatement=function(e,t,i,r){for(var s=0,n=this.labels;s<n.length;s+=1){var a=n[s];a.name===t&&this.raise(i.start,"Label '"+t+"' is already declared");}for(var u=this.type.isLoop?"loop":this.type===o._switch?"switch":null,c=this.labels.length-1;c>=0;c--){var l=this.labels[c];if(l.statementStart===e.start)l.statementStart=this.start,l.kind=u;else break}return this.labels.push({name:t,kind:u,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};m.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};m.parseBlock=function(e,t,i){for(e===void 0&&(e=true),t===void 0&&(t=this.startNode()),t.body=[],this.expect(o.braceL),e&&this.enterScope(0);this.type!==o.braceR;){var r=this.parseStatement(null);t.body.push(r);}return i&&(this.strict=false),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};m.parseFor=function(e,t){return e.init=t,this.expect(o.semi),e.test=this.type===o.semi?null:this.parseExpression(),this.expect(o.semi),e.update=this.type===o.parenR?null:this.parseExpression(),this.expect(o.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};m.parseForIn=function(e,t){var i=this.type===o._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(o.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};m.parseVar=function(e,t,i,r){for(e.declarations=[],e.kind=i;;){var s=this.startNode();if(this.parseVarId(s,i),this.eat(o.eq)?s.init=this.parseMaybeAssign(t):!r&&i==="const"&&!(this.type===o._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!r&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==o._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration"):!r&&s.id.type!=="Identifier"&&!(t&&(this.type===o._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):s.init=null,e.declarations.push(this.finishNode(s,"VariableDeclarator")),!this.eat(o.comma))break}return e};m.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?xt:ce,false);};var Ce=1,pt=2,Ai=4;m.parseFunction=function(e,t,i,r,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===o.star&&t&pt&&this.unexpected(),e.generator=this.eat(o.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Ce&&(e.id=t&Ai&&this.type!==o.name?null:this.parseIdent(),e.id&&!(t&pt)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?xt:ce:Ei));var n=this.yieldPos,a=this.awaitPos,u=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(gt(e.async,e.generator)),t&Ce||(e.id=this.type===o.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,false,s),this.yieldPos=n,this.awaitPos=a,this.awaitIdentPos=u,this.finishNode(e,t&Ce?"FunctionDeclaration":"FunctionExpression")};m.parseFunctionParams=function(e){this.expect(o.parenL),e.params=this.parseBindingList(o.parenR,false,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams();};m.parseClass=function(e,t){this.next();var i=this.strict;this.strict=true,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),s=this.startNode(),n=false;for(s.body=[],this.expect(o.braceL);this.type!==o.braceR;){var a=this.parseClassElement(e.superClass!==null);a&&(s.body.push(a),a.type==="MethodDefinition"&&a.kind==="constructor"?(n&&this.raiseRecoverable(a.start,"Duplicate constructor in the same class"),n=true):a.key&&a.key.type==="PrivateIdentifier"&&Er(r,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"));}return this.strict=i,this.next(),e.body=this.finishNode(s,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};m.parseClassElement=function(e){if(this.eat(o.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),r="",s=false,n=false,a="method",u=false;if(this.eatContextual("static")){if(t>=13&&this.eat(o.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===o.star?u=true:r="static";}if(i.static=u,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===o.star)&&!this.canInsertSemicolon()?n=true:r="async"),!r&&(t>=9||!n)&&this.eat(o.star)&&(s=true),!r&&!n&&!s){var c=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=c:r=c);}if(r?(i.computed=false,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=r,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===o.parenL||a!=="method"||s||n){var l=!i.static&&je(i,"constructor"),p=l&&e;l&&a!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=l?"constructor":a,this.parseClassMethod(i,s,n,p);}else this.parseClassField(i);return i};m.isClassElementNameStart=function(){return this.type===o.name||this.type===o.privateId||this.type===o.num||this.type===o.string||this.type===o.bracketL||this.type.keyword};m.parseClassElementName=function(e){this.type===o.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=false,e.key=this.parsePrivateIdent()):this.parsePropertyName(e);};m.parseClassMethod=function(e,t,i,r){var s=e.key;e.kind==="constructor"?(t&&this.raise(s.start,"Constructor can't be a generator"),i&&this.raise(s.start,"Constructor can't be an async method")):e.static&&je(e,"prototype")&&this.raise(s.start,"Classes may not have a static property named prototype");var n=e.value=this.parseMethod(t,i,r);return e.kind==="get"&&n.params.length!==0&&this.raiseRecoverable(n.start,"getter should have no params"),e.kind==="set"&&n.params.length!==1&&this.raiseRecoverable(n.start,"setter should have exactly one param"),e.kind==="set"&&n.params[0].type==="RestElement"&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};m.parseClassField=function(e){return je(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&je(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(o.eq)?(this.enterScope(Te|We),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")};m.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(ve|We);this.type!==o.braceR;){var i=this.parseStatement(null);e.body.push(i);}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};m.parseClassId=function(e,t){this.type===o.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,ce,false)):(t===true&&this.unexpected(),e.id=null);};m.parseClassSuper=function(e){e.superClass=this.eat(o._extends)?this.parseExprSubscripts(null,false):null;};m.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};m.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,s=r===0?null:this.privateNameStack[r-1],n=0;n<i.length;++n){var a=i[n];we(t,a.name)||(s?s.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"));}};function Er(e,t){var i=t.key.name,r=e[i],s="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(s=(t.static?"s":"i")+t.kind),r==="iget"&&s==="iset"||r==="iset"&&s==="iget"||r==="sget"&&s==="sset"||r==="sset"&&s==="sget"?(e[i]="true",false):r?true:(e[i]=s,false)}function je(e,t){var i=e.computed,r=e.key;return !i&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}m.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==o.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};m.parseExport=function(e,t){if(this.next(),this.eat(o.star))return this.parseExportAllDeclaration(e,t);if(this.eat(o._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else {if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==o.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else {for(var i=0,r=e.specifiers;i<r.length;i+=1){var s=r[i];this.checkUnreserved(s.local),this.checkLocalExport(s.local),s.local.type==="Literal"&&this.raise(s.local.start,"A string literal cannot be used as an exported binding without `from`.");}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);}this.semicolon();}return this.finishNode(e,"ExportNamedDeclaration")};m.parseExportDeclaration=function(e){return this.parseStatement(null)};m.parseExportDefaultDeclaration=function(){var e;if(this.type===o._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Ce|Ai,false,e)}else if(this.type===o._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else {var r=this.parseMaybeAssign();return this.semicolon(),r}};m.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),we(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=true);};m.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var r=0,s=t.properties;r<s.length;r+=1){var n=s[r];this.checkPatternExport(e,n);}else if(i==="ArrayPattern")for(var a=0,u=t.elements;a<u.length;a+=1){var c=u[a];c&&this.checkPatternExport(e,c);}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"&&this.checkPatternExport(e,t.argument);};m.checkVariableExport=function(e,t){if(e)for(var i=0,r=t;i<r.length;i+=1){var s=r[i];this.checkPatternExport(e,s.id);}};m.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};m.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};m.parseExportSpecifiers=function(e){var t=[],i=true;for(this.expect(o.braceL);!this.eat(o.braceR);){if(i)i=false;else if(this.expect(o.comma),this.afterTrailingComma(o.braceR))break;t.push(this.parseExportSpecifier(e));}return t};m.parseImport=function(e){return this.next(),this.type===o.string?(e.specifiers=_r,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===o.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};m.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,ce),this.finishNode(e,"ImportSpecifier")};m.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,ce),this.finishNode(e,"ImportDefaultSpecifier")};m.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,ce),this.finishNode(e,"ImportNamespaceSpecifier")};m.parseImportSpecifiers=function(){var e=[],t=true;if(this.type===o.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(o.comma)))return e;if(this.type===o.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(o.braceL);!this.eat(o.braceR);){if(t)t=false;else if(this.expect(o.comma),this.afterTrailingComma(o.braceR))break;e.push(this.parseImportSpecifier());}return e};m.parseWithClause=function(){var e=[];if(!this.eat(o._with))return e;this.expect(o.braceL);for(var t={},i=true;!this.eat(o.braceR);){if(i)i=false;else if(this.expect(o.comma),this.afterTrailingComma(o.braceR))break;var r=this.parseImportAttribute(),s=r.key.type==="Identifier"?r.key.name:r.key.value;we(t,s)&&this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+s+"'"),t[s]=true,e.push(r);}return e};m.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===o.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(o.colon),this.type!==o.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};m.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===o.string){var e=this.parseLiteral(this.value);return xr.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(true)};m.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1);};m.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var Q=O.prototype;Q.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case "Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case "ObjectPattern":case "ArrayPattern":case "AssignmentPattern":case "RestElement":break;case "ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,true);for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];this.toAssignable(n,t),n.type==="RestElement"&&(n.argument.type==="ArrayPattern"||n.argument.type==="ObjectPattern")&&this.raise(n.argument.start,"Unexpected token");}break;case "Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case "ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,true),this.toAssignableList(e.elements,t);break;case "SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case "AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case "ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case "ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case "MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue");}else i&&this.checkPatternErrors(i,true);return e};Q.toAssignableList=function(e,t){for(var i=e.length,r=0;r<i;r++){var s=e[r];s&&this.toAssignable(s,t);}if(i){var n=e[i-1];this.options.ecmaVersion===6&&t&&n&&n.type==="RestElement"&&n.argument.type!=="Identifier"&&this.unexpected(n.argument.start);}return e};Q.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(false,e),this.finishNode(t,"SpreadElement")};Q.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==o.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};Q.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case o.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(o.bracketR,true,true),this.finishNode(e,"ArrayPattern");case o.braceL:return this.parseObj(true)}return this.parseIdent()};Q.parseBindingList=function(e,t,i,r){for(var s=[],n=true;!this.eat(e);)if(n?n=false:this.expect(o.comma),t&&this.type===o.comma)s.push(null);else {if(i&&this.afterTrailingComma(e))break;if(this.type===o.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),s.push(a),this.type===o.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else s.push(this.parseAssignableListItem(r));}return s};Q.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};Q.parseBindingListItem=function(e){return e};Q.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(o.eq))return i;var r=this.startNodeAt(e,t);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};Q.checkLValSimple=function(e,t,i){t===void 0&&(t=Ve);var r=t!==Ve;switch(e.type){case "Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(t===ce&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(we(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=true),t!==ki&&this.declareName(e.name,t,e.start));break;case "ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case "MemberExpression":r&&this.raiseRecoverable(e.start,"Binding member expression");break;case "ParenthesizedExpression":return r&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue");}};Q.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=Ve),e.type){case "ObjectPattern":for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];this.checkLValInnerPattern(n,t,i);}break;case "ArrayPattern":for(var a=0,u=e.elements;a<u.length;a+=1){var c=u[a];c&&this.checkLValInnerPattern(c,t,i);}break;default:this.checkLValSimple(e,t,i);}};Q.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=Ve),e.type){case "Property":this.checkLValInnerPattern(e.value,t,i);break;case "AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case "RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i);}};var re=function(t,i,r,s,n){this.token=t,this.isExpr=!!i,this.preserveSpace=!!r,this.override=s,this.generator=!!n;},L={b_stat:new re("{",false),b_expr:new re("{",true),b_tmpl:new re("${",false),p_stat:new re("(",false),p_expr:new re("(",true),q_tmpl:new re("`",true,true,function(e){return e.tryReadTemplateToken()}),f_stat:new re("function",false),f_expr:new re("function",true),f_expr_gen:new re("function",true,false,null,true),f_gen:new re("function",false,false,null,true)},ke=O.prototype;ke.initialContext=function(){return [L.b_stat]};ke.curContext=function(){return this.context[this.context.length-1]};ke.braceIsBlock=function(e){var t=this.curContext();return t===L.f_expr||t===L.f_stat?true:e===o.colon&&(t===L.b_stat||t===L.b_expr)?!t.isExpr:e===o._return||e===o.name&&this.exprAllowed?$.test(this.input.slice(this.lastTokEnd,this.start)):e===o._else||e===o.semi||e===o.eof||e===o.parenR||e===o.arrow?true:e===o.braceL?t===L.b_stat:e===o._var||e===o._const||e===o.name?false:!this.exprAllowed};ke.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return false};ke.updateContext=function(e){var t,i=this.type;i.keyword&&e===o.dot?this.exprAllowed=false:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr;};ke.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e);};o.parenR.updateContext=o.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=true;return}var e=this.context.pop();e===L.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr;};o.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?L.b_stat:L.b_expr),this.exprAllowed=true;};o.dollarBraceL.updateContext=function(){this.context.push(L.b_tmpl),this.exprAllowed=true;};o.parenL.updateContext=function(e){var t=e===o._if||e===o._for||e===o._with||e===o._while;this.context.push(t?L.p_stat:L.p_expr),this.exprAllowed=true;};o.incDec.updateContext=function(){};o._function.updateContext=o._class.updateContext=function(e){e.beforeExpr&&e!==o._else&&!(e===o.semi&&this.curContext()!==L.p_stat)&&!(e===o._return&&$.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===o.colon||e===o.braceL)&&this.curContext()===L.b_stat)?this.context.push(L.f_expr):this.context.push(L.f_stat),this.exprAllowed=false;};o.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=true;};o.backQuote.updateContext=function(){this.curContext()===L.q_tmpl?this.context.pop():this.context.push(L.q_tmpl),this.exprAllowed=false;};o.star.updateContext=function(e){if(e===o._function){var t=this.context.length-1;this.context[t]===L.f_expr?this.context[t]=L.f_expr_gen:this.context[t]=L.f_gen;}this.exprAllowed=true;};o.name.updateContext=function(e){var t=false;this.options.ecmaVersion>=6&&e!==o.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=true),this.exprAllowed=t;};var S=O.prototype;S.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,s;switch(r.type){case "Identifier":s=r.name;break;case "Literal":s=String(r.value);break;default:return}var n=e.kind;if(this.options.ecmaVersion>=6){s==="__proto__"&&n==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=true);return}s="$"+s;var a=t[s];if(a){var u;n==="init"?u=this.strict&&a.init||a.get||a.set:u=a.init||a[n],u&&this.raiseRecoverable(r.start,"Redefinition of property");}else a=t[s]={init:false,get:false,set:false};a[n]=true;}};S.parseExpression=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===o.comma){var n=this.startNodeAt(i,r);for(n.expressions=[s];this.eat(o.comma);)n.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(n,"SequenceExpression")}return s};S.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=false;}var r=false,s=-1,n=-1,a=-1;t?(s=t.parenthesizedAssign,n=t.trailingComma,a=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new He,r=true);var u=this.start,c=this.startLoc;(this.type===o.parenL||this.type===o.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var l=this.parseMaybeConditional(e,t);if(i&&(l=i.call(this,l,u,c)),this.type.isAssign){var p=this.startNodeAt(u,c);return p.operator=this.value,this.type===o.eq&&(l=this.toAssignable(l,false,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===o.eq?this.checkLValPattern(l):this.checkLValSimple(l),p.left=l,this.next(),p.right=this.parseMaybeAssign(e),a>-1&&(t.doubleProto=a),this.finishNode(p,"AssignmentExpression")}else r&&this.checkExpressionErrors(t,true);return s>-1&&(t.parenthesizedAssign=s),n>-1&&(t.trailingComma=n),l};S.parseMaybeConditional=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return s;if(this.eat(o.question)){var n=this.startNodeAt(i,r);return n.test=s,n.consequent=this.parseMaybeAssign(),this.expect(o.colon),n.alternate=this.parseMaybeAssign(e),this.finishNode(n,"ConditionalExpression")}return s};S.parseExprOps=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeUnary(t,false,false,e);return this.checkExpressionErrors(t)||s.start===i&&s.type==="ArrowFunctionExpression"?s:this.parseExprOp(s,i,r,-1,e)};S.parseExprOp=function(e,t,i,r,s){var n=this.type.binop;if(n!=null&&(!s||this.type!==o._in)&&n>r){var a=this.type===o.logicalOR||this.type===o.logicalAND,u=this.type===o.coalesce;u&&(n=o.logicalAND.binop);var c=this.value;this.next();var l=this.start,p=this.startLoc,x=this.parseExprOp(this.parseMaybeUnary(null,false,false,s),l,p,n,s),d=this.buildBinary(t,i,e,x,c,a||u);return (a&&this.type===o.coalesce||u&&(this.type===o.logicalOR||this.type===o.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(d,t,i,r,s)}return e};S.buildBinary=function(e,t,i,r,s,n){r.type==="PrivateIdentifier"&&this.raise(r.start,"Private identifier can only be left side of binary expression");var a=this.startNodeAt(e,t);return a.left=i,a.operator=s,a.right=r,this.finishNode(a,n?"LogicalExpression":"BinaryExpression")};S.parseMaybeUnary=function(e,t,i,r){var s=this.start,n=this.startLoc,a;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(r),t=true;else if(this.type.prefix){var u=this.startNode(),c=this.type===o.incDec;u.operator=this.value,u.prefix=true,this.next(),u.argument=this.parseMaybeUnary(null,true,c,r),this.checkExpressionErrors(e,true),c?this.checkLValSimple(u.argument):this.strict&&u.operator==="delete"&&Pi(u.argument)?this.raiseRecoverable(u.start,"Deleting local variable in strict mode"):u.operator==="delete"&&ht(u.argument)?this.raiseRecoverable(u.start,"Private fields can not be deleted"):t=true,a=this.finishNode(u,c?"UpdateExpression":"UnaryExpression");}else if(!t&&this.type===o.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==o._in&&this.unexpected();else {if(a=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(s,n);l.operator=this.value,l.prefix=false,l.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(l,"UpdateExpression");}}if(!i&&this.eat(o.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(s,n,a,this.parseMaybeUnary(null,false,false,r),"**",false);else return a};function Pi(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&Pi(e.expression)}function ht(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&ht(e.expression)||e.type==="ParenthesizedExpression"&&ht(e.expression)}S.parseExprSubscripts=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprAtom(e,t);if(s.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return s;var n=this.parseSubscripts(s,i,r,false,t);return e&&n.type==="MemberExpression"&&(e.parenthesizedAssign>=n.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=n.start&&(e.parenthesizedBind=-1),e.trailingComma>=n.start&&(e.trailingComma=-1)),n};S.parseSubscripts=function(e,t,i,r,s){for(var n=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=false;;){var u=this.parseSubscript(e,t,i,r,n,a,s);if(u.optional&&(a=true),u===e||u.type==="ArrowFunctionExpression"){if(a){var c=this.startNodeAt(t,i);c.expression=u,u=this.finishNode(c,"ChainExpression");}return u}e=u;}};S.shouldParseAsyncArrow=function(){return !this.canInsertSemicolon()&&this.eat(o.arrow)};S.parseSubscriptAsyncArrow=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,true,r)};S.parseSubscript=function(e,t,i,r,s,n,a){var u=this.options.ecmaVersion>=11,c=u&&this.eat(o.questionDot);r&&c&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var l=this.eat(o.bracketL);if(l||c&&this.type!==o.parenL&&this.type!==o.backQuote||this.eat(o.dot)){var p=this.startNodeAt(t,i);p.object=e,l?(p.property=this.parseExpression(),this.expect(o.bracketR)):this.type===o.privateId&&e.type!=="Super"?p.property=this.parsePrivateIdent():p.property=this.parseIdent(this.options.allowReserved!=="never"),p.computed=!!l,u&&(p.optional=c),e=this.finishNode(p,"MemberExpression");}else if(!r&&this.eat(o.parenL)){var x=new He,d=this.yieldPos,k=this.awaitPos,g=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var _=this.parseExprList(o.parenR,this.options.ecmaVersion>=8,false,x);if(s&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(x,false),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=d,this.awaitPos=k,this.awaitIdentPos=g,this.parseSubscriptAsyncArrow(t,i,_,a);this.checkExpressionErrors(x,true),this.yieldPos=d||this.yieldPos,this.awaitPos=k||this.awaitPos,this.awaitIdentPos=g||this.awaitIdentPos;var w=this.startNodeAt(t,i);w.callee=e,w.arguments=_,u&&(w.optional=c),e=this.finishNode(w,"CallExpression");}else if(this.type===o.backQuote){(c||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var N=this.startNodeAt(t,i);N.tag=e,N.quasi=this.parseTemplate({isTagged:true}),e=this.finishNode(N,"TaggedTemplateExpression");}return e};S.parseExprAtom=function(e,t,i){this.type===o.slash&&this.readRegexp();var r,s=this.potentialArrowAt===this.start;switch(this.type){case o._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type===o.parenL&&!this.allowDirectSuper&&this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==o.dot&&this.type!==o.bracketL&&this.type!==o.parenL&&this.unexpected(),this.finishNode(r,"Super");case o._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case o.name:var n=this.start,a=this.startLoc,u=this.containsEsc,c=this.parseIdent(false);if(this.options.ecmaVersion>=8&&!u&&c.name==="async"&&!this.canInsertSemicolon()&&this.eat(o._function))return this.overrideContext(L.f_expr),this.parseFunction(this.startNodeAt(n,a),0,false,true,t);if(s&&!this.canInsertSemicolon()){if(this.eat(o.arrow))return this.parseArrowExpression(this.startNodeAt(n,a),[c],false,t);if(this.options.ecmaVersion>=8&&c.name==="async"&&this.type===o.name&&!u&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return c=this.parseIdent(false),(this.canInsertSemicolon()||!this.eat(o.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,a),[c],true,t)}return c;case o.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case o.num:case o.string:return this.parseLiteral(this.value);case o._null:case o._true:case o._false:return r=this.startNode(),r.value=this.type===o._null?null:this.type===o._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case o.parenL:var p=this.start,x=this.parseParenAndDistinguishExpression(s,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(x)&&(e.parenthesizedAssign=p),e.parenthesizedBind<0&&(e.parenthesizedBind=p)),x;case o.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(o.bracketR,true,true,e),this.finishNode(r,"ArrayExpression");case o.braceL:return this.overrideContext(L.b_expr),this.parseObj(false,e);case o._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case o._class:return this.parseClass(this.startNode(),false);case o._new:return this.parseNew();case o.backQuote:return this.parseTemplate();case o._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};S.parseExprAtomDefault=function(){this.unexpected();};S.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===o.parenL&&!e)return this.parseDynamicImport(t);if(this.type===o.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}else this.unexpected();};S.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(o.parenR)?e.options=null:(this.expect(o.comma),this.afterTrailingComma(o.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(o.parenR)||(this.expect(o.comma),this.afterTrailingComma(o.parenR)||this.unexpected())));else if(!this.eat(o.parenR)){var t=this.start;this.eat(o.comma)&&this.eat(o.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t);}return this.finishNode(e,"ImportExpression")};S.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(true),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};S.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};S.parseParenExpression=function(){this.expect(o.parenL);var e=this.parseExpression();return this.expect(o.parenR),e};S.shouldParseArrow=function(e){return !this.canInsertSemicolon()};S.parseParenAndDistinguishExpression=function(e,t){var i=this.start,r=this.startLoc,s,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a=this.start,u=this.startLoc,c=[],l=true,p=false,x=new He,d=this.yieldPos,k=this.awaitPos,g;for(this.yieldPos=0,this.awaitPos=0;this.type!==o.parenR;)if(l?l=false:this.expect(o.comma),n&&this.afterTrailingComma(o.parenR,true)){p=true;break}else if(this.type===o.ellipsis){g=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===o.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else c.push(this.parseMaybeAssign(false,x,this.parseParenItem));var _=this.lastTokEnd,w=this.lastTokEndLoc;if(this.expect(o.parenR),e&&this.shouldParseArrow(c)&&this.eat(o.arrow))return this.checkPatternErrors(x,false),this.checkYieldAwaitInDefaultParams(),this.yieldPos=d,this.awaitPos=k,this.parseParenArrowList(i,r,c,t);(!c.length||p)&&this.unexpected(this.lastTokStart),g&&this.unexpected(g),this.checkExpressionErrors(x,true),this.yieldPos=d||this.yieldPos,this.awaitPos=k||this.awaitPos,c.length>1?(s=this.startNodeAt(a,u),s.expressions=c,this.finishNodeAt(s,"SequenceExpression",_,w)):s=c[0];}else s=this.parseParenExpression();if(this.options.preserveParens){var N=this.startNodeAt(i,r);return N.expression=s,this.finishNode(N,"ParenthesizedExpression")}else return s};S.parseParenItem=function(e){return e};S.parseParenArrowList=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,false,r)};var wr=[];S.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===o.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(true),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,s=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,false,true),r,s,true,false),this.eat(o.parenL)?e.arguments=this.parseExprList(o.parenR,this.options.ecmaVersion>=8,false):e.arguments=wr,this.finishNode(e,"NewExpression")};S.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===o.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,`
5
+ ]`;continue}s+=r[c],r[c]==="\\"?n=true:a&&r[c]==="]"?a=false:!a&&r[c]==="["&&(a=true);}try{new RegExp(s);}catch{return console.warn(`Could not convert regex pattern at ${t.currentPath.join("/")} to a flag-independent form! Falling back to the flag-ignorant source`),e.source}return s}function De(e,t){if(t.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),t.target==="openApi3"&&e.keyType?._def.typeName===a$4.ZodEnum)return {type:"object",required:e.keyType._def.values,properties:e.keyType._def.values.reduce((r,s)=>({...r,[s]:b(e.valueType._def,{...t,currentPath:[...t.currentPath,"properties",s]})??L(t)}),{}),additionalProperties:t.rejectedAdditionalProperties};let i={type:"object",additionalProperties:b(e.valueType._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]})??t.allowedAdditionalProperties};if(t.target==="openApi3")return i;if(e.keyType?._def.typeName===a$4.ZodString&&e.keyType._def.checks?.length){let{type:r,...s}=Oe(e.keyType._def,t);return {...i,propertyNames:s}}else {if(e.keyType?._def.typeName===a$4.ZodEnum)return {...i,propertyNames:{enum:e.keyType._def.values}};if(e.keyType?._def.typeName===a$4.ZodBranded&&e.keyType._def.type._def.typeName===a$4.ZodString&&e.keyType._def.type._def.checks?.length){let{type:r,...s}=Le(e.keyType._def,t);return {...i,propertyNames:s}}}return i}function Ut(e,t){if(t.mapStrategy==="record")return De(e,t);let i=b(e.keyType._def,{...t,currentPath:[...t.currentPath,"items","items","0"]})||L(t),r=b(e.valueType._def,{...t,currentPath:[...t.currentPath,"items","items","1"]})||L(t);return {type:"array",maxItems:125,items:{type:"array",items:[i,r],minItems:2,maxItems:2}}}function zt(e){let t=e.values,r=Object.keys(e.values).filter(n=>typeof t[t[n]]!="number").map(n=>t[n]),s=Array.from(new Set(r.map(n=>typeof n)));return {type:s.length===1?s[0]==="string"?"string":"number":["string","number"],enum:r}}function Wt(e){return e.target==="openAi"?void 0:{not:L({...e,currentPath:[...e.currentPath,"not"]})}}function $t(e){return e.target==="openApi3"?{enum:["null"],nullable:true}:{type:"null"}}var Ae={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};function Zt(e,t){if(t.target==="openApi3")return Ht(e,t);let i=e.options instanceof Map?Array.from(e.options.values()):e.options;if(i.every(r=>r._def.typeName in Ae&&(!r._def.checks||!r._def.checks.length))){let r=i.reduce((s,n)=>{let a=Ae[n._def.typeName];return a&&!s.includes(a)?[...s,a]:s},[]);return {type:r.length>1?r:r[0]}}else if(i.every(r=>r._def.typeName==="ZodLiteral"&&!r.description)){let r=i.reduce((s,n)=>{let a=typeof n._def.value;switch(a){case "string":case "number":case "boolean":return [...s,a];case "bigint":return [...s,"integer"];case "object":if(n._def.value===null)return [...s,"null"];default:return s}},[]);if(r.length===i.length){let s=r.filter((n,a,u)=>u.indexOf(n)===a);return {type:s.length>1?s:s[0],enum:i.reduce((n,a)=>n.includes(a._def.value)?n:[...n,a._def.value],[])}}}else if(i.every(r=>r._def.typeName==="ZodEnum"))return {type:"string",enum:i.reduce((r,s)=>[...r,...s._def.values.filter(n=>!r.includes(n))],[])};return Ht(e,t)}var Ht=(e,t)=>{let i=(e.options instanceof Map?Array.from(e.options.values()):e.options).map((r,s)=>b(r._def,{...t,currentPath:[...t.currentPath,"anyOf",`${s}`]})).filter(r=>!!r&&(!t.strictUnions||typeof r=="object"&&Object.keys(r).length>0));return i.length?{anyOf:i}:void 0};function Kt(e,t){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(e.innerType._def.typeName)&&(!e.innerType._def.checks||!e.innerType._def.checks.length))return t.target==="openApi3"?{type:Ae[e.innerType._def.typeName],nullable:true}:{type:[Ae[e.innerType._def.typeName],"null"]};if(t.target==="openApi3"){let r=b(e.innerType._def,{...t,currentPath:[...t.currentPath]});return r&&"$ref"in r?{allOf:[r],nullable:true}:r&&{...r,nullable:true}}let i=b(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","0"]});return i&&{anyOf:[i,{type:"null"}]}}function qt(e,t){let i={type:"number"};if(!e.checks)return i;for(let r of e.checks)switch(r.kind){case "int":i.type="integer",et(i,"type",r.message,t);break;case "min":t.target==="jsonSchema7"?r.inclusive?P(i,"minimum",r.value,r.message,t):P(i,"exclusiveMinimum",r.value,r.message,t):(r.inclusive||(i.exclusiveMinimum=true),P(i,"minimum",r.value,r.message,t));break;case "max":t.target==="jsonSchema7"?r.inclusive?P(i,"maximum",r.value,r.message,t):P(i,"exclusiveMaximum",r.value,r.message,t):(r.inclusive||(i.exclusiveMaximum=true),P(i,"maximum",r.value,r.message,t));break;case "multipleOf":P(i,"multipleOf",r.value,r.message,t);break}return i}function Gt(e,t){let i=t.target==="openAi",r={type:"object",properties:{}},s=[],n=e.shape();for(let u in n){let c=n[u];if(c===void 0||c._def===void 0)continue;let l=sr(c);l&&i&&(c._def.typeName==="ZodOptional"&&(c=c._def.innerType),c.isNullable()||(c=c.nullable()),l=false);let p=b(c._def,{...t,currentPath:[...t.currentPath,"properties",u],propertyPath:[...t.currentPath,"properties",u]});p!==void 0&&(r.properties[u]=p,l||s.push(u));}s.length&&(r.required=s);let a=rr(e,t);return a!==void 0&&(r.additionalProperties=a),r}function rr(e,t){if(e.catchall._def.typeName!=="ZodNever")return b(e.catchall._def,{...t,currentPath:[...t.currentPath,"additionalProperties"]});switch(e.unknownKeys){case "passthrough":return t.allowedAdditionalProperties;case "strict":return t.rejectedAdditionalProperties;case "strip":return t.removeAdditionalStrategy==="strict"?t.allowedAdditionalProperties:t.rejectedAdditionalProperties}}function sr(e){try{return e.isOptional()}catch{return true}}var Jt=(e,t)=>{if(t.currentPath.toString()===t.propertyPath?.toString())return b(e.innerType._def,t);let i=b(e.innerType._def,{...t,currentPath:[...t.currentPath,"anyOf","1"]});return i?{anyOf:[{not:L(t)},i]}:L(t)};var Yt=(e,t)=>{if(t.pipeStrategy==="input")return b(e.in._def,t);if(t.pipeStrategy==="output")return b(e.out._def,t);let i=b(e.in._def,{...t,currentPath:[...t.currentPath,"allOf","0"]}),r=b(e.out._def,{...t,currentPath:[...t.currentPath,"allOf",i?"1":"0"]});return {allOf:[i,r].filter(s=>s!==void 0)}};function Qt(e,t){return b(e.type._def,t)}function Xt(e,t){let r={type:"array",uniqueItems:true,items:b(e.valueType._def,{...t,currentPath:[...t.currentPath,"items"]})};return e.minSize&&P(r,"minItems",e.minSize.value,e.minSize.message,t),e.maxSize&&P(r,"maxItems",e.maxSize.value,e.maxSize.message,t),r}function ei(e,t){return e.rest?{type:"array",minItems:e.items.length,items:e.items.map((i,r)=>b(i._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((i,r)=>r===void 0?i:[...i,r],[]),additionalItems:b(e.rest._def,{...t,currentPath:[...t.currentPath,"additionalItems"]})}:{type:"array",minItems:e.items.length,maxItems:e.items.length,items:e.items.map((i,r)=>b(i._def,{...t,currentPath:[...t.currentPath,"items",`${r}`]})).reduce((i,r)=>r===void 0?i:[...i,r],[])}}function ti(e){return {not:L(e)}}function ii(e){return L(e)}var ri=(e,t)=>b(e.innerType._def,t);var si=(e,t,i)=>{switch(t){case a$4.ZodString:return Oe(e,i);case a$4.ZodNumber:return qt(e,i);case a$4.ZodObject:return Gt(e,i);case a$4.ZodBigInt:return Rt(e,i);case a$4.ZodBoolean:return Lt();case a$4.ZodDate:return tt(e,i);case a$4.ZodUndefined:return ti(i);case a$4.ZodNull:return $t(i);case a$4.ZodArray:return Nt(e,i);case a$4.ZodUnion:case a$4.ZodDiscriminatedUnion:return Zt(e,i);case a$4.ZodIntersection:return Vt(e,i);case a$4.ZodTuple:return ei(e,i);case a$4.ZodRecord:return De(e,i);case a$4.ZodLiteral:return jt(e,i);case a$4.ZodEnum:return Ft(e);case a$4.ZodNativeEnum:return zt(e);case a$4.ZodNullable:return Kt(e,i);case a$4.ZodOptional:return Jt(e,i);case a$4.ZodMap:return Ut(e,i);case a$4.ZodSet:return Xt(e,i);case a$4.ZodLazy:return ()=>e.getter()._def;case a$4.ZodPromise:return Qt(e,i);case a$4.ZodNaN:case a$4.ZodNever:return Wt(i);case a$4.ZodEffects:return Mt(e,i);case a$4.ZodAny:return L(i);case a$4.ZodUnknown:return ii(i);case a$4.ZodDefault:return Dt(e,i);case a$4.ZodBranded:return Le(e,i);case a$4.ZodReadonly:return ri(e,i);case a$4.ZodCatch:return Ot(e,i);case a$4.ZodPipeline:return Yt(e,i);case a$4.ZodFunction:case a$4.ZodVoid:case a$4.ZodSymbol:return;default:return (r=>{})()}};function b(e,t,i=false){let r=t.seen.get(e);if(t.override){let u=t.override?.(e,t,r,i);if(u!==Ct)return u}if(r&&!i){let u=nr(r,t);if(u!==void 0)return u}let s={def:e,path:t.currentPath,jsonSchema:void 0};t.seen.set(e,s);let n=si(e,e.typeName,t),a=typeof n=="function"?b(n(),t):n;if(a&&ar(e,t,a),t.postProcess){let u=t.postProcess(a,e,t);return s.jsonSchema=a,u}return s.jsonSchema=a,a}var nr=(e,t)=>{switch(t.$refStrategy){case "root":return {$ref:e.path.join("/")};case "relative":return {$ref:Re(t.currentPath,e.path)};case "none":case "seen":return e.path.length<t.currentPath.length&&e.path.every((i,r)=>t.currentPath[r]===i)?(console.warn(`Recursive reference detected at ${t.currentPath.join("/")}! Defaulting to any`),L(t)):t.$refStrategy==="seen"?L(t):void 0}},ar=(e,t,i)=>(e.description&&(i.description=e.description,t.markdownDescription&&(i.markdownDescription=e.description)),i);var st=(e,t)=>{let i=Tt(t),r=void 0,s=t?.name,n=b(e._def,i,false)??L(i);i.flags.hasReferencedOpenAiAnyType&&(r||(r={}),r[i.openAiAnyTypeName]||(r[i.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:i.$refStrategy==="relative"?"1":[...i.basePath,i.definitionPath,i.openAiAnyTypeName].join("/")}}));let u=s===void 0?r?{...n,[i.definitionPath]:r}:n:{$ref:[...i.$refStrategy==="relative"?[]:i.basePath,i.definitionPath,s].join("/"),[i.definitionPath]:{...r,[s]:n}};return i.target==="jsonSchema7"?u.$schema="http://json-schema.org/draft-07/schema#":(i.target==="jsonSchema2019-09"||i.target==="openAi")&&(u.$schema="https://json-schema.org/draft/2019-09/schema#"),i.target==="openAi"&&("anyOf"in u||"oneOf"in u||"allOf"in u||"type"in u&&Array.isArray(u.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),u};var or={"grpc.keepalive_time_ms":3e4,"grpc.keepalive_timeout_ms":1e4,"grpc.keepalive_permit_without_calls":1,"grpc.max_send_message_length":-1,"grpc.max_receive_message_length":-1,"grpc.enable_retries":1},Me=class{server;constructor(){this.server=new Z.Server(or);}addService(t){this.server.addService(a.LogicMesh.service,{NegotiateIntent:t.negotiateIntent,ExecuteLogic:t.executeLogic});}async listen(t=50051,i){let r=b$1(i);return new Promise((s,n)=>{this.server.bindAsync(`0.0.0.0:${t}`,r,(a,u)=>{if(a){n(a);return}a$1.info(`[LIOP-RPC] Server listening on port ${u}`),s(u);});})}async stop(){return new Promise(t=>{this.server.tryShutdown(()=>{a$1.info("[LIOP-RPC] Server shut down"),t();});})}};var pe={audience:"urn:liop:mesh:api",tokenTtlSeconds:3600,jwksCacheTtlMs:6e5,jwksCooldownMs:3e4,clockToleranceSec:5,signingAlgorithm:"EdDSA"};var Pe=class{jwksResolver;issuer;audience;constructor(t,i,r){this.issuer=t,this.audience=i,r instanceof URL?this.jwksResolver=Ee.createRemoteJWKSet(r,{cacheMaxAge:pe.jwksCacheTtlMs,cooldownDuration:pe.jwksCooldownMs}):this.jwksResolver=Ee.createLocalJWKSet(r);}async validate(t){let i=this.buildIssuerAliases(),{payload:r}=await Ee.jwtVerify(t,this.jwksResolver,{issuer:i.length>1?i:this.issuer,audience:this.audience,algorithms:[pe.signingAlgorithm,"ES256"],clockTolerance:pe.clockToleranceSec,requiredClaims:["sub","scope"]});return {token:t,clientId:r.sub??"unknown",scopes:typeof r.scope=="string"?r.scope.split(" "):[],expiresAt:r.exp}}buildIssuerAliases(){let t=[this.issuer],i=this.issuer.endsWith("/")?this.issuer.slice(0,-1):this.issuer,r=["nexus:3000","liop-nexus:3000","127.0.0.1:3000","localhost:3000","127.0.0.1:13000","localhost:13000","127.0.0.1:13001","localhost:13001"],s="";try{let u=new URL(i);s=`${u.hostname}:${u.port||"3000"}`;}catch{return t}if(!r.some(u=>s===u))return t;let a=i.replace(/^https?:\/\/[^/]+/,"");for(let u of r){let c=`http://${u}${a}`;t.includes(c)||t.push(c);}if(a)for(let u of r){let c=`http://${u}`;t.includes(c)||t.push(c);}else for(let u of r){let c=`http://${u}/oidc`;t.includes(c)||t.push(c);}return t}getIssuer(){return this.issuer}getAudience(){return this.audience}};function ai(e){let{privateKey:t,publicKey:i}=me.generateKeyPairSync("ed25519"),r=t.export({format:"jwk"}),s=i.export({format:"jwk"}),n=me.createHash("sha256").update(s.x||"").digest("hex").slice(0,16),a={...r,kid:n,use:"sig",alg:"EdDSA"},u={...s,kid:n,use:"sig",alg:"EdDSA"},c={keys:[a]},l={keys:[u]},p={scopes:["openid","offline_access",...b$2],clients:e.clients.map(k=>({client_id:k.client_id,client_secret:k.client_secret,grant_types:["client_credentials"],response_types:[],redirect_uris:[],scope:k.scope,token_endpoint_auth_method:"client_secret_post",id_token_signed_response_alg:"EdDSA"})),features:{clientCredentials:{enabled:true},devInteractions:{enabled:false},resourceIndicators:{enabled:true,useGrantedResource:()=>true,getResourceServerInfo:(k,m,S)=>({scope:S.scope||"",accessTokenFormat:"jwt",jwt:{sign:{alg:"EdDSA"}}})}},formats:{AccessToken:"jwt"},interactions:{url:()=>{throw new Error("InteractionsNotSupportedException: This Authorization Server is strictly configured for Machine-to-Machine flows.")}},jwks:c,ttl:{ClientCredentials:3600},cookies:{keys:[me.randomBytes(32).toString("hex")]},extraTokenClaims:(k,m)=>m.kind==="AccessToken"?{scope:m.scope}:{}},y=e.issuer.endsWith("/")?e.issuer.slice(0,-1):e.issuer,g=new ur(y,p);return g.proxy=true,{provider:g,jwks:l}}var cr=[509,0,227,0,150,4,294,9,1368,2,2,1,6,3,41,2,5,0,166,1,574,3,9,9,7,9,32,4,318,1,78,5,71,10,50,3,123,2,54,14,32,10,3,1,11,3,46,10,8,0,46,9,7,2,37,13,2,9,6,1,45,0,13,2,49,13,9,3,2,11,83,11,7,0,3,0,158,11,6,9,7,3,56,1,2,6,3,1,3,2,10,0,11,1,3,6,4,4,68,8,2,0,3,0,2,3,2,4,2,0,15,1,83,17,10,9,5,0,82,19,13,9,214,6,3,8,28,1,83,16,16,9,82,12,9,9,7,19,58,14,5,9,243,14,166,9,71,5,2,1,3,3,2,0,2,1,13,9,120,6,3,6,4,0,29,9,41,6,2,3,9,0,10,10,47,15,199,7,137,9,54,7,2,7,17,9,57,21,2,13,123,5,4,0,2,1,2,6,2,0,9,9,49,4,2,1,2,4,9,9,55,9,266,3,10,1,2,0,49,6,4,4,14,10,5350,0,7,14,11465,27,2343,9,87,9,39,4,60,6,26,9,535,9,470,0,2,54,8,3,82,0,12,1,19628,1,4178,9,519,45,3,22,543,4,4,5,9,7,3,6,31,3,149,2,1418,49,513,54,5,49,9,0,15,0,23,4,2,14,1361,6,2,16,3,6,2,1,2,4,101,0,161,6,10,9,357,0,62,13,499,13,245,1,2,9,233,0,3,0,8,1,6,0,475,6,110,6,6,9,4759,9,787719,239],hi=[0,11,2,25,2,18,2,1,2,14,3,13,35,122,70,52,268,28,4,48,48,31,14,29,6,37,11,29,3,35,5,7,2,4,43,157,19,35,5,35,5,39,9,51,13,10,2,14,2,6,2,1,2,10,2,14,2,6,2,1,4,51,13,310,10,21,11,7,25,5,2,41,2,8,70,5,3,0,2,43,2,1,4,0,3,22,11,22,10,30,66,18,2,1,11,21,11,25,7,25,39,55,7,1,65,0,16,3,2,2,2,28,43,28,4,28,36,7,2,27,28,53,11,21,11,18,14,17,111,72,56,50,14,50,14,35,39,27,10,22,251,41,7,1,17,5,57,28,11,0,9,21,43,17,47,20,28,22,13,52,58,1,3,0,14,44,33,24,27,35,30,0,3,0,9,34,4,0,13,47,15,3,22,0,2,0,36,17,2,24,20,1,64,6,2,0,2,3,2,14,2,9,8,46,39,7,3,1,3,21,2,6,2,1,2,4,4,0,19,0,13,4,31,9,2,0,3,0,2,37,2,0,26,0,2,0,45,52,19,3,21,2,31,47,21,1,2,0,185,46,42,3,37,47,21,0,60,42,14,0,72,26,38,6,186,43,117,63,32,7,3,0,3,7,2,1,2,23,16,0,2,0,95,7,3,38,17,0,2,0,29,0,11,39,8,0,22,0,12,45,20,0,19,72,200,32,32,8,2,36,18,0,50,29,113,6,2,1,2,37,22,0,26,5,2,1,2,31,15,0,24,43,261,18,16,0,2,12,2,33,125,0,80,921,103,110,18,195,2637,96,16,1071,18,5,26,3994,6,582,6842,29,1763,568,8,30,18,78,18,29,19,47,17,3,32,20,6,18,433,44,212,63,33,24,3,24,45,74,6,0,67,12,65,1,2,0,15,4,10,7381,42,31,98,114,8702,3,2,6,2,1,2,290,16,0,30,2,3,0,15,3,9,395,2309,106,6,12,4,8,8,9,5991,84,2,70,2,1,3,0,3,1,3,3,2,11,2,0,2,6,2,64,2,3,3,7,2,6,2,27,2,3,2,4,2,0,4,6,2,339,3,24,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,30,2,24,2,7,1845,30,7,5,262,61,147,44,11,6,17,0,322,29,19,43,485,27,229,29,3,0,208,30,2,2,2,1,2,6,3,4,10,1,225,6,2,3,2,1,2,14,2,196,60,67,8,0,1205,3,2,26,2,1,2,0,3,0,2,9,2,3,2,0,2,0,7,0,5,0,2,0,2,0,2,2,2,1,2,0,3,0,2,0,2,0,2,0,2,0,2,1,2,0,3,3,2,6,2,3,2,3,2,0,2,9,2,16,6,2,2,4,2,16,4421,42719,33,4381,3,5773,3,7472,16,621,2467,541,1507,4938,6,8489],lr="\u200C\u200D\xB7\u0300-\u036F\u0387\u0483-\u0487\u0591-\u05BD\u05BF\u05C1\u05C2\u05C4\u05C5\u05C7\u0610-\u061A\u064B-\u0669\u0670\u06D6-\u06DC\u06DF-\u06E4\u06E7\u06E8\u06EA-\u06ED\u06F0-\u06F9\u0711\u0730-\u074A\u07A6-\u07B0\u07C0-\u07C9\u07EB-\u07F3\u07FD\u0816-\u0819\u081B-\u0823\u0825-\u0827\u0829-\u082D\u0859-\u085B\u0897-\u089F\u08CA-\u08E1\u08E3-\u0903\u093A-\u093C\u093E-\u094F\u0951-\u0957\u0962\u0963\u0966-\u096F\u0981-\u0983\u09BC\u09BE-\u09C4\u09C7\u09C8\u09CB-\u09CD\u09D7\u09E2\u09E3\u09E6-\u09EF\u09FE\u0A01-\u0A03\u0A3C\u0A3E-\u0A42\u0A47\u0A48\u0A4B-\u0A4D\u0A51\u0A66-\u0A71\u0A75\u0A81-\u0A83\u0ABC\u0ABE-\u0AC5\u0AC7-\u0AC9\u0ACB-\u0ACD\u0AE2\u0AE3\u0AE6-\u0AEF\u0AFA-\u0AFF\u0B01-\u0B03\u0B3C\u0B3E-\u0B44\u0B47\u0B48\u0B4B-\u0B4D\u0B55-\u0B57\u0B62\u0B63\u0B66-\u0B6F\u0B82\u0BBE-\u0BC2\u0BC6-\u0BC8\u0BCA-\u0BCD\u0BD7\u0BE6-\u0BEF\u0C00-\u0C04\u0C3C\u0C3E-\u0C44\u0C46-\u0C48\u0C4A-\u0C4D\u0C55\u0C56\u0C62\u0C63\u0C66-\u0C6F\u0C81-\u0C83\u0CBC\u0CBE-\u0CC4\u0CC6-\u0CC8\u0CCA-\u0CCD\u0CD5\u0CD6\u0CE2\u0CE3\u0CE6-\u0CEF\u0CF3\u0D00-\u0D03\u0D3B\u0D3C\u0D3E-\u0D44\u0D46-\u0D48\u0D4A-\u0D4D\u0D57\u0D62\u0D63\u0D66-\u0D6F\u0D81-\u0D83\u0DCA\u0DCF-\u0DD4\u0DD6\u0DD8-\u0DDF\u0DE6-\u0DEF\u0DF2\u0DF3\u0E31\u0E34-\u0E3A\u0E47-\u0E4E\u0E50-\u0E59\u0EB1\u0EB4-\u0EBC\u0EC8-\u0ECE\u0ED0-\u0ED9\u0F18\u0F19\u0F20-\u0F29\u0F35\u0F37\u0F39\u0F3E\u0F3F\u0F71-\u0F84\u0F86\u0F87\u0F8D-\u0F97\u0F99-\u0FBC\u0FC6\u102B-\u103E\u1040-\u1049\u1056-\u1059\u105E-\u1060\u1062-\u1064\u1067-\u106D\u1071-\u1074\u1082-\u108D\u108F-\u109D\u135D-\u135F\u1369-\u1371\u1712-\u1715\u1732-\u1734\u1752\u1753\u1772\u1773\u17B4-\u17D3\u17DD\u17E0-\u17E9\u180B-\u180D\u180F-\u1819\u18A9\u1920-\u192B\u1930-\u193B\u1946-\u194F\u19D0-\u19DA\u1A17-\u1A1B\u1A55-\u1A5E\u1A60-\u1A7C\u1A7F-\u1A89\u1A90-\u1A99\u1AB0-\u1ABD\u1ABF-\u1ADD\u1AE0-\u1AEB\u1B00-\u1B04\u1B34-\u1B44\u1B50-\u1B59\u1B6B-\u1B73\u1B80-\u1B82\u1BA1-\u1BAD\u1BB0-\u1BB9\u1BE6-\u1BF3\u1C24-\u1C37\u1C40-\u1C49\u1C50-\u1C59\u1CD0-\u1CD2\u1CD4-\u1CE8\u1CED\u1CF4\u1CF7-\u1CF9\u1DC0-\u1DFF\u200C\u200D\u203F\u2040\u2054\u20D0-\u20DC\u20E1\u20E5-\u20F0\u2CEF-\u2CF1\u2D7F\u2DE0-\u2DFF\u302A-\u302F\u3099\u309A\u30FB\uA620-\uA629\uA66F\uA674-\uA67D\uA69E\uA69F\uA6F0\uA6F1\uA802\uA806\uA80B\uA823-\uA827\uA82C\uA880\uA881\uA8B4-\uA8C5\uA8D0-\uA8D9\uA8E0-\uA8F1\uA8FF-\uA909\uA926-\uA92D\uA947-\uA953\uA980-\uA983\uA9B3-\uA9C0\uA9D0-\uA9D9\uA9E5\uA9F0-\uA9F9\uAA29-\uAA36\uAA43\uAA4C\uAA4D\uAA50-\uAA59\uAA7B-\uAA7D\uAAB0\uAAB2-\uAAB4\uAAB7\uAAB8\uAABE\uAABF\uAAC1\uAAEB-\uAAEF\uAAF5\uAAF6\uABE3-\uABEA\uABEC\uABED\uABF0-\uABF9\uFB1E\uFE00-\uFE0F\uFE20-\uFE2F\uFE33\uFE34\uFE4D-\uFE4F\uFF10-\uFF19\uFF3F\uFF65",fi="\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u0870-\u0887\u0889-\u088F\u08A0-\u08C9\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C5C\u0C5D\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDC-\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u1711\u171F-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4C\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C8A\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2118-\u211D\u2124\u2126\u2128\u212A-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2160-\u2188\u2C00-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u3005-\u3007\u3021-\u3029\u3031-\u3035\u3038-\u303C\u3041-\u3096\u309B-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BF\u31F0-\u31FF\u3400-\u4DBF\u4E00-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7DC\uA7F1-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC",at={3:"abstract boolean byte char class double enum export extends final float goto implements import int interface long native package private protected public short static super synchronized throws transient volatile",5:"class enum extends super const export import",6:"enum",strict:"implements interface let package private protected public static yield",strictBind:"eval arguments"},ot="break case catch continue debugger default do else finally for function if return switch throw try var while with null true false instanceof typeof void delete new in this",pr={5:ot,"5module":ot+" export import",6:ot+" const class extends export import super"},di=/^in(stanceof)?$/,hr=new RegExp("["+fi+"]"),fr=new RegExp("["+fi+lr+"]");function ct(e,t){for(var i=65536,r=0;r<t.length;r+=2){if(i+=t[r],i>e)return false;if(i+=t[r+1],i>=e)return true}return false}function se(e,t){return e<65?e===36:e<91?true:e<97?e===95:e<123?true:e<=65535?e>=170&&hr.test(String.fromCharCode(e)):t===false?false:ct(e,hi)}function fe(e,t){return e<48?e===36:e<58?true:e<65?false:e<91?true:e<97?e===95:e<123?true:e<=65535?e>=170&&fr.test(String.fromCharCode(e)):t===false?false:ct(e,hi)||ct(e,cr)}var I=function(t,i){i===void 0&&(i={}),this.label=t,this.keyword=i.keyword,this.beforeExpr=!!i.beforeExpr,this.startsExpr=!!i.startsExpr,this.isLoop=!!i.isLoop,this.isAssign=!!i.isAssign,this.prefix=!!i.prefix,this.postfix=!!i.postfix,this.binop=i.binop||null,this.updateContext=null;};function q(e,t){return new I(e,{beforeExpr:true,binop:t})}var G={beforeExpr:true},$={startsExpr:true},ft={};function C(e,t){return t===void 0&&(t={}),t.keyword=e,ft[e]=new I(e,t)}var o={num:new I("num",$),regexp:new I("regexp",$),string:new I("string",$),name:new I("name",$),privateId:new I("privateId",$),eof:new I("eof"),bracketL:new I("[",{beforeExpr:true,startsExpr:true}),bracketR:new I("]"),braceL:new I("{",{beforeExpr:true,startsExpr:true}),braceR:new I("}"),parenL:new I("(",{beforeExpr:true,startsExpr:true}),parenR:new I(")"),comma:new I(",",G),semi:new I(";",G),colon:new I(":",G),dot:new I("."),question:new I("?",G),questionDot:new I("?."),arrow:new I("=>",G),template:new I("template"),invalidTemplate:new I("invalidTemplate"),ellipsis:new I("...",G),backQuote:new I("`",$),dollarBraceL:new I("${",{beforeExpr:true,startsExpr:true}),eq:new I("=",{beforeExpr:true,isAssign:true}),assign:new I("_=",{beforeExpr:true,isAssign:true}),incDec:new I("++/--",{prefix:true,postfix:true,startsExpr:true}),prefix:new I("!/~",{beforeExpr:true,prefix:true,startsExpr:true}),logicalOR:q("||",1),logicalAND:q("&&",2),bitwiseOR:q("|",3),bitwiseXOR:q("^",4),bitwiseAND:q("&",5),equality:q("==/!=/===/!==",6),relational:q("</>/<=/>=",7),bitShift:q("<</>>/>>>",8),plusMin:new I("+/-",{beforeExpr:true,binop:9,prefix:true,startsExpr:true}),modulo:q("%",10),star:q("*",10),slash:q("/",10),starstar:new I("**",{beforeExpr:true}),coalesce:q("??",1),_break:C("break"),_case:C("case",G),_catch:C("catch"),_continue:C("continue"),_debugger:C("debugger"),_default:C("default",G),_do:C("do",{isLoop:true,beforeExpr:true}),_else:C("else",G),_finally:C("finally"),_for:C("for",{isLoop:true}),_function:C("function",$),_if:C("if"),_return:C("return",G),_switch:C("switch"),_throw:C("throw",G),_try:C("try"),_var:C("var"),_const:C("const"),_while:C("while",{isLoop:true}),_with:C("with"),_new:C("new",{beforeExpr:true,startsExpr:true}),_this:C("this",$),_super:C("super",$),_class:C("class",$),_extends:C("extends",G),_export:C("export"),_import:C("import",$),_null:C("null",$),_true:C("true",$),_false:C("false",$),_in:C("in",{beforeExpr:true,binop:7}),_instanceof:C("instanceof",{beforeExpr:true,binop:7}),_typeof:C("typeof",{beforeExpr:true,prefix:true,startsExpr:true}),_void:C("void",{beforeExpr:true,prefix:true,startsExpr:true}),_delete:C("delete",{beforeExpr:true,prefix:true,startsExpr:true})},H=/\r\n?|\n|\u2028|\u2029/,dr=new RegExp(H.source,"g");function _e(e){return e===10||e===13||e===8232||e===8233}function mi(e,t,i){i===void 0&&(i=e.length);for(var r=t;r<i;r++){var s=e.charCodeAt(r);if(_e(s))return r<i-1&&s===13&&e.charCodeAt(r+1)===10?r+2:r+1}return -1}var gi=/[\u1680\u2000-\u200a\u202f\u205f\u3000\ufeff]/,B=/(?:\s|\/\/.*|\/\*[^]*?\*\/)*/g,yi=Object.prototype,mr=yi.hasOwnProperty,gr=yi.toString,we=Object.hasOwn||(function(e,t){return mr.call(e,t)}),oi=Array.isArray||(function(e){return gr.call(e)==="[object Array]"}),ui=Object.create(null);function he(e){return ui[e]||(ui[e]=new RegExp("^(?:"+e.replace(/ /g,"|")+")$"))}function oe(e){return e<=65535?String.fromCharCode(e):(e-=65536,String.fromCharCode((e>>10)+55296,(e&1023)+56320))}var yr=/(?:[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])/,Ie=function(t,i){this.line=t,this.column=i;};Ie.prototype.offset=function(t){return new Ie(this.line,this.column+t)};var ze=function(t,i,r){this.start=i,this.end=r,t.sourceFile!==null&&(this.source=t.sourceFile);};function xi(e,t){for(var i=1,r=0;;){var s=mi(e,r,t);if(s<0)return new Ie(i,t-r);++i,r=s;}}var lt={ecmaVersion:null,sourceType:"script",onInsertedSemicolon:null,onTrailingComma:null,allowReserved:null,allowReturnOutsideFunction:false,allowImportExportEverywhere:false,allowAwaitOutsideFunction:null,allowSuperOutsideMethod:null,allowHashBang:false,checkPrivateFields:true,locations:false,onToken:null,onComment:null,ranges:false,program:null,sourceFile:null,directSourceFile:null,preserveParens:false},ci=false;function xr(e){var t={};for(var i in lt)t[i]=e&&we(e,i)?e[i]:lt[i];if(t.ecmaVersion==="latest"?t.ecmaVersion=1e8:t.ecmaVersion==null?(!ci&&typeof console=="object"&&console.warn&&(ci=true,console.warn(`Since Acorn 8.0.0, options.ecmaVersion is required.
6
+ Defaulting to 2020, but this will stop working in the future.`)),t.ecmaVersion=11):t.ecmaVersion>=2015&&(t.ecmaVersion-=2009),t.allowReserved==null&&(t.allowReserved=t.ecmaVersion<5),(!e||e.allowHashBang==null)&&(t.allowHashBang=t.ecmaVersion>=14),oi(t.onToken)){var r=t.onToken;t.onToken=function(s){return r.push(s)};}if(oi(t.onComment)&&(t.onComment=vr(t,t.onComment)),t.sourceType==="commonjs"&&t.allowAwaitOutsideFunction)throw new Error("Cannot use allowAwaitOutsideFunction with sourceType: commonjs");return t}function vr(e,t){return function(i,r,s,n,a,u){var c={type:i?"Block":"Line",value:r,start:s,end:n};e.locations&&(c.loc=new ze(this,a,u)),e.ranges&&(c.range=[s,n]),t.push(c);}}var xe=1,ve=2,dt=4,vi=8,mt=16,bi=32,We=64,Si=128,be=256,Te=512,Ei=1024,$e=xe|ve|be;function gt(e,t){return ve|(e?dt:0)|(t?vi:0)}var Ve=0,yt=1,ce=2,_i=3,wi=4,ki=5,F=function(t,i,r){this.options=t=xr(t),this.sourceFile=t.sourceFile,this.keywords=he(pr[t.ecmaVersion>=6?6:t.sourceType==="module"?"5module":5]);var s="";t.allowReserved!==true&&(s=at[t.ecmaVersion>=6?6:t.ecmaVersion===5?5:3],t.sourceType==="module"&&(s+=" await")),this.reservedWords=he(s);var n=(s?s+" ":"")+at.strict;this.reservedWordsStrict=he(n),this.reservedWordsStrictBind=he(n+" "+at.strictBind),this.input=String(i),this.containsEsc=false,r?(this.pos=r,this.lineStart=this.input.lastIndexOf(`
7
+ `,r-1)+1,this.curLine=this.input.slice(0,this.lineStart).split(H).length):(this.pos=this.lineStart=0,this.curLine=1),this.type=o.eof,this.value=null,this.start=this.end=this.pos,this.startLoc=this.endLoc=this.curPosition(),this.lastTokEndLoc=this.lastTokStartLoc=null,this.lastTokStart=this.lastTokEnd=this.pos,this.context=this.initialContext(),this.exprAllowed=true,this.inModule=t.sourceType==="module",this.strict=this.inModule||this.strictDirective(this.pos),this.potentialArrowAt=-1,this.potentialArrowInForAwait=false,this.yieldPos=this.awaitPos=this.awaitIdentPos=0,this.labels=[],this.undefinedExports=Object.create(null),this.pos===0&&t.allowHashBang&&this.input.slice(0,2)==="#!"&&this.skipLineComment(2),this.scopeStack=[],this.enterScope(this.options.sourceType==="commonjs"?ve:xe),this.regexpState=null,this.privateNameStack=[];},Y={inFunction:{configurable:true},inGenerator:{configurable:true},inAsync:{configurable:true},canAwait:{configurable:true},allowReturn:{configurable:true},allowSuper:{configurable:true},allowDirectSuper:{configurable:true},treatFunctionsAsVar:{configurable:true},allowNewDotTarget:{configurable:true},allowUsing:{configurable:true},inClassStaticBlock:{configurable:true}};F.prototype.parse=function(){var t=this.options.program||this.startNode();return this.nextToken(),this.parseTopLevel(t)};Y.inFunction.get=function(){return (this.currentVarScope().flags&ve)>0};Y.inGenerator.get=function(){return (this.currentVarScope().flags&vi)>0};Y.inAsync.get=function(){return (this.currentVarScope().flags&dt)>0};Y.canAwait.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(be|Te))return false;if(i&ve)return (i&dt)>0}return this.inModule&&this.options.ecmaVersion>=13||this.options.allowAwaitOutsideFunction};Y.allowReturn.get=function(){return !!(this.inFunction||this.options.allowReturnOutsideFunction&&this.currentVarScope().flags&xe)};Y.allowSuper.get=function(){var e=this.currentThisScope(),t=e.flags;return (t&We)>0||this.options.allowSuperOutsideMethod};Y.allowDirectSuper.get=function(){return (this.currentThisScope().flags&Si)>0};Y.treatFunctionsAsVar.get=function(){return this.treatFunctionsAsVarInScope(this.currentScope())};Y.allowNewDotTarget.get=function(){for(var e=this.scopeStack.length-1;e>=0;e--){var t=this.scopeStack[e],i=t.flags;if(i&(be|Te)||i&ve&&!(i&mt))return true}return false};Y.allowUsing.get=function(){var e=this.currentScope(),t=e.flags;return !(t&Ei||!this.inModule&&t&xe)};Y.inClassStaticBlock.get=function(){return (this.currentVarScope().flags&be)>0};F.extend=function(){for(var t=[],i=arguments.length;i--;)t[i]=arguments[i];for(var r=this,s=0;s<t.length;s++)r=t[s](r);return r};F.parse=function(t,i){return new this(i,t).parse()};F.parseExpressionAt=function(t,i,r){var s=new this(r,t,i);return s.nextToken(),s.parseExpression()};F.tokenizer=function(t,i){return new this(i,t)};Object.defineProperties(F.prototype,Y);var W=F.prototype,br=/^(?:'((?:\\[^]|[^'\\])*?)'|"((?:\\[^]|[^"\\])*?)")/;W.strictDirective=function(e){if(this.options.ecmaVersion<5)return false;for(;;){B.lastIndex=e,e+=B.exec(this.input)[0].length;var t=br.exec(this.input.slice(e));if(!t)return false;if((t[1]||t[2])==="use strict"){B.lastIndex=e+t[0].length;var i=B.exec(this.input),r=i.index+i[0].length,s=this.input.charAt(r);return s===";"||s==="}"||H.test(i[0])&&!(/[(`.[+\-/*%<>=,?^&]/.test(s)||s==="!"&&this.input.charAt(r+1)==="=")}e+=t[0].length,B.lastIndex=e,e+=B.exec(this.input)[0].length,this.input[e]===";"&&e++;}};W.eat=function(e){return this.type===e?(this.next(),true):false};W.isContextual=function(e){return this.type===o.name&&this.value===e&&!this.containsEsc};W.eatContextual=function(e){return this.isContextual(e)?(this.next(),true):false};W.expectContextual=function(e){this.eatContextual(e)||this.unexpected();};W.canInsertSemicolon=function(){return this.type===o.eof||this.type===o.braceR||H.test(this.input.slice(this.lastTokEnd,this.start))};W.insertSemicolon=function(){if(this.canInsertSemicolon())return this.options.onInsertedSemicolon&&this.options.onInsertedSemicolon(this.lastTokEnd,this.lastTokEndLoc),true};W.semicolon=function(){!this.eat(o.semi)&&!this.insertSemicolon()&&this.unexpected();};W.afterTrailingComma=function(e,t){if(this.type===e)return this.options.onTrailingComma&&this.options.onTrailingComma(this.lastTokStart,this.lastTokStartLoc),t||this.next(),true};W.expect=function(e){this.eat(e)||this.unexpected();};W.unexpected=function(e){this.raise(e??this.start,"Unexpected token");};var He=function(){this.shorthandAssign=this.trailingComma=this.parenthesizedAssign=this.parenthesizedBind=this.doubleProto=-1;};W.checkPatternErrors=function(e,t){if(e){e.trailingComma>-1&&this.raiseRecoverable(e.trailingComma,"Comma is not permitted after the rest element");var i=t?e.parenthesizedAssign:e.parenthesizedBind;i>-1&&this.raiseRecoverable(i,t?"Assigning to rvalue":"Parenthesized pattern");}};W.checkExpressionErrors=function(e,t){if(!e)return false;var i=e.shorthandAssign,r=e.doubleProto;if(!t)return i>=0||r>=0;i>=0&&this.raise(i,"Shorthand property assignments are valid only in destructuring patterns"),r>=0&&this.raiseRecoverable(r,"Redefinition of __proto__ property");};W.checkYieldAwaitInDefaultParams=function(){this.yieldPos&&(!this.awaitPos||this.yieldPos<this.awaitPos)&&this.raise(this.yieldPos,"Yield expression cannot be a default value"),this.awaitPos&&this.raise(this.awaitPos,"Await expression cannot be a default value");};W.isSimpleAssignTarget=function(e){return e.type==="ParenthesizedExpression"?this.isSimpleAssignTarget(e.expression):e.type==="Identifier"||e.type==="MemberExpression"};var d=F.prototype;d.parseTopLevel=function(e){var t=Object.create(null);for(e.body||(e.body=[]);this.type!==o.eof;){var i=this.parseStatement(null,true,t);e.body.push(i);}if(this.inModule)for(var r=0,s=Object.keys(this.undefinedExports);r<s.length;r+=1){var n=s[r];this.raiseRecoverable(this.undefinedExports[n].start,"Export '"+n+"' is not defined");}return this.adaptDirectivePrologue(e.body),this.next(),e.sourceType=this.options.sourceType==="commonjs"?"script":this.options.sourceType,this.finishNode(e,"Program")};var xt={kind:"loop"},Sr={kind:"switch"};d.isLet=function(e){if(this.options.ecmaVersion<6||!this.isContextual("let"))return false;B.lastIndex=this.pos;var t=B.exec(this.input),i=this.pos+t[0].length,r=this.fullCharCodeAt(i);if(r===91||r===92)return true;if(e)return false;if(r===123)return true;if(se(r)){var s=i;do i+=r<=65535?1:2;while(fe(r=this.fullCharCodeAt(i)));if(r===92)return true;var n=this.input.slice(s,i);if(!di.test(n))return true}return false};d.isAsyncFunction=function(){if(this.options.ecmaVersion<8||!this.isContextual("async"))return false;B.lastIndex=this.pos;var e=B.exec(this.input),t=this.pos+e[0].length,i;return !H.test(this.input.slice(this.pos,t))&&this.input.slice(t,t+8)==="function"&&(t+8===this.input.length||!(fe(i=this.fullCharCodeAt(t+8))||i===92))};d.isUsingKeyword=function(e,t){if(this.options.ecmaVersion<17||!this.isContextual(e?"await":"using"))return false;B.lastIndex=this.pos;var i=B.exec(this.input),r=this.pos+i[0].length;if(H.test(this.input.slice(this.pos,r)))return false;if(e){var s=r+5,n;if(this.input.slice(r,s)!=="using"||s===this.input.length||fe(n=this.fullCharCodeAt(s))||n===92)return false;B.lastIndex=s;var a=B.exec(this.input);if(r=s+a[0].length,a&&H.test(this.input.slice(s,r)))return false}var u=this.fullCharCodeAt(r);if(!se(u)&&u!==92)return false;var c=r;do r+=u<=65535?1:2;while(fe(u=this.fullCharCodeAt(r)));if(u===92)return true;var l=this.input.slice(c,r);return !(di.test(l)||t&&l==="of")};d.isAwaitUsing=function(e){return this.isUsingKeyword(true,e)};d.isUsing=function(e){return this.isUsingKeyword(false,e)};d.parseStatement=function(e,t,i){var r=this.type,s=this.startNode(),n;switch(this.isLet(e)&&(r=o._var,n="let"),r){case o._break:case o._continue:return this.parseBreakContinueStatement(s,r.keyword);case o._debugger:return this.parseDebuggerStatement(s);case o._do:return this.parseDoStatement(s);case o._for:return this.parseForStatement(s);case o._function:return e&&(this.strict||e!=="if"&&e!=="label")&&this.options.ecmaVersion>=6&&this.unexpected(),this.parseFunctionStatement(s,false,!e);case o._class:return e&&this.unexpected(),this.parseClass(s,true);case o._if:return this.parseIfStatement(s);case o._return:return this.parseReturnStatement(s);case o._switch:return this.parseSwitchStatement(s);case o._throw:return this.parseThrowStatement(s);case o._try:return this.parseTryStatement(s);case o._const:case o._var:return n=n||this.value,e&&n!=="var"&&this.unexpected(),this.parseVarStatement(s,n);case o._while:return this.parseWhileStatement(s);case o._with:return this.parseWithStatement(s);case o.braceL:return this.parseBlock(true,s);case o.semi:return this.parseEmptyStatement(s);case o._export:case o._import:if(this.options.ecmaVersion>10&&r===o._import){B.lastIndex=this.pos;var a=B.exec(this.input),u=this.pos+a[0].length,c=this.input.charCodeAt(u);if(c===40||c===46)return this.parseExpressionStatement(s,this.parseExpression())}return this.options.allowImportExportEverywhere||(t||this.raise(this.start,"'import' and 'export' may only appear at the top level"),this.inModule||this.raise(this.start,"'import' and 'export' may appear only with 'sourceType: module'")),r===o._import?this.parseImport(s):this.parseExport(s,i);default:if(this.isAsyncFunction())return e&&this.unexpected(),this.next(),this.parseFunctionStatement(s,true,!e);var l=this.isAwaitUsing(false)?"await using":this.isUsing(false)?"using":null;if(l)return this.allowUsing||this.raise(this.start,"Using declaration cannot appear in the top level when source type is `script` or in the bare case statement"),l==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.next(),this.parseVar(s,false,l),this.semicolon(),this.finishNode(s,"VariableDeclaration");var p=this.value,y=this.parseExpression();return r===o.name&&y.type==="Identifier"&&this.eat(o.colon)?this.parseLabeledStatement(s,p,y,e):this.parseExpressionStatement(s,y)}};d.parseBreakContinueStatement=function(e,t){var i=t==="break";this.next(),this.eat(o.semi)||this.insertSemicolon()?e.label=null:this.type!==o.name?this.unexpected():(e.label=this.parseIdent(),this.semicolon());for(var r=0;r<this.labels.length;++r){var s=this.labels[r];if((e.label==null||s.name===e.label.name)&&(s.kind!=null&&(i||s.kind==="loop")||e.label&&i))break}return r===this.labels.length&&this.raise(e.start,"Unsyntactic "+t),this.finishNode(e,i?"BreakStatement":"ContinueStatement")};d.parseDebuggerStatement=function(e){return this.next(),this.semicolon(),this.finishNode(e,"DebuggerStatement")};d.parseDoStatement=function(e){return this.next(),this.labels.push(xt),e.body=this.parseStatement("do"),this.labels.pop(),this.expect(o._while),e.test=this.parseParenExpression(),this.options.ecmaVersion>=6?this.eat(o.semi):this.semicolon(),this.finishNode(e,"DoWhileStatement")};d.parseForStatement=function(e){this.next();var t=this.options.ecmaVersion>=9&&this.canAwait&&this.eatContextual("await")?this.lastTokStart:-1;if(this.labels.push(xt),this.enterScope(0),this.expect(o.parenL),this.type===o.semi)return t>-1&&this.unexpected(t),this.parseFor(e,null);var i=this.isLet();if(this.type===o._var||this.type===o._const||i){var r=this.startNode(),s=i?"let":this.value;return this.next(),this.parseVar(r,true,s),this.finishNode(r,"VariableDeclaration"),this.parseForAfterInit(e,r,t)}var n=this.isContextual("let"),a=false,u=this.isUsing(true)?"using":this.isAwaitUsing(true)?"await using":null;if(u){var c=this.startNode();return this.next(),u==="await using"&&(this.canAwait||this.raise(this.start,"Await using cannot appear outside of async function"),this.next()),this.parseVar(c,true,u),this.finishNode(c,"VariableDeclaration"),this.parseForAfterInit(e,c,t)}var l=this.containsEsc,p=new He,y=this.start,g=t>-1?this.parseExprSubscripts(p,"await"):this.parseExpression(true,p);return this.type===o._in||(a=this.options.ecmaVersion>=6&&this.isContextual("of"))?(t>-1?(this.type===o._in&&this.unexpected(t),e.await=true):a&&this.options.ecmaVersion>=8&&(g.start===y&&!l&&g.type==="Identifier"&&g.name==="async"?this.unexpected():this.options.ecmaVersion>=9&&(e.await=false)),n&&a&&this.raise(g.start,"The left-hand side of a for-of loop may not start with 'let'."),this.toAssignable(g,false,p),this.checkLValPattern(g),this.parseForIn(e,g)):(this.checkExpressionErrors(p,true),t>-1&&this.unexpected(t),this.parseFor(e,g))};d.parseForAfterInit=function(e,t,i){return (this.type===o._in||this.options.ecmaVersion>=6&&this.isContextual("of"))&&t.declarations.length===1?(this.options.ecmaVersion>=9&&(this.type===o._in?i>-1&&this.unexpected(i):e.await=i>-1),this.parseForIn(e,t)):(i>-1&&this.unexpected(i),this.parseFor(e,t))};d.parseFunctionStatement=function(e,t,i){return this.next(),this.parseFunction(e,Ce|(i?0:pt),false,t)};d.parseIfStatement=function(e){return this.next(),e.test=this.parseParenExpression(),e.consequent=this.parseStatement("if"),e.alternate=this.eat(o._else)?this.parseStatement("if"):null,this.finishNode(e,"IfStatement")};d.parseReturnStatement=function(e){return this.allowReturn||this.raise(this.start,"'return' outside of function"),this.next(),this.eat(o.semi)||this.insertSemicolon()?e.argument=null:(e.argument=this.parseExpression(),this.semicolon()),this.finishNode(e,"ReturnStatement")};d.parseSwitchStatement=function(e){this.next(),e.discriminant=this.parseParenExpression(),e.cases=[],this.expect(o.braceL),this.labels.push(Sr),this.enterScope(Ei);for(var t,i=false;this.type!==o.braceR;)if(this.type===o._case||this.type===o._default){var r=this.type===o._case;t&&this.finishNode(t,"SwitchCase"),e.cases.push(t=this.startNode()),t.consequent=[],this.next(),r?t.test=this.parseExpression():(i&&this.raiseRecoverable(this.lastTokStart,"Multiple default clauses"),i=true,t.test=null),this.expect(o.colon);}else t||this.unexpected(),t.consequent.push(this.parseStatement(null));return this.exitScope(),t&&this.finishNode(t,"SwitchCase"),this.next(),this.labels.pop(),this.finishNode(e,"SwitchStatement")};d.parseThrowStatement=function(e){return this.next(),H.test(this.input.slice(this.lastTokEnd,this.start))&&this.raise(this.lastTokEnd,"Illegal newline after throw"),e.argument=this.parseExpression(),this.semicolon(),this.finishNode(e,"ThrowStatement")};var Er=[];d.parseCatchClauseParam=function(){var e=this.parseBindingAtom(),t=e.type==="Identifier";return this.enterScope(t?bi:0),this.checkLValPattern(e,t?wi:ce),this.expect(o.parenR),e};d.parseTryStatement=function(e){if(this.next(),e.block=this.parseBlock(),e.handler=null,this.type===o._catch){var t=this.startNode();this.next(),this.eat(o.parenL)?t.param=this.parseCatchClauseParam():(this.options.ecmaVersion<10&&this.unexpected(),t.param=null,this.enterScope(0)),t.body=this.parseBlock(false),this.exitScope(),e.handler=this.finishNode(t,"CatchClause");}return e.finalizer=this.eat(o._finally)?this.parseBlock():null,!e.handler&&!e.finalizer&&this.raise(e.start,"Missing catch or finally clause"),this.finishNode(e,"TryStatement")};d.parseVarStatement=function(e,t,i){return this.next(),this.parseVar(e,false,t,i),this.semicolon(),this.finishNode(e,"VariableDeclaration")};d.parseWhileStatement=function(e){return this.next(),e.test=this.parseParenExpression(),this.labels.push(xt),e.body=this.parseStatement("while"),this.labels.pop(),this.finishNode(e,"WhileStatement")};d.parseWithStatement=function(e){return this.strict&&this.raise(this.start,"'with' in strict mode"),this.next(),e.object=this.parseParenExpression(),e.body=this.parseStatement("with"),this.finishNode(e,"WithStatement")};d.parseEmptyStatement=function(e){return this.next(),this.finishNode(e,"EmptyStatement")};d.parseLabeledStatement=function(e,t,i,r){for(var s=0,n=this.labels;s<n.length;s+=1){var a=n[s];a.name===t&&this.raise(i.start,"Label '"+t+"' is already declared");}for(var u=this.type.isLoop?"loop":this.type===o._switch?"switch":null,c=this.labels.length-1;c>=0;c--){var l=this.labels[c];if(l.statementStart===e.start)l.statementStart=this.start,l.kind=u;else break}return this.labels.push({name:t,kind:u,statementStart:this.start}),e.body=this.parseStatement(r?r.indexOf("label")===-1?r+"label":r:"label"),this.labels.pop(),e.label=i,this.finishNode(e,"LabeledStatement")};d.parseExpressionStatement=function(e,t){return e.expression=t,this.semicolon(),this.finishNode(e,"ExpressionStatement")};d.parseBlock=function(e,t,i){for(e===void 0&&(e=true),t===void 0&&(t=this.startNode()),t.body=[],this.expect(o.braceL),e&&this.enterScope(0);this.type!==o.braceR;){var r=this.parseStatement(null);t.body.push(r);}return i&&(this.strict=false),this.next(),e&&this.exitScope(),this.finishNode(t,"BlockStatement")};d.parseFor=function(e,t){return e.init=t,this.expect(o.semi),e.test=this.type===o.semi?null:this.parseExpression(),this.expect(o.semi),e.update=this.type===o.parenR?null:this.parseExpression(),this.expect(o.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,"ForStatement")};d.parseForIn=function(e,t){var i=this.type===o._in;return this.next(),t.type==="VariableDeclaration"&&t.declarations[0].init!=null&&(!i||this.options.ecmaVersion<8||this.strict||t.kind!=="var"||t.declarations[0].id.type!=="Identifier")&&this.raise(t.start,(i?"for-in":"for-of")+" loop variable declaration may not have an initializer"),e.left=t,e.right=i?this.parseExpression():this.parseMaybeAssign(),this.expect(o.parenR),e.body=this.parseStatement("for"),this.exitScope(),this.labels.pop(),this.finishNode(e,i?"ForInStatement":"ForOfStatement")};d.parseVar=function(e,t,i,r){for(e.declarations=[],e.kind=i;;){var s=this.startNode();if(this.parseVarId(s,i),this.eat(o.eq)?s.init=this.parseMaybeAssign(t):!r&&i==="const"&&!(this.type===o._in||this.options.ecmaVersion>=6&&this.isContextual("of"))?this.unexpected():!r&&(i==="using"||i==="await using")&&this.options.ecmaVersion>=17&&this.type!==o._in&&!this.isContextual("of")?this.raise(this.lastTokEnd,"Missing initializer in "+i+" declaration"):!r&&s.id.type!=="Identifier"&&!(t&&(this.type===o._in||this.isContextual("of")))?this.raise(this.lastTokEnd,"Complex binding patterns require an initialization value"):s.init=null,e.declarations.push(this.finishNode(s,"VariableDeclarator")),!this.eat(o.comma))break}return e};d.parseVarId=function(e,t){e.id=t==="using"||t==="await using"?this.parseIdent():this.parseBindingAtom(),this.checkLValPattern(e.id,t==="var"?yt:ce,false);};var Ce=1,pt=2,Ai=4;d.parseFunction=function(e,t,i,r,s){this.initFunction(e),(this.options.ecmaVersion>=9||this.options.ecmaVersion>=6&&!r)&&(this.type===o.star&&t&pt&&this.unexpected(),e.generator=this.eat(o.star)),this.options.ecmaVersion>=8&&(e.async=!!r),t&Ce&&(e.id=t&Ai&&this.type!==o.name?null:this.parseIdent(),e.id&&!(t&pt)&&this.checkLValSimple(e.id,this.strict||e.generator||e.async?this.treatFunctionsAsVar?yt:ce:_i));var n=this.yieldPos,a=this.awaitPos,u=this.awaitIdentPos;return this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(gt(e.async,e.generator)),t&Ce||(e.id=this.type===o.name?this.parseIdent():null),this.parseFunctionParams(e),this.parseFunctionBody(e,i,false,s),this.yieldPos=n,this.awaitPos=a,this.awaitIdentPos=u,this.finishNode(e,t&Ce?"FunctionDeclaration":"FunctionExpression")};d.parseFunctionParams=function(e){this.expect(o.parenL),e.params=this.parseBindingList(o.parenR,false,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams();};d.parseClass=function(e,t){this.next();var i=this.strict;this.strict=true,this.parseClassId(e,t),this.parseClassSuper(e);var r=this.enterClassBody(),s=this.startNode(),n=false;for(s.body=[],this.expect(o.braceL);this.type!==o.braceR;){var a=this.parseClassElement(e.superClass!==null);a&&(s.body.push(a),a.type==="MethodDefinition"&&a.kind==="constructor"?(n&&this.raiseRecoverable(a.start,"Duplicate constructor in the same class"),n=true):a.key&&a.key.type==="PrivateIdentifier"&&_r(r,a)&&this.raiseRecoverable(a.key.start,"Identifier '#"+a.key.name+"' has already been declared"));}return this.strict=i,this.next(),e.body=this.finishNode(s,"ClassBody"),this.exitClassBody(),this.finishNode(e,t?"ClassDeclaration":"ClassExpression")};d.parseClassElement=function(e){if(this.eat(o.semi))return null;var t=this.options.ecmaVersion,i=this.startNode(),r="",s=false,n=false,a="method",u=false;if(this.eatContextual("static")){if(t>=13&&this.eat(o.braceL))return this.parseClassStaticBlock(i),i;this.isClassElementNameStart()||this.type===o.star?u=true:r="static";}if(i.static=u,!r&&t>=8&&this.eatContextual("async")&&((this.isClassElementNameStart()||this.type===o.star)&&!this.canInsertSemicolon()?n=true:r="async"),!r&&(t>=9||!n)&&this.eat(o.star)&&(s=true),!r&&!n&&!s){var c=this.value;(this.eatContextual("get")||this.eatContextual("set"))&&(this.isClassElementNameStart()?a=c:r=c);}if(r?(i.computed=false,i.key=this.startNodeAt(this.lastTokStart,this.lastTokStartLoc),i.key.name=r,this.finishNode(i.key,"Identifier")):this.parseClassElementName(i),t<13||this.type===o.parenL||a!=="method"||s||n){var l=!i.static&&je(i,"constructor"),p=l&&e;l&&a!=="method"&&this.raise(i.key.start,"Constructor can't have get/set modifier"),i.kind=l?"constructor":a,this.parseClassMethod(i,s,n,p);}else this.parseClassField(i);return i};d.isClassElementNameStart=function(){return this.type===o.name||this.type===o.privateId||this.type===o.num||this.type===o.string||this.type===o.bracketL||this.type.keyword};d.parseClassElementName=function(e){this.type===o.privateId?(this.value==="constructor"&&this.raise(this.start,"Classes can't have an element named '#constructor'"),e.computed=false,e.key=this.parsePrivateIdent()):this.parsePropertyName(e);};d.parseClassMethod=function(e,t,i,r){var s=e.key;e.kind==="constructor"?(t&&this.raise(s.start,"Constructor can't be a generator"),i&&this.raise(s.start,"Constructor can't be an async method")):e.static&&je(e,"prototype")&&this.raise(s.start,"Classes may not have a static property named prototype");var n=e.value=this.parseMethod(t,i,r);return e.kind==="get"&&n.params.length!==0&&this.raiseRecoverable(n.start,"getter should have no params"),e.kind==="set"&&n.params.length!==1&&this.raiseRecoverable(n.start,"setter should have exactly one param"),e.kind==="set"&&n.params[0].type==="RestElement"&&this.raiseRecoverable(n.params[0].start,"Setter cannot use rest params"),this.finishNode(e,"MethodDefinition")};d.parseClassField=function(e){return je(e,"constructor")?this.raise(e.key.start,"Classes can't have a field named 'constructor'"):e.static&&je(e,"prototype")&&this.raise(e.key.start,"Classes can't have a static field named 'prototype'"),this.eat(o.eq)?(this.enterScope(Te|We),e.value=this.parseMaybeAssign(),this.exitScope()):e.value=null,this.semicolon(),this.finishNode(e,"PropertyDefinition")};d.parseClassStaticBlock=function(e){e.body=[];var t=this.labels;for(this.labels=[],this.enterScope(be|We);this.type!==o.braceR;){var i=this.parseStatement(null);e.body.push(i);}return this.next(),this.exitScope(),this.labels=t,this.finishNode(e,"StaticBlock")};d.parseClassId=function(e,t){this.type===o.name?(e.id=this.parseIdent(),t&&this.checkLValSimple(e.id,ce,false)):(t===true&&this.unexpected(),e.id=null);};d.parseClassSuper=function(e){e.superClass=this.eat(o._extends)?this.parseExprSubscripts(null,false):null;};d.enterClassBody=function(){var e={declared:Object.create(null),used:[]};return this.privateNameStack.push(e),e.declared};d.exitClassBody=function(){var e=this.privateNameStack.pop(),t=e.declared,i=e.used;if(this.options.checkPrivateFields)for(var r=this.privateNameStack.length,s=r===0?null:this.privateNameStack[r-1],n=0;n<i.length;++n){var a=i[n];we(t,a.name)||(s?s.used.push(a):this.raiseRecoverable(a.start,"Private field '#"+a.name+"' must be declared in an enclosing class"));}};function _r(e,t){var i=t.key.name,r=e[i],s="true";return t.type==="MethodDefinition"&&(t.kind==="get"||t.kind==="set")&&(s=(t.static?"s":"i")+t.kind),r==="iget"&&s==="iset"||r==="iset"&&s==="iget"||r==="sget"&&s==="sset"||r==="sset"&&s==="sget"?(e[i]="true",false):r?true:(e[i]=s,false)}function je(e,t){var i=e.computed,r=e.key;return !i&&(r.type==="Identifier"&&r.name===t||r.type==="Literal"&&r.value===t)}d.parseExportAllDeclaration=function(e,t){return this.options.ecmaVersion>=11&&(this.eatContextual("as")?(e.exported=this.parseModuleExportName(),this.checkExport(t,e.exported,this.lastTokStart)):e.exported=null),this.expectContextual("from"),this.type!==o.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ExportAllDeclaration")};d.parseExport=function(e,t){if(this.next(),this.eat(o.star))return this.parseExportAllDeclaration(e,t);if(this.eat(o._default))return this.checkExport(t,"default",this.lastTokStart),e.declaration=this.parseExportDefaultDeclaration(),this.finishNode(e,"ExportDefaultDeclaration");if(this.shouldParseExportStatement())e.declaration=this.parseExportDeclaration(e),e.declaration.type==="VariableDeclaration"?this.checkVariableExport(t,e.declaration.declarations):this.checkExport(t,e.declaration.id,e.declaration.id.start),e.specifiers=[],e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);else {if(e.declaration=null,e.specifiers=this.parseExportSpecifiers(t),this.eatContextual("from"))this.type!==o.string&&this.unexpected(),e.source=this.parseExprAtom(),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause());else {for(var i=0,r=e.specifiers;i<r.length;i+=1){var s=r[i];this.checkUnreserved(s.local),this.checkLocalExport(s.local),s.local.type==="Literal"&&this.raise(s.local.start,"A string literal cannot be used as an exported binding without `from`.");}e.source=null,this.options.ecmaVersion>=16&&(e.attributes=[]);}this.semicolon();}return this.finishNode(e,"ExportNamedDeclaration")};d.parseExportDeclaration=function(e){return this.parseStatement(null)};d.parseExportDefaultDeclaration=function(){var e;if(this.type===o._function||(e=this.isAsyncFunction())){var t=this.startNode();return this.next(),e&&this.next(),this.parseFunction(t,Ce|Ai,false,e)}else if(this.type===o._class){var i=this.startNode();return this.parseClass(i,"nullableID")}else {var r=this.parseMaybeAssign();return this.semicolon(),r}};d.checkExport=function(e,t,i){e&&(typeof t!="string"&&(t=t.type==="Identifier"?t.name:t.value),we(e,t)&&this.raiseRecoverable(i,"Duplicate export '"+t+"'"),e[t]=true);};d.checkPatternExport=function(e,t){var i=t.type;if(i==="Identifier")this.checkExport(e,t,t.start);else if(i==="ObjectPattern")for(var r=0,s=t.properties;r<s.length;r+=1){var n=s[r];this.checkPatternExport(e,n);}else if(i==="ArrayPattern")for(var a=0,u=t.elements;a<u.length;a+=1){var c=u[a];c&&this.checkPatternExport(e,c);}else i==="Property"?this.checkPatternExport(e,t.value):i==="AssignmentPattern"?this.checkPatternExport(e,t.left):i==="RestElement"&&this.checkPatternExport(e,t.argument);};d.checkVariableExport=function(e,t){if(e)for(var i=0,r=t;i<r.length;i+=1){var s=r[i];this.checkPatternExport(e,s.id);}};d.shouldParseExportStatement=function(){return this.type.keyword==="var"||this.type.keyword==="const"||this.type.keyword==="class"||this.type.keyword==="function"||this.isLet()||this.isAsyncFunction()};d.parseExportSpecifier=function(e){var t=this.startNode();return t.local=this.parseModuleExportName(),t.exported=this.eatContextual("as")?this.parseModuleExportName():t.local,this.checkExport(e,t.exported,t.exported.start),this.finishNode(t,"ExportSpecifier")};d.parseExportSpecifiers=function(e){var t=[],i=true;for(this.expect(o.braceL);!this.eat(o.braceR);){if(i)i=false;else if(this.expect(o.comma),this.afterTrailingComma(o.braceR))break;t.push(this.parseExportSpecifier(e));}return t};d.parseImport=function(e){return this.next(),this.type===o.string?(e.specifiers=Er,e.source=this.parseExprAtom()):(e.specifiers=this.parseImportSpecifiers(),this.expectContextual("from"),e.source=this.type===o.string?this.parseExprAtom():this.unexpected()),this.options.ecmaVersion>=16&&(e.attributes=this.parseWithClause()),this.semicolon(),this.finishNode(e,"ImportDeclaration")};d.parseImportSpecifier=function(){var e=this.startNode();return e.imported=this.parseModuleExportName(),this.eatContextual("as")?e.local=this.parseIdent():(this.checkUnreserved(e.imported),e.local=e.imported),this.checkLValSimple(e.local,ce),this.finishNode(e,"ImportSpecifier")};d.parseImportDefaultSpecifier=function(){var e=this.startNode();return e.local=this.parseIdent(),this.checkLValSimple(e.local,ce),this.finishNode(e,"ImportDefaultSpecifier")};d.parseImportNamespaceSpecifier=function(){var e=this.startNode();return this.next(),this.expectContextual("as"),e.local=this.parseIdent(),this.checkLValSimple(e.local,ce),this.finishNode(e,"ImportNamespaceSpecifier")};d.parseImportSpecifiers=function(){var e=[],t=true;if(this.type===o.name&&(e.push(this.parseImportDefaultSpecifier()),!this.eat(o.comma)))return e;if(this.type===o.star)return e.push(this.parseImportNamespaceSpecifier()),e;for(this.expect(o.braceL);!this.eat(o.braceR);){if(t)t=false;else if(this.expect(o.comma),this.afterTrailingComma(o.braceR))break;e.push(this.parseImportSpecifier());}return e};d.parseWithClause=function(){var e=[];if(!this.eat(o._with))return e;this.expect(o.braceL);for(var t={},i=true;!this.eat(o.braceR);){if(i)i=false;else if(this.expect(o.comma),this.afterTrailingComma(o.braceR))break;var r=this.parseImportAttribute(),s=r.key.type==="Identifier"?r.key.name:r.key.value;we(t,s)&&this.raiseRecoverable(r.key.start,"Duplicate attribute key '"+s+"'"),t[s]=true,e.push(r);}return e};d.parseImportAttribute=function(){var e=this.startNode();return e.key=this.type===o.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never"),this.expect(o.colon),this.type!==o.string&&this.unexpected(),e.value=this.parseExprAtom(),this.finishNode(e,"ImportAttribute")};d.parseModuleExportName=function(){if(this.options.ecmaVersion>=13&&this.type===o.string){var e=this.parseLiteral(this.value);return yr.test(e.value)&&this.raise(e.start,"An export name cannot include a lone surrogate."),e}return this.parseIdent(true)};d.adaptDirectivePrologue=function(e){for(var t=0;t<e.length&&this.isDirectiveCandidate(e[t]);++t)e[t].directive=e[t].expression.raw.slice(1,-1);};d.isDirectiveCandidate=function(e){return this.options.ecmaVersion>=5&&e.type==="ExpressionStatement"&&e.expression.type==="Literal"&&typeof e.expression.value=="string"&&(this.input[e.start]==='"'||this.input[e.start]==="'")};var Q=F.prototype;Q.toAssignable=function(e,t,i){if(this.options.ecmaVersion>=6&&e)switch(e.type){case "Identifier":this.inAsync&&e.name==="await"&&this.raise(e.start,"Cannot use 'await' as identifier inside an async function");break;case "ObjectPattern":case "ArrayPattern":case "AssignmentPattern":case "RestElement":break;case "ObjectExpression":e.type="ObjectPattern",i&&this.checkPatternErrors(i,true);for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];this.toAssignable(n,t),n.type==="RestElement"&&(n.argument.type==="ArrayPattern"||n.argument.type==="ObjectPattern")&&this.raise(n.argument.start,"Unexpected token");}break;case "Property":e.kind!=="init"&&this.raise(e.key.start,"Object pattern can't contain getter or setter"),this.toAssignable(e.value,t);break;case "ArrayExpression":e.type="ArrayPattern",i&&this.checkPatternErrors(i,true),this.toAssignableList(e.elements,t);break;case "SpreadElement":e.type="RestElement",this.toAssignable(e.argument,t),e.argument.type==="AssignmentPattern"&&this.raise(e.argument.start,"Rest elements cannot have a default value");break;case "AssignmentExpression":e.operator!=="="&&this.raise(e.left.end,"Only '=' operator can be used for specifying default value."),e.type="AssignmentPattern",delete e.operator,this.toAssignable(e.left,t);break;case "ParenthesizedExpression":this.toAssignable(e.expression,t,i);break;case "ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case "MemberExpression":if(!t)break;default:this.raise(e.start,"Assigning to rvalue");}else i&&this.checkPatternErrors(i,true);return e};Q.toAssignableList=function(e,t){for(var i=e.length,r=0;r<i;r++){var s=e[r];s&&this.toAssignable(s,t);}if(i){var n=e[i-1];this.options.ecmaVersion===6&&t&&n&&n.type==="RestElement"&&n.argument.type!=="Identifier"&&this.unexpected(n.argument.start);}return e};Q.parseSpread=function(e){var t=this.startNode();return this.next(),t.argument=this.parseMaybeAssign(false,e),this.finishNode(t,"SpreadElement")};Q.parseRestBinding=function(){var e=this.startNode();return this.next(),this.options.ecmaVersion===6&&this.type!==o.name&&this.unexpected(),e.argument=this.parseBindingAtom(),this.finishNode(e,"RestElement")};Q.parseBindingAtom=function(){if(this.options.ecmaVersion>=6)switch(this.type){case o.bracketL:var e=this.startNode();return this.next(),e.elements=this.parseBindingList(o.bracketR,true,true),this.finishNode(e,"ArrayPattern");case o.braceL:return this.parseObj(true)}return this.parseIdent()};Q.parseBindingList=function(e,t,i,r){for(var s=[],n=true;!this.eat(e);)if(n?n=false:this.expect(o.comma),t&&this.type===o.comma)s.push(null);else {if(i&&this.afterTrailingComma(e))break;if(this.type===o.ellipsis){var a=this.parseRestBinding();this.parseBindingListItem(a),s.push(a),this.type===o.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.expect(e);break}else s.push(this.parseAssignableListItem(r));}return s};Q.parseAssignableListItem=function(e){var t=this.parseMaybeDefault(this.start,this.startLoc);return this.parseBindingListItem(t),t};Q.parseBindingListItem=function(e){return e};Q.parseMaybeDefault=function(e,t,i){if(i=i||this.parseBindingAtom(),this.options.ecmaVersion<6||!this.eat(o.eq))return i;var r=this.startNodeAt(e,t);return r.left=i,r.right=this.parseMaybeAssign(),this.finishNode(r,"AssignmentPattern")};Q.checkLValSimple=function(e,t,i){t===void 0&&(t=Ve);var r=t!==Ve;switch(e.type){case "Identifier":this.strict&&this.reservedWordsStrictBind.test(e.name)&&this.raiseRecoverable(e.start,(r?"Binding ":"Assigning to ")+e.name+" in strict mode"),r&&(t===ce&&e.name==="let"&&this.raiseRecoverable(e.start,"let is disallowed as a lexically bound name"),i&&(we(i,e.name)&&this.raiseRecoverable(e.start,"Argument name clash"),i[e.name]=true),t!==ki&&this.declareName(e.name,t,e.start));break;case "ChainExpression":this.raiseRecoverable(e.start,"Optional chaining cannot appear in left-hand side");break;case "MemberExpression":r&&this.raiseRecoverable(e.start,"Binding member expression");break;case "ParenthesizedExpression":return r&&this.raiseRecoverable(e.start,"Binding parenthesized expression"),this.checkLValSimple(e.expression,t,i);default:this.raise(e.start,(r?"Binding":"Assigning to")+" rvalue");}};Q.checkLValPattern=function(e,t,i){switch(t===void 0&&(t=Ve),e.type){case "ObjectPattern":for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];this.checkLValInnerPattern(n,t,i);}break;case "ArrayPattern":for(var a=0,u=e.elements;a<u.length;a+=1){var c=u[a];c&&this.checkLValInnerPattern(c,t,i);}break;default:this.checkLValSimple(e,t,i);}};Q.checkLValInnerPattern=function(e,t,i){switch(t===void 0&&(t=Ve),e.type){case "Property":this.checkLValInnerPattern(e.value,t,i);break;case "AssignmentPattern":this.checkLValPattern(e.left,t,i);break;case "RestElement":this.checkLValPattern(e.argument,t,i);break;default:this.checkLValPattern(e,t,i);}};var re=function(t,i,r,s,n){this.token=t,this.isExpr=!!i,this.preserveSpace=!!r,this.override=s,this.generator=!!n;},O={b_stat:new re("{",false),b_expr:new re("{",true),b_tmpl:new re("${",false),p_stat:new re("(",false),p_expr:new re("(",true),q_tmpl:new re("`",true,true,function(e){return e.tryReadTemplateToken()}),f_stat:new re("function",false),f_expr:new re("function",true),f_expr_gen:new re("function",true,false,null,true),f_gen:new re("function",false,false,null,true)},ke=F.prototype;ke.initialContext=function(){return [O.b_stat]};ke.curContext=function(){return this.context[this.context.length-1]};ke.braceIsBlock=function(e){var t=this.curContext();return t===O.f_expr||t===O.f_stat?true:e===o.colon&&(t===O.b_stat||t===O.b_expr)?!t.isExpr:e===o._return||e===o.name&&this.exprAllowed?H.test(this.input.slice(this.lastTokEnd,this.start)):e===o._else||e===o.semi||e===o.eof||e===o.parenR||e===o.arrow?true:e===o.braceL?t===O.b_stat:e===o._var||e===o._const||e===o.name?false:!this.exprAllowed};ke.inGeneratorContext=function(){for(var e=this.context.length-1;e>=1;e--){var t=this.context[e];if(t.token==="function")return t.generator}return false};ke.updateContext=function(e){var t,i=this.type;i.keyword&&e===o.dot?this.exprAllowed=false:(t=i.updateContext)?t.call(this,e):this.exprAllowed=i.beforeExpr;};ke.overrideContext=function(e){this.curContext()!==e&&(this.context[this.context.length-1]=e);};o.parenR.updateContext=o.braceR.updateContext=function(){if(this.context.length===1){this.exprAllowed=true;return}var e=this.context.pop();e===O.b_stat&&this.curContext().token==="function"&&(e=this.context.pop()),this.exprAllowed=!e.isExpr;};o.braceL.updateContext=function(e){this.context.push(this.braceIsBlock(e)?O.b_stat:O.b_expr),this.exprAllowed=true;};o.dollarBraceL.updateContext=function(){this.context.push(O.b_tmpl),this.exprAllowed=true;};o.parenL.updateContext=function(e){var t=e===o._if||e===o._for||e===o._with||e===o._while;this.context.push(t?O.p_stat:O.p_expr),this.exprAllowed=true;};o.incDec.updateContext=function(){};o._function.updateContext=o._class.updateContext=function(e){e.beforeExpr&&e!==o._else&&!(e===o.semi&&this.curContext()!==O.p_stat)&&!(e===o._return&&H.test(this.input.slice(this.lastTokEnd,this.start)))&&!((e===o.colon||e===o.braceL)&&this.curContext()===O.b_stat)?this.context.push(O.f_expr):this.context.push(O.f_stat),this.exprAllowed=false;};o.colon.updateContext=function(){this.curContext().token==="function"&&this.context.pop(),this.exprAllowed=true;};o.backQuote.updateContext=function(){this.curContext()===O.q_tmpl?this.context.pop():this.context.push(O.q_tmpl),this.exprAllowed=false;};o.star.updateContext=function(e){if(e===o._function){var t=this.context.length-1;this.context[t]===O.f_expr?this.context[t]=O.f_expr_gen:this.context[t]=O.f_gen;}this.exprAllowed=true;};o.name.updateContext=function(e){var t=false;this.options.ecmaVersion>=6&&e!==o.dot&&(this.value==="of"&&!this.exprAllowed||this.value==="yield"&&this.inGeneratorContext())&&(t=true),this.exprAllowed=t;};var _=F.prototype;_.checkPropClash=function(e,t,i){if(!(this.options.ecmaVersion>=9&&e.type==="SpreadElement")&&!(this.options.ecmaVersion>=6&&(e.computed||e.method||e.shorthand))){var r=e.key,s;switch(r.type){case "Identifier":s=r.name;break;case "Literal":s=String(r.value);break;default:return}var n=e.kind;if(this.options.ecmaVersion>=6){s==="__proto__"&&n==="init"&&(t.proto&&(i?i.doubleProto<0&&(i.doubleProto=r.start):this.raiseRecoverable(r.start,"Redefinition of __proto__ property")),t.proto=true);return}s="$"+s;var a=t[s];if(a){var u;n==="init"?u=this.strict&&a.init||a.get||a.set:u=a.init||a[n],u&&this.raiseRecoverable(r.start,"Redefinition of property");}else a=t[s]={init:false,get:false,set:false};a[n]=true;}};_.parseExpression=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeAssign(e,t);if(this.type===o.comma){var n=this.startNodeAt(i,r);for(n.expressions=[s];this.eat(o.comma);)n.expressions.push(this.parseMaybeAssign(e,t));return this.finishNode(n,"SequenceExpression")}return s};_.parseMaybeAssign=function(e,t,i){if(this.isContextual("yield")){if(this.inGenerator)return this.parseYield(e);this.exprAllowed=false;}var r=false,s=-1,n=-1,a=-1;t?(s=t.parenthesizedAssign,n=t.trailingComma,a=t.doubleProto,t.parenthesizedAssign=t.trailingComma=-1):(t=new He,r=true);var u=this.start,c=this.startLoc;(this.type===o.parenL||this.type===o.name)&&(this.potentialArrowAt=this.start,this.potentialArrowInForAwait=e==="await");var l=this.parseMaybeConditional(e,t);if(i&&(l=i.call(this,l,u,c)),this.type.isAssign){var p=this.startNodeAt(u,c);return p.operator=this.value,this.type===o.eq&&(l=this.toAssignable(l,false,t)),r||(t.parenthesizedAssign=t.trailingComma=t.doubleProto=-1),t.shorthandAssign>=l.start&&(t.shorthandAssign=-1),this.type===o.eq?this.checkLValPattern(l):this.checkLValSimple(l),p.left=l,this.next(),p.right=this.parseMaybeAssign(e),a>-1&&(t.doubleProto=a),this.finishNode(p,"AssignmentExpression")}else r&&this.checkExpressionErrors(t,true);return s>-1&&(t.parenthesizedAssign=s),n>-1&&(t.trailingComma=n),l};_.parseMaybeConditional=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprOps(e,t);if(this.checkExpressionErrors(t))return s;if(this.eat(o.question)){var n=this.startNodeAt(i,r);return n.test=s,n.consequent=this.parseMaybeAssign(),this.expect(o.colon),n.alternate=this.parseMaybeAssign(e),this.finishNode(n,"ConditionalExpression")}return s};_.parseExprOps=function(e,t){var i=this.start,r=this.startLoc,s=this.parseMaybeUnary(t,false,false,e);return this.checkExpressionErrors(t)||s.start===i&&s.type==="ArrowFunctionExpression"?s:this.parseExprOp(s,i,r,-1,e)};_.parseExprOp=function(e,t,i,r,s){var n=this.type.binop;if(n!=null&&(!s||this.type!==o._in)&&n>r){var a=this.type===o.logicalOR||this.type===o.logicalAND,u=this.type===o.coalesce;u&&(n=o.logicalAND.binop);var c=this.value;this.next();var l=this.start,p=this.startLoc,y=this.parseExprOp(this.parseMaybeUnary(null,false,false,s),l,p,n,s),g=this.buildBinary(t,i,e,y,c,a||u);return (a&&this.type===o.coalesce||u&&(this.type===o.logicalOR||this.type===o.logicalAND))&&this.raiseRecoverable(this.start,"Logical expressions and coalesce expressions cannot be mixed. Wrap either by parentheses"),this.parseExprOp(g,t,i,r,s)}return e};_.buildBinary=function(e,t,i,r,s,n){r.type==="PrivateIdentifier"&&this.raise(r.start,"Private identifier can only be left side of binary expression");var a=this.startNodeAt(e,t);return a.left=i,a.operator=s,a.right=r,this.finishNode(a,n?"LogicalExpression":"BinaryExpression")};_.parseMaybeUnary=function(e,t,i,r){var s=this.start,n=this.startLoc,a;if(this.isContextual("await")&&this.canAwait)a=this.parseAwait(r),t=true;else if(this.type.prefix){var u=this.startNode(),c=this.type===o.incDec;u.operator=this.value,u.prefix=true,this.next(),u.argument=this.parseMaybeUnary(null,true,c,r),this.checkExpressionErrors(e,true),c?this.checkLValSimple(u.argument):this.strict&&u.operator==="delete"&&Pi(u.argument)?this.raiseRecoverable(u.start,"Deleting local variable in strict mode"):u.operator==="delete"&&ht(u.argument)?this.raiseRecoverable(u.start,"Private fields can not be deleted"):t=true,a=this.finishNode(u,c?"UpdateExpression":"UnaryExpression");}else if(!t&&this.type===o.privateId)(r||this.privateNameStack.length===0)&&this.options.checkPrivateFields&&this.unexpected(),a=this.parsePrivateIdent(),this.type!==o._in&&this.unexpected();else {if(a=this.parseExprSubscripts(e,r),this.checkExpressionErrors(e))return a;for(;this.type.postfix&&!this.canInsertSemicolon();){var l=this.startNodeAt(s,n);l.operator=this.value,l.prefix=false,l.argument=a,this.checkLValSimple(a),this.next(),a=this.finishNode(l,"UpdateExpression");}}if(!i&&this.eat(o.starstar))if(t)this.unexpected(this.lastTokStart);else return this.buildBinary(s,n,a,this.parseMaybeUnary(null,false,false,r),"**",false);else return a};function Pi(e){return e.type==="Identifier"||e.type==="ParenthesizedExpression"&&Pi(e.expression)}function ht(e){return e.type==="MemberExpression"&&e.property.type==="PrivateIdentifier"||e.type==="ChainExpression"&&ht(e.expression)||e.type==="ParenthesizedExpression"&&ht(e.expression)}_.parseExprSubscripts=function(e,t){var i=this.start,r=this.startLoc,s=this.parseExprAtom(e,t);if(s.type==="ArrowFunctionExpression"&&this.input.slice(this.lastTokStart,this.lastTokEnd)!==")")return s;var n=this.parseSubscripts(s,i,r,false,t);return e&&n.type==="MemberExpression"&&(e.parenthesizedAssign>=n.start&&(e.parenthesizedAssign=-1),e.parenthesizedBind>=n.start&&(e.parenthesizedBind=-1),e.trailingComma>=n.start&&(e.trailingComma=-1)),n};_.parseSubscripts=function(e,t,i,r,s){for(var n=this.options.ecmaVersion>=8&&e.type==="Identifier"&&e.name==="async"&&this.lastTokEnd===e.end&&!this.canInsertSemicolon()&&e.end-e.start===5&&this.potentialArrowAt===e.start,a=false;;){var u=this.parseSubscript(e,t,i,r,n,a,s);if(u.optional&&(a=true),u===e||u.type==="ArrowFunctionExpression"){if(a){var c=this.startNodeAt(t,i);c.expression=u,u=this.finishNode(c,"ChainExpression");}return u}e=u;}};_.shouldParseAsyncArrow=function(){return !this.canInsertSemicolon()&&this.eat(o.arrow)};_.parseSubscriptAsyncArrow=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,true,r)};_.parseSubscript=function(e,t,i,r,s,n,a){var u=this.options.ecmaVersion>=11,c=u&&this.eat(o.questionDot);r&&c&&this.raise(this.lastTokStart,"Optional chaining cannot appear in the callee of new expressions");var l=this.eat(o.bracketL);if(l||c&&this.type!==o.parenL&&this.type!==o.backQuote||this.eat(o.dot)){var p=this.startNodeAt(t,i);p.object=e,l?(p.property=this.parseExpression(),this.expect(o.bracketR)):this.type===o.privateId&&e.type!=="Super"?p.property=this.parsePrivateIdent():p.property=this.parseIdent(this.options.allowReserved!=="never"),p.computed=!!l,u&&(p.optional=c),e=this.finishNode(p,"MemberExpression");}else if(!r&&this.eat(o.parenL)){var y=new He,g=this.yieldPos,k=this.awaitPos,m=this.awaitIdentPos;this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0;var S=this.parseExprList(o.parenR,this.options.ecmaVersion>=8,false,y);if(s&&!c&&this.shouldParseAsyncArrow())return this.checkPatternErrors(y,false),this.checkYieldAwaitInDefaultParams(),this.awaitIdentPos>0&&this.raise(this.awaitIdentPos,"Cannot use 'await' as identifier inside an async function"),this.yieldPos=g,this.awaitPos=k,this.awaitIdentPos=m,this.parseSubscriptAsyncArrow(t,i,S,a);this.checkExpressionErrors(y,true),this.yieldPos=g||this.yieldPos,this.awaitPos=k||this.awaitPos,this.awaitIdentPos=m||this.awaitIdentPos;var x=this.startNodeAt(t,i);x.callee=e,x.arguments=S,u&&(x.optional=c),e=this.finishNode(x,"CallExpression");}else if(this.type===o.backQuote){(c||n)&&this.raise(this.start,"Optional chaining cannot appear in the tag of tagged template expressions");var T=this.startNodeAt(t,i);T.tag=e,T.quasi=this.parseTemplate({isTagged:true}),e=this.finishNode(T,"TaggedTemplateExpression");}return e};_.parseExprAtom=function(e,t,i){this.type===o.slash&&this.readRegexp();var r,s=this.potentialArrowAt===this.start;switch(this.type){case o._super:return this.allowSuper||this.raise(this.start,"'super' keyword outside a method"),r=this.startNode(),this.next(),this.type===o.parenL&&!this.allowDirectSuper&&this.raise(r.start,"super() call outside constructor of a subclass"),this.type!==o.dot&&this.type!==o.bracketL&&this.type!==o.parenL&&this.unexpected(),this.finishNode(r,"Super");case o._this:return r=this.startNode(),this.next(),this.finishNode(r,"ThisExpression");case o.name:var n=this.start,a=this.startLoc,u=this.containsEsc,c=this.parseIdent(false);if(this.options.ecmaVersion>=8&&!u&&c.name==="async"&&!this.canInsertSemicolon()&&this.eat(o._function))return this.overrideContext(O.f_expr),this.parseFunction(this.startNodeAt(n,a),0,false,true,t);if(s&&!this.canInsertSemicolon()){if(this.eat(o.arrow))return this.parseArrowExpression(this.startNodeAt(n,a),[c],false,t);if(this.options.ecmaVersion>=8&&c.name==="async"&&this.type===o.name&&!u&&(!this.potentialArrowInForAwait||this.value!=="of"||this.containsEsc))return c=this.parseIdent(false),(this.canInsertSemicolon()||!this.eat(o.arrow))&&this.unexpected(),this.parseArrowExpression(this.startNodeAt(n,a),[c],true,t)}return c;case o.regexp:var l=this.value;return r=this.parseLiteral(l.value),r.regex={pattern:l.pattern,flags:l.flags},r;case o.num:case o.string:return this.parseLiteral(this.value);case o._null:case o._true:case o._false:return r=this.startNode(),r.value=this.type===o._null?null:this.type===o._true,r.raw=this.type.keyword,this.next(),this.finishNode(r,"Literal");case o.parenL:var p=this.start,y=this.parseParenAndDistinguishExpression(s,t);return e&&(e.parenthesizedAssign<0&&!this.isSimpleAssignTarget(y)&&(e.parenthesizedAssign=p),e.parenthesizedBind<0&&(e.parenthesizedBind=p)),y;case o.bracketL:return r=this.startNode(),this.next(),r.elements=this.parseExprList(o.bracketR,true,true,e),this.finishNode(r,"ArrayExpression");case o.braceL:return this.overrideContext(O.b_expr),this.parseObj(false,e);case o._function:return r=this.startNode(),this.next(),this.parseFunction(r,0);case o._class:return this.parseClass(this.startNode(),false);case o._new:return this.parseNew();case o.backQuote:return this.parseTemplate();case o._import:return this.options.ecmaVersion>=11?this.parseExprImport(i):this.unexpected();default:return this.parseExprAtomDefault()}};_.parseExprAtomDefault=function(){this.unexpected();};_.parseExprImport=function(e){var t=this.startNode();if(this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword import"),this.next(),this.type===o.parenL&&!e)return this.parseDynamicImport(t);if(this.type===o.dot){var i=this.startNodeAt(t.start,t.loc&&t.loc.start);return i.name="import",t.meta=this.finishNode(i,"Identifier"),this.parseImportMeta(t)}else this.unexpected();};_.parseDynamicImport=function(e){if(this.next(),e.source=this.parseMaybeAssign(),this.options.ecmaVersion>=16)this.eat(o.parenR)?e.options=null:(this.expect(o.comma),this.afterTrailingComma(o.parenR)?e.options=null:(e.options=this.parseMaybeAssign(),this.eat(o.parenR)||(this.expect(o.comma),this.afterTrailingComma(o.parenR)||this.unexpected())));else if(!this.eat(o.parenR)){var t=this.start;this.eat(o.comma)&&this.eat(o.parenR)?this.raiseRecoverable(t,"Trailing comma is not allowed in import()"):this.unexpected(t);}return this.finishNode(e,"ImportExpression")};_.parseImportMeta=function(e){this.next();var t=this.containsEsc;return e.property=this.parseIdent(true),e.property.name!=="meta"&&this.raiseRecoverable(e.property.start,"The only valid meta property for import is 'import.meta'"),t&&this.raiseRecoverable(e.start,"'import.meta' must not contain escaped characters"),this.options.sourceType!=="module"&&!this.options.allowImportExportEverywhere&&this.raiseRecoverable(e.start,"Cannot use 'import.meta' outside a module"),this.finishNode(e,"MetaProperty")};_.parseLiteral=function(e){var t=this.startNode();return t.value=e,t.raw=this.input.slice(this.start,this.end),t.raw.charCodeAt(t.raw.length-1)===110&&(t.bigint=t.value!=null?t.value.toString():t.raw.slice(0,-1).replace(/_/g,"")),this.next(),this.finishNode(t,"Literal")};_.parseParenExpression=function(){this.expect(o.parenL);var e=this.parseExpression();return this.expect(o.parenR),e};_.shouldParseArrow=function(e){return !this.canInsertSemicolon()};_.parseParenAndDistinguishExpression=function(e,t){var i=this.start,r=this.startLoc,s,n=this.options.ecmaVersion>=8;if(this.options.ecmaVersion>=6){this.next();var a=this.start,u=this.startLoc,c=[],l=true,p=false,y=new He,g=this.yieldPos,k=this.awaitPos,m;for(this.yieldPos=0,this.awaitPos=0;this.type!==o.parenR;)if(l?l=false:this.expect(o.comma),n&&this.afterTrailingComma(o.parenR,true)){p=true;break}else if(this.type===o.ellipsis){m=this.start,c.push(this.parseParenItem(this.parseRestBinding())),this.type===o.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element");break}else c.push(this.parseMaybeAssign(false,y,this.parseParenItem));var S=this.lastTokEnd,x=this.lastTokEndLoc;if(this.expect(o.parenR),e&&this.shouldParseArrow(c)&&this.eat(o.arrow))return this.checkPatternErrors(y,false),this.checkYieldAwaitInDefaultParams(),this.yieldPos=g,this.awaitPos=k,this.parseParenArrowList(i,r,c,t);(!c.length||p)&&this.unexpected(this.lastTokStart),m&&this.unexpected(m),this.checkExpressionErrors(y,true),this.yieldPos=g||this.yieldPos,this.awaitPos=k||this.awaitPos,c.length>1?(s=this.startNodeAt(a,u),s.expressions=c,this.finishNodeAt(s,"SequenceExpression",S,x)):s=c[0];}else s=this.parseParenExpression();if(this.options.preserveParens){var T=this.startNodeAt(i,r);return T.expression=s,this.finishNode(T,"ParenthesizedExpression")}else return s};_.parseParenItem=function(e){return e};_.parseParenArrowList=function(e,t,i,r){return this.parseArrowExpression(this.startNodeAt(e,t),i,false,r)};var wr=[];_.parseNew=function(){this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword new");var e=this.startNode();if(this.next(),this.options.ecmaVersion>=6&&this.type===o.dot){var t=this.startNodeAt(e.start,e.loc&&e.loc.start);t.name="new",e.meta=this.finishNode(t,"Identifier"),this.next();var i=this.containsEsc;return e.property=this.parseIdent(true),e.property.name!=="target"&&this.raiseRecoverable(e.property.start,"The only valid meta property for new is 'new.target'"),i&&this.raiseRecoverable(e.start,"'new.target' must not contain escaped characters"),this.allowNewDotTarget||this.raiseRecoverable(e.start,"'new.target' can only be used in functions and class static block"),this.finishNode(e,"MetaProperty")}var r=this.start,s=this.startLoc;return e.callee=this.parseSubscripts(this.parseExprAtom(null,false,true),r,s,true,false),this.eat(o.parenL)?e.arguments=this.parseExprList(o.parenR,this.options.ecmaVersion>=8,false):e.arguments=wr,this.finishNode(e,"NewExpression")};_.parseTemplateElement=function(e){var t=e.isTagged,i=this.startNode();return this.type===o.invalidTemplate?(t||this.raiseRecoverable(this.start,"Bad escape sequence in untagged template literal"),i.value={raw:this.value.replace(/\r\n?/g,`
8
8
  `),cooked:null}):i.value={raw:this.input.slice(this.start,this.end).replace(/\r\n?/g,`
9
- `),cooked:this.value},this.next(),i.tail=this.type===o.backQuote,this.finishNode(i,"TemplateElement")};S.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=false);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(i.quasis=[r];!r.tail;)this.type===o.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(o.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(o.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};S.isAsyncProp=function(e){return !e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===o.name||this.type===o.num||this.type===o.string||this.type===o.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===o.star)&&!$.test(this.input.slice(this.lastTokEnd,this.start))};S.parseObj=function(e,t){var i=this.startNode(),r=true,s={};for(i.properties=[],this.next();!this.eat(o.braceR);){if(r)r=false;else if(this.expect(o.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(o.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,s,t),i.properties.push(n);}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};S.parseProperty=function(e,t){var i=this.startNode(),r,s,n,a;if(this.options.ecmaVersion>=9&&this.eat(o.ellipsis))return e?(i.argument=this.parseIdent(false),this.type===o.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(false,t),this.type===o.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=false,i.shorthand=false,(e||t)&&(n=this.start,a=this.startLoc),e||(r=this.eat(o.star)));var u=this.containsEsc;return this.parsePropertyName(i),!e&&!u&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(i)?(s=true,r=this.options.ecmaVersion>=9&&this.eat(o.star),this.parsePropertyName(i)):s=false,this.parsePropertyValue(i,e,r,s,n,a,t,u),this.finishNode(i,"Property")};S.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(false),e.kind=t;var i=e.kind==="get"?0:1;if(e.value.params.length!==i){var r=e.value.start;e.kind==="get"?this.raiseRecoverable(r,"getter should have no params"):this.raiseRecoverable(r,"setter should have exactly one param");}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params");};S.parsePropertyValue=function(e,t,i,r,s,n,a,u){(i||r)&&this.type===o.colon&&this.unexpected(),this.eat(o.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(false,a),e.kind="init"):this.options.ecmaVersion>=6&&this.type===o.parenL?(t&&this.unexpected(),e.method=true,e.value=this.parseMethod(i,r),e.kind="init"):!t&&!u&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==o.comma&&this.type!==o.braceR&&this.type!==o.eq?((i||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=s),t?e.value=this.parseMaybeDefault(s,n,this.copyNode(e.key)):this.type===o.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(s,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=true):this.unexpected();};S.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(o.bracketL))return e.computed=true,e.key=this.parseMaybeAssign(),this.expect(o.bracketR),e.key;e.computed=false;}return e.key=this.type===o.num||this.type===o.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};S.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=false),this.options.ecmaVersion>=8&&(e.async=false);};S.parseMethod=function(e,t,i){var r=this.startNode(),s=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(gt(t,r.generator)|We|(i?Si:0)),this.expect(o.parenL),r.params=this.parseBindingList(o.parenR,false,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,false,true,false),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(r,"FunctionExpression")};S.parseArrowExpression=function(e,t,i,r){var s=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(gt(i,false)|mt),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,true),this.parseFunctionBody(e,true,false,r),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")};S.parseFunctionBody=function(e,t,i,r){var s=t&&this.type!==o.braceL,n=this.strict,a=false;if(s)e.body=this.parseMaybeAssign(r),e.expression=true,this.checkParams(e,false);else {var u=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!n||u)&&(a=this.strictDirective(this.end),a&&u&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var c=this.labels;this.labels=[],a&&(this.strict=true),this.checkParams(e,!n&&!a&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,ki),e.body=this.parseBlock(false,void 0,a&&!n),e.expression=false,this.adaptDirectivePrologue(e.body.body),this.labels=c;}this.exitScope();};S.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(r.type!=="Identifier")return false}return true};S.checkParams=function(e,t){for(var i=Object.create(null),r=0,s=e.params;r<s.length;r+=1){var n=s[r];this.checkLValInnerPattern(n,xt,t?null:i);}};S.parseExprList=function(e,t,i,r){for(var s=[],n=true;!this.eat(e);){if(n)n=false;else if(this.expect(o.comma),t&&this.afterTrailingComma(e))break;var a=void 0;i&&this.type===o.comma?a=null:this.type===o.ellipsis?(a=this.parseSpread(r),r&&this.type===o.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):a=this.parseMaybeAssign(false,r),s.push(a);}return s};S.checkUnreserved=function(e){var t=e.start,i=e.end,r=e.name;if(this.inGenerator&&r==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&$e)&&r==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(r==="arguments"||r==="await")&&this.raise(t,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(t,"Unexpected keyword '"+r+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var s=this.strict?this.reservedWordsStrict:this.reservedWords;s.test(r)&&(!this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+r+"' is reserved"));}};S.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};S.parseIdentNode=function(){var e=this.startNode();return this.type===o.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=o.name):this.unexpected(),e};S.parsePrivateIdent=function(){var e=this.startNode();return this.type===o.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e};S.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===o.semi||this.canInsertSemicolon()||this.type!==o.star&&!this.type.startsExpr?(t.delegate=false,t.argument=null):(t.delegate=this.eat(o.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};S.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,true,false,e),this.finishNode(t,"AwaitExpression")};var Be=O.prototype;Be.raise=function(e,t){var i=yi(this.input,e);t+=" ("+i.line+":"+i.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var r=new SyntaxError(t);throw r.pos=e,r.loc=i,r.raisedAt=this.pos,r};Be.raiseRecoverable=Be.raise;Be.curPosition=function(){if(this.options.locations)return new Ie(this.curLine,this.pos-this.lineStart)};var fe=O.prototype,kr=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[];};fe.enterScope=function(e){this.scopeStack.push(new kr(e));};fe.exitScope=function(){this.scopeStack.pop();};fe.treatFunctionsAsVarInScope=function(e){return e.flags&ye||!this.inModule&&e.flags&xe};fe.declareName=function(e,t,i){var r=false;if(t===ce){var s=this.currentScope();r=s.lexical.indexOf(e)>-1||s.functions.indexOf(e)>-1||s.var.indexOf(e)>-1,s.lexical.push(e),this.inModule&&s.flags&xe&&delete this.undefinedExports[e];}else if(t===wi){var n=this.currentScope();n.lexical.push(e);}else if(t===Ei){var a=this.currentScope();this.treatFunctionsAsVar?r=a.lexical.indexOf(e)>-1:r=a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e);}else for(var u=this.scopeStack.length-1;u>=0;--u){var c=this.scopeStack[u];if(c.lexical.indexOf(e)>-1&&!(c.flags&bi&&c.lexical[0]===e)||!this.treatFunctionsAsVarInScope(c)&&c.functions.indexOf(e)>-1){r=true;break}if(c.var.push(e),this.inModule&&c.flags&xe&&delete this.undefinedExports[e],c.flags&$e)break}r&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared");};fe.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e);};fe.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};fe.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&($e|Te|ve))return t}};fe.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&($e|Te|ve)&&!(t.flags&mt))return t}};var Ze=function(t,i,r){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new ze(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0]);},Ne=O.prototype;Ne.startNode=function(){return new Ze(this,this.start,this.startLoc)};Ne.startNodeAt=function(e,t){return new Ze(this,e,t)};function Ci(e,t,i,r){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=i),e}Ne.finishNode=function(e,t){return Ci.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};Ne.finishNodeAt=function(e,t,i,r){return Ci.call(this,e,t,i,r)};Ne.copyNode=function(e){var t=new Ze(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var Ar="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",Ii="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Ti=Ii+" Extended_Pictographic",Ni=Ti,Ri=Ni+" EBase EComp EMod EPres ExtPict",Li=Ri,Pr=Li,Cr={9:Ii,10:Ti,11:Ni,12:Ri,13:Li,14:Pr},Ir="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Tr={9:"",10:"",11:"",12:"",13:"",14:Ir},li="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Oi="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Di=Oi+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Mi=Di+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Fi=Mi+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Vi=Fi+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Nr=Vi+" "+Ar,Rr={9:Oi,10:Di,11:Mi,12:Fi,13:Vi,14:Nr},ji={};function Lr(e){var t=ji[e]={binary:pe(Cr[e]+" "+li),binaryOfStrings:pe(Tr[e]),nonBinary:{General_Category:pe(li),Script:pe(Rr[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions;}for(Fe=0,ut=[9,10,11,12,13,14];Fe<ut.length;Fe+=1)pi=ut[Fe],Lr(pi);var pi,Fe,ut,f=O.prototype,Ue=function(t,i){this.parent=t,this.base=i||this;};Ue.prototype.separatedFrom=function(t){for(var i=this;i;i=i.parent)for(var r=t;r;r=r.parent)if(i.base===r.base&&i!==r)return true;return false};Ue.prototype.sibling=function(){return new Ue(this.parent,this.base)};var ne=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=ji[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=false,this.switchV=false,this.switchN=false,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=false,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null;};ne.prototype.reset=function(t,i,r){var s=r.indexOf("v")!==-1,n=r.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=r,s&&this.parser.options.ecmaVersion>=15?(this.switchU=true,this.switchV=true,this.switchN=true):(this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchV=false,this.switchN=n&&this.parser.options.ecmaVersion>=9);};ne.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t);};ne.prototype.at=function(t,i){i===void 0&&(i=false);var r=this.source,s=r.length;if(t>=s)return -1;var n=r.charCodeAt(t);if(!(i||this.switchU)||n<=55295||n>=57344||t+1>=s)return n;var a=r.charCodeAt(t+1);return a>=56320&&a<=57343?(n<<10)+a-56613888:n};ne.prototype.nextIndex=function(t,i){i===void 0&&(i=false);var r=this.source,s=r.length;if(t>=s)return s;var n=r.charCodeAt(t),a;return !(i||this.switchU)||n<=55295||n>=57344||t+1>=s||(a=r.charCodeAt(t+1))<56320||a>57343?t+1:t+2};ne.prototype.current=function(t){return t===void 0&&(t=false),this.at(this.pos,t)};ne.prototype.lookahead=function(t){return t===void 0&&(t=false),this.at(this.nextIndex(this.pos,t),t)};ne.prototype.advance=function(t){t===void 0&&(t=false),this.pos=this.nextIndex(this.pos,t);};ne.prototype.eat=function(t,i){return i===void 0&&(i=false),this.current(i)===t?(this.advance(i),true):false};ne.prototype.eatChars=function(t,i){i===void 0&&(i=false);for(var r=this.pos,s=0,n=t;s<n.length;s+=1){var a=n[s],u=this.at(r,i);if(u===-1||u!==a)return false;r=this.nextIndex(r,i);}return this.pos=r,true};f.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,r=false,s=false,n=0;n<i.length;n++){var a=i.charAt(n);t.indexOf(a)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(a,n+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),a==="u"&&(r=true),a==="v"&&(s=true);}this.options.ecmaVersion>=15&&r&&s&&this.raise(e.start,"Invalid regular expression flag");};function Or(e){for(var t in e)return true;return false}f.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&Or(e.groupNames)&&(e.switchN=true,this.regexp_pattern(e));};f.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=false,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var r=i[t];e.groupNames[r]||e.raise("Invalid named capture referenced");}};f.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Ue(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,true)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets");};f.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};f.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),true):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),true):false};f.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=false,e.eat(94)||e.eat(36))return true;if(e.eat(92)){if(e.eat(66)||e.eat(98))return true;e.pos=t;}if(e.eat(40)&&e.eat(63)){var i=false;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,true}return e.pos=t,false};f.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=false),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),true):false};f.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};f.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var r=0,s=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue),e.eat(125)))return s!==-1&&s<r&&!t&&e.raise("numbers out of order in {} quantifier"),true;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i;}return false};f.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};f.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return true;e.pos=t;}return false};f.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),r=e.eat(45);if(i||r){for(var s=0;s<i.length;s++){var n=i.charAt(s);i.indexOf(n,s+1)>-1&&e.raise("Duplicate regular expression modifiers");}if(r){var a=this.regexp_eatModifiers(e);!i&&!a&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var u=0;u<a.length;u++){var c=a.charAt(u);(a.indexOf(c,u+1)>-1||i.indexOf(c)>-1)&&e.raise("Duplicate regular expression modifiers");}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return true;e.raise("Unterminated group");}}e.pos=t;}return false};f.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,true;e.raise("Unterminated group");}return false};f.regexp_eatModifiers=function(e){for(var t="",i=0;(i=e.current())!==-1&&Dr(i);)t+=oe(i),e.advance();return t};function Dr(e){return e===105||e===109||e===115}f.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};f.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,true)&&e.raise("Nothing to repeat"),false};f.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Bi(t)?(e.lastIntValue=t,e.advance(),true):false};function Bi(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}f.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!Bi(i);)e.advance();return e.pos!==t};f.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),true):false};f.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var r=0,s=i;r<s.length;r+=1){var n=s[r];n.separatedFrom(e.branchID)||e.raise("Duplicate capture group name");}else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=true;}};f.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return true;e.raise("Invalid capture group name");}return false};f.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=oe(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=oe(e.lastIntValue);return true}return false};f.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Mr(r)?(e.lastIntValue=r,true):(e.pos=t,false)};function Mr(e){return se(e,true)||e===36||e===95}f.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Fr(r)?(e.lastIntValue=r,true):(e.pos=t,false)};function Fr(e){return he(e,true)||e===36||e===95||e===8204||e===8205}f.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?true:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),false)};f.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),true;if(i<=e.numCapturingParens)return true;e.pos=t;}return false};f.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),true;e.raise("Invalid named reference");}return false};f.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,false)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};f.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return true;e.pos=t;}return false};f.regexp_eatZero=function(e){return e.current()===48&&!Ke(e.lookahead())?(e.lastIntValue=0,e.advance(),true):false};f.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),true):t===110?(e.lastIntValue=10,e.advance(),true):t===118?(e.lastIntValue=11,e.advance(),true):t===102?(e.lastIntValue=12,e.advance(),true):t===114?(e.lastIntValue=13,e.advance(),true):false};f.regexp_eatControlLetter=function(e){var t=e.current();return Ui(t)?(e.lastIntValue=t%32,e.advance(),true):false};function Ui(e){return e>=65&&e<=90||e>=97&&e<=122}f.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=false);var i=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(r&&s>=55296&&s<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=(s-55296)*1024+(a-56320)+65536,true}e.pos=n,e.lastIntValue=s;}return true}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Vr(e.lastIntValue))return true;r&&e.raise("Invalid unicode escape"),e.pos=i;}return false};function Vr(e){return e>=0&&e<=1114111}f.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?true:e.eat(47)?(e.lastIntValue=47,true):false;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),true):false};f.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return true}return false};var zi=0,ue=1,J=2;f.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(jr(t))return e.lastIntValue=-1,e.advance(),ue;var i=false;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&r===J&&e.raise("Invalid property name"),r;e.raise("Invalid property name");}return zi};function jr(e){return e===100||e===68||e===115||e===83||e===119||e===87}f.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,r),ue}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,s)}return zi};f.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){we(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value");};f.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return ue;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return J;e.raise("Invalid property name");};f.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Wi(t=e.current());)e.lastStringValue+=oe(t),e.advance();return e.lastStringValue!==""};function Wi(e){return Ui(e)||e===95}f.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Br(t=e.current());)e.lastStringValue+=oe(t),e.advance();return e.lastStringValue!==""};function Br(e){return Wi(e)||Ke(e)}f.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};f.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&i===J&&e.raise("Negated character class may contain strings"),true}return false};f.regexp_classContents=function(e){return e.current()===93?ue:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),ue)};f.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class");}}};f.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return true;if(e.switchU){var i=e.current();(i===99||Zi(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape");}e.pos=t;}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),true):false};f.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,true;if(e.switchU&&e.eat(45))return e.lastIntValue=45,true;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return true;e.pos=t;}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};f.regexp_classSetExpression=function(e){var t=ue,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===J&&(t=J);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==J&&(t=ue);continue}e.raise("Invalid character in character class");}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(r!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(i=this.regexp_eatClassSetOperand(e),!i)return t;i===J&&(t=J);}};f.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return i!==-1&&r!==-1&&i>r&&e.raise("Range out of order in character class"),true}e.pos=t;}return false};f.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?ue:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};f.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return i&&r===J&&e.raise("Negated character class may contain strings"),r;e.pos=t;}if(e.eat(92)){var s=this.regexp_eatCharacterClassEscape(e);if(s)return s;e.pos=t;}return null};f.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t;}return null};f.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===J&&(t=J);return t};f.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?ue:J};f.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?true:e.eat(98)?(e.lastIntValue=8,true):(e.pos=t,false);var i=e.current();return i<0||i===e.lookahead()&&Ur(i)||zr(i)?false:(e.advance(),e.lastIntValue=i,true)};function Ur(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function zr(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}f.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Wr(t)?(e.lastIntValue=t,e.advance(),true):false};function Wr(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}f.regexp_eatClassControlLetter=function(e){var t=e.current();return Ke(t)||t===95?(e.lastIntValue=t%32,e.advance(),true):false};f.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return true;e.switchU&&e.raise("Invalid escape"),e.pos=t;}return false};f.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ke(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function Ke(e){return e>=48&&e<=57}f.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;$i(i=e.current());)e.lastIntValue=16*e.lastIntValue+Hi(i),e.advance();return e.pos!==t};function $i(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Hi(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}f.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i;}else e.lastIntValue=t;return true}return false};f.regexp_eatOctalDigit=function(e){var t=e.current();return Zi(t)?(e.lastIntValue=t-48,e.advance(),true):(e.lastIntValue=0,false)};function Zi(e){return e>=48&&e<=55}f.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var s=e.current();if(!$i(s))return e.pos=i,false;e.lastIntValue=16*e.lastIntValue+Hi(s),e.advance();}return true};var vt=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new ze(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end]);},A=O.prototype;A.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new vt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken();};A.getToken=function(){return this.next(),new vt(this)};typeof Symbol<"u"&&(A[Symbol.iterator]=function(){var e=this;return {next:function(){var t=e.getToken();return {done:t.type===o.eof,value:t}}}});A.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(o.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos());};A.readToken=function(e){return se(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};A.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var i=this.input.charCodeAt(e+1);return i<=56319||i>=57344?t:(t<<10)+i-56613888};A.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};A.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var r=void 0,s=t;(r=mi(this.input,s,this.pos))>-1;)++this.curLine,s=this.lineStart=r;this.options.onComment&&this.options.onComment(true,this.input.slice(t+2,i),t,this.pos,e,this.curPosition());};A.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!Ee(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(false,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition());};A.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&gi.test(String.fromCharCode(e)))++this.pos;else break e}}};A.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i);};A.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(true);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(o.ellipsis)):(++this.pos,this.finishToken(o.dot))};A.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(o.assign,2):this.finishOp(o.slash,1)};A.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,r=e===42?o.star:o.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,r=o.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(o.assign,i+1):this.finishOp(r,i)};A.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(o.assign,3)}return this.finishOp(e===124?o.logicalOR:o.logicalAND,2)}return t===61?this.finishOp(o.assign,2):this.finishOp(e===124?o.bitwiseOR:o.bitwiseAND,1)};A.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(o.assign,2):this.finishOp(o.bitwiseXOR,1)};A.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||$.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(o.incDec,2):t===61?this.finishOp(o.assign,2):this.finishOp(o.plusMin,1)};A.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(o.assign,i+1):this.finishOp(o.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(o.relational,i))};A.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(o.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(o.arrow)):this.finishOp(e===61?o.eq:o.prefix,1)};A.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(o.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(o.assign,3)}return this.finishOp(o.coalesce,2)}}return this.finishOp(o.question,1)};A.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),se(t,true)||t===92))return this.finishToken(o.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+oe(t)+"'");};A.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return ++this.pos,this.finishToken(o.parenL);case 41:return ++this.pos,this.finishToken(o.parenR);case 59:return ++this.pos,this.finishToken(o.semi);case 44:return ++this.pos,this.finishToken(o.comma);case 91:return ++this.pos,this.finishToken(o.bracketL);case 93:return ++this.pos,this.finishToken(o.bracketR);case 123:return ++this.pos,this.finishToken(o.braceL);case 125:return ++this.pos,this.finishToken(o.braceR);case 58:return ++this.pos,this.finishToken(o.colon);case 96:if(this.options.ecmaVersion<6)break;return ++this.pos,this.finishToken(o.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(false);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(o.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+oe(e)+"'");};A.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};A.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var r=this.input.charAt(this.pos);if($.test(r)&&this.raise(i,"Unterminated regular expression"),e)e=false;else {if(r==="[")t=true;else if(r==="]"&&t)t=false;else if(r==="/"&&!t)break;e=r==="\\";}++this.pos;}var s=this.input.slice(i,this.pos);++this.pos;var n=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(n);var u=this.regexpState||(this.regexpState=new ne(this));u.reset(i,s,a),this.validateRegExpFlags(u),this.validateRegExpPattern(u);var c=null;try{c=new RegExp(s,a);}catch{}return this.finishToken(o.regexp,{pattern:s,flags:a,value:c})};A.readInt=function(e,t,i){for(var r=this.options.ecmaVersion>=12&&t===void 0,s=i&&this.input.charCodeAt(this.pos)===48,n=this.pos,a=0,u=0,c=0,l=t??1/0;c<l;++c,++this.pos){var p=this.input.charCodeAt(this.pos),x=void 0;if(r&&p===95){s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),u===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),c===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),u=p;continue}if(p>=97?x=p-97+10:p>=65?x=p-65+10:p>=48&&p<=57?x=p-48:x=1/0,x>=e)break;u=p,a=a*e+x;}return r&&u===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||t!=null&&this.pos-n!==t?null:a};function $r(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Ki(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}A.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=Ki(this.input.slice(t,this.pos)),++this.pos):se(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(o.num,i)};A.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,true)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&r===110){var s=Ki(this.input.slice(t,this.pos));return ++this.pos,se(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(o.num,s)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=false),r===46&&!i&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!i&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),se(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=$r(this.input.slice(t,this.pos),i);return this.finishToken(o.num,n)};A.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds");}else t=this.readHexChar(4);return t};A.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(false),i=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(Ee(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos);}return t+=this.input.slice(i,this.pos++),this.finishToken(o.string,t)};var Gi={};A.tryReadTemplateToken=function(){this.inTemplateElement=true;try{this.readTmplToken();}catch(e){if(e===Gi)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=false;};A.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw Gi;this.raise(e,t);};A.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===o.template||this.type===o.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(o.dollarBraceL)):(++this.pos,this.finishToken(o.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(o.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(true),t=this.pos;else if(Ee(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
9
+ `),cooked:this.value},this.next(),i.tail=this.type===o.backQuote,this.finishNode(i,"TemplateElement")};_.parseTemplate=function(e){e===void 0&&(e={});var t=e.isTagged;t===void 0&&(t=false);var i=this.startNode();this.next(),i.expressions=[];var r=this.parseTemplateElement({isTagged:t});for(i.quasis=[r];!r.tail;)this.type===o.eof&&this.raise(this.pos,"Unterminated template literal"),this.expect(o.dollarBraceL),i.expressions.push(this.parseExpression()),this.expect(o.braceR),i.quasis.push(r=this.parseTemplateElement({isTagged:t}));return this.next(),this.finishNode(i,"TemplateLiteral")};_.isAsyncProp=function(e){return !e.computed&&e.key.type==="Identifier"&&e.key.name==="async"&&(this.type===o.name||this.type===o.num||this.type===o.string||this.type===o.bracketL||this.type.keyword||this.options.ecmaVersion>=9&&this.type===o.star)&&!H.test(this.input.slice(this.lastTokEnd,this.start))};_.parseObj=function(e,t){var i=this.startNode(),r=true,s={};for(i.properties=[],this.next();!this.eat(o.braceR);){if(r)r=false;else if(this.expect(o.comma),this.options.ecmaVersion>=5&&this.afterTrailingComma(o.braceR))break;var n=this.parseProperty(e,t);e||this.checkPropClash(n,s,t),i.properties.push(n);}return this.finishNode(i,e?"ObjectPattern":"ObjectExpression")};_.parseProperty=function(e,t){var i=this.startNode(),r,s,n,a;if(this.options.ecmaVersion>=9&&this.eat(o.ellipsis))return e?(i.argument=this.parseIdent(false),this.type===o.comma&&this.raiseRecoverable(this.start,"Comma is not permitted after the rest element"),this.finishNode(i,"RestElement")):(i.argument=this.parseMaybeAssign(false,t),this.type===o.comma&&t&&t.trailingComma<0&&(t.trailingComma=this.start),this.finishNode(i,"SpreadElement"));this.options.ecmaVersion>=6&&(i.method=false,i.shorthand=false,(e||t)&&(n=this.start,a=this.startLoc),e||(r=this.eat(o.star)));var u=this.containsEsc;return this.parsePropertyName(i),!e&&!u&&this.options.ecmaVersion>=8&&!r&&this.isAsyncProp(i)?(s=true,r=this.options.ecmaVersion>=9&&this.eat(o.star),this.parsePropertyName(i)):s=false,this.parsePropertyValue(i,e,r,s,n,a,t,u),this.finishNode(i,"Property")};_.parseGetterSetter=function(e){var t=e.key.name;this.parsePropertyName(e),e.value=this.parseMethod(false),e.kind=t;var i=e.kind==="get"?0:1;if(e.value.params.length!==i){var r=e.value.start;e.kind==="get"?this.raiseRecoverable(r,"getter should have no params"):this.raiseRecoverable(r,"setter should have exactly one param");}else e.kind==="set"&&e.value.params[0].type==="RestElement"&&this.raiseRecoverable(e.value.params[0].start,"Setter cannot use rest params");};_.parsePropertyValue=function(e,t,i,r,s,n,a,u){(i||r)&&this.type===o.colon&&this.unexpected(),this.eat(o.colon)?(e.value=t?this.parseMaybeDefault(this.start,this.startLoc):this.parseMaybeAssign(false,a),e.kind="init"):this.options.ecmaVersion>=6&&this.type===o.parenL?(t&&this.unexpected(),e.method=true,e.value=this.parseMethod(i,r),e.kind="init"):!t&&!u&&this.options.ecmaVersion>=5&&!e.computed&&e.key.type==="Identifier"&&(e.key.name==="get"||e.key.name==="set")&&this.type!==o.comma&&this.type!==o.braceR&&this.type!==o.eq?((i||r)&&this.unexpected(),this.parseGetterSetter(e)):this.options.ecmaVersion>=6&&!e.computed&&e.key.type==="Identifier"?((i||r)&&this.unexpected(),this.checkUnreserved(e.key),e.key.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=s),t?e.value=this.parseMaybeDefault(s,n,this.copyNode(e.key)):this.type===o.eq&&a?(a.shorthandAssign<0&&(a.shorthandAssign=this.start),e.value=this.parseMaybeDefault(s,n,this.copyNode(e.key))):e.value=this.copyNode(e.key),e.kind="init",e.shorthand=true):this.unexpected();};_.parsePropertyName=function(e){if(this.options.ecmaVersion>=6){if(this.eat(o.bracketL))return e.computed=true,e.key=this.parseMaybeAssign(),this.expect(o.bracketR),e.key;e.computed=false;}return e.key=this.type===o.num||this.type===o.string?this.parseExprAtom():this.parseIdent(this.options.allowReserved!=="never")};_.initFunction=function(e){e.id=null,this.options.ecmaVersion>=6&&(e.generator=e.expression=false),this.options.ecmaVersion>=8&&(e.async=false);};_.parseMethod=function(e,t,i){var r=this.startNode(),s=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.initFunction(r),this.options.ecmaVersion>=6&&(r.generator=e),this.options.ecmaVersion>=8&&(r.async=!!t),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,this.enterScope(gt(t,r.generator)|We|(i?Si:0)),this.expect(o.parenL),r.params=this.parseBindingList(o.parenR,false,this.options.ecmaVersion>=8),this.checkYieldAwaitInDefaultParams(),this.parseFunctionBody(r,false,true,false),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(r,"FunctionExpression")};_.parseArrowExpression=function(e,t,i,r){var s=this.yieldPos,n=this.awaitPos,a=this.awaitIdentPos;return this.enterScope(gt(i,false)|mt),this.initFunction(e),this.options.ecmaVersion>=8&&(e.async=!!i),this.yieldPos=0,this.awaitPos=0,this.awaitIdentPos=0,e.params=this.toAssignableList(t,true),this.parseFunctionBody(e,true,false,r),this.yieldPos=s,this.awaitPos=n,this.awaitIdentPos=a,this.finishNode(e,"ArrowFunctionExpression")};_.parseFunctionBody=function(e,t,i,r){var s=t&&this.type!==o.braceL,n=this.strict,a=false;if(s)e.body=this.parseMaybeAssign(r),e.expression=true,this.checkParams(e,false);else {var u=this.options.ecmaVersion>=7&&!this.isSimpleParamList(e.params);(!n||u)&&(a=this.strictDirective(this.end),a&&u&&this.raiseRecoverable(e.start,"Illegal 'use strict' directive in function with non-simple parameter list"));var c=this.labels;this.labels=[],a&&(this.strict=true),this.checkParams(e,!n&&!a&&!t&&!i&&this.isSimpleParamList(e.params)),this.strict&&e.id&&this.checkLValSimple(e.id,ki),e.body=this.parseBlock(false,void 0,a&&!n),e.expression=false,this.adaptDirectivePrologue(e.body.body),this.labels=c;}this.exitScope();};_.isSimpleParamList=function(e){for(var t=0,i=e;t<i.length;t+=1){var r=i[t];if(r.type!=="Identifier")return false}return true};_.checkParams=function(e,t){for(var i=Object.create(null),r=0,s=e.params;r<s.length;r+=1){var n=s[r];this.checkLValInnerPattern(n,yt,t?null:i);}};_.parseExprList=function(e,t,i,r){for(var s=[],n=true;!this.eat(e);){if(n)n=false;else if(this.expect(o.comma),t&&this.afterTrailingComma(e))break;var a=void 0;i&&this.type===o.comma?a=null:this.type===o.ellipsis?(a=this.parseSpread(r),r&&this.type===o.comma&&r.trailingComma<0&&(r.trailingComma=this.start)):a=this.parseMaybeAssign(false,r),s.push(a);}return s};_.checkUnreserved=function(e){var t=e.start,i=e.end,r=e.name;if(this.inGenerator&&r==="yield"&&this.raiseRecoverable(t,"Cannot use 'yield' as identifier inside a generator"),this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use 'await' as identifier inside an async function"),!(this.currentThisScope().flags&$e)&&r==="arguments"&&this.raiseRecoverable(t,"Cannot use 'arguments' in class field initializer"),this.inClassStaticBlock&&(r==="arguments"||r==="await")&&this.raise(t,"Cannot use "+r+" in class static initialization block"),this.keywords.test(r)&&this.raise(t,"Unexpected keyword '"+r+"'"),!(this.options.ecmaVersion<6&&this.input.slice(t,i).indexOf("\\")!==-1)){var s=this.strict?this.reservedWordsStrict:this.reservedWords;s.test(r)&&(!this.inAsync&&r==="await"&&this.raiseRecoverable(t,"Cannot use keyword 'await' outside an async function"),this.raiseRecoverable(t,"The keyword '"+r+"' is reserved"));}};_.parseIdent=function(e){var t=this.parseIdentNode();return this.next(!!e),this.finishNode(t,"Identifier"),e||(this.checkUnreserved(t),t.name==="await"&&!this.awaitIdentPos&&(this.awaitIdentPos=t.start)),t};_.parseIdentNode=function(){var e=this.startNode();return this.type===o.name?e.name=this.value:this.type.keyword?(e.name=this.type.keyword,(e.name==="class"||e.name==="function")&&(this.lastTokEnd!==this.lastTokStart+1||this.input.charCodeAt(this.lastTokStart)!==46)&&this.context.pop(),this.type=o.name):this.unexpected(),e};_.parsePrivateIdent=function(){var e=this.startNode();return this.type===o.privateId?e.name=this.value:this.unexpected(),this.next(),this.finishNode(e,"PrivateIdentifier"),this.options.checkPrivateFields&&(this.privateNameStack.length===0?this.raise(e.start,"Private field '#"+e.name+"' must be declared in an enclosing class"):this.privateNameStack[this.privateNameStack.length-1].used.push(e)),e};_.parseYield=function(e){this.yieldPos||(this.yieldPos=this.start);var t=this.startNode();return this.next(),this.type===o.semi||this.canInsertSemicolon()||this.type!==o.star&&!this.type.startsExpr?(t.delegate=false,t.argument=null):(t.delegate=this.eat(o.star),t.argument=this.parseMaybeAssign(e)),this.finishNode(t,"YieldExpression")};_.parseAwait=function(e){this.awaitPos||(this.awaitPos=this.start);var t=this.startNode();return this.next(),t.argument=this.parseMaybeUnary(null,true,false,e),this.finishNode(t,"AwaitExpression")};var Be=F.prototype;Be.raise=function(e,t){var i=xi(this.input,e);t+=" ("+i.line+":"+i.column+")",this.sourceFile&&(t+=" in "+this.sourceFile);var r=new SyntaxError(t);throw r.pos=e,r.loc=i,r.raisedAt=this.pos,r};Be.raiseRecoverable=Be.raise;Be.curPosition=function(){if(this.options.locations)return new Ie(this.curLine,this.pos-this.lineStart)};var de=F.prototype,kr=function(t){this.flags=t,this.var=[],this.lexical=[],this.functions=[];};de.enterScope=function(e){this.scopeStack.push(new kr(e));};de.exitScope=function(){this.scopeStack.pop();};de.treatFunctionsAsVarInScope=function(e){return e.flags&ve||!this.inModule&&e.flags&xe};de.declareName=function(e,t,i){var r=false;if(t===ce){var s=this.currentScope();r=s.lexical.indexOf(e)>-1||s.functions.indexOf(e)>-1||s.var.indexOf(e)>-1,s.lexical.push(e),this.inModule&&s.flags&xe&&delete this.undefinedExports[e];}else if(t===wi){var n=this.currentScope();n.lexical.push(e);}else if(t===_i){var a=this.currentScope();this.treatFunctionsAsVar?r=a.lexical.indexOf(e)>-1:r=a.lexical.indexOf(e)>-1||a.var.indexOf(e)>-1,a.functions.push(e);}else for(var u=this.scopeStack.length-1;u>=0;--u){var c=this.scopeStack[u];if(c.lexical.indexOf(e)>-1&&!(c.flags&bi&&c.lexical[0]===e)||!this.treatFunctionsAsVarInScope(c)&&c.functions.indexOf(e)>-1){r=true;break}if(c.var.push(e),this.inModule&&c.flags&xe&&delete this.undefinedExports[e],c.flags&$e)break}r&&this.raiseRecoverable(i,"Identifier '"+e+"' has already been declared");};de.checkLocalExport=function(e){this.scopeStack[0].lexical.indexOf(e.name)===-1&&this.scopeStack[0].var.indexOf(e.name)===-1&&(this.undefinedExports[e.name]=e);};de.currentScope=function(){return this.scopeStack[this.scopeStack.length-1]};de.currentVarScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&($e|Te|be))return t}};de.currentThisScope=function(){for(var e=this.scopeStack.length-1;;e--){var t=this.scopeStack[e];if(t.flags&($e|Te|be)&&!(t.flags&mt))return t}};var Ze=function(t,i,r){this.type="",this.start=i,this.end=0,t.options.locations&&(this.loc=new ze(t,r)),t.options.directSourceFile&&(this.sourceFile=t.options.directSourceFile),t.options.ranges&&(this.range=[i,0]);},Ne=F.prototype;Ne.startNode=function(){return new Ze(this,this.start,this.startLoc)};Ne.startNodeAt=function(e,t){return new Ze(this,e,t)};function Ci(e,t,i,r){return e.type=t,e.end=i,this.options.locations&&(e.loc.end=r),this.options.ranges&&(e.range[1]=i),e}Ne.finishNode=function(e,t){return Ci.call(this,e,t,this.lastTokEnd,this.lastTokEndLoc)};Ne.finishNodeAt=function(e,t,i,r){return Ci.call(this,e,t,i,r)};Ne.copyNode=function(e){var t=new Ze(this,e.start,this.startLoc);for(var i in e)t[i]=e[i];return t};var Ar="Berf Beria_Erfe Gara Garay Gukh Gurung_Khema Hrkt Katakana_Or_Hiragana Kawi Kirat_Rai Krai Nag_Mundari Nagm Ol_Onal Onao Sidetic Sidt Sunu Sunuwar Tai_Yo Tayo Todhri Todr Tolong_Siki Tols Tulu_Tigalari Tutg Unknown Zzzz",Ii="ASCII ASCII_Hex_Digit AHex Alphabetic Alpha Any Assigned Bidi_Control Bidi_C Bidi_Mirrored Bidi_M Case_Ignorable CI Cased Changes_When_Casefolded CWCF Changes_When_Casemapped CWCM Changes_When_Lowercased CWL Changes_When_NFKC_Casefolded CWKCF Changes_When_Titlecased CWT Changes_When_Uppercased CWU Dash Default_Ignorable_Code_Point DI Deprecated Dep Diacritic Dia Emoji Emoji_Component Emoji_Modifier Emoji_Modifier_Base Emoji_Presentation Extender Ext Grapheme_Base Gr_Base Grapheme_Extend Gr_Ext Hex_Digit Hex IDS_Binary_Operator IDSB IDS_Trinary_Operator IDST ID_Continue IDC ID_Start IDS Ideographic Ideo Join_Control Join_C Logical_Order_Exception LOE Lowercase Lower Math Noncharacter_Code_Point NChar Pattern_Syntax Pat_Syn Pattern_White_Space Pat_WS Quotation_Mark QMark Radical Regional_Indicator RI Sentence_Terminal STerm Soft_Dotted SD Terminal_Punctuation Term Unified_Ideograph UIdeo Uppercase Upper Variation_Selector VS White_Space space XID_Continue XIDC XID_Start XIDS",Ti=Ii+" Extended_Pictographic",Ni=Ti,Ri=Ni+" EBase EComp EMod EPres ExtPict",Li=Ri,Pr=Li,Cr={9:Ii,10:Ti,11:Ni,12:Ri,13:Li,14:Pr},Ir="Basic_Emoji Emoji_Keycap_Sequence RGI_Emoji_Modifier_Sequence RGI_Emoji_Flag_Sequence RGI_Emoji_Tag_Sequence RGI_Emoji_ZWJ_Sequence RGI_Emoji",Tr={9:"",10:"",11:"",12:"",13:"",14:Ir},li="Cased_Letter LC Close_Punctuation Pe Connector_Punctuation Pc Control Cc cntrl Currency_Symbol Sc Dash_Punctuation Pd Decimal_Number Nd digit Enclosing_Mark Me Final_Punctuation Pf Format Cf Initial_Punctuation Pi Letter L Letter_Number Nl Line_Separator Zl Lowercase_Letter Ll Mark M Combining_Mark Math_Symbol Sm Modifier_Letter Lm Modifier_Symbol Sk Nonspacing_Mark Mn Number N Open_Punctuation Ps Other C Other_Letter Lo Other_Number No Other_Punctuation Po Other_Symbol So Paragraph_Separator Zp Private_Use Co Punctuation P punct Separator Z Space_Separator Zs Spacing_Mark Mc Surrogate Cs Symbol S Titlecase_Letter Lt Unassigned Cn Uppercase_Letter Lu",Oi="Adlam Adlm Ahom Anatolian_Hieroglyphs Hluw Arabic Arab Armenian Armn Avestan Avst Balinese Bali Bamum Bamu Bassa_Vah Bass Batak Batk Bengali Beng Bhaiksuki Bhks Bopomofo Bopo Brahmi Brah Braille Brai Buginese Bugi Buhid Buhd Canadian_Aboriginal Cans Carian Cari Caucasian_Albanian Aghb Chakma Cakm Cham Cham Cherokee Cher Common Zyyy Coptic Copt Qaac Cuneiform Xsux Cypriot Cprt Cyrillic Cyrl Deseret Dsrt Devanagari Deva Duployan Dupl Egyptian_Hieroglyphs Egyp Elbasan Elba Ethiopic Ethi Georgian Geor Glagolitic Glag Gothic Goth Grantha Gran Greek Grek Gujarati Gujr Gurmukhi Guru Han Hani Hangul Hang Hanunoo Hano Hatran Hatr Hebrew Hebr Hiragana Hira Imperial_Aramaic Armi Inherited Zinh Qaai Inscriptional_Pahlavi Phli Inscriptional_Parthian Prti Javanese Java Kaithi Kthi Kannada Knda Katakana Kana Kayah_Li Kali Kharoshthi Khar Khmer Khmr Khojki Khoj Khudawadi Sind Lao Laoo Latin Latn Lepcha Lepc Limbu Limb Linear_A Lina Linear_B Linb Lisu Lisu Lycian Lyci Lydian Lydi Mahajani Mahj Malayalam Mlym Mandaic Mand Manichaean Mani Marchen Marc Masaram_Gondi Gonm Meetei_Mayek Mtei Mende_Kikakui Mend Meroitic_Cursive Merc Meroitic_Hieroglyphs Mero Miao Plrd Modi Mongolian Mong Mro Mroo Multani Mult Myanmar Mymr Nabataean Nbat New_Tai_Lue Talu Newa Newa Nko Nkoo Nushu Nshu Ogham Ogam Ol_Chiki Olck Old_Hungarian Hung Old_Italic Ital Old_North_Arabian Narb Old_Permic Perm Old_Persian Xpeo Old_South_Arabian Sarb Old_Turkic Orkh Oriya Orya Osage Osge Osmanya Osma Pahawh_Hmong Hmng Palmyrene Palm Pau_Cin_Hau Pauc Phags_Pa Phag Phoenician Phnx Psalter_Pahlavi Phlp Rejang Rjng Runic Runr Samaritan Samr Saurashtra Saur Sharada Shrd Shavian Shaw Siddham Sidd SignWriting Sgnw Sinhala Sinh Sora_Sompeng Sora Soyombo Soyo Sundanese Sund Syloti_Nagri Sylo Syriac Syrc Tagalog Tglg Tagbanwa Tagb Tai_Le Tale Tai_Tham Lana Tai_Viet Tavt Takri Takr Tamil Taml Tangut Tang Telugu Telu Thaana Thaa Thai Thai Tibetan Tibt Tifinagh Tfng Tirhuta Tirh Ugaritic Ugar Vai Vaii Warang_Citi Wara Yi Yiii Zanabazar_Square Zanb",Di=Oi+" Dogra Dogr Gunjala_Gondi Gong Hanifi_Rohingya Rohg Makasar Maka Medefaidrin Medf Old_Sogdian Sogo Sogdian Sogd",Mi=Di+" Elymaic Elym Nandinagari Nand Nyiakeng_Puachue_Hmong Hmnp Wancho Wcho",Fi=Mi+" Chorasmian Chrs Diak Dives_Akuru Khitan_Small_Script Kits Yezi Yezidi",Vi=Fi+" Cypro_Minoan Cpmn Old_Uyghur Ougr Tangsa Tnsa Toto Vithkuqi Vith",Nr=Vi+" "+Ar,Rr={9:Oi,10:Di,11:Mi,12:Fi,13:Vi,14:Nr},ji={};function Lr(e){var t=ji[e]={binary:he(Cr[e]+" "+li),binaryOfStrings:he(Tr[e]),nonBinary:{General_Category:he(li),Script:he(Rr[e])}};t.nonBinary.Script_Extensions=t.nonBinary.Script,t.nonBinary.gc=t.nonBinary.General_Category,t.nonBinary.sc=t.nonBinary.Script,t.nonBinary.scx=t.nonBinary.Script_Extensions;}for(Fe=0,ut=[9,10,11,12,13,14];Fe<ut.length;Fe+=1)pi=ut[Fe],Lr(pi);var pi,Fe,ut,f=F.prototype,Ue=function(t,i){this.parent=t,this.base=i||this;};Ue.prototype.separatedFrom=function(t){for(var i=this;i;i=i.parent)for(var r=t;r;r=r.parent)if(i.base===r.base&&i!==r)return true;return false};Ue.prototype.sibling=function(){return new Ue(this.parent,this.base)};var ne=function(t){this.parser=t,this.validFlags="gim"+(t.options.ecmaVersion>=6?"uy":"")+(t.options.ecmaVersion>=9?"s":"")+(t.options.ecmaVersion>=13?"d":"")+(t.options.ecmaVersion>=15?"v":""),this.unicodeProperties=ji[t.options.ecmaVersion>=14?14:t.options.ecmaVersion],this.source="",this.flags="",this.start=0,this.switchU=false,this.switchV=false,this.switchN=false,this.pos=0,this.lastIntValue=0,this.lastStringValue="",this.lastAssertionIsQuantifiable=false,this.numCapturingParens=0,this.maxBackReference=0,this.groupNames=Object.create(null),this.backReferenceNames=[],this.branchID=null;};ne.prototype.reset=function(t,i,r){var s=r.indexOf("v")!==-1,n=r.indexOf("u")!==-1;this.start=t|0,this.source=i+"",this.flags=r,s&&this.parser.options.ecmaVersion>=15?(this.switchU=true,this.switchV=true,this.switchN=true):(this.switchU=n&&this.parser.options.ecmaVersion>=6,this.switchV=false,this.switchN=n&&this.parser.options.ecmaVersion>=9);};ne.prototype.raise=function(t){this.parser.raiseRecoverable(this.start,"Invalid regular expression: /"+this.source+"/: "+t);};ne.prototype.at=function(t,i){i===void 0&&(i=false);var r=this.source,s=r.length;if(t>=s)return -1;var n=r.charCodeAt(t);if(!(i||this.switchU)||n<=55295||n>=57344||t+1>=s)return n;var a=r.charCodeAt(t+1);return a>=56320&&a<=57343?(n<<10)+a-56613888:n};ne.prototype.nextIndex=function(t,i){i===void 0&&(i=false);var r=this.source,s=r.length;if(t>=s)return s;var n=r.charCodeAt(t),a;return !(i||this.switchU)||n<=55295||n>=57344||t+1>=s||(a=r.charCodeAt(t+1))<56320||a>57343?t+1:t+2};ne.prototype.current=function(t){return t===void 0&&(t=false),this.at(this.pos,t)};ne.prototype.lookahead=function(t){return t===void 0&&(t=false),this.at(this.nextIndex(this.pos,t),t)};ne.prototype.advance=function(t){t===void 0&&(t=false),this.pos=this.nextIndex(this.pos,t);};ne.prototype.eat=function(t,i){return i===void 0&&(i=false),this.current(i)===t?(this.advance(i),true):false};ne.prototype.eatChars=function(t,i){i===void 0&&(i=false);for(var r=this.pos,s=0,n=t;s<n.length;s+=1){var a=n[s],u=this.at(r,i);if(u===-1||u!==a)return false;r=this.nextIndex(r,i);}return this.pos=r,true};f.validateRegExpFlags=function(e){for(var t=e.validFlags,i=e.flags,r=false,s=false,n=0;n<i.length;n++){var a=i.charAt(n);t.indexOf(a)===-1&&this.raise(e.start,"Invalid regular expression flag"),i.indexOf(a,n+1)>-1&&this.raise(e.start,"Duplicate regular expression flag"),a==="u"&&(r=true),a==="v"&&(s=true);}this.options.ecmaVersion>=15&&r&&s&&this.raise(e.start,"Invalid regular expression flag");};function Or(e){for(var t in e)return true;return false}f.validateRegExpPattern=function(e){this.regexp_pattern(e),!e.switchN&&this.options.ecmaVersion>=9&&Or(e.groupNames)&&(e.switchN=true,this.regexp_pattern(e));};f.regexp_pattern=function(e){e.pos=0,e.lastIntValue=0,e.lastStringValue="",e.lastAssertionIsQuantifiable=false,e.numCapturingParens=0,e.maxBackReference=0,e.groupNames=Object.create(null),e.backReferenceNames.length=0,e.branchID=null,this.regexp_disjunction(e),e.pos!==e.source.length&&(e.eat(41)&&e.raise("Unmatched ')'"),(e.eat(93)||e.eat(125))&&e.raise("Lone quantifier brackets")),e.maxBackReference>e.numCapturingParens&&e.raise("Invalid escape");for(var t=0,i=e.backReferenceNames;t<i.length;t+=1){var r=i[t];e.groupNames[r]||e.raise("Invalid named capture referenced");}};f.regexp_disjunction=function(e){var t=this.options.ecmaVersion>=16;for(t&&(e.branchID=new Ue(e.branchID,null)),this.regexp_alternative(e);e.eat(124);)t&&(e.branchID=e.branchID.sibling()),this.regexp_alternative(e);t&&(e.branchID=e.branchID.parent),this.regexp_eatQuantifier(e,true)&&e.raise("Nothing to repeat"),e.eat(123)&&e.raise("Lone quantifier brackets");};f.regexp_alternative=function(e){for(;e.pos<e.source.length&&this.regexp_eatTerm(e););};f.regexp_eatTerm=function(e){return this.regexp_eatAssertion(e)?(e.lastAssertionIsQuantifiable&&this.regexp_eatQuantifier(e)&&e.switchU&&e.raise("Invalid quantifier"),true):(e.switchU?this.regexp_eatAtom(e):this.regexp_eatExtendedAtom(e))?(this.regexp_eatQuantifier(e),true):false};f.regexp_eatAssertion=function(e){var t=e.pos;if(e.lastAssertionIsQuantifiable=false,e.eat(94)||e.eat(36))return true;if(e.eat(92)){if(e.eat(66)||e.eat(98))return true;e.pos=t;}if(e.eat(40)&&e.eat(63)){var i=false;if(this.options.ecmaVersion>=9&&(i=e.eat(60)),e.eat(61)||e.eat(33))return this.regexp_disjunction(e),e.eat(41)||e.raise("Unterminated group"),e.lastAssertionIsQuantifiable=!i,true}return e.pos=t,false};f.regexp_eatQuantifier=function(e,t){return t===void 0&&(t=false),this.regexp_eatQuantifierPrefix(e,t)?(e.eat(63),true):false};f.regexp_eatQuantifierPrefix=function(e,t){return e.eat(42)||e.eat(43)||e.eat(63)||this.regexp_eatBracedQuantifier(e,t)};f.regexp_eatBracedQuantifier=function(e,t){var i=e.pos;if(e.eat(123)){var r=0,s=-1;if(this.regexp_eatDecimalDigits(e)&&(r=e.lastIntValue,e.eat(44)&&this.regexp_eatDecimalDigits(e)&&(s=e.lastIntValue),e.eat(125)))return s!==-1&&s<r&&!t&&e.raise("numbers out of order in {} quantifier"),true;e.switchU&&!t&&e.raise("Incomplete quantifier"),e.pos=i;}return false};f.regexp_eatAtom=function(e){return this.regexp_eatPatternCharacters(e)||e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)};f.regexp_eatReverseSolidusAtomEscape=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatAtomEscape(e))return true;e.pos=t;}return false};f.regexp_eatUncapturingGroup=function(e){var t=e.pos;if(e.eat(40)){if(e.eat(63)){if(this.options.ecmaVersion>=16){var i=this.regexp_eatModifiers(e),r=e.eat(45);if(i||r){for(var s=0;s<i.length;s++){var n=i.charAt(s);i.indexOf(n,s+1)>-1&&e.raise("Duplicate regular expression modifiers");}if(r){var a=this.regexp_eatModifiers(e);!i&&!a&&e.current()===58&&e.raise("Invalid regular expression modifiers");for(var u=0;u<a.length;u++){var c=a.charAt(u);(a.indexOf(c,u+1)>-1||i.indexOf(c)>-1)&&e.raise("Duplicate regular expression modifiers");}}}}if(e.eat(58)){if(this.regexp_disjunction(e),e.eat(41))return true;e.raise("Unterminated group");}}e.pos=t;}return false};f.regexp_eatCapturingGroup=function(e){if(e.eat(40)){if(this.options.ecmaVersion>=9?this.regexp_groupSpecifier(e):e.current()===63&&e.raise("Invalid group"),this.regexp_disjunction(e),e.eat(41))return e.numCapturingParens+=1,true;e.raise("Unterminated group");}return false};f.regexp_eatModifiers=function(e){for(var t="",i=0;(i=e.current())!==-1&&Dr(i);)t+=oe(i),e.advance();return t};function Dr(e){return e===105||e===109||e===115}f.regexp_eatExtendedAtom=function(e){return e.eat(46)||this.regexp_eatReverseSolidusAtomEscape(e)||this.regexp_eatCharacterClass(e)||this.regexp_eatUncapturingGroup(e)||this.regexp_eatCapturingGroup(e)||this.regexp_eatInvalidBracedQuantifier(e)||this.regexp_eatExtendedPatternCharacter(e)};f.regexp_eatInvalidBracedQuantifier=function(e){return this.regexp_eatBracedQuantifier(e,true)&&e.raise("Nothing to repeat"),false};f.regexp_eatSyntaxCharacter=function(e){var t=e.current();return Bi(t)?(e.lastIntValue=t,e.advance(),true):false};function Bi(e){return e===36||e>=40&&e<=43||e===46||e===63||e>=91&&e<=94||e>=123&&e<=125}f.regexp_eatPatternCharacters=function(e){for(var t=e.pos,i=0;(i=e.current())!==-1&&!Bi(i);)e.advance();return e.pos!==t};f.regexp_eatExtendedPatternCharacter=function(e){var t=e.current();return t!==-1&&t!==36&&!(t>=40&&t<=43)&&t!==46&&t!==63&&t!==91&&t!==94&&t!==124?(e.advance(),true):false};f.regexp_groupSpecifier=function(e){if(e.eat(63)){this.regexp_eatGroupName(e)||e.raise("Invalid group");var t=this.options.ecmaVersion>=16,i=e.groupNames[e.lastStringValue];if(i)if(t)for(var r=0,s=i;r<s.length;r+=1){var n=s[r];n.separatedFrom(e.branchID)||e.raise("Duplicate capture group name");}else e.raise("Duplicate capture group name");t?(i||(e.groupNames[e.lastStringValue]=[])).push(e.branchID):e.groupNames[e.lastStringValue]=true;}};f.regexp_eatGroupName=function(e){if(e.lastStringValue="",e.eat(60)){if(this.regexp_eatRegExpIdentifierName(e)&&e.eat(62))return true;e.raise("Invalid capture group name");}return false};f.regexp_eatRegExpIdentifierName=function(e){if(e.lastStringValue="",this.regexp_eatRegExpIdentifierStart(e)){for(e.lastStringValue+=oe(e.lastIntValue);this.regexp_eatRegExpIdentifierPart(e);)e.lastStringValue+=oe(e.lastIntValue);return true}return false};f.regexp_eatRegExpIdentifierStart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Mr(r)?(e.lastIntValue=r,true):(e.pos=t,false)};function Mr(e){return se(e,true)||e===36||e===95}f.regexp_eatRegExpIdentifierPart=function(e){var t=e.pos,i=this.options.ecmaVersion>=11,r=e.current(i);return e.advance(i),r===92&&this.regexp_eatRegExpUnicodeEscapeSequence(e,i)&&(r=e.lastIntValue),Fr(r)?(e.lastIntValue=r,true):(e.pos=t,false)};function Fr(e){return fe(e,true)||e===36||e===95||e===8204||e===8205}f.regexp_eatAtomEscape=function(e){return this.regexp_eatBackReference(e)||this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)||e.switchN&&this.regexp_eatKGroupName(e)?true:(e.switchU&&(e.current()===99&&e.raise("Invalid unicode escape"),e.raise("Invalid escape")),false)};f.regexp_eatBackReference=function(e){var t=e.pos;if(this.regexp_eatDecimalEscape(e)){var i=e.lastIntValue;if(e.switchU)return i>e.maxBackReference&&(e.maxBackReference=i),true;if(i<=e.numCapturingParens)return true;e.pos=t;}return false};f.regexp_eatKGroupName=function(e){if(e.eat(107)){if(this.regexp_eatGroupName(e))return e.backReferenceNames.push(e.lastStringValue),true;e.raise("Invalid named reference");}return false};f.regexp_eatCharacterEscape=function(e){return this.regexp_eatControlEscape(e)||this.regexp_eatCControlLetter(e)||this.regexp_eatZero(e)||this.regexp_eatHexEscapeSequence(e)||this.regexp_eatRegExpUnicodeEscapeSequence(e,false)||!e.switchU&&this.regexp_eatLegacyOctalEscapeSequence(e)||this.regexp_eatIdentityEscape(e)};f.regexp_eatCControlLetter=function(e){var t=e.pos;if(e.eat(99)){if(this.regexp_eatControlLetter(e))return true;e.pos=t;}return false};f.regexp_eatZero=function(e){return e.current()===48&&!Ke(e.lookahead())?(e.lastIntValue=0,e.advance(),true):false};f.regexp_eatControlEscape=function(e){var t=e.current();return t===116?(e.lastIntValue=9,e.advance(),true):t===110?(e.lastIntValue=10,e.advance(),true):t===118?(e.lastIntValue=11,e.advance(),true):t===102?(e.lastIntValue=12,e.advance(),true):t===114?(e.lastIntValue=13,e.advance(),true):false};f.regexp_eatControlLetter=function(e){var t=e.current();return Ui(t)?(e.lastIntValue=t%32,e.advance(),true):false};function Ui(e){return e>=65&&e<=90||e>=97&&e<=122}f.regexp_eatRegExpUnicodeEscapeSequence=function(e,t){t===void 0&&(t=false);var i=e.pos,r=t||e.switchU;if(e.eat(117)){if(this.regexp_eatFixedHexDigits(e,4)){var s=e.lastIntValue;if(r&&s>=55296&&s<=56319){var n=e.pos;if(e.eat(92)&&e.eat(117)&&this.regexp_eatFixedHexDigits(e,4)){var a=e.lastIntValue;if(a>=56320&&a<=57343)return e.lastIntValue=(s-55296)*1024+(a-56320)+65536,true}e.pos=n,e.lastIntValue=s;}return true}if(r&&e.eat(123)&&this.regexp_eatHexDigits(e)&&e.eat(125)&&Vr(e.lastIntValue))return true;r&&e.raise("Invalid unicode escape"),e.pos=i;}return false};function Vr(e){return e>=0&&e<=1114111}f.regexp_eatIdentityEscape=function(e){if(e.switchU)return this.regexp_eatSyntaxCharacter(e)?true:e.eat(47)?(e.lastIntValue=47,true):false;var t=e.current();return t!==99&&(!e.switchN||t!==107)?(e.lastIntValue=t,e.advance(),true):false};f.regexp_eatDecimalEscape=function(e){e.lastIntValue=0;var t=e.current();if(t>=49&&t<=57){do e.lastIntValue=10*e.lastIntValue+(t-48),e.advance();while((t=e.current())>=48&&t<=57);return true}return false};var zi=0,ue=1,J=2;f.regexp_eatCharacterClassEscape=function(e){var t=e.current();if(jr(t))return e.lastIntValue=-1,e.advance(),ue;var i=false;if(e.switchU&&this.options.ecmaVersion>=9&&((i=t===80)||t===112)){e.lastIntValue=-1,e.advance();var r;if(e.eat(123)&&(r=this.regexp_eatUnicodePropertyValueExpression(e))&&e.eat(125))return i&&r===J&&e.raise("Invalid property name"),r;e.raise("Invalid property name");}return zi};function jr(e){return e===100||e===68||e===115||e===83||e===119||e===87}f.regexp_eatUnicodePropertyValueExpression=function(e){var t=e.pos;if(this.regexp_eatUnicodePropertyName(e)&&e.eat(61)){var i=e.lastStringValue;if(this.regexp_eatUnicodePropertyValue(e)){var r=e.lastStringValue;return this.regexp_validateUnicodePropertyNameAndValue(e,i,r),ue}}if(e.pos=t,this.regexp_eatLoneUnicodePropertyNameOrValue(e)){var s=e.lastStringValue;return this.regexp_validateUnicodePropertyNameOrValue(e,s)}return zi};f.regexp_validateUnicodePropertyNameAndValue=function(e,t,i){we(e.unicodeProperties.nonBinary,t)||e.raise("Invalid property name"),e.unicodeProperties.nonBinary[t].test(i)||e.raise("Invalid property value");};f.regexp_validateUnicodePropertyNameOrValue=function(e,t){if(e.unicodeProperties.binary.test(t))return ue;if(e.switchV&&e.unicodeProperties.binaryOfStrings.test(t))return J;e.raise("Invalid property name");};f.regexp_eatUnicodePropertyName=function(e){var t=0;for(e.lastStringValue="";Wi(t=e.current());)e.lastStringValue+=oe(t),e.advance();return e.lastStringValue!==""};function Wi(e){return Ui(e)||e===95}f.regexp_eatUnicodePropertyValue=function(e){var t=0;for(e.lastStringValue="";Br(t=e.current());)e.lastStringValue+=oe(t),e.advance();return e.lastStringValue!==""};function Br(e){return Wi(e)||Ke(e)}f.regexp_eatLoneUnicodePropertyNameOrValue=function(e){return this.regexp_eatUnicodePropertyValue(e)};f.regexp_eatCharacterClass=function(e){if(e.eat(91)){var t=e.eat(94),i=this.regexp_classContents(e);return e.eat(93)||e.raise("Unterminated character class"),t&&i===J&&e.raise("Negated character class may contain strings"),true}return false};f.regexp_classContents=function(e){return e.current()===93?ue:e.switchV?this.regexp_classSetExpression(e):(this.regexp_nonEmptyClassRanges(e),ue)};f.regexp_nonEmptyClassRanges=function(e){for(;this.regexp_eatClassAtom(e);){var t=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassAtom(e)){var i=e.lastIntValue;e.switchU&&(t===-1||i===-1)&&e.raise("Invalid character class"),t!==-1&&i!==-1&&t>i&&e.raise("Range out of order in character class");}}};f.regexp_eatClassAtom=function(e){var t=e.pos;if(e.eat(92)){if(this.regexp_eatClassEscape(e))return true;if(e.switchU){var i=e.current();(i===99||Zi(i))&&e.raise("Invalid class escape"),e.raise("Invalid escape");}e.pos=t;}var r=e.current();return r!==93?(e.lastIntValue=r,e.advance(),true):false};f.regexp_eatClassEscape=function(e){var t=e.pos;if(e.eat(98))return e.lastIntValue=8,true;if(e.switchU&&e.eat(45))return e.lastIntValue=45,true;if(!e.switchU&&e.eat(99)){if(this.regexp_eatClassControlLetter(e))return true;e.pos=t;}return this.regexp_eatCharacterClassEscape(e)||this.regexp_eatCharacterEscape(e)};f.regexp_classSetExpression=function(e){var t=ue,i;if(!this.regexp_eatClassSetRange(e))if(i=this.regexp_eatClassSetOperand(e)){i===J&&(t=J);for(var r=e.pos;e.eatChars([38,38]);){if(e.current()!==38&&(i=this.regexp_eatClassSetOperand(e))){i!==J&&(t=ue);continue}e.raise("Invalid character in character class");}if(r!==e.pos)return t;for(;e.eatChars([45,45]);)this.regexp_eatClassSetOperand(e)||e.raise("Invalid character in character class");if(r!==e.pos)return t}else e.raise("Invalid character in character class");for(;;)if(!this.regexp_eatClassSetRange(e)){if(i=this.regexp_eatClassSetOperand(e),!i)return t;i===J&&(t=J);}};f.regexp_eatClassSetRange=function(e){var t=e.pos;if(this.regexp_eatClassSetCharacter(e)){var i=e.lastIntValue;if(e.eat(45)&&this.regexp_eatClassSetCharacter(e)){var r=e.lastIntValue;return i!==-1&&r!==-1&&i>r&&e.raise("Range out of order in character class"),true}e.pos=t;}return false};f.regexp_eatClassSetOperand=function(e){return this.regexp_eatClassSetCharacter(e)?ue:this.regexp_eatClassStringDisjunction(e)||this.regexp_eatNestedClass(e)};f.regexp_eatNestedClass=function(e){var t=e.pos;if(e.eat(91)){var i=e.eat(94),r=this.regexp_classContents(e);if(e.eat(93))return i&&r===J&&e.raise("Negated character class may contain strings"),r;e.pos=t;}if(e.eat(92)){var s=this.regexp_eatCharacterClassEscape(e);if(s)return s;e.pos=t;}return null};f.regexp_eatClassStringDisjunction=function(e){var t=e.pos;if(e.eatChars([92,113])){if(e.eat(123)){var i=this.regexp_classStringDisjunctionContents(e);if(e.eat(125))return i}else e.raise("Invalid escape");e.pos=t;}return null};f.regexp_classStringDisjunctionContents=function(e){for(var t=this.regexp_classString(e);e.eat(124);)this.regexp_classString(e)===J&&(t=J);return t};f.regexp_classString=function(e){for(var t=0;this.regexp_eatClassSetCharacter(e);)t++;return t===1?ue:J};f.regexp_eatClassSetCharacter=function(e){var t=e.pos;if(e.eat(92))return this.regexp_eatCharacterEscape(e)||this.regexp_eatClassSetReservedPunctuator(e)?true:e.eat(98)?(e.lastIntValue=8,true):(e.pos=t,false);var i=e.current();return i<0||i===e.lookahead()&&Ur(i)||zr(i)?false:(e.advance(),e.lastIntValue=i,true)};function Ur(e){return e===33||e>=35&&e<=38||e>=42&&e<=44||e===46||e>=58&&e<=64||e===94||e===96||e===126}function zr(e){return e===40||e===41||e===45||e===47||e>=91&&e<=93||e>=123&&e<=125}f.regexp_eatClassSetReservedPunctuator=function(e){var t=e.current();return Wr(t)?(e.lastIntValue=t,e.advance(),true):false};function Wr(e){return e===33||e===35||e===37||e===38||e===44||e===45||e>=58&&e<=62||e===64||e===96||e===126}f.regexp_eatClassControlLetter=function(e){var t=e.current();return Ke(t)||t===95?(e.lastIntValue=t%32,e.advance(),true):false};f.regexp_eatHexEscapeSequence=function(e){var t=e.pos;if(e.eat(120)){if(this.regexp_eatFixedHexDigits(e,2))return true;e.switchU&&e.raise("Invalid escape"),e.pos=t;}return false};f.regexp_eatDecimalDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;Ke(i=e.current());)e.lastIntValue=10*e.lastIntValue+(i-48),e.advance();return e.pos!==t};function Ke(e){return e>=48&&e<=57}f.regexp_eatHexDigits=function(e){var t=e.pos,i=0;for(e.lastIntValue=0;$i(i=e.current());)e.lastIntValue=16*e.lastIntValue+Hi(i),e.advance();return e.pos!==t};function $i(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function Hi(e){return e>=65&&e<=70?10+(e-65):e>=97&&e<=102?10+(e-97):e-48}f.regexp_eatLegacyOctalEscapeSequence=function(e){if(this.regexp_eatOctalDigit(e)){var t=e.lastIntValue;if(this.regexp_eatOctalDigit(e)){var i=e.lastIntValue;t<=3&&this.regexp_eatOctalDigit(e)?e.lastIntValue=t*64+i*8+e.lastIntValue:e.lastIntValue=t*8+i;}else e.lastIntValue=t;return true}return false};f.regexp_eatOctalDigit=function(e){var t=e.current();return Zi(t)?(e.lastIntValue=t-48,e.advance(),true):(e.lastIntValue=0,false)};function Zi(e){return e>=48&&e<=55}f.regexp_eatFixedHexDigits=function(e,t){var i=e.pos;e.lastIntValue=0;for(var r=0;r<t;++r){var s=e.current();if(!$i(s))return e.pos=i,false;e.lastIntValue=16*e.lastIntValue+Hi(s),e.advance();}return true};var vt=function(t){this.type=t.type,this.value=t.value,this.start=t.start,this.end=t.end,t.options.locations&&(this.loc=new ze(t,t.startLoc,t.endLoc)),t.options.ranges&&(this.range=[t.start,t.end]);},A=F.prototype;A.next=function(e){!e&&this.type.keyword&&this.containsEsc&&this.raiseRecoverable(this.start,"Escape sequence in keyword "+this.type.keyword),this.options.onToken&&this.options.onToken(new vt(this)),this.lastTokEnd=this.end,this.lastTokStart=this.start,this.lastTokEndLoc=this.endLoc,this.lastTokStartLoc=this.startLoc,this.nextToken();};A.getToken=function(){return this.next(),new vt(this)};typeof Symbol<"u"&&(A[Symbol.iterator]=function(){var e=this;return {next:function(){var t=e.getToken();return {done:t.type===o.eof,value:t}}}});A.nextToken=function(){var e=this.curContext();if((!e||!e.preserveSpace)&&this.skipSpace(),this.start=this.pos,this.options.locations&&(this.startLoc=this.curPosition()),this.pos>=this.input.length)return this.finishToken(o.eof);if(e.override)return e.override(this);this.readToken(this.fullCharCodeAtPos());};A.readToken=function(e){return se(e,this.options.ecmaVersion>=6)||e===92?this.readWord():this.getTokenFromCode(e)};A.fullCharCodeAt=function(e){var t=this.input.charCodeAt(e);if(t<=55295||t>=56320)return t;var i=this.input.charCodeAt(e+1);return i<=56319||i>=57344?t:(t<<10)+i-56613888};A.fullCharCodeAtPos=function(){return this.fullCharCodeAt(this.pos)};A.skipBlockComment=function(){var e=this.options.onComment&&this.curPosition(),t=this.pos,i=this.input.indexOf("*/",this.pos+=2);if(i===-1&&this.raise(this.pos-2,"Unterminated comment"),this.pos=i+2,this.options.locations)for(var r=void 0,s=t;(r=mi(this.input,s,this.pos))>-1;)++this.curLine,s=this.lineStart=r;this.options.onComment&&this.options.onComment(true,this.input.slice(t+2,i),t,this.pos,e,this.curPosition());};A.skipLineComment=function(e){for(var t=this.pos,i=this.options.onComment&&this.curPosition(),r=this.input.charCodeAt(this.pos+=e);this.pos<this.input.length&&!_e(r);)r=this.input.charCodeAt(++this.pos);this.options.onComment&&this.options.onComment(false,this.input.slice(t+e,this.pos),t,this.pos,i,this.curPosition());};A.skipSpace=function(){e:for(;this.pos<this.input.length;){var e=this.input.charCodeAt(this.pos);switch(e){case 32:case 160:++this.pos;break;case 13:this.input.charCodeAt(this.pos+1)===10&&++this.pos;case 10:case 8232:case 8233:++this.pos,this.options.locations&&(++this.curLine,this.lineStart=this.pos);break;case 47:switch(this.input.charCodeAt(this.pos+1)){case 42:this.skipBlockComment();break;case 47:this.skipLineComment(2);break;default:break e}break;default:if(e>8&&e<14||e>=5760&&gi.test(String.fromCharCode(e)))++this.pos;else break e}}};A.finishToken=function(e,t){this.end=this.pos,this.options.locations&&(this.endLoc=this.curPosition());var i=this.type;this.type=e,this.value=t,this.updateContext(i);};A.readToken_dot=function(){var e=this.input.charCodeAt(this.pos+1);if(e>=48&&e<=57)return this.readNumber(true);var t=this.input.charCodeAt(this.pos+2);return this.options.ecmaVersion>=6&&e===46&&t===46?(this.pos+=3,this.finishToken(o.ellipsis)):(++this.pos,this.finishToken(o.dot))};A.readToken_slash=function(){var e=this.input.charCodeAt(this.pos+1);return this.exprAllowed?(++this.pos,this.readRegexp()):e===61?this.finishOp(o.assign,2):this.finishOp(o.slash,1)};A.readToken_mult_modulo_exp=function(e){var t=this.input.charCodeAt(this.pos+1),i=1,r=e===42?o.star:o.modulo;return this.options.ecmaVersion>=7&&e===42&&t===42&&(++i,r=o.starstar,t=this.input.charCodeAt(this.pos+2)),t===61?this.finishOp(o.assign,i+1):this.finishOp(r,i)};A.readToken_pipe_amp=function(e){var t=this.input.charCodeAt(this.pos+1);if(t===e){if(this.options.ecmaVersion>=12){var i=this.input.charCodeAt(this.pos+2);if(i===61)return this.finishOp(o.assign,3)}return this.finishOp(e===124?o.logicalOR:o.logicalAND,2)}return t===61?this.finishOp(o.assign,2):this.finishOp(e===124?o.bitwiseOR:o.bitwiseAND,1)};A.readToken_caret=function(){var e=this.input.charCodeAt(this.pos+1);return e===61?this.finishOp(o.assign,2):this.finishOp(o.bitwiseXOR,1)};A.readToken_plus_min=function(e){var t=this.input.charCodeAt(this.pos+1);return t===e?t===45&&!this.inModule&&this.input.charCodeAt(this.pos+2)===62&&(this.lastTokEnd===0||H.test(this.input.slice(this.lastTokEnd,this.pos)))?(this.skipLineComment(3),this.skipSpace(),this.nextToken()):this.finishOp(o.incDec,2):t===61?this.finishOp(o.assign,2):this.finishOp(o.plusMin,1)};A.readToken_lt_gt=function(e){var t=this.input.charCodeAt(this.pos+1),i=1;return t===e?(i=e===62&&this.input.charCodeAt(this.pos+2)===62?3:2,this.input.charCodeAt(this.pos+i)===61?this.finishOp(o.assign,i+1):this.finishOp(o.bitShift,i)):t===33&&e===60&&!this.inModule&&this.input.charCodeAt(this.pos+2)===45&&this.input.charCodeAt(this.pos+3)===45?(this.skipLineComment(4),this.skipSpace(),this.nextToken()):(t===61&&(i=2),this.finishOp(o.relational,i))};A.readToken_eq_excl=function(e){var t=this.input.charCodeAt(this.pos+1);return t===61?this.finishOp(o.equality,this.input.charCodeAt(this.pos+2)===61?3:2):e===61&&t===62&&this.options.ecmaVersion>=6?(this.pos+=2,this.finishToken(o.arrow)):this.finishOp(e===61?o.eq:o.prefix,1)};A.readToken_question=function(){var e=this.options.ecmaVersion;if(e>=11){var t=this.input.charCodeAt(this.pos+1);if(t===46){var i=this.input.charCodeAt(this.pos+2);if(i<48||i>57)return this.finishOp(o.questionDot,2)}if(t===63){if(e>=12){var r=this.input.charCodeAt(this.pos+2);if(r===61)return this.finishOp(o.assign,3)}return this.finishOp(o.coalesce,2)}}return this.finishOp(o.question,1)};A.readToken_numberSign=function(){var e=this.options.ecmaVersion,t=35;if(e>=13&&(++this.pos,t=this.fullCharCodeAtPos(),se(t,true)||t===92))return this.finishToken(o.privateId,this.readWord1());this.raise(this.pos,"Unexpected character '"+oe(t)+"'");};A.getTokenFromCode=function(e){switch(e){case 46:return this.readToken_dot();case 40:return ++this.pos,this.finishToken(o.parenL);case 41:return ++this.pos,this.finishToken(o.parenR);case 59:return ++this.pos,this.finishToken(o.semi);case 44:return ++this.pos,this.finishToken(o.comma);case 91:return ++this.pos,this.finishToken(o.bracketL);case 93:return ++this.pos,this.finishToken(o.bracketR);case 123:return ++this.pos,this.finishToken(o.braceL);case 125:return ++this.pos,this.finishToken(o.braceR);case 58:return ++this.pos,this.finishToken(o.colon);case 96:if(this.options.ecmaVersion<6)break;return ++this.pos,this.finishToken(o.backQuote);case 48:var t=this.input.charCodeAt(this.pos+1);if(t===120||t===88)return this.readRadixNumber(16);if(this.options.ecmaVersion>=6){if(t===111||t===79)return this.readRadixNumber(8);if(t===98||t===66)return this.readRadixNumber(2)}case 49:case 50:case 51:case 52:case 53:case 54:case 55:case 56:case 57:return this.readNumber(false);case 34:case 39:return this.readString(e);case 47:return this.readToken_slash();case 37:case 42:return this.readToken_mult_modulo_exp(e);case 124:case 38:return this.readToken_pipe_amp(e);case 94:return this.readToken_caret();case 43:case 45:return this.readToken_plus_min(e);case 60:case 62:return this.readToken_lt_gt(e);case 61:case 33:return this.readToken_eq_excl(e);case 63:return this.readToken_question();case 126:return this.finishOp(o.prefix,1);case 35:return this.readToken_numberSign()}this.raise(this.pos,"Unexpected character '"+oe(e)+"'");};A.finishOp=function(e,t){var i=this.input.slice(this.pos,this.pos+t);return this.pos+=t,this.finishToken(e,i)};A.readRegexp=function(){for(var e,t,i=this.pos;;){this.pos>=this.input.length&&this.raise(i,"Unterminated regular expression");var r=this.input.charAt(this.pos);if(H.test(r)&&this.raise(i,"Unterminated regular expression"),e)e=false;else {if(r==="[")t=true;else if(r==="]"&&t)t=false;else if(r==="/"&&!t)break;e=r==="\\";}++this.pos;}var s=this.input.slice(i,this.pos);++this.pos;var n=this.pos,a=this.readWord1();this.containsEsc&&this.unexpected(n);var u=this.regexpState||(this.regexpState=new ne(this));u.reset(i,s,a),this.validateRegExpFlags(u),this.validateRegExpPattern(u);var c=null;try{c=new RegExp(s,a);}catch{}return this.finishToken(o.regexp,{pattern:s,flags:a,value:c})};A.readInt=function(e,t,i){for(var r=this.options.ecmaVersion>=12&&t===void 0,s=i&&this.input.charCodeAt(this.pos)===48,n=this.pos,a=0,u=0,c=0,l=t??1/0;c<l;++c,++this.pos){var p=this.input.charCodeAt(this.pos),y=void 0;if(r&&p===95){s&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed in legacy octal numeric literals"),u===95&&this.raiseRecoverable(this.pos,"Numeric separator must be exactly one underscore"),c===0&&this.raiseRecoverable(this.pos,"Numeric separator is not allowed at the first of digits"),u=p;continue}if(p>=97?y=p-97+10:p>=65?y=p-65+10:p>=48&&p<=57?y=p-48:y=1/0,y>=e)break;u=p,a=a*e+y;}return r&&u===95&&this.raiseRecoverable(this.pos-1,"Numeric separator is not allowed at the last of digits"),this.pos===n||t!=null&&this.pos-n!==t?null:a};function $r(e,t){return t?parseInt(e,8):parseFloat(e.replace(/_/g,""))}function Ki(e){return typeof BigInt!="function"?null:BigInt(e.replace(/_/g,""))}A.readRadixNumber=function(e){var t=this.pos;this.pos+=2;var i=this.readInt(e);return i==null&&this.raise(this.start+2,"Expected number in radix "+e),this.options.ecmaVersion>=11&&this.input.charCodeAt(this.pos)===110?(i=Ki(this.input.slice(t,this.pos)),++this.pos):se(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(o.num,i)};A.readNumber=function(e){var t=this.pos;!e&&this.readInt(10,void 0,true)===null&&this.raise(t,"Invalid number");var i=this.pos-t>=2&&this.input.charCodeAt(t)===48;i&&this.strict&&this.raise(t,"Invalid number");var r=this.input.charCodeAt(this.pos);if(!i&&!e&&this.options.ecmaVersion>=11&&r===110){var s=Ki(this.input.slice(t,this.pos));return ++this.pos,se(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number"),this.finishToken(o.num,s)}i&&/[89]/.test(this.input.slice(t,this.pos))&&(i=false),r===46&&!i&&(++this.pos,this.readInt(10),r=this.input.charCodeAt(this.pos)),(r===69||r===101)&&!i&&(r=this.input.charCodeAt(++this.pos),(r===43||r===45)&&++this.pos,this.readInt(10)===null&&this.raise(t,"Invalid number")),se(this.fullCharCodeAtPos())&&this.raise(this.pos,"Identifier directly after number");var n=$r(this.input.slice(t,this.pos),i);return this.finishToken(o.num,n)};A.readCodePoint=function(){var e=this.input.charCodeAt(this.pos),t;if(e===123){this.options.ecmaVersion<6&&this.unexpected();var i=++this.pos;t=this.readHexChar(this.input.indexOf("}",this.pos)-this.pos),++this.pos,t>1114111&&this.invalidStringToken(i,"Code point out of bounds");}else t=this.readHexChar(4);return t};A.readString=function(e){for(var t="",i=++this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated string constant");var r=this.input.charCodeAt(this.pos);if(r===e)break;r===92?(t+=this.input.slice(i,this.pos),t+=this.readEscapedChar(false),i=this.pos):r===8232||r===8233?(this.options.ecmaVersion<10&&this.raise(this.start,"Unterminated string constant"),++this.pos,this.options.locations&&(this.curLine++,this.lineStart=this.pos)):(_e(r)&&this.raise(this.start,"Unterminated string constant"),++this.pos);}return t+=this.input.slice(i,this.pos++),this.finishToken(o.string,t)};var qi={};A.tryReadTemplateToken=function(){this.inTemplateElement=true;try{this.readTmplToken();}catch(e){if(e===qi)this.readInvalidTemplateToken();else throw e}this.inTemplateElement=false;};A.invalidStringToken=function(e,t){if(this.inTemplateElement&&this.options.ecmaVersion>=9)throw qi;this.raise(e,t);};A.readTmplToken=function(){for(var e="",t=this.pos;;){this.pos>=this.input.length&&this.raise(this.start,"Unterminated template");var i=this.input.charCodeAt(this.pos);if(i===96||i===36&&this.input.charCodeAt(this.pos+1)===123)return this.pos===this.start&&(this.type===o.template||this.type===o.invalidTemplate)?i===36?(this.pos+=2,this.finishToken(o.dollarBraceL)):(++this.pos,this.finishToken(o.backQuote)):(e+=this.input.slice(t,this.pos),this.finishToken(o.template,e));if(i===92)e+=this.input.slice(t,this.pos),e+=this.readEscapedChar(true),t=this.pos;else if(_e(i)){switch(e+=this.input.slice(t,this.pos),++this.pos,i){case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:e+=`
10
10
  `;break;default:e+=String.fromCharCode(i);break}this.options.locations&&(++this.curLine,this.lineStart=this.pos),t=this.pos;}else ++this.pos;}};A.readInvalidTemplateToken=function(){for(;this.pos<this.input.length;this.pos++)switch(this.input[this.pos]){case "\\":++this.pos;break;case "$":if(this.input[this.pos+1]!=="{")break;case "`":return this.finishToken(o.invalidTemplate,this.input.slice(this.start,this.pos));case "\r":this.input[this.pos+1]===`
11
11
  `&&++this.pos;case `
12
12
  `:case "\u2028":case "\u2029":++this.curLine,this.lineStart=this.pos+1;break}this.raise(this.start,"Unterminated template");};A.readEscapedChar=function(e){var t=this.input.charCodeAt(++this.pos);switch(++this.pos,t){case 110:return `
13
- `;case 114:return "\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return oe(this.readCodePoint());case 116:return " ";case 98:return "\b";case 118:return "\v";case 102:return "\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string");}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(r,8);return s>255&&(r=r.slice(0,-1),s=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return Ee(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}};A.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};A.readWord1=function(){this.containsEsc=false;for(var e="",t=true,i=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if(he(s,r))this.pos+=s<=65535?1:2;else if(s===92){this.containsEsc=true,e+=this.input.slice(i,this.pos);var n=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?se:he)(a,r)||this.invalidStringToken(n,"Invalid Unicode escape"),e+=oe(a),i=this.pos;}else break;t=false;}return e+this.input.slice(i,this.pos)};A.readWord=function(){var e=this.readWord1(),t=o.name;return this.keywords.test(e)&&(t=ft[e]),this.finishToken(t,e)};var Hr="8.16.0";O.acorn={Parser:O,version:Hr,defaultOptions:lt,Position:Ie,SourceLocation:ze,getLineInfo:yi,Node:Ze,TokenType:I,tokTypes:o,keywordTypes:ft,TokContext:re,tokContexts:L,isIdentifierChar:he,isIdentifierStart:se,Token:vt,isNewLine:Ee,lineBreak:$,lineBreakG:dr,nonASCIIwhitespace:gi};function bt(e,t){return O.parse(e,t)}function ae(e,t,i,r,s){i||(i=h),(function n(a,u,c){var l=c||a.type;Kr(i,l,a,u,n),t[l]&&t[l](a,u);})(e,r,s);}function St(e,t,i){i(e,t);}function be(e,t,i){}function Kr(e,t,i,r,s){if(e[t]==null)throw new Error("No walker function defined for node type "+t);e[t](i,r,s);}var h={};h.Program=h.BlockStatement=h.StaticBlock=function(e,t,i){for(var r=0,s=e.body;r<s.length;r+=1){var n=s[r];i(n,t,"Statement");}};h.Statement=St;h.EmptyStatement=be;h.ExpressionStatement=h.ParenthesizedExpression=h.ChainExpression=function(e,t,i){return i(e.expression,t,"Expression")};h.IfStatement=function(e,t,i){i(e.test,t,"Expression"),i(e.consequent,t,"Statement"),e.alternate&&i(e.alternate,t,"Statement");};h.LabeledStatement=function(e,t,i){return i(e.body,t,"Statement")};h.BreakStatement=h.ContinueStatement=be;h.WithStatement=function(e,t,i){i(e.object,t,"Expression"),i(e.body,t,"Statement");};h.SwitchStatement=function(e,t,i){i(e.discriminant,t,"Expression");for(var r=0,s=e.cases;r<s.length;r+=1){var n=s[r];i(n,t);}};h.SwitchCase=function(e,t,i){e.test&&i(e.test,t,"Expression");for(var r=0,s=e.consequent;r<s.length;r+=1){var n=s[r];i(n,t,"Statement");}};h.ReturnStatement=h.YieldExpression=h.AwaitExpression=function(e,t,i){e.argument&&i(e.argument,t,"Expression");};h.ThrowStatement=h.SpreadElement=function(e,t,i){return i(e.argument,t,"Expression")};h.TryStatement=function(e,t,i){i(e.block,t,"Statement"),e.handler&&i(e.handler,t),e.finalizer&&i(e.finalizer,t,"Statement");};h.CatchClause=function(e,t,i){e.param&&i(e.param,t,"Pattern"),i(e.body,t,"Statement");};h.WhileStatement=h.DoWhileStatement=function(e,t,i){i(e.test,t,"Expression"),i(e.body,t,"Statement");};h.ForStatement=function(e,t,i){e.init&&i(e.init,t,"ForInit"),e.test&&i(e.test,t,"Expression"),e.update&&i(e.update,t,"Expression"),i(e.body,t,"Statement");};h.ForInStatement=h.ForOfStatement=function(e,t,i){i(e.left,t,"ForInit"),i(e.right,t,"Expression"),i(e.body,t,"Statement");};h.ForInit=function(e,t,i){e.type==="VariableDeclaration"?i(e,t):i(e,t,"Expression");};h.DebuggerStatement=be;h.FunctionDeclaration=function(e,t,i){return i(e,t,"Function")};h.VariableDeclaration=function(e,t,i){for(var r=0,s=e.declarations;r<s.length;r+=1){var n=s[r];i(n,t);}};h.VariableDeclarator=function(e,t,i){i(e.id,t,"Pattern"),e.init&&i(e.init,t,"Expression");};h.Function=function(e,t,i){e.id&&i(e.id,t,"Pattern");for(var r=0,s=e.params;r<s.length;r+=1){var n=s[r];i(n,t,"Pattern");}i(e.body,t,e.expression?"Expression":"Statement");};h.Pattern=function(e,t,i){e.type==="Identifier"?i(e,t,"VariablePattern"):e.type==="MemberExpression"?i(e,t,"MemberPattern"):i(e,t);};h.VariablePattern=be;h.MemberPattern=St;h.RestElement=function(e,t,i){return i(e.argument,t,"Pattern")};h.ArrayPattern=function(e,t,i){for(var r=0,s=e.elements;r<s.length;r+=1){var n=s[r];n&&i(n,t,"Pattern");}};h.ObjectPattern=function(e,t,i){for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];n.type==="Property"?(n.computed&&i(n.key,t,"Expression"),i(n.value,t,"Pattern")):n.type==="RestElement"&&i(n.argument,t,"Pattern");}};h.Expression=St;h.ThisExpression=h.Super=h.MetaProperty=be;h.ArrayExpression=function(e,t,i){for(var r=0,s=e.elements;r<s.length;r+=1){var n=s[r];n&&i(n,t,"Expression");}};h.ObjectExpression=function(e,t,i){for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];i(n,t);}};h.FunctionExpression=h.ArrowFunctionExpression=h.FunctionDeclaration;h.SequenceExpression=function(e,t,i){for(var r=0,s=e.expressions;r<s.length;r+=1){var n=s[r];i(n,t,"Expression");}};h.TemplateLiteral=function(e,t,i){for(var r=0,s=e.quasis;r<s.length;r+=1){var n=s[r];i(n,t);}for(var a=0,u=e.expressions;a<u.length;a+=1){var c=u[a];i(c,t,"Expression");}};h.TemplateElement=be;h.UnaryExpression=h.UpdateExpression=function(e,t,i){i(e.argument,t,"Expression");};h.BinaryExpression=h.LogicalExpression=function(e,t,i){i(e.left,t,"Expression"),i(e.right,t,"Expression");};h.AssignmentExpression=h.AssignmentPattern=function(e,t,i){i(e.left,t,"Pattern"),i(e.right,t,"Expression");};h.ConditionalExpression=function(e,t,i){i(e.test,t,"Expression"),i(e.consequent,t,"Expression"),i(e.alternate,t,"Expression");};h.NewExpression=h.CallExpression=function(e,t,i){if(i(e.callee,t,"Expression"),e.arguments)for(var r=0,s=e.arguments;r<s.length;r+=1){var n=s[r];i(n,t,"Expression");}};h.MemberExpression=function(e,t,i){i(e.object,t,"Expression"),e.computed&&i(e.property,t,"Expression");};h.ExportNamedDeclaration=h.ExportDefaultDeclaration=function(e,t,i){if(e.declaration&&i(e.declaration,t,e.type==="ExportNamedDeclaration"||e.declaration.id?"Statement":"Expression"),e.source&&i(e.source,t,"Expression"),e.attributes)for(var r=0,s=e.attributes;r<s.length;r+=1){var n=s[r];i(n,t);}};h.ExportAllDeclaration=function(e,t,i){if(e.exported&&i(e.exported,t),i(e.source,t,"Expression"),e.attributes)for(var r=0,s=e.attributes;r<s.length;r+=1){var n=s[r];i(n,t);}};h.ImportAttribute=function(e,t,i){i(e.value,t,"Expression");};h.ImportDeclaration=function(e,t,i){for(var r=0,s=e.specifiers;r<s.length;r+=1){var n=s[r];i(n,t);}if(i(e.source,t,"Expression"),e.attributes)for(var a=0,u=e.attributes;a<u.length;a+=1){var c=u[a];i(c,t);}};h.ImportExpression=function(e,t,i){i(e.source,t,"Expression"),e.options&&i(e.options,t,"Expression");};h.ImportSpecifier=h.ImportDefaultSpecifier=h.ImportNamespaceSpecifier=h.Identifier=h.PrivateIdentifier=h.Literal=be;h.TaggedTemplateExpression=function(e,t,i){i(e.tag,t,"Expression"),i(e.quasi,t,"Expression");};h.ClassDeclaration=h.ClassExpression=function(e,t,i){return i(e,t,"Class")};h.Class=function(e,t,i){e.id&&i(e.id,t,"Pattern"),e.superClass&&i(e.superClass,t,"Expression"),i(e.body,t);};h.ClassBody=function(e,t,i){for(var r=0,s=e.body;r<s.length;r+=1){var n=s[r];i(n,t);}};h.MethodDefinition=h.PropertyDefinition=h.Property=function(e,t,i){e.computed&&i(e.key,t,"Expression"),e.value&&i(e.value,t,"Expression");};var Ge=class e{piiFields;sensitiveKeys;static TAINT_PROPAGATING_METHODS=new Set(["charCodeAt","codePointAt","charAt","at","indexOf","lastIndexOf","search","localeCompare","startsWith","endsWith","includes","substring","slice","substr","split","match","matchAll","replace","replaceAll","normalize","toLowerCase","toUpperCase","trim","trimStart","trimEnd","padStart","padEnd","repeat"]);static ARRAY_CALLBACK_METHODS=new Set(["map","forEach","filter","find","some","every","flatMap","findIndex"]);static REDUCE_METHODS=new Set(["reduce","reduceRight"]);constructor(t,i=[]){this.piiFields=new Set(t.map(r=>r.toLowerCase())),this.sensitiveKeys=new Set(i.map(r=>r.toLowerCase()));}classifyField(t,i=[]){let r=t.toLowerCase();if(this.piiFields.has(r))return "forbidden";let s=new Set(i.map(n=>n.toLowerCase()));return this.sensitiveKeys.has(r)||s.has(r)?"sensitive":"public"}analyze(t,i,r=50){let s;try{let c=`function liop_analysis_wrapper(env) {
13
+ `;case 114:return "\r";case 120:return String.fromCharCode(this.readHexChar(2));case 117:return oe(this.readCodePoint());case 116:return " ";case 98:return "\b";case 118:return "\v";case 102:return "\f";case 13:this.input.charCodeAt(this.pos)===10&&++this.pos;case 10:return this.options.locations&&(this.lineStart=this.pos,++this.curLine),"";case 56:case 57:if(this.strict&&this.invalidStringToken(this.pos-1,"Invalid escape sequence"),e){var i=this.pos-1;this.invalidStringToken(i,"Invalid escape sequence in template string");}default:if(t>=48&&t<=55){var r=this.input.substr(this.pos-1,3).match(/^[0-7]+/)[0],s=parseInt(r,8);return s>255&&(r=r.slice(0,-1),s=parseInt(r,8)),this.pos+=r.length-1,t=this.input.charCodeAt(this.pos),(r!=="0"||t===56||t===57)&&(this.strict||e)&&this.invalidStringToken(this.pos-1-r.length,e?"Octal literal in template string":"Octal literal in strict mode"),String.fromCharCode(s)}return _e(t)?(this.options.locations&&(this.lineStart=this.pos,++this.curLine),""):String.fromCharCode(t)}};A.readHexChar=function(e){var t=this.pos,i=this.readInt(16,e);return i===null&&this.invalidStringToken(t,"Bad character escape sequence"),i};A.readWord1=function(){this.containsEsc=false;for(var e="",t=true,i=this.pos,r=this.options.ecmaVersion>=6;this.pos<this.input.length;){var s=this.fullCharCodeAtPos();if(fe(s,r))this.pos+=s<=65535?1:2;else if(s===92){this.containsEsc=true,e+=this.input.slice(i,this.pos);var n=this.pos;this.input.charCodeAt(++this.pos)!==117&&this.invalidStringToken(this.pos,"Expecting Unicode escape sequence \\uXXXX"),++this.pos;var a=this.readCodePoint();(t?se:fe)(a,r)||this.invalidStringToken(n,"Invalid Unicode escape"),e+=oe(a),i=this.pos;}else break;t=false;}return e+this.input.slice(i,this.pos)};A.readWord=function(){var e=this.readWord1(),t=o.name;return this.keywords.test(e)&&(t=ft[e]),this.finishToken(t,e)};var Hr="8.16.0";F.acorn={Parser:F,version:Hr,defaultOptions:lt,Position:Ie,SourceLocation:ze,getLineInfo:xi,Node:Ze,TokenType:I,tokTypes:o,keywordTypes:ft,TokContext:re,tokContexts:O,isIdentifierChar:fe,isIdentifierStart:se,Token:vt,isNewLine:_e,lineBreak:H,lineBreakG:dr,nonASCIIwhitespace:gi};function bt(e,t){return F.parse(e,t)}function ae(e,t,i,r,s){i||(i=h),(function n(a,u,c){var l=c||a.type;Kr(i,l,a,u,n),t[l]&&t[l](a,u);})(e,r,s);}function St(e,t,i){i(e,t);}function Se(e,t,i){}function Kr(e,t,i,r,s){if(e[t]==null)throw new Error("No walker function defined for node type "+t);e[t](i,r,s);}var h={};h.Program=h.BlockStatement=h.StaticBlock=function(e,t,i){for(var r=0,s=e.body;r<s.length;r+=1){var n=s[r];i(n,t,"Statement");}};h.Statement=St;h.EmptyStatement=Se;h.ExpressionStatement=h.ParenthesizedExpression=h.ChainExpression=function(e,t,i){return i(e.expression,t,"Expression")};h.IfStatement=function(e,t,i){i(e.test,t,"Expression"),i(e.consequent,t,"Statement"),e.alternate&&i(e.alternate,t,"Statement");};h.LabeledStatement=function(e,t,i){return i(e.body,t,"Statement")};h.BreakStatement=h.ContinueStatement=Se;h.WithStatement=function(e,t,i){i(e.object,t,"Expression"),i(e.body,t,"Statement");};h.SwitchStatement=function(e,t,i){i(e.discriminant,t,"Expression");for(var r=0,s=e.cases;r<s.length;r+=1){var n=s[r];i(n,t);}};h.SwitchCase=function(e,t,i){e.test&&i(e.test,t,"Expression");for(var r=0,s=e.consequent;r<s.length;r+=1){var n=s[r];i(n,t,"Statement");}};h.ReturnStatement=h.YieldExpression=h.AwaitExpression=function(e,t,i){e.argument&&i(e.argument,t,"Expression");};h.ThrowStatement=h.SpreadElement=function(e,t,i){return i(e.argument,t,"Expression")};h.TryStatement=function(e,t,i){i(e.block,t,"Statement"),e.handler&&i(e.handler,t),e.finalizer&&i(e.finalizer,t,"Statement");};h.CatchClause=function(e,t,i){e.param&&i(e.param,t,"Pattern"),i(e.body,t,"Statement");};h.WhileStatement=h.DoWhileStatement=function(e,t,i){i(e.test,t,"Expression"),i(e.body,t,"Statement");};h.ForStatement=function(e,t,i){e.init&&i(e.init,t,"ForInit"),e.test&&i(e.test,t,"Expression"),e.update&&i(e.update,t,"Expression"),i(e.body,t,"Statement");};h.ForInStatement=h.ForOfStatement=function(e,t,i){i(e.left,t,"ForInit"),i(e.right,t,"Expression"),i(e.body,t,"Statement");};h.ForInit=function(e,t,i){e.type==="VariableDeclaration"?i(e,t):i(e,t,"Expression");};h.DebuggerStatement=Se;h.FunctionDeclaration=function(e,t,i){return i(e,t,"Function")};h.VariableDeclaration=function(e,t,i){for(var r=0,s=e.declarations;r<s.length;r+=1){var n=s[r];i(n,t);}};h.VariableDeclarator=function(e,t,i){i(e.id,t,"Pattern"),e.init&&i(e.init,t,"Expression");};h.Function=function(e,t,i){e.id&&i(e.id,t,"Pattern");for(var r=0,s=e.params;r<s.length;r+=1){var n=s[r];i(n,t,"Pattern");}i(e.body,t,e.expression?"Expression":"Statement");};h.Pattern=function(e,t,i){e.type==="Identifier"?i(e,t,"VariablePattern"):e.type==="MemberExpression"?i(e,t,"MemberPattern"):i(e,t);};h.VariablePattern=Se;h.MemberPattern=St;h.RestElement=function(e,t,i){return i(e.argument,t,"Pattern")};h.ArrayPattern=function(e,t,i){for(var r=0,s=e.elements;r<s.length;r+=1){var n=s[r];n&&i(n,t,"Pattern");}};h.ObjectPattern=function(e,t,i){for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];n.type==="Property"?(n.computed&&i(n.key,t,"Expression"),i(n.value,t,"Pattern")):n.type==="RestElement"&&i(n.argument,t,"Pattern");}};h.Expression=St;h.ThisExpression=h.Super=h.MetaProperty=Se;h.ArrayExpression=function(e,t,i){for(var r=0,s=e.elements;r<s.length;r+=1){var n=s[r];n&&i(n,t,"Expression");}};h.ObjectExpression=function(e,t,i){for(var r=0,s=e.properties;r<s.length;r+=1){var n=s[r];i(n,t);}};h.FunctionExpression=h.ArrowFunctionExpression=h.FunctionDeclaration;h.SequenceExpression=function(e,t,i){for(var r=0,s=e.expressions;r<s.length;r+=1){var n=s[r];i(n,t,"Expression");}};h.TemplateLiteral=function(e,t,i){for(var r=0,s=e.quasis;r<s.length;r+=1){var n=s[r];i(n,t);}for(var a=0,u=e.expressions;a<u.length;a+=1){var c=u[a];i(c,t,"Expression");}};h.TemplateElement=Se;h.UnaryExpression=h.UpdateExpression=function(e,t,i){i(e.argument,t,"Expression");};h.BinaryExpression=h.LogicalExpression=function(e,t,i){i(e.left,t,"Expression"),i(e.right,t,"Expression");};h.AssignmentExpression=h.AssignmentPattern=function(e,t,i){i(e.left,t,"Pattern"),i(e.right,t,"Expression");};h.ConditionalExpression=function(e,t,i){i(e.test,t,"Expression"),i(e.consequent,t,"Expression"),i(e.alternate,t,"Expression");};h.NewExpression=h.CallExpression=function(e,t,i){if(i(e.callee,t,"Expression"),e.arguments)for(var r=0,s=e.arguments;r<s.length;r+=1){var n=s[r];i(n,t,"Expression");}};h.MemberExpression=function(e,t,i){i(e.object,t,"Expression"),e.computed&&i(e.property,t,"Expression");};h.ExportNamedDeclaration=h.ExportDefaultDeclaration=function(e,t,i){if(e.declaration&&i(e.declaration,t,e.type==="ExportNamedDeclaration"||e.declaration.id?"Statement":"Expression"),e.source&&i(e.source,t,"Expression"),e.attributes)for(var r=0,s=e.attributes;r<s.length;r+=1){var n=s[r];i(n,t);}};h.ExportAllDeclaration=function(e,t,i){if(e.exported&&i(e.exported,t),i(e.source,t,"Expression"),e.attributes)for(var r=0,s=e.attributes;r<s.length;r+=1){var n=s[r];i(n,t);}};h.ImportAttribute=function(e,t,i){i(e.value,t,"Expression");};h.ImportDeclaration=function(e,t,i){for(var r=0,s=e.specifiers;r<s.length;r+=1){var n=s[r];i(n,t);}if(i(e.source,t,"Expression"),e.attributes)for(var a=0,u=e.attributes;a<u.length;a+=1){var c=u[a];i(c,t);}};h.ImportExpression=function(e,t,i){i(e.source,t,"Expression"),e.options&&i(e.options,t,"Expression");};h.ImportSpecifier=h.ImportDefaultSpecifier=h.ImportNamespaceSpecifier=h.Identifier=h.PrivateIdentifier=h.Literal=Se;h.TaggedTemplateExpression=function(e,t,i){i(e.tag,t,"Expression"),i(e.quasi,t,"Expression");};h.ClassDeclaration=h.ClassExpression=function(e,t,i){return i(e,t,"Class")};h.Class=function(e,t,i){e.id&&i(e.id,t,"Pattern"),e.superClass&&i(e.superClass,t,"Expression"),i(e.body,t);};h.ClassBody=function(e,t,i){for(var r=0,s=e.body;r<s.length;r+=1){var n=s[r];i(n,t);}};h.MethodDefinition=h.PropertyDefinition=h.Property=function(e,t,i){e.computed&&i(e.key,t,"Expression"),e.value&&i(e.value,t,"Expression");};var qe=class e{piiFields;sensitiveKeys;static TAINT_PROPAGATING_METHODS=new Set(["charCodeAt","codePointAt","charAt","at","indexOf","lastIndexOf","search","localeCompare","startsWith","endsWith","includes","substring","slice","substr","split","match","matchAll","replace","replaceAll","normalize","toLowerCase","toUpperCase","trim","trimStart","trimEnd","padStart","padEnd","repeat"]);static ARRAY_CALLBACK_METHODS=new Set(["map","forEach","filter","find","some","every","flatMap","findIndex"]);static REDUCE_METHODS=new Set(["reduce","reduceRight"]);constructor(t,i=[]){this.piiFields=new Set(t.map(r=>r.toLowerCase())),this.sensitiveKeys=new Set(i.map(r=>r.toLowerCase()));}classifyField(t,i=[]){let r=t.toLowerCase();if(this.piiFields.has(r))return "forbidden";let s=new Set(i.map(n=>n.toLowerCase()));return this.sensitiveKeys.has(r)||s.has(r)?"sensitive":"public"}analyze(t,i,r=50){let s;try{let c=`function liop_analysis_wrapper(env) {
14
14
  ${t}
15
15
  }`;s=bt(c,{ecmaVersion:2022,sourceType:"script",locations:!0});}catch{return null}let n=new Set,a=new Set;this.identifyRecordBoundVars(s,n),this.propagateTaint(s,n,a);let u=this.checkReturnStatements(s,n,a);if(u)return u;if(i!==void 0&&i>0&&i<r){let c=this.detectCorrelatedAggregations(s);if(c)return c.reason=c.reason.replace("50 records",`${r} records`),c}if(i!==void 0&&i>0&&i<r){let c=this.detectMinMaxExtraction(s);if(c)return c.reason=c.reason.replace("50 records",`${r} records`),c}return null}extractQueriedFields(t){let i;try{i=bt(`function w(env) {
16
16
  ${t}
17
- }`,{ecmaVersion:2022,sourceType:"script"});}catch{return []}let r=new Set;this.identifyRecordBoundVars(i,r);let s=new Set;return ae(i,{MemberExpression:a=>{let u=this.getPropertyName(a);if(!(!u||u==="length")&&(a.object.type==="Identifier"&&r.has(a.object.name)&&s.add(u),a.object.type==="MemberExpression")){let c=a.object;c.computed&&this.isEnvRecordsAccess(c.object)&&s.add(u);}}}),Array.from(s)}detectCorrelatedAggregations(t){let i=new Map;ae(t,{CallExpression:s=>{if(s.callee.type!=="MemberExpression")return;let n=s.callee,a=this.getPropertyName(n);if(!a||!e.REDUCE_METHODS.has(a)||!this.isEnvRecordsChain(n.object))return;let u=s.arguments[0];if(!u||u.type!=="ArrowFunctionExpression"&&u.type!=="FunctionExpression")return;let c=u,l=c.params.length>1?c.params[1]:c.params[0];if(!l||l.type!=="Identifier")return;let p=l.name,x=this.extractFieldsFromBody(c.body,p);for(let d of x){let k=i.get(d)??0;i.set(d,k+1);}}});for(let[s,n]of i)if(n>=2)return {reason:`Correlation guard: ${n} aggregations detected on field '${s}'. Multiple correlated aggregations on the same field can enable differencing attacks. Use a single aggregation per numeric field, or increase dataset size above 50 records.`};return null}isEnvRecordsChain(t){if(this.isEnvRecordsAccess(t))return true;if(t.type==="CallExpression"){let i=t;if(i.callee.type==="MemberExpression"){let r=i.callee,s=this.getPropertyName(r);if(s&&(s==="slice"||s==="filter"||s==="toSorted"))return this.isEnvRecordsChain(r.object)}}return false}extractFieldsFromBody(t,i){let r=[];return ae(t,{MemberExpression:n=>{if(n.object.type==="Identifier"&&n.object.name===i){let a=this.getPropertyName(n);a&&a!=="length"&&r.push(a);}}}),r}detectMinMaxExtraction(t){let i=null;return ae(t,{CallExpression:s=>{if(!i&&s.callee.type==="MemberExpression"){let n=s.callee;if(n.object.type==="Identifier"&&n.object.name==="Math"){let a=this.getPropertyName(n);(a==="min"||a==="max")&&s.arguments.some(u=>u.type==="SpreadElement"&&this.isRecordsMapCall(u.argument))&&(i={reason:`Min/Max gate: Math.${a}() on individual records blocked for small datasets (n < 50). Use avg/stddev/count for privacy-safe aggregations.`});}}},MemberExpression:s=>{if(!i&&s.computed&&s.object.type==="CallExpression"){let n=s.object;if(n.callee.type==="MemberExpression"){let a=this.getPropertyName(n.callee);if(a==="sort"||a==="toSorted"){let u=n.callee.object;this.isEnvRecordsChain(u)&&(i={reason:"Min/Max gate: .sort()[index] on individual records blocked for small datasets (n < 50). Use avg/stddev/count for privacy-safe aggregations."});}}}}}),i}isRecordsMapCall(t){if(t.type!=="CallExpression")return false;let i=t;if(i.callee.type!=="MemberExpression")return false;let r=i.callee;return this.getPropertyName(r)==="map"&&this.isEnvRecordsChain(r.object)}identifyRecordBoundVars(t,i){ae(t,{CallExpression:n=>{if(n.callee.type!=="MemberExpression")return;let a=n.callee,u=this.getPropertyName(a);if(!u||!this.isEnvRecordsAccess(a.object))return;let c=n.arguments[0];if(c&&(c.type==="ArrowFunctionExpression"||c.type==="FunctionExpression")){let l=c;if(e.ARRAY_CALLBACK_METHODS.has(u)&&l.params.length>0){let p=l.params[0];p.type==="Identifier"&&i.add(p.name);}if(e.REDUCE_METHODS.has(u)&&l.params.length>1){let p=l.params[1];p.type==="Identifier"&&i.add(p.name);}}},ForOfStatement:n=>{if(this.isEnvRecordsAccess(n.right)&&n.left.type==="VariableDeclaration")for(let a of n.left.declarations)a.id.type==="Identifier"&&i.add(a.id.name);}}),ae(t,{VariableDeclarator:n=>{if(!(!n.init||n.id.type!=="Identifier")&&n.init.type==="MemberExpression"&&n.init.computed){let a=n.init;this.isEnvRecordsAccess(a.object)&&i.add(n.id.name);}}});}propagateTaint(t,i,r){for(let s=0;s<3;s++){let n=r.size;if(ae(t,{VariableDeclarator:u=>{!u.init||u.id.type!=="Identifier"||this.isExpressionTainted(u.init,i,r)&&r.add(u.id.name);},AssignmentExpression:u=>{u.left.type==="Identifier"&&this.isExpressionTainted(u.right,i,r)&&r.add(u.left.name);},FunctionDeclaration:u=>{u.id&&u.id.type==="Identifier"&&this.doesCallbackProduceTaint(u,null,i,r)&&r.add(u.id.name);},CallExpression:u=>{if(u.callee.type!=="MemberExpression")return;let c=u.callee;this.getPropertyName(c)==="push"&&c.object.type==="Identifier"&&u.arguments.some(p=>this.isExpressionTainted(p,i,r))&&r.add(c.object.name);}}),r.size===n)break}}checkReturnStatements(t,i,r){let s=null;return ae(t,{ReturnStatement:a=>{if(!s&&a.argument&&this.isExpressionTainted(a.argument,i,r)){let u=a.loc?.start.line?a.loc.start.line-1:void 0,c=this.describeTaintSource(a.argument,i,r);s={reason:`PII side-channel detected: output contains values derived from restricted fields. ${c?`Operation: ${c}. `:""}Use only non-PII fields (e.g., numeric/date columns) for aggregations.`,line:u,operation:c};}}}),s}isExpressionTainted(t,i,r){switch(t.type){case "Identifier":return r.has(t.name);case "MemberExpression":return this.isMemberExprTainted(t,i,r);case "CallExpression":return this.isCallExprTainted(t,i,r);case "YieldExpression":{let s=t;return s.argument?this.isExpressionTainted(s.argument,i,r):false}case "FunctionExpression":case "ArrowFunctionExpression":{let s=t;return this.doesCallbackProduceTaint(s,null,i,r)}case "BinaryExpression":case "LogicalExpression":{let s=t;return this.isExpressionTainted(s.left,i,r)||this.isExpressionTainted(s.right,i,r)}case "UnaryExpression":{let s=t;return this.isExpressionTainted(s.argument,i,r)}case "ConditionalExpression":{let s=t;return this.isExpressionTainted(s.test,i,r)||this.isExpressionTainted(s.consequent,i,r)||this.isExpressionTainted(s.alternate,i,r)}case "ObjectExpression":return t.properties.some(n=>n.type==="Property"&&this.isExpressionTainted(n.value,i,r));case "ArrayExpression":return t.elements.some(n=>n!==null&&this.isExpressionTainted(n,i,r));case "TemplateLiteral":return t.expressions.some(n=>this.isExpressionTainted(n,i,r));case "SpreadElement":{let s=t;return this.isExpressionTainted(s.argument,i,r)}default:return false}}isMemberExprTainted(t,i,r){let s=this.getPropertyName(t);if(t.object.type==="Identifier"&&i.has(t.object.name)&&s&&this.piiFields.has(s.toLowerCase()))return true;if(t.object.type==="MemberExpression"&&s&&this.piiFields.has(s.toLowerCase())){let n=t.object;if(n.computed&&this.isEnvRecordsAccess(n.object))return true}if(this.isExpressionTainted(t.object,i,r))return true;if(t.computed&&t.object.type==="Identifier"&&i.has(t.object.name)&&t.property.type==="Literal"){let n=t.property.value;if(typeof n=="string"&&this.piiFields.has(n.toLowerCase()))return true}return false}isCallExprTainted(t,i,r){if(t.callee.type==="MemberExpression"){let s=t.callee,n=this.getPropertyName(s);if(n&&e.TAINT_PROPAGATING_METHODS.has(n)&&this.isExpressionTainted(s.object,i,r))return true;if(this.isEnvRecordsAccess(s.object)&&t.arguments[0]){let a=t.arguments[0];if(a.type==="ArrowFunctionExpression"||a.type==="FunctionExpression")return this.doesCallbackProduceTaint(a,n,i,r)}if(this.isExpressionTainted(s.object,i,r)||t.arguments.some(a=>this.isExpressionTainted(a,i,r)))return true}if(t.callee.type==="MemberExpression"){let s=t.callee;this.getPropertyName(s)==="push"&&s.object.type==="Identifier"&&t.arguments.some(a=>this.isExpressionTainted(a,i,r))&&r.add(s.object.name);}if(t.callee.type==="Identifier"){let s=t.callee.name;if(r.has(s))return true;if(!new Set(["Math","Number","parseInt","parseFloat","isNaN","isFinite"]).has(s))return t.arguments.some(a=>this.isExpressionTainted(a,i,r))}return false}doesCallbackProduceTaint(t,i,r,s){let n=new Set(r),a=new Set(s);if(t.params.length>0){let p=i!==null&&e.REDUCE_METHODS.has(i)?1:0;t.params.length>p&&t.params[p].type==="Identifier"&&n.add(t.params[p].name);}if(t.type==="ArrowFunctionExpression"&&t.body.type!=="BlockStatement")return this.isExpressionTainted(t.body,n,a);let u=false,c={ReturnStatement:l=>{l.argument&&this.isExpressionTainted(l.argument,n,a)&&(u=true);},YieldExpression:l=>{let p=l;p.argument&&this.isExpressionTainted(p.argument,n,a)&&(u=true);}};return ae(t.body,c),u}getPropertyName(t){if(!t.computed&&t.property.type==="Identifier")return t.property.name;if(t.computed&&t.property.type==="Literal"){let i=t.property.value;if(typeof i=="string")return i}return null}isEnvRecordsAccess(t){if(t.type==="MemberExpression"){let i=t;if(this.getPropertyName(i)==="records"&&i.object.type==="Identifier"&&i.object.name==="env")return true}return t.type==="Identifier"&&t.name==="records"}describeTaintSource(t,i,r){if(t.type==="Identifier"){let s=t.name;if(r.has(s))return `variable '${s}' is PII-derived`}if(t.type==="ObjectExpression"){let s=t;for(let n of s.properties)if(n.type==="Property"&&this.isExpressionTainted(n.value,i,r))return `property '${n.key.type==="Identifier"?n.key.name:"unknown"}' contains PII-derived value`}if(t.type==="CallExpression"){let s=t;if(s.callee.type==="MemberExpression"){let n=this.getPropertyName(s.callee);if(n)return `result of .${n}() on PII data`}}}};var Gr={aspirin:"Medication",lisinopril:"Medication",metformin:"Medication",amlodipine:"Medication",atorvastatin:"Medication",omeprazole:"Medication",losartan:"Medication",simvastatin:"Medication",levothyroxine:"Medication",ibuprofen:"Medication",acetaminophen:"Medication",amoxicillin:"Medication",ciprofloxacin:"Medication",prednisone:"Medication",warfarin:"Medication",insulin:"Medication",hydrochlorothiazide:"Medication",gabapentin:"Medication",albuterol:"Medication",pantoprazole:"Medication",hypertension:"Condition",diabetes:"Condition",bronchitis:"Condition",pneumonia:"Condition",asthma:"Condition"},qe=4,qr=/^[\d\s.,:;!?()[\]{}<>@#$%^&*+=|\\/"'`~_-]+$/,Je=class e{static nlp=null;async getNlp(){if(!e.nlp){let t=await import('compromise/three');e.nlp=t.default||t,e.nlp.addWords(Gr);}return e.nlp}async scan(t){if(t.length<qe||qr.test(t))return {detected:false,entities:[]};let r=(await this.getNlp())(t),s=[],n=r.people().out("array");for(let c of n){let l=c.trim();l.length>=qe&&s.push({type:"person",text:l});}let a=r.places().out("array");for(let c of a){let l=c.trim();l.length>=qe&&s.push({type:"place",text:l});}let u=r.organizations().out("array");for(let c of u){let l=c.trim();l.length>=qe&&s.push({type:"organization",text:l});}return {detected:s.length>0,entities:s}}async scanDeep(t,i=new WeakSet){if(t==null)return {detected:false,entities:[]};if(typeof t=="string")return this.scan(t);if(typeof t=="object"){if(i.has(t))return {detected:false,entities:[]};i.add(t);let r=Array.isArray(t)?t:Object.values(t),s=[];for(let n of r){let a=await this.scanDeep(n,i);if(a.detected&&(s.push(...a.entities),a.entities.some(u=>u.type==="person")))return {detected:true,entities:s}}return {detected:s.length>0,entities:s}}return {detected:false,entities:[]}}};var Jr={maxDecimalPlaces:4,clampNonNegative:true};function Ye(e,t){let i={...Jr,...t},r=new WeakSet;function s(n){if(n==null)return n;if(typeof n=="number"){if(!Number.isFinite(n))return n;let a=n;i.clampNonNegative&&a<0&&(a=0);let u=10**i.maxDecimalPlaces;return a=Math.round(a*u)/u,a}if(typeof n=="string"||typeof n=="boolean")return n;if(typeof n=="object"){if(r.has(n))return n;if(r.add(n),Array.isArray(n))return n.map(u=>s(u));let a={};for(let[u,c]of Object.entries(n))a[u]=s(c);return a}return n}return s(e)}function Yr(e){let t=e.replace(/\D/g,"");if(t.length<13||t.length>19)return false;let i=0,r=false;for(let s=t.length-1;s>=0;s--){let n=parseInt(t.charAt(s),10);r&&(n*=2,n>9&&(n-=9)),i+=n,r=!r;}return i%10===0}function Qr(e){let t=e.replace(/\s+/g,"").toUpperCase();if(!/^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$/.test(t))return false;let i=t.substring(4)+t.substring(0,4),r="";for(let s=0;s<i.length;s++){let n=i.charCodeAt(s);if(n>=65&&n<=90)r+=(n-55).toString();else if(n>=48&&n<=57)r+=i.charAt(s);else return false}try{return BigInt(r)%97n===1n}catch{return false}}var D={EMAIL:{name:"EMAIL",pattern:/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/gi,validator:e=>!e.endsWith("@example.com")&&!e.endsWith("@test.com")},CREDIT_CARD:{name:"CREDIT_CARD",pattern:/\b(?:\d[ -]*?){13,16}\b/g,validator:Yr},IP_ADDRESS:{name:"IP_ADDRESS",pattern:/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g,validator:e=>["127.0.0.1","0.0.0.0","255.255.255.255"].includes(e)?false:e.split(".").map(Number).every(r=>r>=0&&r<=255)},PHONE:{name:"PHONE",pattern:/(?:(?:\+?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})\b/g,validator:e=>{let t=e.replace(/\D/g,"");return !(t.length<7||t.length>15||/^(\d)\1+$/.test(t)||t==="1234567890")}},SSN:{name:"SSN",pattern:/\b\d{3}[- ]?\d{2}[- ]?\d{4}\b/g,validator:e=>{let t=e.replace(/\D/g,"");if(t.length!==9)return false;let i=parseInt(t.substring(0,3),10);return !(i===0||i===666||i>=900||parseInt(t.substring(3,5),10)===0||parseInt(t.substring(5,9),10)===0||/^(\d)\1+$/.test(t)||t==="123456789")}},IBAN:{name:"IBAN",pattern:/\b[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}\b/gi,validator:Qr},PASSPORT_MRZ:{name:"PASSPORT_MRZ",pattern:/\bP[A-Z<][A-Z<]{3}[A-Z0-9<]{39}(?:\b|\s|$)/g}},qi={GLOBAL_STRICT:[D.EMAIL,D.CREDIT_CARD,D.IP_ADDRESS,D.PHONE,D.PASSPORT_MRZ,D.IBAN],US_COMPLIANT:[D.EMAIL,D.CREDIT_CARD,D.IP_ADDRESS,D.PHONE,D.SSN,D.PASSPORT_MRZ],EU_GDPR:[D.EMAIL,D.CREDIT_CARD,D.IP_ADDRESS,D.PHONE,D.IBAN,D.PASSPORT_MRZ]},Qe=class e{patterns;forbiddenKeysSet;nerScanner;static KEY_SAFELIST=new Set(["grid","video","android","identity","provide","override","validate","hidden","widget","guidelines","beside","guideline","outside","inside","collide","decide","divide","aside","ride","side","wide","hide","tide","pride","bride","slide","guide","stride","oxide","dioxide","suicide","homicide","pesticide","valid","invalid","void","avoid","diagnosis","medication","namespace","namesake","rename","filename","hostname","typename","unnamed","renamed","phonetic","phoneme","microphone","headphone","telephone","saxophone","smartphone","streetview","addressable","addressing","cityscape","electricity","capacity","velocity","opacity","timestamp","timezone","image_id","computation_result","zk_receipt","testid","toolid","sessionid","peerid","nodeid","requestid","correlationid","traceid","spanid"]);shortTokenBoundaryPatterns;longForbiddenTokens;constructor(t=[],i=[],r){this.patterns=t,this.forbiddenKeysSet=new Set(i.map(s=>s.toLowerCase())),this.nerScanner=r??null,this.shortTokenBoundaryPatterns=new Map,this.longForbiddenTokens=[];for(let s of this.forbiddenKeysSet)s.length<4?this.shortTokenBoundaryPatterns.set(s,new RegExp((()=>{let n=s.split("").map(u=>`[${u.toLowerCase()}${u.toUpperCase()}]`).join(""),a=`[a-z]${s.charAt(0).toUpperCase()}${s.slice(1)}`;return `(?:^|[_-])${n}(?:$|[_-])|${a}(?:$|[A-Z_-])|^${n}$`})())):this.longForbiddenTokens.push(s);}async scan(t,i=new WeakSet){if(t==null)return null;if(typeof t=="string"){let r=t.trim();if(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]"))try{let n=JSON.parse(r),a=await this.scan(n,i);if(a)return a}catch{}let s=this.checkString(t);if(s)return s;if(this.nerScanner){let n=await this.nerScanner.scan(t);if(n.detected){let a=n.entities.find(u=>u.type==="person");if(a)return `PII Entity Detected: person name "${a.text}"`}}return null}if(typeof t=="object"){if(i.has(t))return null;if(i.add(t),Array.isArray(t))for(let r of t){let s=await this.scan(r,i);if(s)return s}else for(let[r,s]of Object.entries(t)){if(this.forbiddenKeysSet.has(r.toLowerCase()))return `Forbidden Key: ${r}`;let n=this.checkKeyFuzzy(r);if(n)return n;let a=await this.scan(s,i);if(a)return a}}return null}checkKeyFuzzy(t){let i=t.toLowerCase();if(e.KEY_SAFELIST.has(i))return null;for(let[r,s]of this.shortTokenBoundaryPatterns)if(s.test(t))return `Forbidden Key (fuzzy): ${t} matches boundary pattern "${r}"`;for(let r of this.longForbiddenTokens)if(i.includes(r))return `Forbidden Key (fuzzy): ${t} contains restricted token "${r}"`;return null}checkString(t){for(let i of this.patterns)if(typeof i=="string"){if(t.toLowerCase().includes(i.toLowerCase()))return i}else if(i instanceof RegExp){if(i.global&&(i.lastIndex=0),i.test(t))return i.source}else if(typeof i=="object"&&i!==null){let r=i;if(typeof r.pattern=="string"){if(t.toLowerCase().includes(r.pattern.toLowerCase())&&(!r.validator||r.validator(r.pattern)))return r.name}else if(r.pattern instanceof RegExp){r.pattern.global&&(r.pattern.lastIndex=0);let s=r.pattern.exec(t);for(;s!==null;){let n=s[0];if(!r.validator||r.validator(n))return r.name;if(!r.pattern.global)break;s=r.pattern.exec(t);}}}return null}};var Ji=Se.dirname(fileURLToPath(import.meta.url)),Yi=class e{constructor(t,i){this.serverInfo=t;this.config=i;let r=this.config?.security?.enableNerScanning?new Je:null;this.piiScanner=new Qe(this.config?.security?.piiPatterns??qi.GLOBAL_STRICT,this.config?.security?.forbiddenKeys??["id","name","fullName","firstName","lastName","address","street","city","postalCode","zipCode","phone","email","ssn","accountHolder","accountNumber","account_number","password","token","secret","privateKey"],r);let s=this.config?.security?.rateLimit;this.toolCallWindowMs=s?.windowMs??Number.parseInt(process.env.LIOP_RATE_LIMIT_WINDOW_MS??"60000",10),this.toolCallMaxPerWindow=s?.maxPerWindow??Number.parseInt(process.env.LIOP_RATE_LIMIT_MAX??"15",10),this.globalCallMaxPerWindow=s?.globalMaxPerWindow??Number.parseInt(process.env.LIOP_RATE_LIMIT_GLOBAL_MAX??"40",10);let n=this.config?.security?.forbiddenKeys??["id","name","fullName","firstName","lastName","address","street","city","postalCode","zipCode","phone","email","ssn","accountHolder","accountNumber","account_number","password","token","secret","privateKey"],a=this.config?.security?.sensitiveKeys??[];this.taintAnalyzer=new Ge(n,a);let u=import.meta.url.endsWith(".ts"),c=u?".ts":".js",l=[];if(u)try{let _=createRequire(import.meta.url).resolve("tsx/package.json");l=["--import",pathToFileURL(Se.join(Se.dirname(_),"dist","loader.mjs")).href];}catch{l=["--import","tsx"];}let p=process.env.NODE_ENV==="test"||process.env.VITEST;this.config?.capabilities&&!this.serverInfo.capabilities&&(this.serverInfo.capabilities=this.config.capabilities);let x=[Se.resolve(Ji,`./workers/logic-execution${c}`),Se.resolve(Ji,`../workers/logic-execution${c}`)],d=x.find(g=>j.existsSync(g))||x[1];this.workerPool=new Piscina({filename:d,minThreads:this.config?.workerPool?.minThreads??(p?0:2),maxThreads:this.config?.workerPool?.maxThreads??(p?1:8),idleTimeout:this.config?.workerPool?.idleTimeout??(p?500:5e3),maxQueue:this.config?.workerPool?.maxQueue??"auto",taskQueue:new FixedQueue,execArgv:l,resourceLimits:{maxOldGenerationSizeMb:this.config?.workerPool?.maxHeapMb??Number.parseInt(process.env.LIOP_WORKER_MAX_HEAP_MB??"64",10)}});let k=this.config?.workerPool?.minThreads??(p?0:2);if(this.workerPool&&k>0)for(let g=0;g<k;g++)this.workerPool.run({isWarmup:true}).catch(_=>{a$1.debug(`[LiopServer] Worker pool warm-up ping failed: ${_.message}`);});if(this.config?.auth?.role==="nexus"){let g=this.config.auth.issuer||"http://localhost:3000",_=this.config.auth.audience||le.audience,w=this.config.auth.clients||[{client_id:process.env.LIOP_OAUTH_CLIENT_ID||"liop-mesh-agent",client_secret:process.env.LIOP_OAUTH_CLIENT_SECRET||"dev-secret-change-me",grant_types:["client_credentials"],scope:"liop:tools:call liop:tools:list liop:resources:read liop:schema:read liop:mesh:query"}],{provider:N,jwks:Z}=ai({issuer:g,clients:w});this.oauthProvider=N,this.jwtValidator=new Pe(g,_,Z);}else if(this.config?.auth?.role==="node"){let g=this.config.auth.nexusUrl||process.env.LIOP_NEXUS_URL||"http://localhost:3000",_=this.config.auth.audience||le.audience,w=g.endsWith("/oidc")?g:`${g}/oidc`,N=new URL(`${w}/jwks`);this.jwtValidator=new Pe(g,_,N);}this.resource("LIOP Envelope Specification","liop://protocol/envelope-spec","Complete Logic-on-Origin envelope format, execution rules, and security constraints","text/plain",()=>Promise.resolve(this.buildEnvelopeSpec())),this.config?.auth?.revocationPath&&this.loadRevocationList();}logicCache=new Map;connectionStats=new Map;CACHE_TTL_MS=1440*60*1e3;THROTTLE_THRESHOLD=5;THROTTLE_COOLDOWN_MS=60*1e3;toolCallWindows=new Map;toolCallMaxPerWindow;toolCallWindowMs;globalCallWindow=[];globalCallMaxPerWindow;fieldQueryBudget=new Map;taintAnalyzer;tools=new Map;resources=new Map;prompts=new Map;activeSchema=null;sandboxRecords=[];piiScanner;workerPool;meshNode=null;rpcServer=null;boundPort=null;jwtValidator;oauthProvider;sessions=new Map;revokedTokenHashes=new Set;lastRevocationLoadTime=0;static LIOP_COMPACT_REGEX=/@LIOP\{(?<target>[^,}]+)(?:,(?<name>[^}]*))?\}\n(?<logic>[\s\S]*?)\n@END/m;extractLogic(t){let i=t.match(e.LIOP_COMPACT_REGEX);return i?.groups?.logic?i.groups.logic.trim():null}parseUnknownJson(t){if(typeof t!="string")return t;let i=t.trim();if(i.startsWith("{")&&i.endsWith("}")||i.startsWith("[")&&i.endsWith("]"))try{return JSON.parse(i)}catch{return t}return t}runPreflightPolicy(t,i,r,s="local-client"){if(r){let c=i.replace(/\s+/g," ");if(r.enforceAggregationFirst&&[/return\s+env\.records(?!\s*\.\s*(?:reduce|length|filter|every|some|find)\b)/i,/return\s*\{[\s\S]*\b(accounts|patients|rows|records)\s*:\s*env\.records(?!\s*\.\s*(?:reduce|length|filter)\b)/i].some(p=>p.test(c)))return "Preflight policy rejected: potential row-level export pattern detected.";if(r.preflightDenyPatterns?.some(l=>l.test(c)))return "Preflight policy rejected: custom deny pattern matched."}let n=50;typeof r?.enforceAggregationFirst=="object"&&(n=r.enforceAggregationFirst.minMaxBlockThreshold??50);let a=this.taintAnalyzer.analyze(i,this.sandboxRecords.length,n);if(a)return `Preflight policy rejected: ${a.reason}`;let u=this.taintAnalyzer.extractQueriedFields(i);if(u.length>0){let c=this.fieldQueryBudget.get(s);c||(c=new Map,this.fieldQueryBudget.set(s,c));let l=c.get(t);l||(l=new Map,c.set(t,l));for(let p of u){let x=this.taintAnalyzer.classifyField(p,r?.sensitiveKeys),d=25,k="public";if(r?.queryBudgetPerField!==void 0?(d=r.queryBudgetPerField,k="override"):x==="forbidden"?(d=3,k="forbidden"):x==="sensitive"&&(d=8,k="sensitive"),(l.get(p)??0)>=d)return `Preflight policy rejected: Query budget exceeded for field '${p}' (max ${d} per session for ${k} fields). Rotate PQC session to reset budget.`}for(let p of u){let x=l.get(p)??0;l.set(p,x+1);}}return null}validateOutputPolicy(t,i,r){if(!r)return null;let s=this.parseUnknownJson(i);if(s&&typeof s=="object"&&s.isError===true)return null;if(r.outputSchema){let a=(()=>{if(!(r.outputSchema instanceof b$2.ZodObject))return r.outputSchema;let u=r.outputSchema;return u._def.catchall instanceof b$2.ZodNever?u.strict():u})().safeParse(s);if(!a.success)return `[LIOP] Output schema violation for ${t}: ${a.error.issues.map(u=>`${u.path.join(".")||"<root>"} ${u.message}`).join("; ")}. HINT: Your output must conform to the declared schema. Use 'env.records' to access the dataset and return only allowed fields.`}return r.enforceAggregationFirst&&this.violatesAggregationFirstPolicy(this.unwrapForAggregationPolicyScan(s),r.enforceAggregationFirst,this.sandboxRecords.length)?process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.LIOP_SEC_VERBOSE==="1"?"Aggregation-First Policy Violation: row-level export or K-Anonymity violation blocked. HINT: Use .reduce() to produce a flat {key:value} object. Do NOT use .map() to create arrays of objects. Ensure dataset size > 10 for detailed results.":"Aggregation-First Policy Violation: Output blocked due to privacy constraints.":null}unwrapForAggregationPolicyScan(t){if(typeof t=="string"){let n=t.trim();if(n.startsWith("{")&&n.endsWith("}")||n.startsWith("[")&&n.endsWith("]"))try{return this.unwrapForAggregationPolicyScan(JSON.parse(n))}catch{return t}return t}if(!t||typeof t!="object")return t;let i=t;if(i.computation_result!==void 0)return this.unwrapForAggregationPolicyScan(i.computation_result);if(!Array.isArray(i.content)||i.content.length===0)return t;let r=[];for(let n of i.content)if(n&&typeof n=="object"&&"text"in n){let a=n.text;typeof a=="string"&&r.push(a);}if(r.length===0)return t;let s=r.length===1?r[0]:r.join(`
17
+ }`,{ecmaVersion:2022,sourceType:"script"});}catch{return []}let r=new Set;this.identifyRecordBoundVars(i,r);let s=new Set;return ae(i,{MemberExpression:a=>{let u=this.getPropertyName(a);if(!(!u||u==="length")&&(a.object.type==="Identifier"&&r.has(a.object.name)&&s.add(u),a.object.type==="MemberExpression")){let c=a.object;c.computed&&this.isEnvRecordsAccess(c.object)&&s.add(u);}}}),Array.from(s)}detectCorrelatedAggregations(t){let i=new Map;ae(t,{CallExpression:s=>{if(s.callee.type!=="MemberExpression")return;let n=s.callee,a=this.getPropertyName(n);if(!a||!e.REDUCE_METHODS.has(a)||!this.isEnvRecordsChain(n.object))return;let u=s.arguments[0];if(!u||u.type!=="ArrowFunctionExpression"&&u.type!=="FunctionExpression")return;let c=u,l=c.params.length>1?c.params[1]:c.params[0];if(!l||l.type!=="Identifier")return;let p=l.name,y=this.extractFieldsFromBody(c.body,p);for(let g of y){let k=i.get(g)??0;i.set(g,k+1);}}});for(let[s,n]of i)if(n>=2)return {reason:`Correlation guard: ${n} aggregations detected on field '${s}'. Multiple correlated aggregations on the same field can enable differencing attacks. Use a single aggregation per numeric field, or increase dataset size above 50 records.`};return null}isEnvRecordsChain(t){if(this.isEnvRecordsAccess(t))return true;if(t.type==="CallExpression"){let i=t;if(i.callee.type==="MemberExpression"){let r=i.callee,s=this.getPropertyName(r);if(s&&(s==="slice"||s==="filter"||s==="toSorted"))return this.isEnvRecordsChain(r.object)}}return false}extractFieldsFromBody(t,i){let r=[];return ae(t,{MemberExpression:n=>{if(n.object.type==="Identifier"&&n.object.name===i){let a=this.getPropertyName(n);a&&a!=="length"&&r.push(a);}}}),r}detectMinMaxExtraction(t){let i=null;return ae(t,{CallExpression:s=>{if(!i&&s.callee.type==="MemberExpression"){let n=s.callee;if(n.object.type==="Identifier"&&n.object.name==="Math"){let a=this.getPropertyName(n);(a==="min"||a==="max")&&s.arguments.some(u=>u.type==="SpreadElement"&&this.isRecordsMapCall(u.argument))&&(i={reason:`Min/Max gate: Math.${a}() on individual records blocked for small datasets (n < 50). Use avg/stddev/count for privacy-safe aggregations.`});}}},MemberExpression:s=>{if(!i&&s.computed&&s.object.type==="CallExpression"){let n=s.object;if(n.callee.type==="MemberExpression"){let a=this.getPropertyName(n.callee);if(a==="sort"||a==="toSorted"){let u=n.callee.object;this.isEnvRecordsChain(u)&&(i={reason:"Min/Max gate: .sort()[index] on individual records blocked for small datasets (n < 50). Use avg/stddev/count for privacy-safe aggregations."});}}}}}),i}isRecordsMapCall(t){if(t.type!=="CallExpression")return false;let i=t;if(i.callee.type!=="MemberExpression")return false;let r=i.callee;return this.getPropertyName(r)==="map"&&this.isEnvRecordsChain(r.object)}identifyRecordBoundVars(t,i){ae(t,{CallExpression:n=>{if(n.callee.type!=="MemberExpression")return;let a=n.callee,u=this.getPropertyName(a);if(!u||!this.isEnvRecordsAccess(a.object))return;let c=n.arguments[0];if(c&&(c.type==="ArrowFunctionExpression"||c.type==="FunctionExpression")){let l=c;if(e.ARRAY_CALLBACK_METHODS.has(u)&&l.params.length>0){let p=l.params[0];p.type==="Identifier"&&i.add(p.name);}if(e.REDUCE_METHODS.has(u)&&l.params.length>1){let p=l.params[1];p.type==="Identifier"&&i.add(p.name);}}},ForOfStatement:n=>{if(this.isEnvRecordsAccess(n.right)&&n.left.type==="VariableDeclaration")for(let a of n.left.declarations)a.id.type==="Identifier"&&i.add(a.id.name);}}),ae(t,{VariableDeclarator:n=>{if(!(!n.init||n.id.type!=="Identifier")&&n.init.type==="MemberExpression"&&n.init.computed){let a=n.init;this.isEnvRecordsAccess(a.object)&&i.add(n.id.name);}}});}propagateTaint(t,i,r){for(let s=0;s<3;s++){let n=r.size;if(ae(t,{VariableDeclarator:u=>{!u.init||u.id.type!=="Identifier"||this.isExpressionTainted(u.init,i,r)&&r.add(u.id.name);},AssignmentExpression:u=>{u.left.type==="Identifier"&&this.isExpressionTainted(u.right,i,r)&&r.add(u.left.name);},FunctionDeclaration:u=>{u.id&&u.id.type==="Identifier"&&this.doesCallbackProduceTaint(u,null,i,r)&&r.add(u.id.name);},CallExpression:u=>{if(u.callee.type!=="MemberExpression")return;let c=u.callee;this.getPropertyName(c)==="push"&&c.object.type==="Identifier"&&u.arguments.some(p=>this.isExpressionTainted(p,i,r))&&r.add(c.object.name);}}),r.size===n)break}}checkReturnStatements(t,i,r){let s=null;return ae(t,{ReturnStatement:a=>{if(!s&&a.argument&&this.isExpressionTainted(a.argument,i,r)){let u=a.loc?.start.line?a.loc.start.line-1:void 0,c=this.describeTaintSource(a.argument,i,r);s={reason:`PII side-channel detected: output contains values derived from restricted fields. ${c?`Operation: ${c}. `:""}Use only non-PII fields (e.g., numeric/date columns) for aggregations.`,line:u,operation:c};}}}),s}isExpressionTainted(t,i,r){switch(t.type){case "Identifier":return r.has(t.name);case "MemberExpression":return this.isMemberExprTainted(t,i,r);case "CallExpression":return this.isCallExprTainted(t,i,r);case "YieldExpression":{let s=t;return s.argument?this.isExpressionTainted(s.argument,i,r):false}case "FunctionExpression":case "ArrowFunctionExpression":{let s=t;return this.doesCallbackProduceTaint(s,null,i,r)}case "BinaryExpression":case "LogicalExpression":{let s=t;return this.isExpressionTainted(s.left,i,r)||this.isExpressionTainted(s.right,i,r)}case "UnaryExpression":{let s=t;return this.isExpressionTainted(s.argument,i,r)}case "ConditionalExpression":{let s=t;return this.isExpressionTainted(s.test,i,r)||this.isExpressionTainted(s.consequent,i,r)||this.isExpressionTainted(s.alternate,i,r)}case "ObjectExpression":return t.properties.some(n=>n.type==="Property"&&this.isExpressionTainted(n.value,i,r));case "ArrayExpression":return t.elements.some(n=>n!==null&&this.isExpressionTainted(n,i,r));case "TemplateLiteral":return t.expressions.some(n=>this.isExpressionTainted(n,i,r));case "SpreadElement":{let s=t;return this.isExpressionTainted(s.argument,i,r)}default:return false}}isMemberExprTainted(t,i,r){let s=this.getPropertyName(t);if(t.object.type==="Identifier"&&i.has(t.object.name)&&s&&this.piiFields.has(s.toLowerCase()))return true;if(t.object.type==="MemberExpression"&&s&&this.piiFields.has(s.toLowerCase())){let n=t.object;if(n.computed&&this.isEnvRecordsAccess(n.object))return true}if(this.isExpressionTainted(t.object,i,r))return true;if(t.computed&&t.object.type==="Identifier"&&i.has(t.object.name)&&t.property.type==="Literal"){let n=t.property.value;if(typeof n=="string"&&this.piiFields.has(n.toLowerCase()))return true}return false}isCallExprTainted(t,i,r){if(t.callee.type==="MemberExpression"){let s=t.callee,n=this.getPropertyName(s);if(n&&e.TAINT_PROPAGATING_METHODS.has(n)&&this.isExpressionTainted(s.object,i,r))return true;if(this.isEnvRecordsAccess(s.object)&&t.arguments[0]){let a=t.arguments[0];if(a.type==="ArrowFunctionExpression"||a.type==="FunctionExpression")return this.doesCallbackProduceTaint(a,n,i,r)}if(this.isExpressionTainted(s.object,i,r)||t.arguments.some(a=>this.isExpressionTainted(a,i,r)))return true}if(t.callee.type==="MemberExpression"){let s=t.callee;this.getPropertyName(s)==="push"&&s.object.type==="Identifier"&&t.arguments.some(a=>this.isExpressionTainted(a,i,r))&&r.add(s.object.name);}if(t.callee.type==="Identifier"){let s=t.callee.name;if(r.has(s))return true;if(!new Set(["Math","Number","parseInt","parseFloat","isNaN","isFinite"]).has(s))return t.arguments.some(a=>this.isExpressionTainted(a,i,r))}return false}doesCallbackProduceTaint(t,i,r,s){let n=new Set(r),a=new Set(s);if(t.params.length>0){let p=i!==null&&e.REDUCE_METHODS.has(i)?1:0;t.params.length>p&&t.params[p].type==="Identifier"&&n.add(t.params[p].name);}if(t.type==="ArrowFunctionExpression"&&t.body.type!=="BlockStatement")return this.isExpressionTainted(t.body,n,a);let u=false,c={ReturnStatement:l=>{l.argument&&this.isExpressionTainted(l.argument,n,a)&&(u=true);},YieldExpression:l=>{let p=l;p.argument&&this.isExpressionTainted(p.argument,n,a)&&(u=true);}};return ae(t.body,c),u}getPropertyName(t){if(!t.computed&&t.property.type==="Identifier")return t.property.name;if(t.computed&&t.property.type==="Literal"){let i=t.property.value;if(typeof i=="string")return i}return null}isEnvRecordsAccess(t){if(t.type==="MemberExpression"){let i=t;if(this.getPropertyName(i)==="records"&&i.object.type==="Identifier"&&i.object.name==="env")return true}return t.type==="Identifier"&&t.name==="records"}describeTaintSource(t,i,r){if(t.type==="Identifier"){let s=t.name;if(r.has(s))return `variable '${s}' is PII-derived`}if(t.type==="ObjectExpression"){let s=t;for(let n of s.properties)if(n.type==="Property"&&this.isExpressionTainted(n.value,i,r))return `property '${n.key.type==="Identifier"?n.key.name:"unknown"}' contains PII-derived value`}if(t.type==="CallExpression"){let s=t;if(s.callee.type==="MemberExpression"){let n=this.getPropertyName(s.callee);if(n)return `result of .${n}() on PII data`}}}};var qr={aspirin:"Medication",lisinopril:"Medication",metformin:"Medication",amlodipine:"Medication",atorvastatin:"Medication",omeprazole:"Medication",losartan:"Medication",simvastatin:"Medication",levothyroxine:"Medication",ibuprofen:"Medication",acetaminophen:"Medication",amoxicillin:"Medication",ciprofloxacin:"Medication",prednisone:"Medication",warfarin:"Medication",insulin:"Medication",hydrochlorothiazide:"Medication",gabapentin:"Medication",albuterol:"Medication",pantoprazole:"Medication",hypertension:"Condition",diabetes:"Condition",bronchitis:"Condition",pneumonia:"Condition",asthma:"Condition"},Ge=4,Gr=/^[\d\s.,:;!?()[\]{}<>@#$%^&*+=|\\/"'`~_-]+$/,Je=class e{static nlp=null;async getNlp(){if(!e.nlp){let t=await import('compromise/three');e.nlp=t.default||t,e.nlp.addWords(qr);}return e.nlp}async scan(t){if(t.length<Ge||Gr.test(t))return {detected:false,entities:[]};let r=(await this.getNlp())(t),s=[],n=r.people().out("array");for(let c of n){let l=c.trim();l.length>=Ge&&s.push({type:"person",text:l});}let a=r.places().out("array");for(let c of a){let l=c.trim();l.length>=Ge&&s.push({type:"place",text:l});}let u=r.organizations().out("array");for(let c of u){let l=c.trim();l.length>=Ge&&s.push({type:"organization",text:l});}return {detected:s.length>0,entities:s}}async scanDeep(t,i=new WeakSet){if(t==null)return {detected:false,entities:[]};if(typeof t=="string")return this.scan(t);if(typeof t=="object"){if(i.has(t))return {detected:false,entities:[]};i.add(t);let r=Array.isArray(t)?t:Object.values(t),s=[];for(let n of r){let a=await this.scanDeep(n,i);if(a.detected&&(s.push(...a.entities),a.entities.some(u=>u.type==="person")))return {detected:true,entities:s}}return {detected:s.length>0,entities:s}}return {detected:false,entities:[]}}};var Jr={maxDecimalPlaces:4,clampNonNegative:true};function Ye(e,t){let i={...Jr,...t},r=new WeakSet;function s(n){if(n==null)return n;if(typeof n=="number"){if(!Number.isFinite(n))return n;let a=n;i.clampNonNegative&&a<0&&(a=0);let u=10**i.maxDecimalPlaces;return a=Math.round(a*u)/u,a}if(typeof n=="string"||typeof n=="boolean")return n;if(typeof n=="object"){if(r.has(n))return n;if(r.add(n),Array.isArray(n))return n.map(u=>s(u));let a={};for(let[u,c]of Object.entries(n))a[u]=s(c);return a}return n}return s(e)}function Yr(e){let t=e.replace(/\D/g,"");if(t.length<13||t.length>19)return false;let i=0,r=false;for(let s=t.length-1;s>=0;s--){let n=parseInt(t.charAt(s),10);r&&(n*=2,n>9&&(n-=9)),i+=n,r=!r;}return i%10===0}function Qr(e){let t=e.replace(/\s+/g,"").toUpperCase();if(!/^[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}$/.test(t))return false;let i=t.substring(4)+t.substring(0,4),r="";for(let s=0;s<i.length;s++){let n=i.charCodeAt(s);if(n>=65&&n<=90)r+=(n-55).toString();else if(n>=48&&n<=57)r+=i.charAt(s);else return false}try{return BigInt(r)%97n===1n}catch{return false}}var V={EMAIL:{name:"EMAIL",pattern:/\b[a-zA-Z0-9._%+-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,}\b/gi,validator:e=>!e.endsWith("@example.com")&&!e.endsWith("@test.com")},CREDIT_CARD:{name:"CREDIT_CARD",pattern:/\b(?:\d[ -]*?){13,16}\b/g,validator:Yr},IP_ADDRESS:{name:"IP_ADDRESS",pattern:/\b\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\b/g,validator:e=>["127.0.0.1","0.0.0.0","255.255.255.255"].includes(e)?false:e.split(".").map(Number).every(r=>r>=0&&r<=255)},PHONE:{name:"PHONE",pattern:/(?:(?:\+?\d{1,3}[-. ]?)?\(?\d{3}\)?[-. ]?\d{3}[-. ]?\d{4})\b/g,validator:e=>{let t=e.replace(/\D/g,"");return !(t.length<7||t.length>15||/^(\d)\1+$/.test(t)||t==="1234567890")}},SSN:{name:"SSN",pattern:/\b\d{3}[- ]?\d{2}[- ]?\d{4}\b/g,validator:e=>{let t=e.replace(/\D/g,"");if(t.length!==9)return false;let i=parseInt(t.substring(0,3),10);return !(i===0||i===666||i>=900||parseInt(t.substring(3,5),10)===0||parseInt(t.substring(5,9),10)===0||/^(\d)\1+$/.test(t)||t==="123456789")}},IBAN:{name:"IBAN",pattern:/\b[A-Z]{2}[0-9]{2}[A-Z0-9]{1,30}\b/gi,validator:Qr},PASSPORT_MRZ:{name:"PASSPORT_MRZ",pattern:/\bP[A-Z<][A-Z<]{3}[A-Z0-9<]{39}(?:\b|\s|$)/g}},Gi={GLOBAL_STRICT:[V.EMAIL,V.CREDIT_CARD,V.IP_ADDRESS,V.PHONE,V.PASSPORT_MRZ,V.IBAN],US_COMPLIANT:[V.EMAIL,V.CREDIT_CARD,V.IP_ADDRESS,V.PHONE,V.SSN,V.PASSPORT_MRZ],EU_GDPR:[V.EMAIL,V.CREDIT_CARD,V.IP_ADDRESS,V.PHONE,V.IBAN,V.PASSPORT_MRZ]},Qe=class e{patterns;forbiddenKeysSet;nerScanner;static KEY_SAFELIST=new Set(["grid","video","android","identity","provide","override","validate","hidden","widget","guidelines","beside","guideline","outside","inside","collide","decide","divide","aside","ride","side","wide","hide","tide","pride","bride","slide","guide","stride","oxide","dioxide","suicide","homicide","pesticide","valid","invalid","void","avoid","diagnosis","medication","namespace","namesake","rename","filename","hostname","typename","unnamed","renamed","phonetic","phoneme","microphone","headphone","telephone","saxophone","smartphone","streetview","addressable","addressing","cityscape","electricity","capacity","velocity","opacity","timestamp","timezone","image_id","computation_result","zk_receipt","testid","toolid","sessionid","peerid","nodeid","requestid","correlationid","traceid","spanid"]);shortTokenBoundaryPatterns;longForbiddenTokens;constructor(t=[],i=[],r){this.patterns=t,this.forbiddenKeysSet=new Set(i.map(s=>s.toLowerCase())),this.nerScanner=r??null,this.shortTokenBoundaryPatterns=new Map,this.longForbiddenTokens=[];for(let s of this.forbiddenKeysSet)s.length<4?this.shortTokenBoundaryPatterns.set(s,new RegExp((()=>{let n=s.split("").map(u=>`[${u.toLowerCase()}${u.toUpperCase()}]`).join(""),a=`[a-z]${s.charAt(0).toUpperCase()}${s.slice(1)}`;return `(?:^|[_-])${n}(?:$|[_-])|${a}(?:$|[A-Z_-])|^${n}$`})())):this.longForbiddenTokens.push(s);}async scan(t,i=new WeakSet){if(t==null)return null;if(typeof t=="string"){let r=t.trim();if(r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]"))try{let n=JSON.parse(r),a=await this.scan(n,i);if(a)return a}catch{}let s=this.checkString(t);if(s)return s;if(this.nerScanner){let n=await this.nerScanner.scan(t);if(n.detected){let a=n.entities.find(u=>u.type==="person");if(a)return `PII Entity Detected: person name "${a.text}"`}}return null}if(typeof t=="object"){if(i.has(t))return null;if(i.add(t),Array.isArray(t))for(let r of t){let s=await this.scan(r,i);if(s)return s}else for(let[r,s]of Object.entries(t)){if(this.forbiddenKeysSet.has(r.toLowerCase()))return `Forbidden Key: ${r}`;let n=this.checkKeyFuzzy(r);if(n)return n;let a=await this.scan(s,i);if(a)return a}}return null}checkKeyFuzzy(t){let i=t.toLowerCase();if(e.KEY_SAFELIST.has(i))return null;for(let[r,s]of this.shortTokenBoundaryPatterns)if(s.test(t))return `Forbidden Key (fuzzy): ${t} matches boundary pattern "${r}"`;for(let r of this.longForbiddenTokens)if(i.includes(r))return `Forbidden Key (fuzzy): ${t} contains restricted token "${r}"`;return null}checkString(t){for(let i of this.patterns)if(typeof i=="string"){if(t.toLowerCase().includes(i.toLowerCase()))return i}else if(i instanceof RegExp){if(i.global&&(i.lastIndex=0),i.test(t))return i.source}else if(typeof i=="object"&&i!==null){let r=i;if(typeof r.pattern=="string"){if(t.toLowerCase().includes(r.pattern.toLowerCase())&&(!r.validator||r.validator(r.pattern)))return r.name}else if(r.pattern instanceof RegExp){r.pattern.global&&(r.pattern.lastIndex=0);let s=r.pattern.exec(t);for(;s!==null;){let n=s[0];if(!r.validator||r.validator(n))return r.name;if(!r.pattern.global)break;s=r.pattern.exec(t);}}}return null}};var Ji=le.dirname(fileURLToPath(import.meta.url)),Yi=class e{constructor(t,i){this.serverInfo=t;this.config=i;let r=this.config?.security?.enableNerScanning?new Je:null;this.piiScanner=new Qe(this.config?.security?.piiPatterns??Gi.GLOBAL_STRICT,this.config?.security?.forbiddenKeys??["id","name","fullName","firstName","lastName","address","street","city","postalCode","zipCode","phone","email","ssn","accountHolder","accountNumber","account_number","password","token","secret","privateKey"],r);let s=this.config?.security?.rateLimit;this.toolCallWindowMs=s?.windowMs??Number.parseInt(process.env.LIOP_RATE_LIMIT_WINDOW_MS??"60000",10),this.toolCallMaxPerWindow=s?.maxPerWindow??Number.parseInt(process.env.LIOP_RATE_LIMIT_MAX??"15",10),this.globalCallMaxPerWindow=s?.globalMaxPerWindow??Number.parseInt(process.env.LIOP_RATE_LIMIT_GLOBAL_MAX??"40",10);let n=this.config?.security?.forbiddenKeys??["id","name","fullName","firstName","lastName","address","street","city","postalCode","zipCode","phone","email","ssn","accountHolder","accountNumber","account_number","password","token","secret","privateKey"],a=this.config?.security?.sensitiveKeys??[];this.taintAnalyzer=new qe(n,a);let u=import.meta.url.endsWith(".ts"),c=u?".ts":".js",l=[];if(u)try{let S=createRequire(import.meta.url).resolve("tsx/package.json");l=["--import",pathToFileURL(le.join(le.dirname(S),"dist","loader.mjs")).href];}catch{l=["--import","tsx"];}let p=process.env.NODE_ENV==="test"||process.env.VITEST;this.config?.capabilities&&!this.serverInfo.capabilities&&(this.serverInfo.capabilities=this.config.capabilities);let y=[le.resolve(Ji,`./workers/logic-execution${c}`),le.resolve(Ji,`../workers/logic-execution${c}`)],g=y.find(m=>R.existsSync(m))||y[1];this.workerPool=new Piscina({filename:g,minThreads:this.config?.workerPool?.minThreads??(p?0:2),maxThreads:this.config?.workerPool?.maxThreads??(p?1:8),idleTimeout:this.config?.workerPool?.idleTimeout??(p?500:5e3),maxQueue:this.config?.workerPool?.maxQueue??"auto",taskQueue:new FixedQueue,execArgv:l,resourceLimits:{maxOldGenerationSizeMb:this.config?.workerPool?.maxHeapMb??Number.parseInt(process.env.LIOP_WORKER_MAX_HEAP_MB??"64",10)}});let k=this.config?.workerPool?.minThreads??(p?0:2);if(this.workerPool&&k>0)for(let m=0;m<k;m++)this.workerPool.run({isWarmup:true}).catch(S=>{a$1.debug(`[LiopServer] Worker pool warm-up ping failed: ${S.message}`);});if(this.config?.auth?.role==="nexus"){let m=this.config.auth.issuer||"http://localhost:3000",S=this.config.auth.audience||pe.audience,x=this.config.auth.clients||[{client_id:process.env.LIOP_OAUTH_CLIENT_ID||"liop-mesh-agent",client_secret:process.env.LIOP_OAUTH_CLIENT_SECRET||"dev-secret-change-me",grant_types:["client_credentials"],scope:"liop:tools:call liop:tools:list liop:resources:read liop:schema:read liop:mesh:query"}],{provider:T,jwks:M}=ai({issuer:m,clients:x});this.oauthProvider=T,this.jwtValidator=new Pe(m,S,M);}else if(this.config?.auth?.role==="node"){let m=this.config.auth.nexusUrl||process.env.LIOP_NEXUS_URL||"http://localhost:3000",S=this.config.auth.audience||pe.audience,x=m.endsWith("/oidc")?m:`${m}/oidc`,T=new URL(`${x}/jwks`);this.jwtValidator=new Pe(m,S,T);}this.resource("LIOP Envelope Specification","liop://protocol/envelope-spec","Complete Logic-on-Origin envelope format, execution rules, and security constraints","text/plain",()=>Promise.resolve(this.buildEnvelopeSpec())),this.config?.auth?.revocationPath&&this.loadRevocationList();}logicCache=new Map;connectionStats=new Map;CACHE_TTL_MS=1440*60*1e3;THROTTLE_THRESHOLD=5;THROTTLE_COOLDOWN_MS=60*1e3;toolCallWindows=new Map;toolCallMaxPerWindow;toolCallWindowMs;globalCallWindow=[];globalCallMaxPerWindow;fieldQueryBudget=new Map;taintAnalyzer;tools=new Map;resources=new Map;prompts=new Map;activeSchema=null;sandboxRecords=[];piiScanner;workerPool;meshNode=null;rpcServer=null;boundPort=null;jwtValidator;oauthProvider;sessions=new Map;revokedTokenHashes=new Set;lastRevocationLoadTime=0;static LIOP_COMPACT_REGEX=/@LIOP\{(?<target>[^,}]+)(?:,(?<name>[^}]*))?\}\n(?<logic>[\s\S]*?)\n@END/m;extractLogic(t){let i=t.match(e.LIOP_COMPACT_REGEX);return i?.groups?.logic?i.groups.logic.trim():null}parseUnknownJson(t){if(typeof t!="string")return t;let i=t.trim();if(i.startsWith("{")&&i.endsWith("}")||i.startsWith("[")&&i.endsWith("]"))try{return JSON.parse(i)}catch{return t}return t}runPreflightPolicy(t,i,r,s="local-client"){if(r){let c=i.replace(/\s+/g," ");if(r.enforceAggregationFirst&&[/return\s+env\.records(?!\s*\.\s*(?:reduce|length|filter|every|some|find)\b)/i,/return\s*\{[\s\S]*\b(accounts|patients|rows|records)\s*:\s*env\.records(?!\s*\.\s*(?:reduce|length|filter)\b)/i].some(p=>p.test(c)))return "Preflight policy rejected: potential row-level export pattern detected.";if(r.preflightDenyPatterns?.some(l=>l.test(c)))return "Preflight policy rejected: custom deny pattern matched."}let n=50;typeof r?.enforceAggregationFirst=="object"&&(n=r.enforceAggregationFirst.minMaxBlockThreshold??50);let a=this.taintAnalyzer.analyze(i,this.sandboxRecords.length,n);if(a)return `Preflight policy rejected: ${a.reason}`;let u=this.taintAnalyzer.extractQueriedFields(i);if(u.length>0){let c=r?.budgetStorePath||this.config?.budgetStorePath;if(c)try{let l=this.executeWithBudgetLock(c,p=>{let y=p[s]||{},g=y[t]||{};for(let x of u){let T=this.taintAnalyzer.classifyField(x,r?.sensitiveKeys),M=25,D="public";if(r?.queryBudgetPerField!==void 0?(M=r.queryBudgetPerField,D="override"):T==="forbidden"?(M=3,D="forbidden"):T==="sensitive"&&(M=8,D="sensitive"),(g[x]??0)>=M)return {result:`Preflight policy rejected: Query budget exceeded for field '${x}' (max ${M} per session for ${D} fields). Rotate PQC session to reset budget.`}}let k={...g};for(let x of u)k[x]=(k[x]??0)+1;let m={...y};m[t]=k;let S={...p};return S[s]=m,{result:null,updatedBudget:S}});if(l)return l}catch(l){let p=l instanceof Error?l.message:String(l);a$1.error(`[LIOP-Server] Error applying persistent query budget: ${p}. Falling back to in-memory.`);let y=this.applyInMemoryBudget(s,t,u,r);if(y)return y}else {let l=this.applyInMemoryBudget(s,t,u,r);if(l)return l}}return null}validateOutputPolicy(t,i,r){if(!r)return null;let s=this.parseUnknownJson(i);if(s&&typeof s=="object"&&s.isError===true)return null;if(r.outputSchema){let a=(()=>{if(!(r.outputSchema instanceof b$3.ZodObject))return r.outputSchema;let u=r.outputSchema;return u._def.catchall instanceof b$3.ZodNever?u.strict():u})().safeParse(s);if(!a.success)return `[LIOP] Output schema violation for ${t}: ${a.error.issues.map(u=>`${u.path.join(".")||"<root>"} ${u.message}`).join("; ")}. HINT: Your output must conform to the declared schema. Use 'env.records' to access the dataset and return only allowed fields.`}return r.enforceAggregationFirst&&this.violatesAggregationFirstPolicy(this.unwrapForAggregationPolicyScan(s),r.enforceAggregationFirst,this.sandboxRecords.length)?process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.LIOP_SEC_VERBOSE==="1"?"Aggregation-First Policy Violation: row-level export or K-Anonymity violation blocked. HINT: Use .reduce() to produce a flat {key:value} object. Do NOT use .map() to create arrays of objects. Ensure dataset size > 10 for detailed results.":"Aggregation-First Policy Violation: Output blocked due to privacy constraints.":null}unwrapForAggregationPolicyScan(t){if(typeof t=="string"){let n=t.trim();if(n.startsWith("{")&&n.endsWith("}")||n.startsWith("[")&&n.endsWith("]"))try{return this.unwrapForAggregationPolicyScan(JSON.parse(n))}catch{return t}return t}if(!t||typeof t!="object")return t;let i=t;if(i.computation_result!==void 0)return this.unwrapForAggregationPolicyScan(i.computation_result);if(!Array.isArray(i.content)||i.content.length===0)return t;let r=[];for(let n of i.content)if(n&&typeof n=="object"&&"text"in n){let a=n.text;typeof a=="string"&&r.push(a);}if(r.length===0)return t;let s=r.length===1?r[0]:r.join(`
18
18
  `);return this.unwrapForAggregationPolicyScan(s)}violatesAggregationFirstPolicy(t,i,r){if(!i)return false;let s=typeof i=="object"&&typeof i.maxOutputRows=="number"?i.maxOutputRows:10,n=typeof i=="object"&&typeof i.allowPrimitiveArrays=="boolean"?i.allowPrimitiveArrays:true;if(typeof t=="string"){let a=t.trim();if(a.startsWith("{")&&a.endsWith("}")||a.startsWith("[")&&a.endsWith("]"))try{return this.violatesAggregationFirstPolicy(JSON.parse(a),i,r)}catch{return false}return false}if(Array.isArray(t))return t.length>0&&t.every(a=>typeof a=="object"&&a!==null)?t.length>s?true:t.some(a=>this.violatesAggregationFirstPolicy(a,i,r)):t.length>0&&t.every(a=>typeof a!="object"||a===null)?!n:t.some(a=>this.violatesAggregationFirstPolicy(a,i,r));if(t&&typeof t=="object"){let a=Object.keys(t);return r!==void 0&&r>0&&r<10&&(a.length>3||Object.values(t).some(c=>Array.isArray(c)||typeof c=="object"&&c!==null))||a.length>s?true:Object.values(t).some(u=>this.violatesAggregationFirstPolicy(u,i,r))}return false}buildEnvelopeSpec(){let t=["LIOP v1 Envelope Specification","================================","","FORMAT:","","Compact Envelope:"," @LIOP{wasi_v1,TaskName}"," <JavaScript code>"," @END","","RUNTIME ENVIRONMENT:","- env.records: Array of data objects from the origin","- Must use 'return' to output results","- Zero-Trust WASI Sandbox (Node.js Worker Pool)","- Return aggregated objects, NOT raw row-level arrays","","SANDBOX RUNTIME RESTRICTIONS & WORKAROUNDS:","- Date is poisoned: The 'Date' class/constructor is undefined (Date.now(), Date.parse(), etc. will throw)."," Workaround: Use lexicographical string comparison on ISO 8601 date strings (e.g., record.date >= '2024-01-01').","- Poisoned globals: eval, Function, setTimeout, setInterval, Buffer, ArrayBuffer, and TypedArrays are undefined.","- Frozen prototypes: Any modifications to Object.prototype, Array.prototype, etc., are blocked.","","SECURITY CONSTRAINTS:","- PII Egress Shield blocks raw identifiers in output","- Aggregation-First policy: prefer counts, averages, summaries","- AST Guardian: static analysis before execution","","DIFFERENTIAL PRIVACY (DP) MECHANISM (Laplace Mechanism):","- Default field noise scale is derived from node global sensitivity.","- COUNT / LENGTH Optimization: To obtain EXACT counts without noise (sensitivity=1),"," the return keys MUST contain 'count', 'length', 'size', 'num', 'positive', 'negative',"," or start with 'total_' or 'num_' (e.g. 'total_tx', 'credits_count').","- AVERAGE Optimization: Keys containing 'avg', 'mean' or 'average' scale noise"," down automatically by dividing sensitivity by dataset size (sensitivity / n).","- SUM / OTHER queries: Receive full Laplace noise based on global node sensitivity"," (e.g., Sensitivity=100,000 in Bank to protect balances)."];return this.config?.security?.forbiddenKeys?.length&&t.push(`- Restricted fields: ${this.config.security.forbiddenKeys.join(", ")}`),t.push("","TAINT TRACKING (Phase 108):","- AST-level analysis blocks PII-derived scalars (charCodeAt, charAt, etc.)","- Operations on restricted fields are tracked through variable assignments","- Boolean inference (field.charCodeAt(0) < N ? 1 : 0) is blocked","- Allowed: aggregations on non-PII fields (balance, amount, date)","","K-ANONYMITY THRESHOLDS:","- Small Datasets (< 10 records): Maximum of 3 scalar output fields. Nesting or arrays in output are strictly forbidden.","- Large Datasets (>= 10 records): Maximum of 10 output fields.","","RATE LIMITS (OWASP A01):","- Per-tool: 15 calls/min (configurable via LIOP_RATE_LIMIT_MAX)","- Global: 40 calls/min across all tools (LIOP_RATE_LIMIT_GLOBAL_MAX)","","OPTIONAL PARAMETERS:","- __liop_bypass_ast_cache: boolean (force AST re-evaluation)","","AUTHENTICATION (tokenSlug Convention):","- Restricted nodes declare authRequired: true in their manifest.","- Token resolution: LIOP_TOKEN_<tokenSlug> (deterministic) > LIOP_TOKEN_<PeerID> > LIOP_TOKEN_<ProviderName>","- Format: tokenSlug must match SCREAMING_SNAKE_CASE /^[A-Z][A-Z0-9_]*$/ (e.g., BANK, VAULT, HFT_ORACLE)."),t.join(`
19
- `)}extractSchemaFieldSummary(t,i=0){if(i>3)return "{...}";let r=t.type,s=t.properties,n=t.items;return s?`{${Object.entries(s).map(([u,c])=>{let l=c.type;if(l==="array"&&c.items){let p=this.extractSchemaFieldSummary(c.items,i+1);return `${u}(array of ${p})`}if(l==="object"&&c.properties){let p=this.extractSchemaFieldSummary(c,i+1);return `${u}(${p})`}return `${u}(${l||"unknown"})`}).join(", ")}}`:r==="array"&&n?`Array of ${this.extractSchemaFieldSummary(n,i+1)}`:r||Object.keys(t).join(", ")}async connect(t={}){return this.connectToMesh(t)}tool(t,i,r,s,n){if(this.tools.has(t))throw new Error(`Tool already registered: ${t}`);let a=b$2.object(r),u=st(a),c=i,l=s;if(r.payload&&r.payload instanceof b$2.ZodString){let x=this.config?.security?.forbiddenKeys||[];if(c+=`
19
+ `)}extractSchemaFieldSummary(t,i=0){if(i>3)return "{...}";let r=t.type,s=t.properties,n=t.items;return s?`{${Object.entries(s).map(([u,c])=>{let l=c.type;if(l==="array"&&c.items){let p=this.extractSchemaFieldSummary(c.items,i+1);return `${u}(array of ${p})`}if(l==="object"&&c.properties){let p=this.extractSchemaFieldSummary(c,i+1);return `${u}(${p})`}return `${u}(${l||"unknown"})`}).join(", ")}}`:r==="array"&&n?`Array of ${this.extractSchemaFieldSummary(n,i+1)}`:r||Object.keys(t).join(", ")}async connect(t={}){return this.connectToMesh(t)}tool(t,i,r,s,n){if(this.tools.has(t))throw new Error(`Tool already registered: ${t}`);let a=b$3.object(r),u=st(a),c=i,l=s;if(r.payload&&r.payload instanceof b$3.ZodString){let y=this.config?.security?.forbiddenKeys||[];if(c+=`
20
20
 
21
- Payload: LIOP v1 envelope (WASI sandbox). Format: @LIOP{wasi_v1,TaskName}\\n<JS code>\\n@END | Access data: env.records. Return aggregated object. Note: If dataset size < 10 (synthetic demo), Egress K-Anonymity blocks output if it has >3 keys or any array/nested object. | Full spec: resource liop://protocol/envelope-spec`,x.length>0&&(c+=`
22
- Restricted fields: ${x.join(", ")}.`),this.activeSchema){let d=this.extractSchemaFieldSummary(this.activeSchema);c+=`
23
- Data structure: ${d}. Full schema: resource liop://schema/global`;}l=async(d,k)=>{let g="global_connection",_=Date.now(),w=this.connectionStats.get(g)||{failures:0,lastAttempt:0};if(w.failures>=this.THROTTLE_THRESHOLD&&_-w.lastAttempt<this.THROTTLE_COOLDOWN_MS)return {content:[{type:"text",text:"LIOP_THROTTLED: Too many violations. Cooling down for 60 seconds."}],isError:true};let N=d.payload,Z=d.__liop_bypass_ast_cache===true,B=de.createHash("sha256").update(N).digest("hex"),K=this.extractLogic(N),me=this.logicCache.get(B);if(!Z&&me&&_-me.timestamp<this.CACHE_TTL_MS&&K){d.payload=K;let M=this.runPreflightPolicy(t,K,n,"mcp-client");return M?{content:[{type:"text",text:M}],isError:true}:await this.executeInWorkerPool(d,K,t)}if(!K)return w.failures++,w.lastAttempt=_,this.connectionStats.set(g,w),{content:[{type:"text",text:"Error: Malformed payload. Missing @LIOP boundary.\\nYou MUST wrap your logic exactly like this:\\n\\n@LIOP{wasi_v1,DynamicAudit}\\n// Your JS code here\\n@END"}],isError:true};try{let M=this.extractLogic(d.payload);d.payload=M;let X=this.runPreflightPolicy(t,M,n,"mcp-client");if(X)return w.failures++,w.lastAttempt=_,this.connectionStats.set(g,w),{content:[{type:"text",text:X}],isError:!0};let ee=await this.executeInWorkerPool(d,M,t);return ee.isError?(w.failures++,w.lastAttempt=_,this.connectionStats.set(g,w)):(this.connectionStats.set(g,{failures:0,lastAttempt:_}),this.logicCache.set(B,{hash:B,timestamp:_})),ee}catch(M){let X=M;return w.failures++,w.lastAttempt=_,this.connectionStats.set(g,w),{content:[{type:"text",text:`ExecutionRuntimeException: ${X.message}`}],isError:true}}};}let p={type:"object",properties:u.properties||{},required:u.required};this.tools.set(t,{tool:{name:t,description:c,inputSchema:p},handler:l,schema:a,policy:n}),this.meshNode&&this.meshNode.announceCapability(t).catch(x=>{a$1.info(`[LIOP-Mesh] Failed to auto-announce tool ${t}: ${x.message}`);});}prompt(t,i,r,s){if(this.prompts.has(t))throw new Error(`Prompt already registered: ${t}`);this.prompts.set(t,{prompt:{name:t,description:i,arguments:r},handler:s});}enableZeroShotAutonomy(){this.prompt("liop_blind_analyst","The official Logic-Injection-on-Origin Protocol system prompt. Instructs the LLM on how to securely inject Logic-on-Origin without violating PII or safety constraints.",[],t=>({description:"LIOP Blind Analyst Instructions",messages:[{role:"user",content:{type:"text",text:`You are the "Blind Analyst" operating within the Logic-Injection-on-Origin Protocol (LIOP) ecosystem.
21
+ Payload: LIOP v1 envelope (WASI sandbox). Format: @LIOP{wasi_v1,TaskName}\\n<JS code>\\n@END | Access data: env.records. Return aggregated object. Note: If dataset size < 10 (synthetic demo), Egress K-Anonymity blocks output if it has >3 keys or any array/nested object. | Full spec: resource liop://protocol/envelope-spec`,y.length>0&&(c+=`
22
+ Restricted fields: ${y.join(", ")}.`),this.activeSchema){let g=this.extractSchemaFieldSummary(this.activeSchema);c+=`
23
+ Data structure: ${g}. Full schema: resource liop://schema/global`;}l=async(g,k)=>{let m="global_connection",S=Date.now(),x=this.connectionStats.get(m)||{failures:0,lastAttempt:0};if(x.failures>=this.THROTTLE_THRESHOLD&&S-x.lastAttempt<this.THROTTLE_COOLDOWN_MS)return {content:[{type:"text",text:"LIOP_THROTTLED: Too many violations. Cooling down for 60 seconds."}],isError:true};let T=g.payload,M=g.__liop_bypass_ast_cache===true,D=me.createHash("sha256").update(T).digest("hex"),K=this.extractLogic(T),ge=this.logicCache.get(D);if(!M&&ge&&S-ge.timestamp<this.CACHE_TTL_MS&&K){g.payload=K;let j=this.runPreflightPolicy(t,K,n,"mcp-client");return j?{content:[{type:"text",text:j}],isError:true}:await this.executeInWorkerPool(g,K,t)}if(!K)return x.failures++,x.lastAttempt=S,this.connectionStats.set(m,x),{content:[{type:"text",text:"Error: Malformed payload. Missing @LIOP boundary.\\nYou MUST wrap your logic exactly like this:\\n\\n@LIOP{wasi_v1,DynamicAudit}\\n// Your JS code here\\n@END"}],isError:true};try{let j=this.extractLogic(g.payload);g.payload=j;let X=this.runPreflightPolicy(t,j,n,"mcp-client");if(X)return x.failures++,x.lastAttempt=S,this.connectionStats.set(m,x),{content:[{type:"text",text:X}],isError:!0};let ee=await this.executeInWorkerPool(g,j,t);return ee.isError?(x.failures++,x.lastAttempt=S,this.connectionStats.set(m,x)):(this.connectionStats.set(m,{failures:0,lastAttempt:S}),this.logicCache.set(D,{hash:D,timestamp:S})),ee}catch(j){let X=j;return x.failures++,x.lastAttempt=S,this.connectionStats.set(m,x),{content:[{type:"text",text:`ExecutionRuntimeException: ${X.message}`}],isError:true}}};}let p={type:"object",properties:u.properties||{},required:u.required};this.tools.set(t,{tool:{name:t,description:c,inputSchema:p},handler:l,schema:a,policy:n}),this.meshNode&&this.meshNode.announceCapability(t).catch(y=>{a$1.info(`[LIOP-Mesh] Failed to auto-announce tool ${t}: ${y.message}`);});}prompt(t,i,r,s){if(this.prompts.has(t))throw new Error(`Prompt already registered: ${t}`);this.prompts.set(t,{prompt:{name:t,description:i,arguments:r},handler:s});}enableZeroShotAutonomy(){this.prompt("liop_blind_analyst","The official Logic-Injection-on-Origin Protocol system prompt. Instructs the LLM on how to securely inject Logic-on-Origin without violating PII or safety constraints.",[],t=>({description:"LIOP Blind Analyst Instructions",messages:[{role:"user",content:{type:"text",text:`You are the "Blind Analyst" operating within the Logic-Injection-on-Origin Protocol (LIOP) ecosystem.
24
24
  Your objective is to perform secure Logic-on-Origin injections. You must process remote data without ever requesting its extraction.
25
25
 
26
26
  INDUSTRIAL CONSTRAINTS & PROTOCOL RULES:
@@ -48,7 +48,7 @@ CURRENT DATA DICTIONARY (STRICT):
48
48
  ${JSON.stringify(this.activeSchema,null,2)}`:""}
49
49
 
50
50
  Protocol Adherence is mandatory for successful execution.`}}]}));}resource(t,i,r,s,n){if(this.resources.has(i))throw new Error(`Resource URI already registered: ${i}`);this.resources.set(i,{name:t,uri:i,description:r,mimeType:s,content:n});}buildExecutionGuidelines(){return ["LIOP Sandbox Execution Guidelines","=================================","","1. DATE POISONING & FILTERING WORKAROUND:"," The global 'Date' class is set to undefined inside the sandbox. Calling 'new Date()', 'Date.now()', or 'Date.parse()' will throw a ReferenceError."," - Workaround: Perform chronological filtering using lexicographical string comparisons on ISO 8601 strings."," Example: const filtered = env.records.filter(r => r.date >= '2024-01-01' && r.date <= '2024-12-31');","","2. K-ANONYMITY CONSTRAINTS:"," - Datasets with LESS than 10 records: The returned object must contain at most 3 scalar fields, and must NOT contain any arrays or nested objects."," - Datasets with 10 or MORE records: The returned object can contain up to 10 fields.","","3. DIFFERENTIAL PRIVACY SUFFIXES:"," To avoid Laplacian noise adding random perturbations to your counts or averages, you must name your object keys using specific terms:"," - Counts (Exact, no noise): Key names must contain 'count', 'length', 'size', 'num', 'positive', 'negative', or start with 'total_' or 'num_'."," - Averages (Reduced noise): Key names must contain 'avg', 'mean', or 'average'."," - Sums/Other: Will receive full Laplace noise.","","4. GENERAL RESTRICTIONS:"," - Do not use 'eval', 'Function', 'setTimeout', 'setInterval', 'Buffer', 'ArrayBuffer', or TypedArrays."," - Do not attempt to modify prototypes (Object.prototype, Array.prototype)."].join(`
51
- `)}dataDictionary(t,i="Global Medical Data Dictionary",r="liop://schema/global",s="Exposes the internal database schema for Zero-Shot Autonomy planning"){t.$comment="LIOP DIRECTIVES: 1. Date is undefined (Date.now(), new Date() throw). Workaround: use lexicographical string comparison on ISO 8601 string dates (e.g. record.date >= '2024-01-01'). 2. Small datasets (<10 records) limit outputs to max 3 scalar keys with NO nesting. 3. DP counts must contain count/length/size/num/total_ prefix/suffix.",this.activeSchema=t;let n=this.extractSchemaFieldSummary(t);for(let[a,u]of this.tools.entries())u.schema.shape.payload&&u.schema.shape.payload instanceof b$2.ZodString&&u.tool.description&&!u.tool.description.includes("Data structure:")&&(u.tool.description+=`
52
- Data structure: ${n}. Full schema: resource ${r}. Guidelines: resource liop://schema/guidelines`,this.tools.set(a,u));this.resources.has("liop://schema/guidelines")||this.resource("LIOP Execution Guidelines","liop://schema/guidelines","Directives for generating compliant JavaScript code for the LIOP Sandbox runtime","text/plain",()=>Promise.resolve(this.buildExecutionGuidelines())),this.resource(i,r,s,"application/json",JSON.stringify(t,null,2));}clearAstCache(){this.logicCache.clear(),a$1.info("[LIOP-SDK] AST Security Cache cleared by Admin.");}checkToolCallRateLimit(t){let i=Date.now(),r=this.toolCallWindowMs,s=this.toolCallMaxPerWindow,a=(this.toolCallWindows.get(t)||[]).filter(u=>i-u<r);if(a.length>=s){let u=Math.ceil((a[0]+r-i)/1e3);return {content:[{type:"text",text:`LIOP_RATE_LIMITED: Too many calls to ${t}. Max ${s} per ${r/1e3}s window. Retry after ${u}s.`}],isError:true}}return a.push(i),this.toolCallWindows.set(t,a),null}checkGlobalRateLimit(){let t=Date.now(),i=this.toolCallWindowMs,r=this.globalCallMaxPerWindow;if(this.globalCallWindow=this.globalCallWindow.filter(s=>t-s<i),this.globalCallWindow.length>=r){let s=Math.ceil((this.globalCallWindow[0]+i-t)/1e3);return {content:[{type:"text",text:`LIOP_RATE_LIMITED: Global call limit exceeded. Max ${r} total calls per ${i/1e3}s window. Retry after ${s}s.`}],isError:true}}return this.globalCallWindow.push(t),null}async callTool(t,i="local-client"){let r=this.tools.get(t.name);if(!r)throw new Error(`Tool not found: ${t.name}`);let s=this.checkGlobalRateLimit();if(s)return s;let n=this.checkToolCallRateLimit(t.name);if(n)return n;try{let a=r.schema.parse(t.arguments||{});if(t.arguments?.__liop_bypass_ast_cache===!0&&(a.__liop_bypass_ast_cache=!0),a&&typeof a.payload=="string"){let c=a.payload,l=this.extractLogic(c);if(l){let p=this.runPreflightPolicy(t.name,l,r.policy,i);return p?{content:[{type:"text",text:p}],isError:!0}:(a.payload=l,await this.executeInWorkerPool(a,l,t.name))}}return await r.handler(a,{})}catch(a){let u=a;return u instanceof b$2.ZodError?{content:[{type:"text",text:`Validation Error: ${u.message}`}],isError:true}:{content:[{type:"text",text:`Internal Execution Error: ${u.message}`}],isError:true}}}listTools(){return Array.from(this.tools.values()).map(t=>t.tool)}listPrompts(){return Array.from(this.prompts.values()).map(t=>t.prompt)}async getPrompt(t){let i=this.prompts.get(t.name);if(!i)throw new Error(`Prompt not found: ${t.name}`);return await i.handler(t)}listResources(){return Array.from(this.resources.values())}async readResource(t){let i=this.resources.get(t);if(!i)throw new Error(`Resource not found: ${t}`);let r="No description provided";return typeof i.content=="function"?r=await i.content():typeof i.content=="string"?r=i.content:i.description&&(r=i.description),{contents:[{uri:i.uri,mimeType:i.mimeType||"text/plain",text:r}]}}getServerInfo(){return this.serverInfo}getMeshNode(){return this.meshNode}setSandboxData(t){this.sandboxRecords=t;}getBoundPort(){return this.boundPort}async connectToMesh(t={}){let i=process.env.LIOP_GRPC_PORT?Number.parseInt(process.env.LIOP_GRPC_PORT,10):void 0,r=t.port??i??50051,s=/^[A-Z][A-Z0-9_]*$/;if(this.config?.tokenSlug&&!s.test(this.config.tokenSlug))throw new Error(`Invalid tokenSlug "${this.config.tokenSlug}". Must match SCREAMING_SNAKE_CASE: /^[A-Z][A-Z0-9_]*$/ (e.g., "BANK", "VAULT", "HFT_ORACLE").`);this.meshNode=new a$2(t.meshConfig),await this.meshNode.start();let n=this.meshNode;this.meshNode.registerManifestHandler(()=>{let a=this.listTools().map(c=>({name:c.name,description:c.description,inputSchema:c.inputSchema})),u=Array.from(this.resources.values()).map(c=>({name:c.name,uri:c.uri,description:c.description,mimeType:c.mimeType,text:typeof c.content=="string"?c.content:c.description}));return {peerId:n.getPeerId(),grpcPort:r,tools:a,resources:u,serverInfo:this.serverInfo,authRequired:this.jwtValidator!==void 0,tokenSlug:this.config?.tokenSlug,taxonomy:this.config?.taxonomy?{domain:this.config.taxonomy.domain||"Unknown Domain",clearanceTier:this.config.taxonomy.clearanceTier??0,executionTypes:this.config.taxonomy.executionTypes||[]}:void 0}});for(let a of this.listTools())await this.meshNode.announceCapability(a.name).catch(a$1.info);await this.meshNode.announceManifest().catch(a$1.info),this.rpcServer=new Me,this.rpcServer.addService({negotiateIntent:(a,u)=>{let c=a.request;if(a$1.info(`[LIOP-RPC] Negotiating intent for capability: ${c.capability_hash}`),this.jwtValidator){let l=a.metadata.get("authorization")[0];if(!l){u({code:H.status.UNAUTHENTICATED,details:"Missing Authorization header in gRPC metadata"});return}let p=l.startsWith("Bearer ")?l.slice(7):l,x=de.createHash("sha256").update(p).digest("hex").toLowerCase();if(this.loadRevocationList(),this.revokedTokenHashes.has(x)){u({code:H.status.UNAUTHENTICATED,details:"Token has been revoked by the resource owner"});return}let d=this.config?.auth?.localTestToken,k=/^[a-zA-Z0-9_-]+-local-test-token$/;if(d){if(p===d){a$1.info(`[LIOP-RPC] Bypass authentication for matching localTestToken: ${d}`),import('./kyber-NONMBQNH.js').then(async({Kyber768Wrapper:g})=>{let{publicKey:_,secretKey:w}=await g.generateKeyPair(),N=de.randomUUID();this.sessions.set(N,{capability_hash:c.capability_hash,kyber_sk:w,agent_did:c.agent_did,tokenHash:x}),u(null,{accepted:true,session_token:N,error_message:"",kyber_public_key:_});});return}u({code:H.status.PERMISSION_DENIED,details:p&&k.test(p)?"Pre-shared local test token is invalid for this resource domain (segregation violation).":"Access Denied: This restricted node requires its specific static access token."});return}this.jwtValidator.validate(p).then(g=>{let _=a$3("tools/call",g);if(!_.allowed){u({code:H.status.PERMISSION_DENIED,details:_.reason||"Access Denied"});return}import('./kyber-NONMBQNH.js').then(async({Kyber768Wrapper:w})=>{let{publicKey:N,secretKey:Z}=await w.generateKeyPair(),B=de.randomUUID();this.sessions.set(B,{capability_hash:c.capability_hash,kyber_sk:Z,agent_did:c.agent_did,tokenHash:x}),u(null,{accepted:true,session_token:B,error_message:"",kyber_public_key:N});});}).catch(g=>{u({code:H.status.UNAUTHENTICATED,details:`Invalid JWT token: ${g.message}`});});}else import('./kyber-NONMBQNH.js').then(async({Kyber768Wrapper:l})=>{let{publicKey:p,secretKey:x}=await l.generateKeyPair(),d=de.randomUUID();this.sessions.set(d,{capability_hash:c.capability_hash,kyber_sk:x,agent_did:c.agent_did}),u(null,{accepted:true,session_token:d,error_message:"",kyber_public_key:p});});},executeLogic:async a=>{let u=a.request;a$1.info(`[LIOP-RPC] Executing Logic-on-Origin for session: ${u.session_token}`);let c=async()=>{let l=this.sessions.get(u.session_token);if(!l){a.emit("error",{code:H.status.UNAUTHENTICATED,details:"Invalid session token"});return}if(l.tokenHash&&(this.loadRevocationList(),this.revokedTokenHashes.has(l.tokenHash))){a.emit("error",{code:H.status.UNAUTHENTICATED,details:"Token has been revoked by the resource owner"});return}let p=l.capability_hash,d=(p?this.tools.get(p):void 0)?.policy;try{let g=(await createMlKem768()).decap(new Uint8Array(u.pqc_ciphertext),l.kyber_sk),_=Buffer.from(g),w=Buffer.from(u.wasm_binary),N=w.subarray(-16),Z=w.subarray(0,-16),B=de.createDecipheriv("aes-256-gcm",_,Buffer.from(u.aes_nonce||new Uint8Array(12)));B.setAuthTag(N);let K=B.update(Z);K=Buffer.concat([K,B.final()]);let me=K.toString("utf-8"),M=this.extractLogic(me)||me.trim(),X=this.runPreflightPolicy(p||"unknown_tool",M,d,u.session_token);if(X){a$1.info(`[LIOP-RPC] Preflight blocked: ${X}`);let ee={semantic_evidence:X,cryptographic_proof:Buffer.from(""),zk_receipt:Buffer.from(""),is_error:!0};a.write(ee,()=>{a.end();});return}}catch(k){let g=k instanceof Error?k.message:String(k);a$1.error(`[LIOP-RPC] Preflight decryption failed: ${g}`),a.emit("error",{code:H.status.INTERNAL,details:`Preflight logic analysis failed: ${g}`});return}try{let k=d?{epsilon:d.dpEpsilon??1,sensitivity:d.dpSensitivity??1,smallDatasetThreshold:d.dpSmallDatasetThreshold??50}:void 0,g=await this.workerPool.run({ciphertext:u.pqc_ciphertext,secretKeyObj:Array.from(l.kyber_sk),wasmBinary:u.wasm_binary,inputs:u.inputs,aesNonce:u.aes_nonce,records:this.sandboxRecords,sessionToken:u.session_token,isEncrypted:!0,dpConfig:k}),_=Ye(g.output),w,N=_;try{w=typeof _=="string"?_:JSON.stringify(_);let M=JSON.parse(w);if(M.__liop_proxy_tool){a$1.info(`[LIOP-RPC] Executing Proxied Tool: ${M.__liop_proxy_tool}`);let X=l.agent_did||"unknown-client",ee=await this.callTool({name:M.__liop_proxy_tool,arguments:M.__liop_proxy_args||{}},X);if(ee.isError){a$1.info(`[LIOP-RPC] Proxy tool execution failed: ${ee.content[0].text}`);let Qi={semantic_evidence:ee.content[0].text||"Unknown error",cryptographic_proof:Buffer.from(""),zk_receipt:Buffer.from(""),is_error:!0};a.write(Qi,()=>{a.end();});return}let _t=Ye(ee);w=JSON.stringify(_t),N=this.unwrapForAggregationPolicyScan(_t);}}catch{w=String(_);}let Z=this.validateOutputPolicy(p||"unknown_tool",N,d);if(Z){a$1.info(`[LIOP-RPC] Output policy blocked for ${p||"unknown_tool"}: ${Z}`);let ee={semantic_evidence:process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.LIOP_SEC_VERBOSE==="1"?Z:"[LIOP] Egress Security Violation. Output blocked due to policy enforcement.",cryptographic_proof:Buffer.from(""),zk_receipt:Buffer.from(""),is_error:!0};a.write(ee,()=>{a.end();});return}let B={semantic_evidence:w,cryptographic_proof:Buffer.from(g.image_id||"","hex"),zk_receipt:g.zk_receipt?Buffer.from(g.zk_receipt,"base64"):Buffer.from(""),is_error:!1},K=await this.piiScanner.scan(N),me=this.violatesAggregationFirstPolicy(this.unwrapForAggregationPolicyScan(N),d?.enforceAggregationFirst,this.sandboxRecords?.length);if(K||me){let M=K||"Aggregation-First Policy Violation";a$1.info(`[LIOP-RPC] Secure egress blocked in gRPC stream: ${M}`),B.semantic_evidence="[LIOP] Egress Security Violation. Output blocked due to policy enforcement.",B.is_error=!0;}a.write(B,()=>{a.end();});}catch(k){let g=k,_=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test",w=g.message||String(k);a$1.error(`[LIOP-RPC] Execution Error: ${w}`);let Z={semantic_evidence:_?`Execution Error: ${w}`:"[LIOP] Execution Failed. The injected logic violated runtime constraints or encountered a fatal error.",cryptographic_proof:Buffer.from(""),zk_receipt:Buffer.from(""),is_error:true};try{a.write(Z,()=>{a.end();});}catch{a.end();}}};if(this.jwtValidator){let l=a.metadata.get("authorization")[0];if(!l){a.emit("error",{code:H.status.UNAUTHENTICATED,details:"Missing Authorization header in gRPC metadata"});return}let p=l.startsWith("Bearer ")?l.slice(7):l,x=de.createHash("sha256").update(p).digest("hex").toLowerCase();if(this.loadRevocationList(),this.revokedTokenHashes.has(x)){a.emit("error",{code:H.status.UNAUTHENTICATED,details:"Token has been revoked by the resource owner"});return}let d=this.config?.auth?.localTestToken,k=/^[a-zA-Z0-9_-]+-local-test-token$/;if(d){if(p===d){a$1.info(`[LIOP-RPC] Bypass authentication in executeLogic for matching localTestToken: ${d}`),await c();return}a.emit("error",{code:H.status.PERMISSION_DENIED,details:p&&k.test(p)?"Pre-shared local test token is invalid for this resource domain (segregation violation).":"Access Denied: This restricted node requires its specific static access token."});return}try{let g=await this.jwtValidator.validate(p),_=a$3("tools/call",g);if(!_.allowed){a.emit("error",{code:H.status.PERMISSION_DENIED,details:_.reason||"Access Denied"});return}await c();}catch(g){a.emit("error",{code:H.status.UNAUTHENTICATED,details:`Invalid JWT token: ${g instanceof Error?g.message:String(g)}`});}}else await c();}}),this.boundPort=await this.rpcServer.listen(r),a$1.info(`[LIOP-SDK] Node successfully announced to Mesh. PeerID: ${this.meshNode.getPeerId()}`);}async executeInWorkerPool(t,i,r){try{let s=r?this.tools.get(r)?.policy:void 0,n=s?{epsilon:s.dpEpsilon??1,sensitivity:s.dpSensitivity??1,smallDatasetThreshold:s.dpSmallDatasetThreshold??50}:void 0,a=await this.workerPool.run({ciphertext:new Uint8Array(0),secretKeyObj:Array.from(new Uint8Array(0)),kyberPublicKey:new Uint8Array(0),wasmBinary:Buffer.from(i),inputs:{},records:this.sandboxRecords,sessionToken:"local-dev-token",isEncrypted:!1,dpConfig:n}),u=a.output,c=Ye(u),p=[{type:"text",text:JSON.stringify({computation_result:c,image_id:a.image_id,zk_receipt:a.zk_receipt,status:"Worker Pool Execution Success"})}],x=r?this.tools.get(r)?.policy:void 0,d=this.validateOutputPolicy(r||"unknown_tool",c,x);if(d)return a$1.info(`[LIOP-SDK] Output policy blocked for ${r||"unknown_tool"}: ${d}`),{content:[{type:"text",text:process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.LIOP_SEC_VERBOSE==="1"?d:"[LIOP] Egress Security Violation. Output blocked due to policy enforcement. Ensure your logic uses strictly aggregated, non-PII patterns."}],isError:!0};let k=await this.piiScanner.scan(c),g=this.violatesAggregationFirstPolicy(c,x?.enforceAggregationFirst,this.sandboxRecords?.length);if(k||g){let _=k||"Aggregation-First Policy Violation: Output blocked due to dynamic flat-key policy enforcement.";return a$1.info(`[LIOP-SDK] Secure egress blocked in local execution: ${_}`),{content:[{type:"text",text:process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.LIOP_SEC_VERBOSE==="1"?`[LIOP] Egress Security Violation: ${_}`:"[LIOP] Egress Security Violation. Output blocked due to policy enforcement. Ensure your logic uses strictly aggregated, non-PII patterns."}],isError:!0}}return {content:p}}catch(s){let n=s,a=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.LIOP_SEC_VERBOSE==="1",u=n.message||String(s);return a$1.error(`[LIOP-SDK] WorkerPool Execution Fault: ${u}`),{content:[{type:"text",text:u.includes("worker_thread_exited")||u.includes("ERR_WORKER_OUT_OF_MEMORY")||u.includes("terminated")||u.includes("heap limit")?"[LIOP] Execution terminated: memory limit exceeded (64MB heap). Reduce data processing volume.":a?`WorkerPoolError: ${u}`:"[LIOP] Execution Failed. The injected logic violated runtime constraints or encountered a fatal error."}],isError:true}}}async close(){this.workerPool&&await this.workerPool.close({force:true}),this.rpcServer&&await this.rpcServer.stop(),this.meshNode&&await this.meshNode.stop();}loadRevocationList(){let t=this.config?.auth?.revocationPath;if(t)try{if(j.existsSync(t)){let i=j.statSync(t);if(i.mtimeMs<=this.lastRevocationLoadTime)return;let r=j.readFileSync(t,"utf-8"),s=JSON.parse(r);if(Array.isArray(s)){this.revokedTokenHashes.clear();for(let n of s)typeof n=="string"&&this.revokedTokenHashes.add(n.trim().toLowerCase());this.lastRevocationLoadTime=i.mtimeMs,a$1.info(`[LiopServer] Loaded ${this.revokedTokenHashes.size} revoked token hashes from ${t}`);}}else {let i=Se.dirname(t);j.existsSync(i)||j.mkdirSync(i,{recursive:!0}),j.writeFileSync(t,JSON.stringify([],null,2),"utf-8"),this.lastRevocationLoadTime=Date.now(),a$1.info(`[LiopServer] Created empty local revocation list at ${t}`);}}catch(i){a$1.error(`[LiopServer] Failed to load revocation list: ${i instanceof Error?i.message:String(i)}`);}}revokeToken(t){if(!t)return;let i=de.createHash("sha256").update(t).digest("hex").toLowerCase();this.revokeTokenHash(i);}revokeTokenHash(t){if(!t)return;let i=t.toLowerCase();this.loadRevocationList(),this.revokedTokenHashes.add(i);let r=this.config?.auth?.revocationPath;if(r)try{let s=Se.dirname(r);j.existsSync(s)||j.mkdirSync(s,{recursive:!0});let n=Array.from(this.revokedTokenHashes);j.writeFileSync(r,JSON.stringify(n,null,2),"utf-8");let a=j.statSync(r);this.lastRevocationLoadTime=a.mtimeMs,a$1.info(`[LiopServer] Persisted revocation for hash ${i} to ${r}`);}catch(s){a$1.error(`[LiopServer] Failed to persist revocation: ${s instanceof Error?s.message:String(s)}`);}}};
53
- export{Me as a,le as b,Pe as c,ai as d,Je as e,Ye as f,D as g,qi as h,Qe as i,Yi as j};//# sourceMappingURL=chunk-KQ5BDO2M.js.map
54
- //# sourceMappingURL=chunk-KQ5BDO2M.js.map
51
+ `)}dataDictionary(t,i="Global Medical Data Dictionary",r="liop://schema/global",s="Exposes the internal database schema for Zero-Shot Autonomy planning"){t.$comment="LIOP DIRECTIVES: 1. Date is undefined (Date.now(), new Date() throw). Workaround: use lexicographical string comparison on ISO 8601 string dates (e.g. record.date >= '2024-01-01'). 2. Small datasets (<10 records) limit outputs to max 3 scalar keys with NO nesting. 3. DP counts must contain count/length/size/num/total_ prefix/suffix.",this.activeSchema=t;let n=this.extractSchemaFieldSummary(t);for(let[a,u]of this.tools.entries())u.schema.shape.payload&&u.schema.shape.payload instanceof b$3.ZodString&&u.tool.description&&!u.tool.description.includes("Data structure:")&&(u.tool.description+=`
52
+ Data structure: ${n}. Full schema: resource ${r}. Guidelines: resource liop://schema/guidelines`,this.tools.set(a,u));this.resources.has("liop://schema/guidelines")||this.resource("LIOP Execution Guidelines","liop://schema/guidelines","Directives for generating compliant JavaScript code for the LIOP Sandbox runtime","text/plain",()=>Promise.resolve(this.buildExecutionGuidelines())),this.resource(i,r,s,"application/json",JSON.stringify(t,null,2));}clearAstCache(){this.logicCache.clear(),a$1.info("[LIOP-SDK] AST Security Cache cleared by Admin.");}checkToolCallRateLimit(t){let i=Date.now(),r=this.toolCallWindowMs,s=this.toolCallMaxPerWindow,a=(this.toolCallWindows.get(t)||[]).filter(u=>i-u<r);if(a.length>=s){let u=Math.ceil((a[0]+r-i)/1e3);return {content:[{type:"text",text:`LIOP_RATE_LIMITED: Too many calls to ${t}. Max ${s} per ${r/1e3}s window. Retry after ${u}s.`}],isError:true}}return a.push(i),this.toolCallWindows.set(t,a),null}checkGlobalRateLimit(){let t=Date.now(),i=this.toolCallWindowMs,r=this.globalCallMaxPerWindow;if(this.globalCallWindow=this.globalCallWindow.filter(s=>t-s<i),this.globalCallWindow.length>=r){let s=Math.ceil((this.globalCallWindow[0]+i-t)/1e3);return {content:[{type:"text",text:`LIOP_RATE_LIMITED: Global call limit exceeded. Max ${r} total calls per ${i/1e3}s window. Retry after ${s}s.`}],isError:true}}return this.globalCallWindow.push(t),null}async callTool(t,i="local-client"){let r=this.tools.get(t.name);if(!r)throw new Error(`Tool not found: ${t.name}`);let s=this.checkGlobalRateLimit();if(s)return s;let n=this.checkToolCallRateLimit(t.name);if(n)return n;try{let a=r.schema.parse(t.arguments||{});if(t.arguments?.__liop_bypass_ast_cache===!0&&(a.__liop_bypass_ast_cache=!0),a&&typeof a.payload=="string"){let c=a.payload,l=this.extractLogic(c);if(l){let p=this.runPreflightPolicy(t.name,l,r.policy,i);return p?{content:[{type:"text",text:p}],isError:!0}:(a.payload=l,await this.executeInWorkerPool(a,l,t.name))}}return await r.handler(a,{})}catch(a){let u=a;return u instanceof b$3.ZodError?{content:[{type:"text",text:`Validation Error: ${u.message}`}],isError:true}:{content:[{type:"text",text:`Internal Execution Error: ${u.message}`}],isError:true}}}listTools(){return Array.from(this.tools.values()).map(t=>t.tool)}listPrompts(){return Array.from(this.prompts.values()).map(t=>t.prompt)}async getPrompt(t){let i=this.prompts.get(t.name);if(!i)throw new Error(`Prompt not found: ${t.name}`);return await i.handler(t)}listResources(){return Array.from(this.resources.values())}async readResource(t){let i=this.resources.get(t);if(!i)throw new Error(`Resource not found: ${t}`);let r="No description provided";return typeof i.content=="function"?r=await i.content():typeof i.content=="string"?r=i.content:i.description&&(r=i.description),{contents:[{uri:i.uri,mimeType:i.mimeType||"text/plain",text:r}]}}getServerInfo(){return this.serverInfo}getMeshNode(){return this.meshNode}setSandboxData(t){this.sandboxRecords=t;}getBoundPort(){return this.boundPort}async connectToMesh(t={}){let i=process.env.LIOP_GRPC_PORT?Number.parseInt(process.env.LIOP_GRPC_PORT,10):void 0,r=t.port??i??50051,s=/^[A-Z][A-Z0-9_]*$/;if(this.config?.tokenSlug&&!s.test(this.config.tokenSlug))throw new Error(`Invalid tokenSlug "${this.config.tokenSlug}". Must match SCREAMING_SNAKE_CASE: /^[A-Z][A-Z0-9_]*$/ (e.g., "BANK", "VAULT", "HFT_ORACLE").`);this.meshNode=new a$2(t.meshConfig),await this.meshNode.start();let n=this.meshNode;this.meshNode.registerManifestHandler(()=>{let a=this.listTools().map(c=>({name:c.name,description:c.description,inputSchema:c.inputSchema})),u=Array.from(this.resources.values()).map(c=>({name:c.name,uri:c.uri,description:c.description,mimeType:c.mimeType,text:typeof c.content=="string"?c.content:c.description}));return {peerId:n.getPeerId(),grpcPort:r,tools:a,resources:u,serverInfo:this.serverInfo,authRequired:this.jwtValidator!==void 0,tokenSlug:this.config?.tokenSlug,taxonomy:this.config?.taxonomy?{domain:this.config.taxonomy.domain||"Unknown Domain",clearanceTier:this.config.taxonomy.clearanceTier??0,executionTypes:this.config.taxonomy.executionTypes||[]}:void 0}});for(let a of this.listTools())await this.meshNode.announceCapability(a.name).catch(a$1.info);await this.meshNode.announceManifest().catch(a$1.info),this.rpcServer=new Me,this.rpcServer.addService({negotiateIntent:(a,u)=>{let c=a.request;if(a$1.info(`[LIOP-RPC] Negotiating intent for capability: ${c.capability_hash}`),this.jwtValidator){let l=a.metadata.get("authorization")[0];if(!l){u({code:Z.status.UNAUTHENTICATED,details:"Missing Authorization header in gRPC metadata"});return}let p=l.startsWith("Bearer ")?l.slice(7):l,y=me.createHash("sha256").update(p).digest("hex").toLowerCase();if(this.loadRevocationList(),this.revokedTokenHashes.has(y)){u({code:Z.status.UNAUTHENTICATED,details:"Token has been revoked by the resource owner"});return}let g=this.config?.auth?.localTestToken,k=/^[a-zA-Z0-9_-]+-local-test-token$/;if(g){if(p===g){a$1.info(`[LIOP-RPC] Bypass authentication for matching localTestToken: ${g}`),import('./kyber-NONMBQNH.js').then(async({Kyber768Wrapper:m})=>{let{publicKey:S,secretKey:x}=await m.generateKeyPair(),T=me.randomUUID();this.sessions.set(T,{capability_hash:c.capability_hash,kyber_sk:x,agent_did:c.agent_did,tokenHash:y}),u(null,{accepted:true,session_token:T,error_message:"",kyber_public_key:S});});return}u({code:Z.status.PERMISSION_DENIED,details:p&&k.test(p)?"Pre-shared local test token is invalid for this resource domain (segregation violation).":"Access Denied: This restricted node requires its specific static access token."});return}this.jwtValidator.validate(p).then(m=>{let S=a$3("tools/call",m);if(!S.allowed){u({code:Z.status.PERMISSION_DENIED,details:S.reason||"Access Denied"});return}import('./kyber-NONMBQNH.js').then(async({Kyber768Wrapper:x})=>{let{publicKey:T,secretKey:M}=await x.generateKeyPair(),D=me.randomUUID();this.sessions.set(D,{capability_hash:c.capability_hash,kyber_sk:M,agent_did:c.agent_did,tokenHash:y}),u(null,{accepted:true,session_token:D,error_message:"",kyber_public_key:T});});}).catch(m=>{u({code:Z.status.UNAUTHENTICATED,details:`Invalid JWT token: ${m.message}`});});}else import('./kyber-NONMBQNH.js').then(async({Kyber768Wrapper:l})=>{let{publicKey:p,secretKey:y}=await l.generateKeyPair(),g=me.randomUUID();this.sessions.set(g,{capability_hash:c.capability_hash,kyber_sk:y,agent_did:c.agent_did}),u(null,{accepted:true,session_token:g,error_message:"",kyber_public_key:p});});},executeLogic:async a=>{let u=a.request;a$1.info(`[LIOP-RPC] Executing Logic-on-Origin for session: ${u.session_token}`);let c=async()=>{let l=this.sessions.get(u.session_token);if(!l){a.emit("error",{code:Z.status.UNAUTHENTICATED,details:"Invalid session token"});return}if(l.tokenHash&&(this.loadRevocationList(),this.revokedTokenHashes.has(l.tokenHash))){a.emit("error",{code:Z.status.UNAUTHENTICATED,details:"Token has been revoked by the resource owner"});return}let p=l.capability_hash,g=(p?this.tools.get(p):void 0)?.policy;try{let m=(await createMlKem768()).decap(new Uint8Array(u.pqc_ciphertext),l.kyber_sk),S=Buffer.from(m),x=Buffer.from(u.wasm_binary),T=x.subarray(-16),M=x.subarray(0,-16),D=me.createDecipheriv("aes-256-gcm",S,Buffer.from(u.aes_nonce||new Uint8Array(12)));D.setAuthTag(T);let K=D.update(M);K=Buffer.concat([K,D.final()]);let ge=K.toString("utf-8"),j=this.extractLogic(ge)||ge.trim(),X=this.runPreflightPolicy(p||"unknown_tool",j,g,u.session_token);if(X){a$1.info(`[LIOP-RPC] Preflight blocked: ${X}`);let ee={semantic_evidence:X,cryptographic_proof:Buffer.from(""),zk_receipt:Buffer.from(""),is_error:!0};a.write(ee,()=>{a.end();});return}}catch(k){let m=k instanceof Error?k.message:String(k);a$1.error(`[LIOP-RPC] Preflight decryption failed: ${m}`),a.emit("error",{code:Z.status.INTERNAL,details:`Preflight logic analysis failed: ${m}`});return}try{let k=g?{epsilon:g.dpEpsilon??1,sensitivity:g.dpSensitivity??1,smallDatasetThreshold:g.dpSmallDatasetThreshold??50}:void 0,m=await this.workerPool.run({ciphertext:u.pqc_ciphertext,secretKeyObj:Array.from(l.kyber_sk),wasmBinary:u.wasm_binary,inputs:u.inputs,aesNonce:u.aes_nonce,records:this.sandboxRecords,sessionToken:u.session_token,isEncrypted:!0,dpConfig:k}),S=Ye(m.output),x,T=S;try{x=typeof S=="string"?S:JSON.stringify(S);let j=JSON.parse(x);if(j.__liop_proxy_tool){a$1.info(`[LIOP-RPC] Executing Proxied Tool: ${j.__liop_proxy_tool}`);let X=l.agent_did||"unknown-client",ee=await this.callTool({name:j.__liop_proxy_tool,arguments:j.__liop_proxy_args||{}},X);if(ee.isError){a$1.info(`[LIOP-RPC] Proxy tool execution failed: ${ee.content[0].text}`);let Qi={semantic_evidence:ee.content[0].text||"Unknown error",cryptographic_proof:Buffer.from(""),zk_receipt:Buffer.from(""),is_error:!0};a.write(Qi,()=>{a.end();});return}let Et=Ye(ee);x=JSON.stringify(Et),T=this.unwrapForAggregationPolicyScan(Et);}}catch{x=String(S);}let M=this.validateOutputPolicy(p||"unknown_tool",T,g);if(M){a$1.info(`[LIOP-RPC] Output policy blocked for ${p||"unknown_tool"}: ${M}`);let ee={semantic_evidence:process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.LIOP_SEC_VERBOSE==="1"?M:"[LIOP] Egress Security Violation. Output blocked due to policy enforcement.",cryptographic_proof:Buffer.from(""),zk_receipt:Buffer.from(""),is_error:!0};a.write(ee,()=>{a.end();});return}let D={semantic_evidence:x,cryptographic_proof:Buffer.from(m.image_id||"","hex"),zk_receipt:m.zk_receipt?Buffer.from(m.zk_receipt,"base64"):Buffer.from(""),is_error:!1},K=await this.piiScanner.scan(T),ge=this.violatesAggregationFirstPolicy(this.unwrapForAggregationPolicyScan(T),g?.enforceAggregationFirst,this.sandboxRecords?.length);if(K||ge){let j=K||"Aggregation-First Policy Violation";a$1.info(`[LIOP-RPC] Secure egress blocked in gRPC stream: ${j}`),D.semantic_evidence="[LIOP] Egress Security Violation. Output blocked due to policy enforcement.",D.is_error=!0;}a.write(D,()=>{a.end();});}catch(k){let m=k,S=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test",x=m.message||String(k);a$1.error(`[LIOP-RPC] Execution Error: ${x}`);let M={semantic_evidence:S?`Execution Error: ${x}`:"[LIOP] Execution Failed. The injected logic violated runtime constraints or encountered a fatal error.",cryptographic_proof:Buffer.from(""),zk_receipt:Buffer.from(""),is_error:true};try{a.write(M,()=>{a.end();});}catch{a.end();}}};if(this.jwtValidator){let l=a.metadata.get("authorization")[0];if(!l){a.emit("error",{code:Z.status.UNAUTHENTICATED,details:"Missing Authorization header in gRPC metadata"});return}let p=l.startsWith("Bearer ")?l.slice(7):l,y=me.createHash("sha256").update(p).digest("hex").toLowerCase();if(this.loadRevocationList(),this.revokedTokenHashes.has(y)){a.emit("error",{code:Z.status.UNAUTHENTICATED,details:"Token has been revoked by the resource owner"});return}let g=this.config?.auth?.localTestToken,k=/^[a-zA-Z0-9_-]+-local-test-token$/;if(g){if(p===g){a$1.info(`[LIOP-RPC] Bypass authentication in executeLogic for matching localTestToken: ${g}`),await c();return}a.emit("error",{code:Z.status.PERMISSION_DENIED,details:p&&k.test(p)?"Pre-shared local test token is invalid for this resource domain (segregation violation).":"Access Denied: This restricted node requires its specific static access token."});return}try{let m=await this.jwtValidator.validate(p),S=a$3("tools/call",m);if(!S.allowed){a.emit("error",{code:Z.status.PERMISSION_DENIED,details:S.reason||"Access Denied"});return}await c();}catch(m){a.emit("error",{code:Z.status.UNAUTHENTICATED,details:`Invalid JWT token: ${m instanceof Error?m.message:String(m)}`});}}else await c();}}),this.boundPort=await this.rpcServer.listen(r),a$1.info(`[LIOP-SDK] Node successfully announced to Mesh. PeerID: ${this.meshNode.getPeerId()}`);}async executeInWorkerPool(t,i,r){try{let s=r?this.tools.get(r)?.policy:void 0,n=s?{epsilon:s.dpEpsilon??1,sensitivity:s.dpSensitivity??1,smallDatasetThreshold:s.dpSmallDatasetThreshold??50}:void 0,a=await this.workerPool.run({ciphertext:new Uint8Array(0),secretKeyObj:Array.from(new Uint8Array(0)),kyberPublicKey:new Uint8Array(0),wasmBinary:Buffer.from(i),inputs:{},records:this.sandboxRecords,sessionToken:"local-dev-token",isEncrypted:!1,dpConfig:n}),u=a.output,c=Ye(u),p=[{type:"text",text:JSON.stringify({computation_result:c,image_id:a.image_id,zk_receipt:a.zk_receipt,status:"Worker Pool Execution Success"})}],y=r?this.tools.get(r)?.policy:void 0,g=this.validateOutputPolicy(r||"unknown_tool",c,y);if(g)return a$1.info(`[LIOP-SDK] Output policy blocked for ${r||"unknown_tool"}: ${g}`),{content:[{type:"text",text:process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.LIOP_SEC_VERBOSE==="1"?g:"[LIOP] Egress Security Violation. Output blocked due to policy enforcement. Ensure your logic uses strictly aggregated, non-PII patterns."}],isError:!0};let k=await this.piiScanner.scan(c),m=this.violatesAggregationFirstPolicy(c,y?.enforceAggregationFirst,this.sandboxRecords?.length);if(k||m){let S=k||"Aggregation-First Policy Violation: Output blocked due to dynamic flat-key policy enforcement.";return a$1.info(`[LIOP-SDK] Secure egress blocked in local execution: ${S}`),{content:[{type:"text",text:process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.LIOP_SEC_VERBOSE==="1"?`[LIOP] Egress Security Violation: ${S}`:"[LIOP] Egress Security Violation. Output blocked due to policy enforcement. Ensure your logic uses strictly aggregated, non-PII patterns."}],isError:!0}}return {content:p}}catch(s){let n=s,a=process.env.NODE_ENV==="development"||process.env.NODE_ENV==="test"||process.env.LIOP_SEC_VERBOSE==="1",u=n.message||String(s);return a$1.error(`[LIOP-SDK] WorkerPool Execution Fault: ${u}`),{content:[{type:"text",text:u.includes("worker_thread_exited")||u.includes("ERR_WORKER_OUT_OF_MEMORY")||u.includes("terminated")||u.includes("heap limit")?"[LIOP] Execution terminated: memory limit exceeded (64MB heap). Reduce data processing volume.":a?`WorkerPoolError: ${u}`:"[LIOP] Execution Failed. The injected logic violated runtime constraints or encountered a fatal error."}],isError:true}}}async close(){this.workerPool&&await this.workerPool.close({force:true}),this.rpcServer&&await this.rpcServer.stop(),this.meshNode&&await this.meshNode.stop();}loadRevocationList(){let t=this.config?.auth?.revocationPath;if(t)try{if(R.existsSync(t)){let i=R.statSync(t);if(i.mtimeMs<=this.lastRevocationLoadTime)return;let r=R.readFileSync(t,"utf-8"),s=JSON.parse(r);if(Array.isArray(s)){this.revokedTokenHashes.clear();for(let n of s)typeof n=="string"&&this.revokedTokenHashes.add(n.trim().toLowerCase());this.lastRevocationLoadTime=i.mtimeMs,a$1.info(`[LiopServer] Loaded ${this.revokedTokenHashes.size} revoked token hashes from ${t}`);}}else {let i=le.dirname(t);R.existsSync(i)||R.mkdirSync(i,{recursive:!0}),R.writeFileSync(t,JSON.stringify([],null,2),"utf-8"),this.lastRevocationLoadTime=Date.now(),a$1.info(`[LiopServer] Created empty local revocation list at ${t}`);}}catch(i){a$1.error(`[LiopServer] Failed to load revocation list: ${i instanceof Error?i.message:String(i)}`);}}revokeToken(t){if(!t)return;let i=me.createHash("sha256").update(t).digest("hex").toLowerCase();this.revokeTokenHash(i);}revokeTokenHash(t){if(!t)return;let i=t.toLowerCase();this.loadRevocationList(),this.revokedTokenHashes.add(i);let r=this.config?.auth?.revocationPath;if(r)try{let s=le.dirname(r);R.existsSync(s)||R.mkdirSync(s,{recursive:!0});let n=Array.from(this.revokedTokenHashes);R.writeFileSync(r,JSON.stringify(n,null,2),"utf-8");let a=R.statSync(r);this.lastRevocationLoadTime=a.mtimeMs,a$1.info(`[LiopServer] Persisted revocation for hash ${i} to ${r}`);}catch(s){a$1.error(`[LiopServer] Failed to persist revocation: ${s instanceof Error?s.message:String(s)}`);}}getPersistentBudget(t){try{if(!R.existsSync(t))return {};let i=R.readFileSync(t,"utf-8");return JSON.parse(i||"{}")}catch{return {}}}savePersistentBudget(t,i){let r=`${t}.tmp`,s=le.dirname(t);R.existsSync(s)||R.mkdirSync(s,{recursive:true}),R.writeFileSync(r,JSON.stringify(i,null,2),"utf-8"),R.renameSync(r,t);}executeWithBudgetLock(t,i){let r=`${t}.lock`,s=100,a=0,u=le.dirname(t);if(!R.existsSync(u))try{R.mkdirSync(u,{recursive:!0});}catch{}for(;a<s;)try{R.writeFileSync(r,process.pid.toString(),{flag:"wx"});break}catch(c){if(c&&typeof c=="object"&&"code"in c&&c.code==="EEXIST"){a++;}else throw c}if(a>=s)throw new Error("Timeout acquiring lock for persistent query budget database");try{let c=this.getPersistentBudget(t),{result:l,updatedBudget:p}=i(c);return p&&this.savePersistentBudget(t,p),l}finally{try{R.existsSync(r)&&R.unlinkSync(r);}catch{}}}applyInMemoryBudget(t,i,r,s){let n=this.fieldQueryBudget.get(t);n||(n=new Map,this.fieldQueryBudget.set(t,n));let a=n.get(i);a||(a=new Map,n.set(i,a));for(let u of r){let c=this.taintAnalyzer.classifyField(u,s?.sensitiveKeys),l=25,p="public";if(s?.queryBudgetPerField!==void 0?(l=s.queryBudgetPerField,p="override"):c==="forbidden"?(l=3,p="forbidden"):c==="sensitive"&&(l=8,p="sensitive"),(a.get(u)??0)>=l)return `Preflight policy rejected: Query budget exceeded for field '${u}' (max ${l} per session for ${p} fields). Rotate PQC session to reset budget.`}for(let u of r){let c=a.get(u)??0;a.set(u,c+1);}return null}};
53
+ export{Me as a,pe as b,Pe as c,ai as d,Je as e,Ye as f,V as g,Gi as h,Qe as i,Yi as j};//# sourceMappingURL=chunk-MJOZVESE.js.map
54
+ //# sourceMappingURL=chunk-MJOZVESE.js.map