@iflow-ai/iflow-cli 0.2.36 → 0.2.37-beta.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/bundle/iflow.js CHANGED
@@ -831,14 +831,14 @@ ${JSON.stringify(p,null,2)}`),p.usage&&(this.lastUsageMetadata={total_tokens:p.u
831
831
  \u8FD9\u4E2A\u662F\u9519\u8BEF\u7684json\u683C\u5F0F\uFF1A
832
832
  ${e}
833
833
 
834
- \u8BF7\u76F4\u63A5\u8F93\u51FA\u4E00\u4E2A\u6B63\u786E\u7684json\u683C\u5F0F\uFF1A`;try{let n=await fetch("https://apis.iflow.cn/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({model:"QWen3-4B",messages:[{role:"user",content:r}],temperature:.1,max_tokens:1e3})});if(!n.ok)throw new Error(`API error: ${n.status}`);let i=await n.json();if(!i||!i.choices||!Array.isArray(i.choices)||i.choices.length===0)throw new Error("Invalid response format - missing or empty choices array");let o=i.choices[0]?.message?.content;if(!o||typeof o!="string")throw new Error("Invalid response - missing or invalid message content");let s=o.trim();if(s.startsWith("```json")?s=s.replace(/^```json\s*/,"").replace(/\s*```$/,""):s.startsWith("```")&&(s=s.replace(/^```\s*/,"").replace(/\s*```$/,"")),!s)throw new Error("Fixed JSON is empty after processing");return JSON.parse(s)}catch(n){throw Vg(n),console.error("QWen JSON fix failed:",n),n}}extractTextFromRequest(e){let r="";if(e.contents){let n=Array.isArray(e.contents)?e.contents:[e.contents];for(let i of n)if(i&&typeof i=="object"&&"parts"in i&&i.parts){let o=Array.isArray(i.parts)?i.parts:[i.parts];for(let s of o)if(s&&typeof s=="object"&&"text"in s&&s.text)r+=s.text+" ";else if(s.functionResponse&&s.functionResponse.response)for(let[a,c]of Object.entries(s.functionResponse.response))c!=null&&(r+=String(c)+" ")}}return e.config?.systemInstruction&&(r+=e.config.systemInstruction),r.trim()}extractTextFromEmbedRequest(e){if(e.contents){let r=Array.isArray(e.contents)?e.contents:[e.contents];for(let n of r)if(typeof n=="object"&&n!==null&&"parts"in n&&n.parts){let i=Array.isArray(n.parts)?n.parts:[n.parts];for(let o of i)if(typeof o=="object"&&o!==null&&"text"in o&&o.text)return o.text}else{if(typeof n=="string")return n;if(typeof n=="object"&&n!==null&&"text"in n&&n.text)return n.text}}return""}extractSystemInstruction(e){let r="";if(typeof e=="string")r=e;else if(Array.isArray(e)){for(let n of e)typeof n=="object"&&n!==null&&"text"in n&&n.text&&(r+=n.text+" ");r=r.trim()}else if(typeof e=="object"&&e!==null)if("parts"in e&&e.parts){let n=Array.isArray(e.parts)?e.parts:[e.parts];for(let i of n)typeof i=="object"&&i!==null&&"text"in i&&i.text&&(r+=i.text+" ");r=r.trim()}else"text"in e&&e.text&&(r=e.text);return r}convertToOpenAITools(e){if(!e||e.length===0)return[];let r=[];for(let n of e)if(n.functionDeclarations&&Array.isArray(n.functionDeclarations))for(let i of n.functionDeclarations)r.push({type:"function",function:{name:i.name||"",description:i.description,parameters:this.convertParameters(i.parameters||i.parametersJsonSchema)}});return r}convertParameters(e){if(!e)return;let r={STRING:"string",INTEGER:"integer",NUMBER:"number",BOOLEAN:"boolean",OBJECT:"object",ARRAY:"array"};if(typeof e=="object"&&e.type){if(typeof e.type=="string"&&(r[e.type]?e.type=r[e.type]:e.type=e.type.toLowerCase()),e.properties)for(let i in e.properties){let o=e.properties[i],s={};o.type&&(s.type=r[o.type]),o.description&&(s.description=o.description),e.properties[i]=s}return e.items&&(e.items=this.convertParameters(e.items)),e}let n=i=>{if(!i)return;let o={};if(i.type)switch(i.type){case"STRING":o.type="string";break;case"INTEGER":o.type="integer";break;case"NUMBER":o.type="number";break;case"BOOLEAN":o.type="boolean";break;case"OBJECT":o.type="object";break;case"ARRAY":o.type="array";break;default:o.type=i.type.toLowerCase()}if(o.type="object",i.description&&(o.description=i.description),i.enum&&(o.enum=i.enum),i.properties){o.properties={};for(let[s,a]of Object.entries(i.properties))o.properties[s]=n(a)}return i.items&&(o.items=n(i.items)),i.required&&(o.required=i.required),o};return n(e)}mapFinishReason(e){switch(e){case"stop":return E7.STOP;case"length":return E7.MAX_TOKENS;case"content_filter":return E7.SAFETY;case"tool_calls":return E7.MALFORMED_FUNCTION_CALL;default:return E7.OTHER}}convertResponseSchema(e){if(e)return e.type==="object"||e.type==="OBJECT"?{type:"json_schema",json_schema:{name:e.name||"",description:e.description||"",schema:this.convertSchemaToJsonSchema(e),strict:!0}}:{type:"json_schema",json_schema:{name:"response_schema",description:"Generated response schema",schema:this.convertSchemaToJsonSchema(e),strict:!0}}}convertSchemaToJsonSchema(e){if(!e)return{};let r={};if(e.type)switch(e.type){case"STRING":r.type="string";break;case"INTEGER":r.type="integer";break;case"NUMBER":r.type="number";break;case"BOOLEAN":r.type="boolean";break;case"OBJECT":r.type="object";break;case"ARRAY":r.type="array";break;default:r.type=typeof e.type=="string"?e.type.toLowerCase():e.type}if(e.description&&(r.description=e.description),e.enum&&(r.enum=e.enum),e.properties){r.properties={};for(let[n,i]of Object.entries(e.properties))r.properties[n]=this.convertSchemaToJsonSchema(i)}return e.items&&(r.items=this.convertSchemaToJsonSchema(e.items)),e.required&&(r.required=e.required),r.type==="object"&&!("additionalProperties"in r)&&(r.additionalProperties=!1),r}}});var C1,Xu,sU,aU,KK,tMt,a4=ae(()=>{"use strict";C1="Qwen3-Coder",Xu="Qwen3-Coder",sU="text-embedding-v1",aU="gemini-2.5-flash-lite",KK="https://apis.iflow.cn/v1",tMt="https://ducky.code.alibaba-inc.com/v1/openai"});async function FFe(t,e,r,n){if(e===$t.LOGIN_WITH_IFLOW){let i=await uD(e,r),o=await y5();if(!o)throw new Error("No API key found. Please re-authenticate.");let s=r.getContentGeneratorConfig();return new oU({model:r.getModel(),apiKey:o,baseUrl:s?.baseUrl||KK,authType:e,debugMode:r.getDebugMode(),multimodalModelName:"qwen3-vl-plus",config:r})}if(e===$t.CLOUD_SHELL){let i=await uD(e,r),o=await ANt(i);return new L8(i,o.projectId,t,n,o.userTier)}throw new Error(`Unsupported authType: ${e}`)}var UFe=ae(()=>{"use strict";g3();x7();yNt();fhe();LFe();a4();});function NOn(t){return t.replace(/([a-z])([A-Z])/g,"$1_$2").toUpperCase()}function _5(t){let e=NOn(t),r=`IFLOW_${t}`;if(process.env[r])return process.env[r];let n=`IFLOW_${e}`;if(process.env[n])return process.env[n];let i=`iflow_${t}`;if(process.env[i])return process.env[i];let o=`iflow_${e}`;if(process.env[o])return process.env[o]}function XK(){return _5("apiKey")}function ZK(){return _5("baseUrl")||_5("url")}function eX(){return _5("modelName")||_5("model")}function rMt(t){let e=_5(t);if(e===void 0)return;let r=e.toLowerCase();if(r==="true"||r==="1"||r==="yes")return!0;if(r==="false"||r==="0"||r==="no")return!1}function nMt(t){let e=_5(t);if(e===void 0)return;let r=Number(e);return isNaN(r)?void 0:r}function iMt(t){let e=_5(t);if(e!==void 0)return e.split(",").map(r=>r.trim()).filter(r=>r.length>0)}function E0e(){return!!(XK()||ZK()||eX())}function QFe(){let t={},e=["theme","selectedAuthType","sandbox","toolDiscoveryCommand","toolCallCommand","mcpServerCommand","contextFileName","preferredEditor","apiKey","baseUrl","modelName","searchApiKey","multimodalModelName","memoryImportFormat"],r=["useExternalAuth","showMemoryUsage","usageStatisticsEnabled","autoConfigureMaxOldSpaceSize","hideWindowTitle","hideTips","hideBanner","vimMode","ideModeFeature","ideMode","disableAutoUpdate","skipNextSpeakerCheck","useRipgrep"],n=["maxSessionTurns","memoryDiscoveryMaxDirs","tokensLimit","compressionTokenThreshold","shellTimeout"],i=["coreTools","excludeTools","allowMCPServers","excludeMCPServers"];return e.forEach(o=>{let s=_5(o);s!==void 0&&(t[o]=s)}),r.forEach(o=>{let s=rMt(o);s!==void 0&&(t[o]=s)}),n.forEach(o=>{let s=nMt(o);s!==void 0&&(t[o]=s)}),i.forEach(o=>{let s=iMt(o);s!==void 0&&(t[o]=s)}),t}function OOn(){return{apiKey:XK(),baseUrl:ZK(),model:eX()}}var qFe=ae(()=>{"use strict";});async function GFe(t,e,r){await DF()&&(await dhe()||console.log("OAuth2 credentials cleared due to expiration. Please authenticate when prompted."));let i=process.env.GEMINI_API_KEY,o=process.env.GOOGLE_API_KEY,s=process.env.GOOGLE_CLOUD_PROJECT,a=process.env.GOOGLE_CLOUD_LOCATION,c=XK(),u=ZK(),d=eX(),f=r?.apiKey||c,p=r?.baseUrl||u||kOn[e],h=t.getModel()||d||C1,m={model:h,authType:e,proxy:t?.getProxy(),debugMode:t?.getDebugMode(),config:t};return e===$t.CLOUD_SHELL?m:e===$t.LOGIN_WITH_IFLOW?(m.baseUrl=p||KK,m.multimodalModelName="qwen3-vl-plus",f&&(m.apiKey=f),m):([...Wg,$t.OPENAI_COMPATIBLE].includes(e)&&f&&(m.apiKey=f,m.baseUrl=p,m.model=h),m)}async function HFe(t,e,r){let i={headers:{"User-Agent":`iFlowCLI/0.2.36 (${process.platform}; ${process.arch})`}};if(t.authType&&[...Wg,$t.IDEA_LAB].includes(t.authType)||t.authType===$t.OPENAI_COMPATIBLE)return new oU({...t,config:e});if(t.authType===$t.LOGIN_WITH_IFLOW||t.authType===$t.CLOUD_SHELL)return FFe(i,t.authType,e,r);if([...Wg,$t.OPENAI_COMPATIBLE].includes(t.authType)||t.authType===$t.USE_GEMINI||t.authType===$t.USE_VERTEX_AI)return new the({apiKey:t.apiKey===""?void 0:t.apiKey,vertexai:t.vertexai,httpOptions:i}).models;throw new Error(`Error creating contentGenerator: Unsupported authType: ${t.authType}`)}var $t,Wg,kOn,g3=ae(()=>{"use strict";il();UFe();a4();LFe();qFe();x7();(function(t){t.LOGIN_WITH_IFLOW="oauth-iflow",t.USE_GEMINI="gemini-api-key",t.USE_VERTEX_AI="vertex-ai",t.CLOUD_SHELL="cloud-shell",t.IFLOW="iflow",t.AONE="aone",t.IDEA_LAB="idealab",t.OPENAI_COMPATIBLE="openai-compatible"})($t||($t={}));Wg=[$t.IFLOW,$t.AONE],kOn={[$t.IDEA_LAB]:"https://idealab.alibaba-inc.com/api/openai/v1",[$t.IFLOW]:KK,[$t.AONE]:tMt}});var v0e,oMt=ae(()=>{"use strict";v0e=class{prompts=new Map;registerPrompt(e){if(this.prompts.has(e.name)){let r=`${e.serverName}_${e.name}`;console.warn(`Prompt with name "${e.name}" is already registered. Renaming to "${r}".`),this.prompts.set(r,{...e,name:r})}else this.prompts.set(e.name,e)}getAllPrompts(){return Array.from(this.prompts.values()).sort((e,r)=>e.name.localeCompare(r.name))}getPrompt(e){return this.prompts.get(e)}getPromptsByServer(e){let r=[];for(let n of this.prompts.values())n.serverName===e&&r.push(n);return r.sort((n,i)=>n.name.localeCompare(i.name))}clear(){this.prompts.clear()}removePromptsByServer(e){for(let[r,n]of this.prompts.entries())n.serverName===e&&this.prompts.delete(r)}}});var fo,Yr,po,ho,su=ae(()=>{"use strict";fo=class{name;displayName;description;icon;kind;parameterSchema;isOutputMarkdown;canUpdateOutput;aliases;constructor(e,r,n,i,o,s,a=!0,c=!1,u=[]){this.name=e,this.displayName=r,this.description=n,this.icon=i,this.kind=o,this.parameterSchema=s,this.isOutputMarkdown=a,this.canUpdateOutput=c,this.aliases=u}get schema(){return{name:this.name,description:this.description,parameters:this.parameterSchema}}validateToolParams(e){return null}getDescription(e){return JSON.stringify(e)}shouldConfirmExecute(e,r){return Promise.resolve(!1)}toolLocations(e){return[]}};(function(t){t.ProceedOnce="proceed_once",t.ProceedAlways="proceed_always",t.ProceedAlwaysServer="proceed_always_server",t.ProceedAlwaysTool="proceed_always_tool",t.ModifyWithEditor="modify_with_editor",t.Cancel="cancel"})(Yr||(Yr={}));(function(t){t.FileSearch="fileSearch",t.Folder="folder",t.Globe="globe",t.Hammer="hammer",t.LightBulb="lightBulb",t.Pencil="pencil",t.Regex="regex",t.Terminal="terminal"})(po||(po={}));(function(t){t.Read="read",t.Edit="edit",t.Delete="delete",t.Move="move",t.Search="search",t.Execute="execute",t.Think="think",t.Fetch="fetch",t.Other="other"})(ho||(ho={}))});function SD(t,e){let r=new WeakSet;return JSON.stringify(t,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular]";r.add(i)}return i},e)}var C0e=ae(()=>{"use strict";});var Jo,lU=ae(()=>{"use strict";(function(t){t.INVALID_TOOL_PARAMS="invalid_tool_params",t.UNKNOWN="unknown",t.UNHANDLED_EXCEPTION="unhandled_exception",t.TOOL_NOT_REGISTERED="tool_not_registered",t.EXECUTION_FAILED="execution_failed",t.FILE_NOT_FOUND="file_not_found",t.FILE_WRITE_FAILURE="file_write_failure",t.READ_CONTENT_FAILURE="read_content_failure",t.ATTEMPT_TO_CREATE_EXISTING_FILE="attempt_to_create_existing_file",t.FILE_TOO_LARGE="file_too_large",t.PERMISSION_DENIED="permission_denied",t.NO_SPACE_LEFT="no_space_left",t.TARGET_IS_DIRECTORY="target_is_directory",t.PATH_NOT_IN_WORKSPACE="path_not_in_workspace",t.SEARCH_PATH_NOT_FOUND="search_path_not_found",t.SEARCH_PATH_NOT_A_DIRECTORY="search_path_not_a_directory",t.EDIT_PREPARATION_FAILURE="edit_preparation_failure",t.EDIT_NO_OCCURRENCE_FOUND="edit_no_occurrence_found",t.EDIT_EXPECTED_OCCURRENCE_MISMATCH="edit_expected_occurrence_mismatch",t.EDIT_NO_CHANGE="edit_no_change",t.GLOB_EXECUTION_ERROR="glob_execution_error",t.GREP_EXECUTION_ERROR="grep_execution_error",t.LS_EXECUTION_ERROR="ls_execution_error",t.PATH_IS_NOT_A_DIRECTORY="path_is_not_a_directory",t.MCP_TOOL_ERROR="mcp_tool_error",t.MEMORY_TOOL_EXECUTION_ERROR="memory_tool_execution_error",t.READ_MANY_FILES_SEARCH_ERROR="read_many_files_search_error",t.DISCOVERED_TOOL_EXECUTION_ERROR="discovered_tool_execution_error",t.WEB_FETCH_NO_URL_IN_PROMPT="web_fetch_no_url_in_prompt",t.WEB_FETCH_FALLBACK_FAILED="web_fetch_fallback_failed",t.WEB_FETCH_PROCESSING_ERROR="web_fetch_processing_error",t.WEB_SEARCH_FAILED="web_search_failed",t.HOOK_BLOCKED="hook_blocked"})(Jo||(Jo={}))});function MOn(t){return{text:t.text}}function POn(t,e){return[{text:M.t("mcpTool.messages.mediaDataProvided",{toolName:e,type:t.type,mimeType:t.mimeType})},{inlineData:{mimeType:t.mimeType,data:t.data}}]}function LOn(t,e){let r=t.resource;if(r?.text)return{text:r.text};if(r?.blob){let n=r.mimeType||"application/octet-stream";return[{text:M.t("mcpTool.messages.embeddedResourceProvided",{toolName:e,mimeType:n})},{inlineData:{mimeType:n,data:r.blob}}]}return null}function FOn(t){return{text:M.t("mcpTool.messages.resourceLink",{title:t.title||t.name,uri:t.uri})}}function UOn(t){let e=t?.[0]?.functionResponse,r=e?.response?.content,n=e?.name||"unknown tool";return Array.isArray(r)?r.flatMap(o=>{switch(o.type){case"text":return MOn(o);case"image":case"audio":return POn(o,n);case"resource":return LOn(o,n);case"resource_link":return FOn(o);default:return null}}).filter(o=>o!==null):[{text:M.t("mcpTool.errors.parseResponseFailed")}]}function QOn(t){let e=t?.[0]?.functionResponse?.response?.content;return Array.isArray(e)?e.map(n=>{switch(n.type){case"text":return n.text;case"image":return M.t("mcpTool.display.image",{mimeType:n.mimeType});case"audio":return M.t("mcpTool.display.audio",{mimeType:n.mimeType});case"resource_link":return M.t("mcpTool.display.resourceLink",{title:n.title||n.name,uri:n.uri});case"resource":return n.resource?.text?n.resource.text:M.t("mcpTool.display.embeddedResource",{mimeType:n.resource?.mimeType||M.t("mcpTool.display.unknownType")});default:return M.t("mcpTool.display.unknownContentType",{type:n.type})}}).join(`
834
+ \u8BF7\u76F4\u63A5\u8F93\u51FA\u4E00\u4E2A\u6B63\u786E\u7684json\u683C\u5F0F\uFF1A`;try{let n=await fetch("https://apis.iflow.cn/v1/chat/completions",{method:"POST",headers:{"Content-Type":"application/json",Authorization:`Bearer ${this.apiKey}`},body:JSON.stringify({model:"QWen3-4B",messages:[{role:"user",content:r}],temperature:.1,max_tokens:1e3})});if(!n.ok)throw new Error(`API error: ${n.status}`);let i=await n.json();if(!i||!i.choices||!Array.isArray(i.choices)||i.choices.length===0)throw new Error("Invalid response format - missing or empty choices array");let o=i.choices[0]?.message?.content;if(!o||typeof o!="string")throw new Error("Invalid response - missing or invalid message content");let s=o.trim();if(s.startsWith("```json")?s=s.replace(/^```json\s*/,"").replace(/\s*```$/,""):s.startsWith("```")&&(s=s.replace(/^```\s*/,"").replace(/\s*```$/,"")),!s)throw new Error("Fixed JSON is empty after processing");return JSON.parse(s)}catch(n){throw Vg(n),console.error("QWen JSON fix failed:",n),n}}extractTextFromRequest(e){let r="";if(e.contents){let n=Array.isArray(e.contents)?e.contents:[e.contents];for(let i of n)if(i&&typeof i=="object"&&"parts"in i&&i.parts){let o=Array.isArray(i.parts)?i.parts:[i.parts];for(let s of o)if(s&&typeof s=="object"&&"text"in s&&s.text)r+=s.text+" ";else if(s.functionResponse&&s.functionResponse.response)for(let[a,c]of Object.entries(s.functionResponse.response))c!=null&&(r+=String(c)+" ")}}return e.config?.systemInstruction&&(r+=e.config.systemInstruction),r.trim()}extractTextFromEmbedRequest(e){if(e.contents){let r=Array.isArray(e.contents)?e.contents:[e.contents];for(let n of r)if(typeof n=="object"&&n!==null&&"parts"in n&&n.parts){let i=Array.isArray(n.parts)?n.parts:[n.parts];for(let o of i)if(typeof o=="object"&&o!==null&&"text"in o&&o.text)return o.text}else{if(typeof n=="string")return n;if(typeof n=="object"&&n!==null&&"text"in n&&n.text)return n.text}}return""}extractSystemInstruction(e){let r="";if(typeof e=="string")r=e;else if(Array.isArray(e)){for(let n of e)typeof n=="object"&&n!==null&&"text"in n&&n.text&&(r+=n.text+" ");r=r.trim()}else if(typeof e=="object"&&e!==null)if("parts"in e&&e.parts){let n=Array.isArray(e.parts)?e.parts:[e.parts];for(let i of n)typeof i=="object"&&i!==null&&"text"in i&&i.text&&(r+=i.text+" ");r=r.trim()}else"text"in e&&e.text&&(r=e.text);return r}convertToOpenAITools(e){if(!e||e.length===0)return[];let r=[];for(let n of e)if(n.functionDeclarations&&Array.isArray(n.functionDeclarations))for(let i of n.functionDeclarations)r.push({type:"function",function:{name:i.name||"",description:i.description,parameters:this.convertParameters(i.parameters||i.parametersJsonSchema)}});return r}convertParameters(e){if(!e)return;let r={STRING:"string",INTEGER:"integer",NUMBER:"number",BOOLEAN:"boolean",OBJECT:"object",ARRAY:"array"};if(typeof e=="object"&&e.type){if(typeof e.type=="string"&&(r[e.type]?e.type=r[e.type]:e.type=e.type.toLowerCase()),e.properties)for(let i in e.properties){let o=e.properties[i],s={};o.type&&(s.type=r[o.type]),o.description&&(s.description=o.description),e.properties[i]=s}return e.items&&(e.items=this.convertParameters(e.items)),e}let n=i=>{if(!i)return;let o={};if(i.type)switch(i.type){case"STRING":o.type="string";break;case"INTEGER":o.type="integer";break;case"NUMBER":o.type="number";break;case"BOOLEAN":o.type="boolean";break;case"OBJECT":o.type="object";break;case"ARRAY":o.type="array";break;default:o.type=i.type.toLowerCase()}if(o.type="object",i.description&&(o.description=i.description),i.enum&&(o.enum=i.enum),i.properties){o.properties={};for(let[s,a]of Object.entries(i.properties))o.properties[s]=n(a)}return i.items&&(o.items=n(i.items)),i.required&&(o.required=i.required),o};return n(e)}mapFinishReason(e){switch(e){case"stop":return E7.STOP;case"length":return E7.MAX_TOKENS;case"content_filter":return E7.SAFETY;case"tool_calls":return E7.MALFORMED_FUNCTION_CALL;default:return E7.OTHER}}convertResponseSchema(e){if(e)return e.type==="object"||e.type==="OBJECT"?{type:"json_schema",json_schema:{name:e.name||"",description:e.description||"",schema:this.convertSchemaToJsonSchema(e),strict:!0}}:{type:"json_schema",json_schema:{name:"response_schema",description:"Generated response schema",schema:this.convertSchemaToJsonSchema(e),strict:!0}}}convertSchemaToJsonSchema(e){if(!e)return{};let r={};if(e.type)switch(e.type){case"STRING":r.type="string";break;case"INTEGER":r.type="integer";break;case"NUMBER":r.type="number";break;case"BOOLEAN":r.type="boolean";break;case"OBJECT":r.type="object";break;case"ARRAY":r.type="array";break;default:r.type=typeof e.type=="string"?e.type.toLowerCase():e.type}if(e.description&&(r.description=e.description),e.enum&&(r.enum=e.enum),e.properties){r.properties={};for(let[n,i]of Object.entries(e.properties))r.properties[n]=this.convertSchemaToJsonSchema(i)}return e.items&&(r.items=this.convertSchemaToJsonSchema(e.items)),e.required&&(r.required=e.required),r.type==="object"&&!("additionalProperties"in r)&&(r.additionalProperties=!1),r}}});var C1,Xu,sU,aU,KK,tMt,a4=ae(()=>{"use strict";C1="Qwen3-Coder",Xu="Qwen3-Coder",sU="text-embedding-v1",aU="gemini-2.5-flash-lite",KK="https://apis.iflow.cn/v1",tMt="https://ducky.code.alibaba-inc.com/v1/openai"});async function FFe(t,e,r,n){if(e===$t.LOGIN_WITH_IFLOW){let i=await uD(e,r),o=await y5();if(!o)throw new Error("No API key found. Please re-authenticate.");let s=r.getContentGeneratorConfig();return new oU({model:r.getModel(),apiKey:o,baseUrl:s?.baseUrl||KK,authType:e,debugMode:r.getDebugMode(),multimodalModelName:"qwen3-vl-plus",config:r})}if(e===$t.CLOUD_SHELL){let i=await uD(e,r),o=await ANt(i);return new L8(i,o.projectId,t,n,o.userTier)}throw new Error(`Unsupported authType: ${e}`)}var UFe=ae(()=>{"use strict";g3();x7();yNt();fhe();LFe();a4();});function NOn(t){return t.replace(/([a-z])([A-Z])/g,"$1_$2").toUpperCase()}function _5(t){let e=NOn(t),r=`IFLOW_${t}`;if(process.env[r])return process.env[r];let n=`IFLOW_${e}`;if(process.env[n])return process.env[n];let i=`iflow_${t}`;if(process.env[i])return process.env[i];let o=`iflow_${e}`;if(process.env[o])return process.env[o]}function XK(){return _5("apiKey")}function ZK(){return _5("baseUrl")||_5("url")}function eX(){return _5("modelName")||_5("model")}function rMt(t){let e=_5(t);if(e===void 0)return;let r=e.toLowerCase();if(r==="true"||r==="1"||r==="yes")return!0;if(r==="false"||r==="0"||r==="no")return!1}function nMt(t){let e=_5(t);if(e===void 0)return;let r=Number(e);return isNaN(r)?void 0:r}function iMt(t){let e=_5(t);if(e!==void 0)return e.split(",").map(r=>r.trim()).filter(r=>r.length>0)}function E0e(){return!!(XK()||ZK()||eX())}function QFe(){let t={},e=["theme","selectedAuthType","sandbox","toolDiscoveryCommand","toolCallCommand","mcpServerCommand","contextFileName","preferredEditor","apiKey","baseUrl","modelName","searchApiKey","multimodalModelName","memoryImportFormat"],r=["useExternalAuth","showMemoryUsage","usageStatisticsEnabled","autoConfigureMaxOldSpaceSize","hideWindowTitle","hideTips","hideBanner","vimMode","ideModeFeature","ideMode","disableAutoUpdate","skipNextSpeakerCheck","useRipgrep"],n=["maxSessionTurns","memoryDiscoveryMaxDirs","tokensLimit","compressionTokenThreshold","shellTimeout"],i=["coreTools","excludeTools","allowMCPServers","excludeMCPServers"];return e.forEach(o=>{let s=_5(o);s!==void 0&&(t[o]=s)}),r.forEach(o=>{let s=rMt(o);s!==void 0&&(t[o]=s)}),n.forEach(o=>{let s=nMt(o);s!==void 0&&(t[o]=s)}),i.forEach(o=>{let s=iMt(o);s!==void 0&&(t[o]=s)}),t}function OOn(){return{apiKey:XK(),baseUrl:ZK(),model:eX()}}var qFe=ae(()=>{"use strict";});async function GFe(t,e,r){await DF()&&(await dhe()||console.log("OAuth2 credentials cleared due to expiration. Please authenticate when prompted."));let i=process.env.GEMINI_API_KEY,o=process.env.GOOGLE_API_KEY,s=process.env.GOOGLE_CLOUD_PROJECT,a=process.env.GOOGLE_CLOUD_LOCATION,c=XK(),u=ZK(),d=eX(),f=r?.apiKey||c,p=r?.baseUrl||u||kOn[e],h=t.getModel()||d||C1,m={model:h,authType:e,proxy:t?.getProxy(),debugMode:t?.getDebugMode(),config:t};return e===$t.CLOUD_SHELL?m:e===$t.LOGIN_WITH_IFLOW?(m.baseUrl=p||KK,m.multimodalModelName="qwen3-vl-plus",f&&(m.apiKey=f),m):([...Wg,$t.OPENAI_COMPATIBLE].includes(e)&&f&&(m.apiKey=f,m.baseUrl=p,m.model=h),m)}async function HFe(t,e,r){let i={headers:{"User-Agent":`iFlowCLI/0.2.37-beta.0 (${process.platform}; ${process.arch})`}};if(t.authType&&[...Wg,$t.IDEA_LAB].includes(t.authType)||t.authType===$t.OPENAI_COMPATIBLE)return new oU({...t,config:e});if(t.authType===$t.LOGIN_WITH_IFLOW||t.authType===$t.CLOUD_SHELL)return FFe(i,t.authType,e,r);if([...Wg,$t.OPENAI_COMPATIBLE].includes(t.authType)||t.authType===$t.USE_GEMINI||t.authType===$t.USE_VERTEX_AI)return new the({apiKey:t.apiKey===""?void 0:t.apiKey,vertexai:t.vertexai,httpOptions:i}).models;throw new Error(`Error creating contentGenerator: Unsupported authType: ${t.authType}`)}var $t,Wg,kOn,g3=ae(()=>{"use strict";il();UFe();a4();LFe();qFe();x7();(function(t){t.LOGIN_WITH_IFLOW="oauth-iflow",t.USE_GEMINI="gemini-api-key",t.USE_VERTEX_AI="vertex-ai",t.CLOUD_SHELL="cloud-shell",t.IFLOW="iflow",t.AONE="aone",t.IDEA_LAB="idealab",t.OPENAI_COMPATIBLE="openai-compatible"})($t||($t={}));Wg=[$t.IFLOW,$t.AONE],kOn={[$t.IDEA_LAB]:"https://idealab.alibaba-inc.com/api/openai/v1",[$t.IFLOW]:KK,[$t.AONE]:tMt}});var v0e,oMt=ae(()=>{"use strict";v0e=class{prompts=new Map;registerPrompt(e){if(this.prompts.has(e.name)){let r=`${e.serverName}_${e.name}`;console.warn(`Prompt with name "${e.name}" is already registered. Renaming to "${r}".`),this.prompts.set(r,{...e,name:r})}else this.prompts.set(e.name,e)}getAllPrompts(){return Array.from(this.prompts.values()).sort((e,r)=>e.name.localeCompare(r.name))}getPrompt(e){return this.prompts.get(e)}getPromptsByServer(e){let r=[];for(let n of this.prompts.values())n.serverName===e&&r.push(n);return r.sort((n,i)=>n.name.localeCompare(i.name))}clear(){this.prompts.clear()}removePromptsByServer(e){for(let[r,n]of this.prompts.entries())n.serverName===e&&this.prompts.delete(r)}}});var fo,Yr,po,ho,su=ae(()=>{"use strict";fo=class{name;displayName;description;icon;kind;parameterSchema;isOutputMarkdown;canUpdateOutput;aliases;constructor(e,r,n,i,o,s,a=!0,c=!1,u=[]){this.name=e,this.displayName=r,this.description=n,this.icon=i,this.kind=o,this.parameterSchema=s,this.isOutputMarkdown=a,this.canUpdateOutput=c,this.aliases=u}get schema(){return{name:this.name,description:this.description,parameters:this.parameterSchema}}validateToolParams(e){return null}getDescription(e){return JSON.stringify(e)}shouldConfirmExecute(e,r){return Promise.resolve(!1)}toolLocations(e){return[]}};(function(t){t.ProceedOnce="proceed_once",t.ProceedAlways="proceed_always",t.ProceedAlwaysServer="proceed_always_server",t.ProceedAlwaysTool="proceed_always_tool",t.ModifyWithEditor="modify_with_editor",t.Cancel="cancel"})(Yr||(Yr={}));(function(t){t.FileSearch="fileSearch",t.Folder="folder",t.Globe="globe",t.Hammer="hammer",t.LightBulb="lightBulb",t.Pencil="pencil",t.Regex="regex",t.Terminal="terminal"})(po||(po={}));(function(t){t.Read="read",t.Edit="edit",t.Delete="delete",t.Move="move",t.Search="search",t.Execute="execute",t.Think="think",t.Fetch="fetch",t.Other="other"})(ho||(ho={}))});function SD(t,e){let r=new WeakSet;return JSON.stringify(t,(n,i)=>{if(typeof i=="object"&&i!==null){if(r.has(i))return"[Circular]";r.add(i)}return i},e)}var C0e=ae(()=>{"use strict";});var Jo,lU=ae(()=>{"use strict";(function(t){t.INVALID_TOOL_PARAMS="invalid_tool_params",t.UNKNOWN="unknown",t.UNHANDLED_EXCEPTION="unhandled_exception",t.TOOL_NOT_REGISTERED="tool_not_registered",t.EXECUTION_FAILED="execution_failed",t.FILE_NOT_FOUND="file_not_found",t.FILE_WRITE_FAILURE="file_write_failure",t.READ_CONTENT_FAILURE="read_content_failure",t.ATTEMPT_TO_CREATE_EXISTING_FILE="attempt_to_create_existing_file",t.FILE_TOO_LARGE="file_too_large",t.PERMISSION_DENIED="permission_denied",t.NO_SPACE_LEFT="no_space_left",t.TARGET_IS_DIRECTORY="target_is_directory",t.PATH_NOT_IN_WORKSPACE="path_not_in_workspace",t.SEARCH_PATH_NOT_FOUND="search_path_not_found",t.SEARCH_PATH_NOT_A_DIRECTORY="search_path_not_a_directory",t.EDIT_PREPARATION_FAILURE="edit_preparation_failure",t.EDIT_NO_OCCURRENCE_FOUND="edit_no_occurrence_found",t.EDIT_EXPECTED_OCCURRENCE_MISMATCH="edit_expected_occurrence_mismatch",t.EDIT_NO_CHANGE="edit_no_change",t.GLOB_EXECUTION_ERROR="glob_execution_error",t.GREP_EXECUTION_ERROR="grep_execution_error",t.LS_EXECUTION_ERROR="ls_execution_error",t.PATH_IS_NOT_A_DIRECTORY="path_is_not_a_directory",t.MCP_TOOL_ERROR="mcp_tool_error",t.MEMORY_TOOL_EXECUTION_ERROR="memory_tool_execution_error",t.READ_MANY_FILES_SEARCH_ERROR="read_many_files_search_error",t.DISCOVERED_TOOL_EXECUTION_ERROR="discovered_tool_execution_error",t.WEB_FETCH_NO_URL_IN_PROMPT="web_fetch_no_url_in_prompt",t.WEB_FETCH_FALLBACK_FAILED="web_fetch_fallback_failed",t.WEB_FETCH_PROCESSING_ERROR="web_fetch_processing_error",t.WEB_SEARCH_FAILED="web_search_failed",t.HOOK_BLOCKED="hook_blocked"})(Jo||(Jo={}))});function MOn(t){return{text:t.text}}function POn(t,e){return[{text:M.t("mcpTool.messages.mediaDataProvided",{toolName:e,type:t.type,mimeType:t.mimeType})},{inlineData:{mimeType:t.mimeType,data:t.data}}]}function LOn(t,e){let r=t.resource;if(r?.text)return{text:r.text};if(r?.blob){let n=r.mimeType||"application/octet-stream";return[{text:M.t("mcpTool.messages.embeddedResourceProvided",{toolName:e,mimeType:n})},{inlineData:{mimeType:n,data:r.blob}}]}return null}function FOn(t){return{text:M.t("mcpTool.messages.resourceLink",{title:t.title||t.name,uri:t.uri})}}function UOn(t){let e=t?.[0]?.functionResponse,r=e?.response?.content,n=e?.name||"unknown tool";return Array.isArray(r)?r.flatMap(o=>{switch(o.type){case"text":return MOn(o);case"image":case"audio":return POn(o,n);case"resource":return LOn(o,n);case"resource_link":return FOn(o);default:return null}}).filter(o=>o!==null):[{text:M.t("mcpTool.errors.parseResponseFailed")}]}function QOn(t){let e=t?.[0]?.functionResponse?.response?.content;return Array.isArray(e)?e.map(n=>{switch(n.type){case"text":return n.text;case"image":return M.t("mcpTool.display.image",{mimeType:n.mimeType});case"audio":return M.t("mcpTool.display.audio",{mimeType:n.mimeType});case"resource_link":return M.t("mcpTool.display.resourceLink",{title:n.title||n.name,uri:n.uri});case"resource":return n.resource?.text?n.resource.text:M.t("mcpTool.display.embeddedResource",{mimeType:n.resource?.mimeType||M.t("mcpTool.display.unknownType")});default:return M.t("mcpTool.display.unknownContentType",{type:n.type})}}).join(`
835
835
  `):"```json\n"+JSON.stringify(t,null,2)+"\n```"}function sMt(t){let e=t.replace(/[^a-zA-Z0-9_.-]/g,"_");return e.length>63&&(e=e.slice(0,28)+"___"+e.slice(-32)),e}var Th,tX=ae(()=>{"use strict";C0e();lU();su();il();qn();Th=class t extends fo{mcpTool;serverName;serverToolName;parameterSchemaJson;timeout;trust;static allowlist=new Set;constructor(e,r,n,i,o,s,a,c){super(c??sMt(n),`${n} (${r} MCP Server)`,i,po.Hammer,ho.Other,{type:Lt.OBJECT},!0,!1),this.mcpTool=e,this.serverName=r,this.serverToolName=n,this.parameterSchemaJson=o,this.timeout=s,this.trust=a}asFullyQualifiedTool(){return new t(this.mcpTool,this.serverName,this.serverToolName,this.description,this.parameterSchemaJson,this.timeout,this.trust,`${this.serverName}__${this.serverToolName}`)}get schema(){return{name:this.name,description:this.description,parametersJsonSchema:this.parameterSchemaJson}}async shouldConfirmExecute(e,r){let n=this.serverName,i=`${this.serverName}.${this.serverToolName}`;return this.trust||t.allowlist.has(n)||t.allowlist.has(i)?!1:{type:"mcp",title:M.t("mcpTool.messages.confirmExecution"),serverName:this.serverName,toolName:this.serverToolName,toolDisplayName:this.name,onConfirm:async s=>{s===Yr.ProceedAlwaysServer?t.allowlist.add(n):s===Yr.ProceedAlwaysTool&&t.allowlist.add(i)}}}isMCPToolError(e){let n=e?.[0]?.functionResponse?.response;if(n){let i=n?.error,o=i?.isError;if(i&&(o===!0||o==="true"))return!0}return!1}async execute(e){let{callId:r,...n}=e,i=[{name:this.serverToolName,args:n}],o=await this.mcpTool.callTool(i);if(this.isMCPToolError(o)){let a=`MCP tool '${this.serverToolName}' reported tool error for function call: ${SD(i[0])} with response: ${SD(o)}`;return{llmContent:a,returnDisplay:M.t("mcpTool.errors.toolReportedError",{toolName:this.serverToolName}),error:{message:a,type:Jo.MCP_TOOL_ERROR}}}return{llmContent:UOn(o),returnDisplay:QOn(o)}}}});var lMt=D((vLo,aMt)=>{"use strict";aMt.exports=function(e){return e.map(function(r){return r===""?"''":r&&typeof r=="object"?r.op.replace(/(.)/g,"\\$1"):/["\s\\]/.test(r)&&!/'/.test(r)?"'"+r.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(r)?'"'+r.replace(/(["\\$`!])/g,"\\$1")+'"':String(r).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")}).join(" ")}});var mMt=D((CLo,hMt)=>{"use strict";var pMt="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")",cMt=new RegExp("^"+pMt+"$"),uMt="|&;()<> \\t",qOn='"((\\\\"|[^"])*?)"',GOn="'((\\\\'|[^'])*?)'",HOn=/^#$/,dMt="'",fMt='"',VFe="$",wD="",VOn=4294967296;for(WFe=0;WFe<4;WFe++)wD+=(VOn*Math.random()).toString(16);var WFe,WOn=new RegExp("^"+wD);function $On(t,e){for(var r=e.lastIndex,n=[],i;i=e.exec(t);)n.push(i),e.lastIndex===i.index&&(e.lastIndex+=1);return e.lastIndex=r,n}function jOn(t,e,r){var n=typeof t=="function"?t(r):t[r];return typeof n>"u"&&r!=""?n="":typeof n>"u"&&(n="$"),typeof n=="object"?e+wD+JSON.stringify(n)+wD:e+n}function zOn(t,e,r){r||(r={});var n=r.escape||"\\",i="(\\"+n+`['"`+uMt+`]|[^\\s'"`+uMt+"])+",o=new RegExp(["("+pMt+")","("+i+"|"+qOn+"|"+GOn+")+"].join("|"),"g"),s=$On(t,o);if(s.length===0)return[];e||(e={});var a=!1;return s.map(function(c){var u=c[0];if(!u||a)return;if(cMt.test(u))return{op:u};var d=!1,f=!1,p="",h=!1,m;function g(){m+=1;var E,C,x=u.charAt(m);if(x==="{"){if(m+=1,u.charAt(m)==="}")throw new Error("Bad substitution: "+u.slice(m-2,m+1));if(E=u.indexOf("}",m),E<0)throw new Error("Bad substitution: "+u.slice(m));C=u.slice(m,E),m=E}else if(/[*@#?$!_-]/.test(x))C=x,m+=1;else{var w=u.slice(m);E=w.match(/[^\w\d_]/),E?(C=w.slice(0,E.index),m+=E.index-1):(C=w,m=u.length)}return jOn(e,"",C)}for(m=0;m<u.length;m++){var A=u.charAt(m);if(h=h||!d&&(A==="*"||A==="?"),f)p+=A,f=!1;else if(d)A===d?d=!1:d==dMt?p+=A:A===n?(m+=1,A=u.charAt(m),A===fMt||A===n||A===VFe?p+=A:p+=n+A):A===VFe?p+=g():p+=A;else if(A===fMt||A===dMt)d=A;else{if(cMt.test(A))return{op:u};if(HOn.test(A)){a=!0;var y={comment:t.slice(c.index+m+1)};return p.length?[p,y]:[y]}else A===n?f=!0:A===VFe?p+=g():p+=A}}return h?{op:"glob",pattern:p}:p}).reduce(function(c,u){return typeof u>"u"?c:c.concat(u)},[])}hMt.exports=function(e,r,n){var i=zOn(e,r,n);return typeof r!="function"?i:i.reduce(function(o,s){if(typeof s=="object")return o.concat(s);var a=s.split(RegExp("("+wD+".*?"+wD+")","g"));return a.length===1?o.concat(a[0]):o.concat(a.filter(Boolean).map(function(c){return WOn.test(c)?JSON.parse(c.split(wD)[1]):c}))},[])}});var b0e=D($Fe=>{"use strict";$Fe.quote=lMt();$Fe.parse=mMt()});var Ss,jFe,rn,T5,rX=ae(()=>{(function(t){t.assertEqual=i=>{};function e(i){}t.assertIs=e;function r(i){throw new Error}t.assertNever=r,t.arrayToEnum=i=>{let o={};for(let s of i)o[s]=s;return o},t.getValidEnumValues=i=>{let o=t.objectKeys(i).filter(a=>typeof i[i[a]]!="number"),s={};for(let a of o)s[a]=i[a];return t.objectValues(s)},t.objectValues=i=>t.objectKeys(i).map(function(o){return i[o]}),t.objectKeys=typeof Object.keys=="function"?i=>Object.keys(i):i=>{let o=[];for(let s in i)Object.prototype.hasOwnProperty.call(i,s)&&o.push(s);return o},t.find=(i,o)=>{for(let s of i)if(o(s))return s},t.isInteger=typeof Number.isInteger=="function"?i=>Number.isInteger(i):i=>typeof i=="number"&&Number.isFinite(i)&&Math.floor(i)===i;function n(i,o=" | "){return i.map(s=>typeof s=="string"?`'${s}'`:s).join(o)}t.joinValues=n,t.jsonStringifyReplacer=(i,o)=>typeof o=="bigint"?o.toString():o})(Ss||(Ss={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(jFe||(jFe={}));rn=Ss.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),T5=t=>{switch(typeof t){case"undefined":return rn.undefined;case"string":return rn.string;case"number":return Number.isNaN(t)?rn.nan:rn.number;case"boolean":return rn.boolean;case"function":return rn.function;case"bigint":return rn.bigint;case"symbol":return rn.symbol;case"object":return Array.isArray(t)?rn.array:t===null?rn.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?rn.promise:typeof Map<"u"&&t instanceof Map?rn.map:typeof Set<"u"&&t instanceof Set?rn.set:typeof Date<"u"&&t instanceof Date?rn.date:rn.object;default:return rn.unknown}}});var yr,YOn,$g,x0e=ae(()=>{rX();yr=Ss.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),YOn=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),$g=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=n=>{this.issues=[...this.issues,n]},this.addIssues=(n=[])=>{this.issues=[...this.issues,...n]};let r=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,r):this.__proto__=r,this.name="ZodError",this.issues=e}format(e){let r=e||function(o){return o.message},n={_errors:[]},i=o=>{for(let s of o.issues)if(s.code==="invalid_union")s.unionErrors.map(i);else if(s.code==="invalid_return_type")i(s.returnTypeError);else if(s.code==="invalid_arguments")i(s.argumentsError);else if(s.path.length===0)n._errors.push(r(s));else{let a=n,c=0;for(;c<s.path.length;){let u=s.path[c];c===s.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(r(s))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return i(this),n}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,Ss.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=r=>r.message){let r={},n=[];for(let i of this.issues)if(i.path.length>0){let o=i.path[0];r[o]=r[o]||[],r[o].push(e(i))}else n.push(e(i));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};$g.create=t=>new $g(t)});var JOn,W8,zFe=ae(()=>{x0e();rX();JOn=(t,e)=>{let r;switch(t.code){case yr.invalid_type:t.received===rn.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case yr.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,Ss.jsonStringifyReplacer)}`;break;case yr.unrecognized_keys:r=`Unrecognized key(s) in object: ${Ss.joinValues(t.keys,", ")}`;break;case yr.invalid_union:r="Invalid input";break;case yr.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${Ss.joinValues(t.options)}`;break;case yr.invalid_enum_value:r=`Invalid enum value. Expected ${Ss.joinValues(t.options)}, received '${t.received}'`;break;case yr.invalid_arguments:r="Invalid function arguments";break;case yr.invalid_return_type:r="Invalid function return type";break;case yr.invalid_date:r="Invalid date";break;case yr.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(r=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(r=`${r} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?r=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?r=`Invalid input: must end with "${t.validation.endsWith}"`:Ss.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case yr.too_small:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?r=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:r="Invalid input";break;case yr.too_big:t.type==="array"?r=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?r=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?r=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?r=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?r=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:r="Invalid input";break;case yr.custom:r="Invalid input";break;case yr.invalid_intersection_types:r="Intersection results could not be merged";break;case yr.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case yr.not_finite:r="Number must be finite";break;default:r=e.defaultError,Ss.assertNever(t)}return{message:r}},W8=JOn});function KOn(t){gMt=t}function cU(){return gMt}var gMt,S0e=ae(()=>{zFe();gMt=W8});function jr(t,e){let r=cU(),n=nX({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===W8?void 0:W8].filter(i=>!!i)});t.common.issues.push(n)}var nX,XOn,Ih,Ii,_D,E0,w0e,_0e,tS,uU,YFe=ae(()=>{S0e();zFe();nX=t=>{let{data:e,path:r,errorMaps:n,issueData:i}=t,o=[...r,...i.path||[]],s={...i,path:o};if(i.message!==void 0)return{...i,path:o,message:i.message};let a="",c=n.filter(u=>!!u).slice().reverse();for(let u of c)a=u(s,{data:e,defaultError:a}).message;return{...i,path:o,message:a}},XOn=[];Ih=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,r){let n=[];for(let i of r){if(i.status==="aborted")return Ii;i.status==="dirty"&&e.dirty(),n.push(i.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let i of r){let o=await i.key,s=await i.value;n.push({key:o,value:s})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let i of r){let{key:o,value:s}=i;if(o.status==="aborted"||s.status==="aborted")return Ii;o.status==="dirty"&&e.dirty(),s.status==="dirty"&&e.dirty(),o.value!=="__proto__"&&(typeof s.value<"u"||i.alwaysSet)&&(n[o.value]=s.value)}return{status:e.value,value:n}}},Ii=Object.freeze({status:"aborted"}),_D=t=>({status:"dirty",value:t}),E0=t=>({status:"valid",value:t}),w0e=t=>t.status==="aborted",_0e=t=>t.status==="dirty",tS=t=>t.status==="valid",uU=t=>typeof Promise<"u"&&t instanceof Promise});var AMt=ae(()=>{});var On,yMt=ae(()=>{(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(On||(On={}))});function ko(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:i}=t;if(e&&(r||n))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:i}:{errorMap:(s,a)=>{let{message:c}=t;return s.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??n??a.defaultError}:s.code!=="invalid_type"?{message:a.defaultError}:{message:c??r??a.defaultError}},description:i}}function bMt(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let r=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${r}`}function mkn(t){return new RegExp(`^${bMt(t)}$`)}function xMt(t){let e=`${CMt}T${bMt(t)}`,r=[];return r.push(t.local?"Z?":"Z"),t.offset&&r.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${r.join("|")})`,new RegExp(`^${e}$`)}function gkn(t,e){return!!((e==="v4"||!e)&&lkn.test(t)||(e==="v6"||!e)&&ukn.test(t))}function Akn(t,e){if(!ikn.test(t))return!1;try{let[r]=t.split(".");if(!r)return!1;let n=r.replace(/-/g,"+").replace(/_/g,"/").padEnd(r.length+(4-r.length%4)%4,"="),i=JSON.parse(atob(n));return!(typeof i!="object"||i===null||"typ"in i&&i?.typ!=="JWT"||!i.alg||e&&i.alg!==e)}catch{return!1}}function ykn(t,e){return!!((e==="v4"||!e)&&ckn.test(t)||(e==="v6"||!e)&&dkn.test(t))}function Ekn(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,i=r>n?r:n,o=Number.parseInt(t.toFixed(i).replace(".","")),s=Number.parseInt(e.toFixed(i).replace(".",""));return o%s/10**i}function dU(t){if(t instanceof jg){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=T3.create(dU(n))}return new jg({...t._def,shape:()=>e})}else return t instanceof z8?new z8({...t._def,type:dU(t.element)}):t instanceof T3?T3.create(dU(t.unwrap())):t instanceof D5?D5.create(dU(t.unwrap())):t instanceof I5?I5.create(t.items.map(e=>dU(e))):t}function KFe(t,e){let r=T5(t),n=T5(e);if(t===e)return{valid:!0,data:t};if(r===rn.object&&n===rn.object){let i=Ss.objectKeys(e),o=Ss.objectKeys(t).filter(a=>i.indexOf(a)!==-1),s={...t,...e};for(let a of o){let c=KFe(t[a],e[a]);if(!c.valid)return{valid:!1};s[a]=c.data}return{valid:!0,data:s}}else if(r===rn.array&&n===rn.array){if(t.length!==e.length)return{valid:!1};let i=[];for(let o=0;o<t.length;o++){let s=t[o],a=e[o],c=KFe(s,a);if(!c.valid)return{valid:!1};i.push(c.data)}return{valid:!0,data:i}}else return r===rn.date&&n===rn.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}function SMt(t,e){return new LD({values:t,typeName:Oi.ZodEnum,...ko(e)})}function vMt(t,e){let r=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof r=="string"?{message:r}:r}function wMt(t,e={},r){return t?nS.create().superRefine((n,i)=>{let o=t(n);if(o instanceof Promise)return o.then(s=>{if(!s){let a=vMt(e,n),c=a.fatal??r??!0;i.addIssue({code:"custom",...a,fatal:c})}});if(!o){let s=vMt(e,n),a=s.fatal??r??!0;i.addIssue({code:"custom",...s,fatal:a})}}):nS.create()}var I3,EMt,Ko,ZOn,ekn,tkn,rkn,nkn,ikn,okn,skn,akn,JFe,lkn,ckn,ukn,dkn,fkn,pkn,CMt,hkn,rS,TD,ID,DD,RD,fU,BD,ND,nS,j8,l4,pU,z8,jg,OD,$8,T0e,kD,I5,I0e,hU,mU,D0e,MD,PD,LD,FD,iS,D3,T3,D5,UD,QD,gU,vkn,iX,oX,qD,Ckn,Oi,bkn,_Mt,TMt,xkn,Skn,IMt,wkn,_kn,Tkn,Ikn,Dkn,Rkn,Bkn,Nkn,Okn,kkn,Mkn,Pkn,Lkn,Fkn,Ukn,Qkn,qkn,Gkn,Hkn,Vkn,Wkn,$kn,jkn,zkn,Ykn,Jkn,Kkn,Xkn,Zkn,eMn,tMn,rMn,nMn,iMn,DMt=ae(()=>{x0e();S0e();yMt();YFe();rX();I3=class{constructor(e,r,n,i){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=i}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},EMt=(t,e)=>{if(tS(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let r=new $g(t.common.issues);return this._error=r,this._error}}};Ko=class{get description(){return this._def.description}_getType(e){return T5(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:T5(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Ih,ctx:{common:e.parent.common,data:e.data,parsedType:T5(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(uU(r))throw new Error("Synchronous parse encountered promise.");return r}_parseAsync(e){let r=this._parse(e);return Promise.resolve(r)}parse(e,r){let n=this.safeParse(e,r);if(n.success)return n.data;throw n.error}safeParse(e,r){let n={common:{issues:[],async:r?.async??!1,contextualErrorMap:r?.errorMap},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:T5(e)},i=this._parseSync({data:e,path:n.path,parent:n});return EMt(n,i)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:T5(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return tS(n)?{value:n.value}:{issues:r.common.issues}}catch(n){n?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),r.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:r}).then(n=>tS(n)?{value:n.value}:{issues:r.common.issues})}async parseAsync(e,r){let n=await this.safeParseAsync(e,r);if(n.success)return n.data;throw n.error}async safeParseAsync(e,r){let n={common:{issues:[],contextualErrorMap:r?.errorMap,async:!0},path:r?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:T5(e)},i=this._parse({data:e,path:n.path,parent:n}),o=await(uU(i)?i:Promise.resolve(i));return EMt(n,o)}refine(e,r){let n=i=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(i):r;return this._refinement((i,o)=>{let s=e(i),a=()=>o.addIssue({code:yr.custom,...n(i)});return typeof Promise<"u"&&s instanceof Promise?s.then(c=>c?!0:(a(),!1)):s?!0:(a(),!1)})}refinement(e,r){return this._refinement((n,i)=>e(n)?!0:(i.addIssue(typeof r=="function"?r(n,i):r),!1))}_refinement(e){return new D3({schema:this,typeName:Oi.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:r=>this["~validate"](r)}}optional(){return T3.create(this,this._def)}nullable(){return D5.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return z8.create(this)}promise(){return iS.create(this,this._def)}or(e){return OD.create([this,e],this._def)}and(e){return kD.create(this,e,this._def)}transform(e){return new D3({...ko(this._def),schema:this,typeName:Oi.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new UD({...ko(this._def),innerType:this,defaultValue:r,typeName:Oi.ZodDefault})}brand(){return new iX({typeName:Oi.ZodBranded,type:this,...ko(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new QD({...ko(this._def),innerType:this,catchValue:r,typeName:Oi.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return oX.create(this,e)}readonly(){return qD.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ZOn=/^c[^\s-]{8,}$/i,ekn=/^[0-9a-z]+$/,tkn=/^[0-9A-HJKMNP-TV-Z]{26}$/i,rkn=/^[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}$/i,nkn=/^[a-z0-9_-]{21}$/i,ikn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,okn=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,skn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,akn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",lkn=/^(?:(?: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])$/,ckn=/^(?:(?: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])$/,ukn=/^(([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]))$/,dkn=/^(([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])$/,fkn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,pkn=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,CMt="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",hkn=new RegExp(`^${CMt}$`);rS=class t extends Ko{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==rn.string){let o=this._getOrReturnCtx(e);return jr(o,{code:yr.invalid_type,expected:rn.string,received:o.parsedType}),Ii}let n=new Ih,i;for(let o of this._def.checks)if(o.kind==="min")e.data.length<o.value&&(i=this._getOrReturnCtx(e,i),jr(i,{code:yr.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="max")e.data.length>o.value&&(i=this._getOrReturnCtx(e,i),jr(i,{code:yr.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),n.dirty());else if(o.kind==="length"){let s=e.data.length>o.value,a=e.data.length<o.value;(s||a)&&(i=this._getOrReturnCtx(e,i),s?jr(i,{code:yr.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):a&&jr(i,{code:yr.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),n.dirty())}else if(o.kind==="email")skn.test(e.data)||(i=this._getOrReturnCtx(e,i),jr(i,{validation:"email",code:yr.invalid_string,message:o.message}),n.dirty());else if(o.kind==="emoji")JFe||(JFe=new RegExp(akn,"u")),JFe.test(e.data)||(i=this._getOrReturnCtx(e,i),jr(i,{validation:"emoji",code:yr.invalid_string,message:o.message}),n.dirty());else if(o.kind==="uuid")rkn.test(e.data)||(i=this._getOrReturnCtx(e,i),jr(i,{validation:"uuid",code:yr.invalid_string,message:o.message}),n.dirty());else if(o.kind==="nanoid")nkn.test(e.data)||(i=this._getOrReturnCtx(e,i),jr(i,{validation:"nanoid",code:yr.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid")ZOn.test(e.data)||(i=this._getOrReturnCtx(e,i),jr(i,{validation:"cuid",code:yr.invalid_string,message:o.message}),n.dirty());else if(o.kind==="cuid2")ekn.test(e.data)||(i=this._getOrReturnCtx(e,i),jr(i,{validation:"cuid2",code:yr.invalid_string,message:o.message}),n.dirty());else if(o.kind==="ulid")tkn.test(e.data)||(i=this._getOrReturnCtx(e,i),jr(i,{validation:"ulid",code:yr.invalid_string,message:o.message}),n.dirty());else if(o.kind==="url")try{new URL(e.data)}catch{i=this._getOrReturnCtx(e,i),jr(i,{validation:"url",code:yr.invalid_string,message:o.message}),n.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(e.data)||(i=this._getOrReturnCtx(e,i),jr(i,{validation:"regex",code:yr.invalid_string,message:o.message}),n.dirty())):o.kind==="trim"?e.data=e.data.trim():o.kind==="includes"?e.data.includes(o.value,o.position)||(i=this._getOrReturnCtx(e,i),jr(i,{code:yr.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),n.dirty()):o.kind==="toLowerCase"?e.data=e.data.toLowerCase():o.kind==="toUpperCase"?e.data=e.data.toUpperCase():o.kind==="startsWith"?e.data.startsWith(o.value)||(i=this._getOrReturnCtx(e,i),jr(i,{code:yr.invalid_string,validation:{startsWith:o.value},message:o.message}),n.dirty()):o.kind==="endsWith"?e.data.endsWith(o.value)||(i=this._getOrReturnCtx(e,i),jr(i,{code:yr.invalid_string,validation:{endsWith:o.value},message:o.message}),n.dirty()):o.kind==="datetime"?xMt(o).test(e.data)||(i=this._getOrReturnCtx(e,i),jr(i,{code:yr.invalid_string,validation:"datetime",message:o.message}),n.dirty()):o.kind==="date"?hkn.test(e.data)||(i=this._getOrReturnCtx(e,i),jr(i,{code:yr.invalid_string,validation:"date",message:o.message}),n.dirty()):o.kind==="time"?mkn(o).test(e.data)||(i=this._getOrReturnCtx(e,i),jr(i,{code:yr.invalid_string,validation:"time",message:o.message}),n.dirty()):o.kind==="duration"?okn.test(e.data)||(i=this._getOrReturnCtx(e,i),jr(i,{validation:"duration",code:yr.invalid_string,message:o.message}),n.dirty()):o.kind==="ip"?gkn(e.data,o.version)||(i=this._getOrReturnCtx(e,i),jr(i,{validation:"ip",code:yr.invalid_string,message:o.message}),n.dirty()):o.kind==="jwt"?Akn(e.data,o.alg)||(i=this._getOrReturnCtx(e,i),jr(i,{validation:"jwt",code:yr.invalid_string,message:o.message}),n.dirty()):o.kind==="cidr"?ykn(e.data,o.version)||(i=this._getOrReturnCtx(e,i),jr(i,{validation:"cidr",code:yr.invalid_string,message:o.message}),n.dirty()):o.kind==="base64"?fkn.test(e.data)||(i=this._getOrReturnCtx(e,i),jr(i,{validation:"base64",code:yr.invalid_string,message:o.message}),n.dirty()):o.kind==="base64url"?pkn.test(e.data)||(i=this._getOrReturnCtx(e,i),jr(i,{validation:"base64url",code:yr.invalid_string,message:o.message}),n.dirty()):Ss.assertNever(o);return{status:n.value,value:e.data}}_regex(e,r,n){return this.refinement(i=>e.test(i),{validation:r,code:yr.invalid_string,...On.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...On.errToObj(e)})}url(e){return this._addCheck({kind:"url",...On.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...On.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...On.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...On.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...On.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...On.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...On.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...On.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...On.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...On.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...On.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...On.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...On.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...On.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...On.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...On.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...On.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...On.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...On.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...On.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...On.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...On.errToObj(r)})}nonempty(e){return this.min(1,On.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxLength(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};rS.create=t=>new rS({checks:[],typeName:Oi.ZodString,coerce:t?.coerce??!1,...ko(t)});TD=class t extends Ko{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==rn.number){let o=this._getOrReturnCtx(e);return jr(o,{code:yr.invalid_type,expected:rn.number,received:o.parsedType}),Ii}let n,i=new Ih;for(let o of this._def.checks)o.kind==="int"?Ss.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),jr(n,{code:yr.invalid_type,expected:"integer",received:"float",message:o.message}),i.dirty()):o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),jr(n,{code:yr.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),jr(n,{code:yr.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),i.dirty()):o.kind==="multipleOf"?Ekn(e.data,o.value)!==0&&(n=this._getOrReturnCtx(e,n),jr(n,{code:yr.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):o.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),jr(n,{code:yr.not_finite,message:o.message}),i.dirty()):Ss.assertNever(o);return{status:i.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,On.toString(r))}gt(e,r){return this.setLimit("min",e,!1,On.toString(r))}lte(e,r){return this.setLimit("max",e,!0,On.toString(r))}lt(e,r){return this.setLimit("max",e,!1,On.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:On.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:On.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:On.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:On.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:On.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:On.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:On.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:On.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:On.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:On.toString(e)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&Ss.isInteger(e.value))}get isFinite(){let e=null,r=null;for(let n of this._def.checks){if(n.kind==="finite"||n.kind==="int"||n.kind==="multipleOf")return!0;n.kind==="min"?(r===null||n.value>r)&&(r=n.value):n.kind==="max"&&(e===null||n.value<e)&&(e=n.value)}return Number.isFinite(r)&&Number.isFinite(e)}};TD.create=t=>new TD({checks:[],typeName:Oi.ZodNumber,coerce:t?.coerce||!1,...ko(t)});ID=class t extends Ko{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==rn.bigint)return this._getInvalidInput(e);let n,i=new Ih;for(let o of this._def.checks)o.kind==="min"?(o.inclusive?e.data<o.value:e.data<=o.value)&&(n=this._getOrReturnCtx(e,n),jr(n,{code:yr.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="max"?(o.inclusive?e.data>o.value:e.data>=o.value)&&(n=this._getOrReturnCtx(e,n),jr(n,{code:yr.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),i.dirty()):o.kind==="multipleOf"?e.data%o.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),jr(n,{code:yr.not_multiple_of,multipleOf:o.value,message:o.message}),i.dirty()):Ss.assertNever(o);return{status:i.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return jr(r,{code:yr.invalid_type,expected:rn.bigint,received:r.parsedType}),Ii}gte(e,r){return this.setLimit("min",e,!0,On.toString(r))}gt(e,r){return this.setLimit("min",e,!1,On.toString(r))}lte(e,r){return this.setLimit("max",e,!0,On.toString(r))}lt(e,r){return this.setLimit("max",e,!1,On.toString(r))}setLimit(e,r,n,i){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:On.toString(i)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:On.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:On.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:On.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:On.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:On.toString(r)})}get minValue(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e}get maxValue(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e}};ID.create=t=>new ID({checks:[],typeName:Oi.ZodBigInt,coerce:t?.coerce??!1,...ko(t)});DD=class extends Ko{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==rn.boolean){let n=this._getOrReturnCtx(e);return jr(n,{code:yr.invalid_type,expected:rn.boolean,received:n.parsedType}),Ii}return E0(e.data)}};DD.create=t=>new DD({typeName:Oi.ZodBoolean,coerce:t?.coerce||!1,...ko(t)});RD=class t extends Ko{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==rn.date){let o=this._getOrReturnCtx(e);return jr(o,{code:yr.invalid_type,expected:rn.date,received:o.parsedType}),Ii}if(Number.isNaN(e.data.getTime())){let o=this._getOrReturnCtx(e);return jr(o,{code:yr.invalid_date}),Ii}let n=new Ih,i;for(let o of this._def.checks)o.kind==="min"?e.data.getTime()<o.value&&(i=this._getOrReturnCtx(e,i),jr(i,{code:yr.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),n.dirty()):o.kind==="max"?e.data.getTime()>o.value&&(i=this._getOrReturnCtx(e,i),jr(i,{code:yr.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),n.dirty()):Ss.assertNever(o);return{status:n.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,r){return this._addCheck({kind:"min",value:e.getTime(),message:On.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:On.toString(r)})}get minDate(){let e=null;for(let r of this._def.checks)r.kind==="min"&&(e===null||r.value>e)&&(e=r.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let r of this._def.checks)r.kind==="max"&&(e===null||r.value<e)&&(e=r.value);return e!=null?new Date(e):null}};RD.create=t=>new RD({checks:[],coerce:t?.coerce||!1,typeName:Oi.ZodDate,...ko(t)});fU=class extends Ko{_parse(e){if(this._getType(e)!==rn.symbol){let n=this._getOrReturnCtx(e);return jr(n,{code:yr.invalid_type,expected:rn.symbol,received:n.parsedType}),Ii}return E0(e.data)}};fU.create=t=>new fU({typeName:Oi.ZodSymbol,...ko(t)});BD=class extends Ko{_parse(e){if(this._getType(e)!==rn.undefined){let n=this._getOrReturnCtx(e);return jr(n,{code:yr.invalid_type,expected:rn.undefined,received:n.parsedType}),Ii}return E0(e.data)}};BD.create=t=>new BD({typeName:Oi.ZodUndefined,...ko(t)});ND=class extends Ko{_parse(e){if(this._getType(e)!==rn.null){let n=this._getOrReturnCtx(e);return jr(n,{code:yr.invalid_type,expected:rn.null,received:n.parsedType}),Ii}return E0(e.data)}};ND.create=t=>new ND({typeName:Oi.ZodNull,...ko(t)});nS=class extends Ko{constructor(){super(...arguments),this._any=!0}_parse(e){return E0(e.data)}};nS.create=t=>new nS({typeName:Oi.ZodAny,...ko(t)});j8=class extends Ko{constructor(){super(...arguments),this._unknown=!0}_parse(e){return E0(e.data)}};j8.create=t=>new j8({typeName:Oi.ZodUnknown,...ko(t)});l4=class extends Ko{_parse(e){let r=this._getOrReturnCtx(e);return jr(r,{code:yr.invalid_type,expected:rn.never,received:r.parsedType}),Ii}};l4.create=t=>new l4({typeName:Oi.ZodNever,...ko(t)});pU=class extends Ko{_parse(e){if(this._getType(e)!==rn.undefined){let n=this._getOrReturnCtx(e);return jr(n,{code:yr.invalid_type,expected:rn.void,received:n.parsedType}),Ii}return E0(e.data)}};pU.create=t=>new pU({typeName:Oi.ZodVoid,...ko(t)});z8=class t extends Ko{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),i=this._def;if(r.parsedType!==rn.array)return jr(r,{code:yr.invalid_type,expected:rn.array,received:r.parsedType}),Ii;if(i.exactLength!==null){let s=r.data.length>i.exactLength.value,a=r.data.length<i.exactLength.value;(s||a)&&(jr(r,{code:s?yr.too_big:yr.too_small,minimum:a?i.exactLength.value:void 0,maximum:s?i.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:i.exactLength.message}),n.dirty())}if(i.minLength!==null&&r.data.length<i.minLength.value&&(jr(r,{code:yr.too_small,minimum:i.minLength.value,type:"array",inclusive:!0,exact:!1,message:i.minLength.message}),n.dirty()),i.maxLength!==null&&r.data.length>i.maxLength.value&&(jr(r,{code:yr.too_big,maximum:i.maxLength.value,type:"array",inclusive:!0,exact:!1,message:i.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((s,a)=>i.type._parseAsync(new I3(r,s,r.path,a)))).then(s=>Ih.mergeArray(n,s));let o=[...r.data].map((s,a)=>i.type._parseSync(new I3(r,s,r.path,a)));return Ih.mergeArray(n,o)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:On.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:On.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:On.toString(r)}})}nonempty(e){return this.min(1,e)}};z8.create=(t,e)=>new z8({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Oi.ZodArray,...ko(e)});jg=class t extends Ko{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),r=Ss.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==rn.object){let u=this._getOrReturnCtx(e);return jr(u,{code:yr.invalid_type,expected:rn.object,received:u.parsedType}),Ii}let{status:n,ctx:i}=this._processInputParams(e),{shape:o,keys:s}=this._getCached(),a=[];if(!(this._def.catchall instanceof l4&&this._def.unknownKeys==="strip"))for(let u in i.data)s.includes(u)||a.push(u);let c=[];for(let u of s){let d=o[u],f=i.data[u];c.push({key:{status:"valid",value:u},value:d._parse(new I3(i,f,i.path,u)),alwaysSet:u in i.data})}if(this._def.catchall instanceof l4){let u=this._def.unknownKeys;if(u==="passthrough")for(let d of a)c.push({key:{status:"valid",value:d},value:{status:"valid",value:i.data[d]}});else if(u==="strict")a.length>0&&(jr(i,{code:yr.unrecognized_keys,keys:a}),n.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let d of a){let f=i.data[d];c.push({key:{status:"valid",value:d},value:u._parse(new I3(i,f,i.path,d)),alwaysSet:d in i.data})}}return i.common.async?Promise.resolve().then(async()=>{let u=[];for(let d of c){let f=await d.key,p=await d.value;u.push({key:f,value:p,alwaysSet:d.alwaysSet})}return u}).then(u=>Ih.mergeObjectSync(n,u)):Ih.mergeObjectSync(n,c)}get shape(){return this._def.shape()}strict(e){return On.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let i=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:On.errToObj(e).message??i}:{message:i}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:Oi.ZodObject})}setKey(e,r){return this.augment({[e]:r})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let r={};for(let n of Ss.objectKeys(e))e[n]&&this.shape[n]&&(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}omit(e){let r={};for(let n of Ss.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return dU(this)}partial(e){let r={};for(let n of Ss.objectKeys(this.shape)){let i=this.shape[n];e&&!e[n]?r[n]=i:r[n]=i.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of Ss.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let o=this.shape[n];for(;o instanceof T3;)o=o._def.innerType;r[n]=o}return new t({...this._def,shape:()=>r})}keyof(){return SMt(Ss.objectKeys(this.shape))}};jg.create=(t,e)=>new jg({shape:()=>t,unknownKeys:"strip",catchall:l4.create(),typeName:Oi.ZodObject,...ko(e)});jg.strictCreate=(t,e)=>new jg({shape:()=>t,unknownKeys:"strict",catchall:l4.create(),typeName:Oi.ZodObject,...ko(e)});jg.lazycreate=(t,e)=>new jg({shape:t,unknownKeys:"strip",catchall:l4.create(),typeName:Oi.ZodObject,...ko(e)});OD=class extends Ko{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function i(o){for(let a of o)if(a.result.status==="valid")return a.result;for(let a of o)if(a.result.status==="dirty")return r.common.issues.push(...a.ctx.common.issues),a.result;let s=o.map(a=>new $g(a.ctx.common.issues));return jr(r,{code:yr.invalid_union,unionErrors:s}),Ii}if(r.common.async)return Promise.all(n.map(async o=>{let s={...r,common:{...r.common,issues:[]},parent:null};return{result:await o._parseAsync({data:r.data,path:r.path,parent:s}),ctx:s}})).then(i);{let o,s=[];for(let c of n){let u={...r,common:{...r.common,issues:[]},parent:null},d=c._parseSync({data:r.data,path:r.path,parent:u});if(d.status==="valid")return d;d.status==="dirty"&&!o&&(o={result:d,ctx:u}),u.common.issues.length&&s.push(u.common.issues)}if(o)return r.common.issues.push(...o.ctx.common.issues),o.result;let a=s.map(c=>new $g(c));return jr(r,{code:yr.invalid_union,unionErrors:a}),Ii}}get options(){return this._def.options}};OD.create=(t,e)=>new OD({options:t,typeName:Oi.ZodUnion,...ko(e)});$8=t=>t instanceof MD?$8(t.schema):t instanceof D3?$8(t.innerType()):t instanceof PD?[t.value]:t instanceof LD?t.options:t instanceof FD?Ss.objectValues(t.enum):t instanceof UD?$8(t._def.innerType):t instanceof BD?[void 0]:t instanceof ND?[null]:t instanceof T3?[void 0,...$8(t.unwrap())]:t instanceof D5?[null,...$8(t.unwrap())]:t instanceof iX||t instanceof qD?$8(t.unwrap()):t instanceof QD?$8(t._def.innerType):[],T0e=class t extends Ko{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==rn.object)return jr(r,{code:yr.invalid_type,expected:rn.object,received:r.parsedType}),Ii;let n=this.discriminator,i=r.data[n],o=this.optionsMap.get(i);return o?r.common.async?o._parseAsync({data:r.data,path:r.path,parent:r}):o._parseSync({data:r.data,path:r.path,parent:r}):(jr(r,{code:yr.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),Ii)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let i=new Map;for(let o of r){let s=$8(o.shape[e]);if(!s.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of s){if(i.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);i.set(a,o)}}return new t({typeName:Oi.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:i,...ko(n)})}};kD=class extends Ko{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=(o,s)=>{if(w0e(o)||w0e(s))return Ii;let a=KFe(o.value,s.value);return a.valid?((_0e(o)||_0e(s))&&r.dirty(),{status:r.value,value:a.data}):(jr(n,{code:yr.invalid_intersection_types}),Ii)};return n.common.async?Promise.all([this._def.left._parseAsync({data:n.data,path:n.path,parent:n}),this._def.right._parseAsync({data:n.data,path:n.path,parent:n})]).then(([o,s])=>i(o,s)):i(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};kD.create=(t,e,r)=>new kD({left:t,right:e,typeName:Oi.ZodIntersection,...ko(r)});I5=class t extends Ko{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==rn.array)return jr(n,{code:yr.invalid_type,expected:rn.array,received:n.parsedType}),Ii;if(n.data.length<this._def.items.length)return jr(n,{code:yr.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Ii;!this._def.rest&&n.data.length>this._def.items.length&&(jr(n,{code:yr.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let o=[...n.data].map((s,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new I3(n,s,n.path,a)):null}).filter(s=>!!s);return n.common.async?Promise.all(o).then(s=>Ih.mergeArray(r,s)):Ih.mergeArray(r,o)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};I5.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new I5({items:t,typeName:Oi.ZodTuple,rest:null,...ko(e)})};I0e=class t extends Ko{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==rn.object)return jr(n,{code:yr.invalid_type,expected:rn.object,received:n.parsedType}),Ii;let i=[],o=this._def.keyType,s=this._def.valueType;for(let a in n.data)i.push({key:o._parse(new I3(n,a,n.path,a)),value:s._parse(new I3(n,n.data[a],n.path,a)),alwaysSet:a in n.data});return n.common.async?Ih.mergeObjectAsync(r,i):Ih.mergeObjectSync(r,i)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Ko?new t({keyType:e,valueType:r,typeName:Oi.ZodRecord,...ko(n)}):new t({keyType:rS.create(),valueType:e,typeName:Oi.ZodRecord,...ko(r)})}},hU=class extends Ko{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==rn.map)return jr(n,{code:yr.invalid_type,expected:rn.map,received:n.parsedType}),Ii;let i=this._def.keyType,o=this._def.valueType,s=[...n.data.entries()].map(([a,c],u)=>({key:i._parse(new I3(n,a,n.path,[u,"key"])),value:o._parse(new I3(n,c,n.path,[u,"value"]))}));if(n.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of s){let u=await c.key,d=await c.value;if(u.status==="aborted"||d.status==="aborted")return Ii;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}})}else{let a=new Map;for(let c of s){let u=c.key,d=c.value;if(u.status==="aborted"||d.status==="aborted")return Ii;(u.status==="dirty"||d.status==="dirty")&&r.dirty(),a.set(u.value,d.value)}return{status:r.value,value:a}}}};hU.create=(t,e,r)=>new hU({valueType:e,keyType:t,typeName:Oi.ZodMap,...ko(r)});mU=class t extends Ko{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==rn.set)return jr(n,{code:yr.invalid_type,expected:rn.set,received:n.parsedType}),Ii;let i=this._def;i.minSize!==null&&n.data.size<i.minSize.value&&(jr(n,{code:yr.too_small,minimum:i.minSize.value,type:"set",inclusive:!0,exact:!1,message:i.minSize.message}),r.dirty()),i.maxSize!==null&&n.data.size>i.maxSize.value&&(jr(n,{code:yr.too_big,maximum:i.maxSize.value,type:"set",inclusive:!0,exact:!1,message:i.maxSize.message}),r.dirty());let o=this._def.valueType;function s(c){let u=new Set;for(let d of c){if(d.status==="aborted")return Ii;d.status==="dirty"&&r.dirty(),u.add(d.value)}return{status:r.value,value:u}}let a=[...n.data.values()].map((c,u)=>o._parse(new I3(n,c,n.path,u)));return n.common.async?Promise.all(a).then(c=>s(c)):s(a)}min(e,r){return new t({...this._def,minSize:{value:e,message:On.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:On.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};mU.create=(t,e)=>new mU({valueType:t,minSize:null,maxSize:null,typeName:Oi.ZodSet,...ko(e)});D0e=class t extends Ko{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==rn.function)return jr(r,{code:yr.invalid_type,expected:rn.function,received:r.parsedType}),Ii;function n(a,c){return nX({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,cU(),W8].filter(u=>!!u),issueData:{code:yr.invalid_arguments,argumentsError:c}})}function i(a,c){return nX({data:a,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,cU(),W8].filter(u=>!!u),issueData:{code:yr.invalid_return_type,returnTypeError:c}})}let o={errorMap:r.common.contextualErrorMap},s=r.data;if(this._def.returns instanceof iS){let a=this;return E0(async function(...c){let u=new $g([]),d=await a._def.args.parseAsync(c,o).catch(h=>{throw u.addIssue(n(c,h)),u}),f=await Reflect.apply(s,this,d);return await a._def.returns._def.type.parseAsync(f,o).catch(h=>{throw u.addIssue(i(f,h)),u})})}else{let a=this;return E0(function(...c){let u=a._def.args.safeParse(c,o);if(!u.success)throw new $g([n(c,u.error)]);let d=Reflect.apply(s,this,u.data),f=a._def.returns.safeParse(d,o);if(!f.success)throw new $g([i(d,f.error)]);return f.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:I5.create(e).rest(j8.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,r,n){return new t({args:e||I5.create([]).rest(j8.create()),returns:r||j8.create(),typeName:Oi.ZodFunction,...ko(n)})}},MD=class extends Ko{get schema(){return this._def.getter()}_parse(e){let{ctx:r}=this._processInputParams(e);return this._def.getter()._parse({data:r.data,path:r.path,parent:r})}};MD.create=(t,e)=>new MD({getter:t,typeName:Oi.ZodLazy,...ko(e)});PD=class extends Ko{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return jr(r,{received:r.data,code:yr.invalid_literal,expected:this._def.value}),Ii}return{status:"valid",value:e.data}}get value(){return this._def.value}};PD.create=(t,e)=>new PD({value:t,typeName:Oi.ZodLiteral,...ko(e)});LD=class t extends Ko{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return jr(r,{expected:Ss.joinValues(n),received:r.parsedType,code:yr.invalid_type}),Ii}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let r=this._getOrReturnCtx(e),n=this._def.values;return jr(r,{received:r.data,code:yr.invalid_enum_value,options:n}),Ii}return E0(e.data)}get options(){return this._def.values}get enum(){let e={};for(let r of this._def.values)e[r]=r;return e}get Values(){let e={};for(let r of this._def.values)e[r]=r;return e}get Enum(){let e={};for(let r of this._def.values)e[r]=r;return e}extract(e,r=this._def){return t.create(e,{...this._def,...r})}exclude(e,r=this._def){return t.create(this.options.filter(n=>!e.includes(n)),{...this._def,...r})}};LD.create=SMt;FD=class extends Ko{_parse(e){let r=Ss.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==rn.string&&n.parsedType!==rn.number){let i=Ss.objectValues(r);return jr(n,{expected:Ss.joinValues(i),received:n.parsedType,code:yr.invalid_type}),Ii}if(this._cache||(this._cache=new Set(Ss.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let i=Ss.objectValues(r);return jr(n,{received:n.data,code:yr.invalid_enum_value,options:i}),Ii}return E0(e.data)}get enum(){return this._def.values}};FD.create=(t,e)=>new FD({values:t,typeName:Oi.ZodNativeEnum,...ko(e)});iS=class extends Ko{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==rn.promise&&r.common.async===!1)return jr(r,{code:yr.invalid_type,expected:rn.promise,received:r.parsedType}),Ii;let n=r.parsedType===rn.promise?r.data:Promise.resolve(r.data);return E0(n.then(i=>this._def.type.parseAsync(i,{path:r.path,errorMap:r.common.contextualErrorMap})))}};iS.create=(t,e)=>new iS({type:t,typeName:Oi.ZodPromise,...ko(e)});D3=class extends Ko{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Oi.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),i=this._def.effect||null,o={addIssue:s=>{jr(n,s),s.fatal?r.abort():r.dirty()},get path(){return n.path}};if(o.addIssue=o.addIssue.bind(o),i.type==="preprocess"){let s=i.transform(n.data,o);if(n.common.async)return Promise.resolve(s).then(async a=>{if(r.value==="aborted")return Ii;let c=await this._def.schema._parseAsync({data:a,path:n.path,parent:n});return c.status==="aborted"?Ii:c.status==="dirty"?_D(c.value):r.value==="dirty"?_D(c.value):c});{if(r.value==="aborted")return Ii;let a=this._def.schema._parseSync({data:s,path:n.path,parent:n});return a.status==="aborted"?Ii:a.status==="dirty"?_D(a.value):r.value==="dirty"?_D(a.value):a}}if(i.type==="refinement"){let s=a=>{let c=i.refinement(a,o);if(n.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return a.status==="aborted"?Ii:(a.status==="dirty"&&r.dirty(),s(a.value),{status:r.value,value:a.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>a.status==="aborted"?Ii:(a.status==="dirty"&&r.dirty(),s(a.value).then(()=>({status:r.value,value:a.value}))))}if(i.type==="transform")if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!tS(s))return Ii;let a=i.transform(s.value,o);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:a}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>tS(s)?Promise.resolve(i.transform(s.value,o)).then(a=>({status:r.value,value:a})):Ii);Ss.assertNever(i)}};D3.create=(t,e,r)=>new D3({schema:t,typeName:Oi.ZodEffects,effect:e,...ko(r)});D3.createWithPreprocess=(t,e,r)=>new D3({schema:e,effect:{type:"preprocess",transform:t},typeName:Oi.ZodEffects,...ko(r)});T3=class extends Ko{_parse(e){return this._getType(e)===rn.undefined?E0(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};T3.create=(t,e)=>new T3({innerType:t,typeName:Oi.ZodOptional,...ko(e)});D5=class extends Ko{_parse(e){return this._getType(e)===rn.null?E0(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};D5.create=(t,e)=>new D5({innerType:t,typeName:Oi.ZodNullable,...ko(e)});UD=class extends Ko{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===rn.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};UD.create=(t,e)=>new UD({innerType:t,typeName:Oi.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...ko(e)});QD=class extends Ko{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},i=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return uU(i)?i.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new $g(n.common.issues)},input:n.data})})):{status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new $g(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};QD.create=(t,e)=>new QD({innerType:t,typeName:Oi.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...ko(e)});gU=class extends Ko{_parse(e){if(this._getType(e)!==rn.nan){let n=this._getOrReturnCtx(e);return jr(n,{code:yr.invalid_type,expected:rn.nan,received:n.parsedType}),Ii}return{status:"valid",value:e.data}}};gU.create=t=>new gU({typeName:Oi.ZodNaN,...ko(t)});vkn=Symbol("zod_brand"),iX=class extends Ko{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return this._def.type._parse({data:n,path:r.path,parent:r})}unwrap(){return this._def.type}},oX=class t extends Ko{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let o=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?Ii:o.status==="dirty"?(r.dirty(),_D(o.value)):this._def.out._parseAsync({data:o.value,path:n.path,parent:n})})();{let i=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?Ii:i.status==="dirty"?(r.dirty(),{status:"dirty",value:i.value}):this._def.out._parseSync({data:i.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:Oi.ZodPipeline})}},qD=class extends Ko{_parse(e){let r=this._def.innerType._parse(e),n=i=>(tS(i)&&(i.value=Object.freeze(i.value)),i);return uU(r)?r.then(i=>n(i)):n(r)}unwrap(){return this._def.innerType}};qD.create=(t,e)=>new qD({innerType:t,typeName:Oi.ZodReadonly,...ko(e)});Ckn={object:jg.lazycreate};(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Oi||(Oi={}));bkn=(t,e={message:`Input not instance of ${t.name}`})=>wMt(r=>r instanceof t,e),_Mt=rS.create,TMt=TD.create,xkn=gU.create,Skn=ID.create,IMt=DD.create,wkn=RD.create,_kn=fU.create,Tkn=BD.create,Ikn=ND.create,Dkn=nS.create,Rkn=j8.create,Bkn=l4.create,Nkn=pU.create,Okn=z8.create,kkn=jg.create,Mkn=jg.strictCreate,Pkn=OD.create,Lkn=T0e.create,Fkn=kD.create,Ukn=I5.create,Qkn=I0e.create,qkn=hU.create,Gkn=mU.create,Hkn=D0e.create,Vkn=MD.create,Wkn=PD.create,$kn=LD.create,jkn=FD.create,zkn=iS.create,Ykn=D3.create,Jkn=T3.create,Kkn=D5.create,Xkn=D3.createWithPreprocess,Zkn=oX.create,eMn=()=>_Mt().optional(),tMn=()=>TMt().optional(),rMn=()=>IMt().optional(),nMn={string:(t=>rS.create({...t,coerce:!0})),number:(t=>TD.create({...t,coerce:!0})),boolean:(t=>DD.create({...t,coerce:!0})),bigint:(t=>ID.create({...t,coerce:!0})),date:(t=>RD.create({...t,coerce:!0}))},iMn=Ii});var te={};Uf(te,{BRAND:()=>vkn,DIRTY:()=>_D,EMPTY_PATH:()=>XOn,INVALID:()=>Ii,NEVER:()=>iMn,OK:()=>E0,ParseStatus:()=>Ih,Schema:()=>Ko,ZodAny:()=>nS,ZodArray:()=>z8,ZodBigInt:()=>ID,ZodBoolean:()=>DD,ZodBranded:()=>iX,ZodCatch:()=>QD,ZodDate:()=>RD,ZodDefault:()=>UD,ZodDiscriminatedUnion:()=>T0e,ZodEffects:()=>D3,ZodEnum:()=>LD,ZodError:()=>$g,ZodFirstPartyTypeKind:()=>Oi,ZodFunction:()=>D0e,ZodIntersection:()=>kD,ZodIssueCode:()=>yr,ZodLazy:()=>MD,ZodLiteral:()=>PD,ZodMap:()=>hU,ZodNaN:()=>gU,ZodNativeEnum:()=>FD,ZodNever:()=>l4,ZodNull:()=>ND,ZodNullable:()=>D5,ZodNumber:()=>TD,ZodObject:()=>jg,ZodOptional:()=>T3,ZodParsedType:()=>rn,ZodPipeline:()=>oX,ZodPromise:()=>iS,ZodReadonly:()=>qD,ZodRecord:()=>I0e,ZodSchema:()=>Ko,ZodSet:()=>mU,ZodString:()=>rS,ZodSymbol:()=>fU,ZodTransformer:()=>D3,ZodTuple:()=>I5,ZodType:()=>Ko,ZodUndefined:()=>BD,ZodUnion:()=>OD,ZodUnknown:()=>j8,ZodVoid:()=>pU,addIssueToContext:()=>jr,any:()=>Dkn,array:()=>Okn,bigint:()=>Skn,boolean:()=>IMt,coerce:()=>nMn,custom:()=>wMt,date:()=>wkn,datetimeRegex:()=>xMt,defaultErrorMap:()=>W8,discriminatedUnion:()=>Lkn,effect:()=>Ykn,enum:()=>$kn,function:()=>Hkn,getErrorMap:()=>cU,getParsedType:()=>T5,instanceof:()=>bkn,intersection:()=>Fkn,isAborted:()=>w0e,isAsync:()=>uU,isDirty:()=>_0e,isValid:()=>tS,late:()=>Ckn,lazy:()=>Vkn,literal:()=>Wkn,makeIssue:()=>nX,map:()=>qkn,nan:()=>xkn,nativeEnum:()=>jkn,never:()=>Bkn,null:()=>Ikn,nullable:()=>Kkn,number:()=>TMt,object:()=>kkn,objectUtil:()=>jFe,oboolean:()=>rMn,onumber:()=>tMn,optional:()=>Jkn,ostring:()=>eMn,pipeline:()=>Zkn,preprocess:()=>Xkn,promise:()=>zkn,quotelessJson:()=>YOn,record:()=>Qkn,set:()=>Gkn,setErrorMap:()=>KOn,strictObject:()=>Mkn,string:()=>_Mt,symbol:()=>_kn,transformer:()=>Ykn,tuple:()=>Ukn,undefined:()=>Tkn,union:()=>Pkn,unknown:()=>Rkn,util:()=>Ss,void:()=>Nkn});var XFe=ae(()=>{S0e();YFe();AMt();rX();DMt();x0e()});var oS=ae(()=>{XFe();XFe()});var AU,RMt,R0e,BMt,NMt,oMn,N3,zg,sX,R5,O3,B0e,OMt,N0e,kMt,MMt,PMt,aX,R3,LMt,FMt,sS,GD,O0e,lX,UMt,sMn,aMn,lMn,ZFe,QMt,qMt,k0e,cMn,M0e,P0e,L0e,GMt,HMt,eUe,VMt,WMt,uMn,dMn,tUe,fMn,rUe,pMn,nUe,hMn,mMn,gMn,AMn,yMn,EMn,vMn,cX,CMn,iUe,oUe,sUe,bMn,xMn,$Mt,SMn,uX,wMn,_Mn,TMn,IMn,aUe,F0e,JLo,DMn,RMn,jMt,BMn,NMn,OMn,kMn,MMn,PMn,LMn,FMn,UMn,QMn,qMn,GMn,HMn,VMn,WMn,$Mn,jMn,lUe,zMn,U0e,YMn,JMn,KLo,XLo,ZLo,eFo,tFo,rFo,B3,aS=ae(()=>{oS();AU="2025-06-18",RMt=[AU,"2025-03-26","2024-11-05","2024-10-07"],R0e="2.0",BMt=te.union([te.string(),te.number().int()]),NMt=te.string(),oMn=te.object({progressToken:te.optional(BMt)}).passthrough(),N3=te.object({_meta:te.optional(oMn)}).passthrough(),zg=te.object({method:te.string(),params:te.optional(N3)}),sX=te.object({_meta:te.optional(te.object({}).passthrough())}).passthrough(),R5=te.object({method:te.string(),params:te.optional(sX)}),O3=te.object({_meta:te.optional(te.object({}).passthrough())}).passthrough(),B0e=te.union([te.string(),te.number().int()]),OMt=te.object({jsonrpc:te.literal(R0e),id:B0e}).merge(zg).strict(),N0e=t=>OMt.safeParse(t).success,kMt=te.object({jsonrpc:te.literal(R0e)}).merge(R5).strict(),MMt=t=>kMt.safeParse(t).success,PMt=te.object({jsonrpc:te.literal(R0e),id:B0e,result:O3}).strict(),aX=t=>PMt.safeParse(t).success;(function(t){t[t.ConnectionClosed=-32e3]="ConnectionClosed",t[t.RequestTimeout=-32001]="RequestTimeout",t[t.ParseError=-32700]="ParseError",t[t.InvalidRequest=-32600]="InvalidRequest",t[t.MethodNotFound=-32601]="MethodNotFound",t[t.InvalidParams=-32602]="InvalidParams",t[t.InternalError=-32603]="InternalError"})(R3||(R3={}));LMt=te.object({jsonrpc:te.literal(R0e),id:B0e,error:te.object({code:te.number().int(),message:te.string(),data:te.optional(te.unknown())})}).strict(),FMt=t=>LMt.safeParse(t).success,sS=te.union([OMt,kMt,PMt,LMt]),GD=O3.strict(),O0e=R5.extend({method:te.literal("notifications/cancelled"),params:sX.extend({requestId:B0e,reason:te.string().optional()})}),lX=te.object({name:te.string(),title:te.optional(te.string())}).passthrough(),UMt=lX.extend({version:te.string()}),sMn=te.object({experimental:te.optional(te.object({}).passthrough()),sampling:te.optional(te.object({}).passthrough()),elicitation:te.optional(te.object({}).passthrough()),roots:te.optional(te.object({listChanged:te.optional(te.boolean())}).passthrough())}).passthrough(),aMn=zg.extend({method:te.literal("initialize"),params:N3.extend({protocolVersion:te.string(),capabilities:sMn,clientInfo:UMt})}),lMn=te.object({experimental:te.optional(te.object({}).passthrough()),logging:te.optional(te.object({}).passthrough()),completions:te.optional(te.object({}).passthrough()),prompts:te.optional(te.object({listChanged:te.optional(te.boolean())}).passthrough()),resources:te.optional(te.object({subscribe:te.optional(te.boolean()),listChanged:te.optional(te.boolean())}).passthrough()),tools:te.optional(te.object({listChanged:te.optional(te.boolean())}).passthrough())}).passthrough(),ZFe=O3.extend({protocolVersion:te.string(),capabilities:lMn,serverInfo:UMt,instructions:te.optional(te.string())}),QMt=R5.extend({method:te.literal("notifications/initialized")}),qMt=t=>QMt.safeParse(t).success,k0e=zg.extend({method:te.literal("ping")}),cMn=te.object({progress:te.number(),total:te.optional(te.number()),message:te.optional(te.string())}).passthrough(),M0e=R5.extend({method:te.literal("notifications/progress"),params:sX.merge(cMn).extend({progressToken:BMt})}),P0e=zg.extend({params:N3.extend({cursor:te.optional(NMt)}).optional()}),L0e=O3.extend({nextCursor:te.optional(NMt)}),GMt=te.object({uri:te.string(),mimeType:te.optional(te.string()),_meta:te.optional(te.object({}).passthrough())}).passthrough(),HMt=GMt.extend({text:te.string()}),eUe=te.string().refine(t=>{try{return atob(t),!0}catch{return!1}},{message:"Invalid Base64 string"}),VMt=GMt.extend({blob:eUe}),WMt=lX.extend({uri:te.string(),description:te.optional(te.string()),mimeType:te.optional(te.string()),_meta:te.optional(te.object({}).passthrough())}),uMn=lX.extend({uriTemplate:te.string(),description:te.optional(te.string()),mimeType:te.optional(te.string()),_meta:te.optional(te.object({}).passthrough())}),dMn=P0e.extend({method:te.literal("resources/list")}),tUe=L0e.extend({resources:te.array(WMt)}),fMn=P0e.extend({method:te.literal("resources/templates/list")}),rUe=L0e.extend({resourceTemplates:te.array(uMn)}),pMn=zg.extend({method:te.literal("resources/read"),params:N3.extend({uri:te.string()})}),nUe=O3.extend({contents:te.array(te.union([HMt,VMt]))}),hMn=R5.extend({method:te.literal("notifications/resources/list_changed")}),mMn=zg.extend({method:te.literal("resources/subscribe"),params:N3.extend({uri:te.string()})}),gMn=zg.extend({method:te.literal("resources/unsubscribe"),params:N3.extend({uri:te.string()})}),AMn=R5.extend({method:te.literal("notifications/resources/updated"),params:sX.extend({uri:te.string()})}),yMn=te.object({name:te.string(),description:te.optional(te.string()),required:te.optional(te.boolean())}).passthrough(),EMn=lX.extend({description:te.optional(te.string()),arguments:te.optional(te.array(yMn)),_meta:te.optional(te.object({}).passthrough())}),vMn=P0e.extend({method:te.literal("prompts/list")}),cX=L0e.extend({prompts:te.array(EMn)}),CMn=zg.extend({method:te.literal("prompts/get"),params:N3.extend({name:te.string(),arguments:te.optional(te.record(te.string()))})}),iUe=te.object({type:te.literal("text"),text:te.string(),_meta:te.optional(te.object({}).passthrough())}).passthrough(),oUe=te.object({type:te.literal("image"),data:eUe,mimeType:te.string(),_meta:te.optional(te.object({}).passthrough())}).passthrough(),sUe=te.object({type:te.literal("audio"),data:eUe,mimeType:te.string(),_meta:te.optional(te.object({}).passthrough())}).passthrough(),bMn=te.object({type:te.literal("resource"),resource:te.union([HMt,VMt]),_meta:te.optional(te.object({}).passthrough())}).passthrough(),xMn=WMt.extend({type:te.literal("resource_link")}),$Mt=te.union([iUe,oUe,sUe,xMn,bMn]),SMn=te.object({role:te.enum(["user","assistant"]),content:$Mt}).passthrough(),uX=O3.extend({description:te.optional(te.string()),messages:te.array(SMn)}),wMn=R5.extend({method:te.literal("notifications/prompts/list_changed")}),_Mn=te.object({title:te.optional(te.string()),readOnlyHint:te.optional(te.boolean()),destructiveHint:te.optional(te.boolean()),idempotentHint:te.optional(te.boolean()),openWorldHint:te.optional(te.boolean())}).passthrough(),TMn=lX.extend({description:te.optional(te.string()),inputSchema:te.object({type:te.literal("object"),properties:te.optional(te.object({}).passthrough()),required:te.optional(te.array(te.string()))}).passthrough(),outputSchema:te.optional(te.object({type:te.literal("object"),properties:te.optional(te.object({}).passthrough()),required:te.optional(te.array(te.string()))}).passthrough()),annotations:te.optional(_Mn),_meta:te.optional(te.object({}).passthrough())}),IMn=P0e.extend({method:te.literal("tools/list")}),aUe=L0e.extend({tools:te.array(TMn)}),F0e=O3.extend({content:te.array($Mt).default([]),structuredContent:te.object({}).passthrough().optional(),isError:te.optional(te.boolean())}),JLo=F0e.or(O3.extend({toolResult:te.unknown()})),DMn=zg.extend({method:te.literal("tools/call"),params:N3.extend({name:te.string(),arguments:te.optional(te.record(te.unknown()))})}),RMn=R5.extend({method:te.literal("notifications/tools/list_changed")}),jMt=te.enum(["debug","info","notice","warning","error","critical","alert","emergency"]),BMn=zg.extend({method:te.literal("logging/setLevel"),params:N3.extend({level:jMt})}),NMn=R5.extend({method:te.literal("notifications/message"),params:sX.extend({level:jMt,logger:te.optional(te.string()),data:te.unknown()})}),OMn=te.object({name:te.string().optional()}).passthrough(),kMn=te.object({hints:te.optional(te.array(OMn)),costPriority:te.optional(te.number().min(0).max(1)),speedPriority:te.optional(te.number().min(0).max(1)),intelligencePriority:te.optional(te.number().min(0).max(1))}).passthrough(),MMn=te.object({role:te.enum(["user","assistant"]),content:te.union([iUe,oUe,sUe])}).passthrough(),PMn=zg.extend({method:te.literal("sampling/createMessage"),params:N3.extend({messages:te.array(MMn),systemPrompt:te.optional(te.string()),includeContext:te.optional(te.enum(["none","thisServer","allServers"])),temperature:te.optional(te.number()),maxTokens:te.number().int(),stopSequences:te.optional(te.array(te.string())),metadata:te.optional(te.object({}).passthrough()),modelPreferences:te.optional(kMn)})}),LMn=O3.extend({model:te.string(),stopReason:te.optional(te.enum(["endTurn","stopSequence","maxTokens"]).or(te.string())),role:te.enum(["user","assistant"]),content:te.discriminatedUnion("type",[iUe,oUe,sUe])}),FMn=te.object({type:te.literal("boolean"),title:te.optional(te.string()),description:te.optional(te.string()),default:te.optional(te.boolean())}).passthrough(),UMn=te.object({type:te.literal("string"),title:te.optional(te.string()),description:te.optional(te.string()),minLength:te.optional(te.number()),maxLength:te.optional(te.number()),format:te.optional(te.enum(["email","uri","date","date-time"]))}).passthrough(),QMn=te.object({type:te.enum(["number","integer"]),title:te.optional(te.string()),description:te.optional(te.string()),minimum:te.optional(te.number()),maximum:te.optional(te.number())}).passthrough(),qMn=te.object({type:te.literal("string"),title:te.optional(te.string()),description:te.optional(te.string()),enum:te.array(te.string()),enumNames:te.optional(te.array(te.string()))}).passthrough(),GMn=te.union([FMn,UMn,QMn,qMn]),HMn=zg.extend({method:te.literal("elicitation/create"),params:N3.extend({message:te.string(),requestedSchema:te.object({type:te.literal("object"),properties:te.record(te.string(),GMn),required:te.optional(te.array(te.string()))}).passthrough()})}),VMn=O3.extend({action:te.enum(["accept","decline","cancel"]),content:te.optional(te.record(te.string(),te.unknown()))}),WMn=te.object({type:te.literal("ref/resource"),uri:te.string()}).passthrough(),$Mn=te.object({type:te.literal("ref/prompt"),name:te.string()}).passthrough(),jMn=zg.extend({method:te.literal("completion/complete"),params:N3.extend({ref:te.union([$Mn,WMn]),argument:te.object({name:te.string(),value:te.string()}).passthrough(),context:te.optional(te.object({arguments:te.optional(te.record(te.string(),te.string()))}))})}),lUe=O3.extend({completion:te.object({values:te.array(te.string()).max(100),total:te.optional(te.number().int()),hasMore:te.optional(te.boolean())}).passthrough()}),zMn=te.object({uri:te.string().startsWith("file://"),name:te.optional(te.string()),_meta:te.optional(te.object({}).passthrough())}).passthrough(),U0e=zg.extend({method:te.literal("roots/list")}),YMn=O3.extend({roots:te.array(zMn)}),JMn=R5.extend({method:te.literal("notifications/roots/list_changed")}),KLo=te.union([k0e,aMn,jMn,BMn,CMn,vMn,dMn,fMn,pMn,mMn,gMn,DMn,IMn]),XLo=te.union([O0e,M0e,QMt,JMn]),ZLo=te.union([GD,LMn,VMn,YMn]),eFo=te.union([k0e,PMn,HMn,U0e]),tFo=te.union([O0e,M0e,NMn,AMn,hMn,RMn,wMn]),rFo=te.union([GD,ZFe,lUe,uX,cX,tUe,rUe,nUe,F0e,aUe]),B3=class extends Error{constructor(e,r,n){super(`MCP error ${e}: ${r}`),this.code=e,this.data=n,this.name="McpError"}}});function zMt(t,e){return Object.entries(e).reduce((r,[n,i])=>(i&&typeof i=="object"?r[n]=r[n]?{...r[n],...i}:i:r[n]=i,r),{...t})}var KMn,Q0e,YMt=ae(()=>{aS();KMn=6e4,Q0e=class{constructor(e){this._options=e,this._requestMessageId=0,this._requestHandlers=new Map,this._requestHandlerAbortControllers=new Map,this._notificationHandlers=new Map,this._responseHandlers=new Map,this._progressHandlers=new Map,this._timeoutInfo=new Map,this._pendingDebouncedNotifications=new Set,this.setNotificationHandler(O0e,r=>{let n=this._requestHandlerAbortControllers.get(r.params.requestId);n?.abort(r.params.reason)}),this.setNotificationHandler(M0e,r=>{this._onprogress(r)}),this.setRequestHandler(k0e,r=>({}))}_setupTimeout(e,r,n,i,o=!1){this._timeoutInfo.set(e,{timeoutId:setTimeout(i,r),startTime:Date.now(),timeout:r,maxTotalTimeout:n,resetTimeoutOnProgress:o,onTimeout:i})}_resetTimeout(e){let r=this._timeoutInfo.get(e);if(!r)return!1;let n=Date.now()-r.startTime;if(r.maxTotalTimeout&&n>=r.maxTotalTimeout)throw this._timeoutInfo.delete(e),new B3(R3.RequestTimeout,"Maximum total timeout exceeded",{maxTotalTimeout:r.maxTotalTimeout,totalElapsed:n});return clearTimeout(r.timeoutId),r.timeoutId=setTimeout(r.onTimeout,r.timeout),!0}_cleanupTimeout(e){let r=this._timeoutInfo.get(e);r&&(clearTimeout(r.timeoutId),this._timeoutInfo.delete(e))}async connect(e){var r,n,i;this._transport=e;let o=(r=this.transport)===null||r===void 0?void 0:r.onclose;this._transport.onclose=()=>{o?.(),this._onclose()};let s=(n=this.transport)===null||n===void 0?void 0:n.onerror;this._transport.onerror=c=>{s?.(c),this._onerror(c)};let a=(i=this._transport)===null||i===void 0?void 0:i.onmessage;this._transport.onmessage=(c,u)=>{a?.(c,u),aX(c)||FMt(c)?this._onresponse(c):N0e(c)?this._onrequest(c,u):MMt(c)?this._onnotification(c):this._onerror(new Error(`Unknown message type: ${JSON.stringify(c)}`))},await this._transport.start()}_onclose(){var e;let r=this._responseHandlers;this._responseHandlers=new Map,this._progressHandlers.clear(),this._pendingDebouncedNotifications.clear(),this._transport=void 0,(e=this.onclose)===null||e===void 0||e.call(this);let n=new B3(R3.ConnectionClosed,"Connection closed");for(let i of r.values())i(n)}_onerror(e){var r;(r=this.onerror)===null||r===void 0||r.call(this,e)}_onnotification(e){var r;let n=(r=this._notificationHandlers.get(e.method))!==null&&r!==void 0?r:this.fallbackNotificationHandler;n!==void 0&&Promise.resolve().then(()=>n(e)).catch(i=>this._onerror(new Error(`Uncaught error in notification handler: ${i}`)))}_onrequest(e,r){var n,i;let o=(n=this._requestHandlers.get(e.method))!==null&&n!==void 0?n:this.fallbackRequestHandler,s=this._transport;if(o===void 0){s?.send({jsonrpc:"2.0",id:e.id,error:{code:R3.MethodNotFound,message:"Method not found"}}).catch(u=>this._onerror(new Error(`Failed to send an error response: ${u}`)));return}let a=new AbortController;this._requestHandlerAbortControllers.set(e.id,a);let c={signal:a.signal,sessionId:s?.sessionId,_meta:(i=e.params)===null||i===void 0?void 0:i._meta,sendNotification:u=>this.notification(u,{relatedRequestId:e.id}),sendRequest:(u,d,f)=>this.request(u,d,{...f,relatedRequestId:e.id}),authInfo:r?.authInfo,requestId:e.id,requestInfo:r?.requestInfo};Promise.resolve().then(()=>o(e,c)).then(u=>{if(!a.signal.aborted)return s?.send({result:u,jsonrpc:"2.0",id:e.id})},u=>{var d;if(!a.signal.aborted)return s?.send({jsonrpc:"2.0",id:e.id,error:{code:Number.isSafeInteger(u.code)?u.code:R3.InternalError,message:(d=u.message)!==null&&d!==void 0?d:"Internal error"}})}).catch(u=>this._onerror(new Error(`Failed to send response: ${u}`))).finally(()=>{this._requestHandlerAbortControllers.delete(e.id)})}_onprogress(e){let{progressToken:r,...n}=e.params,i=Number(r),o=this._progressHandlers.get(i);if(!o){this._onerror(new Error(`Received a progress notification for an unknown token: ${JSON.stringify(e)}`));return}let s=this._responseHandlers.get(i),a=this._timeoutInfo.get(i);if(a&&s&&a.resetTimeoutOnProgress)try{this._resetTimeout(i)}catch(c){s(c);return}o(n)}_onresponse(e){let r=Number(e.id),n=this._responseHandlers.get(r);if(n===void 0){this._onerror(new Error(`Received a response for an unknown message ID: ${JSON.stringify(e)}`));return}if(this._responseHandlers.delete(r),this._progressHandlers.delete(r),this._cleanupTimeout(r),aX(e))n(e);else{let i=new B3(e.error.code,e.error.message,e.error.data);n(i)}}get transport(){return this._transport}async close(){var e;await((e=this._transport)===null||e===void 0?void 0:e.close())}request(e,r,n){let{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}=n??{};return new Promise((a,c)=>{var u,d,f,p,h,m;if(!this._transport){c(new Error("Not connected"));return}((u=this._options)===null||u===void 0?void 0:u.enforceStrictCapabilities)===!0&&this.assertCapabilityForMethod(e.method),(d=n?.signal)===null||d===void 0||d.throwIfAborted();let g=this._requestMessageId++,A={...e,jsonrpc:"2.0",id:g};n?.onprogress&&(this._progressHandlers.set(g,n.onprogress),A.params={...e.params,_meta:{...((f=e.params)===null||f===void 0?void 0:f._meta)||{},progressToken:g}});let y=x=>{var w;this._responseHandlers.delete(g),this._progressHandlers.delete(g),this._cleanupTimeout(g),(w=this._transport)===null||w===void 0||w.send({jsonrpc:"2.0",method:"notifications/cancelled",params:{requestId:g,reason:String(x)}},{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}).catch(O=>this._onerror(new Error(`Failed to send cancellation: ${O}`))),c(x)};this._responseHandlers.set(g,x=>{var w;if(!(!((w=n?.signal)===null||w===void 0)&&w.aborted)){if(x instanceof Error)return c(x);try{let O=r.parse(x.result);a(O)}catch(O){c(O)}}}),(p=n?.signal)===null||p===void 0||p.addEventListener("abort",()=>{var x;y((x=n?.signal)===null||x===void 0?void 0:x.reason)});let E=(h=n?.timeout)!==null&&h!==void 0?h:KMn,C=()=>y(new B3(R3.RequestTimeout,"Request timed out",{timeout:E}));this._setupTimeout(g,E,n?.maxTotalTimeout,C,(m=n?.resetTimeoutOnProgress)!==null&&m!==void 0?m:!1),this._transport.send(A,{relatedRequestId:i,resumptionToken:o,onresumptiontoken:s}).catch(x=>{this._cleanupTimeout(g),c(x)})})}async notification(e,r){var n,i;if(!this._transport)throw new Error("Not connected");if(this.assertNotificationCapability(e.method),((i=(n=this._options)===null||n===void 0?void 0:n.debouncedNotificationMethods)!==null&&i!==void 0?i:[]).includes(e.method)&&!e.params&&!r?.relatedRequestId){if(this._pendingDebouncedNotifications.has(e.method))return;this._pendingDebouncedNotifications.add(e.method),Promise.resolve().then(()=>{var c;if(this._pendingDebouncedNotifications.delete(e.method),!this._transport)return;let u={...e,jsonrpc:"2.0"};(c=this._transport)===null||c===void 0||c.send(u,r).catch(d=>this._onerror(d))});return}let a={...e,jsonrpc:"2.0"};await this._transport.send(a,r)}setRequestHandler(e,r){let n=e.shape.method.value;this.assertRequestHandlerCapability(n),this._requestHandlers.set(n,(i,o)=>Promise.resolve(r(e.parse(i),o)))}removeRequestHandler(e){this._requestHandlers.delete(e)}assertCanSetRequestHandler(e){if(this._requestHandlers.has(e))throw new Error(`A request handler for ${e} already exists, which would be overridden`)}setNotificationHandler(e,r){this._notificationHandlers.set(e.shape.method.value,n=>Promise.resolve(r(e.parse(n))))}removeNotificationHandler(e){this._notificationHandlers.delete(e)}}});var KMt=D((q0e,JMt)=>{(function(t,e){typeof q0e=="object"&&typeof JMt<"u"?e(q0e):typeof define=="function"&&define.amd?define(["exports"],e):e(t.URI=t.URI||{})})(q0e,(function(t){"use strict";function e(){for(var et=arguments.length,He=Array(et),rt=0;rt<et;rt++)He[rt]=arguments[rt];if(He.length>1){He[0]=He[0].slice(0,-1);for(var pt=He.length-1,gt=1;gt<pt;++gt)He[gt]=He[gt].slice(1,-1);return He[pt]=He[pt].slice(1),He.join("")}else return He[0]}function r(et){return"(?:"+et+")"}function n(et){return et===void 0?"undefined":et===null?"null":Object.prototype.toString.call(et).split(" ").pop().split("]").shift().toLowerCase()}function i(et){return et.toUpperCase()}function o(et){return et!=null?et instanceof Array?et:typeof et.length!="number"||et.split||et.setInterval||et.call?[et]:Array.prototype.slice.call(et):[]}function s(et,He){var rt=et;if(He)for(var pt in He)rt[pt]=He[pt];return rt}function a(et){var He="[A-Za-z]",rt="[\\x0D]",pt="[0-9]",gt="[\\x22]",jt=e(pt,"[A-Fa-f]"),Cr="[\\x0A]",Qr="[\\x20]",hn=r(r("%[EFef]"+jt+"%"+jt+jt+"%"+jt+jt)+"|"+r("%[89A-Fa-f]"+jt+"%"+jt+jt)+"|"+r("%"+jt+jt)),gi="[\\:\\/\\?\\#\\[\\]\\@]",ai="[\\!\\$\\&\\'\\(\\)\\*\\+\\,\\;\\=]",$i=e(gi,ai),ji=et?"[\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]":"[]",In=et?"[\\uE000-\\uF8FF]":"[]",Ti=e(He,pt,"[\\-\\.\\_\\~]",ji),Vo=r(He+e(He,pt,"[\\+\\-\\.]")+"*"),Eo=r(r(hn+"|"+e(Ti,ai,"[\\:]"))+"*"),Pl=r(r("25[0-5]")+"|"+r("2[0-4]"+pt)+"|"+r("1"+pt+pt)+"|"+r("[1-9]"+pt)+"|"+pt),La=r(r("25[0-5]")+"|"+r("2[0-4]"+pt)+"|"+r("1"+pt+pt)+"|"+r("0?[1-9]"+pt)+"|0?0?"+pt),Ll=r(La+"\\."+La+"\\."+La+"\\."+La),lo=r(jt+"{1,4}"),hc=r(r(lo+"\\:"+lo)+"|"+Ll),Lo=r(r(lo+"\\:")+"{6}"+hc),Pi=r("\\:\\:"+r(lo+"\\:")+"{5}"+hc),Ad=r(r(lo)+"?\\:\\:"+r(lo+"\\:")+"{4}"+hc),mc=r(r(r(lo+"\\:")+"{0,1}"+lo)+"?\\:\\:"+r(lo+"\\:")+"{3}"+hc),yd=r(r(r(lo+"\\:")+"{0,2}"+lo)+"?\\:\\:"+r(lo+"\\:")+"{2}"+hc),Ed=r(r(r(lo+"\\:")+"{0,3}"+lo)+"?\\:\\:"+lo+"\\:"+hc),Fa=r(r(r(lo+"\\:")+"{0,4}"+lo)+"?\\:\\:"+hc),Hs=r(r(r(lo+"\\:")+"{0,5}"+lo)+"?\\:\\:"+lo),gc=r(r(r(lo+"\\:")+"{0,6}"+lo)+"?\\:\\:"),Pe=r([Lo,Pi,Ad,mc,yd,Ed,Fa,Hs,gc].join("|")),Ue=r(r(Ti+"|"+hn)+"+"),st=r(Pe+"\\%25"+Ue),ft=r(Pe+r("\\%25|\\%(?!"+jt+"{2})")+Ue),Ct=r("[vV]"+jt+"+\\."+e(Ti,ai,"[\\:]")+"+"),kt=r("\\["+r(ft+"|"+Pe+"|"+Ct)+"\\]"),nr=r(r(hn+"|"+e(Ti,ai))+"*"),er=r(kt+"|"+Ll+"(?!"+nr+")|"+nr),mr=r(pt+"*"),gr=r(r(Eo+"@")+"?"+er+r("\\:"+mr)+"?"),wr=r(hn+"|"+e(Ti,ai,"[\\:\\@]")),Bn=r(wr+"*"),Xi=r(wr+"+"),ns=r(r(hn+"|"+e(Ti,ai,"[\\@]"))+"+"),Ri=r(r("\\/"+Bn)+"*"),ml=r("\\/"+r(Xi+Ri)+"?"),Ac=r(ns+Ri),Kd=r(Xi+Ri),gl="(?!"+wr+")",QA=r(Ri+"|"+ml+"|"+Ac+"|"+Kd+"|"+gl),pp=r(r(wr+"|"+e("[\\/\\?]",In))+"*"),fh=r(r(wr+"|[\\/\\?]")+"*"),Cm=r(r("\\/\\/"+gr+Ri)+"|"+ml+"|"+Kd+"|"+gl),h6=r(Vo+"\\:"+Cm+r("\\?"+pp)+"?"+r("\\#"+fh)+"?"),X2=r(r("\\/\\/"+gr+Ri)+"|"+ml+"|"+Ac+"|"+gl),wu=r(X2+r("\\?"+pp)+"?"+r("\\#"+fh)+"?"),wg=r(h6+"|"+wu),_u=r(Vo+"\\:"+Cm+r("\\?"+pp)+"?"),Xd="^("+Vo+")\\:"+r(r("\\/\\/("+r("("+Eo+")@")+"?("+er+")"+r("\\:("+mr+")")+"?)")+"?("+Ri+"|"+ml+"|"+Kd+"|"+gl+")")+r("\\?("+pp+")")+"?"+r("\\#("+fh+")")+"?$",bm="^(){0}"+r(r("\\/\\/("+r("("+Eo+")@")+"?("+er+")"+r("\\:("+mr+")")+"?)")+"?("+Ri+"|"+ml+"|"+Ac+"|"+gl+")")+r("\\?("+pp+")")+"?"+r("\\#("+fh+")")+"?$",d0="^("+Vo+")\\:"+r(r("\\/\\/("+r("("+Eo+")@")+"?("+er+")"+r("\\:("+mr+")")+"?)")+"?("+Ri+"|"+ml+"|"+Kd+"|"+gl+")")+r("\\?("+pp+")")+"?$",Tu="^"+r("\\#("+fh+")")+"?$",_g="^"+r("("+Eo+")@")+"?("+er+")"+r("\\:("+mr+")")+"?$";return{NOT_SCHEME:new RegExp(e("[^]",He,pt,"[\\+\\-\\.]"),"g"),NOT_USERINFO:new RegExp(e("[^\\%\\:]",Ti,ai),"g"),NOT_HOST:new RegExp(e("[^\\%\\[\\]\\:]",Ti,ai),"g"),NOT_PATH:new RegExp(e("[^\\%\\/\\:\\@]",Ti,ai),"g"),NOT_PATH_NOSCHEME:new RegExp(e("[^\\%\\/\\@]",Ti,ai),"g"),NOT_QUERY:new RegExp(e("[^\\%]",Ti,ai,"[\\:\\@\\/\\?]",In),"g"),NOT_FRAGMENT:new RegExp(e("[^\\%]",Ti,ai,"[\\:\\@\\/\\?]"),"g"),ESCAPE:new RegExp(e("[^]",Ti,ai),"g"),UNRESERVED:new RegExp(Ti,"g"),OTHER_CHARS:new RegExp(e("[^\\%]",Ti,$i),"g"),PCT_ENCODED:new RegExp(hn,"g"),IPV4ADDRESS:new RegExp("^("+Ll+")$"),IPV6ADDRESS:new RegExp("^\\[?("+Pe+")"+r(r("\\%25|\\%(?!"+jt+"{2})")+"("+Ue+")")+"?\\]?$")}}var c=a(!1),u=a(!0),d=(function(){function et(He,rt){var pt=[],gt=!0,jt=!1,Cr=void 0;try{for(var Qr=He[Symbol.iterator](),hn;!(gt=(hn=Qr.next()).done)&&(pt.push(hn.value),!(rt&&pt.length===rt));gt=!0);}catch(gi){jt=!0,Cr=gi}finally{try{!gt&&Qr.return&&Qr.return()}finally{if(jt)throw Cr}}return pt}return function(He,rt){if(Array.isArray(He))return He;if(Symbol.iterator in Object(He))return et(He,rt);throw new TypeError("Invalid attempt to destructure non-iterable instance")}})(),f=function(et){if(Array.isArray(et)){for(var He=0,rt=Array(et.length);He<et.length;He++)rt[He]=et[He];return rt}else return Array.from(et)},p=2147483647,h=36,m=1,g=26,A=38,y=700,E=72,C=128,x="-",w=/^xn--/,O=/[^\0-\x7E]/,N=/[\x2E\u3002\uFF0E\uFF61]/g,U={overflow:"Overflow: input needs wider integers to process","not-basic":"Illegal input >= 0x80 (not a basic code point)","invalid-input":"Invalid input"},S=h-m,k=Math.floor,B=String.fromCharCode;function F(et){throw new RangeError(U[et])}function L(et,He){for(var rt=[],pt=et.length;pt--;)rt[pt]=He(et[pt]);return rt}function R(et,He){var rt=et.split("@"),pt="";rt.length>1&&(pt=rt[0]+"@",et=rt[1]),et=et.replace(N,".");var gt=et.split("."),jt=L(gt,He).join(".");return pt+jt}function q(et){for(var He=[],rt=0,pt=et.length;rt<pt;){var gt=et.charCodeAt(rt++);if(gt>=55296&&gt<=56319&&rt<pt){var jt=et.charCodeAt(rt++);(jt&64512)==56320?He.push(((gt&1023)<<10)+(jt&1023)+65536):(He.push(gt),rt--)}else He.push(gt)}return He}var Q=function(He){return String.fromCodePoint.apply(String,f(He))},V=function(He){return He-48<10?He-22:He-65<26?He-65:He-97<26?He-97:h},H=function(He,rt){return He+22+75*(He<26)-((rt!=0)<<5)},J=function(He,rt,pt){var gt=0;for(He=pt?k(He/y):He>>1,He+=k(He/rt);He>S*g>>1;gt+=h)He=k(He/S);return k(gt+(S+1)*He/(He+A))},X=function(He){var rt=[],pt=He.length,gt=0,jt=C,Cr=E,Qr=He.lastIndexOf(x);Qr<0&&(Qr=0);for(var hn=0;hn<Qr;++hn)He.charCodeAt(hn)>=128&&F("not-basic"),rt.push(He.charCodeAt(hn));for(var gi=Qr>0?Qr+1:0;gi<pt;){for(var ai=gt,$i=1,ji=h;;ji+=h){gi>=pt&&F("invalid-input");var In=V(He.charCodeAt(gi++));(In>=h||In>k((p-gt)/$i))&&F("overflow"),gt+=In*$i;var Ti=ji<=Cr?m:ji>=Cr+g?g:ji-Cr;if(In<Ti)break;var Vo=h-Ti;$i>k(p/Vo)&&F("overflow"),$i*=Vo}var Eo=rt.length+1;Cr=J(gt-ai,Eo,ai==0),k(gt/Eo)>p-jt&&F("overflow"),jt+=k(gt/Eo),gt%=Eo,rt.splice(gt++,0,jt)}return String.fromCodePoint.apply(String,rt)},he=function(He){var rt=[];He=q(He);var pt=He.length,gt=C,jt=0,Cr=E,Qr=!0,hn=!1,gi=void 0;try{for(var ai=He[Symbol.iterator](),$i;!(Qr=($i=ai.next()).done);Qr=!0){var ji=$i.value;ji<128&&rt.push(B(ji))}}catch(ft){hn=!0,gi=ft}finally{try{!Qr&&ai.return&&ai.return()}finally{if(hn)throw gi}}var In=rt.length,Ti=In;for(In&&rt.push(x);Ti<pt;){var Vo=p,Eo=!0,Pl=!1,La=void 0;try{for(var Ll=He[Symbol.iterator](),lo;!(Eo=(lo=Ll.next()).done);Eo=!0){var hc=lo.value;hc>=gt&&hc<Vo&&(Vo=hc)}}catch(ft){Pl=!0,La=ft}finally{try{!Eo&&Ll.return&&Ll.return()}finally{if(Pl)throw La}}var Lo=Ti+1;Vo-gt>k((p-jt)/Lo)&&F("overflow"),jt+=(Vo-gt)*Lo,gt=Vo;var Pi=!0,Ad=!1,mc=void 0;try{for(var yd=He[Symbol.iterator](),Ed;!(Pi=(Ed=yd.next()).done);Pi=!0){var Fa=Ed.value;if(Fa<gt&&++jt>p&&F("overflow"),Fa==gt){for(var Hs=jt,gc=h;;gc+=h){var Pe=gc<=Cr?m:gc>=Cr+g?g:gc-Cr;if(Hs<Pe)break;var Ue=Hs-Pe,st=h-Pe;rt.push(B(H(Pe+Ue%st,0))),Hs=k(Ue/st)}rt.push(B(H(Hs,0))),Cr=J(jt,Lo,Ti==In),jt=0,++Ti}}}catch(ft){Ad=!0,mc=ft}finally{try{!Pi&&yd.return&&yd.return()}finally{if(Ad)throw mc}}++jt,++gt}return rt.join("")},Ce=function(He){return R(He,function(rt){return w.test(rt)?X(rt.slice(4).toLowerCase()):rt})},ge=function(He){return R(He,function(rt){return O.test(rt)?"xn--"+he(rt):rt})},be={version:"2.1.0",ucs2:{decode:q,encode:Q},decode:X,encode:he,toASCII:ge,toUnicode:Ce},xe={};function se(et){var He=et.charCodeAt(0),rt=void 0;return He<16?rt="%0"+He.toString(16).toUpperCase():He<128?rt="%"+He.toString(16).toUpperCase():He<2048?rt="%"+(He>>6|192).toString(16).toUpperCase()+"%"+(He&63|128).toString(16).toUpperCase():rt="%"+(He>>12|224).toString(16).toUpperCase()+"%"+(He>>6&63|128).toString(16).toUpperCase()+"%"+(He&63|128).toString(16).toUpperCase(),rt}function me(et){for(var He="",rt=0,pt=et.length;rt<pt;){var gt=parseInt(et.substr(rt+1,2),16);if(gt<128)He+=String.fromCharCode(gt),rt+=3;else if(gt>=194&&gt<224){if(pt-rt>=6){var jt=parseInt(et.substr(rt+4,2),16);He+=String.fromCharCode((gt&31)<<6|jt&63)}else He+=et.substr(rt,6);rt+=6}else if(gt>=224){if(pt-rt>=9){var Cr=parseInt(et.substr(rt+4,2),16),Qr=parseInt(et.substr(rt+7,2),16);He+=String.fromCharCode((gt&15)<<12|(Cr&63)<<6|Qr&63)}else He+=et.substr(rt,9);rt+=9}else He+=et.substr(rt,3),rt+=3}return He}function ve(et,He){function rt(pt){var gt=me(pt);return gt.match(He.UNRESERVED)?gt:pt}return et.scheme&&(et.scheme=String(et.scheme).replace(He.PCT_ENCODED,rt).toLowerCase().replace(He.NOT_SCHEME,"")),et.userinfo!==void 0&&(et.userinfo=String(et.userinfo).replace(He.PCT_ENCODED,rt).replace(He.NOT_USERINFO,se).replace(He.PCT_ENCODED,i)),et.host!==void 0&&(et.host=String(et.host).replace(He.PCT_ENCODED,rt).toLowerCase().replace(He.NOT_HOST,se).replace(He.PCT_ENCODED,i)),et.path!==void 0&&(et.path=String(et.path).replace(He.PCT_ENCODED,rt).replace(et.scheme?He.NOT_PATH:He.NOT_PATH_NOSCHEME,se).replace(He.PCT_ENCODED,i)),et.query!==void 0&&(et.query=String(et.query).replace(He.PCT_ENCODED,rt).replace(He.NOT_QUERY,se).replace(He.PCT_ENCODED,i)),et.fragment!==void 0&&(et.fragment=String(et.fragment).replace(He.PCT_ENCODED,rt).replace(He.NOT_FRAGMENT,se).replace(He.PCT_ENCODED,i)),et}function ee(et){return et.replace(/^0*(.*)/,"$1")||"0"}function ce(et,He){var rt=et.match(He.IPV4ADDRESS)||[],pt=d(rt,2),gt=pt[1];return gt?gt.split(".").map(ee).join("."):et}function Y(et,He){var rt=et.match(He.IPV6ADDRESS)||[],pt=d(rt,3),gt=pt[1],jt=pt[2];if(gt){for(var Cr=gt.toLowerCase().split("::").reverse(),Qr=d(Cr,2),hn=Qr[0],gi=Qr[1],ai=gi?gi.split(":").map(ee):[],$i=hn.split(":").map(ee),ji=He.IPV4ADDRESS.test($i[$i.length-1]),In=ji?7:8,Ti=$i.length-In,Vo=Array(In),Eo=0;Eo<In;++Eo)Vo[Eo]=ai[Eo]||$i[Ti+Eo]||"";ji&&(Vo[In-1]=ce(Vo[In-1],He));var Pl=Vo.reduce(function(Lo,Pi,Ad){if(!Pi||Pi==="0"){var mc=Lo[Lo.length-1];mc&&mc.index+mc.length===Ad?mc.length++:Lo.push({index:Ad,length:1})}return Lo},[]),La=Pl.sort(function(Lo,Pi){return Pi.length-Lo.length})[0],Ll=void 0;if(La&&La.length>1){var lo=Vo.slice(0,La.index),hc=Vo.slice(La.index+La.length);Ll=lo.join(":")+"::"+hc.join(":")}else Ll=Vo.join(":");return jt&&(Ll+="%"+jt),Ll}else return et}var re=/^(?:([^:\/?#]+):)?(?:\/\/((?:([^\/?#@]*)@)?(\[[^\/?#\]]+\]|[^\/?#:]*)(?:\:(\d*))?))?([^?#]*)(?:\?([^#]*))?(?:#((?:.|\n|\r)*))?/i,ue="".match(/(){0}/)[1]===void 0;function Z(et){var He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rt={},pt=He.iri!==!1?u:c;He.reference==="suffix"&&(et=(He.scheme?He.scheme+":":"")+"//"+et);var gt=et.match(re);if(gt){ue?(rt.scheme=gt[1],rt.userinfo=gt[3],rt.host=gt[4],rt.port=parseInt(gt[5],10),rt.path=gt[6]||"",rt.query=gt[7],rt.fragment=gt[8],isNaN(rt.port)&&(rt.port=gt[5])):(rt.scheme=gt[1]||void 0,rt.userinfo=et.indexOf("@")!==-1?gt[3]:void 0,rt.host=et.indexOf("//")!==-1?gt[4]:void 0,rt.port=parseInt(gt[5],10),rt.path=gt[6]||"",rt.query=et.indexOf("?")!==-1?gt[7]:void 0,rt.fragment=et.indexOf("#")!==-1?gt[8]:void 0,isNaN(rt.port)&&(rt.port=et.match(/\/\/(?:.|\n)*\:(?:\/|\?|\#|$)/)?gt[4]:void 0)),rt.host&&(rt.host=Y(ce(rt.host,pt),pt)),rt.scheme===void 0&&rt.userinfo===void 0&&rt.host===void 0&&rt.port===void 0&&!rt.path&&rt.query===void 0?rt.reference="same-document":rt.scheme===void 0?rt.reference="relative":rt.fragment===void 0?rt.reference="absolute":rt.reference="uri",He.reference&&He.reference!=="suffix"&&He.reference!==rt.reference&&(rt.error=rt.error||"URI is not a "+He.reference+" reference.");var jt=xe[(He.scheme||rt.scheme||"").toLowerCase()];if(!He.unicodeSupport&&(!jt||!jt.unicodeSupport)){if(rt.host&&(He.domainHost||jt&&jt.domainHost))try{rt.host=be.toASCII(rt.host.replace(pt.PCT_ENCODED,me).toLowerCase())}catch(Cr){rt.error=rt.error||"Host's domain name can not be converted to ASCII via punycode: "+Cr}ve(rt,c)}else ve(rt,pt);jt&&jt.parse&&jt.parse(rt,He)}else rt.error=rt.error||"URI can not be parsed.";return rt}function $(et,He){var rt=He.iri!==!1?u:c,pt=[];return et.userinfo!==void 0&&(pt.push(et.userinfo),pt.push("@")),et.host!==void 0&&pt.push(Y(ce(String(et.host),rt),rt).replace(rt.IPV6ADDRESS,function(gt,jt,Cr){return"["+jt+(Cr?"%25"+Cr:"")+"]"})),(typeof et.port=="number"||typeof et.port=="string")&&(pt.push(":"),pt.push(String(et.port))),pt.length?pt.join(""):void 0}var j=/^\.\.?\//,Ee=/^\/\.(\/|$)/,de=/^\/\.\.(\/|$)/,z=/^\/?(?:.|\n)*?(?=\/|$)/;function Te(et){for(var He=[];et.length;)if(et.match(j))et=et.replace(j,"");else if(et.match(Ee))et=et.replace(Ee,"/");else if(et.match(de))et=et.replace(de,"/"),He.pop();else if(et==="."||et==="..")et="";else{var rt=et.match(z);if(rt){var pt=rt[0];et=et.slice(pt.length),He.push(pt)}else throw new Error("Unexpected dot segment condition")}return He.join("")}function Be(et){var He=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},rt=He.iri?u:c,pt=[],gt=xe[(He.scheme||et.scheme||"").toLowerCase()];if(gt&&gt.serialize&&gt.serialize(et,He),et.host&&!rt.IPV6ADDRESS.test(et.host)){if(He.domainHost||gt&&gt.domainHost)try{et.host=He.iri?be.toUnicode(et.host):be.toASCII(et.host.replace(rt.PCT_ENCODED,me).toLowerCase())}catch(Qr){et.error=et.error||"Host's domain name can not be converted to "+(He.iri?"Unicode":"ASCII")+" via punycode: "+Qr}}ve(et,rt),He.reference!=="suffix"&&et.scheme&&(pt.push(et.scheme),pt.push(":"));var jt=$(et,He);if(jt!==void 0&&(He.reference!=="suffix"&&pt.push("//"),pt.push(jt),et.path&&et.path.charAt(0)!=="/"&&pt.push("/")),et.path!==void 0){var Cr=et.path;!He.absolutePath&&(!gt||!gt.absolutePath)&&(Cr=Te(Cr)),jt===void 0&&(Cr=Cr.replace(/^\/\//,"/%2F")),pt.push(Cr)}return et.query!==void 0&&(pt.push("?"),pt.push(et.query)),et.fragment!==void 0&&(pt.push("#"),pt.push(et.fragment)),pt.join("")}function Oe(et,He){var rt=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},pt=arguments[3],gt={};return pt||(et=Z(Be(et,rt),rt),He=Z(Be(He,rt),rt)),rt=rt||{},!rt.tolerant&&He.scheme?(gt.scheme=He.scheme,gt.userinfo=He.userinfo,gt.host=He.host,gt.port=He.port,gt.path=Te(He.path||""),gt.query=He.query):(He.userinfo!==void 0||He.host!==void 0||He.port!==void 0?(gt.userinfo=He.userinfo,gt.host=He.host,gt.port=He.port,gt.path=Te(He.path||""),gt.query=He.query):(He.path?(He.path.charAt(0)==="/"?gt.path=Te(He.path):((et.userinfo!==void 0||et.host!==void 0||et.port!==void 0)&&!et.path?gt.path="/"+He.path:et.path?gt.path=et.path.slice(0,et.path.lastIndexOf("/")+1)+He.path:gt.path=He.path,gt.path=Te(gt.path)),gt.query=He.query):(gt.path=et.path,He.query!==void 0?gt.query=He.query:gt.query=et.query),gt.userinfo=et.userinfo,gt.host=et.host,gt.port=et.port),gt.scheme=et.scheme),gt.fragment=He.fragment,gt}function ke(et,He,rt){var pt=s({scheme:"null"},rt);return Be(Oe(Z(et,pt),Z(He,pt),pt,!0),pt)}function le(et,He){return typeof et=="string"?et=Be(Z(et,He),He):n(et)==="object"&&(et=Z(Be(et,He),He)),et}function Ie(et,He,rt){return typeof et=="string"?et=Be(Z(et,rt),rt):n(et)==="object"&&(et=Be(et,rt)),typeof He=="string"?He=Be(Z(He,rt),rt):n(He)==="object"&&(He=Be(He,rt)),et===He}function De(et,He){return et&&et.toString().replace(!He||!He.iri?c.ESCAPE:u.ESCAPE,se)}function Re(et,He){return et&&et.toString().replace(!He||!He.iri?c.PCT_ENCODED:u.PCT_ENCODED,me)}var Ge={scheme:"http",domainHost:!0,parse:function(He,rt){return He.host||(He.error=He.error||"HTTP URIs must have a host."),He},serialize:function(He,rt){var pt=String(He.scheme).toLowerCase()==="https";return(He.port===(pt?443:80)||He.port==="")&&(He.port=void 0),He.path||(He.path="/"),He}},Ke={scheme:"https",domainHost:Ge.domainHost,parse:Ge.parse,serialize:Ge.serialize};function tt(et){return typeof et.secure=="boolean"?et.secure:String(et.scheme).toLowerCase()==="wss"}var ut={scheme:"ws",domainHost:!0,parse:function(He,rt){var pt=He;return pt.secure=tt(pt),pt.resourceName=(pt.path||"/")+(pt.query?"?"+pt.query:""),pt.path=void 0,pt.query=void 0,pt},serialize:function(He,rt){if((He.port===(tt(He)?443:80)||He.port==="")&&(He.port=void 0),typeof He.secure=="boolean"&&(He.scheme=He.secure?"wss":"ws",He.secure=void 0),He.resourceName){var pt=He.resourceName.split("?"),gt=d(pt,2),jt=gt[0],Cr=gt[1];He.path=jt&&jt!=="/"?jt:void 0,He.query=Cr,He.resourceName=void 0}return He.fragment=void 0,He}},ht={scheme:"wss",domainHost:ut.domainHost,parse:ut.parse,serialize:ut.serialize},Jt={},Sr=!0,br="[A-Za-z0-9\\-\\.\\_\\~"+(Sr?"\\xA0-\\u200D\\u2010-\\u2029\\u202F-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF":"")+"]",fr="[0-9A-Fa-f]",wt=r(r("%[EFef]"+fr+"%"+fr+fr+"%"+fr+fr)+"|"+r("%[89A-Fa-f]"+fr+"%"+fr+fr)+"|"+r("%"+fr+fr)),vr="[A-Za-z0-9\\!\\$\\%\\'\\*\\+\\-\\^\\_\\`\\{\\|\\}\\~]",sr="[\\!\\$\\%\\'\\(\\)\\*\\+\\,\\-\\.0-9\\<\\>A-Z\\x5E-\\x7E]",Pt=e(sr,'[\\"\\\\]'),Kt="[\\!\\$\\'\\(\\)\\*\\+\\,\\;\\:\\@]",rr=new RegExp(br,"g"),Ar=new RegExp(wt,"g"),Cn=new RegExp(e("[^]",vr,"[\\.]",'[\\"]',Pt),"g"),Hr=new RegExp(e("[^]",br,Kt),"g"),Fr=Hr;function Jr(et){var He=me(et);return He.match(rr)?He:et}var si={scheme:"mailto",parse:function(He,rt){var pt=He,gt=pt.to=pt.path?pt.path.split(","):[];if(pt.path=void 0,pt.query){for(var jt=!1,Cr={},Qr=pt.query.split("&"),hn=0,gi=Qr.length;hn<gi;++hn){var ai=Qr[hn].split("=");switch(ai[0]){case"to":for(var $i=ai[1].split(","),ji=0,In=$i.length;ji<In;++ji)gt.push($i[ji]);break;case"subject":pt.subject=Re(ai[1],rt);break;case"body":pt.body=Re(ai[1],rt);break;default:jt=!0,Cr[Re(ai[0],rt)]=Re(ai[1],rt);break}}jt&&(pt.headers=Cr)}pt.query=void 0;for(var Ti=0,Vo=gt.length;Ti<Vo;++Ti){var Eo=gt[Ti].split("@");if(Eo[0]=Re(Eo[0]),rt.unicodeSupport)Eo[1]=Re(Eo[1],rt).toLowerCase();else try{Eo[1]=be.toASCII(Re(Eo[1],rt).toLowerCase())}catch(Pl){pt.error=pt.error||"Email address's domain name can not be converted to ASCII via punycode: "+Pl}gt[Ti]=Eo.join("@")}return pt},serialize:function(He,rt){var pt=He,gt=o(He.to);if(gt){for(var jt=0,Cr=gt.length;jt<Cr;++jt){var Qr=String(gt[jt]),hn=Qr.lastIndexOf("@"),gi=Qr.slice(0,hn).replace(Ar,Jr).replace(Ar,i).replace(Cn,se),ai=Qr.slice(hn+1);try{ai=rt.iri?be.toUnicode(ai):be.toASCII(Re(ai,rt).toLowerCase())}catch(Ti){pt.error=pt.error||"Email address's domain name can not be converted to "+(rt.iri?"Unicode":"ASCII")+" via punycode: "+Ti}gt[jt]=gi+"@"+ai}pt.path=gt.join(",")}var $i=He.headers=He.headers||{};He.subject&&($i.subject=He.subject),He.body&&($i.body=He.body);var ji=[];for(var In in $i)$i[In]!==Jt[In]&&ji.push(In.replace(Ar,Jr).replace(Ar,i).replace(Hr,se)+"="+$i[In].replace(Ar,Jr).replace(Ar,i).replace(Fr,se));return ji.length&&(pt.query=ji.join("&")),pt}},mi=/^([^\:]+)\:(.*)/,Rn={scheme:"urn",parse:function(He,rt){var pt=He.path&&He.path.match(mi),gt=He;if(pt){var jt=rt.scheme||gt.scheme||"urn",Cr=pt[1].toLowerCase(),Qr=pt[2],hn=jt+":"+(rt.nid||Cr),gi=xe[hn];gt.nid=Cr,gt.nss=Qr,gt.path=void 0,gi&&(gt=gi.parse(gt,rt))}else gt.error=gt.error||"URN can not be parsed.";return gt},serialize:function(He,rt){var pt=rt.scheme||He.scheme||"urn",gt=He.nid,jt=pt+":"+(rt.nid||gt),Cr=xe[jt];Cr&&(He=Cr.serialize(He,rt));var Qr=He,hn=He.nss;return Qr.path=(gt||rt.nid)+":"+hn,Qr}},ao=/^[0-9A-Fa-f]{8}(?:\-[0-9A-Fa-f]{4}){3}\-[0-9A-Fa-f]{12}$/,Wi={scheme:"urn:uuid",parse:function(He,rt){var pt=He;return pt.uuid=pt.nss,pt.nss=void 0,!rt.tolerant&&(!pt.uuid||!pt.uuid.match(ao))&&(pt.error=pt.error||"UUID is not valid."),pt},serialize:function(He,rt){var pt=He;return pt.nss=(He.uuid||"").toLowerCase(),pt}};xe[Ge.scheme]=Ge,xe[Ke.scheme]=Ke,xe[ut.scheme]=ut,xe[ht.scheme]=ht,xe[si.scheme]=si,xe[Rn.scheme]=Rn,xe[Wi.scheme]=Wi,t.SCHEMES=xe,t.pctEncChar=se,t.pctDecChars=me,t.parse=Z,t.removeDotSegments=Te,t.serialize=Be,t.resolveComponents=Oe,t.resolve=ke,t.normalize=le,t.equal=Ie,t.escapeComponent=De,t.unescapeComponent=Re,Object.defineProperty(t,"__esModule",{value:!0})}))});var yU=D((sFo,XMt)=>{"use strict";XMt.exports=function t(e,r){if(e===r)return!0;if(e&&r&&typeof e=="object"&&typeof r=="object"){if(e.constructor!==r.constructor)return!1;var n,i,o;if(Array.isArray(e)){if(n=e.length,n!=r.length)return!1;for(i=n;i--!==0;)if(!t(e[i],r[i]))return!1;return!0}if(e.constructor===RegExp)return e.source===r.source&&e.flags===r.flags;if(e.valueOf!==Object.prototype.valueOf)return e.valueOf()===r.valueOf();if(e.toString!==Object.prototype.toString)return e.toString()===r.toString();if(o=Object.keys(e),n=o.length,n!==Object.keys(r).length)return!1;for(i=n;i--!==0;)if(!Object.prototype.hasOwnProperty.call(r,o[i]))return!1;for(i=n;i--!==0;){var s=o[i];if(!t(e[s],r[s]))return!1}return!0}return e!==e&&r!==r}});var ePt=D((aFo,ZMt)=>{"use strict";ZMt.exports=function(e){for(var r=0,n=e.length,i=0,o;i<n;)r++,o=e.charCodeAt(i++),o>=55296&&o<=56319&&i<n&&(o=e.charCodeAt(i),(o&64512)==56320&&i++);return r}});var HD=D((lFo,nPt)=>{"use strict";nPt.exports={copy:XMn,checkDataType:cUe,checkDataTypes:ZMn,coerceToTypes:ePn,toHash:dUe,getProperty:fUe,escapeQuotes:pUe,equal:yU(),ucs2length:ePt(),varOccurences:nPn,varReplace:iPn,schemaHasRules:oPn,schemaHasRulesExcept:sPn,schemaUnknownRules:aPn,toQuotedString:uUe,getPathExpr:lPn,getPath:cPn,getData:fPn,unescapeFragment:pPn,unescapeJsonPointer:mUe,escapeFragment:hPn,escapeJsonPointer:hUe};function XMn(t,e){e=e||{};for(var r in t)e[r]=t[r];return e}function cUe(t,e,r,n){var i=n?" !== ":" === ",o=n?" || ":" && ",s=n?"!":"",a=n?"":"!";switch(t){case"null":return e+i+"null";case"array":return s+"Array.isArray("+e+")";case"object":return"("+s+e+o+"typeof "+e+i+'"object"'+o+a+"Array.isArray("+e+"))";case"integer":return"(typeof "+e+i+'"number"'+o+a+"("+e+" % 1)"+o+e+i+e+(r?o+s+"isFinite("+e+")":"")+")";case"number":return"(typeof "+e+i+'"'+t+'"'+(r?o+s+"isFinite("+e+")":"")+")";default:return"typeof "+e+i+'"'+t+'"'}}function ZMn(t,e,r){switch(t.length){case 1:return cUe(t[0],e,r,!0);default:var n="",i=dUe(t);i.array&&i.object&&(n=i.null?"(":"(!"+e+" || ",n+="typeof "+e+' !== "object")',delete i.null,delete i.array,delete i.object),i.number&&delete i.integer;for(var o in i)n+=(n?" && ":"")+cUe(o,e,r,!0);return n}}var tPt=dUe(["string","number","integer","boolean","null"]);function ePn(t,e){if(Array.isArray(e)){for(var r=[],n=0;n<e.length;n++){var i=e[n];(tPt[i]||t==="array"&&i==="array")&&(r[r.length]=i)}if(r.length)return r}else{if(tPt[e])return[e];if(t==="array"&&e==="array")return["array"]}}function dUe(t){for(var e={},r=0;r<t.length;r++)e[t[r]]=!0;return e}var tPn=/^[a-z$_][a-z$_0-9]*$/i,rPn=/'|\\/g;function fUe(t){return typeof t=="number"?"["+t+"]":tPn.test(t)?"."+t:"['"+pUe(t)+"']"}function pUe(t){return t.replace(rPn,"\\$&").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\f/g,"\\f").replace(/\t/g,"\\t")}function nPn(t,e){e+="[^0-9]";var r=t.match(new RegExp(e,"g"));return r?r.length:0}function iPn(t,e,r){return e+="([^0-9])",r=r.replace(/\$/g,"$$$$"),t.replace(new RegExp(e,"g"),r+"$1")}function oPn(t,e){if(typeof t=="boolean")return!t;for(var r in t)if(e[r])return!0}function sPn(t,e,r){if(typeof t=="boolean")return!t&&r!="not";for(var n in t)if(n!=r&&e[n])return!0}function aPn(t,e){if(typeof t!="boolean"){for(var r in t)if(!e[r])return r}}function uUe(t){return"'"+pUe(t)+"'"}function lPn(t,e,r,n){var i=r?"'/' + "+e+(n?"":".replace(/~/g, '~0').replace(/\\//g, '~1')"):n?"'[' + "+e+" + ']'":"'[\\'' + "+e+" + '\\']'";return rPt(t,i)}function cPn(t,e,r){var n=uUe(r?"/"+hUe(e):fUe(e));return rPt(t,n)}var uPn=/^\/(?:[^~]|~0|~1)*$/,dPn=/^([0-9]+)(#|\/(?:[^~]|~0|~1)*)?$/;function fPn(t,e,r){var n,i,o,s;if(t==="")return"rootData";if(t[0]=="/"){if(!uPn.test(t))throw new Error("Invalid JSON-pointer: "+t);i=t,o="rootData"}else{if(s=t.match(dPn),!s)throw new Error("Invalid JSON-pointer: "+t);if(n=+s[1],i=s[2],i=="#"){if(n>=e)throw new Error("Cannot access property/index "+n+" levels up, current level is "+e);return r[e-n]}if(n>e)throw new Error("Cannot access data "+n+" levels up, current level is "+e);if(o="data"+(e-n||""),!i)return o}for(var a=o,c=i.split("/"),u=0;u<c.length;u++){var d=c[u];d&&(o+=fUe(mUe(d)),a+=" && "+o)}return a}function rPt(t,e){return t=='""'?e:(t+" + "+e).replace(/([^\\])' \+ '/g,"$1")}function pPn(t){return mUe(decodeURIComponent(t))}function hPn(t){return encodeURIComponent(hUe(t))}function hUe(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}function mUe(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}});var gUe=D((cFo,iPt)=>{"use strict";var mPn=HD();iPt.exports=gPn;function gPn(t){mPn.copy(t,this)}});var sPt=D((uFo,oPt)=>{"use strict";var lS=oPt.exports=function(t,e,r){typeof e=="function"&&(r=e,e={}),r=e.cb||r;var n=typeof r=="function"?r:r.pre||function(){},i=r.post||function(){};G0e(e,n,i,t,"",t)};lS.keywords={additionalItems:!0,items:!0,contains:!0,additionalProperties:!0,propertyNames:!0,not:!0};lS.arrayKeywords={items:!0,allOf:!0,anyOf:!0,oneOf:!0};lS.propsKeywords={definitions:!0,properties:!0,patternProperties:!0,dependencies:!0};lS.skipKeywords={default:!0,enum:!0,const:!0,required:!0,maximum:!0,minimum:!0,exclusiveMaximum:!0,exclusiveMinimum:!0,multipleOf:!0,maxLength:!0,minLength:!0,pattern:!0,format:!0,maxItems:!0,minItems:!0,uniqueItems:!0,maxProperties:!0,minProperties:!0};function G0e(t,e,r,n,i,o,s,a,c,u){if(n&&typeof n=="object"&&!Array.isArray(n)){e(n,i,o,s,a,c,u);for(var d in n){var f=n[d];if(Array.isArray(f)){if(d in lS.arrayKeywords)for(var p=0;p<f.length;p++)G0e(t,e,r,f[p],i+"/"+d+"/"+p,o,i,d,n,p)}else if(d in lS.propsKeywords){if(f&&typeof f=="object")for(var h in f)G0e(t,e,r,f[h],i+"/"+d+"/"+APn(h),o,i,d,n,h)}else(d in lS.keywords||t.allKeys&&!(d in lS.skipKeywords))&&G0e(t,e,r,f,i+"/"+d,o,i,d,n)}r(n,i,o,s,a,c,u)}}function APn(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}});var z0e=D((dFo,uPt)=>{"use strict";var dX=KMt(),aPt=yU(),$0e=HD(),H0e=gUe(),yPn=sPt();uPt.exports=uS;uS.normalizeId=cS;uS.fullPath=V0e;uS.url=W0e;uS.ids=xPn;uS.inlineRef=AUe;uS.schema=j0e;function uS(t,e,r){var n=this._refs[r];if(typeof n=="string")if(this._refs[n])n=this._refs[n];else return uS.call(this,t,e,n);if(n=n||this._schemas[r],n instanceof H0e)return AUe(n.schema,this._opts.inlineRefs)?n.schema:n.validate||this._compile(n);var i=j0e.call(this,e,r),o,s,a;return i&&(o=i.schema,e=i.root,a=i.baseId),o instanceof H0e?s=o.validate||t.call(this,o.schema,e,void 0,a):o!==void 0&&(s=AUe(o,this._opts.inlineRefs)?o:t.call(this,o,e,void 0,a)),s}function j0e(t,e){var r=dX.parse(e),n=cPt(r),i=V0e(this._getId(t.schema));if(Object.keys(t.schema).length===0||n!==i){var o=cS(n),s=this._refs[o];if(typeof s=="string")return EPn.call(this,t,s,r);if(s instanceof H0e)s.validate||this._compile(s),t=s;else if(s=this._schemas[o],s instanceof H0e){if(s.validate||this._compile(s),o==cS(e))return{schema:s,root:t,baseId:i};t=s}else return;if(!t.schema)return;i=V0e(this._getId(t.schema))}return lPt.call(this,r,i,t.schema,t)}function EPn(t,e,r){var n=j0e.call(this,t,e);if(n){var i=n.schema,o=n.baseId;t=n.root;var s=this._getId(i);return s&&(o=W0e(o,s)),lPt.call(this,r,o,i,t)}}var vPn=$0e.toHash(["properties","patternProperties","enum","dependencies","definitions"]);function lPt(t,e,r,n){if(t.fragment=t.fragment||"",t.fragment.slice(0,1)=="/"){for(var i=t.fragment.split("/"),o=1;o<i.length;o++){var s=i[o];if(s){if(s=$0e.unescapeFragment(s),r=r[s],r===void 0)break;var a;if(!vPn[s]&&(a=this._getId(r),a&&(e=W0e(e,a)),r.$ref)){var c=W0e(e,r.$ref),u=j0e.call(this,n,c);u&&(r=u.schema,n=u.root,e=u.baseId)}}}if(r!==void 0&&r!==n.schema)return{schema:r,root:n,baseId:e}}}var CPn=$0e.toHash(["type","format","pattern","maxLength","minLength","maxProperties","minProperties","maxItems","minItems","maximum","minimum","uniqueItems","multipleOf","required","enum"]);function AUe(t,e){if(e===!1)return!1;if(e===void 0||e===!0)return yUe(t);if(e)return EUe(t)<=e}function yUe(t){var e;if(Array.isArray(t)){for(var r=0;r<t.length;r++)if(e=t[r],typeof e=="object"&&!yUe(e))return!1}else for(var n in t)if(n=="$ref"||(e=t[n],typeof e=="object"&&!yUe(e)))return!1;return!0}function EUe(t){var e=0,r;if(Array.isArray(t)){for(var n=0;n<t.length;n++)if(r=t[n],typeof r=="object"&&(e+=EUe(r)),e==1/0)return 1/0}else for(var i in t){if(i=="$ref")return 1/0;if(CPn[i])e++;else if(r=t[i],typeof r=="object"&&(e+=EUe(r)+1),e==1/0)return 1/0}return e}function V0e(t,e){e!==!1&&(t=cS(t));var r=dX.parse(t);return cPt(r)}function cPt(t){return dX.serialize(t).split("#")[0]+"#"}var bPn=/#\/?$/;function cS(t){return t?t.replace(bPn,""):""}function W0e(t,e){return e=cS(e),dX.resolve(t,e)}function xPn(t){var e=cS(this._getId(t)),r={"":e},n={"":V0e(e,!1)},i={},o=this;return yPn(t,{allKeys:!0},function(s,a,c,u,d,f,p){if(a!==""){var h=o._getId(s),m=r[u],g=n[u]+"/"+d;if(p!==void 0&&(g+="/"+(typeof p=="number"?p:$0e.escapeFragment(p))),typeof h=="string"){h=m=cS(m?dX.resolve(m,h):h);var A=o._refs[h];if(typeof A=="string"&&(A=o._refs[A]),A&&A.schema){if(!aPt(s,A.schema))throw new Error('id "'+h+'" resolves to more than one schema')}else if(h!=cS(g))if(h[0]=="#"){if(i[h]&&!aPt(s,i[h]))throw new Error('id "'+h+'" resolves to more than one schema');i[h]=s}else o._refs[h]=g}r[a]=m,n[a]=g}}),i}});var Y0e=D((fFo,fPt)=>{"use strict";var vUe=z0e();fPt.exports={Validation:dPt(SPn),MissingRef:dPt(CUe)};function SPn(t){this.message="validation failed",this.errors=t,this.ajv=this.validation=!0}CUe.message=function(t,e){return"can't resolve reference "+e+" from id "+t};function CUe(t,e,r){this.message=r||CUe.message(t,e),this.missingRef=vUe.url(t,e),this.missingSchema=vUe.normalizeId(vUe.fullPath(this.missingRef))}function dPt(t){return t.prototype=Object.create(Error.prototype),t.prototype.constructor=t,t}});var bUe=D((pFo,pPt)=>{"use strict";pPt.exports=function(t,e){e||(e={}),typeof e=="function"&&(e={cmp:e});var r=typeof e.cycles=="boolean"?e.cycles:!1,n=e.cmp&&(function(o){return function(s){return function(a,c){var u={key:a,value:s[a]},d={key:c,value:s[c]};return o(u,d)}}})(e.cmp),i=[];return(function o(s){if(s&&s.toJSON&&typeof s.toJSON=="function"&&(s=s.toJSON()),s!==void 0){if(typeof s=="number")return isFinite(s)?""+s:"null";if(typeof s!="object")return JSON.stringify(s);var a,c;if(Array.isArray(s)){for(c="[",a=0;a<s.length;a++)a&&(c+=","),c+=o(s[a])||"null";return c+"]"}if(s===null)return"null";if(i.indexOf(s)!==-1){if(r)return JSON.stringify("__cycle__");throw new TypeError("Converting circular structure to JSON")}var u=i.push(s)-1,d=Object.keys(s).sort(n&&n(s));for(c="",a=0;a<d.length;a++){var f=d[a],p=o(s[f]);p&&(c&&(c+=","),c+=JSON.stringify(f)+":"+p)}return i.splice(u,1),"{"+c+"}"}})(t)}});var xUe=D((hFo,hPt)=>{"use strict";hPt.exports=function(e,r,n){var i="",o=e.schema.$async===!0,s=e.util.schemaHasRulesExcept(e.schema,e.RULES.all,"$ref"),a=e.self._getId(e.schema);if(e.opts.strictKeywords){var c=e.util.schemaUnknownRules(e.schema,e.RULES.keywords);if(c){var u="unknown keyword: "+c;if(e.opts.strictKeywords==="log")e.logger.warn(u);else throw new Error(u)}}if(e.isTop&&(i+=" var validate = ",o&&(e.async=!0,i+="async "),i+="function(data, dataPath, parentData, parentDataProperty, rootData) { 'use strict'; ",a&&(e.opts.sourceCode||e.opts.processCode)&&(i+=" "+("/*# sourceURL="+a+" */")+" ")),typeof e.schema=="boolean"||!(s||e.schema.$ref)){var r="false schema",d=e.level,f=e.dataLevel,p=e.schema[r],h=e.schemaPath+e.util.getProperty(r),m=e.errSchemaPath+"/"+r,w=!e.opts.allErrors,U,g="data"+(f||""),x="valid"+d;if(e.schema===!1){e.isTop?w=!0:i+=" var "+x+" = false; ";var A=A||[];A.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(U||"false schema")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(m)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'boolean schema is false' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),i+=" } "):i+=" {} ";var y=i;i=A.pop(),!e.compositeRule&&w?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else e.isTop?o?i+=" return data; ":i+=" validate.errors = null; return true; ":i+=" var "+x+" = true; ";return e.isTop&&(i+=" }; return validate; "),i}if(e.isTop){var E=e.isTop,d=e.level=0,f=e.dataLevel=0,g="data";if(e.rootId=e.resolve.fullPath(e.self._getId(e.root.schema)),e.baseId=e.baseId||e.rootId,delete e.isTop,e.dataPathArr=[""],e.schema.default!==void 0&&e.opts.useDefaults&&e.opts.strictDefaults){var C="default is ignored in the schema root";if(e.opts.strictDefaults==="log")e.logger.warn(C);else throw new Error(C)}i+=" var vErrors = null; ",i+=" var errors = 0; ",i+=" if (rootData === undefined) rootData = data; "}else{var d=e.level,f=e.dataLevel,g="data"+(f||"");if(a&&(e.baseId=e.resolve.url(e.baseId,a)),o&&!e.async)throw new Error("async schema in sync schema");i+=" var errs_"+d+" = errors;"}var x="valid"+d,w=!e.opts.allErrors,O="",N="",U,S=e.schema.type,k=Array.isArray(S);if(S&&e.opts.nullable&&e.schema.nullable===!0&&(k?S.indexOf("null")==-1&&(S=S.concat("null")):S!="null"&&(S=[S,"null"],k=!0)),k&&S.length==1&&(S=S[0],k=!1),e.schema.$ref&&s){if(e.opts.extendRefs=="fail")throw new Error('$ref: validation keywords used in schema at path "'+e.errSchemaPath+'" (see option extendRefs)');e.opts.extendRefs!==!0&&(s=!1,e.logger.warn('$ref: keywords ignored in schema at path "'+e.errSchemaPath+'"'))}if(e.schema.$comment&&e.opts.$comment&&(i+=" "+e.RULES.all.$comment.code(e,"$comment")),S){if(e.opts.coerceTypes)var B=e.util.coerceToTypes(e.opts.coerceTypes,S);var F=e.RULES.types[S];if(B||k||F===!0||F&&!z(F)){var h=e.schemaPath+".type",m=e.errSchemaPath+"/type",h=e.schemaPath+".type",m=e.errSchemaPath+"/type",L=k?"checkDataTypes":"checkDataType";if(i+=" if ("+e.util[L](S,g,e.opts.strictNumbers,!0)+") { ",B){var R="dataType"+d,q="coerced"+d;i+=" var "+R+" = typeof "+g+"; var "+q+" = undefined; ",e.opts.coerceTypes=="array"&&(i+=" if ("+R+" == 'object' && Array.isArray("+g+") && "+g+".length == 1) { "+g+" = "+g+"[0]; "+R+" = typeof "+g+"; if ("+e.util.checkDataType(e.schema.type,g,e.opts.strictNumbers)+") "+q+" = "+g+"; } "),i+=" if ("+q+" !== undefined) ; ";var Q=B;if(Q)for(var V,H=-1,J=Q.length-1;H<J;)V=Q[H+=1],V=="string"?i+=" else if ("+R+" == 'number' || "+R+" == 'boolean') "+q+" = '' + "+g+"; else if ("+g+" === null) "+q+" = ''; ":V=="number"||V=="integer"?(i+=" else if ("+R+" == 'boolean' || "+g+" === null || ("+R+" == 'string' && "+g+" && "+g+" == +"+g+" ",V=="integer"&&(i+=" && !("+g+" % 1)"),i+=")) "+q+" = +"+g+"; "):V=="boolean"?i+=" else if ("+g+" === 'false' || "+g+" === 0 || "+g+" === null) "+q+" = false; else if ("+g+" === 'true' || "+g+" === 1) "+q+" = true; ":V=="null"?i+=" else if ("+g+" === '' || "+g+" === 0 || "+g+" === false) "+q+" = null; ":e.opts.coerceTypes=="array"&&V=="array"&&(i+=" else if ("+R+" == 'string' || "+R+" == 'number' || "+R+" == 'boolean' || "+g+" == null) "+q+" = ["+g+"]; ");i+=" else { ";var A=A||[];A.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(U||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(m)+" , params: { type: '",k?i+=""+S.join(","):i+=""+S,i+="' } ",e.opts.messages!==!1&&(i+=" , message: 'should be ",k?i+=""+S.join(","):i+=""+S,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),i+=" } "):i+=" {} ";var y=i;i=A.pop(),!e.compositeRule&&w?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } if ("+q+" !== undefined) { ";var X=f?"data"+(f-1||""):"parentData",he=f?e.dataPathArr[f]:"parentDataProperty";i+=" "+g+" = "+q+"; ",f||(i+="if ("+X+" !== undefined)"),i+=" "+X+"["+he+"] = "+q+"; } "}else{var A=A||[];A.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(U||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(m)+" , params: { type: '",k?i+=""+S.join(","):i+=""+S,i+="' } ",e.opts.messages!==!1&&(i+=" , message: 'should be ",k?i+=""+S.join(","):i+=""+S,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),i+=" } "):i+=" {} ";var y=i;i=A.pop(),!e.compositeRule&&w?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}i+=" } "}}if(e.schema.$ref&&!s)i+=" "+e.RULES.all.$ref.code(e,"$ref")+" ",w&&(i+=" } if (errors === ",E?i+="0":i+="errs_"+d,i+=") { ",N+="}");else{var Ce=e.RULES;if(Ce){for(var F,ge=-1,be=Ce.length-1;ge<be;)if(F=Ce[ge+=1],z(F)){if(F.type&&(i+=" if ("+e.util.checkDataType(F.type,g,e.opts.strictNumbers)+") { "),e.opts.useDefaults){if(F.type=="object"&&e.schema.properties){var p=e.schema.properties,xe=Object.keys(p),se=xe;if(se)for(var me,ve=-1,ee=se.length-1;ve<ee;){me=se[ve+=1];var ce=p[me];if(ce.default!==void 0){var Y=g+e.util.getProperty(me);if(e.compositeRule){if(e.opts.strictDefaults){var C="default is ignored for: "+Y;if(e.opts.strictDefaults==="log")e.logger.warn(C);else throw new Error(C)}}else i+=" if ("+Y+" === undefined ",e.opts.useDefaults=="empty"&&(i+=" || "+Y+" === null || "+Y+" === '' "),i+=" ) "+Y+" = ",e.opts.useDefaults=="shared"?i+=" "+e.useDefault(ce.default)+" ":i+=" "+JSON.stringify(ce.default)+" ",i+="; "}}}else if(F.type=="array"&&Array.isArray(e.schema.items)){var re=e.schema.items;if(re){for(var ce,H=-1,ue=re.length-1;H<ue;)if(ce=re[H+=1],ce.default!==void 0){var Y=g+"["+H+"]";if(e.compositeRule){if(e.opts.strictDefaults){var C="default is ignored for: "+Y;if(e.opts.strictDefaults==="log")e.logger.warn(C);else throw new Error(C)}}else i+=" if ("+Y+" === undefined ",e.opts.useDefaults=="empty"&&(i+=" || "+Y+" === null || "+Y+" === '' "),i+=" ) "+Y+" = ",e.opts.useDefaults=="shared"?i+=" "+e.useDefault(ce.default)+" ":i+=" "+JSON.stringify(ce.default)+" ",i+="; "}}}}var Z=F.rules;if(Z){for(var $,j=-1,Ee=Z.length-1;j<Ee;)if($=Z[j+=1],Te($)){var de=$.code(e,$.keyword,F.type);de&&(i+=" "+de+" ",w&&(O+="}"))}}if(w&&(i+=" "+O+" ",O=""),F.type&&(i+=" } ",S&&S===F.type&&!B)){i+=" else { ";var h=e.schemaPath+".type",m=e.errSchemaPath+"/type",A=A||[];A.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(U||"type")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(m)+" , params: { type: '",k?i+=""+S.join(","):i+=""+S,i+="' } ",e.opts.messages!==!1&&(i+=" , message: 'should be ",k?i+=""+S.join(","):i+=""+S,i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+h+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+g+" "),i+=" } "):i+=" {} ";var y=i;i=A.pop(),!e.compositeRule&&w?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } "}w&&(i+=" if (errors === ",E?i+="0":i+="errs_"+d,i+=") { ",N+="}")}}}w&&(i+=" "+N+" "),E?(o?(i+=" if (errors === 0) return data; ",i+=" else throw new ValidationError(vErrors); "):(i+=" validate.errors = vErrors; ",i+=" return errors === 0; "),i+=" }; return validate;"):i+=" var "+x+" = errors === errs_"+d+";";function z(Oe){for(var ke=Oe.rules,le=0;le<ke.length;le++)if(Te(ke[le]))return!0}function Te(Oe){return e.schema[Oe.keyword]!==void 0||Oe.implements&&Be(Oe)}function Be(Oe){for(var ke=Oe.implements,le=0;le<ke.length;le++)if(e.schema[ke[le]]!==void 0)return!0}return i}});var EPt=D((mFo,yPt)=>{"use strict";var J0e=z0e(),X0e=HD(),gPt=Y0e(),wPn=bUe(),mPt=xUe(),_Pn=X0e.ucs2length,TPn=yU(),IPn=gPt.Validation;yPt.exports=SUe;function SUe(t,e,r,n){var i=this,o=this._opts,s=[void 0],a={},c=[],u={},d=[],f={},p=[];e=e||{schema:t,refVal:s,refs:a};var h=DPn.call(this,t,e,n),m=this._compilations[h.index];if(h.compiling)return m.callValidate=C;var g=this._formats,A=this.RULES;try{var y=x(t,e,r,n);m.validate=y;var E=m.callValidate;return E&&(E.schema=y.schema,E.errors=null,E.refs=y.refs,E.refVal=y.refVal,E.root=y.root,E.$async=y.$async,o.sourceCode&&(E.source=y.source)),y}finally{RPn.call(this,t,e,n)}function C(){var L=m.validate,R=L.apply(this,arguments);return C.errors=L.errors,R}function x(L,R,q,Q){var V=!R||R&&R.schema==L;if(R.schema!=e.schema)return SUe.call(i,L,R,q,Q);var H=L.$async===!0,J=mPt({isTop:!0,schema:L,isRoot:V,baseId:Q,root:R,schemaPath:"",errSchemaPath:"#",errorPath:'""',MissingRefError:gPt.MissingRef,RULES:A,validate:mPt,util:X0e,resolve:J0e,resolveRef:w,usePattern:k,useDefault:B,useCustomRule:F,opts:o,formats:g,logger:i.logger,self:i});J=K0e(s,OPn)+K0e(c,BPn)+K0e(d,NPn)+K0e(p,kPn)+J,o.processCode&&(J=o.processCode(J,L));var X;try{var he=new Function("self","RULES","formats","root","refVal","defaults","customRules","equal","ucs2length","ValidationError",J);X=he(i,A,g,e,s,d,p,TPn,_Pn,IPn),s[0]=X}catch(Ce){throw i.logger.error("Error compiling schema, function code:",J),Ce}return X.schema=L,X.errors=null,X.refs=a,X.refVal=s,X.root=V?X:R,H&&(X.$async=!0),o.sourceCode===!0&&(X.source={code:J,patterns:c,defaults:d}),X}function w(L,R,q){R=J0e.url(L,R);var Q=a[R],V,H;if(Q!==void 0)return V=s[Q],H="refVal["+Q+"]",S(V,H);if(!q&&e.refs){var J=e.refs[R];if(J!==void 0)return V=e.refVal[J],H=O(R,V),S(V,H)}H=O(R);var X=J0e.call(i,x,e,R);if(X===void 0){var he=r&&r[R];he&&(X=J0e.inlineRef(he,o.inlineRefs)?he:SUe.call(i,he,e,r,L))}if(X===void 0)N(R);else return U(R,X),S(X,H)}function O(L,R){var q=s.length;return s[q]=R,a[L]=q,"refVal"+q}function N(L){delete a[L]}function U(L,R){var q=a[L];s[q]=R}function S(L,R){return typeof L=="object"||typeof L=="boolean"?{code:R,schema:L,inline:!0}:{code:R,$async:L&&!!L.$async}}function k(L){var R=u[L];return R===void 0&&(R=u[L]=c.length,c[R]=L),"pattern"+R}function B(L){switch(typeof L){case"boolean":case"number":return""+L;case"string":return X0e.toQuotedString(L);case"object":if(L===null)return"null";var R=wPn(L),q=f[R];return q===void 0&&(q=f[R]=d.length,d[q]=L),"default"+q}}function F(L,R,q,Q){if(i._opts.validateSchema!==!1){var V=L.definition.dependencies;if(V&&!V.every(function(se){return Object.prototype.hasOwnProperty.call(q,se)}))throw new Error("parent schema must have all required keywords: "+V.join(","));var H=L.definition.validateSchema;if(H){var J=H(R);if(!J){var X="keyword schema is invalid: "+i.errorsText(H.errors);if(i._opts.validateSchema=="log")i.logger.error(X);else throw new Error(X)}}}var he=L.definition.compile,Ce=L.definition.inline,ge=L.definition.macro,be;if(he)be=he.call(i,R,q,Q);else if(ge)be=ge.call(i,R,q,Q),o.validateSchema!==!1&&i.validateSchema(be,!0);else if(Ce)be=Ce.call(i,Q,L.keyword,R,q);else if(be=L.definition.validate,!be)return;if(be===void 0)throw new Error('custom keyword "'+L.keyword+'"failed to compile');var xe=p.length;return p[xe]=be,{code:"customRule"+xe,validate:be}}}function DPn(t,e,r){var n=APt.call(this,t,e,r);return n>=0?{index:n,compiling:!0}:(n=this._compilations.length,this._compilations[n]={schema:t,root:e,baseId:r},{index:n,compiling:!1})}function RPn(t,e,r){var n=APt.call(this,t,e,r);n>=0&&this._compilations.splice(n,1)}function APt(t,e,r){for(var n=0;n<this._compilations.length;n++){var i=this._compilations[n];if(i.schema==t&&i.root==e&&i.baseId==r)return n}return-1}function BPn(t,e){return"var pattern"+t+" = new RegExp("+X0e.toQuotedString(e[t])+");"}function NPn(t){return"var default"+t+" = defaults["+t+"];"}function OPn(t,e){return e[t]===void 0?"":"var refVal"+t+" = refVal["+t+"];"}function kPn(t){return"var customRule"+t+" = customRules["+t+"];"}function K0e(t,e){if(!t.length)return"";for(var r="",n=0;n<t.length;n++)r+=e(n,t);return r}});var CPt=D((gFo,vPt)=>{"use strict";var Z0e=vPt.exports=function(){this._cache={}};Z0e.prototype.put=function(e,r){this._cache[e]=r};Z0e.prototype.get=function(e){return this._cache[e]};Z0e.prototype.del=function(e){delete this._cache[e]};Z0e.prototype.clear=function(){this._cache={}}});var OPt=D((AFo,NPt)=>{"use strict";var MPn=HD(),PPn=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,LPn=[0,31,28,31,30,31,30,31,31,30,31,30,31],FPn=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,bPt=/^(?=.{1,253}\.?$)[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[-0-9a-z]{0,61}[0-9a-z])?)*\.?$/i,UPn=/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'()*+,;=:@]|%[0-9a-f]{2})*)*)(?:\?(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,QPn=/^(?:[a-z][a-z0-9+\-.]*:)?(?:\/?\/(?:(?:[a-z0-9\-._~!$&'()*+,;=:]|%[0-9a-f]{2})*@)?(?:\[(?:(?:(?:(?:[0-9a-f]{1,4}:){6}|::(?:[0-9a-f]{1,4}:){5}|(?:[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){4}|(?:(?:[0-9a-f]{1,4}:){0,1}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){3}|(?:(?:[0-9a-f]{1,4}:){0,2}[0-9a-f]{1,4})?::(?:[0-9a-f]{1,4}:){2}|(?:(?:[0-9a-f]{1,4}:){0,3}[0-9a-f]{1,4})?::[0-9a-f]{1,4}:|(?:(?:[0-9a-f]{1,4}:){0,4}[0-9a-f]{1,4})?::)(?:[0-9a-f]{1,4}:[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?))|(?:(?:[0-9a-f]{1,4}:){0,5}[0-9a-f]{1,4})?::[0-9a-f]{1,4}|(?:(?:[0-9a-f]{1,4}:){0,6}[0-9a-f]{1,4})?::)|[Vv][0-9a-f]+\.[a-z0-9\-._~!$&'()*+,;=:]+)\]|(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)|(?:[a-z0-9\-._~!$&'"()*+,;=]|%[0-9a-f]{2})*)(?::\d*)?(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*|\/(?:(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?|(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})+(?:\/(?:[a-z0-9\-._~!$&'"()*+,;=:@]|%[0-9a-f]{2})*)*)?(?:\?(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?(?:#(?:[a-z0-9\-._~!$&'"()*+,;=:@/?]|%[0-9a-f]{2})*)?$/i,xPt=/^(?:(?:[^\x00-\x20"'<>%\\^`{|}]|%[0-9a-f]{2})|\{[+#./;?&=,!@|]?(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?(?:,(?:[a-z0-9_]|%[0-9a-f]{2})+(?::[1-9][0-9]{0,3}|\*)?)*\})*$/i,SPt=/^(?:(?:http[s\u017F]?|ftp):\/\/)(?:(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+(?::(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?@)?(?:(?!10(?:\.[0-9]{1,3}){3})(?!127(?:\.[0-9]{1,3}){3})(?!169\.254(?:\.[0-9]{1,3}){2})(?!192\.168(?:\.[0-9]{1,3}){2})(?!172\.(?:1[6-9]|2[0-9]|3[01])(?:\.[0-9]{1,3}){2})(?:[1-9][0-9]?|1[0-9][0-9]|2[01][0-9]|22[0-3])(?:\.(?:1?[0-9]{1,2}|2[0-4][0-9]|25[0-5])){2}(?:\.(?:[1-9][0-9]?|1[0-9][0-9]|2[0-4][0-9]|25[0-4]))|(?:(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)(?:\.(?:(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+-)*(?:[0-9a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])+)*(?:\.(?:(?:[a-z\xA1-\uD7FF\uE000-\uFFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF]){2,})))(?::[0-9]{2,5})?(?:\/(?:[\0-\x08\x0E-\x1F!-\x9F\xA1-\u167F\u1681-\u1FFF\u200B-\u2027\u202A-\u202E\u2030-\u205E\u2060-\u2FFF\u3001-\uD7FF\uE000-\uFEFE\uFF00-\uFFFF]|[\uD800-\uDBFF][\uDC00-\uDFFF]|[\uD800-\uDBFF](?![\uDC00-\uDFFF])|(?:[^\uD800-\uDBFF]|^)[\uDC00-\uDFFF])*)?$/i,wPt=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,_Pt=/^(?:\/(?:[^~/]|~0|~1)*)*$/,TPt=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,IPt=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/;NPt.exports=eme;function eme(t){return t=t=="full"?"full":"fast",MPn.copy(eme[t])}eme.fast={date:/^\d\d\d\d-[0-1]\d-[0-3]\d$/,time:/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,"date-time":/^\d\d\d\d-[0-1]\d-[0-3]\d[t\s](?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)$/i,uri:/^(?:[a-z][a-z0-9+\-.]*:)(?:\/?\/)?[^\s]*$/i,"uri-reference":/^(?:(?:[a-z][a-z0-9+\-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,"uri-template":xPt,url:SPt,email:/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*$/i,hostname:bPt,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:BPt,uuid:wPt,"json-pointer":_Pt,"json-pointer-uri-fragment":TPt,"relative-json-pointer":IPt};eme.full={date:DPt,time:RPt,"date-time":HPn,uri:WPn,"uri-reference":QPn,"uri-template":xPt,url:SPt,email:/^[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*@(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/i,hostname:bPt,ipv4:/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,ipv6:/^\s*(?:(?:(?:[0-9a-f]{1,4}:){7}(?:[0-9a-f]{1,4}|:))|(?:(?:[0-9a-f]{1,4}:){6}(?::[0-9a-f]{1,4}|(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){5}(?:(?:(?::[0-9a-f]{1,4}){1,2})|:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3})|:))|(?:(?:[0-9a-f]{1,4}:){4}(?:(?:(?::[0-9a-f]{1,4}){1,3})|(?:(?::[0-9a-f]{1,4})?:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){3}(?:(?:(?::[0-9a-f]{1,4}){1,4})|(?:(?::[0-9a-f]{1,4}){0,2}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){2}(?:(?:(?::[0-9a-f]{1,4}){1,5})|(?:(?::[0-9a-f]{1,4}){0,3}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?:(?:[0-9a-f]{1,4}:){1}(?:(?:(?::[0-9a-f]{1,4}){1,6})|(?:(?::[0-9a-f]{1,4}){0,4}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:))|(?::(?:(?:(?::[0-9a-f]{1,4}){1,7})|(?:(?::[0-9a-f]{1,4}){0,5}:(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]?\d)){3}))|:)))(?:%.+)?\s*$/i,regex:BPt,uuid:wPt,"json-pointer":_Pt,"json-pointer-uri-fragment":TPt,"relative-json-pointer":IPt};function qPn(t){return t%4===0&&(t%100!==0||t%400===0)}function DPt(t){var e=t.match(PPn);if(!e)return!1;var r=+e[1],n=+e[2],i=+e[3];return n>=1&&n<=12&&i>=1&&i<=(n==2&&qPn(r)?29:LPn[n])}function RPt(t,e){var r=t.match(FPn);if(!r)return!1;var n=r[1],i=r[2],o=r[3],s=r[5];return(n<=23&&i<=59&&o<=59||n==23&&i==59&&o==60)&&(!e||s)}var GPn=/t|\s/i;function HPn(t){var e=t.split(GPn);return e.length==2&&DPt(e[0])&&RPt(e[1],!0)}var VPn=/\/|:/;function WPn(t){return VPn.test(t)&&UPn.test(t)}var $Pn=/[^\\]\\Z/;function BPt(t){if($Pn.test(t))return!1;try{return new RegExp(t),!0}catch{return!1}}});var MPt=D((yFo,kPt)=>{"use strict";kPt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.errSchemaPath+"/"+r,u=!e.opts.allErrors,d="data"+(s||""),f="valid"+o,p,h;if(a=="#"||a=="#/")e.isRoot?(p=e.async,h="validate"):(p=e.root.schema.$async===!0,h="root.refVal[0]");else{var m=e.resolveRef(e.baseId,a,e.isRoot);if(m===void 0){var g=e.MissingRefError.message(e.baseId,a);if(e.opts.missingRefs=="fail"){e.logger.error(g);var A=A||[];A.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '$ref' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(c)+" , params: { ref: '"+e.util.escapeQuotes(a)+"' } ",e.opts.messages!==!1&&(i+=" , message: 'can\\'t resolve reference "+e.util.escapeQuotes(a)+"' "),e.opts.verbose&&(i+=" , schema: "+e.util.toQuotedString(a)+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+d+" "),i+=" } "):i+=" {} ";var y=i;i=A.pop(),!e.compositeRule&&u?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u&&(i+=" if (false) { ")}else if(e.opts.missingRefs=="ignore")e.logger.warn(g),u&&(i+=" if (true) { ");else throw new e.MissingRefError(e.baseId,a,g)}else if(m.inline){var E=e.util.copy(e);E.level++;var C="valid"+E.level;E.schema=m.schema,E.schemaPath="",E.errSchemaPath=a;var x=e.validate(E).replace(/validate\.schema/g,m.code);i+=" "+x+" ",u&&(i+=" if ("+C+") { ")}else p=m.$async===!0||e.async&&m.$async!==!1,h=m.code}if(h){var A=A||[];A.push(i),i="",e.opts.passContext?i+=" "+h+".call(this, ":i+=" "+h+"( ",i+=" "+d+", (dataPath || '')",e.errorPath!='""'&&(i+=" + "+e.errorPath);var w=s?"data"+(s-1||""):"parentData",O=s?e.dataPathArr[s]:"parentDataProperty";i+=" , "+w+" , "+O+", rootData) ";var N=i;if(i=A.pop(),p){if(!e.async)throw new Error("async schema referenced by sync schema");u&&(i+=" var "+f+"; "),i+=" try { await "+N+"; ",u&&(i+=" "+f+" = true; "),i+=" } catch (e) { if (!(e instanceof ValidationError)) throw e; if (vErrors === null) vErrors = e.errors; else vErrors = vErrors.concat(e.errors); errors = vErrors.length; ",u&&(i+=" "+f+" = false; "),i+=" } ",u&&(i+=" if ("+f+") { ")}else i+=" if (!"+N+") { if (vErrors === null) vErrors = "+h+".errors; else vErrors = vErrors.concat("+h+".errors); errors = vErrors.length; } ",u&&(i+=" else { ")}return i}});var LPt=D((EFo,PPt)=>{"use strict";PPt.exports=function(e,r,n){var i=" ",o=e.schema[r],s=e.schemaPath+e.util.getProperty(r),a=e.errSchemaPath+"/"+r,c=!e.opts.allErrors,u=e.util.copy(e),d="";u.level++;var f="valid"+u.level,p=u.baseId,h=!0,m=o;if(m)for(var g,A=-1,y=m.length-1;A<y;)g=m[A+=1],(e.opts.strictKeywords?typeof g=="object"&&Object.keys(g).length>0||g===!1:e.util.schemaHasRules(g,e.RULES.all))&&(h=!1,u.schema=g,u.schemaPath=s+"["+A+"]",u.errSchemaPath=a+"/"+A,i+=" "+e.validate(u)+" ",u.baseId=p,c&&(i+=" if ("+f+") { ",d+="}"));return c&&(h?i+=" if (true) { ":i+=" "+d.slice(0,-1)+" "),i}});var UPt=D((vFo,FPt)=>{"use strict";FPt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(s||""),p="valid"+o,h="errs__"+o,m=e.util.copy(e),g="";m.level++;var A="valid"+m.level,y=a.every(function(U){return e.opts.strictKeywords?typeof U=="object"&&Object.keys(U).length>0||U===!1:e.util.schemaHasRules(U,e.RULES.all)});if(y){var E=m.baseId;i+=" var "+h+" = errors; var "+p+" = false; ";var C=e.compositeRule;e.compositeRule=m.compositeRule=!0;var x=a;if(x)for(var w,O=-1,N=x.length-1;O<N;)w=x[O+=1],m.schema=w,m.schemaPath=c+"["+O+"]",m.errSchemaPath=u+"/"+O,i+=" "+e.validate(m)+" ",m.baseId=E,i+=" "+p+" = "+p+" || "+A+"; if (!"+p+") { ",g+="}";e.compositeRule=m.compositeRule=C,i+=" "+g+" if (!"+p+") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'anyOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should match some schema in anyOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else d&&(i+=" if (true) { ");return i}});var qPt=D((CFo,QPt)=>{"use strict";QPt.exports=function(e,r,n){var i=" ",o=e.schema[r],s=e.errSchemaPath+"/"+r,a=!e.opts.allErrors,c=e.util.toQuotedString(o);return e.opts.$comment===!0?i+=" console.log("+c+");":typeof e.opts.$comment=="function"&&(i+=" self._opts.$comment("+c+", "+e.util.toQuotedString(s)+", validate.root.schema);"),i}});var HPt=D((bFo,GPt)=>{"use strict";GPt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(s||""),p="valid"+o,h=e.opts.$data&&a&&a.$data,m;h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a,h||(i+=" var schema"+o+" = validate.schema"+c+";"),i+="var "+p+" = equal("+f+", schema"+o+"); if (!"+p+") { ";var g=g||[];g.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'const' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValue: schema"+o+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be equal to constant' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var A=i;return i=g.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+A+"]); ":i+=" validate.errors = ["+A+"]; return false; ":i+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",d&&(i+=" else { "),i}});var WPt=D((xFo,VPt)=>{"use strict";VPt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(s||""),p="valid"+o,h="errs__"+o,m=e.util.copy(e),g="";m.level++;var A="valid"+m.level,y="i"+o,E=m.dataLevel=e.dataLevel+1,C="data"+E,x=e.baseId,w=e.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:e.util.schemaHasRules(a,e.RULES.all);if(i+="var "+h+" = errors;var "+p+";",w){var O=e.compositeRule;e.compositeRule=m.compositeRule=!0,m.schema=a,m.schemaPath=c,m.errSchemaPath=u,i+=" var "+A+" = false; for (var "+y+" = 0; "+y+" < "+f+".length; "+y+"++) { ",m.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers,!0);var N=f+"["+y+"]";m.dataPathArr[E]=y;var U=e.validate(m);m.baseId=x,e.util.varOccurences(U,C)<2?i+=" "+e.util.varReplace(U,C,N)+" ":i+=" var "+C+" = "+N+"; "+U+" ",i+=" if ("+A+") break; } ",e.compositeRule=m.compositeRule=O,i+=" "+g+" if (!"+A+") {"}else i+=" if ("+f+".length == 0) {";var S=S||[];S.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'contains' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should contain a valid item' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var k=i;return i=S.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+k+"]); ":i+=" validate.errors = ["+k+"]; return false; ":i+=" var err = "+k+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { ",w&&(i+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } "),e.opts.allErrors&&(i+=" } "),i}});var jPt=D((SFo,$Pt)=>{"use strict";$Pt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(s||""),p="errs__"+o,h=e.util.copy(e),m="";h.level++;var g="valid"+h.level,A={},y={},E=e.opts.ownProperties;for(O in a)if(O!="__proto__"){var C=a[O],x=Array.isArray(C)?y:A;x[O]=C}i+="var "+p+" = errors;";var w=e.errorPath;i+="var missing"+o+";";for(var O in y)if(x=y[O],x.length){if(i+=" if ( "+f+e.util.getProperty(O)+" !== undefined ",E&&(i+=" && Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(O)+"') "),d){i+=" && ( ";var N=x;if(N)for(var U,S=-1,k=N.length-1;S<k;){U=N[S+=1],S&&(i+=" || ");var B=e.util.getProperty(U),F=f+B;i+=" ( ( "+F+" === undefined ",E&&(i+=" || ! Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(U)+"') "),i+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?U:B)+") ) "}i+=")) { ";var L="missing"+o,R="' + "+L+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(w,L,!0):w+" + "+L);var q=q||[];q.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(O)+"', missingProperty: '"+R+"', depsCount: "+x.length+", deps: '"+e.util.escapeQuotes(x.length==1?x[0]:x.join(", "))+"' } ",e.opts.messages!==!1&&(i+=" , message: 'should have ",x.length==1?i+="property "+e.util.escapeQuotes(x[0]):i+="properties "+e.util.escapeQuotes(x.join(", ")),i+=" when property "+e.util.escapeQuotes(O)+" is present' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var Q=i;i=q.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+Q+"]); ":i+=" validate.errors = ["+Q+"]; return false; ":i+=" var err = "+Q+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; "}else{i+=" ) { ";var V=x;if(V)for(var U,H=-1,J=V.length-1;H<J;){U=V[H+=1];var B=e.util.getProperty(U),R=e.util.escapeQuotes(U),F=f+B;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(w,U,e.opts.jsonPointers)),i+=" if ( "+F+" === undefined ",E&&(i+=" || ! Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(U)+"') "),i+=") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'dependencies' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { property: '"+e.util.escapeQuotes(O)+"', missingProperty: '"+R+"', depsCount: "+x.length+", deps: '"+e.util.escapeQuotes(x.length==1?x[0]:x.join(", "))+"' } ",e.opts.messages!==!1&&(i+=" , message: 'should have ",x.length==1?i+="property "+e.util.escapeQuotes(x[0]):i+="properties "+e.util.escapeQuotes(x.join(", ")),i+=" when property "+e.util.escapeQuotes(O)+" is present' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}i+=" } ",d&&(m+="}",i+=" else { ")}e.errorPath=w;var X=h.baseId;for(var O in A){var C=A[O];(e.opts.strictKeywords?typeof C=="object"&&Object.keys(C).length>0||C===!1:e.util.schemaHasRules(C,e.RULES.all))&&(i+=" "+g+" = true; if ( "+f+e.util.getProperty(O)+" !== undefined ",E&&(i+=" && Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(O)+"') "),i+=") { ",h.schema=C,h.schemaPath=c+e.util.getProperty(O),h.errSchemaPath=u+"/"+e.util.escapeFragment(O),i+=" "+e.validate(h)+" ",h.baseId=X,i+=" } ",d&&(i+=" if ("+g+") { ",m+="}"))}return d&&(i+=" "+m+" if ("+p+" == errors) {"),i}});var YPt=D((wFo,zPt)=>{"use strict";zPt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(s||""),p="valid"+o,h=e.opts.$data&&a&&a.$data,m;h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a;var g="i"+o,A="schema"+o;h||(i+=" var "+A+" = validate.schema"+c+";"),i+="var "+p+";",h&&(i+=" if (schema"+o+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+o+")) "+p+" = false; else {"),i+=""+p+" = false;for (var "+g+"=0; "+g+"<"+A+".length; "+g+"++) if (equal("+f+", "+A+"["+g+"])) { "+p+" = true; break; }",h&&(i+=" } "),i+=" if (!"+p+") { ";var y=y||[];y.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'enum' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { allowedValues: schema"+o+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be equal to one of the allowed values' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var E=i;return i=y.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+E+"]); ":i+=" validate.errors = ["+E+"]; return false; ":i+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" }",d&&(i+=" else { "),i}});var KPt=D((_Fo,JPt)=>{"use strict";JPt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(s||"");if(e.opts.format===!1)return d&&(i+=" if (true) { "),i;var p=e.opts.$data&&a&&a.$data,h;p?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",h="schema"+o):h=a;var m=e.opts.unknownFormats,g=Array.isArray(m);if(p){var A="format"+o,y="isObject"+o,E="formatType"+o;i+=" var "+A+" = formats["+h+"]; var "+y+" = typeof "+A+" == 'object' && !("+A+" instanceof RegExp) && "+A+".validate; var "+E+" = "+y+" && "+A+".type || 'string'; if ("+y+") { ",e.async&&(i+=" var async"+o+" = "+A+".async; "),i+=" "+A+" = "+A+".validate; } if ( ",p&&(i+=" ("+h+" !== undefined && typeof "+h+" != 'string') || "),i+=" (",m!="ignore"&&(i+=" ("+h+" && !"+A+" ",g&&(i+=" && self._opts.unknownFormats.indexOf("+h+") == -1 "),i+=") || "),i+=" ("+A+" && "+E+" == '"+n+"' && !(typeof "+A+" == 'function' ? ",e.async?i+=" (async"+o+" ? await "+A+"("+f+") : "+A+"("+f+")) ":i+=" "+A+"("+f+") ",i+=" : "+A+".test("+f+"))))) {"}else{var A=e.formats[a];if(!A){if(m=="ignore")return e.logger.warn('unknown format "'+a+'" ignored in schema at path "'+e.errSchemaPath+'"'),d&&(i+=" if (true) { "),i;if(g&&m.indexOf(a)>=0)return d&&(i+=" if (true) { "),i;throw new Error('unknown format "'+a+'" is used in schema at path "'+e.errSchemaPath+'"')}var y=typeof A=="object"&&!(A instanceof RegExp)&&A.validate,E=y&&A.type||"string";if(y){var C=A.async===!0;A=A.validate}if(E!=n)return d&&(i+=" if (true) { "),i;if(C){if(!e.async)throw new Error("async format in sync schema");var x="formats"+e.util.getProperty(a)+".validate";i+=" if (!(await "+x+"("+f+"))) { "}else{i+=" if (! ";var x="formats"+e.util.getProperty(a);y&&(x+=".validate"),typeof A=="function"?i+=" "+x+"("+f+") ":i+=" "+x+".test("+f+") ",i+=") { "}}var w=w||[];w.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'format' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { format: ",p?i+=""+h:i+=""+e.util.toQuotedString(a),i+=" } ",e.opts.messages!==!1&&(i+=` , message: 'should match format "`,p?i+="' + "+h+" + '":i+=""+e.util.escapeQuotes(a),i+=`"' `),e.opts.verbose&&(i+=" , schema: ",p?i+="validate.schema"+c:i+=""+e.util.toQuotedString(a),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var O=i;return i=w.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+O+"]); ":i+=" validate.errors = ["+O+"]; return false; ":i+=" var err = "+O+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",d&&(i+=" else { "),i}});var ZPt=D((TFo,XPt)=>{"use strict";XPt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(s||""),p="valid"+o,h="errs__"+o,m=e.util.copy(e);m.level++;var g="valid"+m.level,A=e.schema.then,y=e.schema.else,E=A!==void 0&&(e.opts.strictKeywords?typeof A=="object"&&Object.keys(A).length>0||A===!1:e.util.schemaHasRules(A,e.RULES.all)),C=y!==void 0&&(e.opts.strictKeywords?typeof y=="object"&&Object.keys(y).length>0||y===!1:e.util.schemaHasRules(y,e.RULES.all)),x=m.baseId;if(E||C){var w;m.createErrors=!1,m.schema=a,m.schemaPath=c,m.errSchemaPath=u,i+=" var "+h+" = errors; var "+p+" = true; ";var O=e.compositeRule;e.compositeRule=m.compositeRule=!0,i+=" "+e.validate(m)+" ",m.baseId=x,m.createErrors=!0,i+=" errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; } ",e.compositeRule=m.compositeRule=O,E?(i+=" if ("+g+") { ",m.schema=e.schema.then,m.schemaPath=e.schemaPath+".then",m.errSchemaPath=e.errSchemaPath+"/then",i+=" "+e.validate(m)+" ",m.baseId=x,i+=" "+p+" = "+g+"; ",E&&C?(w="ifClause"+o,i+=" var "+w+" = 'then'; "):w="'then'",i+=" } ",C&&(i+=" else { ")):i+=" if (!"+g+") { ",C&&(m.schema=e.schema.else,m.schemaPath=e.schemaPath+".else",m.errSchemaPath=e.errSchemaPath+"/else",i+=" "+e.validate(m)+" ",m.baseId=x,i+=" "+p+" = "+g+"; ",E&&C?(w="ifClause"+o,i+=" var "+w+" = 'else'; "):w="'else'",i+=" } "),i+=" if (!"+p+") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'if' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { failingKeyword: "+w+" } ",e.opts.messages!==!1&&(i+=` , message: 'should match "' + `+w+` + '" schema' `),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+=" } ",d&&(i+=" else { ")}else d&&(i+=" if (true) { ");return i}});var tLt=D((IFo,eLt)=>{"use strict";eLt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(s||""),p="valid"+o,h="errs__"+o,m=e.util.copy(e),g="";m.level++;var A="valid"+m.level,y="i"+o,E=m.dataLevel=e.dataLevel+1,C="data"+E,x=e.baseId;if(i+="var "+h+" = errors;var "+p+";",Array.isArray(a)){var w=e.schema.additionalItems;if(w===!1){i+=" "+p+" = "+f+".length <= "+a.length+"; ";var O=u;u=e.errSchemaPath+"/additionalItems",i+=" if (!"+p+") { ";var N=N||[];N.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'additionalItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+a.length+" } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have more than "+a.length+" items' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var U=i;i=N.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+U+"]); ":i+=" validate.errors = ["+U+"]; return false; ":i+=" var err = "+U+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",u=O,d&&(g+="}",i+=" else { ")}var S=a;if(S){for(var k,B=-1,F=S.length-1;B<F;)if(k=S[B+=1],e.opts.strictKeywords?typeof k=="object"&&Object.keys(k).length>0||k===!1:e.util.schemaHasRules(k,e.RULES.all)){i+=" "+A+" = true; if ("+f+".length > "+B+") { ";var L=f+"["+B+"]";m.schema=k,m.schemaPath=c+"["+B+"]",m.errSchemaPath=u+"/"+B,m.errorPath=e.util.getPathExpr(e.errorPath,B,e.opts.jsonPointers,!0),m.dataPathArr[E]=B;var R=e.validate(m);m.baseId=x,e.util.varOccurences(R,C)<2?i+=" "+e.util.varReplace(R,C,L)+" ":i+=" var "+C+" = "+L+"; "+R+" ",i+=" } ",d&&(i+=" if ("+A+") { ",g+="}")}}if(typeof w=="object"&&(e.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:e.util.schemaHasRules(w,e.RULES.all))){m.schema=w,m.schemaPath=e.schemaPath+".additionalItems",m.errSchemaPath=e.errSchemaPath+"/additionalItems",i+=" "+A+" = true; if ("+f+".length > "+a.length+") { for (var "+y+" = "+a.length+"; "+y+" < "+f+".length; "+y+"++) { ",m.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers,!0);var L=f+"["+y+"]";m.dataPathArr[E]=y;var R=e.validate(m);m.baseId=x,e.util.varOccurences(R,C)<2?i+=" "+e.util.varReplace(R,C,L)+" ":i+=" var "+C+" = "+L+"; "+R+" ",d&&(i+=" if (!"+A+") break; "),i+=" } } ",d&&(i+=" if ("+A+") { ",g+="}")}}else if(e.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:e.util.schemaHasRules(a,e.RULES.all)){m.schema=a,m.schemaPath=c,m.errSchemaPath=u,i+=" for (var "+y+" = 0; "+y+" < "+f+".length; "+y+"++) { ",m.errorPath=e.util.getPathExpr(e.errorPath,y,e.opts.jsonPointers,!0);var L=f+"["+y+"]";m.dataPathArr[E]=y;var R=e.validate(m);m.baseId=x,e.util.varOccurences(R,C)<2?i+=" "+e.util.varReplace(R,C,L)+" ":i+=" var "+C+" = "+L+"; "+R+" ",d&&(i+=" if (!"+A+") break; "),i+=" }"}return d&&(i+=" "+g+" if ("+h+" == errors) {"),i}});var wUe=D((DFo,rLt)=>{"use strict";rLt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,x,f="data"+(s||""),p=e.opts.$data&&a&&a.$data,h;p?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",h="schema"+o):h=a;var m=r=="maximum",g=m?"exclusiveMaximum":"exclusiveMinimum",A=e.schema[g],y=e.opts.$data&&A&&A.$data,E=m?"<":">",C=m?">":"<",x=void 0;if(!(p||typeof a=="number"||a===void 0))throw new Error(r+" must be number");if(!(y||A===void 0||typeof A=="number"||typeof A=="boolean"))throw new Error(g+" must be number or boolean");if(y){var w=e.util.getData(A.$data,s,e.dataPathArr),O="exclusive"+o,N="exclType"+o,U="exclIsNumber"+o,S="op"+o,k="' + "+S+" + '";i+=" var schemaExcl"+o+" = "+w+"; ",w="schemaExcl"+o,i+=" var "+O+"; var "+N+" = typeof "+w+"; if ("+N+" != 'boolean' && "+N+" != 'undefined' && "+N+" != 'number') { ";var x=g,B=B||[];B.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(x||"_exclusiveLimit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: '"+g+" should be boolean' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var F=i;i=B.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+F+"]); ":i+=" validate.errors = ["+F+"]; return false; ":i+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else if ( ",p&&(i+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),i+=" "+N+" == 'number' ? ( ("+O+" = "+h+" === undefined || "+w+" "+E+"= "+h+") ? "+f+" "+C+"= "+w+" : "+f+" "+C+" "+h+" ) : ( ("+O+" = "+w+" === true) ? "+f+" "+C+"= "+h+" : "+f+" "+C+" "+h+" ) || "+f+" !== "+f+") { var op"+o+" = "+O+" ? '"+E+"' : '"+E+"='; ",a===void 0&&(x=g,u=e.errSchemaPath+"/"+g,h=w,p=y)}else{var U=typeof A=="number",k=E;if(U&&p){var S="'"+k+"'";i+=" if ( ",p&&(i+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),i+=" ( "+h+" === undefined || "+A+" "+E+"= "+h+" ? "+f+" "+C+"= "+A+" : "+f+" "+C+" "+h+" ) || "+f+" !== "+f+") { "}else{U&&a===void 0?(O=!0,x=g,u=e.errSchemaPath+"/"+g,h=A,C+="="):(U&&(h=Math[m?"min":"max"](A,a)),A===(U?h:!0)?(O=!0,x=g,u=e.errSchemaPath+"/"+g,C+="="):(O=!1,k+="="));var S="'"+k+"'";i+=" if ( ",p&&(i+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),i+=" "+f+" "+C+" "+h+" || "+f+" !== "+f+") { "}}x=x||r;var B=B||[];B.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(x||"_limit")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { comparison: "+S+", limit: "+h+", exclusive: "+O+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be "+k+" ",p?i+="' + "+h:i+=""+h+"'"),e.opts.verbose&&(i+=" , schema: ",p?i+="validate.schema"+c:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var F=i;return i=B.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+F+"]); ":i+=" validate.errors = ["+F+"]; return false; ":i+=" var err = "+F+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",d&&(i+=" else { "),i}});var _Ue=D((RFo,nLt)=>{"use strict";nLt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,g,f="data"+(s||""),p=e.opts.$data&&a&&a.$data,h;if(p?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",h="schema"+o):h=a,!(p||typeof a=="number"))throw new Error(r+" must be number");var m=r=="maxItems"?">":"<";i+="if ( ",p&&(i+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),i+=" "+f+".length "+m+" "+h+") { ";var g=r,A=A||[];A.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(g||"_limitItems")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+h+" } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have ",r=="maxItems"?i+="more":i+="fewer",i+=" than ",p?i+="' + "+h+" + '":i+=""+a,i+=" items' "),e.opts.verbose&&(i+=" , schema: ",p?i+="validate.schema"+c:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var y=i;return i=A.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",d&&(i+=" else { "),i}});var TUe=D((BFo,iLt)=>{"use strict";iLt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,g,f="data"+(s||""),p=e.opts.$data&&a&&a.$data,h;if(p?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",h="schema"+o):h=a,!(p||typeof a=="number"))throw new Error(r+" must be number");var m=r=="maxLength"?">":"<";i+="if ( ",p&&(i+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),e.opts.unicode===!1?i+=" "+f+".length ":i+=" ucs2length("+f+") ",i+=" "+m+" "+h+") { ";var g=r,A=A||[];A.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(g||"_limitLength")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+h+" } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT be ",r=="maxLength"?i+="longer":i+="shorter",i+=" than ",p?i+="' + "+h+" + '":i+=""+a,i+=" characters' "),e.opts.verbose&&(i+=" , schema: ",p?i+="validate.schema"+c:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var y=i;return i=A.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",d&&(i+=" else { "),i}});var IUe=D((NFo,oLt)=>{"use strict";oLt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,g,f="data"+(s||""),p=e.opts.$data&&a&&a.$data,h;if(p?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",h="schema"+o):h=a,!(p||typeof a=="number"))throw new Error(r+" must be number");var m=r=="maxProperties"?">":"<";i+="if ( ",p&&(i+=" ("+h+" !== undefined && typeof "+h+" != 'number') || "),i+=" Object.keys("+f+").length "+m+" "+h+") { ";var g=r,A=A||[];A.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(g||"_limitProperties")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { limit: "+h+" } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have ",r=="maxProperties"?i+="more":i+="fewer",i+=" than ",p?i+="' + "+h+" + '":i+=""+a,i+=" properties' "),e.opts.verbose&&(i+=" , schema: ",p?i+="validate.schema"+c:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var y=i;return i=A.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+y+"]); ":i+=" validate.errors = ["+y+"]; return false; ":i+=" var err = "+y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",d&&(i+=" else { "),i}});var aLt=D((OFo,sLt)=>{"use strict";sLt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(s||""),p=e.opts.$data&&a&&a.$data,h;if(p?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",h="schema"+o):h=a,!(p||typeof a=="number"))throw new Error(r+" must be number");i+="var division"+o+";if (",p&&(i+=" "+h+" !== undefined && ( typeof "+h+" != 'number' || "),i+=" (division"+o+" = "+f+" / "+h+", ",e.opts.multipleOfPrecision?i+=" Math.abs(Math.round(division"+o+") - division"+o+") > 1e-"+e.opts.multipleOfPrecision+" ":i+=" division"+o+" !== parseInt(division"+o+") ",i+=" ) ",p&&(i+=" ) "),i+=" ) { ";var m=m||[];m.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'multipleOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { multipleOf: "+h+" } ",e.opts.messages!==!1&&(i+=" , message: 'should be multiple of ",p?i+="' + "+h:i+=""+h+"'"),e.opts.verbose&&(i+=" , schema: ",p?i+="validate.schema"+c:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var g=i;return i=m.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+g+"]); ":i+=" validate.errors = ["+g+"]; return false; ":i+=" var err = "+g+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",d&&(i+=" else { "),i}});var cLt=D((kFo,lLt)=>{"use strict";lLt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(s||""),p="errs__"+o,h=e.util.copy(e);h.level++;var m="valid"+h.level;if(e.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:e.util.schemaHasRules(a,e.RULES.all)){h.schema=a,h.schemaPath=c,h.errSchemaPath=u,i+=" var "+p+" = errors; ";var g=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.createErrors=!1;var A;h.opts.allErrors&&(A=h.opts.allErrors,h.opts.allErrors=!1),i+=" "+e.validate(h)+" ",h.createErrors=!0,A&&(h.opts.allErrors=A),e.compositeRule=h.compositeRule=g,i+=" if ("+m+") { ";var y=y||[];y.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var E=i;i=y.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+E+"]); ":i+=" validate.errors = ["+E+"]; return false; ":i+=" var err = "+E+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { errors = "+p+"; if (vErrors !== null) { if ("+p+") vErrors.length = "+p+"; else vErrors = null; } ",e.opts.allErrors&&(i+=" } ")}else i+=" var err = ",e.createErrors!==!1?(i+=" { keyword: 'not' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: {} ",e.opts.messages!==!1&&(i+=" , message: 'should NOT be valid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",d&&(i+=" if (false) { ");return i}});var dLt=D((MFo,uLt)=>{"use strict";uLt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(s||""),p="valid"+o,h="errs__"+o,m=e.util.copy(e),g="";m.level++;var A="valid"+m.level,y=m.baseId,E="prevValid"+o,C="passingSchemas"+o;i+="var "+h+" = errors , "+E+" = false , "+p+" = false , "+C+" = null; ";var x=e.compositeRule;e.compositeRule=m.compositeRule=!0;var w=a;if(w)for(var O,N=-1,U=w.length-1;N<U;)O=w[N+=1],(e.opts.strictKeywords?typeof O=="object"&&Object.keys(O).length>0||O===!1:e.util.schemaHasRules(O,e.RULES.all))?(m.schema=O,m.schemaPath=c+"["+N+"]",m.errSchemaPath=u+"/"+N,i+=" "+e.validate(m)+" ",m.baseId=y):i+=" var "+A+" = true; ",N&&(i+=" if ("+A+" && "+E+") { "+p+" = false; "+C+" = ["+C+", "+N+"]; } else { ",g+="}"),i+=" if ("+A+") { "+p+" = "+E+" = true; "+C+" = "+N+"; }";return e.compositeRule=m.compositeRule=x,i+=""+g+"if (!"+p+") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'oneOf' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { passingSchemas: "+C+" } ",e.opts.messages!==!1&&(i+=" , message: 'should match exactly one schema in oneOf' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),i+="} else { errors = "+h+"; if (vErrors !== null) { if ("+h+") vErrors.length = "+h+"; else vErrors = null; }",e.opts.allErrors&&(i+=" } "),i}});var pLt=D((PFo,fLt)=>{"use strict";fLt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(s||""),p=e.opts.$data&&a&&a.$data,h;p?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",h="schema"+o):h=a;var m=p?"(new RegExp("+h+"))":e.usePattern(a);i+="if ( ",p&&(i+=" ("+h+" !== undefined && typeof "+h+" != 'string') || "),i+=" !"+m+".test("+f+") ) { ";var g=g||[];g.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'pattern' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { pattern: ",p?i+=""+h:i+=""+e.util.toQuotedString(a),i+=" } ",e.opts.messages!==!1&&(i+=` , message: 'should match pattern "`,p?i+="' + "+h+" + '":i+=""+e.util.escapeQuotes(a),i+=`"' `),e.opts.verbose&&(i+=" , schema: ",p?i+="validate.schema"+c:i+=""+e.util.toQuotedString(a),i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var A=i;return i=g.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+A+"]); ":i+=" validate.errors = ["+A+"]; return false; ":i+=" var err = "+A+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+="} ",d&&(i+=" else { "),i}});var mLt=D((LFo,hLt)=>{"use strict";hLt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(s||""),p="errs__"+o,h=e.util.copy(e),m="";h.level++;var g="valid"+h.level,A="key"+o,y="idx"+o,E=h.dataLevel=e.dataLevel+1,C="data"+E,x="dataProperties"+o,w=Object.keys(a||{}).filter(H),O=e.schema.patternProperties||{},N=Object.keys(O).filter(H),U=e.schema.additionalProperties,S=w.length||N.length,k=U===!1,B=typeof U=="object"&&Object.keys(U).length,F=e.opts.removeAdditional,L=k||B||F,R=e.opts.ownProperties,q=e.baseId,Q=e.schema.required;if(Q&&!(e.opts.$data&&Q.$data)&&Q.length<e.opts.loopRequired)var V=e.util.toHash(Q);function H(Re){return Re!=="__proto__"}if(i+="var "+p+" = errors;var "+g+" = true;",R&&(i+=" var "+x+" = undefined;"),L){if(R?i+=" "+x+" = "+x+" || Object.keys("+f+"); for (var "+y+"=0; "+y+"<"+x+".length; "+y+"++) { var "+A+" = "+x+"["+y+"]; ":i+=" for (var "+A+" in "+f+") { ",S){if(i+=" var isAdditional"+o+" = !(false ",w.length)if(w.length>8)i+=" || validate.schema"+c+".hasOwnProperty("+A+") ";else{var J=w;if(J)for(var X,he=-1,Ce=J.length-1;he<Ce;)X=J[he+=1],i+=" || "+A+" == "+e.util.toQuotedString(X)+" "}if(N.length){var ge=N;if(ge)for(var be,xe=-1,se=ge.length-1;xe<se;)be=ge[xe+=1],i+=" || "+e.usePattern(be)+".test("+A+") "}i+=" ); if (isAdditional"+o+") { "}if(F=="all")i+=" delete "+f+"["+A+"]; ";else{var me=e.errorPath,ve="' + "+A+" + '";if(e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(e.errorPath,A,e.opts.jsonPointers)),k)if(F)i+=" delete "+f+"["+A+"]; ";else{i+=" "+g+" = false; ";var ee=u;u=e.errSchemaPath+"/additionalProperties";var ce=ce||[];ce.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'additionalProperties' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { additionalProperty: '"+ve+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is an invalid additional property":i+="should NOT have additional properties",i+="' "),e.opts.verbose&&(i+=" , schema: false , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var Y=i;i=ce.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+Y+"]); ":i+=" validate.errors = ["+Y+"]; return false; ":i+=" var err = "+Y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=ee,d&&(i+=" break; ")}else if(B)if(F=="failing"){i+=" var "+p+" = errors; ";var re=e.compositeRule;e.compositeRule=h.compositeRule=!0,h.schema=U,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,A,e.opts.jsonPointers);var ue=f+"["+A+"]";h.dataPathArr[E]=A;var Z=e.validate(h);h.baseId=q,e.util.varOccurences(Z,C)<2?i+=" "+e.util.varReplace(Z,C,ue)+" ":i+=" var "+C+" = "+ue+"; "+Z+" ",i+=" if (!"+g+") { errors = "+p+"; if (validate.errors !== null) { if (errors) validate.errors.length = errors; else validate.errors = null; } delete "+f+"["+A+"]; } ",e.compositeRule=h.compositeRule=re}else{h.schema=U,h.schemaPath=e.schemaPath+".additionalProperties",h.errSchemaPath=e.errSchemaPath+"/additionalProperties",h.errorPath=e.opts._errorDataPathProperty?e.errorPath:e.util.getPathExpr(e.errorPath,A,e.opts.jsonPointers);var ue=f+"["+A+"]";h.dataPathArr[E]=A;var Z=e.validate(h);h.baseId=q,e.util.varOccurences(Z,C)<2?i+=" "+e.util.varReplace(Z,C,ue)+" ":i+=" var "+C+" = "+ue+"; "+Z+" ",d&&(i+=" if (!"+g+") break; ")}e.errorPath=me}S&&(i+=" } "),i+=" } ",d&&(i+=" if ("+g+") { ",m+="}")}var $=e.opts.useDefaults&&!e.compositeRule;if(w.length){var j=w;if(j)for(var X,Ee=-1,de=j.length-1;Ee<de;){X=j[Ee+=1];var z=a[X];if(e.opts.strictKeywords?typeof z=="object"&&Object.keys(z).length>0||z===!1:e.util.schemaHasRules(z,e.RULES.all)){var Te=e.util.getProperty(X),ue=f+Te,Be=$&&z.default!==void 0;h.schema=z,h.schemaPath=c+Te,h.errSchemaPath=u+"/"+e.util.escapeFragment(X),h.errorPath=e.util.getPath(e.errorPath,X,e.opts.jsonPointers),h.dataPathArr[E]=e.util.toQuotedString(X);var Z=e.validate(h);if(h.baseId=q,e.util.varOccurences(Z,C)<2){Z=e.util.varReplace(Z,C,ue);var Oe=ue}else{var Oe=C;i+=" var "+C+" = "+ue+"; "}if(Be)i+=" "+Z+" ";else{if(V&&V[X]){i+=" if ( "+Oe+" === undefined ",R&&(i+=" || ! Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(X)+"') "),i+=") { "+g+" = false; ";var me=e.errorPath,ee=u,ke=e.util.escapeQuotes(X);e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(me,X,e.opts.jsonPointers)),u=e.errSchemaPath+"/required";var ce=ce||[];ce.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+ke+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+ke+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var Y=i;i=ce.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+Y+"]); ":i+=" validate.errors = ["+Y+"]; return false; ":i+=" var err = "+Y+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",u=ee,e.errorPath=me,i+=" } else { "}else d?(i+=" if ( "+Oe+" === undefined ",R&&(i+=" || ! Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(X)+"') "),i+=") { "+g+" = true; } else { "):(i+=" if ("+Oe+" !== undefined ",R&&(i+=" && Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(X)+"') "),i+=" ) { ");i+=" "+Z+" } "}}d&&(i+=" if ("+g+") { ",m+="}")}}if(N.length){var le=N;if(le)for(var be,Ie=-1,De=le.length-1;Ie<De;){be=le[Ie+=1];var z=O[be];if(e.opts.strictKeywords?typeof z=="object"&&Object.keys(z).length>0||z===!1:e.util.schemaHasRules(z,e.RULES.all)){h.schema=z,h.schemaPath=e.schemaPath+".patternProperties"+e.util.getProperty(be),h.errSchemaPath=e.errSchemaPath+"/patternProperties/"+e.util.escapeFragment(be),R?i+=" "+x+" = "+x+" || Object.keys("+f+"); for (var "+y+"=0; "+y+"<"+x+".length; "+y+"++) { var "+A+" = "+x+"["+y+"]; ":i+=" for (var "+A+" in "+f+") { ",i+=" if ("+e.usePattern(be)+".test("+A+")) { ",h.errorPath=e.util.getPathExpr(e.errorPath,A,e.opts.jsonPointers);var ue=f+"["+A+"]";h.dataPathArr[E]=A;var Z=e.validate(h);h.baseId=q,e.util.varOccurences(Z,C)<2?i+=" "+e.util.varReplace(Z,C,ue)+" ":i+=" var "+C+" = "+ue+"; "+Z+" ",d&&(i+=" if (!"+g+") break; "),i+=" } ",d&&(i+=" else "+g+" = true; "),i+=" } ",d&&(i+=" if ("+g+") { ",m+="}")}}}return d&&(i+=" "+m+" if ("+p+" == errors) {"),i}});var ALt=D((FFo,gLt)=>{"use strict";gLt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(s||""),p="errs__"+o,h=e.util.copy(e),m="";h.level++;var g="valid"+h.level;if(i+="var "+p+" = errors;",e.opts.strictKeywords?typeof a=="object"&&Object.keys(a).length>0||a===!1:e.util.schemaHasRules(a,e.RULES.all)){h.schema=a,h.schemaPath=c,h.errSchemaPath=u;var A="key"+o,y="idx"+o,E="i"+o,C="' + "+A+" + '",x=h.dataLevel=e.dataLevel+1,w="data"+x,O="dataProperties"+o,N=e.opts.ownProperties,U=e.baseId;N&&(i+=" var "+O+" = undefined; "),N?i+=" "+O+" = "+O+" || Object.keys("+f+"); for (var "+y+"=0; "+y+"<"+O+".length; "+y+"++) { var "+A+" = "+O+"["+y+"]; ":i+=" for (var "+A+" in "+f+") { ",i+=" var startErrs"+o+" = errors; ";var S=A,k=e.compositeRule;e.compositeRule=h.compositeRule=!0;var B=e.validate(h);h.baseId=U,e.util.varOccurences(B,w)<2?i+=" "+e.util.varReplace(B,w,S)+" ":i+=" var "+w+" = "+S+"; "+B+" ",e.compositeRule=h.compositeRule=k,i+=" if (!"+g+") { for (var "+E+"=startErrs"+o+"; "+E+"<errors; "+E+"++) { vErrors["+E+"].propertyName = "+A+"; } var err = ",e.createErrors!==!1?(i+=" { keyword: 'propertyNames' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { propertyName: '"+C+"' } ",e.opts.messages!==!1&&(i+=" , message: 'property name \\'"+C+"\\' is invalid' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; "),d&&(i+=" break; "),i+=" } }"}return d&&(i+=" "+m+" if ("+p+" == errors) {"),i}});var ELt=D((UFo,yLt)=>{"use strict";yLt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(s||""),p="valid"+o,h=e.opts.$data&&a&&a.$data,m;h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a;var g="schema"+o;if(!h)if(a.length<e.opts.loopRequired&&e.schema.properties&&Object.keys(e.schema.properties).length){var A=[],y=a;if(y)for(var E,C=-1,x=y.length-1;C<x;){E=y[C+=1];var w=e.schema.properties[E];w&&(e.opts.strictKeywords?typeof w=="object"&&Object.keys(w).length>0||w===!1:e.util.schemaHasRules(w,e.RULES.all))||(A[A.length]=E)}}else var A=a;if(h||A.length){var O=e.errorPath,N=h||A.length>=e.opts.loopRequired,U=e.opts.ownProperties;if(d)if(i+=" var missing"+o+"; ",N){h||(i+=" var "+g+" = validate.schema"+c+"; ");var S="i"+o,k="schema"+o+"["+S+"]",B="' + "+k+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(O,k,e.opts.jsonPointers)),i+=" var "+p+" = true; ",h&&(i+=" if (schema"+o+" === undefined) "+p+" = true; else if (!Array.isArray(schema"+o+")) "+p+" = false; else {"),i+=" for (var "+S+" = 0; "+S+" < "+g+".length; "+S+"++) { "+p+" = "+f+"["+g+"["+S+"]] !== undefined ",U&&(i+=" && Object.prototype.hasOwnProperty.call("+f+", "+g+"["+S+"]) "),i+="; if (!"+p+") break; } ",h&&(i+=" } "),i+=" if (!"+p+") { ";var F=F||[];F.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+B+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+B+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var L=i;i=F.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+L+"]); ":i+=" validate.errors = ["+L+"]; return false; ":i+=" var err = "+L+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else{i+=" if ( ";var R=A;if(R)for(var q,S=-1,Q=R.length-1;S<Q;){q=R[S+=1],S&&(i+=" || ");var V=e.util.getProperty(q),H=f+V;i+=" ( ( "+H+" === undefined ",U&&(i+=" || ! Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(q)+"') "),i+=") && (missing"+o+" = "+e.util.toQuotedString(e.opts.jsonPointers?q:V)+") ) "}i+=") { ";var k="missing"+o,B="' + "+k+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.opts.jsonPointers?e.util.getPathExpr(O,k,!0):O+" + "+k);var F=F||[];F.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+B+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+B+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var L=i;i=F.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+L+"]); ":i+=" validate.errors = ["+L+"]; return false; ":i+=" var err = "+L+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } else { "}else if(N){h||(i+=" var "+g+" = validate.schema"+c+"; ");var S="i"+o,k="schema"+o+"["+S+"]",B="' + "+k+" + '";e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPathExpr(O,k,e.opts.jsonPointers)),h&&(i+=" if ("+g+" && !Array.isArray("+g+")) { var err = ",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+B+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+B+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } else if ("+g+" !== undefined) { "),i+=" for (var "+S+" = 0; "+S+" < "+g+".length; "+S+"++) { if ("+f+"["+g+"["+S+"]] === undefined ",U&&(i+=" || ! Object.prototype.hasOwnProperty.call("+f+", "+g+"["+S+"]) "),i+=") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+B+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+B+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } } ",h&&(i+=" } ")}else{var J=A;if(J)for(var q,X=-1,he=J.length-1;X<he;){q=J[X+=1];var V=e.util.getProperty(q),B=e.util.escapeQuotes(q),H=f+V;e.opts._errorDataPathProperty&&(e.errorPath=e.util.getPath(O,q,e.opts.jsonPointers)),i+=" if ( "+H+" === undefined ",U&&(i+=" || ! Object.prototype.hasOwnProperty.call("+f+", '"+e.util.escapeQuotes(q)+"') "),i+=") { var err = ",e.createErrors!==!1?(i+=" { keyword: 'required' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { missingProperty: '"+B+"' } ",e.opts.messages!==!1&&(i+=" , message: '",e.opts._errorDataPathProperty?i+="is a required property":i+="should have required property \\'"+B+"\\'",i+="' "),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; } "}}e.errorPath=O}else d&&(i+=" if (true) {");return i}});var CLt=D((QFo,vLt)=>{"use strict";vLt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f="data"+(s||""),p="valid"+o,h=e.opts.$data&&a&&a.$data,m;if(h?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",m="schema"+o):m=a,(a||h)&&e.opts.uniqueItems!==!1){h&&(i+=" var "+p+"; if ("+m+" === false || "+m+" === undefined) "+p+" = true; else if (typeof "+m+" != 'boolean') "+p+" = false; else { "),i+=" var i = "+f+".length , "+p+" = true , j; if (i > 1) { ";var g=e.schema.items&&e.schema.items.type,A=Array.isArray(g);if(!g||g=="object"||g=="array"||A&&(g.indexOf("object")>=0||g.indexOf("array")>=0))i+=" outer: for (;i--;) { for (j = i; j--;) { if (equal("+f+"[i], "+f+"[j])) { "+p+" = false; break outer; } } } ";else{i+=" var itemIndices = {}, item; for (;i--;) { var item = "+f+"[i]; ";var y="checkDataType"+(A?"s":"");i+=" if ("+e.util[y](g,"item",e.opts.strictNumbers,!0)+") continue; ",A&&(i+=` if (typeof item == 'string') item = '"' + item; `),i+=" if (typeof itemIndices[item] == 'number') { "+p+" = false; j = itemIndices[item]; break; } itemIndices[item] = i; } "}i+=" } ",h&&(i+=" } "),i+=" if (!"+p+") { ";var E=E||[];E.push(i),i="",e.createErrors!==!1?(i+=" { keyword: 'uniqueItems' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { i: i, j: j } ",e.opts.messages!==!1&&(i+=" , message: 'should NOT have duplicate items (items ## ' + j + ' and ' + i + ' are identical)' "),e.opts.verbose&&(i+=" , schema: ",h?i+="validate.schema"+c:i+=""+a,i+=" , parentSchema: validate.schema"+e.schemaPath+" , data: "+f+" "),i+=" } "):i+=" {} ";var C=i;i=E.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+C+"]); ":i+=" validate.errors = ["+C+"]; return false; ":i+=" var err = "+C+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",i+=" } ",d&&(i+=" else { ")}else d&&(i+=" if (true) { ");return i}});var xLt=D((qFo,bLt)=>{"use strict";bLt.exports={$ref:MPt(),allOf:LPt(),anyOf:UPt(),$comment:qPt(),const:HPt(),contains:WPt(),dependencies:jPt(),enum:YPt(),format:KPt(),if:ZPt(),items:tLt(),maximum:wUe(),minimum:wUe(),maxItems:_Ue(),minItems:_Ue(),maxLength:TUe(),minLength:TUe(),maxProperties:IUe(),minProperties:IUe(),multipleOf:aLt(),not:cLt(),oneOf:dLt(),pattern:pLt(),properties:mLt(),propertyNames:ALt(),required:ELt(),uniqueItems:CLt(),validate:xUe()}});var _Lt=D((GFo,wLt)=>{"use strict";var SLt=xLt(),DUe=HD().toHash;wLt.exports=function(){var e=[{type:"number",rules:[{maximum:["exclusiveMaximum"]},{minimum:["exclusiveMinimum"]},"multipleOf","format"]},{type:"string",rules:["maxLength","minLength","pattern","format"]},{type:"array",rules:["maxItems","minItems","items","contains","uniqueItems"]},{type:"object",rules:["maxProperties","minProperties","required","dependencies","propertyNames",{properties:["additionalProperties","patternProperties"]}]},{rules:["$ref","const","enum","not","anyOf","oneOf","allOf","if"]}],r=["type","$comment"],n=["$schema","$id","id","$data","$async","title","description","default","definitions","examples","readOnly","writeOnly","contentMediaType","contentEncoding","additionalItems","then","else"],i=["number","integer","string","array","object","boolean","null"];return e.all=DUe(r),e.types=DUe(i),e.forEach(function(o){o.rules=o.rules.map(function(s){var a;if(typeof s=="object"){var c=Object.keys(s)[0];a=s[c],s=c,a.forEach(function(d){r.push(d),e.all[d]=!0})}r.push(s);var u=e.all[s]={keyword:s,code:SLt[s],implements:a};return u}),e.all.$comment={keyword:"$comment",code:SLt.$comment},o.type&&(e.types[o.type]=o)}),e.keywords=DUe(r.concat(n)),e.custom={},e}});var DLt=D((HFo,ILt)=>{"use strict";var TLt=["multipleOf","maximum","exclusiveMaximum","minimum","exclusiveMinimum","maxLength","minLength","pattern","additionalItems","maxItems","minItems","uniqueItems","maxProperties","minProperties","required","additionalProperties","enum","format","const"];ILt.exports=function(t,e){for(var r=0;r<e.length;r++){t=JSON.parse(JSON.stringify(t));var n=e[r].split("/"),i=t,o;for(o=1;o<n.length;o++)i=i[n[o]];for(o=0;o<TLt.length;o++){var s=TLt[o],a=i[s];a&&(i[s]={anyOf:[a,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]})}}return t}});var NLt=D((VFo,BLt)=>{"use strict";var jPn=Y0e().MissingRef;BLt.exports=RLt;function RLt(t,e,r){var n=this;if(typeof this._opts.loadSchema!="function")throw new Error("options.loadSchema should be a function");typeof e=="function"&&(r=e,e=void 0);var i=o(t).then(function(){var a=n._addSchema(t,void 0,e);return a.validate||s(a)});return r&&i.then(function(a){r(null,a)},r),i;function o(a){var c=a.$schema;return c&&!n.getSchema(c)?RLt.call(n,{$ref:c},!0):Promise.resolve()}function s(a){try{return n._compile(a)}catch(u){if(u instanceof jPn)return c(u);throw u}function c(u){var d=u.missingSchema;if(h(d))throw new Error("Schema "+d+" is loaded but "+u.missingRef+" cannot be resolved");var f=n._loadingSchemas[d];return f||(f=n._loadingSchemas[d]=n._opts.loadSchema(d),f.then(p,p)),f.then(function(m){if(!h(d))return o(m).then(function(){h(d)||n.addSchema(m,d,void 0,e)})}).then(function(){return s(a)});function p(){delete n._loadingSchemas[d]}function h(m){return n._refs[m]||n._schemas[m]}}}}});var kLt=D((WFo,OLt)=>{"use strict";OLt.exports=function(e,r,n){var i=" ",o=e.level,s=e.dataLevel,a=e.schema[r],c=e.schemaPath+e.util.getProperty(r),u=e.errSchemaPath+"/"+r,d=!e.opts.allErrors,f,p="data"+(s||""),h="valid"+o,m="errs__"+o,g=e.opts.$data&&a&&a.$data,A;g?(i+=" var schema"+o+" = "+e.util.getData(a.$data,s,e.dataPathArr)+"; ",A="schema"+o):A=a;var y=this,E="definition"+o,C=y.definition,x="",w,O,N,U,S;if(g&&C.$data){S="keywordValidate"+o;var k=C.validateSchema;i+=" var "+E+" = RULES.custom['"+r+"'].definition; var "+S+" = "+E+".validate;"}else{if(U=e.useCustomRule(y,a,e.schema,e),!U)return;A="validate.schema"+c,S=U.code,w=C.compile,O=C.inline,N=C.macro}var B=S+".errors",F="i"+o,L="ruleErr"+o,R=C.async;if(R&&!e.async)throw new Error("async keyword in sync schema");if(O||N||(i+=""+B+" = null;"),i+="var "+m+" = errors;var "+h+";",g&&C.$data&&(x+="}",i+=" if ("+A+" === undefined) { "+h+" = true; } else { ",k&&(x+="}",i+=" "+h+" = "+E+".validateSchema("+A+"); if ("+h+") { ")),O)C.statements?i+=" "+U.validate+" ":i+=" "+h+" = "+U.validate+"; ";else if(N){var q=e.util.copy(e),x="";q.level++;var Q="valid"+q.level;q.schema=U.validate,q.schemaPath="";var V=e.compositeRule;e.compositeRule=q.compositeRule=!0;var H=e.validate(q).replace(/validate\.schema/g,S);e.compositeRule=q.compositeRule=V,i+=" "+H}else{var J=J||[];J.push(i),i="",i+=" "+S+".call( ",e.opts.passContext?i+="this":i+="self",w||C.schema===!1?i+=" , "+p+" ":i+=" , "+A+" , "+p+" , validate.schema"+e.schemaPath+" ",i+=" , (dataPath || '')",e.errorPath!='""'&&(i+=" + "+e.errorPath);var X=s?"data"+(s-1||""):"parentData",he=s?e.dataPathArr[s]:"parentDataProperty";i+=" , "+X+" , "+he+" , rootData ) ";var Ce=i;i=J.pop(),C.errors===!1?(i+=" "+h+" = ",R&&(i+="await "),i+=""+Ce+"; "):R?(B="customErrors"+o,i+=" var "+B+" = null; try { "+h+" = await "+Ce+"; } catch (e) { "+h+" = false; if (e instanceof ValidationError) "+B+" = e.errors; else throw e; } "):i+=" "+B+" = null; "+h+" = "+Ce+"; "}if(C.modifying&&(i+=" if ("+X+") "+p+" = "+X+"["+he+"];"),i+=""+x,C.valid)d&&(i+=" if (true) { ");else{i+=" if ( ",C.valid===void 0?(i+=" !",N?i+=""+Q:i+=""+h):i+=" "+!C.valid+" ",i+=") { ",f=y.keyword;var J=J||[];J.push(i),i="";var J=J||[];J.push(i),i="",e.createErrors!==!1?(i+=" { keyword: '"+(f||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+y.keyword+"' } ",e.opts.messages!==!1&&(i+=` , message: 'should pass "`+y.keyword+`" keyword validation' `),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ";var ge=i;i=J.pop(),!e.compositeRule&&d?e.async?i+=" throw new ValidationError(["+ge+"]); ":i+=" validate.errors = ["+ge+"]; return false; ":i+=" var err = "+ge+"; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ";var be=i;i=J.pop(),O?C.errors?C.errors!="full"&&(i+=" for (var "+F+"="+m+"; "+F+"<errors; "+F+"++) { var "+L+" = vErrors["+F+"]; if ("+L+".dataPath === undefined) "+L+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+L+".schemaPath === undefined) { "+L+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(i+=" "+L+".schema = "+A+"; "+L+".data = "+p+"; "),i+=" } "):C.errors===!1?i+=" "+be+" ":(i+=" if ("+m+" == errors) { "+be+" } else { for (var "+F+"="+m+"; "+F+"<errors; "+F+"++) { var "+L+" = vErrors["+F+"]; if ("+L+".dataPath === undefined) "+L+".dataPath = (dataPath || '') + "+e.errorPath+"; if ("+L+".schemaPath === undefined) { "+L+'.schemaPath = "'+u+'"; } ',e.opts.verbose&&(i+=" "+L+".schema = "+A+"; "+L+".data = "+p+"; "),i+=" } } "):N?(i+=" var err = ",e.createErrors!==!1?(i+=" { keyword: '"+(f||"custom")+"' , dataPath: (dataPath || '') + "+e.errorPath+" , schemaPath: "+e.util.toQuotedString(u)+" , params: { keyword: '"+y.keyword+"' } ",e.opts.messages!==!1&&(i+=` , message: 'should pass "`+y.keyword+`" keyword validation' `),e.opts.verbose&&(i+=" , schema: validate.schema"+c+" , parentSchema: validate.schema"+e.schemaPath+" , data: "+p+" "),i+=" } "):i+=" {} ",i+="; if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ",!e.compositeRule&&d&&(e.async?i+=" throw new ValidationError(vErrors); ":i+=" validate.errors = vErrors; return false; ")):C.errors===!1?i+=" "+be+" ":(i+=" if (Array.isArray("+B+")) { if (vErrors === null) vErrors = "+B+"; else vErrors = vErrors.concat("+B+"); errors = vErrors.length; for (var "+F+"="+m+"; "+F+"<errors; "+F+"++) { var "+L+" = vErrors["+F+"]; if ("+L+".dataPath === undefined) "+L+".dataPath = (dataPath || '') + "+e.errorPath+"; "+L+'.schemaPath = "'+u+'"; ',e.opts.verbose&&(i+=" "+L+".schema = "+A+"; "+L+".data = "+p+"; "),i+=" } } else { "+be+" } "),i+=" } ",d&&(i+=" else { ")}return i}});var RUe=D(($Fo,zPn)=>{zPn.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"http://json-schema.org/draft-07/schema#",title:"Core schema meta-schema",definitions:{schemaArray:{type:"array",minItems:1,items:{$ref:"#"}},nonNegativeInteger:{type:"integer",minimum:0},nonNegativeIntegerDefault0:{allOf:[{$ref:"#/definitions/nonNegativeInteger"},{default:0}]},simpleTypes:{enum:["array","boolean","integer","null","number","object","string"]},stringArray:{type:"array",items:{type:"string"},uniqueItems:!0,default:[]}},type:["object","boolean"],properties:{$id:{type:"string",format:"uri-reference"},$schema:{type:"string",format:"uri"},$ref:{type:"string",format:"uri-reference"},$comment:{type:"string"},title:{type:"string"},description:{type:"string"},default:!0,readOnly:{type:"boolean",default:!1},examples:{type:"array",items:!0},multipleOf:{type:"number",exclusiveMinimum:0},maximum:{type:"number"},exclusiveMaximum:{type:"number"},minimum:{type:"number"},exclusiveMinimum:{type:"number"},maxLength:{$ref:"#/definitions/nonNegativeInteger"},minLength:{$ref:"#/definitions/nonNegativeIntegerDefault0"},pattern:{type:"string",format:"regex"},additionalItems:{$ref:"#"},items:{anyOf:[{$ref:"#"},{$ref:"#/definitions/schemaArray"}],default:!0},maxItems:{$ref:"#/definitions/nonNegativeInteger"},minItems:{$ref:"#/definitions/nonNegativeIntegerDefault0"},uniqueItems:{type:"boolean",default:!1},contains:{$ref:"#"},maxProperties:{$ref:"#/definitions/nonNegativeInteger"},minProperties:{$ref:"#/definitions/nonNegativeIntegerDefault0"},required:{$ref:"#/definitions/stringArray"},additionalProperties:{$ref:"#"},definitions:{type:"object",additionalProperties:{$ref:"#"},default:{}},properties:{type:"object",additionalProperties:{$ref:"#"},default:{}},patternProperties:{type:"object",additionalProperties:{$ref:"#"},propertyNames:{format:"regex"},default:{}},dependencies:{type:"object",additionalProperties:{anyOf:[{$ref:"#"},{$ref:"#/definitions/stringArray"}]}},propertyNames:{$ref:"#"},const:!0,enum:{type:"array",items:!0,minItems:1,uniqueItems:!0},type:{anyOf:[{$ref:"#/definitions/simpleTypes"},{type:"array",items:{$ref:"#/definitions/simpleTypes"},minItems:1,uniqueItems:!0}]},format:{type:"string"},contentMediaType:{type:"string"},contentEncoding:{type:"string"},if:{$ref:"#"},then:{$ref:"#"},else:{$ref:"#"},allOf:{$ref:"#/definitions/schemaArray"},anyOf:{$ref:"#/definitions/schemaArray"},oneOf:{$ref:"#/definitions/schemaArray"},not:{$ref:"#"}},default:!0}});var LLt=D((jFo,PLt)=>{"use strict";var MLt=RUe();PLt.exports={$id:"https://github.com/ajv-validator/ajv/blob/master/lib/definition_schema.js",definitions:{simpleTypes:MLt.definitions.simpleTypes},type:"object",dependencies:{schema:["validate"],$data:["validate"],statements:["inline"],valid:{not:{required:["macro"]}}},properties:{type:MLt.properties.type,schema:{type:"boolean"},statements:{type:"boolean"},dependencies:{type:"array",items:{type:"string"}},metaSchema:{type:"object"},modifying:{type:"boolean"},valid:{type:"boolean"},$data:{type:"boolean"},async:{type:"boolean"},errors:{anyOf:[{type:"boolean"},{const:"full"}]}}}});var ULt=D((zFo,FLt)=>{"use strict";var YPn=/^[a-z_$][a-z0-9_$-]*$/i,JPn=kLt(),KPn=LLt();FLt.exports={add:XPn,get:ZPn,remove:eLn,validate:BUe};function XPn(t,e){var r=this.RULES;if(r.keywords[t])throw new Error("Keyword "+t+" is already defined");if(!YPn.test(t))throw new Error("Keyword "+t+" is not a valid identifier");if(e){this.validateKeyword(e,!0);var n=e.type;if(Array.isArray(n))for(var i=0;i<n.length;i++)s(t,n[i],e);else s(t,n,e);var o=e.metaSchema;o&&(e.$data&&this._opts.$data&&(o={anyOf:[o,{$ref:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#"}]}),e.validateSchema=this.compile(o,!0))}r.keywords[t]=r.all[t]=!0;function s(a,c,u){for(var d,f=0;f<r.length;f++){var p=r[f];if(p.type==c){d=p;break}}d||(d={type:c,rules:[]},r.push(d));var h={keyword:a,definition:u,custom:!0,code:JPn,implements:u.implements};d.rules.push(h),r.custom[a]=h}return this}function ZPn(t){var e=this.RULES.custom[t];return e?e.definition:this.RULES.keywords[t]||!1}function eLn(t){var e=this.RULES;delete e.keywords[t],delete e.all[t],delete e.custom[t];for(var r=0;r<e.length;r++)for(var n=e[r].rules,i=0;i<n.length;i++)if(n[i].keyword==t){n.splice(i,1);break}return this}function BUe(t,e){BUe.errors=null;var r=this._validateKeyword=this._validateKeyword||this.compile(KPn,!0);if(r(t))return!0;if(BUe.errors=r.errors,e)throw new Error("custom keyword definition is invalid: "+this.errorsText(r.errors));return!1}});var QLt=D((YFo,tLn)=>{tLn.exports={$schema:"http://json-schema.org/draft-07/schema#",$id:"https://raw.githubusercontent.com/ajv-validator/ajv/master/lib/refs/data.json#",description:"Meta-schema for $data reference (JSON Schema extension proposal)",type:"object",required:["$data"],properties:{$data:{type:"string",anyOf:[{format:"relative-json-pointer"},{format:"json-pointer"}]}},additionalProperties:!1}});var JLt=D((JFo,YLt)=>{"use strict";var GLt=EPt(),VD=z0e(),rLn=CPt(),HLt=gUe(),nLn=bUe(),iLn=OPt(),oLn=_Lt(),VLt=DLt(),WLt=HD();YLt.exports=Zu;Zu.prototype.validate=aLn;Zu.prototype.compile=lLn;Zu.prototype.addSchema=cLn;Zu.prototype.addMetaSchema=uLn;Zu.prototype.validateSchema=dLn;Zu.prototype.getSchema=pLn;Zu.prototype.removeSchema=mLn;Zu.prototype.addFormat=xLn;Zu.prototype.errorsText=bLn;Zu.prototype._addSchema=gLn;Zu.prototype._compile=ALn;Zu.prototype.compileAsync=NLt();var nme=ULt();Zu.prototype.addKeyword=nme.add;Zu.prototype.getKeyword=nme.get;Zu.prototype.removeKeyword=nme.remove;Zu.prototype.validateKeyword=nme.validate;var $Lt=Y0e();Zu.ValidationError=$Lt.Validation;Zu.MissingRefError=$Lt.MissingRef;Zu.$dataMetaSchema=VLt;var rme="http://json-schema.org/draft-07/schema",qLt=["removeAdditional","useDefaults","coerceTypes","strictDefaults"],sLn=["/properties"];function Zu(t){if(!(this instanceof Zu))return new Zu(t);t=this._opts=WLt.copy(t)||{},DLn(this),this._schemas={},this._refs={},this._fragments={},this._formats=iLn(t.format),this._cache=t.cache||new rLn,this._loadingSchemas={},this._compilations=[],this.RULES=oLn(),this._getId=yLn(t),t.loopRequired=t.loopRequired||1/0,t.errorDataPath=="property"&&(t._errorDataPathProperty=!0),t.serialize===void 0&&(t.serialize=nLn),this._metaOpts=ILn(this),t.formats&&_Ln(this),t.keywords&&TLn(this),SLn(this),typeof t.meta=="object"&&this.addMetaSchema(t.meta),t.nullable&&this.addKeyword("nullable",{metaSchema:{type:"boolean"}}),wLn(this)}function aLn(t,e){var r;if(typeof t=="string"){if(r=this.getSchema(t),!r)throw new Error('no schema with key or ref "'+t+'"')}else{var n=this._addSchema(t);r=n.validate||this._compile(n)}var i=r(e);return r.$async!==!0&&(this.errors=r.errors),i}function lLn(t,e){var r=this._addSchema(t,void 0,e);return r.validate||this._compile(r)}function cLn(t,e,r,n){if(Array.isArray(t)){for(var i=0;i<t.length;i++)this.addSchema(t[i],void 0,r,n);return this}var o=this._getId(t);if(o!==void 0&&typeof o!="string")throw new Error("schema id must be string");return e=VD.normalizeId(e||o),zLt(this,e),this._schemas[e]=this._addSchema(t,r,n,!0),this}function uLn(t,e,r){return this.addSchema(t,e,r,!0),this}function dLn(t,e){var r=t.$schema;if(r!==void 0&&typeof r!="string")throw new Error("$schema must be a string");if(r=r||this._opts.defaultMeta||fLn(this),!r)return this.logger.warn("meta-schema not available"),this.errors=null,!0;var n=this.validate(r,t);if(!n&&e){var i="schema is invalid: "+this.errorsText();if(this._opts.validateSchema=="log")this.logger.error(i);else throw new Error(i)}return n}function fLn(t){var e=t._opts.meta;return t._opts.defaultMeta=typeof e=="object"?t._getId(e)||e:t.getSchema(rme)?rme:void 0,t._opts.defaultMeta}function pLn(t){var e=jLt(this,t);switch(typeof e){case"object":return e.validate||this._compile(e);case"string":return this.getSchema(e);case"undefined":return hLn(this,t)}}function hLn(t,e){var r=VD.schema.call(t,{schema:{}},e);if(r){var n=r.schema,i=r.root,o=r.baseId,s=GLt.call(t,n,i,void 0,o);return t._fragments[e]=new HLt({ref:e,fragment:!0,schema:n,root:i,baseId:o,validate:s}),s}}function jLt(t,e){return e=VD.normalizeId(e),t._schemas[e]||t._refs[e]||t._fragments[e]}function mLn(t){if(t instanceof RegExp)return tme(this,this._schemas,t),tme(this,this._refs,t),this;switch(typeof t){case"undefined":return tme(this,this._schemas),tme(this,this._refs),this._cache.clear(),this;case"string":var e=jLt(this,t);return e&&this._cache.del(e.cacheKey),delete this._schemas[t],delete this._refs[t],this;case"object":var r=this._opts.serialize,n=r?r(t):t;this._cache.del(n);var i=this._getId(t);i&&(i=VD.normalizeId(i),delete this._schemas[i],delete this._refs[i])}return this}function tme(t,e,r){for(var n in e){var i=e[n];!i.meta&&(!r||r.test(n))&&(t._cache.del(i.cacheKey),delete e[n])}}function gLn(t,e,r,n){if(typeof t!="object"&&typeof t!="boolean")throw new Error("schema should be object or boolean");var i=this._opts.serialize,o=i?i(t):t,s=this._cache.get(o);if(s)return s;n=n||this._opts.addUsedSchema!==!1;var a=VD.normalizeId(this._getId(t));a&&n&&zLt(this,a);var c=this._opts.validateSchema!==!1&&!e,u;c&&!(u=a&&a==VD.normalizeId(t.$schema))&&this.validateSchema(t,!0);var d=VD.ids.call(this,t),f=new HLt({id:a,schema:t,localRefs:d,cacheKey:o,meta:r});return a[0]!="#"&&n&&(this._refs[a]=f),this._cache.put(o,f),c&&u&&this.validateSchema(t,!0),f}function ALn(t,e){if(t.compiling)return t.validate=i,i.schema=t.schema,i.errors=null,i.root=e||i,t.schema.$async===!0&&(i.$async=!0),i;t.compiling=!0;var r;t.meta&&(r=this._opts,this._opts=this._metaOpts);var n;try{n=GLt.call(this,t.schema,e,t.localRefs)}catch(o){throw delete t.validate,o}finally{t.compiling=!1,t.meta&&(this._opts=r)}return t.validate=n,t.refs=n.refs,t.refVal=n.refVal,t.root=n.root,n;function i(){var o=t.validate,s=o.apply(this,arguments);return i.errors=o.errors,s}}function yLn(t){switch(t.schemaId){case"auto":return CLn;case"id":return ELn;default:return vLn}}function ELn(t){return t.$id&&this.logger.warn("schema $id ignored",t.$id),t.id}function vLn(t){return t.id&&this.logger.warn("schema id ignored",t.id),t.$id}function CLn(t){if(t.$id&&t.id&&t.$id!=t.id)throw new Error("schema $id is different from id");return t.$id||t.id}function bLn(t,e){if(t=t||this.errors,!t)return"No errors";e=e||{};for(var r=e.separator===void 0?", ":e.separator,n=e.dataVar===void 0?"data":e.dataVar,i="",o=0;o<t.length;o++){var s=t[o];s&&(i+=n+s.dataPath+" "+s.message+r)}return i.slice(0,-r.length)}function xLn(t,e){return typeof e=="string"&&(e=new RegExp(e)),this._formats[t]=e,this}function SLn(t){var e;if(t._opts.$data&&(e=QLt(),t.addMetaSchema(e,e.$id,!0)),t._opts.meta!==!1){var r=RUe();t._opts.$data&&(r=VLt(r,sLn)),t.addMetaSchema(r,rme,!0),t._refs["http://json-schema.org/schema"]=rme}}function wLn(t){var e=t._opts.schemas;if(e)if(Array.isArray(e))t.addSchema(e);else for(var r in e)t.addSchema(e[r],r)}function _Ln(t){for(var e in t._opts.formats){var r=t._opts.formats[e];t.addFormat(e,r)}}function TLn(t){for(var e in t._opts.keywords){var r=t._opts.keywords[e];t.addKeyword(e,r)}}function zLt(t,e){if(t._schemas[e]||t._refs[e])throw new Error('schema with key or id "'+e+'" already exists')}function ILn(t){for(var e=WLt.copy(t._opts),r=0;r<qLt.length;r++)delete e[qLt[r]];return e}function DLn(t){var e=t._opts.logger;if(e===!1)t.logger={log:NUe,warn:NUe,error:NUe};else{if(e===void 0&&(e=console),!(typeof e=="object"&&e.log&&e.warn&&e.error))throw new Error("logger must implement log, warn and error methods");t.logger=e}}function NUe(){}});var KLt,b1,EU=ae(()=>{YMt();aS();KLt=Fe(JLt(),1),b1=class extends Q0e{constructor(e,r){var n;super(r),this._clientInfo=e,this._cachedToolOutputValidators=new Map,this._capabilities=(n=r?.capabilities)!==null&&n!==void 0?n:{},this._ajv=new KLt.default}registerCapabilities(e){if(this.transport)throw new Error("Cannot register capabilities after connecting to transport");this._capabilities=zMt(this._capabilities,e)}assertCapability(e,r){var n;if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n[e]))throw new Error(`Server does not support ${e} (required for ${r})`)}async connect(e,r){if(await super.connect(e),e.sessionId===void 0)try{let n=await this.request({method:"initialize",params:{protocolVersion:AU,capabilities:this._capabilities,clientInfo:this._clientInfo}},ZFe,r);if(n===void 0)throw new Error(`Server sent invalid initialize result: ${n}`);if(!RMt.includes(n.protocolVersion))throw new Error(`Server's protocol version is not supported: ${n.protocolVersion}`);this._serverCapabilities=n.capabilities,this._serverVersion=n.serverInfo,e.setProtocolVersion&&e.setProtocolVersion(n.protocolVersion),this._instructions=n.instructions,await this.notification({method:"notifications/initialized"})}catch(n){throw this.close(),n}}getServerCapabilities(){return this._serverCapabilities}getServerVersion(){return this._serverVersion}getInstructions(){return this._instructions}assertCapabilityForMethod(e){var r,n,i,o,s;switch(e){case"logging/setLevel":if(!(!((r=this._serverCapabilities)===null||r===void 0)&&r.logging))throw new Error(`Server does not support logging (required for ${e})`);break;case"prompts/get":case"prompts/list":if(!(!((n=this._serverCapabilities)===null||n===void 0)&&n.prompts))throw new Error(`Server does not support prompts (required for ${e})`);break;case"resources/list":case"resources/templates/list":case"resources/read":case"resources/subscribe":case"resources/unsubscribe":if(!(!((i=this._serverCapabilities)===null||i===void 0)&&i.resources))throw new Error(`Server does not support resources (required for ${e})`);if(e==="resources/subscribe"&&!this._serverCapabilities.resources.subscribe)throw new Error(`Server does not support resource subscriptions (required for ${e})`);break;case"tools/call":case"tools/list":if(!(!((o=this._serverCapabilities)===null||o===void 0)&&o.tools))throw new Error(`Server does not support tools (required for ${e})`);break;case"completion/complete":if(!(!((s=this._serverCapabilities)===null||s===void 0)&&s.completions))throw new Error(`Server does not support completions (required for ${e})`);break;case"initialize":break;case"ping":break}}assertNotificationCapability(e){var r;switch(e){case"notifications/roots/list_changed":if(!(!((r=this._capabilities.roots)===null||r===void 0)&&r.listChanged))throw new Error(`Client does not support roots list changed notifications (required for ${e})`);break;case"notifications/initialized":break;case"notifications/cancelled":break;case"notifications/progress":break}}assertRequestHandlerCapability(e){switch(e){case"sampling/createMessage":if(!this._capabilities.sampling)throw new Error(`Client does not support sampling capability (required for ${e})`);break;case"elicitation/create":if(!this._capabilities.elicitation)throw new Error(`Client does not support elicitation capability (required for ${e})`);break;case"roots/list":if(!this._capabilities.roots)throw new Error(`Client does not support roots capability (required for ${e})`);break;case"ping":break}}async ping(e){return this.request({method:"ping"},GD,e)}async complete(e,r){return this.request({method:"completion/complete",params:e},lUe,r)}async setLoggingLevel(e,r){return this.request({method:"logging/setLevel",params:{level:e}},GD,r)}async getPrompt(e,r){return this.request({method:"prompts/get",params:e},uX,r)}async listPrompts(e,r){return this.request({method:"prompts/list",params:e},cX,r)}async listResources(e,r){return this.request({method:"resources/list",params:e},tUe,r)}async listResourceTemplates(e,r){return this.request({method:"resources/templates/list",params:e},rUe,r)}async readResource(e,r){return this.request({method:"resources/read",params:e},nUe,r)}async subscribeResource(e,r){return this.request({method:"resources/subscribe",params:e},GD,r)}async unsubscribeResource(e,r){return this.request({method:"resources/unsubscribe",params:e},GD,r)}async callTool(e,r=F0e,n){let i=await this.request({method:"tools/call",params:e},r,n),o=this.getToolOutputValidator(e.name);if(o){if(!i.structuredContent&&!i.isError)throw new B3(R3.InvalidRequest,`Tool ${e.name} has an output schema but did not return structured content`);if(i.structuredContent)try{if(!o(i.structuredContent))throw new B3(R3.InvalidParams,`Structured content does not match the tool's output schema: ${this._ajv.errorsText(o.errors)}`)}catch(s){throw s instanceof B3?s:new B3(R3.InvalidParams,`Failed to validate structured content: ${s instanceof Error?s.message:String(s)}`)}}return i}cacheToolOutputSchemas(e){this._cachedToolOutputValidators.clear();for(let r of e)if(r.outputSchema)try{let n=this._ajv.compile(r.outputSchema);this._cachedToolOutputValidators.set(r.name,n)}catch{}}getToolOutputValidator(e){return this._cachedToolOutputValidators.get(e)}async listTools(e,r){let n=await this.request({method:"tools/list",params:e},aUe,r);return this.cacheToolOutputSchemas(n.tools),n}async sendRootsListChanged(){return this.notification({method:"notifications/roots/list_changed"})}}});var rFt=D((eUo,tFt)=>{tFt.exports=eFt;eFt.sync=BLn;var XLt=ye("fs");function RLn(t,e){var r=e.pathExt!==void 0?e.pathExt:process.env.PATHEXT;if(!r||(r=r.split(";"),r.indexOf("")!==-1))return!0;for(var n=0;n<r.length;n++){var i=r[n].toLowerCase();if(i&&t.substr(-i.length).toLowerCase()===i)return!0}return!1}function ZLt(t,e,r){return!t.isSymbolicLink()&&!t.isFile()?!1:RLn(e,r)}function eFt(t,e,r){XLt.stat(t,function(n,i){r(n,n?!1:ZLt(i,t,e))})}function BLn(t,e){return ZLt(XLt.statSync(t),t,e)}});var aFt=D((tUo,sFt)=>{sFt.exports=iFt;iFt.sync=NLn;var nFt=ye("fs");function iFt(t,e,r){nFt.stat(t,function(n,i){r(n,n?!1:oFt(i,e))})}function NLn(t,e){return oFt(nFt.statSync(t),e)}function oFt(t,e){return t.isFile()&&OLn(t,e)}function OLn(t,e){var r=t.mode,n=t.uid,i=t.gid,o=e.uid!==void 0?e.uid:process.getuid&&process.getuid(),s=e.gid!==void 0?e.gid:process.getgid&&process.getgid(),a=parseInt("100",8),c=parseInt("010",8),u=parseInt("001",8),d=a|c,f=r&u||r&c&&i===s||r&a&&n===o||r&d&&o===0;return f}});var cFt=D((nUo,lFt)=>{var rUo=ye("fs"),ime;process.platform==="win32"||global.TESTING_WINDOWS?ime=rFt():ime=aFt();lFt.exports=OUe;OUe.sync=kLn;function OUe(t,e,r){if(typeof e=="function"&&(r=e,e={}),!r){if(typeof Promise!="function")throw new TypeError("callback not provided");return new Promise(function(n,i){OUe(t,e||{},function(o,s){o?i(o):n(s)})})}ime(t,e||{},function(n,i){n&&(n.code==="EACCES"||e&&e.ignoreErrors)&&(n=null,i=!1),r(n,i)})}function kLn(t,e){try{return ime.sync(t,e||{})}catch(r){if(e&&e.ignoreErrors||r.code==="EACCES")return!1;throw r}}});var gFt=D((iUo,mFt)=>{var vU=process.platform==="win32"||process.env.OSTYPE==="cygwin"||process.env.OSTYPE==="msys",uFt=ye("path"),MLn=vU?";":":",dFt=cFt(),fFt=t=>Object.assign(new Error(`not found: ${t}`),{code:"ENOENT"}),pFt=(t,e)=>{let r=e.colon||MLn,n=t.match(/\//)||vU&&t.match(/\\/)?[""]:[...vU?[process.cwd()]:[],...(e.path||process.env.PATH||"").split(r)],i=vU?e.pathExt||process.env.PATHEXT||".EXE;.CMD;.BAT;.COM":"",o=vU?i.split(r):[""];return vU&&t.indexOf(".")!==-1&&o[0]!==""&&o.unshift(""),{pathEnv:n,pathExt:o,pathExtExe:i}},hFt=(t,e,r)=>{typeof e=="function"&&(r=e,e={}),e||(e={});let{pathEnv:n,pathExt:i,pathExtExe:o}=pFt(t,e),s=[],a=u=>new Promise((d,f)=>{if(u===n.length)return e.all&&s.length?d(s):f(fFt(t));let p=n[u],h=/^".*"$/.test(p)?p.slice(1,-1):p,m=uFt.join(h,t),g=!h&&/^\.[\\\/]/.test(t)?t.slice(0,2)+m:m;d(c(g,u,0))}),c=(u,d,f)=>new Promise((p,h)=>{if(f===i.length)return p(a(d+1));let m=i[f];dFt(u+m,{pathExt:o},(g,A)=>{if(!g&&A)if(e.all)s.push(u+m);else return p(u+m);return p(c(u,d,f+1))})});return r?a(0).then(u=>r(null,u),r):a(0)},PLn=(t,e)=>{e=e||{};let{pathEnv:r,pathExt:n,pathExtExe:i}=pFt(t,e),o=[];for(let s=0;s<r.length;s++){let a=r[s],c=/^".*"$/.test(a)?a.slice(1,-1):a,u=uFt.join(c,t),d=!c&&/^\.[\\\/]/.test(t)?t.slice(0,2)+u:u;for(let f=0;f<n.length;f++){let p=d+n[f];try{if(dFt.sync(p,{pathExt:i}))if(e.all)o.push(p);else return p}catch{}}}if(e.all&&o.length)return o;if(e.nothrow)return null;throw fFt(t)};mFt.exports=hFt;hFt.sync=PLn});var yFt=D((oUo,kUe)=>{"use strict";var AFt=(t={})=>{let e=t.env||process.env;return(t.platform||process.platform)!=="win32"?"PATH":Object.keys(e).reverse().find(n=>n.toUpperCase()==="PATH")||"Path"};kUe.exports=AFt;kUe.exports.default=AFt});var bFt=D((sUo,CFt)=>{"use strict";var EFt=ye("path"),LLn=gFt(),FLn=yFt();function vFt(t,e){let r=t.options.env||process.env,n=process.cwd(),i=t.options.cwd!=null,o=i&&process.chdir!==void 0&&!process.chdir.disabled;if(o)try{process.chdir(t.options.cwd)}catch{}let s;try{s=LLn.sync(t.command,{path:r[FLn({env:r})],pathExt:e?EFt.delimiter:void 0})}catch{}finally{o&&process.chdir(n)}return s&&(s=EFt.resolve(i?t.options.cwd:"",s)),s}function ULn(t){return vFt(t)||vFt(t,!0)}CFt.exports=ULn});var xFt=D((aUo,PUe)=>{"use strict";var MUe=/([()\][%!^"`<>&|;, *?])/g;function QLn(t){return t=t.replace(MUe,"^$1"),t}function qLn(t,e){return t=`${t}`,t=t.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),t=t.replace(/(?=(\\+?)?)\1$/,"$1$1"),t=`"${t}"`,t=t.replace(MUe,"^$1"),e&&(t=t.replace(MUe,"^$1")),t}PUe.exports.command=QLn;PUe.exports.argument=qLn});var wFt=D((lUo,SFt)=>{"use strict";SFt.exports=/^#!(.*)/});var TFt=D((cUo,_Ft)=>{"use strict";var GLn=wFt();_Ft.exports=(t="")=>{let e=t.match(GLn);if(!e)return null;let[r,n]=e[0].replace(/#! ?/,"").split(" "),i=r.split("/").pop();return i==="env"?n:n?`${i} ${n}`:i}});var DFt=D((uUo,IFt)=>{"use strict";var LUe=ye("fs"),HLn=TFt();function VLn(t){let r=Buffer.alloc(150),n;try{n=LUe.openSync(t,"r"),LUe.readSync(n,r,0,150,0),LUe.closeSync(n)}catch{}return HLn(r.toString())}IFt.exports=VLn});var OFt=D((dUo,NFt)=>{"use strict";var WLn=ye("path"),RFt=bFt(),BFt=xFt(),$Ln=DFt(),jLn=process.platform==="win32",zLn=/\.(?:com|exe)$/i,YLn=/node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;function JLn(t){t.file=RFt(t);let e=t.file&&$Ln(t.file);return e?(t.args.unshift(t.file),t.command=e,RFt(t)):t.file}function KLn(t){if(!jLn)return t;let e=JLn(t),r=!zLn.test(e);if(t.options.forceShell||r){let n=YLn.test(e);t.command=WLn.normalize(t.command),t.command=BFt.command(t.command),t.args=t.args.map(o=>BFt.argument(o,n));let i=[t.command].concat(t.args).join(" ");t.args=["/d","/s","/c",`"${i}"`],t.command=process.env.comspec||"cmd.exe",t.options.windowsVerbatimArguments=!0}return t}function XLn(t,e,r){e&&!Array.isArray(e)&&(r=e,e=null),e=e?e.slice(0):[],r=Object.assign({},r);let n={command:t,args:e,options:r,file:void 0,original:{command:t,args:e}};return r.shell?n:KLn(n)}NFt.exports=XLn});var PFt=D((fUo,MFt)=>{"use strict";var FUe=process.platform==="win32";function UUe(t,e){return Object.assign(new Error(`${e} ${t.command} ENOENT`),{code:"ENOENT",errno:"ENOENT",syscall:`${e} ${t.command}`,path:t.command,spawnargs:t.args})}function ZLn(t,e){if(!FUe)return;let r=t.emit;t.emit=function(n,i){if(n==="exit"){let o=kFt(i,e);if(o)return r.call(t,"error",o)}return r.apply(t,arguments)}}function kFt(t,e){return FUe&&t===1&&!e.file?UUe(e.original,"spawn"):null}function eFn(t,e){return FUe&&t===1&&!e.file?UUe(e.original,"spawnSync"):null}MFt.exports={hookChildProcess:ZLn,verifyENOENT:kFt,verifyENOENTSync:eFn,notFoundError:UUe}});var UFt=D((pUo,CU)=>{"use strict";var LFt=ye("child_process"),QUe=OFt(),qUe=PFt();function FFt(t,e,r){let n=QUe(t,e,r),i=LFt.spawn(n.command,n.args,n.options);return qUe.hookChildProcess(i,n),i}function tFn(t,e,r){let n=QUe(t,e,r),i=LFt.spawnSync(n.command,n.args,n.options);return i.error=i.error||qUe.verifyENOENTSync(i.status,n),i}CU.exports=FFt;CU.exports.spawn=FFt;CU.exports.sync=tFn;CU.exports._parse=QUe;CU.exports._enoent=qUe});function rFn(t){return sS.parse(JSON.parse(t))}function QFt(t){return JSON.stringify(t)+`
836
836
  `}var ome,qFt=ae(()=>{aS();ome=class{append(e){this._buffer=this._buffer?Buffer.concat([this._buffer,e]):e}readMessage(){if(!this._buffer)return null;let e=this._buffer.indexOf(`
837
837
  `);if(e===-1)return null;let r=this._buffer.toString("utf8",0,e).replace(/\r$/,"");return this._buffer=this._buffer.subarray(e+1),rFn(r)}clear(){this._buffer=void 0}}});import sme from"node:process";import{PassThrough as nFn}from"node:stream";function oFn(){let t={};for(let e of iFn){let r=sme.env[e];r!==void 0&&(r.startsWith("()")||(t[e]=r))}return t}function sFn(){return"type"in sme}var GFt,iFn,bU,GUe=ae(()=>{GFt=Fe(UFt(),1);qFt();iFn=sme.platform==="win32"?["APPDATA","HOMEDRIVE","HOMEPATH","LOCALAPPDATA","PATH","PROCESSOR_ARCHITECTURE","SYSTEMDRIVE","SYSTEMROOT","TEMP","USERNAME","USERPROFILE","PROGRAMFILES"]:["HOME","LOGNAME","PATH","SHELL","TERM","USER"];bU=class{constructor(e){this._abortController=new AbortController,this._readBuffer=new ome,this._stderrStream=null,this._serverParams=e,(e.stderr==="pipe"||e.stderr==="overlapped")&&(this._stderrStream=new nFn)}async start(){if(this._process)throw new Error("StdioClientTransport already started! If using Client class, note that connect() calls start() automatically.");return new Promise((e,r)=>{var n,i,o,s,a;this._process=(0,GFt.default)(this._serverParams.command,(n=this._serverParams.args)!==null&&n!==void 0?n:[],{env:{...oFn(),...this._serverParams.env},stdio:["pipe","pipe",(i=this._serverParams.stderr)!==null&&i!==void 0?i:"inherit"],shell:!1,signal:this._abortController.signal,windowsHide:sme.platform==="win32"&&sFn(),cwd:this._serverParams.cwd}),this._process.on("error",c=>{var u,d;if(c.name==="AbortError"){(u=this.onclose)===null||u===void 0||u.call(this);return}r(c),(d=this.onerror)===null||d===void 0||d.call(this,c)}),this._process.on("spawn",()=>{e()}),this._process.on("close",c=>{var u;this._process=void 0,(u=this.onclose)===null||u===void 0||u.call(this)}),(o=this._process.stdin)===null||o===void 0||o.on("error",c=>{var u;(u=this.onerror)===null||u===void 0||u.call(this,c)}),(s=this._process.stdout)===null||s===void 0||s.on("data",c=>{this._readBuffer.append(c),this.processReadBuffer()}),(a=this._process.stdout)===null||a===void 0||a.on("error",c=>{var u;(u=this.onerror)===null||u===void 0||u.call(this,c)}),this._stderrStream&&this._process.stderr&&this._process.stderr.pipe(this._stderrStream)})}get stderr(){var e,r;return this._stderrStream?this._stderrStream:(r=(e=this._process)===null||e===void 0?void 0:e.stderr)!==null&&r!==void 0?r:null}get pid(){var e,r;return(r=(e=this._process)===null||e===void 0?void 0:e.pid)!==null&&r!==void 0?r:null}processReadBuffer(){for(var e,r;;)try{let n=this._readBuffer.readMessage();if(n===null)break;(e=this.onmessage)===null||e===void 0||e.call(this,n)}catch(n){(r=this.onerror)===null||r===void 0||r.call(this,n)}}async close(){this._abortController.abort(),this._process=void 0,this._readBuffer.clear()}send(e){return new Promise(r=>{var n;if(!(!((n=this._process)===null||n===void 0)&&n.stdin))throw new Error("Not connected");let i=QFt(e);this._process.stdin.write(i)?r():this._process.stdin.once("drain",r)})}}});function HUe(t){}function lme(t){if(typeof t=="function")throw new TypeError("`callbacks` must be an object, got a function instead. Did you mean `{onEvent: fn}`?");let{onEvent:e=HUe,onError:r=HUe,onRetry:n=HUe,onComment:i}=t,o="",s=!0,a,c="",u="";function d(g){let A=s?g.replace(/^\xEF\xBB\xBF/,""):g,[y,E]=aFn(`${o}${A}`);for(let C of y)f(C);o=E,s=!1}function f(g){if(g===""){h();return}if(g.startsWith(":")){i&&i(g.slice(g.startsWith(": ")?2:1));return}let A=g.indexOf(":");if(A!==-1){let y=g.slice(0,A),E=g[A+1]===" "?2:1,C=g.slice(A+E);p(y,C,g);return}p(g,"",g)}function p(g,A,y){switch(g){case"event":u=A;break;case"data":c=`${c}${A}
838
838
  `;break;case"id":a=A.includes("\0")?void 0:A;break;case"retry":/^\d+$/.test(A)?n(parseInt(A,10)):r(new ame(`Invalid \`retry\` value: "${A}"`,{type:"invalid-retry",value:A,line:y}));break;default:r(new ame(`Unknown field "${g.length>20?`${g.slice(0,20)}\u2026`:g}"`,{type:"unknown-field",field:g,value:A,line:y}));break}}function h(){c.length>0&&e({id:a,event:u||void 0,data:c.endsWith(`
839
839
  `)?c.slice(0,-1):c}),a=void 0,c="",u=""}function m(g={}){o&&g.consume&&f(o),s=!0,a=void 0,c="",u="",o=""}return{feed:d,reset:m}}function aFn(t){let e=[],r="",n=0;for(;n<t.length;){let i=t.indexOf("\r",n),o=t.indexOf(`
840
840
  `,n),s=-1;if(i!==-1&&o!==-1?s=Math.min(i,o):i!==-1?i===t.length-1?s=-1:s=i:o!==-1&&(s=o),s===-1){r=t.slice(n);break}else{let a=t.slice(n,s);e.push(a),n=s+1,t[n-1]==="\r"&&t[n]===`
841
- `&&n++}}return[e,r]}var ame,VUe=ae(()=>{ame=class extends Error{constructor(e,r){super(e),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}});function lFn(t){let e=globalThis.DOMException;return typeof e=="function"?new e(t,"SyntaxError"):new SyntaxError(t)}function WUe(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(WUe).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${WUe(t.cause)}`:t.message:`${t}`}function HFt(t){return{type:t.type,message:t.message,code:t.code,defaultPrevented:t.defaultPrevented,cancelable:t.cancelable,timeStamp:t.timeStamp}}function cFn(){let t="document"in globalThis?globalThis.document:void 0;return t&&typeof t=="object"&&"baseURI"in t&&typeof t.baseURI=="string"?t.baseURI:void 0}var ume,WFt,ZUe,ws,Hf,au,Y8,Yg,WD,xU,cme,dme,hX,_U,mX,dS,SU,TU,wU,fX,c4,$Ue,jUe,zUe,VFt,YUe,JUe,pX,KUe,XUe,$D,$Ft=ae(()=>{VUe();ume=class extends Event{constructor(e,r){var n,i;super(e),this.code=(n=r?.code)!=null?n:void 0,this.message=(i=r?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,r,n){return n(HFt(this),r)}[Symbol.for("Deno.customInspect")](e,r){return e(HFt(this),r)}};WFt=t=>{throw TypeError(t)},ZUe=(t,e,r)=>e.has(t)||WFt("Cannot "+r),ws=(t,e,r)=>(ZUe(t,e,"read from private field"),r?r.call(t):e.get(t)),Hf=(t,e,r)=>e.has(t)?WFt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),au=(t,e,r,n)=>(ZUe(t,e,"write to private field"),e.set(t,r),r),Y8=(t,e,r)=>(ZUe(t,e,"access private method"),r),$D=class extends EventTarget{constructor(e,r){var n,i;super(),Hf(this,c4),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Hf(this,Yg),Hf(this,WD),Hf(this,xU),Hf(this,cme),Hf(this,dme),Hf(this,hX),Hf(this,_U),Hf(this,mX,null),Hf(this,dS),Hf(this,SU),Hf(this,TU,null),Hf(this,wU,null),Hf(this,fX,null),Hf(this,jUe,async o=>{var s;ws(this,SU).reset();let{body:a,redirected:c,status:u,headers:d}=o;if(u===204){Y8(this,c4,pX).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(c?au(this,xU,new URL(o.url)):au(this,xU,void 0),u!==200){Y8(this,c4,pX).call(this,`Non-200 status code (${u})`,u);return}if(!(d.get("content-type")||"").startsWith("text/event-stream")){Y8(this,c4,pX).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(ws(this,Yg)===this.CLOSED)return;au(this,Yg,this.OPEN);let f=new Event("open");if((s=ws(this,fX))==null||s.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){Y8(this,c4,pX).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}let p=new TextDecoder,h=a.getReader(),m=!0;do{let{done:g,value:A}=await h.read();A&&ws(this,SU).feed(p.decode(A,{stream:!g})),g&&(m=!1,ws(this,SU).reset(),Y8(this,c4,KUe).call(this))}while(m)}),Hf(this,zUe,o=>{au(this,dS,void 0),!(o.name==="AbortError"||o.type==="aborted")&&Y8(this,c4,KUe).call(this,WUe(o))}),Hf(this,YUe,o=>{typeof o.id=="string"&&au(this,mX,o.id);let s=new MessageEvent(o.event||"message",{data:o.data,origin:ws(this,xU)?ws(this,xU).origin:ws(this,WD).origin,lastEventId:o.id||""});ws(this,wU)&&(!o.event||o.event==="message")&&ws(this,wU).call(this,s),this.dispatchEvent(s)}),Hf(this,JUe,o=>{au(this,hX,o)}),Hf(this,XUe,()=>{au(this,_U,void 0),ws(this,Yg)===this.CONNECTING&&Y8(this,c4,$Ue).call(this)});try{if(e instanceof URL)au(this,WD,e);else if(typeof e=="string")au(this,WD,new URL(e,cFn()));else throw new Error("Invalid URL")}catch{throw lFn("An invalid or illegal string was specified")}au(this,SU,lme({onEvent:ws(this,YUe),onRetry:ws(this,JUe)})),au(this,Yg,this.CONNECTING),au(this,hX,3e3),au(this,dme,(n=r?.fetch)!=null?n:globalThis.fetch),au(this,cme,(i=r?.withCredentials)!=null?i:!1),Y8(this,c4,$Ue).call(this)}get readyState(){return ws(this,Yg)}get url(){return ws(this,WD).href}get withCredentials(){return ws(this,cme)}get onerror(){return ws(this,TU)}set onerror(e){au(this,TU,e)}get onmessage(){return ws(this,wU)}set onmessage(e){au(this,wU,e)}get onopen(){return ws(this,fX)}set onopen(e){au(this,fX,e)}addEventListener(e,r,n){let i=r;super.addEventListener(e,i,n)}removeEventListener(e,r,n){let i=r;super.removeEventListener(e,i,n)}close(){ws(this,_U)&&clearTimeout(ws(this,_U)),ws(this,Yg)!==this.CLOSED&&(ws(this,dS)&&ws(this,dS).abort(),au(this,Yg,this.CLOSED),au(this,dS,void 0))}};Yg=new WeakMap,WD=new WeakMap,xU=new WeakMap,cme=new WeakMap,dme=new WeakMap,hX=new WeakMap,_U=new WeakMap,mX=new WeakMap,dS=new WeakMap,SU=new WeakMap,TU=new WeakMap,wU=new WeakMap,fX=new WeakMap,c4=new WeakSet,$Ue=function(){au(this,Yg,this.CONNECTING),au(this,dS,new AbortController),ws(this,dme)(ws(this,WD),Y8(this,c4,VFt).call(this)).then(ws(this,jUe)).catch(ws(this,zUe))},jUe=new WeakMap,zUe=new WeakMap,VFt=function(){var t;let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...ws(this,mX)?{"Last-Event-ID":ws(this,mX)}:void 0},cache:"no-store",signal:(t=ws(this,dS))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},YUe=new WeakMap,JUe=new WeakMap,pX=function(t,e){var r;ws(this,Yg)!==this.CLOSED&&au(this,Yg,this.CLOSED);let n=new ume("error",{code:e,message:t});(r=ws(this,TU))==null||r.call(this,n),this.dispatchEvent(n)},KUe=function(t,e){var r;if(ws(this,Yg)===this.CLOSED)return;au(this,Yg,this.CONNECTING);let n=new ume("error",{code:e,message:t});(r=ws(this,TU))==null||r.call(this,n),this.dispatchEvent(n),au(this,_U,setTimeout(ws(this,XUe),ws(this,hX)))},XUe=new WeakMap,$D.CONNECTING=0,$D.OPEN=1,$D.CLOSED=2});async function uFn(t){return(await eQe).getRandomValues(new Uint8Array(t))}async function dFn(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r="",n=await uFn(t);for(let i=0;i<t;i++){let o=n[i]%e.length;r+=e[o]}return r}async function fFn(t){return await dFn(t)}async function pFn(t){let e=await(await eQe).subtle.digest("SHA-256",new TextEncoder().encode(t));return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function tQe(t){if(t||(t=43),t<43||t>128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await fFn(t),r=await pFn(e);return{code_verifier:e,code_challenge:r}}var eQe,jFt=ae(()=>{eQe=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(t=>t.webcrypto)});var Dp,zFt,rQe,hFn,YFt,nQe,JFt,mFn,gFn,KFt,wUo,_Uo,iQe=ae(()=>{oS();Dp=te.string().url().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:te.ZodIssueCode.custom,message:"URL must be parseable",fatal:!0}),te.NEVER}).refine(t=>{let e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),zFt=te.object({resource:te.string().url(),authorization_servers:te.array(Dp).optional(),jwks_uri:te.string().url().optional(),scopes_supported:te.array(te.string()).optional(),bearer_methods_supported:te.array(te.string()).optional(),resource_signing_alg_values_supported:te.array(te.string()).optional(),resource_name:te.string().optional(),resource_documentation:te.string().optional(),resource_policy_uri:te.string().url().optional(),resource_tos_uri:te.string().url().optional(),tls_client_certificate_bound_access_tokens:te.boolean().optional(),authorization_details_types_supported:te.array(te.string()).optional(),dpop_signing_alg_values_supported:te.array(te.string()).optional(),dpop_bound_access_tokens_required:te.boolean().optional()}).passthrough(),rQe=te.object({issuer:te.string(),authorization_endpoint:Dp,token_endpoint:Dp,registration_endpoint:Dp.optional(),scopes_supported:te.array(te.string()).optional(),response_types_supported:te.array(te.string()),response_modes_supported:te.array(te.string()).optional(),grant_types_supported:te.array(te.string()).optional(),token_endpoint_auth_methods_supported:te.array(te.string()).optional(),token_endpoint_auth_signing_alg_values_supported:te.array(te.string()).optional(),service_documentation:Dp.optional(),revocation_endpoint:Dp.optional(),revocation_endpoint_auth_methods_supported:te.array(te.string()).optional(),revocation_endpoint_auth_signing_alg_values_supported:te.array(te.string()).optional(),introspection_endpoint:te.string().optional(),introspection_endpoint_auth_methods_supported:te.array(te.string()).optional(),introspection_endpoint_auth_signing_alg_values_supported:te.array(te.string()).optional(),code_challenge_methods_supported:te.array(te.string()).optional()}).passthrough(),hFn=te.object({issuer:te.string(),authorization_endpoint:Dp,token_endpoint:Dp,userinfo_endpoint:Dp.optional(),jwks_uri:Dp,registration_endpoint:Dp.optional(),scopes_supported:te.array(te.string()).optional(),response_types_supported:te.array(te.string()),response_modes_supported:te.array(te.string()).optional(),grant_types_supported:te.array(te.string()).optional(),acr_values_supported:te.array(te.string()).optional(),subject_types_supported:te.array(te.string()),id_token_signing_alg_values_supported:te.array(te.string()),id_token_encryption_alg_values_supported:te.array(te.string()).optional(),id_token_encryption_enc_values_supported:te.array(te.string()).optional(),userinfo_signing_alg_values_supported:te.array(te.string()).optional(),userinfo_encryption_alg_values_supported:te.array(te.string()).optional(),userinfo_encryption_enc_values_supported:te.array(te.string()).optional(),request_object_signing_alg_values_supported:te.array(te.string()).optional(),request_object_encryption_alg_values_supported:te.array(te.string()).optional(),request_object_encryption_enc_values_supported:te.array(te.string()).optional(),token_endpoint_auth_methods_supported:te.array(te.string()).optional(),token_endpoint_auth_signing_alg_values_supported:te.array(te.string()).optional(),display_values_supported:te.array(te.string()).optional(),claim_types_supported:te.array(te.string()).optional(),claims_supported:te.array(te.string()).optional(),service_documentation:te.string().optional(),claims_locales_supported:te.array(te.string()).optional(),ui_locales_supported:te.array(te.string()).optional(),claims_parameter_supported:te.boolean().optional(),request_parameter_supported:te.boolean().optional(),request_uri_parameter_supported:te.boolean().optional(),require_request_uri_registration:te.boolean().optional(),op_policy_uri:Dp.optional(),op_tos_uri:Dp.optional()}).passthrough(),YFt=hFn.merge(rQe.pick({code_challenge_methods_supported:!0})),nQe=te.object({access_token:te.string(),id_token:te.string().optional(),token_type:te.string(),expires_in:te.number().optional(),scope:te.string().optional(),refresh_token:te.string().optional()}).strip(),JFt=te.object({error:te.string(),error_description:te.string().optional(),error_uri:te.string().optional()}),mFn=te.object({redirect_uris:te.array(Dp),token_endpoint_auth_method:te.string().optional(),grant_types:te.array(te.string()).optional(),response_types:te.array(te.string()).optional(),client_name:te.string().optional(),client_uri:Dp.optional(),logo_uri:Dp.optional(),scope:te.string().optional(),contacts:te.array(te.string()).optional(),tos_uri:Dp.optional(),policy_uri:te.string().optional(),jwks_uri:Dp.optional(),jwks:te.any().optional(),software_id:te.string().optional(),software_version:te.string().optional(),software_statement:te.string().optional()}).strip(),gFn=te.object({client_id:te.string(),client_secret:te.string().optional(),client_id_issued_at:te.number().optional(),client_secret_expires_at:te.number().optional()}).strip(),KFt=mFn.merge(gFn),wUo=te.object({error:te.string(),error_description:te.string().optional()}).strip(),_Uo=te.object({token:te.string(),token_type_hint:te.string().optional()}).strip()});function XFt(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}function ZFt({requestedResource:t,configuredResource:e}){let r=typeof t=="string"?new URL(t):new URL(t.href),n=typeof e=="string"?new URL(e):new URL(e.href);if(r.origin!==n.origin||r.pathname.length<n.pathname.length)return!1;let i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",o=n.pathname.endsWith("/")?n.pathname:n.pathname+"/";return i.startsWith(o)}var eUt=ae(()=>{});var lf,gX,jD,zD,YD,AX,yX,EX,J8,vX,CX,bX,xX,SX,wX,_X,TX,tUt,rUt=ae(()=>{lf=class extends Error{constructor(e,r){super(e),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){let e={error:this.errorCode,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}get errorCode(){return this.constructor.errorCode}},gX=class extends lf{};gX.errorCode="invalid_request";jD=class extends lf{};jD.errorCode="invalid_client";zD=class extends lf{};zD.errorCode="invalid_grant";YD=class extends lf{};YD.errorCode="unauthorized_client";AX=class extends lf{};AX.errorCode="unsupported_grant_type";yX=class extends lf{};yX.errorCode="invalid_scope";EX=class extends lf{};EX.errorCode="access_denied";J8=class extends lf{};J8.errorCode="server_error";vX=class extends lf{};vX.errorCode="temporarily_unavailable";CX=class extends lf{};CX.errorCode="unsupported_response_type";bX=class extends lf{};bX.errorCode="unsupported_token_type";xX=class extends lf{};xX.errorCode="invalid_token";SX=class extends lf{};SX.errorCode="method_not_allowed";wX=class extends lf{};wX.errorCode="too_many_requests";_X=class extends lf{};_X.errorCode="invalid_client_metadata";TX=class extends lf{};TX.errorCode="insufficient_scope";tUt={[gX.errorCode]:gX,[jD.errorCode]:jD,[zD.errorCode]:zD,[YD.errorCode]:YD,[AX.errorCode]:AX,[yX.errorCode]:yX,[EX.errorCode]:EX,[J8.errorCode]:J8,[vX.errorCode]:vX,[CX.errorCode]:CX,[bX.errorCode]:bX,[xX.errorCode]:xX,[SX.errorCode]:SX,[wX.errorCode]:wX,[_X.errorCode]:_X,[TX.errorCode]:TX}});function iUt(t,e){let r=t.client_secret!==void 0;return e.length===0?r?"client_secret_post":"none":r&&e.includes("client_secret_basic")?"client_secret_basic":r&&e.includes("client_secret_post")?"client_secret_post":e.includes("none")?"none":r?"client_secret_post":"none"}function oUt(t,e,r,n){let{client_id:i,client_secret:o}=e;switch(t){case"client_secret_basic":AFn(i,o,r);return;case"client_secret_post":yFn(i,o,n);return;case"none":EFn(i,n);return;default:throw new Error(`Unsupported client authentication method: ${t}`)}}function AFn(t,e,r){if(!e)throw new Error("client_secret_basic authentication requires a client_secret");let n=btoa(`${t}:${e}`);r.set("Authorization",`Basic ${n}`)}function yFn(t,e,r){r.set("client_id",t),e&&r.set("client_secret",e)}function EFn(t,e){e.set("client_id",t)}async function sQe(t){let e=t instanceof Response?t.status:void 0,r=t instanceof Response?await t.text():t;try{let n=JFt.parse(JSON.parse(r)),{error:i,error_description:o,error_uri:s}=n,a=tUt[i]||J8;return new a(o||"",s)}catch(n){let i=`${e?`HTTP ${e}: `:""}Invalid OAuth error response: ${n}. Raw body: ${r}`;return new J8(i)}}async function fS(t,e){var r,n;try{return await oQe(t,e)}catch(i){if(i instanceof jD||i instanceof YD)return await((r=t.invalidateCredentials)===null||r===void 0?void 0:r.call(t,"all")),await oQe(t,e);if(i instanceof zD)return await((n=t.invalidateCredentials)===null||n===void 0?void 0:n.call(t,"tokens")),await oQe(t,e);throw i}}async function oQe(t,{serverUrl:e,authorizationCode:r,scope:n,resourceMetadataUrl:i,fetchFn:o}){let s,a;try{s=await CFn(e,{resourceMetadataUrl:i},o),s.authorization_servers&&s.authorization_servers.length>0&&(a=s.authorization_servers[0])}catch{}a||(a=e);let c=await vFn(e,t,s),u=await _Fn(a,{fetchFn:o}),d=await Promise.resolve(t.clientInformation());if(!d){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");if(!t.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");let g=await IFn(a,{metadata:u,clientMetadata:t.clientMetadata,fetchFn:o});await t.saveClientInformation(g),d=g}if(r!==void 0){let g=await t.codeVerifier(),A=await lQe(a,{metadata:u,clientInformation:d,authorizationCode:r,codeVerifier:g,redirectUri:t.redirectUrl,resource:c,addClientAuthentication:t.addClientAuthentication,fetchFn:o});return await t.saveTokens(A),"AUTHORIZED"}let f=await t.tokens();if(f?.refresh_token)try{let g=await cQe(a,{metadata:u,clientInformation:d,refreshToken:f.refresh_token,resource:c,addClientAuthentication:t.addClientAuthentication,fetchFn:o});return await t.saveTokens(g),"AUTHORIZED"}catch(g){if(!(!(g instanceof lf)||g instanceof J8))throw g}let p=t.state?await t.state():void 0,{authorizationUrl:h,codeVerifier:m}=await TFn(a,{metadata:u,clientInformation:d,state:p,redirectUrl:t.redirectUrl,scope:n||t.clientMetadata.scope,resource:c});return await t.saveCodeVerifier(m),await t.redirectToAuthorization(h),"REDIRECT"}async function vFn(t,e,r){let n=XFt(t);if(e.validateResourceURL)return await e.validateResourceURL(n,r?.resource);if(r){if(!ZFt({requestedResource:n,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${n} (or origin)`);return new URL(r.resource)}}function IX(t){let e=t.headers.get("WWW-Authenticate");if(!e)return;let[r,n]=e.split(" ");if(r.toLowerCase()!=="bearer"||!n)return;let o=/resource_metadata="([^"]*)"/.exec(e);if(o)try{return new URL(o[1])}catch{return}}async function CFn(t,e,r=fetch){let n=await SFn(t,"oauth-protected-resource",r,{protocolVersion:e?.protocolVersion,metadataUrl:e?.resourceMetadataUrl});if(!n||n.status===404)throw new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!n.ok)throw new Error(`HTTP ${n.status} trying to load well-known OAuth protected resource metadata.`);return zFt.parse(await n.json())}async function aQe(t,e,r=fetch){try{return await r(t,{headers:e})}catch(n){if(n instanceof TypeError)return e?aQe(t,void 0,r):void 0;throw n}}function bFn(t,e="",r={}){return e.endsWith("/")&&(e=e.slice(0,-1)),r.prependPathname?`${e}/.well-known/${t}`:`/.well-known/${t}${e}`}async function nUt(t,e,r=fetch){return await aQe(t,{"MCP-Protocol-Version":e},r)}function xFn(t,e){return!t||t.status>=400&&t.status<500&&e!=="/"}async function SFn(t,e,r,n){var i,o;let s=new URL(t),a=(i=n?.protocolVersion)!==null&&i!==void 0?i:AU,c;if(n?.metadataUrl)c=new URL(n.metadataUrl);else{let d=bFn(e,s.pathname);c=new URL(d,(o=n?.metadataServerUrl)!==null&&o!==void 0?o:s),c.search=s.search}let u=await nUt(c,a,r);if(!n?.metadataUrl&&xFn(u,s.pathname)){let d=new URL(`/.well-known/${e}`,s);u=await nUt(d,a,r)}return u}function wFn(t){let e=typeof t=="string"?new URL(t):t,r=e.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",e.origin),type:"oidc"}),n;let i=e.pathname;return i.endsWith("/")&&(i=i.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${i}`,e.origin),type:"oauth"}),n.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${i}`,e.origin),type:"oidc"}),n.push({url:new URL(`${i}/.well-known/openid-configuration`,e.origin),type:"oidc"}),n}async function _Fn(t,{fetchFn:e=fetch,protocolVersion:r=AU}={}){var n;let i={"MCP-Protocol-Version":r},o=wFn(t);for(let{url:s,type:a}of o){let c=await aQe(s,i,e);if(c){if(!c.ok){if(c.status>=400&&c.status<500)continue;throw new Error(`HTTP ${c.status} trying to load ${a==="oauth"?"OAuth":"OpenID provider"} metadata from ${s}`)}if(a==="oauth")return rQe.parse(await c.json());{let u=YFt.parse(await c.json());if(!(!((n=u.code_challenge_methods_supported)===null||n===void 0)&&n.includes("S256")))throw new Error(`Incompatible OIDC provider at ${s}: does not support S256 code challenge method required by MCP specification`);return u}}}}async function TFn(t,{metadata:e,clientInformation:r,redirectUrl:n,scope:i,state:o,resource:s}){let a="code",c="S256",u;if(e){if(u=new URL(e.authorization_endpoint),!e.response_types_supported.includes(a))throw new Error(`Incompatible auth server: does not support response type ${a}`);if(!e.code_challenge_methods_supported||!e.code_challenge_methods_supported.includes(c))throw new Error(`Incompatible auth server: does not support code challenge method ${c}`)}else u=new URL("/authorize",t);let d=await tQe(),f=d.code_verifier,p=d.code_challenge;return u.searchParams.set("response_type",a),u.searchParams.set("client_id",r.client_id),u.searchParams.set("code_challenge",p),u.searchParams.set("code_challenge_method",c),u.searchParams.set("redirect_uri",String(n)),o&&u.searchParams.set("state",o),i&&u.searchParams.set("scope",i),i?.includes("offline_access")&&u.searchParams.append("prompt","consent"),s&&u.searchParams.set("resource",s.href),{authorizationUrl:u,codeVerifier:f}}async function lQe(t,{metadata:e,clientInformation:r,authorizationCode:n,codeVerifier:i,redirectUri:o,resource:s,addClientAuthentication:a,fetchFn:c}){var u;let d="authorization_code",f=e?.token_endpoint?new URL(e.token_endpoint):new URL("/token",t);if(e?.grant_types_supported&&!e.grant_types_supported.includes(d))throw new Error(`Incompatible auth server: does not support grant type ${d}`);let p=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}),h=new URLSearchParams({grant_type:d,code:n,code_verifier:i,redirect_uri:String(o)});if(a)a(p,h,t,e);else{let g=(u=e?.token_endpoint_auth_methods_supported)!==null&&u!==void 0?u:[],A=iUt(r,g);oUt(A,r,p,h)}s&&h.set("resource",s.href);let m=await(c??fetch)(f,{method:"POST",headers:p,body:h});if(!m.ok)throw await sQe(m);return nQe.parse(await m.json())}async function cQe(t,{metadata:e,clientInformation:r,refreshToken:n,resource:i,addClientAuthentication:o,fetchFn:s}){var a;let c="refresh_token",u;if(e){if(u=new URL(e.token_endpoint),e.grant_types_supported&&!e.grant_types_supported.includes(c))throw new Error(`Incompatible auth server: does not support grant type ${c}`)}else u=new URL("/token",t);let d=new Headers({"Content-Type":"application/x-www-form-urlencoded"}),f=new URLSearchParams({grant_type:c,refresh_token:n});if(o)o(d,f,t,e);else{let h=(a=e?.token_endpoint_auth_methods_supported)!==null&&a!==void 0?a:[],m=iUt(r,h);oUt(m,r,d,f)}i&&f.set("resource",i.href);let p=await(s??fetch)(u,{method:"POST",headers:d,body:f});if(!p.ok)throw await sQe(p);return nQe.parse({refresh_token:n,...await p.json()})}async function IFn(t,{metadata:e,clientMetadata:r,fetchFn:n}){let i;if(e){if(!e.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(e.registration_endpoint)}else i=new URL("/register",t);let o=await(n??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok)throw await sQe(o);return KFt.parse(await o.json())}var Jg,fme=ae(()=>{jFt();aS();iQe();iQe();eUt();rUt();Jg=class extends Error{constructor(e){super(e??"Unauthorized")}}});var uQe,IU,sUt=ae(()=>{$Ft();aS();fme();uQe=class extends Error{constructor(e,r,n){super(`SSE error: ${r}`),this.code=e,this.event=n}},IU=class{constructor(e,r){this._url=e,this._resourceMetadataUrl=void 0,this._eventSourceInit=r?.eventSourceInit,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch}async _authThenStart(){var e;if(!this._authProvider)throw new Jg("No auth provider");let r;try{r=await fS(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})}catch(n){throw(e=this.onerror)===null||e===void 0||e.call(this,n),n}if(r!=="AUTHORIZED")throw new Jg;return await this._startOrAuth()}async _commonHeaders(){var e;let r={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(r.Authorization=`Bearer ${n.access_token}`)}return this._protocolVersion&&(r["mcp-protocol-version"]=this._protocolVersion),new Headers({...r,...(e=this._requestInit)===null||e===void 0?void 0:e.headers})}_startOrAuth(){var e,r,n;let i=(n=(r=(e=this===null||this===void 0?void 0:this._eventSourceInit)===null||e===void 0?void 0:e.fetch)!==null&&r!==void 0?r:this._fetch)!==null&&n!==void 0?n:fetch;return new Promise((o,s)=>{this._eventSource=new $D(this._url.href,{...this._eventSourceInit,fetch:async(a,c)=>{let u=await this._commonHeaders();u.set("Accept","text/event-stream");let d=await i(a,{...c,headers:u});return d.status===401&&d.headers.has("www-authenticate")&&(this._resourceMetadataUrl=IX(d)),d}}),this._abortController=new AbortController,this._eventSource.onerror=a=>{var c;if(a.code===401&&this._authProvider){this._authThenStart().then(o,s);return}let u=new uQe(a.code,a.message,a);s(u),(c=this.onerror)===null||c===void 0||c.call(this,u)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",a=>{var c;let u=a;try{if(this._endpoint=new URL(u.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(d){s(d),(c=this.onerror)===null||c===void 0||c.call(this,d),this.close();return}o()}),this._eventSource.onmessage=a=>{var c,u;let d=a,f;try{f=sS.parse(JSON.parse(d.data))}catch(p){(c=this.onerror)===null||c===void 0||c.call(this,p);return}(u=this.onmessage)===null||u===void 0||u.call(this,f)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(e){if(!this._authProvider)throw new Jg("No auth provider");if(await fS(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Jg("Failed to authorize")}async close(){var e,r,n;(e=this._abortController)===null||e===void 0||e.abort(),(r=this._eventSource)===null||r===void 0||r.close(),(n=this.onclose)===null||n===void 0||n.call(this)}async send(e){var r,n,i;if(!this._endpoint)throw new Error("Not connected");try{let o=await this._commonHeaders();o.set("content-type","application/json");let s={...this._requestInit,method:"POST",headers:o,body:JSON.stringify(e),signal:(r=this._abortController)===null||r===void 0?void 0:r.signal},a=await((n=this._fetch)!==null&&n!==void 0?n:fetch)(this._endpoint,s);if(!a.ok){if(a.status===401&&this._authProvider){if(this._resourceMetadataUrl=IX(a),await fS(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Jg;return this.send(e)}let c=await a.text().catch(()=>null);throw new Error(`Error POSTing to endpoint (HTTP ${a.status}): ${c}`)}}catch(o){throw(i=this.onerror)===null||i===void 0||i.call(this,o),o}}setProtocolVersion(e){this._protocolVersion=e}}});var pme,aUt=ae(()=>{VUe();pme=class extends TransformStream{constructor({onError:e,onRetry:r,onComment:n}={}){let i;super({start(o){i=lme({onEvent:s=>{o.enqueue(s)},onError(s){e==="terminate"?o.error(s):typeof e=="function"&&e(s)},onRetry:r,onComment:n})},transform(o){i.feed(o)}})}}});var DFn,DX,pS,dQe=ae(()=>{aS();fme();aUt();DFn={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},DX=class extends Error{constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},pS=class{constructor(e,r){var n;this._url=e,this._resourceMetadataUrl=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._sessionId=r?.sessionId,this._reconnectionOptions=(n=r?.reconnectionOptions)!==null&&n!==void 0?n:DFn}async _authThenStart(){var e;if(!this._authProvider)throw new Jg("No auth provider");let r;try{r=await fS(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})}catch(n){throw(e=this.onerror)===null||e===void 0||e.call(this,n),n}if(r!=="AUTHORIZED")throw new Jg;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){var e;let r={};if(this._authProvider){let i=await this._authProvider.tokens();i&&(r.Authorization=`Bearer ${i.access_token}`)}this._sessionId&&(r["mcp-session-id"]=this._sessionId),this._protocolVersion&&(r["mcp-protocol-version"]=this._protocolVersion);let n=this._normalizeHeaders((e=this._requestInit)===null||e===void 0?void 0:e.headers);return new Headers({...r,...n})}async _startOrAuthSse(e){var r,n,i;let{resumptionToken:o}=e;try{let s=await this._commonHeaders();s.set("Accept","text/event-stream"),o&&s.set("last-event-id",o);let a=await((r=this._fetch)!==null&&r!==void 0?r:fetch)(this._url,{method:"GET",headers:s,signal:(n=this._abortController)===null||n===void 0?void 0:n.signal});if(!a.ok){if(a.status===401&&this._authProvider)return await this._authThenStart();if(a.status===405)return;throw new DX(a.status,`Failed to open SSE stream: ${a.statusText}`)}this._handleSseStream(a.body,e,!0)}catch(s){throw(i=this.onerror)===null||i===void 0||i.call(this,s),s}}_getNextReconnectionDelay(e){let r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,i=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,e),i)}_normalizeHeaders(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}_scheduleReconnection(e,r=0){var n;let i=this._reconnectionOptions.maxRetries;if(i>0&&r>=i){(n=this.onerror)===null||n===void 0||n.call(this,new Error(`Maximum reconnection attempts (${i}) exceeded.`));return}let o=this._getNextReconnectionDelay(r);setTimeout(()=>{this._startOrAuthSse(e).catch(s=>{var a;(a=this.onerror)===null||a===void 0||a.call(this,new Error(`Failed to reconnect SSE stream: ${s instanceof Error?s.message:String(s)}`)),this._scheduleReconnection(e,r+1)})},o)}_handleSseStream(e,r,n){if(!e)return;let{onresumptiontoken:i,replayMessageId:o}=r,s;(async()=>{var c,u,d,f;try{let p=e.pipeThrough(new TextDecoderStream).pipeThrough(new pme).getReader();for(;;){let{value:h,done:m}=await p.read();if(m)break;if(h.id&&(s=h.id,i?.(h.id)),!h.event||h.event==="message")try{let g=sS.parse(JSON.parse(h.data));o!==void 0&&aX(g)&&(g.id=o),(c=this.onmessage)===null||c===void 0||c.call(this,g)}catch(g){(u=this.onerror)===null||u===void 0||u.call(this,g)}}}catch(p){if((d=this.onerror)===null||d===void 0||d.call(this,new Error(`SSE stream disconnected: ${p}`)),n&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:i,replayMessageId:o},0)}catch(h){(f=this.onerror)===null||f===void 0||f.call(this,new Error(`Failed to reconnect: ${h instanceof Error?h.message:String(h)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new Jg("No auth provider");if(await fS(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Jg("Failed to authorize")}async close(){var e,r;(e=this._abortController)===null||e===void 0||e.abort(),(r=this.onclose)===null||r===void 0||r.call(this)}async send(e,r){var n,i,o,s;try{let{resumptionToken:a,onresumptiontoken:c}=r||{};if(a){this._startOrAuthSse({resumptionToken:a,replayMessageId:N0e(e)?e.id:void 0}).catch(A=>{var y;return(y=this.onerror)===null||y===void 0?void 0:y.call(this,A)});return}let u=await this._commonHeaders();u.set("content-type","application/json"),u.set("accept","application/json, text/event-stream");let d={...this._requestInit,method:"POST",headers:u,body:JSON.stringify(e),signal:(n=this._abortController)===null||n===void 0?void 0:n.signal},f=await((i=this._fetch)!==null&&i!==void 0?i:fetch)(this._url,d),p=f.headers.get("mcp-session-id");if(p&&(this._sessionId=p),!f.ok){if(f.status===401&&this._authProvider){if(this._resourceMetadataUrl=IX(f),await fS(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Jg;return this.send(e)}let A=await f.text().catch(()=>null);throw new Error(`Error POSTing to endpoint (HTTP ${f.status}): ${A}`)}if(f.status===202){qMt(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(A=>{var y;return(y=this.onerror)===null||y===void 0?void 0:y.call(this,A)});return}let m=(Array.isArray(e)?e:[e]).filter(A=>"method"in A&&"id"in A&&A.id!==void 0).length>0,g=f.headers.get("content-type");if(m)if(g?.includes("text/event-stream"))this._handleSseStream(f.body,{onresumptiontoken:c},!1);else if(g?.includes("application/json")){let A=await f.json(),y=Array.isArray(A)?A.map(E=>sS.parse(E)):[sS.parse(A)];for(let E of y)(o=this.onmessage)===null||o===void 0||o.call(this,E)}else throw new DX(-1,`Unexpected content type: ${g}`)}catch(a){throw(s=this.onerror)===null||s===void 0||s.call(this,a),a}}get sessionId(){return this._sessionId}async terminateSession(){var e,r,n;if(this._sessionId)try{let i=await this._commonHeaders(),o={...this._requestInit,method:"DELETE",headers:i,signal:(e=this._abortController)===null||e===void 0?void 0:e.signal},s=await((r=this._fetch)!==null&&r!==void 0?r:fetch)(this._url,o);if(!s.ok&&s.status!==405)throw new DX(s.status,`Failed to terminate session: ${s.statusText}`);this._sessionId=void 0}catch(i){throw(n=this.onerror)===null||n===void 0||n.call(this,i),i}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}}});import{readFile as RFn}from"node:fs/promises";var RX,BX,JD,fQe=ae(()=>{"use strict";bL();fme();qn();(function(t){t.CLI_CONNECT="cli_connect",t.PING="ping",t.GET_ACTIVE_FILE="get_active_file",t.GET_FILE_CONTENT="get_file_content",t.GET_SELECTED_TEXT="get_selected_text",t.SHOW_DIFF="show_diff"})(RX||(RX={}));BX=class extends Error{code;constructor(e,r){super(r),this.code=e}},JD=class{_websocket;_url;_authProvider;_websocketOptions;_WebSocket;_protocolVersion;_isClosed=!1;_specialIds=new Set;onclose;onerror;onmessage;sessionId;constructor(e,r){this._url=e,this._authProvider=r?.authProvider,this._websocketOptions=r?.websocketOptions,this._WebSocket=r?.WebSocket||v8.default}async start(){if(this._isClosed)throw new Error(M.t("websocketClient.errors.transportClosed"));let e=null;if(this._authProvider)try{let i=await this._authProvider.tokens();i?.access_token&&(e=i.access_token)}catch(i){try{let o=await this._authProvider.clientInformation();if(o){let s=await this._authProvider.tokens();if(s?.refresh_token){let a=await cQe(this._url,{clientInformation:o,refreshToken:s.refresh_token,addClientAuthentication:this._authProvider.addClientAuthentication});await this._authProvider.saveTokens(a),a?.access_token&&(e=a.access_token)}}}catch{if(this._authProvider.redirectToAuthorization){let s=this._authProvider.redirectUrl;throw await this._authProvider.redirectToAuthorization(typeof s=="string"?new URL(s):s),new Error(M.t("websocketClient.errors.unauthorizedOAuth"))}throw i}}let r={...this._websocketOptions?.headers};e&&(r.Authorization=`Bearer ${e}`),this._protocolVersion&&(r["MCP-Protocol-Version"]=this._protocolVersion);let n=new URL(this._url.toString());return n.protocol==="http:"?n.protocol="ws:":n.protocol==="https:"&&(n.protocol="wss:"),new Promise((i,o)=>{try{let s={headers:r};this._websocket=new this._WebSocket(n.toString(),s),this._websocket.on("open",()=>{i()}),this._websocket.on("error",a=>{let c=a.code!==void 0?a.code:void 0;o(new BX(c,`WebSocket error: ${a.message}`))}),this._websocket.on("message",async a=>{try{let c=a.toString(),u=JSON.parse(c);if(this._specialIds.has(Number(u.id))||u.type==="welcome")return;this.onmessage?.(await this._transformResponse(u))}catch(c){this.onerror?.(new Error(`Failed to parse WebSocket message: ${c instanceof Error?c.message:String(c)}`))}}),this._websocket.on("close",()=>{this._isClosed||(this._isClosed=!0,this.onclose?.())})}catch(s){o(new BX(void 0,`Failed to create WebSocket: ${s}`))}})}async finishAuth(e){if(!this._authProvider)throw new Error(M.t("websocketClient.errors.noAuthProvider"));try{let r=await this._authProvider.clientInformation();if(r){let n=this._authProvider.redirectUrl.toString(),i=await lQe(this._url,{clientInformation:r,authorizationCode:e,codeVerifier:await this._authProvider.codeVerifier(),redirectUri:n,addClientAuthentication:this._authProvider.addClientAuthentication});await this._authProvider.saveTokens(i)}else throw new Error(M.t("websocketClient.errors.clientInfoNotAvailable"))}catch(r){throw new Error(`Failed to exchange authorization code for access token: ${r}`)}}async close(){this._isClosed=!0,this._websocket&&this._websocket.readyState===v8.default.OPEN?this._websocket.close():this.onclose?.()}async send(e){if(this._isClosed)throw new Error(M.t("websocketClient.errors.transportClosed"));if(!this._websocket)throw new Error(M.t("websocketClient.errors.transportNotStarted"));if(this._websocket.readyState!==v8.default.OPEN)throw new Error(M.t("websocketClient.errors.websocketNotOpen"));try{if(e.method==="notifications/initialized")return;let r=await this._transformRequest(e),n=JSON.stringify(r);this._websocket.send(n)}catch(r){throw new BX(void 0,`Failed to send message: ${r instanceof Error?r.message:String(r)}`)}}async _transformRequest(e){if(e.method==="initialize")return{type:RX.CLI_CONNECT,id:e.id,timestamp:Date.now(),payload:{clientInfo:{version:"0.2.36",platform:process.platform,workingDirectory:process.cwd()}}};if(e.method==="tools/call"&&e.params?.name==="openDiff"){let{arguments:r}=e.params||{},{filePath:n,newContent:i}=r||{};return{type:RX.SHOW_DIFF,id:e.id,timestamp:Date.now(),payload:{originalText:await RFn(n,"utf8"),modifiedText:i}}}return e}async _transformResponse(e){if(e.type==="connection_ack")return{jsonrpc:"2.0",id:e.id,result:{protocolVersion:"2024-11-05",capabilities:{logging:{},prompts:{},resources:{},tools:{}},serverInfo:{name:"JetBrains Plugin Server",title:"JetBrains Plugin Server",version:"1.0.0"}}};if(e.type==="selection_changed"){let r=await this._getSelectedText();return{jsonrpc:"2.0",method:"ide/contextUpdate",params:{workspaceState:{openFiles:[{path:e.payload.fileName,timestamp:Date.now(),isActive:!0,selectedText:r}]}}}}return e.type==="active_file_changed"?{jsonrpc:"2.0",method:"ide/contextUpdate",params:{workspaceState:{openFiles:[{path:e.payload.fileName,timestamp:Date.now(),isActive:!0}]}}}:e}async _getSelectedText(){if(!this._websocket)return"";let e=performance.now();return this._specialIds.add(e),this._websocket.send(JSON.stringify({type:RX.GET_SELECTED_TEXT,id:e,timestamp:Date.now()})),new Promise((r,n)=>{this._websocket.once("message",i=>{try{let o=JSON.parse(i.toString());Number(o.id)===e&&(this._specialIds.delete(e),o.payload.success?r(o.payload.data.text):n(o.payload.error))}catch{r("")}})})}setProtocolVersion(e){this._protocolVersion=e}}});var lUt,hme,cUt=ae(()=>{"use strict";lUt=Fe(pK(),1);qn();hme=class{config;auth;redirectUrl="";clientMetadata={client_name:"iFlow CLI (Google ADC)",redirect_uris:[],grant_types:[],response_types:[],token_endpoint_auth_method:"none"};_clientInformation;constructor(e){this.config=e;let r=this.config?.oauth?.scopes;if(!r||r.length===0)throw new Error(M.t("mcp.auth.scopesRequired"));this.auth=new lUt.GoogleAuth({scopes:r})}clientInformation(){return this._clientInformation}saveClientInformation(e){this._clientInformation=e}async tokens(){let r=await(await this.auth.getClient()).getAccessToken();if(!r.token){console.error(M.t("mcp.auth.failedToGetAccessToken"));return}return{access_token:r.token,token_type:"Bearer"}}saveTokens(e){}redirectToAuthorization(e){}saveCodeVerifier(e){}codeVerifier(){return""}}});import{execFile as BFn}from"node:child_process";import{promisify as NFn}from"node:util";import{platform as OFn}from"node:os";import{URL as kFn}from"node:url";function MFn(t){let e;try{e=new kFn(t)}catch{throw new Error(`Invalid URL: ${t}`)}if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error(`Unsafe protocol: ${e.protocol}. Only HTTP and HTTPS are allowed.`);if(/[\r\n\x00-\x1f]/.test(t))throw new Error("URL contains invalid characters")}async function dUt(t){MFn(t);let e=OFn(),r,n;switch(e){case"darwin":r="open",n=[t];break;case"win32":r="powershell.exe",n=["-NoProfile","-NonInteractive","-WindowStyle","Hidden","-Command",`Start-Process '${t.replace(/'/g,"''")}'`];break;case"linux":case"freebsd":case"openbsd":r="xdg-open",n=[t];break;default:throw new Error(`Unsupported platform: ${e}`)}let i={env:{...process.env,SHELL:void 0},detached:!0,stdio:"ignore"};try{await uUt(r,n,i)}catch(o){if((e==="linux"||e==="freebsd"||e==="openbsd")&&r==="xdg-open"){let s=["gnome-open","kde-open","firefox","chromium","google-chrome"];for(let a of s)try{await uUt(a,[t],i);return}catch{continue}}throw new Error(`Failed to open browser: ${o instanceof Error?o.message:"Unknown error"}`)}}var uUt,fUt=ae(()=>{"use strict";uUt=NFn(BFn)});function cs(t){return t instanceof Error&&"code"in t}function or(t){if(t instanceof Error)return t.message;try{return String(t)}catch{return"Failed to get error details"}}function pQe(t){if(t&&typeof t=="object"&&"response"in t){let r=PFn(t);if(r.error&&r.error.message&&r.error.code)switch(r.error.code){case 400:return new gme(r.error.message);case 401:return new hS(r.error.message);case 403:return new mme(r.error.message);default:}}return t}function PFn(t){return typeof t.response?.data=="string"?JSON.parse(t.response?.data):t.response?.data}var mme,hS,gme,lu=ae(()=>{"use strict";mme=class extends Error{},hS=class extends Error{},gme=class extends Error{}});import{promises as DU}from"node:fs";import*as Ame from"node:path";import*as pUt from"node:os";var Rp,yme=ae(()=>{"use strict";lu();qn();Rp=class{static TOKEN_FILE="mcp-oauth-tokens.json";static CONFIG_DIR=".iflow";static getTokenFilePath(){let e=pUt.homedir();return Ame.join(e,this.CONFIG_DIR,this.TOKEN_FILE)}static async ensureConfigDir(){let e=Ame.dirname(this.getTokenFilePath());await DU.mkdir(e,{recursive:!0})}static async loadTokens(){let e=new Map;try{let r=this.getTokenFilePath(),n=await DU.readFile(r,"utf-8"),i=JSON.parse(n);for(let o of i)e.set(o.serverName,o)}catch(r){r.code!=="ENOENT"&&console.error(M.t("mcp.tokenStorage.errors.failedToLoadTokens",{error:or(r)}))}return e}static async saveToken(e,r,n,i,o){await this.ensureConfigDir();let s=await this.loadTokens(),a={serverName:e,token:r,clientId:n,tokenUrl:i,mcpServerUrl:o,updatedAt:Date.now()};s.set(e,a);let c=Array.from(s.values()),u=this.getTokenFilePath();try{await DU.writeFile(u,JSON.stringify(c,null,2),{mode:384})}catch(d){throw console.error(M.t("mcp.tokenStorage.errors.failedToSaveToken",{error:or(d)})),d}}static async getToken(e){return(await this.loadTokens()).get(e)||null}static async removeToken(e){let r=await this.loadTokens();if(r.delete(e)){let n=Array.from(r.values()),i=this.getTokenFilePath();try{n.length===0?await DU.unlink(i):await DU.writeFile(i,JSON.stringify(n,null,2),{mode:384})}catch(o){console.error(M.t("mcp.tokenStorage.errors.failedToRemoveToken",{error:or(o)}))}}}static isTokenExpired(e){if(!e.expiresAt)return!1;let r=300*1e3;return Date.now()+r>=e.expiresAt}static async clearAllTokens(){try{let e=this.getTokenFilePath();await DU.unlink(e)}catch(e){e.code!=="ENOENT"&&console.error(M.t("mcp.tokenStorage.errors.failedToClearTokens",{error:or(e)}))}}}});var Bp,Eme=ae(()=>{"use strict";lu();qn();Bp=class{static buildWellKnownUrls(e){let r=new URL(e),n=`${r.protocol}//${r.host}`;return{protectedResource:new URL("/.well-known/oauth-protected-resource",n).toString(),authorizationServer:new URL("/.well-known/oauth-authorization-server",n).toString()}}static async fetchProtectedResourceMetadata(e){try{let r=await fetch(e);return r.ok?await r.json():null}catch(r){return console.debug(`Failed to fetch protected resource metadata from ${e}: ${or(r)}`),null}}static async fetchAuthorizationServerMetadata(e){try{let r=await fetch(e);return r.ok?await r.json():null}catch(r){return console.debug(`Failed to fetch authorization server metadata from ${e}: ${or(r)}`),null}}static metadataToOAuthConfig(e){return{authorizationUrl:e.authorization_endpoint,tokenUrl:e.token_endpoint,scopes:e.scopes_supported||[]}}static async discoverOAuthConfig(e){try{let r=this.buildWellKnownUrls(e),n=await this.fetchProtectedResourceMetadata(r.protectedResource);if(n?.authorization_servers?.length){let o=n.authorization_servers[0],s=new URL("/.well-known/oauth-authorization-server",o).toString(),a=await this.fetchAuthorizationServerMetadata(s);if(a){let c=this.metadataToOAuthConfig(a);return a.registration_endpoint&&console.log(M.t("mcp.oauth.discovery.dynamicRegistrationSupported"),a.registration_endpoint),c}}console.debug(`Trying OAuth discovery fallback at ${r.authorizationServer}`);let i=await this.fetchAuthorizationServerMetadata(r.authorizationServer);if(i){let o=this.metadataToOAuthConfig(i);return i.registration_endpoint&&console.log(M.t("mcp.oauth.discovery.dynamicRegistrationSupported"),i.registration_endpoint),o}return null}catch(r){return console.debug(`Failed to discover OAuth configuration: ${or(r)}`),null}}static parseWWWAuthenticateHeader(e){let r=e.match(/resource_metadata="([^"]+)"/);return r?r[1]:null}static async discoverOAuthFromWWWAuthenticate(e){let r=this.parseWWWAuthenticateHeader(e);if(!r)return null;console.log(M.t("mcp.oauth.discovery.foundResourceMetadataUri",{uri:r}));let n=await this.fetchProtectedResourceMetadata(r);if(!n?.authorization_servers?.length)return null;let i=n.authorization_servers[0],o=new URL("/.well-known/oauth-authorization-server",i).toString(),s=await this.fetchAuthorizationServerMetadata(o);return s?(console.log(M.t("mcp.oauth.discovery.configDiscoveredFromWwwAuth")),this.metadataToOAuthConfig(s)):null}static extractBaseUrl(e){let r=new URL(e);return`${r.protocol}//${r.host}`}static isSSEEndpoint(e){return e.includes("/sse")||!e.includes("/mcp")}static buildResourceParameter(e){let r=new URL(e);return`${r.protocol}//${r.host}`}}});import*as hUt from"node:http";import*as NX from"node:crypto";import{URL as hQe}from"node:url";var x1,mQe=ae(()=>{"use strict";fUt();yme();lu();Eme();qn();x1=class{static REDIRECT_PORT=7777;static REDIRECT_PATH="/oauth/callback";static HTTP_OK=200;static HTTP_REDIRECT=302;static async registerClient(e,r){let i={client_name:"iFlow CLI MCP Client",redirect_uris:[r.redirectUri||`http://localhost:${this.REDIRECT_PORT}${this.REDIRECT_PATH}`],grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none",code_challenge_method:["S256"],scope:r.scopes?.join(" ")||""},o=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!o.ok){let s=await o.text();throw new Error(M.t("mcp.auth.clientRegistrationFailed",{status:o.status,statusText:o.statusText,error:s}))}return await o.json()}static async discoverOAuthFromMCPServer(e){let r=Bp.extractBaseUrl(e);return Bp.discoverOAuthConfig(r)}static generatePKCEParams(){let e=NX.randomBytes(32).toString("base64url"),r=NX.createHash("sha256").update(e).digest("base64url"),n=NX.randomBytes(16).toString("base64url");return{codeVerifier:e,codeChallenge:r,state:n}}static async startCallbackServer(e){return new Promise((r,n)=>{let i=hUt.createServer(async(o,s)=>{try{let a=new hQe(o.url,`http://localhost:${this.REDIRECT_PORT}`);if(a.pathname!==this.REDIRECT_PATH){s.writeHead(404),s.end(M.t("mcp.ui.notFound"));return}let c=a.searchParams.get("code"),u=a.searchParams.get("state"),d=a.searchParams.get("error");if(d){s.writeHead(this.HTTP_OK,{"Content-Type":"text/html"}),s.end(`
841
+ `&&n++}}return[e,r]}var ame,VUe=ae(()=>{ame=class extends Error{constructor(e,r){super(e),this.name="ParseError",this.type=r.type,this.field=r.field,this.value=r.value,this.line=r.line}}});function lFn(t){let e=globalThis.DOMException;return typeof e=="function"?new e(t,"SyntaxError"):new SyntaxError(t)}function WUe(t){return t instanceof Error?"errors"in t&&Array.isArray(t.errors)?t.errors.map(WUe).join(", "):"cause"in t&&t.cause instanceof Error?`${t}: ${WUe(t.cause)}`:t.message:`${t}`}function HFt(t){return{type:t.type,message:t.message,code:t.code,defaultPrevented:t.defaultPrevented,cancelable:t.cancelable,timeStamp:t.timeStamp}}function cFn(){let t="document"in globalThis?globalThis.document:void 0;return t&&typeof t=="object"&&"baseURI"in t&&typeof t.baseURI=="string"?t.baseURI:void 0}var ume,WFt,ZUe,ws,Hf,au,Y8,Yg,WD,xU,cme,dme,hX,_U,mX,dS,SU,TU,wU,fX,c4,$Ue,jUe,zUe,VFt,YUe,JUe,pX,KUe,XUe,$D,$Ft=ae(()=>{VUe();ume=class extends Event{constructor(e,r){var n,i;super(e),this.code=(n=r?.code)!=null?n:void 0,this.message=(i=r?.message)!=null?i:void 0}[Symbol.for("nodejs.util.inspect.custom")](e,r,n){return n(HFt(this),r)}[Symbol.for("Deno.customInspect")](e,r){return e(HFt(this),r)}};WFt=t=>{throw TypeError(t)},ZUe=(t,e,r)=>e.has(t)||WFt("Cannot "+r),ws=(t,e,r)=>(ZUe(t,e,"read from private field"),r?r.call(t):e.get(t)),Hf=(t,e,r)=>e.has(t)?WFt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r),au=(t,e,r,n)=>(ZUe(t,e,"write to private field"),e.set(t,r),r),Y8=(t,e,r)=>(ZUe(t,e,"access private method"),r),$D=class extends EventTarget{constructor(e,r){var n,i;super(),Hf(this,c4),this.CONNECTING=0,this.OPEN=1,this.CLOSED=2,Hf(this,Yg),Hf(this,WD),Hf(this,xU),Hf(this,cme),Hf(this,dme),Hf(this,hX),Hf(this,_U),Hf(this,mX,null),Hf(this,dS),Hf(this,SU),Hf(this,TU,null),Hf(this,wU,null),Hf(this,fX,null),Hf(this,jUe,async o=>{var s;ws(this,SU).reset();let{body:a,redirected:c,status:u,headers:d}=o;if(u===204){Y8(this,c4,pX).call(this,"Server sent HTTP 204, not reconnecting",204),this.close();return}if(c?au(this,xU,new URL(o.url)):au(this,xU,void 0),u!==200){Y8(this,c4,pX).call(this,`Non-200 status code (${u})`,u);return}if(!(d.get("content-type")||"").startsWith("text/event-stream")){Y8(this,c4,pX).call(this,'Invalid content type, expected "text/event-stream"',u);return}if(ws(this,Yg)===this.CLOSED)return;au(this,Yg,this.OPEN);let f=new Event("open");if((s=ws(this,fX))==null||s.call(this,f),this.dispatchEvent(f),typeof a!="object"||!a||!("getReader"in a)){Y8(this,c4,pX).call(this,"Invalid response body, expected a web ReadableStream",u),this.close();return}let p=new TextDecoder,h=a.getReader(),m=!0;do{let{done:g,value:A}=await h.read();A&&ws(this,SU).feed(p.decode(A,{stream:!g})),g&&(m=!1,ws(this,SU).reset(),Y8(this,c4,KUe).call(this))}while(m)}),Hf(this,zUe,o=>{au(this,dS,void 0),!(o.name==="AbortError"||o.type==="aborted")&&Y8(this,c4,KUe).call(this,WUe(o))}),Hf(this,YUe,o=>{typeof o.id=="string"&&au(this,mX,o.id);let s=new MessageEvent(o.event||"message",{data:o.data,origin:ws(this,xU)?ws(this,xU).origin:ws(this,WD).origin,lastEventId:o.id||""});ws(this,wU)&&(!o.event||o.event==="message")&&ws(this,wU).call(this,s),this.dispatchEvent(s)}),Hf(this,JUe,o=>{au(this,hX,o)}),Hf(this,XUe,()=>{au(this,_U,void 0),ws(this,Yg)===this.CONNECTING&&Y8(this,c4,$Ue).call(this)});try{if(e instanceof URL)au(this,WD,e);else if(typeof e=="string")au(this,WD,new URL(e,cFn()));else throw new Error("Invalid URL")}catch{throw lFn("An invalid or illegal string was specified")}au(this,SU,lme({onEvent:ws(this,YUe),onRetry:ws(this,JUe)})),au(this,Yg,this.CONNECTING),au(this,hX,3e3),au(this,dme,(n=r?.fetch)!=null?n:globalThis.fetch),au(this,cme,(i=r?.withCredentials)!=null?i:!1),Y8(this,c4,$Ue).call(this)}get readyState(){return ws(this,Yg)}get url(){return ws(this,WD).href}get withCredentials(){return ws(this,cme)}get onerror(){return ws(this,TU)}set onerror(e){au(this,TU,e)}get onmessage(){return ws(this,wU)}set onmessage(e){au(this,wU,e)}get onopen(){return ws(this,fX)}set onopen(e){au(this,fX,e)}addEventListener(e,r,n){let i=r;super.addEventListener(e,i,n)}removeEventListener(e,r,n){let i=r;super.removeEventListener(e,i,n)}close(){ws(this,_U)&&clearTimeout(ws(this,_U)),ws(this,Yg)!==this.CLOSED&&(ws(this,dS)&&ws(this,dS).abort(),au(this,Yg,this.CLOSED),au(this,dS,void 0))}};Yg=new WeakMap,WD=new WeakMap,xU=new WeakMap,cme=new WeakMap,dme=new WeakMap,hX=new WeakMap,_U=new WeakMap,mX=new WeakMap,dS=new WeakMap,SU=new WeakMap,TU=new WeakMap,wU=new WeakMap,fX=new WeakMap,c4=new WeakSet,$Ue=function(){au(this,Yg,this.CONNECTING),au(this,dS,new AbortController),ws(this,dme)(ws(this,WD),Y8(this,c4,VFt).call(this)).then(ws(this,jUe)).catch(ws(this,zUe))},jUe=new WeakMap,zUe=new WeakMap,VFt=function(){var t;let e={mode:"cors",redirect:"follow",headers:{Accept:"text/event-stream",...ws(this,mX)?{"Last-Event-ID":ws(this,mX)}:void 0},cache:"no-store",signal:(t=ws(this,dS))==null?void 0:t.signal};return"window"in globalThis&&(e.credentials=this.withCredentials?"include":"same-origin"),e},YUe=new WeakMap,JUe=new WeakMap,pX=function(t,e){var r;ws(this,Yg)!==this.CLOSED&&au(this,Yg,this.CLOSED);let n=new ume("error",{code:e,message:t});(r=ws(this,TU))==null||r.call(this,n),this.dispatchEvent(n)},KUe=function(t,e){var r;if(ws(this,Yg)===this.CLOSED)return;au(this,Yg,this.CONNECTING);let n=new ume("error",{code:e,message:t});(r=ws(this,TU))==null||r.call(this,n),this.dispatchEvent(n),au(this,_U,setTimeout(ws(this,XUe),ws(this,hX)))},XUe=new WeakMap,$D.CONNECTING=0,$D.OPEN=1,$D.CLOSED=2});async function uFn(t){return(await eQe).getRandomValues(new Uint8Array(t))}async function dFn(t){let e="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-._~",r="",n=await uFn(t);for(let i=0;i<t;i++){let o=n[i]%e.length;r+=e[o]}return r}async function fFn(t){return await dFn(t)}async function pFn(t){let e=await(await eQe).subtle.digest("SHA-256",new TextEncoder().encode(t));return btoa(String.fromCharCode(...new Uint8Array(e))).replace(/\//g,"_").replace(/\+/g,"-").replace(/=/g,"")}async function tQe(t){if(t||(t=43),t<43||t>128)throw`Expected a length between 43 and 128. Received ${t}.`;let e=await fFn(t),r=await pFn(e);return{code_verifier:e,code_challenge:r}}var eQe,jFt=ae(()=>{eQe=globalThis.crypto?.webcrypto??globalThis.crypto??import("node:crypto").then(t=>t.webcrypto)});var Dp,zFt,rQe,hFn,YFt,nQe,JFt,mFn,gFn,KFt,wUo,_Uo,iQe=ae(()=>{oS();Dp=te.string().url().superRefine((t,e)=>{if(!URL.canParse(t))return e.addIssue({code:te.ZodIssueCode.custom,message:"URL must be parseable",fatal:!0}),te.NEVER}).refine(t=>{let e=new URL(t);return e.protocol!=="javascript:"&&e.protocol!=="data:"&&e.protocol!=="vbscript:"},{message:"URL cannot use javascript:, data:, or vbscript: scheme"}),zFt=te.object({resource:te.string().url(),authorization_servers:te.array(Dp).optional(),jwks_uri:te.string().url().optional(),scopes_supported:te.array(te.string()).optional(),bearer_methods_supported:te.array(te.string()).optional(),resource_signing_alg_values_supported:te.array(te.string()).optional(),resource_name:te.string().optional(),resource_documentation:te.string().optional(),resource_policy_uri:te.string().url().optional(),resource_tos_uri:te.string().url().optional(),tls_client_certificate_bound_access_tokens:te.boolean().optional(),authorization_details_types_supported:te.array(te.string()).optional(),dpop_signing_alg_values_supported:te.array(te.string()).optional(),dpop_bound_access_tokens_required:te.boolean().optional()}).passthrough(),rQe=te.object({issuer:te.string(),authorization_endpoint:Dp,token_endpoint:Dp,registration_endpoint:Dp.optional(),scopes_supported:te.array(te.string()).optional(),response_types_supported:te.array(te.string()),response_modes_supported:te.array(te.string()).optional(),grant_types_supported:te.array(te.string()).optional(),token_endpoint_auth_methods_supported:te.array(te.string()).optional(),token_endpoint_auth_signing_alg_values_supported:te.array(te.string()).optional(),service_documentation:Dp.optional(),revocation_endpoint:Dp.optional(),revocation_endpoint_auth_methods_supported:te.array(te.string()).optional(),revocation_endpoint_auth_signing_alg_values_supported:te.array(te.string()).optional(),introspection_endpoint:te.string().optional(),introspection_endpoint_auth_methods_supported:te.array(te.string()).optional(),introspection_endpoint_auth_signing_alg_values_supported:te.array(te.string()).optional(),code_challenge_methods_supported:te.array(te.string()).optional()}).passthrough(),hFn=te.object({issuer:te.string(),authorization_endpoint:Dp,token_endpoint:Dp,userinfo_endpoint:Dp.optional(),jwks_uri:Dp,registration_endpoint:Dp.optional(),scopes_supported:te.array(te.string()).optional(),response_types_supported:te.array(te.string()),response_modes_supported:te.array(te.string()).optional(),grant_types_supported:te.array(te.string()).optional(),acr_values_supported:te.array(te.string()).optional(),subject_types_supported:te.array(te.string()),id_token_signing_alg_values_supported:te.array(te.string()),id_token_encryption_alg_values_supported:te.array(te.string()).optional(),id_token_encryption_enc_values_supported:te.array(te.string()).optional(),userinfo_signing_alg_values_supported:te.array(te.string()).optional(),userinfo_encryption_alg_values_supported:te.array(te.string()).optional(),userinfo_encryption_enc_values_supported:te.array(te.string()).optional(),request_object_signing_alg_values_supported:te.array(te.string()).optional(),request_object_encryption_alg_values_supported:te.array(te.string()).optional(),request_object_encryption_enc_values_supported:te.array(te.string()).optional(),token_endpoint_auth_methods_supported:te.array(te.string()).optional(),token_endpoint_auth_signing_alg_values_supported:te.array(te.string()).optional(),display_values_supported:te.array(te.string()).optional(),claim_types_supported:te.array(te.string()).optional(),claims_supported:te.array(te.string()).optional(),service_documentation:te.string().optional(),claims_locales_supported:te.array(te.string()).optional(),ui_locales_supported:te.array(te.string()).optional(),claims_parameter_supported:te.boolean().optional(),request_parameter_supported:te.boolean().optional(),request_uri_parameter_supported:te.boolean().optional(),require_request_uri_registration:te.boolean().optional(),op_policy_uri:Dp.optional(),op_tos_uri:Dp.optional()}).passthrough(),YFt=hFn.merge(rQe.pick({code_challenge_methods_supported:!0})),nQe=te.object({access_token:te.string(),id_token:te.string().optional(),token_type:te.string(),expires_in:te.number().optional(),scope:te.string().optional(),refresh_token:te.string().optional()}).strip(),JFt=te.object({error:te.string(),error_description:te.string().optional(),error_uri:te.string().optional()}),mFn=te.object({redirect_uris:te.array(Dp),token_endpoint_auth_method:te.string().optional(),grant_types:te.array(te.string()).optional(),response_types:te.array(te.string()).optional(),client_name:te.string().optional(),client_uri:Dp.optional(),logo_uri:Dp.optional(),scope:te.string().optional(),contacts:te.array(te.string()).optional(),tos_uri:Dp.optional(),policy_uri:te.string().optional(),jwks_uri:Dp.optional(),jwks:te.any().optional(),software_id:te.string().optional(),software_version:te.string().optional(),software_statement:te.string().optional()}).strip(),gFn=te.object({client_id:te.string(),client_secret:te.string().optional(),client_id_issued_at:te.number().optional(),client_secret_expires_at:te.number().optional()}).strip(),KFt=mFn.merge(gFn),wUo=te.object({error:te.string(),error_description:te.string().optional()}).strip(),_Uo=te.object({token:te.string(),token_type_hint:te.string().optional()}).strip()});function XFt(t){let e=typeof t=="string"?new URL(t):new URL(t.href);return e.hash="",e}function ZFt({requestedResource:t,configuredResource:e}){let r=typeof t=="string"?new URL(t):new URL(t.href),n=typeof e=="string"?new URL(e):new URL(e.href);if(r.origin!==n.origin||r.pathname.length<n.pathname.length)return!1;let i=r.pathname.endsWith("/")?r.pathname:r.pathname+"/",o=n.pathname.endsWith("/")?n.pathname:n.pathname+"/";return i.startsWith(o)}var eUt=ae(()=>{});var lf,gX,jD,zD,YD,AX,yX,EX,J8,vX,CX,bX,xX,SX,wX,_X,TX,tUt,rUt=ae(()=>{lf=class extends Error{constructor(e,r){super(e),this.errorUri=r,this.name=this.constructor.name}toResponseObject(){let e={error:this.errorCode,error_description:this.message};return this.errorUri&&(e.error_uri=this.errorUri),e}get errorCode(){return this.constructor.errorCode}},gX=class extends lf{};gX.errorCode="invalid_request";jD=class extends lf{};jD.errorCode="invalid_client";zD=class extends lf{};zD.errorCode="invalid_grant";YD=class extends lf{};YD.errorCode="unauthorized_client";AX=class extends lf{};AX.errorCode="unsupported_grant_type";yX=class extends lf{};yX.errorCode="invalid_scope";EX=class extends lf{};EX.errorCode="access_denied";J8=class extends lf{};J8.errorCode="server_error";vX=class extends lf{};vX.errorCode="temporarily_unavailable";CX=class extends lf{};CX.errorCode="unsupported_response_type";bX=class extends lf{};bX.errorCode="unsupported_token_type";xX=class extends lf{};xX.errorCode="invalid_token";SX=class extends lf{};SX.errorCode="method_not_allowed";wX=class extends lf{};wX.errorCode="too_many_requests";_X=class extends lf{};_X.errorCode="invalid_client_metadata";TX=class extends lf{};TX.errorCode="insufficient_scope";tUt={[gX.errorCode]:gX,[jD.errorCode]:jD,[zD.errorCode]:zD,[YD.errorCode]:YD,[AX.errorCode]:AX,[yX.errorCode]:yX,[EX.errorCode]:EX,[J8.errorCode]:J8,[vX.errorCode]:vX,[CX.errorCode]:CX,[bX.errorCode]:bX,[xX.errorCode]:xX,[SX.errorCode]:SX,[wX.errorCode]:wX,[_X.errorCode]:_X,[TX.errorCode]:TX}});function iUt(t,e){let r=t.client_secret!==void 0;return e.length===0?r?"client_secret_post":"none":r&&e.includes("client_secret_basic")?"client_secret_basic":r&&e.includes("client_secret_post")?"client_secret_post":e.includes("none")?"none":r?"client_secret_post":"none"}function oUt(t,e,r,n){let{client_id:i,client_secret:o}=e;switch(t){case"client_secret_basic":AFn(i,o,r);return;case"client_secret_post":yFn(i,o,n);return;case"none":EFn(i,n);return;default:throw new Error(`Unsupported client authentication method: ${t}`)}}function AFn(t,e,r){if(!e)throw new Error("client_secret_basic authentication requires a client_secret");let n=btoa(`${t}:${e}`);r.set("Authorization",`Basic ${n}`)}function yFn(t,e,r){r.set("client_id",t),e&&r.set("client_secret",e)}function EFn(t,e){e.set("client_id",t)}async function sQe(t){let e=t instanceof Response?t.status:void 0,r=t instanceof Response?await t.text():t;try{let n=JFt.parse(JSON.parse(r)),{error:i,error_description:o,error_uri:s}=n,a=tUt[i]||J8;return new a(o||"",s)}catch(n){let i=`${e?`HTTP ${e}: `:""}Invalid OAuth error response: ${n}. Raw body: ${r}`;return new J8(i)}}async function fS(t,e){var r,n;try{return await oQe(t,e)}catch(i){if(i instanceof jD||i instanceof YD)return await((r=t.invalidateCredentials)===null||r===void 0?void 0:r.call(t,"all")),await oQe(t,e);if(i instanceof zD)return await((n=t.invalidateCredentials)===null||n===void 0?void 0:n.call(t,"tokens")),await oQe(t,e);throw i}}async function oQe(t,{serverUrl:e,authorizationCode:r,scope:n,resourceMetadataUrl:i,fetchFn:o}){let s,a;try{s=await CFn(e,{resourceMetadataUrl:i},o),s.authorization_servers&&s.authorization_servers.length>0&&(a=s.authorization_servers[0])}catch{}a||(a=e);let c=await vFn(e,t,s),u=await _Fn(a,{fetchFn:o}),d=await Promise.resolve(t.clientInformation());if(!d){if(r!==void 0)throw new Error("Existing OAuth client information is required when exchanging an authorization code");if(!t.saveClientInformation)throw new Error("OAuth client information must be saveable for dynamic registration");let g=await IFn(a,{metadata:u,clientMetadata:t.clientMetadata,fetchFn:o});await t.saveClientInformation(g),d=g}if(r!==void 0){let g=await t.codeVerifier(),A=await lQe(a,{metadata:u,clientInformation:d,authorizationCode:r,codeVerifier:g,redirectUri:t.redirectUrl,resource:c,addClientAuthentication:t.addClientAuthentication,fetchFn:o});return await t.saveTokens(A),"AUTHORIZED"}let f=await t.tokens();if(f?.refresh_token)try{let g=await cQe(a,{metadata:u,clientInformation:d,refreshToken:f.refresh_token,resource:c,addClientAuthentication:t.addClientAuthentication,fetchFn:o});return await t.saveTokens(g),"AUTHORIZED"}catch(g){if(!(!(g instanceof lf)||g instanceof J8))throw g}let p=t.state?await t.state():void 0,{authorizationUrl:h,codeVerifier:m}=await TFn(a,{metadata:u,clientInformation:d,state:p,redirectUrl:t.redirectUrl,scope:n||t.clientMetadata.scope,resource:c});return await t.saveCodeVerifier(m),await t.redirectToAuthorization(h),"REDIRECT"}async function vFn(t,e,r){let n=XFt(t);if(e.validateResourceURL)return await e.validateResourceURL(n,r?.resource);if(r){if(!ZFt({requestedResource:n,configuredResource:r.resource}))throw new Error(`Protected resource ${r.resource} does not match expected ${n} (or origin)`);return new URL(r.resource)}}function IX(t){let e=t.headers.get("WWW-Authenticate");if(!e)return;let[r,n]=e.split(" ");if(r.toLowerCase()!=="bearer"||!n)return;let o=/resource_metadata="([^"]*)"/.exec(e);if(o)try{return new URL(o[1])}catch{return}}async function CFn(t,e,r=fetch){let n=await SFn(t,"oauth-protected-resource",r,{protocolVersion:e?.protocolVersion,metadataUrl:e?.resourceMetadataUrl});if(!n||n.status===404)throw new Error("Resource server does not implement OAuth 2.0 Protected Resource Metadata.");if(!n.ok)throw new Error(`HTTP ${n.status} trying to load well-known OAuth protected resource metadata.`);return zFt.parse(await n.json())}async function aQe(t,e,r=fetch){try{return await r(t,{headers:e})}catch(n){if(n instanceof TypeError)return e?aQe(t,void 0,r):void 0;throw n}}function bFn(t,e="",r={}){return e.endsWith("/")&&(e=e.slice(0,-1)),r.prependPathname?`${e}/.well-known/${t}`:`/.well-known/${t}${e}`}async function nUt(t,e,r=fetch){return await aQe(t,{"MCP-Protocol-Version":e},r)}function xFn(t,e){return!t||t.status>=400&&t.status<500&&e!=="/"}async function SFn(t,e,r,n){var i,o;let s=new URL(t),a=(i=n?.protocolVersion)!==null&&i!==void 0?i:AU,c;if(n?.metadataUrl)c=new URL(n.metadataUrl);else{let d=bFn(e,s.pathname);c=new URL(d,(o=n?.metadataServerUrl)!==null&&o!==void 0?o:s),c.search=s.search}let u=await nUt(c,a,r);if(!n?.metadataUrl&&xFn(u,s.pathname)){let d=new URL(`/.well-known/${e}`,s);u=await nUt(d,a,r)}return u}function wFn(t){let e=typeof t=="string"?new URL(t):t,r=e.pathname!=="/",n=[];if(!r)return n.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),n.push({url:new URL("/.well-known/openid-configuration",e.origin),type:"oidc"}),n;let i=e.pathname;return i.endsWith("/")&&(i=i.slice(0,-1)),n.push({url:new URL(`/.well-known/oauth-authorization-server${i}`,e.origin),type:"oauth"}),n.push({url:new URL("/.well-known/oauth-authorization-server",e.origin),type:"oauth"}),n.push({url:new URL(`/.well-known/openid-configuration${i}`,e.origin),type:"oidc"}),n.push({url:new URL(`${i}/.well-known/openid-configuration`,e.origin),type:"oidc"}),n}async function _Fn(t,{fetchFn:e=fetch,protocolVersion:r=AU}={}){var n;let i={"MCP-Protocol-Version":r},o=wFn(t);for(let{url:s,type:a}of o){let c=await aQe(s,i,e);if(c){if(!c.ok){if(c.status>=400&&c.status<500)continue;throw new Error(`HTTP ${c.status} trying to load ${a==="oauth"?"OAuth":"OpenID provider"} metadata from ${s}`)}if(a==="oauth")return rQe.parse(await c.json());{let u=YFt.parse(await c.json());if(!(!((n=u.code_challenge_methods_supported)===null||n===void 0)&&n.includes("S256")))throw new Error(`Incompatible OIDC provider at ${s}: does not support S256 code challenge method required by MCP specification`);return u}}}}async function TFn(t,{metadata:e,clientInformation:r,redirectUrl:n,scope:i,state:o,resource:s}){let a="code",c="S256",u;if(e){if(u=new URL(e.authorization_endpoint),!e.response_types_supported.includes(a))throw new Error(`Incompatible auth server: does not support response type ${a}`);if(!e.code_challenge_methods_supported||!e.code_challenge_methods_supported.includes(c))throw new Error(`Incompatible auth server: does not support code challenge method ${c}`)}else u=new URL("/authorize",t);let d=await tQe(),f=d.code_verifier,p=d.code_challenge;return u.searchParams.set("response_type",a),u.searchParams.set("client_id",r.client_id),u.searchParams.set("code_challenge",p),u.searchParams.set("code_challenge_method",c),u.searchParams.set("redirect_uri",String(n)),o&&u.searchParams.set("state",o),i&&u.searchParams.set("scope",i),i?.includes("offline_access")&&u.searchParams.append("prompt","consent"),s&&u.searchParams.set("resource",s.href),{authorizationUrl:u,codeVerifier:f}}async function lQe(t,{metadata:e,clientInformation:r,authorizationCode:n,codeVerifier:i,redirectUri:o,resource:s,addClientAuthentication:a,fetchFn:c}){var u;let d="authorization_code",f=e?.token_endpoint?new URL(e.token_endpoint):new URL("/token",t);if(e?.grant_types_supported&&!e.grant_types_supported.includes(d))throw new Error(`Incompatible auth server: does not support grant type ${d}`);let p=new Headers({"Content-Type":"application/x-www-form-urlencoded",Accept:"application/json"}),h=new URLSearchParams({grant_type:d,code:n,code_verifier:i,redirect_uri:String(o)});if(a)a(p,h,t,e);else{let g=(u=e?.token_endpoint_auth_methods_supported)!==null&&u!==void 0?u:[],A=iUt(r,g);oUt(A,r,p,h)}s&&h.set("resource",s.href);let m=await(c??fetch)(f,{method:"POST",headers:p,body:h});if(!m.ok)throw await sQe(m);return nQe.parse(await m.json())}async function cQe(t,{metadata:e,clientInformation:r,refreshToken:n,resource:i,addClientAuthentication:o,fetchFn:s}){var a;let c="refresh_token",u;if(e){if(u=new URL(e.token_endpoint),e.grant_types_supported&&!e.grant_types_supported.includes(c))throw new Error(`Incompatible auth server: does not support grant type ${c}`)}else u=new URL("/token",t);let d=new Headers({"Content-Type":"application/x-www-form-urlencoded"}),f=new URLSearchParams({grant_type:c,refresh_token:n});if(o)o(d,f,t,e);else{let h=(a=e?.token_endpoint_auth_methods_supported)!==null&&a!==void 0?a:[],m=iUt(r,h);oUt(m,r,d,f)}i&&f.set("resource",i.href);let p=await(s??fetch)(u,{method:"POST",headers:d,body:f});if(!p.ok)throw await sQe(p);return nQe.parse({refresh_token:n,...await p.json()})}async function IFn(t,{metadata:e,clientMetadata:r,fetchFn:n}){let i;if(e){if(!e.registration_endpoint)throw new Error("Incompatible auth server: does not support dynamic client registration");i=new URL(e.registration_endpoint)}else i=new URL("/register",t);let o=await(n??fetch)(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(r)});if(!o.ok)throw await sQe(o);return KFt.parse(await o.json())}var Jg,fme=ae(()=>{jFt();aS();iQe();iQe();eUt();rUt();Jg=class extends Error{constructor(e){super(e??"Unauthorized")}}});var uQe,IU,sUt=ae(()=>{$Ft();aS();fme();uQe=class extends Error{constructor(e,r,n){super(`SSE error: ${r}`),this.code=e,this.event=n}},IU=class{constructor(e,r){this._url=e,this._resourceMetadataUrl=void 0,this._eventSourceInit=r?.eventSourceInit,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch}async _authThenStart(){var e;if(!this._authProvider)throw new Jg("No auth provider");let r;try{r=await fS(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})}catch(n){throw(e=this.onerror)===null||e===void 0||e.call(this,n),n}if(r!=="AUTHORIZED")throw new Jg;return await this._startOrAuth()}async _commonHeaders(){var e;let r={};if(this._authProvider){let n=await this._authProvider.tokens();n&&(r.Authorization=`Bearer ${n.access_token}`)}return this._protocolVersion&&(r["mcp-protocol-version"]=this._protocolVersion),new Headers({...r,...(e=this._requestInit)===null||e===void 0?void 0:e.headers})}_startOrAuth(){var e,r,n;let i=(n=(r=(e=this===null||this===void 0?void 0:this._eventSourceInit)===null||e===void 0?void 0:e.fetch)!==null&&r!==void 0?r:this._fetch)!==null&&n!==void 0?n:fetch;return new Promise((o,s)=>{this._eventSource=new $D(this._url.href,{...this._eventSourceInit,fetch:async(a,c)=>{let u=await this._commonHeaders();u.set("Accept","text/event-stream");let d=await i(a,{...c,headers:u});return d.status===401&&d.headers.has("www-authenticate")&&(this._resourceMetadataUrl=IX(d)),d}}),this._abortController=new AbortController,this._eventSource.onerror=a=>{var c;if(a.code===401&&this._authProvider){this._authThenStart().then(o,s);return}let u=new uQe(a.code,a.message,a);s(u),(c=this.onerror)===null||c===void 0||c.call(this,u)},this._eventSource.onopen=()=>{},this._eventSource.addEventListener("endpoint",a=>{var c;let u=a;try{if(this._endpoint=new URL(u.data,this._url),this._endpoint.origin!==this._url.origin)throw new Error(`Endpoint origin does not match connection origin: ${this._endpoint.origin}`)}catch(d){s(d),(c=this.onerror)===null||c===void 0||c.call(this,d),this.close();return}o()}),this._eventSource.onmessage=a=>{var c,u;let d=a,f;try{f=sS.parse(JSON.parse(d.data))}catch(p){(c=this.onerror)===null||c===void 0||c.call(this,p);return}(u=this.onmessage)===null||u===void 0||u.call(this,f)}})}async start(){if(this._eventSource)throw new Error("SSEClientTransport already started! If using Client class, note that connect() calls start() automatically.");return await this._startOrAuth()}async finishAuth(e){if(!this._authProvider)throw new Jg("No auth provider");if(await fS(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Jg("Failed to authorize")}async close(){var e,r,n;(e=this._abortController)===null||e===void 0||e.abort(),(r=this._eventSource)===null||r===void 0||r.close(),(n=this.onclose)===null||n===void 0||n.call(this)}async send(e){var r,n,i;if(!this._endpoint)throw new Error("Not connected");try{let o=await this._commonHeaders();o.set("content-type","application/json");let s={...this._requestInit,method:"POST",headers:o,body:JSON.stringify(e),signal:(r=this._abortController)===null||r===void 0?void 0:r.signal},a=await((n=this._fetch)!==null&&n!==void 0?n:fetch)(this._endpoint,s);if(!a.ok){if(a.status===401&&this._authProvider){if(this._resourceMetadataUrl=IX(a),await fS(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Jg;return this.send(e)}let c=await a.text().catch(()=>null);throw new Error(`Error POSTing to endpoint (HTTP ${a.status}): ${c}`)}}catch(o){throw(i=this.onerror)===null||i===void 0||i.call(this,o),o}}setProtocolVersion(e){this._protocolVersion=e}}});var pme,aUt=ae(()=>{VUe();pme=class extends TransformStream{constructor({onError:e,onRetry:r,onComment:n}={}){let i;super({start(o){i=lme({onEvent:s=>{o.enqueue(s)},onError(s){e==="terminate"?o.error(s):typeof e=="function"&&e(s)},onRetry:r,onComment:n})},transform(o){i.feed(o)}})}}});var DFn,DX,pS,dQe=ae(()=>{aS();fme();aUt();DFn={initialReconnectionDelay:1e3,maxReconnectionDelay:3e4,reconnectionDelayGrowFactor:1.5,maxRetries:2},DX=class extends Error{constructor(e,r){super(`Streamable HTTP error: ${r}`),this.code=e}},pS=class{constructor(e,r){var n;this._url=e,this._resourceMetadataUrl=void 0,this._requestInit=r?.requestInit,this._authProvider=r?.authProvider,this._fetch=r?.fetch,this._sessionId=r?.sessionId,this._reconnectionOptions=(n=r?.reconnectionOptions)!==null&&n!==void 0?n:DFn}async _authThenStart(){var e;if(!this._authProvider)throw new Jg("No auth provider");let r;try{r=await fS(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})}catch(n){throw(e=this.onerror)===null||e===void 0||e.call(this,n),n}if(r!=="AUTHORIZED")throw new Jg;return await this._startOrAuthSse({resumptionToken:void 0})}async _commonHeaders(){var e;let r={};if(this._authProvider){let i=await this._authProvider.tokens();i&&(r.Authorization=`Bearer ${i.access_token}`)}this._sessionId&&(r["mcp-session-id"]=this._sessionId),this._protocolVersion&&(r["mcp-protocol-version"]=this._protocolVersion);let n=this._normalizeHeaders((e=this._requestInit)===null||e===void 0?void 0:e.headers);return new Headers({...r,...n})}async _startOrAuthSse(e){var r,n,i;let{resumptionToken:o}=e;try{let s=await this._commonHeaders();s.set("Accept","text/event-stream"),o&&s.set("last-event-id",o);let a=await((r=this._fetch)!==null&&r!==void 0?r:fetch)(this._url,{method:"GET",headers:s,signal:(n=this._abortController)===null||n===void 0?void 0:n.signal});if(!a.ok){if(a.status===401&&this._authProvider)return await this._authThenStart();if(a.status===405)return;throw new DX(a.status,`Failed to open SSE stream: ${a.statusText}`)}this._handleSseStream(a.body,e,!0)}catch(s){throw(i=this.onerror)===null||i===void 0||i.call(this,s),s}}_getNextReconnectionDelay(e){let r=this._reconnectionOptions.initialReconnectionDelay,n=this._reconnectionOptions.reconnectionDelayGrowFactor,i=this._reconnectionOptions.maxReconnectionDelay;return Math.min(r*Math.pow(n,e),i)}_normalizeHeaders(e){return e?e instanceof Headers?Object.fromEntries(e.entries()):Array.isArray(e)?Object.fromEntries(e):{...e}:{}}_scheduleReconnection(e,r=0){var n;let i=this._reconnectionOptions.maxRetries;if(i>0&&r>=i){(n=this.onerror)===null||n===void 0||n.call(this,new Error(`Maximum reconnection attempts (${i}) exceeded.`));return}let o=this._getNextReconnectionDelay(r);setTimeout(()=>{this._startOrAuthSse(e).catch(s=>{var a;(a=this.onerror)===null||a===void 0||a.call(this,new Error(`Failed to reconnect SSE stream: ${s instanceof Error?s.message:String(s)}`)),this._scheduleReconnection(e,r+1)})},o)}_handleSseStream(e,r,n){if(!e)return;let{onresumptiontoken:i,replayMessageId:o}=r,s;(async()=>{var c,u,d,f;try{let p=e.pipeThrough(new TextDecoderStream).pipeThrough(new pme).getReader();for(;;){let{value:h,done:m}=await p.read();if(m)break;if(h.id&&(s=h.id,i?.(h.id)),!h.event||h.event==="message")try{let g=sS.parse(JSON.parse(h.data));o!==void 0&&aX(g)&&(g.id=o),(c=this.onmessage)===null||c===void 0||c.call(this,g)}catch(g){(u=this.onerror)===null||u===void 0||u.call(this,g)}}}catch(p){if((d=this.onerror)===null||d===void 0||d.call(this,new Error(`SSE stream disconnected: ${p}`)),n&&this._abortController&&!this._abortController.signal.aborted)try{this._scheduleReconnection({resumptionToken:s,onresumptiontoken:i,replayMessageId:o},0)}catch(h){(f=this.onerror)===null||f===void 0||f.call(this,new Error(`Failed to reconnect: ${h instanceof Error?h.message:String(h)}`))}}})()}async start(){if(this._abortController)throw new Error("StreamableHTTPClientTransport already started! If using Client class, note that connect() calls start() automatically.");this._abortController=new AbortController}async finishAuth(e){if(!this._authProvider)throw new Jg("No auth provider");if(await fS(this._authProvider,{serverUrl:this._url,authorizationCode:e,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Jg("Failed to authorize")}async close(){var e,r;(e=this._abortController)===null||e===void 0||e.abort(),(r=this.onclose)===null||r===void 0||r.call(this)}async send(e,r){var n,i,o,s;try{let{resumptionToken:a,onresumptiontoken:c}=r||{};if(a){this._startOrAuthSse({resumptionToken:a,replayMessageId:N0e(e)?e.id:void 0}).catch(A=>{var y;return(y=this.onerror)===null||y===void 0?void 0:y.call(this,A)});return}let u=await this._commonHeaders();u.set("content-type","application/json"),u.set("accept","application/json, text/event-stream");let d={...this._requestInit,method:"POST",headers:u,body:JSON.stringify(e),signal:(n=this._abortController)===null||n===void 0?void 0:n.signal},f=await((i=this._fetch)!==null&&i!==void 0?i:fetch)(this._url,d),p=f.headers.get("mcp-session-id");if(p&&(this._sessionId=p),!f.ok){if(f.status===401&&this._authProvider){if(this._resourceMetadataUrl=IX(f),await fS(this._authProvider,{serverUrl:this._url,resourceMetadataUrl:this._resourceMetadataUrl,fetchFn:this._fetch})!=="AUTHORIZED")throw new Jg;return this.send(e)}let A=await f.text().catch(()=>null);throw new Error(`Error POSTing to endpoint (HTTP ${f.status}): ${A}`)}if(f.status===202){qMt(e)&&this._startOrAuthSse({resumptionToken:void 0}).catch(A=>{var y;return(y=this.onerror)===null||y===void 0?void 0:y.call(this,A)});return}let m=(Array.isArray(e)?e:[e]).filter(A=>"method"in A&&"id"in A&&A.id!==void 0).length>0,g=f.headers.get("content-type");if(m)if(g?.includes("text/event-stream"))this._handleSseStream(f.body,{onresumptiontoken:c},!1);else if(g?.includes("application/json")){let A=await f.json(),y=Array.isArray(A)?A.map(E=>sS.parse(E)):[sS.parse(A)];for(let E of y)(o=this.onmessage)===null||o===void 0||o.call(this,E)}else throw new DX(-1,`Unexpected content type: ${g}`)}catch(a){throw(s=this.onerror)===null||s===void 0||s.call(this,a),a}}get sessionId(){return this._sessionId}async terminateSession(){var e,r,n;if(this._sessionId)try{let i=await this._commonHeaders(),o={...this._requestInit,method:"DELETE",headers:i,signal:(e=this._abortController)===null||e===void 0?void 0:e.signal},s=await((r=this._fetch)!==null&&r!==void 0?r:fetch)(this._url,o);if(!s.ok&&s.status!==405)throw new DX(s.status,`Failed to terminate session: ${s.statusText}`);this._sessionId=void 0}catch(i){throw(n=this.onerror)===null||n===void 0||n.call(this,i),i}}setProtocolVersion(e){this._protocolVersion=e}get protocolVersion(){return this._protocolVersion}}});import{readFile as RFn}from"node:fs/promises";var RX,BX,JD,fQe=ae(()=>{"use strict";bL();fme();qn();(function(t){t.CLI_CONNECT="cli_connect",t.PING="ping",t.GET_ACTIVE_FILE="get_active_file",t.GET_FILE_CONTENT="get_file_content",t.GET_SELECTED_TEXT="get_selected_text",t.SHOW_DIFF="show_diff"})(RX||(RX={}));BX=class extends Error{code;constructor(e,r){super(r),this.code=e}},JD=class{_websocket;_url;_authProvider;_websocketOptions;_WebSocket;_protocolVersion;_isClosed=!1;_specialIds=new Set;onclose;onerror;onmessage;sessionId;constructor(e,r){this._url=e,this._authProvider=r?.authProvider,this._websocketOptions=r?.websocketOptions,this._WebSocket=r?.WebSocket||v8.default}async start(){if(this._isClosed)throw new Error(M.t("websocketClient.errors.transportClosed"));let e=null;if(this._authProvider)try{let i=await this._authProvider.tokens();i?.access_token&&(e=i.access_token)}catch(i){try{let o=await this._authProvider.clientInformation();if(o){let s=await this._authProvider.tokens();if(s?.refresh_token){let a=await cQe(this._url,{clientInformation:o,refreshToken:s.refresh_token,addClientAuthentication:this._authProvider.addClientAuthentication});await this._authProvider.saveTokens(a),a?.access_token&&(e=a.access_token)}}}catch{if(this._authProvider.redirectToAuthorization){let s=this._authProvider.redirectUrl;throw await this._authProvider.redirectToAuthorization(typeof s=="string"?new URL(s):s),new Error(M.t("websocketClient.errors.unauthorizedOAuth"))}throw i}}let r={...this._websocketOptions?.headers};e&&(r.Authorization=`Bearer ${e}`),this._protocolVersion&&(r["MCP-Protocol-Version"]=this._protocolVersion);let n=new URL(this._url.toString());return n.protocol==="http:"?n.protocol="ws:":n.protocol==="https:"&&(n.protocol="wss:"),new Promise((i,o)=>{try{let s={headers:r};this._websocket=new this._WebSocket(n.toString(),s),this._websocket.on("open",()=>{i()}),this._websocket.on("error",a=>{let c=a.code!==void 0?a.code:void 0;o(new BX(c,`WebSocket error: ${a.message}`))}),this._websocket.on("message",async a=>{try{let c=a.toString(),u=JSON.parse(c);if(this._specialIds.has(Number(u.id))||u.type==="welcome")return;this.onmessage?.(await this._transformResponse(u))}catch(c){this.onerror?.(new Error(`Failed to parse WebSocket message: ${c instanceof Error?c.message:String(c)}`))}}),this._websocket.on("close",()=>{this._isClosed||(this._isClosed=!0,this.onclose?.())})}catch(s){o(new BX(void 0,`Failed to create WebSocket: ${s}`))}})}async finishAuth(e){if(!this._authProvider)throw new Error(M.t("websocketClient.errors.noAuthProvider"));try{let r=await this._authProvider.clientInformation();if(r){let n=this._authProvider.redirectUrl.toString(),i=await lQe(this._url,{clientInformation:r,authorizationCode:e,codeVerifier:await this._authProvider.codeVerifier(),redirectUri:n,addClientAuthentication:this._authProvider.addClientAuthentication});await this._authProvider.saveTokens(i)}else throw new Error(M.t("websocketClient.errors.clientInfoNotAvailable"))}catch(r){throw new Error(`Failed to exchange authorization code for access token: ${r}`)}}async close(){this._isClosed=!0,this._websocket&&this._websocket.readyState===v8.default.OPEN?this._websocket.close():this.onclose?.()}async send(e){if(this._isClosed)throw new Error(M.t("websocketClient.errors.transportClosed"));if(!this._websocket)throw new Error(M.t("websocketClient.errors.transportNotStarted"));if(this._websocket.readyState!==v8.default.OPEN)throw new Error(M.t("websocketClient.errors.websocketNotOpen"));try{if(e.method==="notifications/initialized")return;let r=await this._transformRequest(e),n=JSON.stringify(r);this._websocket.send(n)}catch(r){throw new BX(void 0,`Failed to send message: ${r instanceof Error?r.message:String(r)}`)}}async _transformRequest(e){if(e.method==="initialize")return{type:RX.CLI_CONNECT,id:e.id,timestamp:Date.now(),payload:{clientInfo:{version:"0.2.37-beta.0",platform:process.platform,workingDirectory:process.cwd()}}};if(e.method==="tools/call"&&e.params?.name==="openDiff"){let{arguments:r}=e.params||{},{filePath:n,newContent:i}=r||{};return{type:RX.SHOW_DIFF,id:e.id,timestamp:Date.now(),payload:{originalText:await RFn(n,"utf8"),modifiedText:i}}}return e}async _transformResponse(e){if(e.type==="connection_ack")return{jsonrpc:"2.0",id:e.id,result:{protocolVersion:"2024-11-05",capabilities:{logging:{},prompts:{},resources:{},tools:{}},serverInfo:{name:"JetBrains Plugin Server",title:"JetBrains Plugin Server",version:"1.0.0"}}};if(e.type==="selection_changed"){let r=await this._getSelectedText();return{jsonrpc:"2.0",method:"ide/contextUpdate",params:{workspaceState:{openFiles:[{path:e.payload.fileName,timestamp:Date.now(),isActive:!0,selectedText:r}]}}}}return e.type==="active_file_changed"?{jsonrpc:"2.0",method:"ide/contextUpdate",params:{workspaceState:{openFiles:[{path:e.payload.fileName,timestamp:Date.now(),isActive:!0}]}}}:e}async _getSelectedText(){if(!this._websocket)return"";let e=performance.now();return this._specialIds.add(e),this._websocket.send(JSON.stringify({type:RX.GET_SELECTED_TEXT,id:e,timestamp:Date.now()})),new Promise((r,n)=>{this._websocket.once("message",i=>{try{let o=JSON.parse(i.toString());Number(o.id)===e&&(this._specialIds.delete(e),o.payload.success?r(o.payload.data.text):n(o.payload.error))}catch{r("")}})})}setProtocolVersion(e){this._protocolVersion=e}}});var lUt,hme,cUt=ae(()=>{"use strict";lUt=Fe(pK(),1);qn();hme=class{config;auth;redirectUrl="";clientMetadata={client_name:"iFlow CLI (Google ADC)",redirect_uris:[],grant_types:[],response_types:[],token_endpoint_auth_method:"none"};_clientInformation;constructor(e){this.config=e;let r=this.config?.oauth?.scopes;if(!r||r.length===0)throw new Error(M.t("mcp.auth.scopesRequired"));this.auth=new lUt.GoogleAuth({scopes:r})}clientInformation(){return this._clientInformation}saveClientInformation(e){this._clientInformation=e}async tokens(){let r=await(await this.auth.getClient()).getAccessToken();if(!r.token){console.error(M.t("mcp.auth.failedToGetAccessToken"));return}return{access_token:r.token,token_type:"Bearer"}}saveTokens(e){}redirectToAuthorization(e){}saveCodeVerifier(e){}codeVerifier(){return""}}});import{execFile as BFn}from"node:child_process";import{promisify as NFn}from"node:util";import{platform as OFn}from"node:os";import{URL as kFn}from"node:url";function MFn(t){let e;try{e=new kFn(t)}catch{throw new Error(`Invalid URL: ${t}`)}if(e.protocol!=="http:"&&e.protocol!=="https:")throw new Error(`Unsafe protocol: ${e.protocol}. Only HTTP and HTTPS are allowed.`);if(/[\r\n\x00-\x1f]/.test(t))throw new Error("URL contains invalid characters")}async function dUt(t){MFn(t);let e=OFn(),r,n;switch(e){case"darwin":r="open",n=[t];break;case"win32":r="powershell.exe",n=["-NoProfile","-NonInteractive","-WindowStyle","Hidden","-Command",`Start-Process '${t.replace(/'/g,"''")}'`];break;case"linux":case"freebsd":case"openbsd":r="xdg-open",n=[t];break;default:throw new Error(`Unsupported platform: ${e}`)}let i={env:{...process.env,SHELL:void 0},detached:!0,stdio:"ignore"};try{await uUt(r,n,i)}catch(o){if((e==="linux"||e==="freebsd"||e==="openbsd")&&r==="xdg-open"){let s=["gnome-open","kde-open","firefox","chromium","google-chrome"];for(let a of s)try{await uUt(a,[t],i);return}catch{continue}}throw new Error(`Failed to open browser: ${o instanceof Error?o.message:"Unknown error"}`)}}var uUt,fUt=ae(()=>{"use strict";uUt=NFn(BFn)});function cs(t){return t instanceof Error&&"code"in t}function or(t){if(t instanceof Error)return t.message;try{return String(t)}catch{return"Failed to get error details"}}function pQe(t){if(t&&typeof t=="object"&&"response"in t){let r=PFn(t);if(r.error&&r.error.message&&r.error.code)switch(r.error.code){case 400:return new gme(r.error.message);case 401:return new hS(r.error.message);case 403:return new mme(r.error.message);default:}}return t}function PFn(t){return typeof t.response?.data=="string"?JSON.parse(t.response?.data):t.response?.data}var mme,hS,gme,lu=ae(()=>{"use strict";mme=class extends Error{},hS=class extends Error{},gme=class extends Error{}});import{promises as DU}from"node:fs";import*as Ame from"node:path";import*as pUt from"node:os";var Rp,yme=ae(()=>{"use strict";lu();qn();Rp=class{static TOKEN_FILE="mcp-oauth-tokens.json";static CONFIG_DIR=".iflow";static getTokenFilePath(){let e=pUt.homedir();return Ame.join(e,this.CONFIG_DIR,this.TOKEN_FILE)}static async ensureConfigDir(){let e=Ame.dirname(this.getTokenFilePath());await DU.mkdir(e,{recursive:!0})}static async loadTokens(){let e=new Map;try{let r=this.getTokenFilePath(),n=await DU.readFile(r,"utf-8"),i=JSON.parse(n);for(let o of i)e.set(o.serverName,o)}catch(r){r.code!=="ENOENT"&&console.error(M.t("mcp.tokenStorage.errors.failedToLoadTokens",{error:or(r)}))}return e}static async saveToken(e,r,n,i,o){await this.ensureConfigDir();let s=await this.loadTokens(),a={serverName:e,token:r,clientId:n,tokenUrl:i,mcpServerUrl:o,updatedAt:Date.now()};s.set(e,a);let c=Array.from(s.values()),u=this.getTokenFilePath();try{await DU.writeFile(u,JSON.stringify(c,null,2),{mode:384})}catch(d){throw console.error(M.t("mcp.tokenStorage.errors.failedToSaveToken",{error:or(d)})),d}}static async getToken(e){return(await this.loadTokens()).get(e)||null}static async removeToken(e){let r=await this.loadTokens();if(r.delete(e)){let n=Array.from(r.values()),i=this.getTokenFilePath();try{n.length===0?await DU.unlink(i):await DU.writeFile(i,JSON.stringify(n,null,2),{mode:384})}catch(o){console.error(M.t("mcp.tokenStorage.errors.failedToRemoveToken",{error:or(o)}))}}}static isTokenExpired(e){if(!e.expiresAt)return!1;let r=300*1e3;return Date.now()+r>=e.expiresAt}static async clearAllTokens(){try{let e=this.getTokenFilePath();await DU.unlink(e)}catch(e){e.code!=="ENOENT"&&console.error(M.t("mcp.tokenStorage.errors.failedToClearTokens",{error:or(e)}))}}}});var Bp,Eme=ae(()=>{"use strict";lu();qn();Bp=class{static buildWellKnownUrls(e){let r=new URL(e),n=`${r.protocol}//${r.host}`;return{protectedResource:new URL("/.well-known/oauth-protected-resource",n).toString(),authorizationServer:new URL("/.well-known/oauth-authorization-server",n).toString()}}static async fetchProtectedResourceMetadata(e){try{let r=await fetch(e);return r.ok?await r.json():null}catch(r){return console.debug(`Failed to fetch protected resource metadata from ${e}: ${or(r)}`),null}}static async fetchAuthorizationServerMetadata(e){try{let r=await fetch(e);return r.ok?await r.json():null}catch(r){return console.debug(`Failed to fetch authorization server metadata from ${e}: ${or(r)}`),null}}static metadataToOAuthConfig(e){return{authorizationUrl:e.authorization_endpoint,tokenUrl:e.token_endpoint,scopes:e.scopes_supported||[]}}static async discoverOAuthConfig(e){try{let r=this.buildWellKnownUrls(e),n=await this.fetchProtectedResourceMetadata(r.protectedResource);if(n?.authorization_servers?.length){let o=n.authorization_servers[0],s=new URL("/.well-known/oauth-authorization-server",o).toString(),a=await this.fetchAuthorizationServerMetadata(s);if(a){let c=this.metadataToOAuthConfig(a);return a.registration_endpoint&&console.log(M.t("mcp.oauth.discovery.dynamicRegistrationSupported"),a.registration_endpoint),c}}console.debug(`Trying OAuth discovery fallback at ${r.authorizationServer}`);let i=await this.fetchAuthorizationServerMetadata(r.authorizationServer);if(i){let o=this.metadataToOAuthConfig(i);return i.registration_endpoint&&console.log(M.t("mcp.oauth.discovery.dynamicRegistrationSupported"),i.registration_endpoint),o}return null}catch(r){return console.debug(`Failed to discover OAuth configuration: ${or(r)}`),null}}static parseWWWAuthenticateHeader(e){let r=e.match(/resource_metadata="([^"]+)"/);return r?r[1]:null}static async discoverOAuthFromWWWAuthenticate(e){let r=this.parseWWWAuthenticateHeader(e);if(!r)return null;console.log(M.t("mcp.oauth.discovery.foundResourceMetadataUri",{uri:r}));let n=await this.fetchProtectedResourceMetadata(r);if(!n?.authorization_servers?.length)return null;let i=n.authorization_servers[0],o=new URL("/.well-known/oauth-authorization-server",i).toString(),s=await this.fetchAuthorizationServerMetadata(o);return s?(console.log(M.t("mcp.oauth.discovery.configDiscoveredFromWwwAuth")),this.metadataToOAuthConfig(s)):null}static extractBaseUrl(e){let r=new URL(e);return`${r.protocol}//${r.host}`}static isSSEEndpoint(e){return e.includes("/sse")||!e.includes("/mcp")}static buildResourceParameter(e){let r=new URL(e);return`${r.protocol}//${r.host}`}}});import*as hUt from"node:http";import*as NX from"node:crypto";import{URL as hQe}from"node:url";var x1,mQe=ae(()=>{"use strict";fUt();yme();lu();Eme();qn();x1=class{static REDIRECT_PORT=7777;static REDIRECT_PATH="/oauth/callback";static HTTP_OK=200;static HTTP_REDIRECT=302;static async registerClient(e,r){let i={client_name:"iFlow CLI MCP Client",redirect_uris:[r.redirectUri||`http://localhost:${this.REDIRECT_PORT}${this.REDIRECT_PATH}`],grant_types:["authorization_code","refresh_token"],response_types:["code"],token_endpoint_auth_method:"none",code_challenge_method:["S256"],scope:r.scopes?.join(" ")||""},o=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(i)});if(!o.ok){let s=await o.text();throw new Error(M.t("mcp.auth.clientRegistrationFailed",{status:o.status,statusText:o.statusText,error:s}))}return await o.json()}static async discoverOAuthFromMCPServer(e){let r=Bp.extractBaseUrl(e);return Bp.discoverOAuthConfig(r)}static generatePKCEParams(){let e=NX.randomBytes(32).toString("base64url"),r=NX.createHash("sha256").update(e).digest("base64url"),n=NX.randomBytes(16).toString("base64url");return{codeVerifier:e,codeChallenge:r,state:n}}static async startCallbackServer(e){return new Promise((r,n)=>{let i=hUt.createServer(async(o,s)=>{try{let a=new hQe(o.url,`http://localhost:${this.REDIRECT_PORT}`);if(a.pathname!==this.REDIRECT_PATH){s.writeHead(404),s.end(M.t("mcp.ui.notFound"));return}let c=a.searchParams.get("code"),u=a.searchParams.get("state"),d=a.searchParams.get("error");if(d){s.writeHead(this.HTTP_OK,{"Content-Type":"text/html"}),s.end(`
842
842
  <html>
843
843
  <body>
844
844
  <h1>${M.t("mcp.ui.authenticationFailed")}</h1>
@@ -2902,8 +2902,8 @@ IMPORTANT: Always use the ${Wl.Name} and '${K4.Name}'tool to plan and track task
2902
2902
  - **Feedback:** To report a bug or provide feedback, please use the /bug command.
2903
2903
 
2904
2904
  ${(function(){let s=rA.env.SANDBOX==="sandbox-exec",a=!!rA.env.SANDBOX;return s?`
2905
- # MacOS Seatbelt
2906
- You are running under macos seatbelt with limited access to files outside the project directory or system temp directory, and with limited access to host system resources such as ports. If you encounter failures that could be due to MacOS Seatbelt (e.g. if a command fails with 'Operation not permitted' or similar error), as you report the error to the user, also explain why you think it could be due to MacOS Seatbelt, and how the user may need to adjust their Seatbelt profile.
2905
+ # macOS Seatbelt
2906
+ You are running under macOS seatbelt with limited access to files outside the project directory or system temp directory, and with limited access to host system resources such as ports. If you encounter failures that could be due to macOS Seatbelt (e.g. if a command fails with 'Operation not permitted' or similar error), as you report the error to the user, also explain why you think it could be due to macOS Seatbelt, and how the user may need to adjust their Seatbelt profile.
2907
2907
  `:a?`
2908
2908
  # Sandbox
2909
2909
  You are running in a sandbox container with limited access to files outside the project directory or system temp directory, and with limited access to host system resources such as ports. If you encounter failures that could be due to sandboxing (e.g. if a command fails with 'Operation not permitted' or similar error), when you report the error to the user, also explain why you think it could be due to sandboxing, and how the user may need to adjust their sandbox configuration.
@@ -2985,8 +2985,8 @@ If the user asks for help or wants to give feedback inform them of the following
2985
2985
  When the user directly asks about ${t} (eg 'can ${t} do...', 'does ${t} have...') or asks in second person (eg 'are you able...', 'can you do...'), first use the ${eE.Name} tool to gather information to answer the question from ${t} docs at ${e}.
2986
2986
 
2987
2987
  ${(function(){let s=rA.env.SANDBOX==="sandbox-exec",a=!!rA.env.SANDBOX;return s?`
2988
- # MacOS Seatbelt
2989
- You are running under macOS seatbelt with limited access to files outside the project directory or system temp directory, and with limited access to host system resources such as ports. If you encounter failures that could be due to MacOS Seatbelt (e.g. if a command fails with 'Operation not permitted' or similar error), as you report the error to the user, also explain why you think it could be due to MacOS Seatbelt, and how the user may need to adjust their Seatbelt profile.
2988
+ # macOS Seatbelt
2989
+ You are running under macOS seatbelt with limited access to files outside the project directory or system temp directory, and with limited access to host system resources such as ports. If you encounter failures that could be due to macOS Seatbelt (e.g. if a command fails with 'Operation not permitted' or similar error), as you report the error to the user, also explain why you think it could be due to macOS Seatbelt, and how the user may need to adjust their Seatbelt profile.
2990
2990
  `:a?`
2991
2991
  # Sandbox
2992
2992
  You are running in a sandbox container with limited access to files outside the project directory or system temp directory, and with limited access to host system resources such as ports. If you encounter failures that could be due to sandboxing (e.g. if a command fails with 'Operation not permitted' or similar error), when you report the error to the user, also explain why you think it could be due to sandboxing, and how the user may need to adjust their sandbox configuration.
@@ -3184,7 +3184,7 @@ When summarizing the conversation focus on typescript code changes and also reme
3184
3184
  # Summary instructions
3185
3185
  When you are using compact - please focus on test output and code changes. Include file reads verbatim.
3186
3186
  </example>
3187
- `.trim()}async function hft(t,e){let r=rW(t,e),n=`
3187
+ `.trim()}async function hft(t,e){let r=await rW(t,e),n=`
3188
3188
 
3189
3189
  # PLAN MODE ACTIVE
3190
3190
 
@@ -3282,7 +3282,7 @@ To resolve the conflict:`,(0,$xe.getConflictResolutionRecipe)(o,e))),n=i):Iqr.di
3282
3282
  `,`Details:
3283
3283
  `,(0,$xe.getIncompatibilityDetails)(o,e),`To resolve the conflict:
3284
3284
  `,(0,$xe.getConflictResolutionRecipe)(o,e))}return n}};jxe.MetricStorageRegistry=k2t});var Rqr=D(zxe=>{"use strict";Object.defineProperty(zxe,"__esModule",{value:!0});zxe.MultiMetricStorage=void 0;var M2t=class{constructor(e){this._backingStorages=e}record(e,r,n,i){this._backingStorages.forEach(o=>{o.record(e,r,n,i)})}};zxe.MultiMetricStorage=M2t});var Nqr=D(A$=>{"use strict";Object.defineProperty(A$,"__esModule",{value:!0});A$.BatchObservableResultImpl=A$.ObservableResultImpl=void 0;var g$=(Ur(),pr(Wr)),Bqr=gae(),Lno=Uxe(),P2t=class{constructor(e,r){this._instrumentName=e,this._valueType=r,this._buffer=new Bqr.AttributeHashMap}observe(e,r={}){if(typeof e!="number"){g$.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===g$.ValueType.INT&&!Number.isInteger(e)&&(g$.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(r,e)}};A$.ObservableResultImpl=P2t;var L2t=class{constructor(){this._buffer=new Map}observe(e,r,n={}){if(!(0,Lno.isObservableInstrument)(e))return;let i=this._buffer.get(e);if(i==null&&(i=new Bqr.AttributeHashMap,this._buffer.set(e,i)),typeof r!="number"){g$.diag.warn(`non-number value provided to metric ${e._descriptor.name}: ${r}`);return}e._descriptor.valueType===g$.ValueType.INT&&!Number.isInteger(r)&&(g$.diag.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),r=Math.trunc(r),!Number.isInteger(r))||i.set(n,r)}};A$.BatchObservableResultImpl=L2t});var Mqr=D(Yxe=>{"use strict";Object.defineProperty(Yxe,"__esModule",{value:!0});Yxe.ObservableRegistry=void 0;var Fno=(Ur(),pr(Wr)),Oqr=Uxe(),kqr=Nqr(),Aae=sC(),F2t=class{constructor(){this._callbacks=[],this._batchCallbacks=[]}addCallback(e,r){this._findCallback(e,r)>=0||this._callbacks.push({callback:e,instrument:r})}removeCallback(e,r){let n=this._findCallback(e,r);n<0||this._callbacks.splice(n,1)}addBatchCallback(e,r){let n=new Set(r.filter(Oqr.isObservableInstrument));if(n.size===0){Fno.diag.error("BatchObservableCallback is not associated with valid instruments",r);return}this._findBatchCallback(e,n)>=0||this._batchCallbacks.push({callback:e,instruments:n})}removeBatchCallback(e,r){let n=new Set(r.filter(Oqr.isObservableInstrument)),i=this._findBatchCallback(e,n);i<0||this._batchCallbacks.splice(i,1)}async observe(e,r){let n=this._observeCallbacks(e,r),i=this._observeBatchCallbacks(e,r);return(await(0,Aae.PromiseAllSettled)([...n,...i])).filter(Aae.isPromiseAllSettledRejectionResult).map(a=>a.reason)}_observeCallbacks(e,r){return this._callbacks.map(async({callback:n,instrument:i})=>{let o=new kqr.ObservableResultImpl(i._descriptor.name,i._descriptor.valueType),s=Promise.resolve(n(o));r!=null&&(s=(0,Aae.callWithTimeout)(s,r)),await s,i._metricStorages.forEach(a=>{a.record(o._buffer,e)})})}_observeBatchCallbacks(e,r){return this._batchCallbacks.map(async({callback:n,instruments:i})=>{let o=new kqr.BatchObservableResultImpl,s=Promise.resolve(n(o));r!=null&&(s=(0,Aae.callWithTimeout)(s,r)),await s,i.forEach(a=>{let c=o._buffer.get(a);c!=null&&a._metricStorages.forEach(u=>{u.record(c,e)})})})}_findCallback(e,r){return this._callbacks.findIndex(n=>n.callback===e&&n.instrument===r)}_findBatchCallback(e,r){return this._batchCallbacks.findIndex(n=>n.callback===e&&(0,Aae.setEquals)(n.instruments,r))}};Yxe.ObservableRegistry=F2t});var Pqr=D(Jxe=>{"use strict";Object.defineProperty(Jxe,"__esModule",{value:!0});Jxe.SyncMetricStorage=void 0;var Uno=_2t(),Qno=R2t(),qno=N2t(),U2t=class extends Uno.MetricStorage{constructor(e,r,n,i){super(e),this._attributesProcessor=n,this._deltaMetricStorage=new Qno.DeltaMetricProcessor(r),this._temporalMetricStorage=new qno.TemporalMetricProcessor(r,i)}record(e,r,n,i){r=this._attributesProcessor.process(r,n),this._deltaMetricStorage.record(e,r,n,i)}collect(e,r){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,r)}};Jxe.SyncMetricStorage=U2t});var q2t=D(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});X_.FilteringAttributesProcessor=X_.NoopAttributesProcessor=X_.AttributesProcessor=void 0;var yae=class{static Noop(){return Gno}};X_.AttributesProcessor=yae;var Kxe=class extends yae{process(e,r){return e}};X_.NoopAttributesProcessor=Kxe;var Q2t=class extends yae{constructor(e){super(),this._allowedAttributeNames=e}process(e,r){let n={};return Object.keys(e).filter(i=>this._allowedAttributeNames.includes(i)).forEach(i=>n[i]=e[i]),n}};X_.FilteringAttributesProcessor=Q2t;var Gno=new Kxe});var Lqr=D(Xxe=>{"use strict";Object.defineProperty(Xxe,"__esModule",{value:!0});Xxe.MeterSharedState=void 0;var Hno=V9(),Vno=Cqr(),Wno=sC(),$no=bqr(),jno=Dqr(),zno=Rqr(),Yno=Mqr(),Jno=Pqr(),Kno=q2t(),G2t=class{constructor(e,r){this._meterProviderSharedState=e,this._instrumentationScope=r,this.metricStorageRegistry=new jno.MetricStorageRegistry,this.observableRegistry=new Yno.ObservableRegistry,this.meter=new Vno.Meter(this)}registerMetricStorage(e){let r=this._registerMetricStorage(e,Jno.SyncMetricStorage);return r.length===1?r[0]:new zno.MultiMetricStorage(r)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,$no.AsyncMetricStorage)}async collect(e,r,n){let i=await this.observableRegistry.observe(r,n?.timeoutMillis),o=this.metricStorageRegistry.getStorages(e);if(o.length===0)return null;let s=o.map(a=>a.collect(e,r)).filter(Wno.isNotNullish);return s.length===0?{errors:i}:{scopeMetrics:{scope:this._instrumentationScope,metrics:s},errors:i}}_registerMetricStorage(e,r){let i=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(o=>{let s=(0,Hno.createInstrumentDescriptorWithView)(o,e),a=this.metricStorageRegistry.findOrUpdateCompatibleStorage(s);if(a!=null)return a;let c=o.aggregation.createAggregator(s),u=new r(s,c,o.attributesProcessor,this._meterProviderSharedState.metricCollectors);return this.metricStorageRegistry.register(u),u});if(i.length===0){let s=this._meterProviderSharedState.selectAggregations(e.type).map(([a,c])=>{let u=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(a,e);if(u!=null)return u;let d=c.createAggregator(e),f=new r(e,d,Kno.AttributesProcessor.Noop(),[a]);return this.metricStorageRegistry.registerForCollector(a,f),f});i=i.concat(s)}return i}};Xxe.MeterSharedState=G2t});var Fqr=D(Zxe=>{"use strict";Object.defineProperty(Zxe,"__esModule",{value:!0});Zxe.MeterProviderSharedState=void 0;var Xno=sC(),Zno=vqr(),eio=Lqr(),H2t=class{constructor(e){this.resource=e,this.viewRegistry=new Zno.ViewRegistry,this.metricCollectors=[],this.meterSharedStates=new Map}getMeterSharedState(e){let r=(0,Xno.instrumentationScopeId)(e),n=this.meterSharedStates.get(r);return n==null&&(n=new eio.MeterSharedState(this,e),this.meterSharedStates.set(r,n)),n}selectAggregations(e){let r=[];for(let n of this.metricCollectors)r.push([n,n.selectAggregation(e)]);return r}};Zxe.MeterProviderSharedState=H2t});var Uqr=D(e7e=>{"use strict";Object.defineProperty(e7e,"__esModule",{value:!0});e7e.MetricCollector=void 0;var tio=jn(),V2t=class{constructor(e,r){this._sharedState=e,this._metricReader=r}async collect(e){let r=(0,tio.millisToHrTime)(Date.now()),n=[],i=[],o=Array.from(this._sharedState.meterSharedStates.values()).map(async s=>{let a=await s.collect(this,r,e);a?.scopeMetrics!=null&&n.push(a.scopeMetrics),a?.errors!=null&&i.push(...a.errors)});return await Promise.all(o),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:n},errors:i}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}};e7e.MetricCollector=V2t});var qqr=D(r7e=>{"use strict";Object.defineProperty(r7e,"__esModule",{value:!0});r7e.MeterProvider=void 0;var t7e=(Ur(),pr(Wr)),Qqr=K_(),rio=Fqr(),nio=Uqr(),W2t=class{constructor(e){var r;this._shutdown=!1;let n=Qqr.Resource.default().merge((r=e?.resource)!==null&&r!==void 0?r:Qqr.Resource.empty());if(this._sharedState=new rio.MeterProviderSharedState(n),e?.views!=null&&e.views.length>0)for(let i of e.views)this._sharedState.viewRegistry.addView(i);if(e?.readers!=null&&e.readers.length>0)for(let i of e.readers)this.addMetricReader(i)}getMeter(e,r="",n={}){return this._shutdown?(t7e.diag.warn("A shutdown MeterProvider cannot provide a Meter"),(0,t7e.createNoopMeter)()):this._sharedState.getMeterSharedState({name:e,version:r,schemaUrl:n.schemaUrl}).meter}addMetricReader(e){let r=new nio.MetricCollector(this._sharedState,e);e.setMetricProducer(r),this._sharedState.metricCollectors.push(r)}async shutdown(e){if(this._shutdown){t7e.diag.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(r=>r.shutdown(e)))}async forceFlush(e){if(this._shutdown){t7e.diag.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(r=>r.forceFlush(e)))}};r7e.MeterProvider=W2t});var n7e=D(y$=>{"use strict";Object.defineProperty(y$,"__esModule",{value:!0});y$.ExactPredicate=y$.PatternPredicate=void 0;var iio=/[\^$\\.+?()[\]{}|]/g,$2t=class t{constructor(e){e==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(t.escapePattern(e)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(iio,"\\$&").replace("*",".*")}$`}static hasWildcard(e){return e.includes("*")}};y$.PatternPredicate=$2t;var j2t=class{constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}};y$.ExactPredicate=j2t});var Hqr=D(i7e=>{"use strict";Object.defineProperty(i7e,"__esModule",{value:!0});i7e.InstrumentSelector=void 0;var Gqr=n7e(),z2t=class{constructor(e){var r;this._nameFilter=new Gqr.PatternPredicate((r=e?.name)!==null&&r!==void 0?r:"*"),this._type=e?.type,this._unitFilter=new Gqr.ExactPredicate(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}};i7e.InstrumentSelector=z2t});var Vqr=D(o7e=>{"use strict";Object.defineProperty(o7e,"__esModule",{value:!0});o7e.MeterSelector=void 0;var Y2t=n7e(),J2t=class{constructor(e){this._nameFilter=new Y2t.ExactPredicate(e?.name),this._versionFilter=new Y2t.ExactPredicate(e?.version),this._schemaUrlFilter=new Y2t.ExactPredicate(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};o7e.MeterSelector=J2t});var $qr=D(s7e=>{"use strict";Object.defineProperty(s7e,"__esModule",{value:!0});s7e.View=void 0;var oio=n7e(),Wqr=q2t(),sio=Hqr(),aio=Vqr(),lio=axe();function cio(t){return t.instrumentName==null&&t.instrumentType==null&&t.instrumentUnit==null&&t.meterName==null&&t.meterVersion==null&&t.meterSchemaUrl==null}var K2t=class{constructor(e){var r;if(cio(e))throw new Error("Cannot create view with no selector arguments supplied");if(e.name!=null&&(e?.instrumentName==null||oio.PatternPredicate.hasWildcard(e.instrumentName)))throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.");e.attributeKeys!=null?this.attributesProcessor=new Wqr.FilteringAttributesProcessor(e.attributeKeys):this.attributesProcessor=Wqr.AttributesProcessor.Noop(),this.name=e.name,this.description=e.description,this.aggregation=(r=e.aggregation)!==null&&r!==void 0?r:lio.Aggregation.Default(),this.instrumentSelector=new sio.InstrumentSelector({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new aio.MeterSelector({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl})}};s7e.View=K2t});var dk=D(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.TimeoutError=gs.View=gs.Aggregation=gs.SumAggregation=gs.LastValueAggregation=gs.HistogramAggregation=gs.DropAggregation=gs.ExponentialHistogramAggregation=gs.ExplicitBucketHistogramAggregation=gs.DefaultAggregation=gs.MeterProvider=gs.InstrumentType=gs.ConsoleMetricExporter=gs.InMemoryMetricExporter=gs.PeriodicExportingMetricReader=gs.MetricReader=gs.DataPointType=gs.AggregationTemporality=void 0;var uio=W9e();Object.defineProperty(gs,"AggregationTemporality",{enumerable:!0,get:function(){return uio.AggregationTemporality}});var dio=JW();Object.defineProperty(gs,"DataPointType",{enumerable:!0,get:function(){return dio.DataPointType}});var fio=Wgt();Object.defineProperty(gs,"MetricReader",{enumerable:!0,get:function(){return fio.MetricReader}});var pio=GQr();Object.defineProperty(gs,"PeriodicExportingMetricReader",{enumerable:!0,get:function(){return pio.PeriodicExportingMetricReader}});var hio=VQr();Object.defineProperty(gs,"InMemoryMetricExporter",{enumerable:!0,get:function(){return hio.InMemoryMetricExporter}});var mio=$Qr();Object.defineProperty(gs,"ConsoleMetricExporter",{enumerable:!0,get:function(){return mio.ConsoleMetricExporter}});var gio=V9();Object.defineProperty(gs,"InstrumentType",{enumerable:!0,get:function(){return gio.InstrumentType}});var Aio=qqr();Object.defineProperty(gs,"MeterProvider",{enumerable:!0,get:function(){return Aio.MeterProvider}});var Z_=axe();Object.defineProperty(gs,"DefaultAggregation",{enumerable:!0,get:function(){return Z_.DefaultAggregation}});Object.defineProperty(gs,"ExplicitBucketHistogramAggregation",{enumerable:!0,get:function(){return Z_.ExplicitBucketHistogramAggregation}});Object.defineProperty(gs,"ExponentialHistogramAggregation",{enumerable:!0,get:function(){return Z_.ExponentialHistogramAggregation}});Object.defineProperty(gs,"DropAggregation",{enumerable:!0,get:function(){return Z_.DropAggregation}});Object.defineProperty(gs,"HistogramAggregation",{enumerable:!0,get:function(){return Z_.HistogramAggregation}});Object.defineProperty(gs,"LastValueAggregation",{enumerable:!0,get:function(){return Z_.LastValueAggregation}});Object.defineProperty(gs,"SumAggregation",{enumerable:!0,get:function(){return Z_.SumAggregation}});Object.defineProperty(gs,"Aggregation",{enumerable:!0,get:function(){return Z_.Aggregation}});var yio=$qr();Object.defineProperty(gs,"View",{enumerable:!0,get:function(){return yio.View}});var Eio=sC();Object.defineProperty(gs,"TimeoutError",{enumerable:!0,get:function(){return Eio.TimeoutError}})});var Kqr=D(eT=>{"use strict";Object.defineProperty(eT,"__esModule",{value:!0});eT.toMetric=eT.toScopeMetrics=eT.toResourceMetrics=void 0;var jqr=(Ur(),pr(Wr)),E$=dk(),vio=iae(),a7e=YW(),Cio=G9e();function bio(t,e){let r=(0,vio.getOtlpEncoder)(e);return{resource:(0,Cio.createResource)(t.resource),schemaUrl:void 0,scopeMetrics:Yqr(t.scopeMetrics,r)}}eT.toResourceMetrics=bio;function Yqr(t,e){return Array.from(t.map(r=>({scope:(0,a7e.createInstrumentationScope)(r.scope),metrics:r.metrics.map(n=>Jqr(n,e)),schemaUrl:r.scope.schemaUrl})))}eT.toScopeMetrics=Yqr;function Jqr(t,e){let r={name:t.descriptor.name,description:t.descriptor.description,unit:t.descriptor.unit},n=_io(t.aggregationTemporality);switch(t.dataPointType){case E$.DataPointType.SUM:r.sum={aggregationTemporality:n,isMonotonic:t.isMonotonic,dataPoints:zqr(t,e)};break;case E$.DataPointType.GAUGE:r.gauge={dataPoints:zqr(t,e)};break;case E$.DataPointType.HISTOGRAM:r.histogram={aggregationTemporality:n,dataPoints:Sio(t,e)};break;case E$.DataPointType.EXPONENTIAL_HISTOGRAM:r.exponentialHistogram={aggregationTemporality:n,dataPoints:wio(t,e)};break}return r}eT.toMetric=Jqr;function xio(t,e,r){let n={attributes:(0,a7e.toAttributes)(t.attributes),startTimeUnixNano:r.encodeHrTime(t.startTime),timeUnixNano:r.encodeHrTime(t.endTime)};switch(e){case jqr.ValueType.INT:n.asInt=t.value;break;case jqr.ValueType.DOUBLE:n.asDouble=t.value;break}return n}function zqr(t,e){return t.dataPoints.map(r=>xio(r,t.descriptor.valueType,e))}function Sio(t,e){return t.dataPoints.map(r=>{let n=r.value;return{attributes:(0,a7e.toAttributes)(r.attributes),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:e.encodeHrTime(r.startTime),timeUnixNano:e.encodeHrTime(r.endTime)}})}function wio(t,e){return t.dataPoints.map(r=>{let n=r.value;return{attributes:(0,a7e.toAttributes)(r.attributes),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:e.encodeHrTime(r.startTime),timeUnixNano:e.encodeHrTime(r.endTime)}})}function _io(t){switch(t){case E$.AggregationTemporality.DELTA:return 1;case E$.AggregationTemporality.CUMULATIVE:return 2}}});var c7e=D(l7e=>{"use strict";Object.defineProperty(l7e,"__esModule",{value:!0});l7e.createExportMetricsServiceRequest=void 0;var Tio=Kqr();function Iio(t,e){return{resourceMetrics:t.map(r=>(0,Tio.toResourceMetrics)(r,e))}}l7e.createExportMetricsServiceRequest=Iio});var u7e=D(v$=>{"use strict";Object.defineProperty(v$,"__esModule",{value:!0});v$.toLogAttributes=v$.createExportLogsServiceRequest=void 0;var Dio=iae(),X2t=YW(),Rio=G9e();function Bio(t,e){let r=(0,Dio.getOtlpEncoder)(e);return{resourceLogs:Oio(t,r)}}v$.createExportLogsServiceRequest=Bio;function Nio(t){let e=new Map;for(let r of t){let{resource:n,instrumentationScope:{name:i,version:o="",schemaUrl:s=""}}=r,a=e.get(n);a||(a=new Map,e.set(n,a));let c=`${i}@${o}:${s}`,u=a.get(c);u||(u=[],a.set(c,u)),u.push(r)}return e}function Oio(t,e){let r=Nio(t);return Array.from(r,([n,i])=>({resource:(0,Rio.createResource)(n),scopeLogs:Array.from(i,([,o])=>({scope:(0,X2t.createInstrumentationScope)(o[0].instrumentationScope),logRecords:o.map(s=>kio(s,e)),schemaUrl:o[0].instrumentationScope.schemaUrl})),schemaUrl:void 0}))}function kio(t,e){var r,n,i;return{timeUnixNano:e.encodeHrTime(t.hrTime),observedTimeUnixNano:e.encodeHrTime(t.hrTimeObserved),severityNumber:t.severityNumber,severityText:t.severityText,body:(0,X2t.toAnyValue)(t.body),attributes:Xqr(t.attributes),droppedAttributesCount:t.droppedAttributesCount,flags:(r=t.spanContext)===null||r===void 0?void 0:r.traceFlags,traceId:e.encodeOptionalSpanContext((n=t.spanContext)===null||n===void 0?void 0:n.traceId),spanId:e.encodeOptionalSpanContext((i=t.spanContext)===null||i===void 0?void 0:i.spanId)}}function Xqr(t){return Object.keys(t).map(e=>(0,X2t.toKeyValue)(e,t[e]))}v$.toLogAttributes=Xqr});var eGr=D((fbs,Zqr)=>{"use strict";Zqr.exports=Mht()});var rGr=D((pbs,tGr)=>{"use strict";var bi=eGr(),vt=bi.Reader,Po=bi.Writer,Me=bi.util,Ne=bi.roots.default||(bi.roots.default={});Ne.opentelemetry=(function(){var t={};return t.proto=(function(){var e={};return e.common=(function(){var r={};return r.v1=(function(){var n={};return n.AnyValue=(function(){function i(s){if(s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}i.prototype.stringValue=null,i.prototype.boolValue=null,i.prototype.intValue=null,i.prototype.doubleValue=null,i.prototype.arrayValue=null,i.prototype.kvlistValue=null,i.prototype.bytesValue=null;var o;return Object.defineProperty(i.prototype,"value",{get:Me.oneOfGetter(o=["stringValue","boolValue","intValue","doubleValue","arrayValue","kvlistValue","bytesValue"]),set:Me.oneOfSetter(o)}),i.create=function(a){return new i(a)},i.encode=function(a,c){return c||(c=Po.create()),a.stringValue!=null&&Object.hasOwnProperty.call(a,"stringValue")&&c.uint32(10).string(a.stringValue),a.boolValue!=null&&Object.hasOwnProperty.call(a,"boolValue")&&c.uint32(16).bool(a.boolValue),a.intValue!=null&&Object.hasOwnProperty.call(a,"intValue")&&c.uint32(24).int64(a.intValue),a.doubleValue!=null&&Object.hasOwnProperty.call(a,"doubleValue")&&c.uint32(33).double(a.doubleValue),a.arrayValue!=null&&Object.hasOwnProperty.call(a,"arrayValue")&&Ne.opentelemetry.proto.common.v1.ArrayValue.encode(a.arrayValue,c.uint32(42).fork()).ldelim(),a.kvlistValue!=null&&Object.hasOwnProperty.call(a,"kvlistValue")&&Ne.opentelemetry.proto.common.v1.KeyValueList.encode(a.kvlistValue,c.uint32(50).fork()).ldelim(),a.bytesValue!=null&&Object.hasOwnProperty.call(a,"bytesValue")&&c.uint32(58).bytes(a.bytesValue),c},i.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},i.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.common.v1.AnyValue;a.pos<u;){var f=a.uint32();switch(f>>>3){case 1:{d.stringValue=a.string();break}case 2:{d.boolValue=a.bool();break}case 3:{d.intValue=a.int64();break}case 4:{d.doubleValue=a.double();break}case 5:{d.arrayValue=Ne.opentelemetry.proto.common.v1.ArrayValue.decode(a,a.uint32());break}case 6:{d.kvlistValue=Ne.opentelemetry.proto.common.v1.KeyValueList.decode(a,a.uint32());break}case 7:{d.bytesValue=a.bytes();break}default:a.skipType(f&7);break}}return d},i.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},i.verify=function(a){if(typeof a!="object"||a===null)return"object expected";var c={};if(a.stringValue!=null&&a.hasOwnProperty("stringValue")&&(c.value=1,!Me.isString(a.stringValue)))return"stringValue: string expected";if(a.boolValue!=null&&a.hasOwnProperty("boolValue")){if(c.value===1)return"value: multiple values";if(c.value=1,typeof a.boolValue!="boolean")return"boolValue: boolean expected"}if(a.intValue!=null&&a.hasOwnProperty("intValue")){if(c.value===1)return"value: multiple values";if(c.value=1,!Me.isInteger(a.intValue)&&!(a.intValue&&Me.isInteger(a.intValue.low)&&Me.isInteger(a.intValue.high)))return"intValue: integer|Long expected"}if(a.doubleValue!=null&&a.hasOwnProperty("doubleValue")){if(c.value===1)return"value: multiple values";if(c.value=1,typeof a.doubleValue!="number")return"doubleValue: number expected"}if(a.arrayValue!=null&&a.hasOwnProperty("arrayValue")){if(c.value===1)return"value: multiple values";c.value=1;{var u=Ne.opentelemetry.proto.common.v1.ArrayValue.verify(a.arrayValue);if(u)return"arrayValue."+u}}if(a.kvlistValue!=null&&a.hasOwnProperty("kvlistValue")){if(c.value===1)return"value: multiple values";c.value=1;{var u=Ne.opentelemetry.proto.common.v1.KeyValueList.verify(a.kvlistValue);if(u)return"kvlistValue."+u}}if(a.bytesValue!=null&&a.hasOwnProperty("bytesValue")){if(c.value===1)return"value: multiple values";if(c.value=1,!(a.bytesValue&&typeof a.bytesValue.length=="number"||Me.isString(a.bytesValue)))return"bytesValue: buffer expected"}return null},i.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.common.v1.AnyValue)return a;var c=new Ne.opentelemetry.proto.common.v1.AnyValue;if(a.stringValue!=null&&(c.stringValue=String(a.stringValue)),a.boolValue!=null&&(c.boolValue=!!a.boolValue),a.intValue!=null&&(Me.Long?(c.intValue=Me.Long.fromValue(a.intValue)).unsigned=!1:typeof a.intValue=="string"?c.intValue=parseInt(a.intValue,10):typeof a.intValue=="number"?c.intValue=a.intValue:typeof a.intValue=="object"&&(c.intValue=new Me.LongBits(a.intValue.low>>>0,a.intValue.high>>>0).toNumber())),a.doubleValue!=null&&(c.doubleValue=Number(a.doubleValue)),a.arrayValue!=null){if(typeof a.arrayValue!="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.arrayValue: object expected");c.arrayValue=Ne.opentelemetry.proto.common.v1.ArrayValue.fromObject(a.arrayValue)}if(a.kvlistValue!=null){if(typeof a.kvlistValue!="object")throw TypeError(".opentelemetry.proto.common.v1.AnyValue.kvlistValue: object expected");c.kvlistValue=Ne.opentelemetry.proto.common.v1.KeyValueList.fromObject(a.kvlistValue)}return a.bytesValue!=null&&(typeof a.bytesValue=="string"?Me.base64.decode(a.bytesValue,c.bytesValue=Me.newBuffer(Me.base64.length(a.bytesValue)),0):a.bytesValue.length>=0&&(c.bytesValue=a.bytesValue)),c},i.toObject=function(a,c){c||(c={});var u={};return a.stringValue!=null&&a.hasOwnProperty("stringValue")&&(u.stringValue=a.stringValue,c.oneofs&&(u.value="stringValue")),a.boolValue!=null&&a.hasOwnProperty("boolValue")&&(u.boolValue=a.boolValue,c.oneofs&&(u.value="boolValue")),a.intValue!=null&&a.hasOwnProperty("intValue")&&(typeof a.intValue=="number"?u.intValue=c.longs===String?String(a.intValue):a.intValue:u.intValue=c.longs===String?Me.Long.prototype.toString.call(a.intValue):c.longs===Number?new Me.LongBits(a.intValue.low>>>0,a.intValue.high>>>0).toNumber():a.intValue,c.oneofs&&(u.value="intValue")),a.doubleValue!=null&&a.hasOwnProperty("doubleValue")&&(u.doubleValue=c.json&&!isFinite(a.doubleValue)?String(a.doubleValue):a.doubleValue,c.oneofs&&(u.value="doubleValue")),a.arrayValue!=null&&a.hasOwnProperty("arrayValue")&&(u.arrayValue=Ne.opentelemetry.proto.common.v1.ArrayValue.toObject(a.arrayValue,c),c.oneofs&&(u.value="arrayValue")),a.kvlistValue!=null&&a.hasOwnProperty("kvlistValue")&&(u.kvlistValue=Ne.opentelemetry.proto.common.v1.KeyValueList.toObject(a.kvlistValue,c),c.oneofs&&(u.value="kvlistValue")),a.bytesValue!=null&&a.hasOwnProperty("bytesValue")&&(u.bytesValue=c.bytes===String?Me.base64.encode(a.bytesValue,0,a.bytesValue.length):c.bytes===Array?Array.prototype.slice.call(a.bytesValue):a.bytesValue,c.oneofs&&(u.value="bytesValue")),u},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.common.v1.AnyValue"},i})(),n.ArrayValue=(function(){function i(o){if(this.values=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.values=Me.emptyArray,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.values!=null&&s.values.length)for(var c=0;c<s.values.length;++c)Ne.opentelemetry.proto.common.v1.AnyValue.encode(s.values[c],a.uint32(10).fork()).ldelim();return a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.common.v1.ArrayValue;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.values&&u.values.length||(u.values=[]),u.values.push(Ne.opentelemetry.proto.common.v1.AnyValue.decode(s,s.uint32()));break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.values!=null&&s.hasOwnProperty("values")){if(!Array.isArray(s.values))return"values: array expected";for(var a=0;a<s.values.length;++a){var c=Ne.opentelemetry.proto.common.v1.AnyValue.verify(s.values[a]);if(c)return"values."+c}}return null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.common.v1.ArrayValue)return s;var a=new Ne.opentelemetry.proto.common.v1.ArrayValue;if(s.values){if(!Array.isArray(s.values))throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: array expected");a.values=[];for(var c=0;c<s.values.length;++c){if(typeof s.values[c]!="object")throw TypeError(".opentelemetry.proto.common.v1.ArrayValue.values: object expected");a.values[c]=Ne.opentelemetry.proto.common.v1.AnyValue.fromObject(s.values[c])}}return a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.values=[]),s.values&&s.values.length){c.values=[];for(var u=0;u<s.values.length;++u)c.values[u]=Ne.opentelemetry.proto.common.v1.AnyValue.toObject(s.values[u],a)}return c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.common.v1.ArrayValue"},i})(),n.KeyValueList=(function(){function i(o){if(this.values=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.values=Me.emptyArray,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.values!=null&&s.values.length)for(var c=0;c<s.values.length;++c)Ne.opentelemetry.proto.common.v1.KeyValue.encode(s.values[c],a.uint32(10).fork()).ldelim();return a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.common.v1.KeyValueList;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.values&&u.values.length||(u.values=[]),u.values.push(Ne.opentelemetry.proto.common.v1.KeyValue.decode(s,s.uint32()));break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.values!=null&&s.hasOwnProperty("values")){if(!Array.isArray(s.values))return"values: array expected";for(var a=0;a<s.values.length;++a){var c=Ne.opentelemetry.proto.common.v1.KeyValue.verify(s.values[a]);if(c)return"values."+c}}return null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.common.v1.KeyValueList)return s;var a=new Ne.opentelemetry.proto.common.v1.KeyValueList;if(s.values){if(!Array.isArray(s.values))throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: array expected");a.values=[];for(var c=0;c<s.values.length;++c){if(typeof s.values[c]!="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValueList.values: object expected");a.values[c]=Ne.opentelemetry.proto.common.v1.KeyValue.fromObject(s.values[c])}}return a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.values=[]),s.values&&s.values.length){c.values=[];for(var u=0;u<s.values.length;++u)c.values[u]=Ne.opentelemetry.proto.common.v1.KeyValue.toObject(s.values[u],a)}return c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.common.v1.KeyValueList"},i})(),n.KeyValue=(function(){function i(o){if(o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.key=null,i.prototype.value=null,i.create=function(s){return new i(s)},i.encode=function(s,a){return a||(a=Po.create()),s.key!=null&&Object.hasOwnProperty.call(s,"key")&&a.uint32(10).string(s.key),s.value!=null&&Object.hasOwnProperty.call(s,"value")&&Ne.opentelemetry.proto.common.v1.AnyValue.encode(s.value,a.uint32(18).fork()).ldelim(),a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.common.v1.KeyValue;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.key=s.string();break}case 2:{u.value=Ne.opentelemetry.proto.common.v1.AnyValue.decode(s,s.uint32());break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.key!=null&&s.hasOwnProperty("key")&&!Me.isString(s.key))return"key: string expected";if(s.value!=null&&s.hasOwnProperty("value")){var a=Ne.opentelemetry.proto.common.v1.AnyValue.verify(s.value);if(a)return"value."+a}return null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.common.v1.KeyValue)return s;var a=new Ne.opentelemetry.proto.common.v1.KeyValue;if(s.key!=null&&(a.key=String(s.key)),s.value!=null){if(typeof s.value!="object")throw TypeError(".opentelemetry.proto.common.v1.KeyValue.value: object expected");a.value=Ne.opentelemetry.proto.common.v1.AnyValue.fromObject(s.value)}return a},i.toObject=function(s,a){a||(a={});var c={};return a.defaults&&(c.key="",c.value=null),s.key!=null&&s.hasOwnProperty("key")&&(c.key=s.key),s.value!=null&&s.hasOwnProperty("value")&&(c.value=Ne.opentelemetry.proto.common.v1.AnyValue.toObject(s.value,a)),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.common.v1.KeyValue"},i})(),n.InstrumentationScope=(function(){function i(o){if(this.attributes=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.name=null,i.prototype.version=null,i.prototype.attributes=Me.emptyArray,i.prototype.droppedAttributesCount=null,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.name!=null&&Object.hasOwnProperty.call(s,"name")&&a.uint32(10).string(s.name),s.version!=null&&Object.hasOwnProperty.call(s,"version")&&a.uint32(18).string(s.version),s.attributes!=null&&s.attributes.length)for(var c=0;c<s.attributes.length;++c)Ne.opentelemetry.proto.common.v1.KeyValue.encode(s.attributes[c],a.uint32(26).fork()).ldelim();return s.droppedAttributesCount!=null&&Object.hasOwnProperty.call(s,"droppedAttributesCount")&&a.uint32(32).uint32(s.droppedAttributesCount),a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.common.v1.InstrumentationScope;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.name=s.string();break}case 2:{u.version=s.string();break}case 3:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(Ne.opentelemetry.proto.common.v1.KeyValue.decode(s,s.uint32()));break}case 4:{u.droppedAttributesCount=s.uint32();break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.name!=null&&s.hasOwnProperty("name")&&!Me.isString(s.name))return"name: string expected";if(s.version!=null&&s.hasOwnProperty("version")&&!Me.isString(s.version))return"version: string expected";if(s.attributes!=null&&s.hasOwnProperty("attributes")){if(!Array.isArray(s.attributes))return"attributes: array expected";for(var a=0;a<s.attributes.length;++a){var c=Ne.opentelemetry.proto.common.v1.KeyValue.verify(s.attributes[a]);if(c)return"attributes."+c}}return s.droppedAttributesCount!=null&&s.hasOwnProperty("droppedAttributesCount")&&!Me.isInteger(s.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.common.v1.InstrumentationScope)return s;var a=new Ne.opentelemetry.proto.common.v1.InstrumentationScope;if(s.name!=null&&(a.name=String(s.name)),s.version!=null&&(a.version=String(s.version)),s.attributes){if(!Array.isArray(s.attributes))throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: array expected");a.attributes=[];for(var c=0;c<s.attributes.length;++c){if(typeof s.attributes[c]!="object")throw TypeError(".opentelemetry.proto.common.v1.InstrumentationScope.attributes: object expected");a.attributes[c]=Ne.opentelemetry.proto.common.v1.KeyValue.fromObject(s.attributes[c])}}return s.droppedAttributesCount!=null&&(a.droppedAttributesCount=s.droppedAttributesCount>>>0),a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.attributes=[]),a.defaults&&(c.name="",c.version="",c.droppedAttributesCount=0),s.name!=null&&s.hasOwnProperty("name")&&(c.name=s.name),s.version!=null&&s.hasOwnProperty("version")&&(c.version=s.version),s.attributes&&s.attributes.length){c.attributes=[];for(var u=0;u<s.attributes.length;++u)c.attributes[u]=Ne.opentelemetry.proto.common.v1.KeyValue.toObject(s.attributes[u],a)}return s.droppedAttributesCount!=null&&s.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=s.droppedAttributesCount),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.common.v1.InstrumentationScope"},i})(),n})(),r})(),e.resource=(function(){var r={};return r.v1=(function(){var n={};return n.Resource=(function(){function i(o){if(this.attributes=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.attributes=Me.emptyArray,i.prototype.droppedAttributesCount=null,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.attributes!=null&&s.attributes.length)for(var c=0;c<s.attributes.length;++c)Ne.opentelemetry.proto.common.v1.KeyValue.encode(s.attributes[c],a.uint32(10).fork()).ldelim();return s.droppedAttributesCount!=null&&Object.hasOwnProperty.call(s,"droppedAttributesCount")&&a.uint32(16).uint32(s.droppedAttributesCount),a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.resource.v1.Resource;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(Ne.opentelemetry.proto.common.v1.KeyValue.decode(s,s.uint32()));break}case 2:{u.droppedAttributesCount=s.uint32();break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.attributes!=null&&s.hasOwnProperty("attributes")){if(!Array.isArray(s.attributes))return"attributes: array expected";for(var a=0;a<s.attributes.length;++a){var c=Ne.opentelemetry.proto.common.v1.KeyValue.verify(s.attributes[a]);if(c)return"attributes."+c}}return s.droppedAttributesCount!=null&&s.hasOwnProperty("droppedAttributesCount")&&!Me.isInteger(s.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.resource.v1.Resource)return s;var a=new Ne.opentelemetry.proto.resource.v1.Resource;if(s.attributes){if(!Array.isArray(s.attributes))throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: array expected");a.attributes=[];for(var c=0;c<s.attributes.length;++c){if(typeof s.attributes[c]!="object")throw TypeError(".opentelemetry.proto.resource.v1.Resource.attributes: object expected");a.attributes[c]=Ne.opentelemetry.proto.common.v1.KeyValue.fromObject(s.attributes[c])}}return s.droppedAttributesCount!=null&&(a.droppedAttributesCount=s.droppedAttributesCount>>>0),a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.attributes=[]),a.defaults&&(c.droppedAttributesCount=0),s.attributes&&s.attributes.length){c.attributes=[];for(var u=0;u<s.attributes.length;++u)c.attributes[u]=Ne.opentelemetry.proto.common.v1.KeyValue.toObject(s.attributes[u],a)}return s.droppedAttributesCount!=null&&s.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=s.droppedAttributesCount),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.resource.v1.Resource"},i})(),n})(),r})(),e.trace=(function(){var r={};return r.v1=(function(){var n={};return n.TracesData=(function(){function i(o){if(this.resourceSpans=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.resourceSpans=Me.emptyArray,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.resourceSpans!=null&&s.resourceSpans.length)for(var c=0;c<s.resourceSpans.length;++c)Ne.opentelemetry.proto.trace.v1.ResourceSpans.encode(s.resourceSpans[c],a.uint32(10).fork()).ldelim();return a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.trace.v1.TracesData;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.resourceSpans&&u.resourceSpans.length||(u.resourceSpans=[]),u.resourceSpans.push(Ne.opentelemetry.proto.trace.v1.ResourceSpans.decode(s,s.uint32()));break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.resourceSpans!=null&&s.hasOwnProperty("resourceSpans")){if(!Array.isArray(s.resourceSpans))return"resourceSpans: array expected";for(var a=0;a<s.resourceSpans.length;++a){var c=Ne.opentelemetry.proto.trace.v1.ResourceSpans.verify(s.resourceSpans[a]);if(c)return"resourceSpans."+c}}return null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.trace.v1.TracesData)return s;var a=new Ne.opentelemetry.proto.trace.v1.TracesData;if(s.resourceSpans){if(!Array.isArray(s.resourceSpans))throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: array expected");a.resourceSpans=[];for(var c=0;c<s.resourceSpans.length;++c){if(typeof s.resourceSpans[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.TracesData.resourceSpans: object expected");a.resourceSpans[c]=Ne.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(s.resourceSpans[c])}}return a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.resourceSpans=[]),s.resourceSpans&&s.resourceSpans.length){c.resourceSpans=[];for(var u=0;u<s.resourceSpans.length;++u)c.resourceSpans[u]=Ne.opentelemetry.proto.trace.v1.ResourceSpans.toObject(s.resourceSpans[u],a)}return c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.trace.v1.TracesData"},i})(),n.ResourceSpans=(function(){function i(o){if(this.scopeSpans=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.resource=null,i.prototype.scopeSpans=Me.emptyArray,i.prototype.schemaUrl=null,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.resource!=null&&Object.hasOwnProperty.call(s,"resource")&&Ne.opentelemetry.proto.resource.v1.Resource.encode(s.resource,a.uint32(10).fork()).ldelim(),s.scopeSpans!=null&&s.scopeSpans.length)for(var c=0;c<s.scopeSpans.length;++c)Ne.opentelemetry.proto.trace.v1.ScopeSpans.encode(s.scopeSpans[c],a.uint32(18).fork()).ldelim();return s.schemaUrl!=null&&Object.hasOwnProperty.call(s,"schemaUrl")&&a.uint32(26).string(s.schemaUrl),a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.trace.v1.ResourceSpans;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.resource=Ne.opentelemetry.proto.resource.v1.Resource.decode(s,s.uint32());break}case 2:{u.scopeSpans&&u.scopeSpans.length||(u.scopeSpans=[]),u.scopeSpans.push(Ne.opentelemetry.proto.trace.v1.ScopeSpans.decode(s,s.uint32()));break}case 3:{u.schemaUrl=s.string();break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.resource!=null&&s.hasOwnProperty("resource")){var a=Ne.opentelemetry.proto.resource.v1.Resource.verify(s.resource);if(a)return"resource."+a}if(s.scopeSpans!=null&&s.hasOwnProperty("scopeSpans")){if(!Array.isArray(s.scopeSpans))return"scopeSpans: array expected";for(var c=0;c<s.scopeSpans.length;++c){var a=Ne.opentelemetry.proto.trace.v1.ScopeSpans.verify(s.scopeSpans[c]);if(a)return"scopeSpans."+a}}return s.schemaUrl!=null&&s.hasOwnProperty("schemaUrl")&&!Me.isString(s.schemaUrl)?"schemaUrl: string expected":null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.trace.v1.ResourceSpans)return s;var a=new Ne.opentelemetry.proto.trace.v1.ResourceSpans;if(s.resource!=null){if(typeof s.resource!="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.resource: object expected");a.resource=Ne.opentelemetry.proto.resource.v1.Resource.fromObject(s.resource)}if(s.scopeSpans){if(!Array.isArray(s.scopeSpans))throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: array expected");a.scopeSpans=[];for(var c=0;c<s.scopeSpans.length;++c){if(typeof s.scopeSpans[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.ResourceSpans.scopeSpans: object expected");a.scopeSpans[c]=Ne.opentelemetry.proto.trace.v1.ScopeSpans.fromObject(s.scopeSpans[c])}}return s.schemaUrl!=null&&(a.schemaUrl=String(s.schemaUrl)),a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.scopeSpans=[]),a.defaults&&(c.resource=null,c.schemaUrl=""),s.resource!=null&&s.hasOwnProperty("resource")&&(c.resource=Ne.opentelemetry.proto.resource.v1.Resource.toObject(s.resource,a)),s.scopeSpans&&s.scopeSpans.length){c.scopeSpans=[];for(var u=0;u<s.scopeSpans.length;++u)c.scopeSpans[u]=Ne.opentelemetry.proto.trace.v1.ScopeSpans.toObject(s.scopeSpans[u],a)}return s.schemaUrl!=null&&s.hasOwnProperty("schemaUrl")&&(c.schemaUrl=s.schemaUrl),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.trace.v1.ResourceSpans"},i})(),n.ScopeSpans=(function(){function i(o){if(this.spans=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.scope=null,i.prototype.spans=Me.emptyArray,i.prototype.schemaUrl=null,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.scope!=null&&Object.hasOwnProperty.call(s,"scope")&&Ne.opentelemetry.proto.common.v1.InstrumentationScope.encode(s.scope,a.uint32(10).fork()).ldelim(),s.spans!=null&&s.spans.length)for(var c=0;c<s.spans.length;++c)Ne.opentelemetry.proto.trace.v1.Span.encode(s.spans[c],a.uint32(18).fork()).ldelim();return s.schemaUrl!=null&&Object.hasOwnProperty.call(s,"schemaUrl")&&a.uint32(26).string(s.schemaUrl),a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.trace.v1.ScopeSpans;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.scope=Ne.opentelemetry.proto.common.v1.InstrumentationScope.decode(s,s.uint32());break}case 2:{u.spans&&u.spans.length||(u.spans=[]),u.spans.push(Ne.opentelemetry.proto.trace.v1.Span.decode(s,s.uint32()));break}case 3:{u.schemaUrl=s.string();break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.scope!=null&&s.hasOwnProperty("scope")){var a=Ne.opentelemetry.proto.common.v1.InstrumentationScope.verify(s.scope);if(a)return"scope."+a}if(s.spans!=null&&s.hasOwnProperty("spans")){if(!Array.isArray(s.spans))return"spans: array expected";for(var c=0;c<s.spans.length;++c){var a=Ne.opentelemetry.proto.trace.v1.Span.verify(s.spans[c]);if(a)return"spans."+a}}return s.schemaUrl!=null&&s.hasOwnProperty("schemaUrl")&&!Me.isString(s.schemaUrl)?"schemaUrl: string expected":null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.trace.v1.ScopeSpans)return s;var a=new Ne.opentelemetry.proto.trace.v1.ScopeSpans;if(s.scope!=null){if(typeof s.scope!="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.scope: object expected");a.scope=Ne.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(s.scope)}if(s.spans){if(!Array.isArray(s.spans))throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: array expected");a.spans=[];for(var c=0;c<s.spans.length;++c){if(typeof s.spans[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.ScopeSpans.spans: object expected");a.spans[c]=Ne.opentelemetry.proto.trace.v1.Span.fromObject(s.spans[c])}}return s.schemaUrl!=null&&(a.schemaUrl=String(s.schemaUrl)),a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.spans=[]),a.defaults&&(c.scope=null,c.schemaUrl=""),s.scope!=null&&s.hasOwnProperty("scope")&&(c.scope=Ne.opentelemetry.proto.common.v1.InstrumentationScope.toObject(s.scope,a)),s.spans&&s.spans.length){c.spans=[];for(var u=0;u<s.spans.length;++u)c.spans[u]=Ne.opentelemetry.proto.trace.v1.Span.toObject(s.spans[u],a)}return s.schemaUrl!=null&&s.hasOwnProperty("schemaUrl")&&(c.schemaUrl=s.schemaUrl),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.trace.v1.ScopeSpans"},i})(),n.Span=(function(){function i(o){if(this.attributes=[],this.events=[],this.links=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.traceId=null,i.prototype.spanId=null,i.prototype.traceState=null,i.prototype.parentSpanId=null,i.prototype.name=null,i.prototype.kind=null,i.prototype.startTimeUnixNano=null,i.prototype.endTimeUnixNano=null,i.prototype.attributes=Me.emptyArray,i.prototype.droppedAttributesCount=null,i.prototype.events=Me.emptyArray,i.prototype.droppedEventsCount=null,i.prototype.links=Me.emptyArray,i.prototype.droppedLinksCount=null,i.prototype.status=null,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.traceId!=null&&Object.hasOwnProperty.call(s,"traceId")&&a.uint32(10).bytes(s.traceId),s.spanId!=null&&Object.hasOwnProperty.call(s,"spanId")&&a.uint32(18).bytes(s.spanId),s.traceState!=null&&Object.hasOwnProperty.call(s,"traceState")&&a.uint32(26).string(s.traceState),s.parentSpanId!=null&&Object.hasOwnProperty.call(s,"parentSpanId")&&a.uint32(34).bytes(s.parentSpanId),s.name!=null&&Object.hasOwnProperty.call(s,"name")&&a.uint32(42).string(s.name),s.kind!=null&&Object.hasOwnProperty.call(s,"kind")&&a.uint32(48).int32(s.kind),s.startTimeUnixNano!=null&&Object.hasOwnProperty.call(s,"startTimeUnixNano")&&a.uint32(57).fixed64(s.startTimeUnixNano),s.endTimeUnixNano!=null&&Object.hasOwnProperty.call(s,"endTimeUnixNano")&&a.uint32(65).fixed64(s.endTimeUnixNano),s.attributes!=null&&s.attributes.length)for(var c=0;c<s.attributes.length;++c)Ne.opentelemetry.proto.common.v1.KeyValue.encode(s.attributes[c],a.uint32(74).fork()).ldelim();if(s.droppedAttributesCount!=null&&Object.hasOwnProperty.call(s,"droppedAttributesCount")&&a.uint32(80).uint32(s.droppedAttributesCount),s.events!=null&&s.events.length)for(var c=0;c<s.events.length;++c)Ne.opentelemetry.proto.trace.v1.Span.Event.encode(s.events[c],a.uint32(90).fork()).ldelim();if(s.droppedEventsCount!=null&&Object.hasOwnProperty.call(s,"droppedEventsCount")&&a.uint32(96).uint32(s.droppedEventsCount),s.links!=null&&s.links.length)for(var c=0;c<s.links.length;++c)Ne.opentelemetry.proto.trace.v1.Span.Link.encode(s.links[c],a.uint32(106).fork()).ldelim();return s.droppedLinksCount!=null&&Object.hasOwnProperty.call(s,"droppedLinksCount")&&a.uint32(112).uint32(s.droppedLinksCount),s.status!=null&&Object.hasOwnProperty.call(s,"status")&&Ne.opentelemetry.proto.trace.v1.Status.encode(s.status,a.uint32(122).fork()).ldelim(),a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.trace.v1.Span;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.traceId=s.bytes();break}case 2:{u.spanId=s.bytes();break}case 3:{u.traceState=s.string();break}case 4:{u.parentSpanId=s.bytes();break}case 5:{u.name=s.string();break}case 6:{u.kind=s.int32();break}case 7:{u.startTimeUnixNano=s.fixed64();break}case 8:{u.endTimeUnixNano=s.fixed64();break}case 9:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(Ne.opentelemetry.proto.common.v1.KeyValue.decode(s,s.uint32()));break}case 10:{u.droppedAttributesCount=s.uint32();break}case 11:{u.events&&u.events.length||(u.events=[]),u.events.push(Ne.opentelemetry.proto.trace.v1.Span.Event.decode(s,s.uint32()));break}case 12:{u.droppedEventsCount=s.uint32();break}case 13:{u.links&&u.links.length||(u.links=[]),u.links.push(Ne.opentelemetry.proto.trace.v1.Span.Link.decode(s,s.uint32()));break}case 14:{u.droppedLinksCount=s.uint32();break}case 15:{u.status=Ne.opentelemetry.proto.trace.v1.Status.decode(s,s.uint32());break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.traceId!=null&&s.hasOwnProperty("traceId")&&!(s.traceId&&typeof s.traceId.length=="number"||Me.isString(s.traceId)))return"traceId: buffer expected";if(s.spanId!=null&&s.hasOwnProperty("spanId")&&!(s.spanId&&typeof s.spanId.length=="number"||Me.isString(s.spanId)))return"spanId: buffer expected";if(s.traceState!=null&&s.hasOwnProperty("traceState")&&!Me.isString(s.traceState))return"traceState: string expected";if(s.parentSpanId!=null&&s.hasOwnProperty("parentSpanId")&&!(s.parentSpanId&&typeof s.parentSpanId.length=="number"||Me.isString(s.parentSpanId)))return"parentSpanId: buffer expected";if(s.name!=null&&s.hasOwnProperty("name")&&!Me.isString(s.name))return"name: string expected";if(s.kind!=null&&s.hasOwnProperty("kind"))switch(s.kind){default:return"kind: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:break}if(s.startTimeUnixNano!=null&&s.hasOwnProperty("startTimeUnixNano")&&!Me.isInteger(s.startTimeUnixNano)&&!(s.startTimeUnixNano&&Me.isInteger(s.startTimeUnixNano.low)&&Me.isInteger(s.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(s.endTimeUnixNano!=null&&s.hasOwnProperty("endTimeUnixNano")&&!Me.isInteger(s.endTimeUnixNano)&&!(s.endTimeUnixNano&&Me.isInteger(s.endTimeUnixNano.low)&&Me.isInteger(s.endTimeUnixNano.high)))return"endTimeUnixNano: integer|Long expected";if(s.attributes!=null&&s.hasOwnProperty("attributes")){if(!Array.isArray(s.attributes))return"attributes: array expected";for(var a=0;a<s.attributes.length;++a){var c=Ne.opentelemetry.proto.common.v1.KeyValue.verify(s.attributes[a]);if(c)return"attributes."+c}}if(s.droppedAttributesCount!=null&&s.hasOwnProperty("droppedAttributesCount")&&!Me.isInteger(s.droppedAttributesCount))return"droppedAttributesCount: integer expected";if(s.events!=null&&s.hasOwnProperty("events")){if(!Array.isArray(s.events))return"events: array expected";for(var a=0;a<s.events.length;++a){var c=Ne.opentelemetry.proto.trace.v1.Span.Event.verify(s.events[a]);if(c)return"events."+c}}if(s.droppedEventsCount!=null&&s.hasOwnProperty("droppedEventsCount")&&!Me.isInteger(s.droppedEventsCount))return"droppedEventsCount: integer expected";if(s.links!=null&&s.hasOwnProperty("links")){if(!Array.isArray(s.links))return"links: array expected";for(var a=0;a<s.links.length;++a){var c=Ne.opentelemetry.proto.trace.v1.Span.Link.verify(s.links[a]);if(c)return"links."+c}}if(s.droppedLinksCount!=null&&s.hasOwnProperty("droppedLinksCount")&&!Me.isInteger(s.droppedLinksCount))return"droppedLinksCount: integer expected";if(s.status!=null&&s.hasOwnProperty("status")){var c=Ne.opentelemetry.proto.trace.v1.Status.verify(s.status);if(c)return"status."+c}return null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.trace.v1.Span)return s;var a=new Ne.opentelemetry.proto.trace.v1.Span;switch(s.traceId!=null&&(typeof s.traceId=="string"?Me.base64.decode(s.traceId,a.traceId=Me.newBuffer(Me.base64.length(s.traceId)),0):s.traceId.length>=0&&(a.traceId=s.traceId)),s.spanId!=null&&(typeof s.spanId=="string"?Me.base64.decode(s.spanId,a.spanId=Me.newBuffer(Me.base64.length(s.spanId)),0):s.spanId.length>=0&&(a.spanId=s.spanId)),s.traceState!=null&&(a.traceState=String(s.traceState)),s.parentSpanId!=null&&(typeof s.parentSpanId=="string"?Me.base64.decode(s.parentSpanId,a.parentSpanId=Me.newBuffer(Me.base64.length(s.parentSpanId)),0):s.parentSpanId.length>=0&&(a.parentSpanId=s.parentSpanId)),s.name!=null&&(a.name=String(s.name)),s.kind){default:if(typeof s.kind=="number"){a.kind=s.kind;break}break;case"SPAN_KIND_UNSPECIFIED":case 0:a.kind=0;break;case"SPAN_KIND_INTERNAL":case 1:a.kind=1;break;case"SPAN_KIND_SERVER":case 2:a.kind=2;break;case"SPAN_KIND_CLIENT":case 3:a.kind=3;break;case"SPAN_KIND_PRODUCER":case 4:a.kind=4;break;case"SPAN_KIND_CONSUMER":case 5:a.kind=5;break}if(s.startTimeUnixNano!=null&&(Me.Long?(a.startTimeUnixNano=Me.Long.fromValue(s.startTimeUnixNano)).unsigned=!1:typeof s.startTimeUnixNano=="string"?a.startTimeUnixNano=parseInt(s.startTimeUnixNano,10):typeof s.startTimeUnixNano=="number"?a.startTimeUnixNano=s.startTimeUnixNano:typeof s.startTimeUnixNano=="object"&&(a.startTimeUnixNano=new Me.LongBits(s.startTimeUnixNano.low>>>0,s.startTimeUnixNano.high>>>0).toNumber())),s.endTimeUnixNano!=null&&(Me.Long?(a.endTimeUnixNano=Me.Long.fromValue(s.endTimeUnixNano)).unsigned=!1:typeof s.endTimeUnixNano=="string"?a.endTimeUnixNano=parseInt(s.endTimeUnixNano,10):typeof s.endTimeUnixNano=="number"?a.endTimeUnixNano=s.endTimeUnixNano:typeof s.endTimeUnixNano=="object"&&(a.endTimeUnixNano=new Me.LongBits(s.endTimeUnixNano.low>>>0,s.endTimeUnixNano.high>>>0).toNumber())),s.attributes){if(!Array.isArray(s.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: array expected");a.attributes=[];for(var c=0;c<s.attributes.length;++c){if(typeof s.attributes[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.attributes: object expected");a.attributes[c]=Ne.opentelemetry.proto.common.v1.KeyValue.fromObject(s.attributes[c])}}if(s.droppedAttributesCount!=null&&(a.droppedAttributesCount=s.droppedAttributesCount>>>0),s.events){if(!Array.isArray(s.events))throw TypeError(".opentelemetry.proto.trace.v1.Span.events: array expected");a.events=[];for(var c=0;c<s.events.length;++c){if(typeof s.events[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.events: object expected");a.events[c]=Ne.opentelemetry.proto.trace.v1.Span.Event.fromObject(s.events[c])}}if(s.droppedEventsCount!=null&&(a.droppedEventsCount=s.droppedEventsCount>>>0),s.links){if(!Array.isArray(s.links))throw TypeError(".opentelemetry.proto.trace.v1.Span.links: array expected");a.links=[];for(var c=0;c<s.links.length;++c){if(typeof s.links[c]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.links: object expected");a.links[c]=Ne.opentelemetry.proto.trace.v1.Span.Link.fromObject(s.links[c])}}if(s.droppedLinksCount!=null&&(a.droppedLinksCount=s.droppedLinksCount>>>0),s.status!=null){if(typeof s.status!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.status: object expected");a.status=Ne.opentelemetry.proto.trace.v1.Status.fromObject(s.status)}return a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.attributes=[],c.events=[],c.links=[]),a.defaults){if(a.bytes===String?c.traceId="":(c.traceId=[],a.bytes!==Array&&(c.traceId=Me.newBuffer(c.traceId))),a.bytes===String?c.spanId="":(c.spanId=[],a.bytes!==Array&&(c.spanId=Me.newBuffer(c.spanId))),c.traceState="",a.bytes===String?c.parentSpanId="":(c.parentSpanId=[],a.bytes!==Array&&(c.parentSpanId=Me.newBuffer(c.parentSpanId))),c.name="",c.kind=a.enums===String?"SPAN_KIND_UNSPECIFIED":0,Me.Long){var u=new Me.Long(0,0,!1);c.startTimeUnixNano=a.longs===String?u.toString():a.longs===Number?u.toNumber():u}else c.startTimeUnixNano=a.longs===String?"0":0;if(Me.Long){var u=new Me.Long(0,0,!1);c.endTimeUnixNano=a.longs===String?u.toString():a.longs===Number?u.toNumber():u}else c.endTimeUnixNano=a.longs===String?"0":0;c.droppedAttributesCount=0,c.droppedEventsCount=0,c.droppedLinksCount=0,c.status=null}if(s.traceId!=null&&s.hasOwnProperty("traceId")&&(c.traceId=a.bytes===String?Me.base64.encode(s.traceId,0,s.traceId.length):a.bytes===Array?Array.prototype.slice.call(s.traceId):s.traceId),s.spanId!=null&&s.hasOwnProperty("spanId")&&(c.spanId=a.bytes===String?Me.base64.encode(s.spanId,0,s.spanId.length):a.bytes===Array?Array.prototype.slice.call(s.spanId):s.spanId),s.traceState!=null&&s.hasOwnProperty("traceState")&&(c.traceState=s.traceState),s.parentSpanId!=null&&s.hasOwnProperty("parentSpanId")&&(c.parentSpanId=a.bytes===String?Me.base64.encode(s.parentSpanId,0,s.parentSpanId.length):a.bytes===Array?Array.prototype.slice.call(s.parentSpanId):s.parentSpanId),s.name!=null&&s.hasOwnProperty("name")&&(c.name=s.name),s.kind!=null&&s.hasOwnProperty("kind")&&(c.kind=a.enums===String?Ne.opentelemetry.proto.trace.v1.Span.SpanKind[s.kind]===void 0?s.kind:Ne.opentelemetry.proto.trace.v1.Span.SpanKind[s.kind]:s.kind),s.startTimeUnixNano!=null&&s.hasOwnProperty("startTimeUnixNano")&&(typeof s.startTimeUnixNano=="number"?c.startTimeUnixNano=a.longs===String?String(s.startTimeUnixNano):s.startTimeUnixNano:c.startTimeUnixNano=a.longs===String?Me.Long.prototype.toString.call(s.startTimeUnixNano):a.longs===Number?new Me.LongBits(s.startTimeUnixNano.low>>>0,s.startTimeUnixNano.high>>>0).toNumber():s.startTimeUnixNano),s.endTimeUnixNano!=null&&s.hasOwnProperty("endTimeUnixNano")&&(typeof s.endTimeUnixNano=="number"?c.endTimeUnixNano=a.longs===String?String(s.endTimeUnixNano):s.endTimeUnixNano:c.endTimeUnixNano=a.longs===String?Me.Long.prototype.toString.call(s.endTimeUnixNano):a.longs===Number?new Me.LongBits(s.endTimeUnixNano.low>>>0,s.endTimeUnixNano.high>>>0).toNumber():s.endTimeUnixNano),s.attributes&&s.attributes.length){c.attributes=[];for(var d=0;d<s.attributes.length;++d)c.attributes[d]=Ne.opentelemetry.proto.common.v1.KeyValue.toObject(s.attributes[d],a)}if(s.droppedAttributesCount!=null&&s.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=s.droppedAttributesCount),s.events&&s.events.length){c.events=[];for(var d=0;d<s.events.length;++d)c.events[d]=Ne.opentelemetry.proto.trace.v1.Span.Event.toObject(s.events[d],a)}if(s.droppedEventsCount!=null&&s.hasOwnProperty("droppedEventsCount")&&(c.droppedEventsCount=s.droppedEventsCount),s.links&&s.links.length){c.links=[];for(var d=0;d<s.links.length;++d)c.links[d]=Ne.opentelemetry.proto.trace.v1.Span.Link.toObject(s.links[d],a)}return s.droppedLinksCount!=null&&s.hasOwnProperty("droppedLinksCount")&&(c.droppedLinksCount=s.droppedLinksCount),s.status!=null&&s.hasOwnProperty("status")&&(c.status=Ne.opentelemetry.proto.trace.v1.Status.toObject(s.status,a)),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.trace.v1.Span"},i.SpanKind=(function(){var o={},s=Object.create(o);return s[o[0]="SPAN_KIND_UNSPECIFIED"]=0,s[o[1]="SPAN_KIND_INTERNAL"]=1,s[o[2]="SPAN_KIND_SERVER"]=2,s[o[3]="SPAN_KIND_CLIENT"]=3,s[o[4]="SPAN_KIND_PRODUCER"]=4,s[o[5]="SPAN_KIND_CONSUMER"]=5,s})(),i.Event=(function(){function o(s){if(this.attributes=[],s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}return o.prototype.timeUnixNano=null,o.prototype.name=null,o.prototype.attributes=Me.emptyArray,o.prototype.droppedAttributesCount=null,o.create=function(a){return new o(a)},o.encode=function(a,c){if(c||(c=Po.create()),a.timeUnixNano!=null&&Object.hasOwnProperty.call(a,"timeUnixNano")&&c.uint32(9).fixed64(a.timeUnixNano),a.name!=null&&Object.hasOwnProperty.call(a,"name")&&c.uint32(18).string(a.name),a.attributes!=null&&a.attributes.length)for(var u=0;u<a.attributes.length;++u)Ne.opentelemetry.proto.common.v1.KeyValue.encode(a.attributes[u],c.uint32(26).fork()).ldelim();return a.droppedAttributesCount!=null&&Object.hasOwnProperty.call(a,"droppedAttributesCount")&&c.uint32(32).uint32(a.droppedAttributesCount),c},o.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},o.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.trace.v1.Span.Event;a.pos<u;){var f=a.uint32();switch(f>>>3){case 1:{d.timeUnixNano=a.fixed64();break}case 2:{d.name=a.string();break}case 3:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(Ne.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}case 4:{d.droppedAttributesCount=a.uint32();break}default:a.skipType(f&7);break}}return d},o.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},o.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&!Me.isInteger(a.timeUnixNano)&&!(a.timeUnixNano&&Me.isInteger(a.timeUnixNano.low)&&Me.isInteger(a.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(a.name!=null&&a.hasOwnProperty("name")&&!Me.isString(a.name))return"name: string expected";if(a.attributes!=null&&a.hasOwnProperty("attributes")){if(!Array.isArray(a.attributes))return"attributes: array expected";for(var c=0;c<a.attributes.length;++c){var u=Ne.opentelemetry.proto.common.v1.KeyValue.verify(a.attributes[c]);if(u)return"attributes."+u}}return a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&!Me.isInteger(a.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},o.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.trace.v1.Span.Event)return a;var c=new Ne.opentelemetry.proto.trace.v1.Span.Event;if(a.timeUnixNano!=null&&(Me.Long?(c.timeUnixNano=Me.Long.fromValue(a.timeUnixNano)).unsigned=!1:typeof a.timeUnixNano=="string"?c.timeUnixNano=parseInt(a.timeUnixNano,10):typeof a.timeUnixNano=="number"?c.timeUnixNano=a.timeUnixNano:typeof a.timeUnixNano=="object"&&(c.timeUnixNano=new Me.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber())),a.name!=null&&(c.name=String(a.name)),a.attributes){if(!Array.isArray(a.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: array expected");c.attributes=[];for(var u=0;u<a.attributes.length;++u){if(typeof a.attributes[u]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Event.attributes: object expected");c.attributes[u]=Ne.opentelemetry.proto.common.v1.KeyValue.fromObject(a.attributes[u])}}return a.droppedAttributesCount!=null&&(c.droppedAttributesCount=a.droppedAttributesCount>>>0),c},o.toObject=function(a,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.attributes=[]),c.defaults){if(Me.Long){var d=new Me.Long(0,0,!1);u.timeUnixNano=c.longs===String?d.toString():c.longs===Number?d.toNumber():d}else u.timeUnixNano=c.longs===String?"0":0;u.name="",u.droppedAttributesCount=0}if(a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&(typeof a.timeUnixNano=="number"?u.timeUnixNano=c.longs===String?String(a.timeUnixNano):a.timeUnixNano:u.timeUnixNano=c.longs===String?Me.Long.prototype.toString.call(a.timeUnixNano):c.longs===Number?new Me.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber():a.timeUnixNano),a.name!=null&&a.hasOwnProperty("name")&&(u.name=a.name),a.attributes&&a.attributes.length){u.attributes=[];for(var f=0;f<a.attributes.length;++f)u.attributes[f]=Ne.opentelemetry.proto.common.v1.KeyValue.toObject(a.attributes[f],c)}return a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&(u.droppedAttributesCount=a.droppedAttributesCount),u},o.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.trace.v1.Span.Event"},o})(),i.Link=(function(){function o(s){if(this.attributes=[],s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}return o.prototype.traceId=null,o.prototype.spanId=null,o.prototype.traceState=null,o.prototype.attributes=Me.emptyArray,o.prototype.droppedAttributesCount=null,o.create=function(a){return new o(a)},o.encode=function(a,c){if(c||(c=Po.create()),a.traceId!=null&&Object.hasOwnProperty.call(a,"traceId")&&c.uint32(10).bytes(a.traceId),a.spanId!=null&&Object.hasOwnProperty.call(a,"spanId")&&c.uint32(18).bytes(a.spanId),a.traceState!=null&&Object.hasOwnProperty.call(a,"traceState")&&c.uint32(26).string(a.traceState),a.attributes!=null&&a.attributes.length)for(var u=0;u<a.attributes.length;++u)Ne.opentelemetry.proto.common.v1.KeyValue.encode(a.attributes[u],c.uint32(34).fork()).ldelim();return a.droppedAttributesCount!=null&&Object.hasOwnProperty.call(a,"droppedAttributesCount")&&c.uint32(40).uint32(a.droppedAttributesCount),c},o.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},o.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.trace.v1.Span.Link;a.pos<u;){var f=a.uint32();switch(f>>>3){case 1:{d.traceId=a.bytes();break}case 2:{d.spanId=a.bytes();break}case 3:{d.traceState=a.string();break}case 4:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(Ne.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}case 5:{d.droppedAttributesCount=a.uint32();break}default:a.skipType(f&7);break}}return d},o.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},o.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.traceId!=null&&a.hasOwnProperty("traceId")&&!(a.traceId&&typeof a.traceId.length=="number"||Me.isString(a.traceId)))return"traceId: buffer expected";if(a.spanId!=null&&a.hasOwnProperty("spanId")&&!(a.spanId&&typeof a.spanId.length=="number"||Me.isString(a.spanId)))return"spanId: buffer expected";if(a.traceState!=null&&a.hasOwnProperty("traceState")&&!Me.isString(a.traceState))return"traceState: string expected";if(a.attributes!=null&&a.hasOwnProperty("attributes")){if(!Array.isArray(a.attributes))return"attributes: array expected";for(var c=0;c<a.attributes.length;++c){var u=Ne.opentelemetry.proto.common.v1.KeyValue.verify(a.attributes[c]);if(u)return"attributes."+u}}return a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&!Me.isInteger(a.droppedAttributesCount)?"droppedAttributesCount: integer expected":null},o.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.trace.v1.Span.Link)return a;var c=new Ne.opentelemetry.proto.trace.v1.Span.Link;if(a.traceId!=null&&(typeof a.traceId=="string"?Me.base64.decode(a.traceId,c.traceId=Me.newBuffer(Me.base64.length(a.traceId)),0):a.traceId.length>=0&&(c.traceId=a.traceId)),a.spanId!=null&&(typeof a.spanId=="string"?Me.base64.decode(a.spanId,c.spanId=Me.newBuffer(Me.base64.length(a.spanId)),0):a.spanId.length>=0&&(c.spanId=a.spanId)),a.traceState!=null&&(c.traceState=String(a.traceState)),a.attributes){if(!Array.isArray(a.attributes))throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: array expected");c.attributes=[];for(var u=0;u<a.attributes.length;++u){if(typeof a.attributes[u]!="object")throw TypeError(".opentelemetry.proto.trace.v1.Span.Link.attributes: object expected");c.attributes[u]=Ne.opentelemetry.proto.common.v1.KeyValue.fromObject(a.attributes[u])}}return a.droppedAttributesCount!=null&&(c.droppedAttributesCount=a.droppedAttributesCount>>>0),c},o.toObject=function(a,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.attributes=[]),c.defaults&&(c.bytes===String?u.traceId="":(u.traceId=[],c.bytes!==Array&&(u.traceId=Me.newBuffer(u.traceId))),c.bytes===String?u.spanId="":(u.spanId=[],c.bytes!==Array&&(u.spanId=Me.newBuffer(u.spanId))),u.traceState="",u.droppedAttributesCount=0),a.traceId!=null&&a.hasOwnProperty("traceId")&&(u.traceId=c.bytes===String?Me.base64.encode(a.traceId,0,a.traceId.length):c.bytes===Array?Array.prototype.slice.call(a.traceId):a.traceId),a.spanId!=null&&a.hasOwnProperty("spanId")&&(u.spanId=c.bytes===String?Me.base64.encode(a.spanId,0,a.spanId.length):c.bytes===Array?Array.prototype.slice.call(a.spanId):a.spanId),a.traceState!=null&&a.hasOwnProperty("traceState")&&(u.traceState=a.traceState),a.attributes&&a.attributes.length){u.attributes=[];for(var d=0;d<a.attributes.length;++d)u.attributes[d]=Ne.opentelemetry.proto.common.v1.KeyValue.toObject(a.attributes[d],c)}return a.droppedAttributesCount!=null&&a.hasOwnProperty("droppedAttributesCount")&&(u.droppedAttributesCount=a.droppedAttributesCount),u},o.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.trace.v1.Span.Link"},o})(),i})(),n.Status=(function(){function i(o){if(o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.message=null,i.prototype.code=null,i.create=function(s){return new i(s)},i.encode=function(s,a){return a||(a=Po.create()),s.message!=null&&Object.hasOwnProperty.call(s,"message")&&a.uint32(18).string(s.message),s.code!=null&&Object.hasOwnProperty.call(s,"code")&&a.uint32(24).int32(s.code),a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.trace.v1.Status;s.pos<c;){var d=s.uint32();switch(d>>>3){case 2:{u.message=s.string();break}case 3:{u.code=s.int32();break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.message!=null&&s.hasOwnProperty("message")&&!Me.isString(s.message))return"message: string expected";if(s.code!=null&&s.hasOwnProperty("code"))switch(s.code){default:return"code: enum value expected";case 0:case 1:case 2:break}return null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.trace.v1.Status)return s;var a=new Ne.opentelemetry.proto.trace.v1.Status;switch(s.message!=null&&(a.message=String(s.message)),s.code){default:if(typeof s.code=="number"){a.code=s.code;break}break;case"STATUS_CODE_UNSET":case 0:a.code=0;break;case"STATUS_CODE_OK":case 1:a.code=1;break;case"STATUS_CODE_ERROR":case 2:a.code=2;break}return a},i.toObject=function(s,a){a||(a={});var c={};return a.defaults&&(c.message="",c.code=a.enums===String?"STATUS_CODE_UNSET":0),s.message!=null&&s.hasOwnProperty("message")&&(c.message=s.message),s.code!=null&&s.hasOwnProperty("code")&&(c.code=a.enums===String?Ne.opentelemetry.proto.trace.v1.Status.StatusCode[s.code]===void 0?s.code:Ne.opentelemetry.proto.trace.v1.Status.StatusCode[s.code]:s.code),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.trace.v1.Status"},i.StatusCode=(function(){var o={},s=Object.create(o);return s[o[0]="STATUS_CODE_UNSET"]=0,s[o[1]="STATUS_CODE_OK"]=1,s[o[2]="STATUS_CODE_ERROR"]=2,s})(),i})(),n})(),r})(),e.collector=(function(){var r={};return r.trace=(function(){var n={};return n.v1=(function(){var i={};return i.TraceService=(function(){function o(s,a,c){bi.rpc.Service.call(this,s,a,c)}return(o.prototype=Object.create(bi.rpc.Service.prototype)).constructor=o,o.create=function(a,c,u){return new this(a,c,u)},Object.defineProperty(o.prototype.export=function s(a,c){return this.rpcCall(s,Ne.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest,Ne.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,a,c)},"name",{value:"Export"}),o})(),i.ExportTraceServiceRequest=(function(){function o(s){if(this.resourceSpans=[],s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}return o.prototype.resourceSpans=Me.emptyArray,o.create=function(a){return new o(a)},o.encode=function(a,c){if(c||(c=Po.create()),a.resourceSpans!=null&&a.resourceSpans.length)for(var u=0;u<a.resourceSpans.length;++u)Ne.opentelemetry.proto.trace.v1.ResourceSpans.encode(a.resourceSpans[u],c.uint32(10).fork()).ldelim();return c},o.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},o.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;a.pos<u;){var f=a.uint32();switch(f>>>3){case 1:{d.resourceSpans&&d.resourceSpans.length||(d.resourceSpans=[]),d.resourceSpans.push(Ne.opentelemetry.proto.trace.v1.ResourceSpans.decode(a,a.uint32()));break}default:a.skipType(f&7);break}}return d},o.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},o.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.resourceSpans!=null&&a.hasOwnProperty("resourceSpans")){if(!Array.isArray(a.resourceSpans))return"resourceSpans: array expected";for(var c=0;c<a.resourceSpans.length;++c){var u=Ne.opentelemetry.proto.trace.v1.ResourceSpans.verify(a.resourceSpans[c]);if(u)return"resourceSpans."+u}}return null},o.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest)return a;var c=new Ne.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;if(a.resourceSpans){if(!Array.isArray(a.resourceSpans))throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: array expected");c.resourceSpans=[];for(var u=0;u<a.resourceSpans.length;++u){if(typeof a.resourceSpans[u]!="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest.resourceSpans: object expected");c.resourceSpans[u]=Ne.opentelemetry.proto.trace.v1.ResourceSpans.fromObject(a.resourceSpans[u])}}return c},o.toObject=function(a,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.resourceSpans=[]),a.resourceSpans&&a.resourceSpans.length){u.resourceSpans=[];for(var d=0;d<a.resourceSpans.length;++d)u.resourceSpans[d]=Ne.opentelemetry.proto.trace.v1.ResourceSpans.toObject(a.resourceSpans[d],c)}return u},o.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest"},o})(),i.ExportTraceServiceResponse=(function(){function o(s){if(s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}return o.prototype.partialSuccess=null,o.create=function(a){return new o(a)},o.encode=function(a,c){return c||(c=Po.create()),a.partialSuccess!=null&&Object.hasOwnProperty.call(a,"partialSuccess")&&Ne.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.encode(a.partialSuccess,c.uint32(10).fork()).ldelim(),c},o.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},o.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;a.pos<u;){var f=a.uint32();switch(f>>>3){case 1:{d.partialSuccess=Ne.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.decode(a,a.uint32());break}default:a.skipType(f&7);break}}return d},o.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},o.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.partialSuccess!=null&&a.hasOwnProperty("partialSuccess")){var c=Ne.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.verify(a.partialSuccess);if(c)return"partialSuccess."+c}return null},o.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse)return a;var c=new Ne.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse;if(a.partialSuccess!=null){if(typeof a.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse.partialSuccess: object expected");c.partialSuccess=Ne.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.fromObject(a.partialSuccess)}return c},o.toObject=function(a,c){c||(c={});var u={};return c.defaults&&(u.partialSuccess=null),a.partialSuccess!=null&&a.hasOwnProperty("partialSuccess")&&(u.partialSuccess=Ne.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess.toObject(a.partialSuccess,c)),u},o.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse"},o})(),i.ExportTracePartialSuccess=(function(){function o(s){if(s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}return o.prototype.rejectedSpans=null,o.prototype.errorMessage=null,o.create=function(a){return new o(a)},o.encode=function(a,c){return c||(c=Po.create()),a.rejectedSpans!=null&&Object.hasOwnProperty.call(a,"rejectedSpans")&&c.uint32(8).int64(a.rejectedSpans),a.errorMessage!=null&&Object.hasOwnProperty.call(a,"errorMessage")&&c.uint32(18).string(a.errorMessage),c},o.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},o.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;a.pos<u;){var f=a.uint32();switch(f>>>3){case 1:{d.rejectedSpans=a.int64();break}case 2:{d.errorMessage=a.string();break}default:a.skipType(f&7);break}}return d},o.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},o.verify=function(a){return typeof a!="object"||a===null?"object expected":a.rejectedSpans!=null&&a.hasOwnProperty("rejectedSpans")&&!Me.isInteger(a.rejectedSpans)&&!(a.rejectedSpans&&Me.isInteger(a.rejectedSpans.low)&&Me.isInteger(a.rejectedSpans.high))?"rejectedSpans: integer|Long expected":a.errorMessage!=null&&a.hasOwnProperty("errorMessage")&&!Me.isString(a.errorMessage)?"errorMessage: string expected":null},o.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess)return a;var c=new Ne.opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess;return a.rejectedSpans!=null&&(Me.Long?(c.rejectedSpans=Me.Long.fromValue(a.rejectedSpans)).unsigned=!1:typeof a.rejectedSpans=="string"?c.rejectedSpans=parseInt(a.rejectedSpans,10):typeof a.rejectedSpans=="number"?c.rejectedSpans=a.rejectedSpans:typeof a.rejectedSpans=="object"&&(c.rejectedSpans=new Me.LongBits(a.rejectedSpans.low>>>0,a.rejectedSpans.high>>>0).toNumber())),a.errorMessage!=null&&(c.errorMessage=String(a.errorMessage)),c},o.toObject=function(a,c){c||(c={});var u={};if(c.defaults){if(Me.Long){var d=new Me.Long(0,0,!1);u.rejectedSpans=c.longs===String?d.toString():c.longs===Number?d.toNumber():d}else u.rejectedSpans=c.longs===String?"0":0;u.errorMessage=""}return a.rejectedSpans!=null&&a.hasOwnProperty("rejectedSpans")&&(typeof a.rejectedSpans=="number"?u.rejectedSpans=c.longs===String?String(a.rejectedSpans):a.rejectedSpans:u.rejectedSpans=c.longs===String?Me.Long.prototype.toString.call(a.rejectedSpans):c.longs===Number?new Me.LongBits(a.rejectedSpans.low>>>0,a.rejectedSpans.high>>>0).toNumber():a.rejectedSpans),a.errorMessage!=null&&a.hasOwnProperty("errorMessage")&&(u.errorMessage=a.errorMessage),u},o.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.collector.trace.v1.ExportTracePartialSuccess"},o})(),i})(),n})(),r.metrics=(function(){var n={};return n.v1=(function(){var i={};return i.MetricsService=(function(){function o(s,a,c){bi.rpc.Service.call(this,s,a,c)}return(o.prototype=Object.create(bi.rpc.Service.prototype)).constructor=o,o.create=function(a,c,u){return new this(a,c,u)},Object.defineProperty(o.prototype.export=function s(a,c){return this.rpcCall(s,Ne.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,Ne.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,a,c)},"name",{value:"Export"}),o})(),i.ExportMetricsServiceRequest=(function(){function o(s){if(this.resourceMetrics=[],s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}return o.prototype.resourceMetrics=Me.emptyArray,o.create=function(a){return new o(a)},o.encode=function(a,c){if(c||(c=Po.create()),a.resourceMetrics!=null&&a.resourceMetrics.length)for(var u=0;u<a.resourceMetrics.length;++u)Ne.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(a.resourceMetrics[u],c.uint32(10).fork()).ldelim();return c},o.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},o.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;a.pos<u;){var f=a.uint32();switch(f>>>3){case 1:{d.resourceMetrics&&d.resourceMetrics.length||(d.resourceMetrics=[]),d.resourceMetrics.push(Ne.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(a,a.uint32()));break}default:a.skipType(f&7);break}}return d},o.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},o.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.resourceMetrics!=null&&a.hasOwnProperty("resourceMetrics")){if(!Array.isArray(a.resourceMetrics))return"resourceMetrics: array expected";for(var c=0;c<a.resourceMetrics.length;++c){var u=Ne.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(a.resourceMetrics[c]);if(u)return"resourceMetrics."+u}}return null},o.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest)return a;var c=new Ne.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest;if(a.resourceMetrics){if(!Array.isArray(a.resourceMetrics))throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: array expected");c.resourceMetrics=[];for(var u=0;u<a.resourceMetrics.length;++u){if(typeof a.resourceMetrics[u]!="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest.resourceMetrics: object expected");c.resourceMetrics[u]=Ne.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(a.resourceMetrics[u])}}return c},o.toObject=function(a,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.resourceMetrics=[]),a.resourceMetrics&&a.resourceMetrics.length){u.resourceMetrics=[];for(var d=0;d<a.resourceMetrics.length;++d)u.resourceMetrics[d]=Ne.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(a.resourceMetrics[d],c)}return u},o.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest"},o})(),i.ExportMetricsServiceResponse=(function(){function o(s){if(s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}return o.prototype.partialSuccess=null,o.create=function(a){return new o(a)},o.encode=function(a,c){return c||(c=Po.create()),a.partialSuccess!=null&&Object.hasOwnProperty.call(a,"partialSuccess")&&Ne.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.encode(a.partialSuccess,c.uint32(10).fork()).ldelim(),c},o.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},o.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;a.pos<u;){var f=a.uint32();switch(f>>>3){case 1:{d.partialSuccess=Ne.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.decode(a,a.uint32());break}default:a.skipType(f&7);break}}return d},o.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},o.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.partialSuccess!=null&&a.hasOwnProperty("partialSuccess")){var c=Ne.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.verify(a.partialSuccess);if(c)return"partialSuccess."+c}return null},o.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse)return a;var c=new Ne.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse;if(a.partialSuccess!=null){if(typeof a.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse.partialSuccess: object expected");c.partialSuccess=Ne.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.fromObject(a.partialSuccess)}return c},o.toObject=function(a,c){c||(c={});var u={};return c.defaults&&(u.partialSuccess=null),a.partialSuccess!=null&&a.hasOwnProperty("partialSuccess")&&(u.partialSuccess=Ne.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess.toObject(a.partialSuccess,c)),u},o.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse"},o})(),i.ExportMetricsPartialSuccess=(function(){function o(s){if(s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}return o.prototype.rejectedDataPoints=null,o.prototype.errorMessage=null,o.create=function(a){return new o(a)},o.encode=function(a,c){return c||(c=Po.create()),a.rejectedDataPoints!=null&&Object.hasOwnProperty.call(a,"rejectedDataPoints")&&c.uint32(8).int64(a.rejectedDataPoints),a.errorMessage!=null&&Object.hasOwnProperty.call(a,"errorMessage")&&c.uint32(18).string(a.errorMessage),c},o.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},o.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;a.pos<u;){var f=a.uint32();switch(f>>>3){case 1:{d.rejectedDataPoints=a.int64();break}case 2:{d.errorMessage=a.string();break}default:a.skipType(f&7);break}}return d},o.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},o.verify=function(a){return typeof a!="object"||a===null?"object expected":a.rejectedDataPoints!=null&&a.hasOwnProperty("rejectedDataPoints")&&!Me.isInteger(a.rejectedDataPoints)&&!(a.rejectedDataPoints&&Me.isInteger(a.rejectedDataPoints.low)&&Me.isInteger(a.rejectedDataPoints.high))?"rejectedDataPoints: integer|Long expected":a.errorMessage!=null&&a.hasOwnProperty("errorMessage")&&!Me.isString(a.errorMessage)?"errorMessage: string expected":null},o.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess)return a;var c=new Ne.opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess;return a.rejectedDataPoints!=null&&(Me.Long?(c.rejectedDataPoints=Me.Long.fromValue(a.rejectedDataPoints)).unsigned=!1:typeof a.rejectedDataPoints=="string"?c.rejectedDataPoints=parseInt(a.rejectedDataPoints,10):typeof a.rejectedDataPoints=="number"?c.rejectedDataPoints=a.rejectedDataPoints:typeof a.rejectedDataPoints=="object"&&(c.rejectedDataPoints=new Me.LongBits(a.rejectedDataPoints.low>>>0,a.rejectedDataPoints.high>>>0).toNumber())),a.errorMessage!=null&&(c.errorMessage=String(a.errorMessage)),c},o.toObject=function(a,c){c||(c={});var u={};if(c.defaults){if(Me.Long){var d=new Me.Long(0,0,!1);u.rejectedDataPoints=c.longs===String?d.toString():c.longs===Number?d.toNumber():d}else u.rejectedDataPoints=c.longs===String?"0":0;u.errorMessage=""}return a.rejectedDataPoints!=null&&a.hasOwnProperty("rejectedDataPoints")&&(typeof a.rejectedDataPoints=="number"?u.rejectedDataPoints=c.longs===String?String(a.rejectedDataPoints):a.rejectedDataPoints:u.rejectedDataPoints=c.longs===String?Me.Long.prototype.toString.call(a.rejectedDataPoints):c.longs===Number?new Me.LongBits(a.rejectedDataPoints.low>>>0,a.rejectedDataPoints.high>>>0).toNumber():a.rejectedDataPoints),a.errorMessage!=null&&a.hasOwnProperty("errorMessage")&&(u.errorMessage=a.errorMessage),u},o.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.collector.metrics.v1.ExportMetricsPartialSuccess"},o})(),i})(),n})(),r.logs=(function(){var n={};return n.v1=(function(){var i={};return i.LogsService=(function(){function o(s,a,c){bi.rpc.Service.call(this,s,a,c)}return(o.prototype=Object.create(bi.rpc.Service.prototype)).constructor=o,o.create=function(a,c,u){return new this(a,c,u)},Object.defineProperty(o.prototype.export=function s(a,c){return this.rpcCall(s,Ne.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,Ne.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,a,c)},"name",{value:"Export"}),o})(),i.ExportLogsServiceRequest=(function(){function o(s){if(this.resourceLogs=[],s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}return o.prototype.resourceLogs=Me.emptyArray,o.create=function(a){return new o(a)},o.encode=function(a,c){if(c||(c=Po.create()),a.resourceLogs!=null&&a.resourceLogs.length)for(var u=0;u<a.resourceLogs.length;++u)Ne.opentelemetry.proto.logs.v1.ResourceLogs.encode(a.resourceLogs[u],c.uint32(10).fork()).ldelim();return c},o.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},o.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;a.pos<u;){var f=a.uint32();switch(f>>>3){case 1:{d.resourceLogs&&d.resourceLogs.length||(d.resourceLogs=[]),d.resourceLogs.push(Ne.opentelemetry.proto.logs.v1.ResourceLogs.decode(a,a.uint32()));break}default:a.skipType(f&7);break}}return d},o.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},o.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.resourceLogs!=null&&a.hasOwnProperty("resourceLogs")){if(!Array.isArray(a.resourceLogs))return"resourceLogs: array expected";for(var c=0;c<a.resourceLogs.length;++c){var u=Ne.opentelemetry.proto.logs.v1.ResourceLogs.verify(a.resourceLogs[c]);if(u)return"resourceLogs."+u}}return null},o.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest)return a;var c=new Ne.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest;if(a.resourceLogs){if(!Array.isArray(a.resourceLogs))throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: array expected");c.resourceLogs=[];for(var u=0;u<a.resourceLogs.length;++u){if(typeof a.resourceLogs[u]!="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest.resourceLogs: object expected");c.resourceLogs[u]=Ne.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(a.resourceLogs[u])}}return c},o.toObject=function(a,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.resourceLogs=[]),a.resourceLogs&&a.resourceLogs.length){u.resourceLogs=[];for(var d=0;d<a.resourceLogs.length;++d)u.resourceLogs[d]=Ne.opentelemetry.proto.logs.v1.ResourceLogs.toObject(a.resourceLogs[d],c)}return u},o.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest"},o})(),i.ExportLogsServiceResponse=(function(){function o(s){if(s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}return o.prototype.partialSuccess=null,o.create=function(a){return new o(a)},o.encode=function(a,c){return c||(c=Po.create()),a.partialSuccess!=null&&Object.hasOwnProperty.call(a,"partialSuccess")&&Ne.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.encode(a.partialSuccess,c.uint32(10).fork()).ldelim(),c},o.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},o.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;a.pos<u;){var f=a.uint32();switch(f>>>3){case 1:{d.partialSuccess=Ne.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.decode(a,a.uint32());break}default:a.skipType(f&7);break}}return d},o.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},o.verify=function(a){if(typeof a!="object"||a===null)return"object expected";if(a.partialSuccess!=null&&a.hasOwnProperty("partialSuccess")){var c=Ne.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.verify(a.partialSuccess);if(c)return"partialSuccess."+c}return null},o.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse)return a;var c=new Ne.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse;if(a.partialSuccess!=null){if(typeof a.partialSuccess!="object")throw TypeError(".opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse.partialSuccess: object expected");c.partialSuccess=Ne.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.fromObject(a.partialSuccess)}return c},o.toObject=function(a,c){c||(c={});var u={};return c.defaults&&(u.partialSuccess=null),a.partialSuccess!=null&&a.hasOwnProperty("partialSuccess")&&(u.partialSuccess=Ne.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess.toObject(a.partialSuccess,c)),u},o.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse"},o})(),i.ExportLogsPartialSuccess=(function(){function o(s){if(s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}return o.prototype.rejectedLogRecords=null,o.prototype.errorMessage=null,o.create=function(a){return new o(a)},o.encode=function(a,c){return c||(c=Po.create()),a.rejectedLogRecords!=null&&Object.hasOwnProperty.call(a,"rejectedLogRecords")&&c.uint32(8).int64(a.rejectedLogRecords),a.errorMessage!=null&&Object.hasOwnProperty.call(a,"errorMessage")&&c.uint32(18).string(a.errorMessage),c},o.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},o.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;a.pos<u;){var f=a.uint32();switch(f>>>3){case 1:{d.rejectedLogRecords=a.int64();break}case 2:{d.errorMessage=a.string();break}default:a.skipType(f&7);break}}return d},o.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},o.verify=function(a){return typeof a!="object"||a===null?"object expected":a.rejectedLogRecords!=null&&a.hasOwnProperty("rejectedLogRecords")&&!Me.isInteger(a.rejectedLogRecords)&&!(a.rejectedLogRecords&&Me.isInteger(a.rejectedLogRecords.low)&&Me.isInteger(a.rejectedLogRecords.high))?"rejectedLogRecords: integer|Long expected":a.errorMessage!=null&&a.hasOwnProperty("errorMessage")&&!Me.isString(a.errorMessage)?"errorMessage: string expected":null},o.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess)return a;var c=new Ne.opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess;return a.rejectedLogRecords!=null&&(Me.Long?(c.rejectedLogRecords=Me.Long.fromValue(a.rejectedLogRecords)).unsigned=!1:typeof a.rejectedLogRecords=="string"?c.rejectedLogRecords=parseInt(a.rejectedLogRecords,10):typeof a.rejectedLogRecords=="number"?c.rejectedLogRecords=a.rejectedLogRecords:typeof a.rejectedLogRecords=="object"&&(c.rejectedLogRecords=new Me.LongBits(a.rejectedLogRecords.low>>>0,a.rejectedLogRecords.high>>>0).toNumber())),a.errorMessage!=null&&(c.errorMessage=String(a.errorMessage)),c},o.toObject=function(a,c){c||(c={});var u={};if(c.defaults){if(Me.Long){var d=new Me.Long(0,0,!1);u.rejectedLogRecords=c.longs===String?d.toString():c.longs===Number?d.toNumber():d}else u.rejectedLogRecords=c.longs===String?"0":0;u.errorMessage=""}return a.rejectedLogRecords!=null&&a.hasOwnProperty("rejectedLogRecords")&&(typeof a.rejectedLogRecords=="number"?u.rejectedLogRecords=c.longs===String?String(a.rejectedLogRecords):a.rejectedLogRecords:u.rejectedLogRecords=c.longs===String?Me.Long.prototype.toString.call(a.rejectedLogRecords):c.longs===Number?new Me.LongBits(a.rejectedLogRecords.low>>>0,a.rejectedLogRecords.high>>>0).toNumber():a.rejectedLogRecords),a.errorMessage!=null&&a.hasOwnProperty("errorMessage")&&(u.errorMessage=a.errorMessage),u},o.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.collector.logs.v1.ExportLogsPartialSuccess"},o})(),i})(),n})(),r})(),e.metrics=(function(){var r={};return r.v1=(function(){var n={};return n.MetricsData=(function(){function i(o){if(this.resourceMetrics=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.resourceMetrics=Me.emptyArray,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.resourceMetrics!=null&&s.resourceMetrics.length)for(var c=0;c<s.resourceMetrics.length;++c)Ne.opentelemetry.proto.metrics.v1.ResourceMetrics.encode(s.resourceMetrics[c],a.uint32(10).fork()).ldelim();return a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.metrics.v1.MetricsData;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.resourceMetrics&&u.resourceMetrics.length||(u.resourceMetrics=[]),u.resourceMetrics.push(Ne.opentelemetry.proto.metrics.v1.ResourceMetrics.decode(s,s.uint32()));break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.resourceMetrics!=null&&s.hasOwnProperty("resourceMetrics")){if(!Array.isArray(s.resourceMetrics))return"resourceMetrics: array expected";for(var a=0;a<s.resourceMetrics.length;++a){var c=Ne.opentelemetry.proto.metrics.v1.ResourceMetrics.verify(s.resourceMetrics[a]);if(c)return"resourceMetrics."+c}}return null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.metrics.v1.MetricsData)return s;var a=new Ne.opentelemetry.proto.metrics.v1.MetricsData;if(s.resourceMetrics){if(!Array.isArray(s.resourceMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: array expected");a.resourceMetrics=[];for(var c=0;c<s.resourceMetrics.length;++c){if(typeof s.resourceMetrics[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.MetricsData.resourceMetrics: object expected");a.resourceMetrics[c]=Ne.opentelemetry.proto.metrics.v1.ResourceMetrics.fromObject(s.resourceMetrics[c])}}return a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.resourceMetrics=[]),s.resourceMetrics&&s.resourceMetrics.length){c.resourceMetrics=[];for(var u=0;u<s.resourceMetrics.length;++u)c.resourceMetrics[u]=Ne.opentelemetry.proto.metrics.v1.ResourceMetrics.toObject(s.resourceMetrics[u],a)}return c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.metrics.v1.MetricsData"},i})(),n.ResourceMetrics=(function(){function i(o){if(this.scopeMetrics=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.resource=null,i.prototype.scopeMetrics=Me.emptyArray,i.prototype.schemaUrl=null,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.resource!=null&&Object.hasOwnProperty.call(s,"resource")&&Ne.opentelemetry.proto.resource.v1.Resource.encode(s.resource,a.uint32(10).fork()).ldelim(),s.scopeMetrics!=null&&s.scopeMetrics.length)for(var c=0;c<s.scopeMetrics.length;++c)Ne.opentelemetry.proto.metrics.v1.ScopeMetrics.encode(s.scopeMetrics[c],a.uint32(18).fork()).ldelim();return s.schemaUrl!=null&&Object.hasOwnProperty.call(s,"schemaUrl")&&a.uint32(26).string(s.schemaUrl),a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.metrics.v1.ResourceMetrics;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.resource=Ne.opentelemetry.proto.resource.v1.Resource.decode(s,s.uint32());break}case 2:{u.scopeMetrics&&u.scopeMetrics.length||(u.scopeMetrics=[]),u.scopeMetrics.push(Ne.opentelemetry.proto.metrics.v1.ScopeMetrics.decode(s,s.uint32()));break}case 3:{u.schemaUrl=s.string();break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.resource!=null&&s.hasOwnProperty("resource")){var a=Ne.opentelemetry.proto.resource.v1.Resource.verify(s.resource);if(a)return"resource."+a}if(s.scopeMetrics!=null&&s.hasOwnProperty("scopeMetrics")){if(!Array.isArray(s.scopeMetrics))return"scopeMetrics: array expected";for(var c=0;c<s.scopeMetrics.length;++c){var a=Ne.opentelemetry.proto.metrics.v1.ScopeMetrics.verify(s.scopeMetrics[c]);if(a)return"scopeMetrics."+a}}return s.schemaUrl!=null&&s.hasOwnProperty("schemaUrl")&&!Me.isString(s.schemaUrl)?"schemaUrl: string expected":null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.metrics.v1.ResourceMetrics)return s;var a=new Ne.opentelemetry.proto.metrics.v1.ResourceMetrics;if(s.resource!=null){if(typeof s.resource!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.resource: object expected");a.resource=Ne.opentelemetry.proto.resource.v1.Resource.fromObject(s.resource)}if(s.scopeMetrics){if(!Array.isArray(s.scopeMetrics))throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: array expected");a.scopeMetrics=[];for(var c=0;c<s.scopeMetrics.length;++c){if(typeof s.scopeMetrics[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ResourceMetrics.scopeMetrics: object expected");a.scopeMetrics[c]=Ne.opentelemetry.proto.metrics.v1.ScopeMetrics.fromObject(s.scopeMetrics[c])}}return s.schemaUrl!=null&&(a.schemaUrl=String(s.schemaUrl)),a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.scopeMetrics=[]),a.defaults&&(c.resource=null,c.schemaUrl=""),s.resource!=null&&s.hasOwnProperty("resource")&&(c.resource=Ne.opentelemetry.proto.resource.v1.Resource.toObject(s.resource,a)),s.scopeMetrics&&s.scopeMetrics.length){c.scopeMetrics=[];for(var u=0;u<s.scopeMetrics.length;++u)c.scopeMetrics[u]=Ne.opentelemetry.proto.metrics.v1.ScopeMetrics.toObject(s.scopeMetrics[u],a)}return s.schemaUrl!=null&&s.hasOwnProperty("schemaUrl")&&(c.schemaUrl=s.schemaUrl),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.metrics.v1.ResourceMetrics"},i})(),n.ScopeMetrics=(function(){function i(o){if(this.metrics=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.scope=null,i.prototype.metrics=Me.emptyArray,i.prototype.schemaUrl=null,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.scope!=null&&Object.hasOwnProperty.call(s,"scope")&&Ne.opentelemetry.proto.common.v1.InstrumentationScope.encode(s.scope,a.uint32(10).fork()).ldelim(),s.metrics!=null&&s.metrics.length)for(var c=0;c<s.metrics.length;++c)Ne.opentelemetry.proto.metrics.v1.Metric.encode(s.metrics[c],a.uint32(18).fork()).ldelim();return s.schemaUrl!=null&&Object.hasOwnProperty.call(s,"schemaUrl")&&a.uint32(26).string(s.schemaUrl),a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.metrics.v1.ScopeMetrics;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.scope=Ne.opentelemetry.proto.common.v1.InstrumentationScope.decode(s,s.uint32());break}case 2:{u.metrics&&u.metrics.length||(u.metrics=[]),u.metrics.push(Ne.opentelemetry.proto.metrics.v1.Metric.decode(s,s.uint32()));break}case 3:{u.schemaUrl=s.string();break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.scope!=null&&s.hasOwnProperty("scope")){var a=Ne.opentelemetry.proto.common.v1.InstrumentationScope.verify(s.scope);if(a)return"scope."+a}if(s.metrics!=null&&s.hasOwnProperty("metrics")){if(!Array.isArray(s.metrics))return"metrics: array expected";for(var c=0;c<s.metrics.length;++c){var a=Ne.opentelemetry.proto.metrics.v1.Metric.verify(s.metrics[c]);if(a)return"metrics."+a}}return s.schemaUrl!=null&&s.hasOwnProperty("schemaUrl")&&!Me.isString(s.schemaUrl)?"schemaUrl: string expected":null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.metrics.v1.ScopeMetrics)return s;var a=new Ne.opentelemetry.proto.metrics.v1.ScopeMetrics;if(s.scope!=null){if(typeof s.scope!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.scope: object expected");a.scope=Ne.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(s.scope)}if(s.metrics){if(!Array.isArray(s.metrics))throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: array expected");a.metrics=[];for(var c=0;c<s.metrics.length;++c){if(typeof s.metrics[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ScopeMetrics.metrics: object expected");a.metrics[c]=Ne.opentelemetry.proto.metrics.v1.Metric.fromObject(s.metrics[c])}}return s.schemaUrl!=null&&(a.schemaUrl=String(s.schemaUrl)),a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.metrics=[]),a.defaults&&(c.scope=null,c.schemaUrl=""),s.scope!=null&&s.hasOwnProperty("scope")&&(c.scope=Ne.opentelemetry.proto.common.v1.InstrumentationScope.toObject(s.scope,a)),s.metrics&&s.metrics.length){c.metrics=[];for(var u=0;u<s.metrics.length;++u)c.metrics[u]=Ne.opentelemetry.proto.metrics.v1.Metric.toObject(s.metrics[u],a)}return s.schemaUrl!=null&&s.hasOwnProperty("schemaUrl")&&(c.schemaUrl=s.schemaUrl),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.metrics.v1.ScopeMetrics"},i})(),n.Metric=(function(){function i(s){if(s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}i.prototype.name=null,i.prototype.description=null,i.prototype.unit=null,i.prototype.gauge=null,i.prototype.sum=null,i.prototype.histogram=null,i.prototype.exponentialHistogram=null,i.prototype.summary=null;var o;return Object.defineProperty(i.prototype,"data",{get:Me.oneOfGetter(o=["gauge","sum","histogram","exponentialHistogram","summary"]),set:Me.oneOfSetter(o)}),i.create=function(a){return new i(a)},i.encode=function(a,c){return c||(c=Po.create()),a.name!=null&&Object.hasOwnProperty.call(a,"name")&&c.uint32(10).string(a.name),a.description!=null&&Object.hasOwnProperty.call(a,"description")&&c.uint32(18).string(a.description),a.unit!=null&&Object.hasOwnProperty.call(a,"unit")&&c.uint32(26).string(a.unit),a.gauge!=null&&Object.hasOwnProperty.call(a,"gauge")&&Ne.opentelemetry.proto.metrics.v1.Gauge.encode(a.gauge,c.uint32(42).fork()).ldelim(),a.sum!=null&&Object.hasOwnProperty.call(a,"sum")&&Ne.opentelemetry.proto.metrics.v1.Sum.encode(a.sum,c.uint32(58).fork()).ldelim(),a.histogram!=null&&Object.hasOwnProperty.call(a,"histogram")&&Ne.opentelemetry.proto.metrics.v1.Histogram.encode(a.histogram,c.uint32(74).fork()).ldelim(),a.exponentialHistogram!=null&&Object.hasOwnProperty.call(a,"exponentialHistogram")&&Ne.opentelemetry.proto.metrics.v1.ExponentialHistogram.encode(a.exponentialHistogram,c.uint32(82).fork()).ldelim(),a.summary!=null&&Object.hasOwnProperty.call(a,"summary")&&Ne.opentelemetry.proto.metrics.v1.Summary.encode(a.summary,c.uint32(90).fork()).ldelim(),c},i.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},i.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.metrics.v1.Metric;a.pos<u;){var f=a.uint32();switch(f>>>3){case 1:{d.name=a.string();break}case 2:{d.description=a.string();break}case 3:{d.unit=a.string();break}case 5:{d.gauge=Ne.opentelemetry.proto.metrics.v1.Gauge.decode(a,a.uint32());break}case 7:{d.sum=Ne.opentelemetry.proto.metrics.v1.Sum.decode(a,a.uint32());break}case 9:{d.histogram=Ne.opentelemetry.proto.metrics.v1.Histogram.decode(a,a.uint32());break}case 10:{d.exponentialHistogram=Ne.opentelemetry.proto.metrics.v1.ExponentialHistogram.decode(a,a.uint32());break}case 11:{d.summary=Ne.opentelemetry.proto.metrics.v1.Summary.decode(a,a.uint32());break}default:a.skipType(f&7);break}}return d},i.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},i.verify=function(a){if(typeof a!="object"||a===null)return"object expected";var c={};if(a.name!=null&&a.hasOwnProperty("name")&&!Me.isString(a.name))return"name: string expected";if(a.description!=null&&a.hasOwnProperty("description")&&!Me.isString(a.description))return"description: string expected";if(a.unit!=null&&a.hasOwnProperty("unit")&&!Me.isString(a.unit))return"unit: string expected";if(a.gauge!=null&&a.hasOwnProperty("gauge")){c.data=1;{var u=Ne.opentelemetry.proto.metrics.v1.Gauge.verify(a.gauge);if(u)return"gauge."+u}}if(a.sum!=null&&a.hasOwnProperty("sum")){if(c.data===1)return"data: multiple values";c.data=1;{var u=Ne.opentelemetry.proto.metrics.v1.Sum.verify(a.sum);if(u)return"sum."+u}}if(a.histogram!=null&&a.hasOwnProperty("histogram")){if(c.data===1)return"data: multiple values";c.data=1;{var u=Ne.opentelemetry.proto.metrics.v1.Histogram.verify(a.histogram);if(u)return"histogram."+u}}if(a.exponentialHistogram!=null&&a.hasOwnProperty("exponentialHistogram")){if(c.data===1)return"data: multiple values";c.data=1;{var u=Ne.opentelemetry.proto.metrics.v1.ExponentialHistogram.verify(a.exponentialHistogram);if(u)return"exponentialHistogram."+u}}if(a.summary!=null&&a.hasOwnProperty("summary")){if(c.data===1)return"data: multiple values";c.data=1;{var u=Ne.opentelemetry.proto.metrics.v1.Summary.verify(a.summary);if(u)return"summary."+u}}return null},i.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.metrics.v1.Metric)return a;var c=new Ne.opentelemetry.proto.metrics.v1.Metric;if(a.name!=null&&(c.name=String(a.name)),a.description!=null&&(c.description=String(a.description)),a.unit!=null&&(c.unit=String(a.unit)),a.gauge!=null){if(typeof a.gauge!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.gauge: object expected");c.gauge=Ne.opentelemetry.proto.metrics.v1.Gauge.fromObject(a.gauge)}if(a.sum!=null){if(typeof a.sum!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.sum: object expected");c.sum=Ne.opentelemetry.proto.metrics.v1.Sum.fromObject(a.sum)}if(a.histogram!=null){if(typeof a.histogram!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.histogram: object expected");c.histogram=Ne.opentelemetry.proto.metrics.v1.Histogram.fromObject(a.histogram)}if(a.exponentialHistogram!=null){if(typeof a.exponentialHistogram!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.exponentialHistogram: object expected");c.exponentialHistogram=Ne.opentelemetry.proto.metrics.v1.ExponentialHistogram.fromObject(a.exponentialHistogram)}if(a.summary!=null){if(typeof a.summary!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Metric.summary: object expected");c.summary=Ne.opentelemetry.proto.metrics.v1.Summary.fromObject(a.summary)}return c},i.toObject=function(a,c){c||(c={});var u={};return c.defaults&&(u.name="",u.description="",u.unit=""),a.name!=null&&a.hasOwnProperty("name")&&(u.name=a.name),a.description!=null&&a.hasOwnProperty("description")&&(u.description=a.description),a.unit!=null&&a.hasOwnProperty("unit")&&(u.unit=a.unit),a.gauge!=null&&a.hasOwnProperty("gauge")&&(u.gauge=Ne.opentelemetry.proto.metrics.v1.Gauge.toObject(a.gauge,c),c.oneofs&&(u.data="gauge")),a.sum!=null&&a.hasOwnProperty("sum")&&(u.sum=Ne.opentelemetry.proto.metrics.v1.Sum.toObject(a.sum,c),c.oneofs&&(u.data="sum")),a.histogram!=null&&a.hasOwnProperty("histogram")&&(u.histogram=Ne.opentelemetry.proto.metrics.v1.Histogram.toObject(a.histogram,c),c.oneofs&&(u.data="histogram")),a.exponentialHistogram!=null&&a.hasOwnProperty("exponentialHistogram")&&(u.exponentialHistogram=Ne.opentelemetry.proto.metrics.v1.ExponentialHistogram.toObject(a.exponentialHistogram,c),c.oneofs&&(u.data="exponentialHistogram")),a.summary!=null&&a.hasOwnProperty("summary")&&(u.summary=Ne.opentelemetry.proto.metrics.v1.Summary.toObject(a.summary,c),c.oneofs&&(u.data="summary")),u},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.Metric"},i})(),n.Gauge=(function(){function i(o){if(this.dataPoints=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.dataPoints=Me.emptyArray,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.dataPoints!=null&&s.dataPoints.length)for(var c=0;c<s.dataPoints.length;++c)Ne.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(s.dataPoints[c],a.uint32(10).fork()).ldelim();return a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.metrics.v1.Gauge;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.dataPoints&&u.dataPoints.length||(u.dataPoints=[]),u.dataPoints.push(Ne.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(s,s.uint32()));break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.dataPoints!=null&&s.hasOwnProperty("dataPoints")){if(!Array.isArray(s.dataPoints))return"dataPoints: array expected";for(var a=0;a<s.dataPoints.length;++a){var c=Ne.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(s.dataPoints[a]);if(c)return"dataPoints."+c}}return null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.metrics.v1.Gauge)return s;var a=new Ne.opentelemetry.proto.metrics.v1.Gauge;if(s.dataPoints){if(!Array.isArray(s.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: array expected");a.dataPoints=[];for(var c=0;c<s.dataPoints.length;++c){if(typeof s.dataPoints[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Gauge.dataPoints: object expected");a.dataPoints[c]=Ne.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(s.dataPoints[c])}}return a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.dataPoints=[]),s.dataPoints&&s.dataPoints.length){c.dataPoints=[];for(var u=0;u<s.dataPoints.length;++u)c.dataPoints[u]=Ne.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(s.dataPoints[u],a)}return c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.metrics.v1.Gauge"},i})(),n.Sum=(function(){function i(o){if(this.dataPoints=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.dataPoints=Me.emptyArray,i.prototype.aggregationTemporality=null,i.prototype.isMonotonic=null,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.dataPoints!=null&&s.dataPoints.length)for(var c=0;c<s.dataPoints.length;++c)Ne.opentelemetry.proto.metrics.v1.NumberDataPoint.encode(s.dataPoints[c],a.uint32(10).fork()).ldelim();return s.aggregationTemporality!=null&&Object.hasOwnProperty.call(s,"aggregationTemporality")&&a.uint32(16).int32(s.aggregationTemporality),s.isMonotonic!=null&&Object.hasOwnProperty.call(s,"isMonotonic")&&a.uint32(24).bool(s.isMonotonic),a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.metrics.v1.Sum;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.dataPoints&&u.dataPoints.length||(u.dataPoints=[]),u.dataPoints.push(Ne.opentelemetry.proto.metrics.v1.NumberDataPoint.decode(s,s.uint32()));break}case 2:{u.aggregationTemporality=s.int32();break}case 3:{u.isMonotonic=s.bool();break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.dataPoints!=null&&s.hasOwnProperty("dataPoints")){if(!Array.isArray(s.dataPoints))return"dataPoints: array expected";for(var a=0;a<s.dataPoints.length;++a){var c=Ne.opentelemetry.proto.metrics.v1.NumberDataPoint.verify(s.dataPoints[a]);if(c)return"dataPoints."+c}}if(s.aggregationTemporality!=null&&s.hasOwnProperty("aggregationTemporality"))switch(s.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return s.isMonotonic!=null&&s.hasOwnProperty("isMonotonic")&&typeof s.isMonotonic!="boolean"?"isMonotonic: boolean expected":null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.metrics.v1.Sum)return s;var a=new Ne.opentelemetry.proto.metrics.v1.Sum;if(s.dataPoints){if(!Array.isArray(s.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: array expected");a.dataPoints=[];for(var c=0;c<s.dataPoints.length;++c){if(typeof s.dataPoints[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Sum.dataPoints: object expected");a.dataPoints[c]=Ne.opentelemetry.proto.metrics.v1.NumberDataPoint.fromObject(s.dataPoints[c])}}switch(s.aggregationTemporality){default:if(typeof s.aggregationTemporality=="number"){a.aggregationTemporality=s.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:a.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:a.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:a.aggregationTemporality=2;break}return s.isMonotonic!=null&&(a.isMonotonic=!!s.isMonotonic),a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.dataPoints=[]),a.defaults&&(c.aggregationTemporality=a.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0,c.isMonotonic=!1),s.dataPoints&&s.dataPoints.length){c.dataPoints=[];for(var u=0;u<s.dataPoints.length;++u)c.dataPoints[u]=Ne.opentelemetry.proto.metrics.v1.NumberDataPoint.toObject(s.dataPoints[u],a)}return s.aggregationTemporality!=null&&s.hasOwnProperty("aggregationTemporality")&&(c.aggregationTemporality=a.enums===String?Ne.opentelemetry.proto.metrics.v1.AggregationTemporality[s.aggregationTemporality]===void 0?s.aggregationTemporality:Ne.opentelemetry.proto.metrics.v1.AggregationTemporality[s.aggregationTemporality]:s.aggregationTemporality),s.isMonotonic!=null&&s.hasOwnProperty("isMonotonic")&&(c.isMonotonic=s.isMonotonic),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.metrics.v1.Sum"},i})(),n.Histogram=(function(){function i(o){if(this.dataPoints=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.dataPoints=Me.emptyArray,i.prototype.aggregationTemporality=null,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.dataPoints!=null&&s.dataPoints.length)for(var c=0;c<s.dataPoints.length;++c)Ne.opentelemetry.proto.metrics.v1.HistogramDataPoint.encode(s.dataPoints[c],a.uint32(10).fork()).ldelim();return s.aggregationTemporality!=null&&Object.hasOwnProperty.call(s,"aggregationTemporality")&&a.uint32(16).int32(s.aggregationTemporality),a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.metrics.v1.Histogram;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.dataPoints&&u.dataPoints.length||(u.dataPoints=[]),u.dataPoints.push(Ne.opentelemetry.proto.metrics.v1.HistogramDataPoint.decode(s,s.uint32()));break}case 2:{u.aggregationTemporality=s.int32();break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.dataPoints!=null&&s.hasOwnProperty("dataPoints")){if(!Array.isArray(s.dataPoints))return"dataPoints: array expected";for(var a=0;a<s.dataPoints.length;++a){var c=Ne.opentelemetry.proto.metrics.v1.HistogramDataPoint.verify(s.dataPoints[a]);if(c)return"dataPoints."+c}}if(s.aggregationTemporality!=null&&s.hasOwnProperty("aggregationTemporality"))switch(s.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.metrics.v1.Histogram)return s;var a=new Ne.opentelemetry.proto.metrics.v1.Histogram;if(s.dataPoints){if(!Array.isArray(s.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: array expected");a.dataPoints=[];for(var c=0;c<s.dataPoints.length;++c){if(typeof s.dataPoints[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Histogram.dataPoints: object expected");a.dataPoints[c]=Ne.opentelemetry.proto.metrics.v1.HistogramDataPoint.fromObject(s.dataPoints[c])}}switch(s.aggregationTemporality){default:if(typeof s.aggregationTemporality=="number"){a.aggregationTemporality=s.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:a.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:a.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:a.aggregationTemporality=2;break}return a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.dataPoints=[]),a.defaults&&(c.aggregationTemporality=a.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0),s.dataPoints&&s.dataPoints.length){c.dataPoints=[];for(var u=0;u<s.dataPoints.length;++u)c.dataPoints[u]=Ne.opentelemetry.proto.metrics.v1.HistogramDataPoint.toObject(s.dataPoints[u],a)}return s.aggregationTemporality!=null&&s.hasOwnProperty("aggregationTemporality")&&(c.aggregationTemporality=a.enums===String?Ne.opentelemetry.proto.metrics.v1.AggregationTemporality[s.aggregationTemporality]===void 0?s.aggregationTemporality:Ne.opentelemetry.proto.metrics.v1.AggregationTemporality[s.aggregationTemporality]:s.aggregationTemporality),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.metrics.v1.Histogram"},i})(),n.ExponentialHistogram=(function(){function i(o){if(this.dataPoints=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.dataPoints=Me.emptyArray,i.prototype.aggregationTemporality=null,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.dataPoints!=null&&s.dataPoints.length)for(var c=0;c<s.dataPoints.length;++c)Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.encode(s.dataPoints[c],a.uint32(10).fork()).ldelim();return s.aggregationTemporality!=null&&Object.hasOwnProperty.call(s,"aggregationTemporality")&&a.uint32(16).int32(s.aggregationTemporality),a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.metrics.v1.ExponentialHistogram;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.dataPoints&&u.dataPoints.length||(u.dataPoints=[]),u.dataPoints.push(Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.decode(s,s.uint32()));break}case 2:{u.aggregationTemporality=s.int32();break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.dataPoints!=null&&s.hasOwnProperty("dataPoints")){if(!Array.isArray(s.dataPoints))return"dataPoints: array expected";for(var a=0;a<s.dataPoints.length;++a){var c=Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.verify(s.dataPoints[a]);if(c)return"dataPoints."+c}}if(s.aggregationTemporality!=null&&s.hasOwnProperty("aggregationTemporality"))switch(s.aggregationTemporality){default:return"aggregationTemporality: enum value expected";case 0:case 1:case 2:break}return null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.metrics.v1.ExponentialHistogram)return s;var a=new Ne.opentelemetry.proto.metrics.v1.ExponentialHistogram;if(s.dataPoints){if(!Array.isArray(s.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: array expected");a.dataPoints=[];for(var c=0;c<s.dataPoints.length;++c){if(typeof s.dataPoints[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogram.dataPoints: object expected");a.dataPoints[c]=Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.fromObject(s.dataPoints[c])}}switch(s.aggregationTemporality){default:if(typeof s.aggregationTemporality=="number"){a.aggregationTemporality=s.aggregationTemporality;break}break;case"AGGREGATION_TEMPORALITY_UNSPECIFIED":case 0:a.aggregationTemporality=0;break;case"AGGREGATION_TEMPORALITY_DELTA":case 1:a.aggregationTemporality=1;break;case"AGGREGATION_TEMPORALITY_CUMULATIVE":case 2:a.aggregationTemporality=2;break}return a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.dataPoints=[]),a.defaults&&(c.aggregationTemporality=a.enums===String?"AGGREGATION_TEMPORALITY_UNSPECIFIED":0),s.dataPoints&&s.dataPoints.length){c.dataPoints=[];for(var u=0;u<s.dataPoints.length;++u)c.dataPoints[u]=Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.toObject(s.dataPoints[u],a)}return s.aggregationTemporality!=null&&s.hasOwnProperty("aggregationTemporality")&&(c.aggregationTemporality=a.enums===String?Ne.opentelemetry.proto.metrics.v1.AggregationTemporality[s.aggregationTemporality]===void 0?s.aggregationTemporality:Ne.opentelemetry.proto.metrics.v1.AggregationTemporality[s.aggregationTemporality]:s.aggregationTemporality),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.metrics.v1.ExponentialHistogram"},i})(),n.Summary=(function(){function i(o){if(this.dataPoints=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.dataPoints=Me.emptyArray,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.dataPoints!=null&&s.dataPoints.length)for(var c=0;c<s.dataPoints.length;++c)Ne.opentelemetry.proto.metrics.v1.SummaryDataPoint.encode(s.dataPoints[c],a.uint32(10).fork()).ldelim();return a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.metrics.v1.Summary;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.dataPoints&&u.dataPoints.length||(u.dataPoints=[]),u.dataPoints.push(Ne.opentelemetry.proto.metrics.v1.SummaryDataPoint.decode(s,s.uint32()));break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.dataPoints!=null&&s.hasOwnProperty("dataPoints")){if(!Array.isArray(s.dataPoints))return"dataPoints: array expected";for(var a=0;a<s.dataPoints.length;++a){var c=Ne.opentelemetry.proto.metrics.v1.SummaryDataPoint.verify(s.dataPoints[a]);if(c)return"dataPoints."+c}}return null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.metrics.v1.Summary)return s;var a=new Ne.opentelemetry.proto.metrics.v1.Summary;if(s.dataPoints){if(!Array.isArray(s.dataPoints))throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: array expected");a.dataPoints=[];for(var c=0;c<s.dataPoints.length;++c){if(typeof s.dataPoints[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Summary.dataPoints: object expected");a.dataPoints[c]=Ne.opentelemetry.proto.metrics.v1.SummaryDataPoint.fromObject(s.dataPoints[c])}}return a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.dataPoints=[]),s.dataPoints&&s.dataPoints.length){c.dataPoints=[];for(var u=0;u<s.dataPoints.length;++u)c.dataPoints[u]=Ne.opentelemetry.proto.metrics.v1.SummaryDataPoint.toObject(s.dataPoints[u],a)}return c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.metrics.v1.Summary"},i})(),n.AggregationTemporality=(function(){var i={},o=Object.create(i);return o[i[0]="AGGREGATION_TEMPORALITY_UNSPECIFIED"]=0,o[i[1]="AGGREGATION_TEMPORALITY_DELTA"]=1,o[i[2]="AGGREGATION_TEMPORALITY_CUMULATIVE"]=2,o})(),n.DataPointFlags=(function(){var i={},o=Object.create(i);return o[i[0]="DATA_POINT_FLAGS_DO_NOT_USE"]=0,o[i[1]="DATA_POINT_FLAGS_NO_RECORDED_VALUE_MASK"]=1,o})(),n.NumberDataPoint=(function(){function i(s){if(this.attributes=[],this.exemplars=[],s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}i.prototype.attributes=Me.emptyArray,i.prototype.startTimeUnixNano=null,i.prototype.timeUnixNano=null,i.prototype.asDouble=null,i.prototype.asInt=null,i.prototype.exemplars=Me.emptyArray,i.prototype.flags=null;var o;return Object.defineProperty(i.prototype,"value",{get:Me.oneOfGetter(o=["asDouble","asInt"]),set:Me.oneOfSetter(o)}),i.create=function(a){return new i(a)},i.encode=function(a,c){if(c||(c=Po.create()),a.startTimeUnixNano!=null&&Object.hasOwnProperty.call(a,"startTimeUnixNano")&&c.uint32(17).fixed64(a.startTimeUnixNano),a.timeUnixNano!=null&&Object.hasOwnProperty.call(a,"timeUnixNano")&&c.uint32(25).fixed64(a.timeUnixNano),a.asDouble!=null&&Object.hasOwnProperty.call(a,"asDouble")&&c.uint32(33).double(a.asDouble),a.exemplars!=null&&a.exemplars.length)for(var u=0;u<a.exemplars.length;++u)Ne.opentelemetry.proto.metrics.v1.Exemplar.encode(a.exemplars[u],c.uint32(42).fork()).ldelim();if(a.asInt!=null&&Object.hasOwnProperty.call(a,"asInt")&&c.uint32(49).sfixed64(a.asInt),a.attributes!=null&&a.attributes.length)for(var u=0;u<a.attributes.length;++u)Ne.opentelemetry.proto.common.v1.KeyValue.encode(a.attributes[u],c.uint32(58).fork()).ldelim();return a.flags!=null&&Object.hasOwnProperty.call(a,"flags")&&c.uint32(64).uint32(a.flags),c},i.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},i.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.metrics.v1.NumberDataPoint;a.pos<u;){var f=a.uint32();switch(f>>>3){case 7:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(Ne.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}case 2:{d.startTimeUnixNano=a.fixed64();break}case 3:{d.timeUnixNano=a.fixed64();break}case 4:{d.asDouble=a.double();break}case 6:{d.asInt=a.sfixed64();break}case 5:{d.exemplars&&d.exemplars.length||(d.exemplars=[]),d.exemplars.push(Ne.opentelemetry.proto.metrics.v1.Exemplar.decode(a,a.uint32()));break}case 8:{d.flags=a.uint32();break}default:a.skipType(f&7);break}}return d},i.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},i.verify=function(a){if(typeof a!="object"||a===null)return"object expected";var c={};if(a.attributes!=null&&a.hasOwnProperty("attributes")){if(!Array.isArray(a.attributes))return"attributes: array expected";for(var u=0;u<a.attributes.length;++u){var d=Ne.opentelemetry.proto.common.v1.KeyValue.verify(a.attributes[u]);if(d)return"attributes."+d}}if(a.startTimeUnixNano!=null&&a.hasOwnProperty("startTimeUnixNano")&&!Me.isInteger(a.startTimeUnixNano)&&!(a.startTimeUnixNano&&Me.isInteger(a.startTimeUnixNano.low)&&Me.isInteger(a.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&!Me.isInteger(a.timeUnixNano)&&!(a.timeUnixNano&&Me.isInteger(a.timeUnixNano.low)&&Me.isInteger(a.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(a.asDouble!=null&&a.hasOwnProperty("asDouble")&&(c.value=1,typeof a.asDouble!="number"))return"asDouble: number expected";if(a.asInt!=null&&a.hasOwnProperty("asInt")){if(c.value===1)return"value: multiple values";if(c.value=1,!Me.isInteger(a.asInt)&&!(a.asInt&&Me.isInteger(a.asInt.low)&&Me.isInteger(a.asInt.high)))return"asInt: integer|Long expected"}if(a.exemplars!=null&&a.hasOwnProperty("exemplars")){if(!Array.isArray(a.exemplars))return"exemplars: array expected";for(var u=0;u<a.exemplars.length;++u){var d=Ne.opentelemetry.proto.metrics.v1.Exemplar.verify(a.exemplars[u]);if(d)return"exemplars."+d}}return a.flags!=null&&a.hasOwnProperty("flags")&&!Me.isInteger(a.flags)?"flags: integer expected":null},i.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.metrics.v1.NumberDataPoint)return a;var c=new Ne.opentelemetry.proto.metrics.v1.NumberDataPoint;if(a.attributes){if(!Array.isArray(a.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: array expected");c.attributes=[];for(var u=0;u<a.attributes.length;++u){if(typeof a.attributes[u]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.attributes: object expected");c.attributes[u]=Ne.opentelemetry.proto.common.v1.KeyValue.fromObject(a.attributes[u])}}if(a.startTimeUnixNano!=null&&(Me.Long?(c.startTimeUnixNano=Me.Long.fromValue(a.startTimeUnixNano)).unsigned=!1:typeof a.startTimeUnixNano=="string"?c.startTimeUnixNano=parseInt(a.startTimeUnixNano,10):typeof a.startTimeUnixNano=="number"?c.startTimeUnixNano=a.startTimeUnixNano:typeof a.startTimeUnixNano=="object"&&(c.startTimeUnixNano=new Me.LongBits(a.startTimeUnixNano.low>>>0,a.startTimeUnixNano.high>>>0).toNumber())),a.timeUnixNano!=null&&(Me.Long?(c.timeUnixNano=Me.Long.fromValue(a.timeUnixNano)).unsigned=!1:typeof a.timeUnixNano=="string"?c.timeUnixNano=parseInt(a.timeUnixNano,10):typeof a.timeUnixNano=="number"?c.timeUnixNano=a.timeUnixNano:typeof a.timeUnixNano=="object"&&(c.timeUnixNano=new Me.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber())),a.asDouble!=null&&(c.asDouble=Number(a.asDouble)),a.asInt!=null&&(Me.Long?(c.asInt=Me.Long.fromValue(a.asInt)).unsigned=!1:typeof a.asInt=="string"?c.asInt=parseInt(a.asInt,10):typeof a.asInt=="number"?c.asInt=a.asInt:typeof a.asInt=="object"&&(c.asInt=new Me.LongBits(a.asInt.low>>>0,a.asInt.high>>>0).toNumber())),a.exemplars){if(!Array.isArray(a.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: array expected");c.exemplars=[];for(var u=0;u<a.exemplars.length;++u){if(typeof a.exemplars[u]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.NumberDataPoint.exemplars: object expected");c.exemplars[u]=Ne.opentelemetry.proto.metrics.v1.Exemplar.fromObject(a.exemplars[u])}}return a.flags!=null&&(c.flags=a.flags>>>0),c},i.toObject=function(a,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.exemplars=[],u.attributes=[]),c.defaults){if(Me.Long){var d=new Me.Long(0,0,!1);u.startTimeUnixNano=c.longs===String?d.toString():c.longs===Number?d.toNumber():d}else u.startTimeUnixNano=c.longs===String?"0":0;if(Me.Long){var d=new Me.Long(0,0,!1);u.timeUnixNano=c.longs===String?d.toString():c.longs===Number?d.toNumber():d}else u.timeUnixNano=c.longs===String?"0":0;u.flags=0}if(a.startTimeUnixNano!=null&&a.hasOwnProperty("startTimeUnixNano")&&(typeof a.startTimeUnixNano=="number"?u.startTimeUnixNano=c.longs===String?String(a.startTimeUnixNano):a.startTimeUnixNano:u.startTimeUnixNano=c.longs===String?Me.Long.prototype.toString.call(a.startTimeUnixNano):c.longs===Number?new Me.LongBits(a.startTimeUnixNano.low>>>0,a.startTimeUnixNano.high>>>0).toNumber():a.startTimeUnixNano),a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&(typeof a.timeUnixNano=="number"?u.timeUnixNano=c.longs===String?String(a.timeUnixNano):a.timeUnixNano:u.timeUnixNano=c.longs===String?Me.Long.prototype.toString.call(a.timeUnixNano):c.longs===Number?new Me.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber():a.timeUnixNano),a.asDouble!=null&&a.hasOwnProperty("asDouble")&&(u.asDouble=c.json&&!isFinite(a.asDouble)?String(a.asDouble):a.asDouble,c.oneofs&&(u.value="asDouble")),a.exemplars&&a.exemplars.length){u.exemplars=[];for(var f=0;f<a.exemplars.length;++f)u.exemplars[f]=Ne.opentelemetry.proto.metrics.v1.Exemplar.toObject(a.exemplars[f],c)}if(a.asInt!=null&&a.hasOwnProperty("asInt")&&(typeof a.asInt=="number"?u.asInt=c.longs===String?String(a.asInt):a.asInt:u.asInt=c.longs===String?Me.Long.prototype.toString.call(a.asInt):c.longs===Number?new Me.LongBits(a.asInt.low>>>0,a.asInt.high>>>0).toNumber():a.asInt,c.oneofs&&(u.value="asInt")),a.attributes&&a.attributes.length){u.attributes=[];for(var f=0;f<a.attributes.length;++f)u.attributes[f]=Ne.opentelemetry.proto.common.v1.KeyValue.toObject(a.attributes[f],c)}return a.flags!=null&&a.hasOwnProperty("flags")&&(u.flags=a.flags),u},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.NumberDataPoint"},i})(),n.HistogramDataPoint=(function(){function i(s){if(this.attributes=[],this.bucketCounts=[],this.explicitBounds=[],this.exemplars=[],s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}i.prototype.attributes=Me.emptyArray,i.prototype.startTimeUnixNano=null,i.prototype.timeUnixNano=null,i.prototype.count=null,i.prototype.sum=null,i.prototype.bucketCounts=Me.emptyArray,i.prototype.explicitBounds=Me.emptyArray,i.prototype.exemplars=Me.emptyArray,i.prototype.flags=null,i.prototype.min=null,i.prototype.max=null;var o;return Object.defineProperty(i.prototype,"_sum",{get:Me.oneOfGetter(o=["sum"]),set:Me.oneOfSetter(o)}),Object.defineProperty(i.prototype,"_min",{get:Me.oneOfGetter(o=["min"]),set:Me.oneOfSetter(o)}),Object.defineProperty(i.prototype,"_max",{get:Me.oneOfGetter(o=["max"]),set:Me.oneOfSetter(o)}),i.create=function(a){return new i(a)},i.encode=function(a,c){if(c||(c=Po.create()),a.startTimeUnixNano!=null&&Object.hasOwnProperty.call(a,"startTimeUnixNano")&&c.uint32(17).fixed64(a.startTimeUnixNano),a.timeUnixNano!=null&&Object.hasOwnProperty.call(a,"timeUnixNano")&&c.uint32(25).fixed64(a.timeUnixNano),a.count!=null&&Object.hasOwnProperty.call(a,"count")&&c.uint32(33).fixed64(a.count),a.sum!=null&&Object.hasOwnProperty.call(a,"sum")&&c.uint32(41).double(a.sum),a.bucketCounts!=null&&a.bucketCounts.length){c.uint32(50).fork();for(var u=0;u<a.bucketCounts.length;++u)c.fixed64(a.bucketCounts[u]);c.ldelim()}if(a.explicitBounds!=null&&a.explicitBounds.length){c.uint32(58).fork();for(var u=0;u<a.explicitBounds.length;++u)c.double(a.explicitBounds[u]);c.ldelim()}if(a.exemplars!=null&&a.exemplars.length)for(var u=0;u<a.exemplars.length;++u)Ne.opentelemetry.proto.metrics.v1.Exemplar.encode(a.exemplars[u],c.uint32(66).fork()).ldelim();if(a.attributes!=null&&a.attributes.length)for(var u=0;u<a.attributes.length;++u)Ne.opentelemetry.proto.common.v1.KeyValue.encode(a.attributes[u],c.uint32(74).fork()).ldelim();return a.flags!=null&&Object.hasOwnProperty.call(a,"flags")&&c.uint32(80).uint32(a.flags),a.min!=null&&Object.hasOwnProperty.call(a,"min")&&c.uint32(89).double(a.min),a.max!=null&&Object.hasOwnProperty.call(a,"max")&&c.uint32(97).double(a.max),c},i.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},i.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.metrics.v1.HistogramDataPoint;a.pos<u;){var f=a.uint32();switch(f>>>3){case 9:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(Ne.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}case 2:{d.startTimeUnixNano=a.fixed64();break}case 3:{d.timeUnixNano=a.fixed64();break}case 4:{d.count=a.fixed64();break}case 5:{d.sum=a.double();break}case 6:{if(d.bucketCounts&&d.bucketCounts.length||(d.bucketCounts=[]),(f&7)===2)for(var p=a.uint32()+a.pos;a.pos<p;)d.bucketCounts.push(a.fixed64());else d.bucketCounts.push(a.fixed64());break}case 7:{if(d.explicitBounds&&d.explicitBounds.length||(d.explicitBounds=[]),(f&7)===2)for(var p=a.uint32()+a.pos;a.pos<p;)d.explicitBounds.push(a.double());else d.explicitBounds.push(a.double());break}case 8:{d.exemplars&&d.exemplars.length||(d.exemplars=[]),d.exemplars.push(Ne.opentelemetry.proto.metrics.v1.Exemplar.decode(a,a.uint32()));break}case 10:{d.flags=a.uint32();break}case 11:{d.min=a.double();break}case 12:{d.max=a.double();break}default:a.skipType(f&7);break}}return d},i.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},i.verify=function(a){if(typeof a!="object"||a===null)return"object expected";var c={};if(a.attributes!=null&&a.hasOwnProperty("attributes")){if(!Array.isArray(a.attributes))return"attributes: array expected";for(var u=0;u<a.attributes.length;++u){var d=Ne.opentelemetry.proto.common.v1.KeyValue.verify(a.attributes[u]);if(d)return"attributes."+d}}if(a.startTimeUnixNano!=null&&a.hasOwnProperty("startTimeUnixNano")&&!Me.isInteger(a.startTimeUnixNano)&&!(a.startTimeUnixNano&&Me.isInteger(a.startTimeUnixNano.low)&&Me.isInteger(a.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&!Me.isInteger(a.timeUnixNano)&&!(a.timeUnixNano&&Me.isInteger(a.timeUnixNano.low)&&Me.isInteger(a.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(a.count!=null&&a.hasOwnProperty("count")&&!Me.isInteger(a.count)&&!(a.count&&Me.isInteger(a.count.low)&&Me.isInteger(a.count.high)))return"count: integer|Long expected";if(a.sum!=null&&a.hasOwnProperty("sum")&&(c._sum=1,typeof a.sum!="number"))return"sum: number expected";if(a.bucketCounts!=null&&a.hasOwnProperty("bucketCounts")){if(!Array.isArray(a.bucketCounts))return"bucketCounts: array expected";for(var u=0;u<a.bucketCounts.length;++u)if(!Me.isInteger(a.bucketCounts[u])&&!(a.bucketCounts[u]&&Me.isInteger(a.bucketCounts[u].low)&&Me.isInteger(a.bucketCounts[u].high)))return"bucketCounts: integer|Long[] expected"}if(a.explicitBounds!=null&&a.hasOwnProperty("explicitBounds")){if(!Array.isArray(a.explicitBounds))return"explicitBounds: array expected";for(var u=0;u<a.explicitBounds.length;++u)if(typeof a.explicitBounds[u]!="number")return"explicitBounds: number[] expected"}if(a.exemplars!=null&&a.hasOwnProperty("exemplars")){if(!Array.isArray(a.exemplars))return"exemplars: array expected";for(var u=0;u<a.exemplars.length;++u){var d=Ne.opentelemetry.proto.metrics.v1.Exemplar.verify(a.exemplars[u]);if(d)return"exemplars."+d}}return a.flags!=null&&a.hasOwnProperty("flags")&&!Me.isInteger(a.flags)?"flags: integer expected":a.min!=null&&a.hasOwnProperty("min")&&(c._min=1,typeof a.min!="number")?"min: number expected":a.max!=null&&a.hasOwnProperty("max")&&(c._max=1,typeof a.max!="number")?"max: number expected":null},i.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.metrics.v1.HistogramDataPoint)return a;var c=new Ne.opentelemetry.proto.metrics.v1.HistogramDataPoint;if(a.attributes){if(!Array.isArray(a.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: array expected");c.attributes=[];for(var u=0;u<a.attributes.length;++u){if(typeof a.attributes[u]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.attributes: object expected");c.attributes[u]=Ne.opentelemetry.proto.common.v1.KeyValue.fromObject(a.attributes[u])}}if(a.startTimeUnixNano!=null&&(Me.Long?(c.startTimeUnixNano=Me.Long.fromValue(a.startTimeUnixNano)).unsigned=!1:typeof a.startTimeUnixNano=="string"?c.startTimeUnixNano=parseInt(a.startTimeUnixNano,10):typeof a.startTimeUnixNano=="number"?c.startTimeUnixNano=a.startTimeUnixNano:typeof a.startTimeUnixNano=="object"&&(c.startTimeUnixNano=new Me.LongBits(a.startTimeUnixNano.low>>>0,a.startTimeUnixNano.high>>>0).toNumber())),a.timeUnixNano!=null&&(Me.Long?(c.timeUnixNano=Me.Long.fromValue(a.timeUnixNano)).unsigned=!1:typeof a.timeUnixNano=="string"?c.timeUnixNano=parseInt(a.timeUnixNano,10):typeof a.timeUnixNano=="number"?c.timeUnixNano=a.timeUnixNano:typeof a.timeUnixNano=="object"&&(c.timeUnixNano=new Me.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber())),a.count!=null&&(Me.Long?(c.count=Me.Long.fromValue(a.count)).unsigned=!1:typeof a.count=="string"?c.count=parseInt(a.count,10):typeof a.count=="number"?c.count=a.count:typeof a.count=="object"&&(c.count=new Me.LongBits(a.count.low>>>0,a.count.high>>>0).toNumber())),a.sum!=null&&(c.sum=Number(a.sum)),a.bucketCounts){if(!Array.isArray(a.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.bucketCounts: array expected");c.bucketCounts=[];for(var u=0;u<a.bucketCounts.length;++u)Me.Long?(c.bucketCounts[u]=Me.Long.fromValue(a.bucketCounts[u])).unsigned=!1:typeof a.bucketCounts[u]=="string"?c.bucketCounts[u]=parseInt(a.bucketCounts[u],10):typeof a.bucketCounts[u]=="number"?c.bucketCounts[u]=a.bucketCounts[u]:typeof a.bucketCounts[u]=="object"&&(c.bucketCounts[u]=new Me.LongBits(a.bucketCounts[u].low>>>0,a.bucketCounts[u].high>>>0).toNumber())}if(a.explicitBounds){if(!Array.isArray(a.explicitBounds))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.explicitBounds: array expected");c.explicitBounds=[];for(var u=0;u<a.explicitBounds.length;++u)c.explicitBounds[u]=Number(a.explicitBounds[u])}if(a.exemplars){if(!Array.isArray(a.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: array expected");c.exemplars=[];for(var u=0;u<a.exemplars.length;++u){if(typeof a.exemplars[u]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.HistogramDataPoint.exemplars: object expected");c.exemplars[u]=Ne.opentelemetry.proto.metrics.v1.Exemplar.fromObject(a.exemplars[u])}}return a.flags!=null&&(c.flags=a.flags>>>0),a.min!=null&&(c.min=Number(a.min)),a.max!=null&&(c.max=Number(a.max)),c},i.toObject=function(a,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.bucketCounts=[],u.explicitBounds=[],u.exemplars=[],u.attributes=[]),c.defaults){if(Me.Long){var d=new Me.Long(0,0,!1);u.startTimeUnixNano=c.longs===String?d.toString():c.longs===Number?d.toNumber():d}else u.startTimeUnixNano=c.longs===String?"0":0;if(Me.Long){var d=new Me.Long(0,0,!1);u.timeUnixNano=c.longs===String?d.toString():c.longs===Number?d.toNumber():d}else u.timeUnixNano=c.longs===String?"0":0;if(Me.Long){var d=new Me.Long(0,0,!1);u.count=c.longs===String?d.toString():c.longs===Number?d.toNumber():d}else u.count=c.longs===String?"0":0;u.flags=0}if(a.startTimeUnixNano!=null&&a.hasOwnProperty("startTimeUnixNano")&&(typeof a.startTimeUnixNano=="number"?u.startTimeUnixNano=c.longs===String?String(a.startTimeUnixNano):a.startTimeUnixNano:u.startTimeUnixNano=c.longs===String?Me.Long.prototype.toString.call(a.startTimeUnixNano):c.longs===Number?new Me.LongBits(a.startTimeUnixNano.low>>>0,a.startTimeUnixNano.high>>>0).toNumber():a.startTimeUnixNano),a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&(typeof a.timeUnixNano=="number"?u.timeUnixNano=c.longs===String?String(a.timeUnixNano):a.timeUnixNano:u.timeUnixNano=c.longs===String?Me.Long.prototype.toString.call(a.timeUnixNano):c.longs===Number?new Me.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber():a.timeUnixNano),a.count!=null&&a.hasOwnProperty("count")&&(typeof a.count=="number"?u.count=c.longs===String?String(a.count):a.count:u.count=c.longs===String?Me.Long.prototype.toString.call(a.count):c.longs===Number?new Me.LongBits(a.count.low>>>0,a.count.high>>>0).toNumber():a.count),a.sum!=null&&a.hasOwnProperty("sum")&&(u.sum=c.json&&!isFinite(a.sum)?String(a.sum):a.sum,c.oneofs&&(u._sum="sum")),a.bucketCounts&&a.bucketCounts.length){u.bucketCounts=[];for(var f=0;f<a.bucketCounts.length;++f)typeof a.bucketCounts[f]=="number"?u.bucketCounts[f]=c.longs===String?String(a.bucketCounts[f]):a.bucketCounts[f]:u.bucketCounts[f]=c.longs===String?Me.Long.prototype.toString.call(a.bucketCounts[f]):c.longs===Number?new Me.LongBits(a.bucketCounts[f].low>>>0,a.bucketCounts[f].high>>>0).toNumber():a.bucketCounts[f]}if(a.explicitBounds&&a.explicitBounds.length){u.explicitBounds=[];for(var f=0;f<a.explicitBounds.length;++f)u.explicitBounds[f]=c.json&&!isFinite(a.explicitBounds[f])?String(a.explicitBounds[f]):a.explicitBounds[f]}if(a.exemplars&&a.exemplars.length){u.exemplars=[];for(var f=0;f<a.exemplars.length;++f)u.exemplars[f]=Ne.opentelemetry.proto.metrics.v1.Exemplar.toObject(a.exemplars[f],c)}if(a.attributes&&a.attributes.length){u.attributes=[];for(var f=0;f<a.attributes.length;++f)u.attributes[f]=Ne.opentelemetry.proto.common.v1.KeyValue.toObject(a.attributes[f],c)}return a.flags!=null&&a.hasOwnProperty("flags")&&(u.flags=a.flags),a.min!=null&&a.hasOwnProperty("min")&&(u.min=c.json&&!isFinite(a.min)?String(a.min):a.min,c.oneofs&&(u._min="min")),a.max!=null&&a.hasOwnProperty("max")&&(u.max=c.json&&!isFinite(a.max)?String(a.max):a.max,c.oneofs&&(u._max="max")),u},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.HistogramDataPoint"},i})(),n.ExponentialHistogramDataPoint=(function(){function i(s){if(this.attributes=[],this.exemplars=[],s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}i.prototype.attributes=Me.emptyArray,i.prototype.startTimeUnixNano=null,i.prototype.timeUnixNano=null,i.prototype.count=null,i.prototype.sum=null,i.prototype.scale=null,i.prototype.zeroCount=null,i.prototype.positive=null,i.prototype.negative=null,i.prototype.flags=null,i.prototype.exemplars=Me.emptyArray,i.prototype.min=null,i.prototype.max=null,i.prototype.zeroThreshold=null;var o;return Object.defineProperty(i.prototype,"_sum",{get:Me.oneOfGetter(o=["sum"]),set:Me.oneOfSetter(o)}),Object.defineProperty(i.prototype,"_min",{get:Me.oneOfGetter(o=["min"]),set:Me.oneOfSetter(o)}),Object.defineProperty(i.prototype,"_max",{get:Me.oneOfGetter(o=["max"]),set:Me.oneOfSetter(o)}),i.create=function(a){return new i(a)},i.encode=function(a,c){if(c||(c=Po.create()),a.attributes!=null&&a.attributes.length)for(var u=0;u<a.attributes.length;++u)Ne.opentelemetry.proto.common.v1.KeyValue.encode(a.attributes[u],c.uint32(10).fork()).ldelim();if(a.startTimeUnixNano!=null&&Object.hasOwnProperty.call(a,"startTimeUnixNano")&&c.uint32(17).fixed64(a.startTimeUnixNano),a.timeUnixNano!=null&&Object.hasOwnProperty.call(a,"timeUnixNano")&&c.uint32(25).fixed64(a.timeUnixNano),a.count!=null&&Object.hasOwnProperty.call(a,"count")&&c.uint32(33).fixed64(a.count),a.sum!=null&&Object.hasOwnProperty.call(a,"sum")&&c.uint32(41).double(a.sum),a.scale!=null&&Object.hasOwnProperty.call(a,"scale")&&c.uint32(48).sint32(a.scale),a.zeroCount!=null&&Object.hasOwnProperty.call(a,"zeroCount")&&c.uint32(57).fixed64(a.zeroCount),a.positive!=null&&Object.hasOwnProperty.call(a,"positive")&&Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(a.positive,c.uint32(66).fork()).ldelim(),a.negative!=null&&Object.hasOwnProperty.call(a,"negative")&&Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.encode(a.negative,c.uint32(74).fork()).ldelim(),a.flags!=null&&Object.hasOwnProperty.call(a,"flags")&&c.uint32(80).uint32(a.flags),a.exemplars!=null&&a.exemplars.length)for(var u=0;u<a.exemplars.length;++u)Ne.opentelemetry.proto.metrics.v1.Exemplar.encode(a.exemplars[u],c.uint32(90).fork()).ldelim();return a.min!=null&&Object.hasOwnProperty.call(a,"min")&&c.uint32(97).double(a.min),a.max!=null&&Object.hasOwnProperty.call(a,"max")&&c.uint32(105).double(a.max),a.zeroThreshold!=null&&Object.hasOwnProperty.call(a,"zeroThreshold")&&c.uint32(113).double(a.zeroThreshold),c},i.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},i.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;a.pos<u;){var f=a.uint32();switch(f>>>3){case 1:{d.attributes&&d.attributes.length||(d.attributes=[]),d.attributes.push(Ne.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}case 2:{d.startTimeUnixNano=a.fixed64();break}case 3:{d.timeUnixNano=a.fixed64();break}case 4:{d.count=a.fixed64();break}case 5:{d.sum=a.double();break}case 6:{d.scale=a.sint32();break}case 7:{d.zeroCount=a.fixed64();break}case 8:{d.positive=Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(a,a.uint32());break}case 9:{d.negative=Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.decode(a,a.uint32());break}case 10:{d.flags=a.uint32();break}case 11:{d.exemplars&&d.exemplars.length||(d.exemplars=[]),d.exemplars.push(Ne.opentelemetry.proto.metrics.v1.Exemplar.decode(a,a.uint32()));break}case 12:{d.min=a.double();break}case 13:{d.max=a.double();break}case 14:{d.zeroThreshold=a.double();break}default:a.skipType(f&7);break}}return d},i.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},i.verify=function(a){if(typeof a!="object"||a===null)return"object expected";var c={};if(a.attributes!=null&&a.hasOwnProperty("attributes")){if(!Array.isArray(a.attributes))return"attributes: array expected";for(var u=0;u<a.attributes.length;++u){var d=Ne.opentelemetry.proto.common.v1.KeyValue.verify(a.attributes[u]);if(d)return"attributes."+d}}if(a.startTimeUnixNano!=null&&a.hasOwnProperty("startTimeUnixNano")&&!Me.isInteger(a.startTimeUnixNano)&&!(a.startTimeUnixNano&&Me.isInteger(a.startTimeUnixNano.low)&&Me.isInteger(a.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&!Me.isInteger(a.timeUnixNano)&&!(a.timeUnixNano&&Me.isInteger(a.timeUnixNano.low)&&Me.isInteger(a.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(a.count!=null&&a.hasOwnProperty("count")&&!Me.isInteger(a.count)&&!(a.count&&Me.isInteger(a.count.low)&&Me.isInteger(a.count.high)))return"count: integer|Long expected";if(a.sum!=null&&a.hasOwnProperty("sum")&&(c._sum=1,typeof a.sum!="number"))return"sum: number expected";if(a.scale!=null&&a.hasOwnProperty("scale")&&!Me.isInteger(a.scale))return"scale: integer expected";if(a.zeroCount!=null&&a.hasOwnProperty("zeroCount")&&!Me.isInteger(a.zeroCount)&&!(a.zeroCount&&Me.isInteger(a.zeroCount.low)&&Me.isInteger(a.zeroCount.high)))return"zeroCount: integer|Long expected";if(a.positive!=null&&a.hasOwnProperty("positive")){var d=Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(a.positive);if(d)return"positive."+d}if(a.negative!=null&&a.hasOwnProperty("negative")){var d=Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.verify(a.negative);if(d)return"negative."+d}if(a.flags!=null&&a.hasOwnProperty("flags")&&!Me.isInteger(a.flags))return"flags: integer expected";if(a.exemplars!=null&&a.hasOwnProperty("exemplars")){if(!Array.isArray(a.exemplars))return"exemplars: array expected";for(var u=0;u<a.exemplars.length;++u){var d=Ne.opentelemetry.proto.metrics.v1.Exemplar.verify(a.exemplars[u]);if(d)return"exemplars."+d}}return a.min!=null&&a.hasOwnProperty("min")&&(c._min=1,typeof a.min!="number")?"min: number expected":a.max!=null&&a.hasOwnProperty("max")&&(c._max=1,typeof a.max!="number")?"max: number expected":a.zeroThreshold!=null&&a.hasOwnProperty("zeroThreshold")&&typeof a.zeroThreshold!="number"?"zeroThreshold: number expected":null},i.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint)return a;var c=new Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint;if(a.attributes){if(!Array.isArray(a.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: array expected");c.attributes=[];for(var u=0;u<a.attributes.length;++u){if(typeof a.attributes[u]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.attributes: object expected");c.attributes[u]=Ne.opentelemetry.proto.common.v1.KeyValue.fromObject(a.attributes[u])}}if(a.startTimeUnixNano!=null&&(Me.Long?(c.startTimeUnixNano=Me.Long.fromValue(a.startTimeUnixNano)).unsigned=!1:typeof a.startTimeUnixNano=="string"?c.startTimeUnixNano=parseInt(a.startTimeUnixNano,10):typeof a.startTimeUnixNano=="number"?c.startTimeUnixNano=a.startTimeUnixNano:typeof a.startTimeUnixNano=="object"&&(c.startTimeUnixNano=new Me.LongBits(a.startTimeUnixNano.low>>>0,a.startTimeUnixNano.high>>>0).toNumber())),a.timeUnixNano!=null&&(Me.Long?(c.timeUnixNano=Me.Long.fromValue(a.timeUnixNano)).unsigned=!1:typeof a.timeUnixNano=="string"?c.timeUnixNano=parseInt(a.timeUnixNano,10):typeof a.timeUnixNano=="number"?c.timeUnixNano=a.timeUnixNano:typeof a.timeUnixNano=="object"&&(c.timeUnixNano=new Me.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber())),a.count!=null&&(Me.Long?(c.count=Me.Long.fromValue(a.count)).unsigned=!1:typeof a.count=="string"?c.count=parseInt(a.count,10):typeof a.count=="number"?c.count=a.count:typeof a.count=="object"&&(c.count=new Me.LongBits(a.count.low>>>0,a.count.high>>>0).toNumber())),a.sum!=null&&(c.sum=Number(a.sum)),a.scale!=null&&(c.scale=a.scale|0),a.zeroCount!=null&&(Me.Long?(c.zeroCount=Me.Long.fromValue(a.zeroCount)).unsigned=!1:typeof a.zeroCount=="string"?c.zeroCount=parseInt(a.zeroCount,10):typeof a.zeroCount=="number"?c.zeroCount=a.zeroCount:typeof a.zeroCount=="object"&&(c.zeroCount=new Me.LongBits(a.zeroCount.low>>>0,a.zeroCount.high>>>0).toNumber())),a.positive!=null){if(typeof a.positive!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.positive: object expected");c.positive=Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(a.positive)}if(a.negative!=null){if(typeof a.negative!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.negative: object expected");c.negative=Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.fromObject(a.negative)}if(a.flags!=null&&(c.flags=a.flags>>>0),a.exemplars){if(!Array.isArray(a.exemplars))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: array expected");c.exemplars=[];for(var u=0;u<a.exemplars.length;++u){if(typeof a.exemplars[u]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.exemplars: object expected");c.exemplars[u]=Ne.opentelemetry.proto.metrics.v1.Exemplar.fromObject(a.exemplars[u])}}return a.min!=null&&(c.min=Number(a.min)),a.max!=null&&(c.max=Number(a.max)),a.zeroThreshold!=null&&(c.zeroThreshold=Number(a.zeroThreshold)),c},i.toObject=function(a,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.attributes=[],u.exemplars=[]),c.defaults){if(Me.Long){var d=new Me.Long(0,0,!1);u.startTimeUnixNano=c.longs===String?d.toString():c.longs===Number?d.toNumber():d}else u.startTimeUnixNano=c.longs===String?"0":0;if(Me.Long){var d=new Me.Long(0,0,!1);u.timeUnixNano=c.longs===String?d.toString():c.longs===Number?d.toNumber():d}else u.timeUnixNano=c.longs===String?"0":0;if(Me.Long){var d=new Me.Long(0,0,!1);u.count=c.longs===String?d.toString():c.longs===Number?d.toNumber():d}else u.count=c.longs===String?"0":0;if(u.scale=0,Me.Long){var d=new Me.Long(0,0,!1);u.zeroCount=c.longs===String?d.toString():c.longs===Number?d.toNumber():d}else u.zeroCount=c.longs===String?"0":0;u.positive=null,u.negative=null,u.flags=0,u.zeroThreshold=0}if(a.attributes&&a.attributes.length){u.attributes=[];for(var f=0;f<a.attributes.length;++f)u.attributes[f]=Ne.opentelemetry.proto.common.v1.KeyValue.toObject(a.attributes[f],c)}if(a.startTimeUnixNano!=null&&a.hasOwnProperty("startTimeUnixNano")&&(typeof a.startTimeUnixNano=="number"?u.startTimeUnixNano=c.longs===String?String(a.startTimeUnixNano):a.startTimeUnixNano:u.startTimeUnixNano=c.longs===String?Me.Long.prototype.toString.call(a.startTimeUnixNano):c.longs===Number?new Me.LongBits(a.startTimeUnixNano.low>>>0,a.startTimeUnixNano.high>>>0).toNumber():a.startTimeUnixNano),a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&(typeof a.timeUnixNano=="number"?u.timeUnixNano=c.longs===String?String(a.timeUnixNano):a.timeUnixNano:u.timeUnixNano=c.longs===String?Me.Long.prototype.toString.call(a.timeUnixNano):c.longs===Number?new Me.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber():a.timeUnixNano),a.count!=null&&a.hasOwnProperty("count")&&(typeof a.count=="number"?u.count=c.longs===String?String(a.count):a.count:u.count=c.longs===String?Me.Long.prototype.toString.call(a.count):c.longs===Number?new Me.LongBits(a.count.low>>>0,a.count.high>>>0).toNumber():a.count),a.sum!=null&&a.hasOwnProperty("sum")&&(u.sum=c.json&&!isFinite(a.sum)?String(a.sum):a.sum,c.oneofs&&(u._sum="sum")),a.scale!=null&&a.hasOwnProperty("scale")&&(u.scale=a.scale),a.zeroCount!=null&&a.hasOwnProperty("zeroCount")&&(typeof a.zeroCount=="number"?u.zeroCount=c.longs===String?String(a.zeroCount):a.zeroCount:u.zeroCount=c.longs===String?Me.Long.prototype.toString.call(a.zeroCount):c.longs===Number?new Me.LongBits(a.zeroCount.low>>>0,a.zeroCount.high>>>0).toNumber():a.zeroCount),a.positive!=null&&a.hasOwnProperty("positive")&&(u.positive=Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(a.positive,c)),a.negative!=null&&a.hasOwnProperty("negative")&&(u.negative=Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.toObject(a.negative,c)),a.flags!=null&&a.hasOwnProperty("flags")&&(u.flags=a.flags),a.exemplars&&a.exemplars.length){u.exemplars=[];for(var f=0;f<a.exemplars.length;++f)u.exemplars[f]=Ne.opentelemetry.proto.metrics.v1.Exemplar.toObject(a.exemplars[f],c)}return a.min!=null&&a.hasOwnProperty("min")&&(u.min=c.json&&!isFinite(a.min)?String(a.min):a.min,c.oneofs&&(u._min="min")),a.max!=null&&a.hasOwnProperty("max")&&(u.max=c.json&&!isFinite(a.max)?String(a.max):a.max,c.oneofs&&(u._max="max")),a.zeroThreshold!=null&&a.hasOwnProperty("zeroThreshold")&&(u.zeroThreshold=c.json&&!isFinite(a.zeroThreshold)?String(a.zeroThreshold):a.zeroThreshold),u},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint"},i.Buckets=(function(){function s(a){if(this.bucketCounts=[],a)for(var c=Object.keys(a),u=0;u<c.length;++u)a[c[u]]!=null&&(this[c[u]]=a[c[u]])}return s.prototype.offset=null,s.prototype.bucketCounts=Me.emptyArray,s.create=function(c){return new s(c)},s.encode=function(c,u){if(u||(u=Po.create()),c.offset!=null&&Object.hasOwnProperty.call(c,"offset")&&u.uint32(8).sint32(c.offset),c.bucketCounts!=null&&c.bucketCounts.length){u.uint32(18).fork();for(var d=0;d<c.bucketCounts.length;++d)u.uint64(c.bucketCounts[d]);u.ldelim()}return u},s.encodeDelimited=function(c,u){return this.encode(c,u).ldelim()},s.decode=function(c,u){c instanceof vt||(c=vt.create(c));for(var d=u===void 0?c.len:c.pos+u,f=new Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;c.pos<d;){var p=c.uint32();switch(p>>>3){case 1:{f.offset=c.sint32();break}case 2:{if(f.bucketCounts&&f.bucketCounts.length||(f.bucketCounts=[]),(p&7)===2)for(var h=c.uint32()+c.pos;c.pos<h;)f.bucketCounts.push(c.uint64());else f.bucketCounts.push(c.uint64());break}default:c.skipType(p&7);break}}return f},s.decodeDelimited=function(c){return c instanceof vt||(c=new vt(c)),this.decode(c,c.uint32())},s.verify=function(c){if(typeof c!="object"||c===null)return"object expected";if(c.offset!=null&&c.hasOwnProperty("offset")&&!Me.isInteger(c.offset))return"offset: integer expected";if(c.bucketCounts!=null&&c.hasOwnProperty("bucketCounts")){if(!Array.isArray(c.bucketCounts))return"bucketCounts: array expected";for(var u=0;u<c.bucketCounts.length;++u)if(!Me.isInteger(c.bucketCounts[u])&&!(c.bucketCounts[u]&&Me.isInteger(c.bucketCounts[u].low)&&Me.isInteger(c.bucketCounts[u].high)))return"bucketCounts: integer|Long[] expected"}return null},s.fromObject=function(c){if(c instanceof Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets)return c;var u=new Ne.opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets;if(c.offset!=null&&(u.offset=c.offset|0),c.bucketCounts){if(!Array.isArray(c.bucketCounts))throw TypeError(".opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets.bucketCounts: array expected");u.bucketCounts=[];for(var d=0;d<c.bucketCounts.length;++d)Me.Long?(u.bucketCounts[d]=Me.Long.fromValue(c.bucketCounts[d])).unsigned=!0:typeof c.bucketCounts[d]=="string"?u.bucketCounts[d]=parseInt(c.bucketCounts[d],10):typeof c.bucketCounts[d]=="number"?u.bucketCounts[d]=c.bucketCounts[d]:typeof c.bucketCounts[d]=="object"&&(u.bucketCounts[d]=new Me.LongBits(c.bucketCounts[d].low>>>0,c.bucketCounts[d].high>>>0).toNumber(!0))}return u},s.toObject=function(c,u){u||(u={});var d={};if((u.arrays||u.defaults)&&(d.bucketCounts=[]),u.defaults&&(d.offset=0),c.offset!=null&&c.hasOwnProperty("offset")&&(d.offset=c.offset),c.bucketCounts&&c.bucketCounts.length){d.bucketCounts=[];for(var f=0;f<c.bucketCounts.length;++f)typeof c.bucketCounts[f]=="number"?d.bucketCounts[f]=u.longs===String?String(c.bucketCounts[f]):c.bucketCounts[f]:d.bucketCounts[f]=u.longs===String?Me.Long.prototype.toString.call(c.bucketCounts[f]):u.longs===Number?new Me.LongBits(c.bucketCounts[f].low>>>0,c.bucketCounts[f].high>>>0).toNumber(!0):c.bucketCounts[f]}return d},s.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},s.getTypeUrl=function(c){return c===void 0&&(c="type.googleapis.com"),c+"/opentelemetry.proto.metrics.v1.ExponentialHistogramDataPoint.Buckets"},s})(),i})(),n.SummaryDataPoint=(function(){function i(o){if(this.attributes=[],this.quantileValues=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.attributes=Me.emptyArray,i.prototype.startTimeUnixNano=null,i.prototype.timeUnixNano=null,i.prototype.count=null,i.prototype.sum=null,i.prototype.quantileValues=Me.emptyArray,i.prototype.flags=null,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.startTimeUnixNano!=null&&Object.hasOwnProperty.call(s,"startTimeUnixNano")&&a.uint32(17).fixed64(s.startTimeUnixNano),s.timeUnixNano!=null&&Object.hasOwnProperty.call(s,"timeUnixNano")&&a.uint32(25).fixed64(s.timeUnixNano),s.count!=null&&Object.hasOwnProperty.call(s,"count")&&a.uint32(33).fixed64(s.count),s.sum!=null&&Object.hasOwnProperty.call(s,"sum")&&a.uint32(41).double(s.sum),s.quantileValues!=null&&s.quantileValues.length)for(var c=0;c<s.quantileValues.length;++c)Ne.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.encode(s.quantileValues[c],a.uint32(50).fork()).ldelim();if(s.attributes!=null&&s.attributes.length)for(var c=0;c<s.attributes.length;++c)Ne.opentelemetry.proto.common.v1.KeyValue.encode(s.attributes[c],a.uint32(58).fork()).ldelim();return s.flags!=null&&Object.hasOwnProperty.call(s,"flags")&&a.uint32(64).uint32(s.flags),a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.metrics.v1.SummaryDataPoint;s.pos<c;){var d=s.uint32();switch(d>>>3){case 7:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(Ne.opentelemetry.proto.common.v1.KeyValue.decode(s,s.uint32()));break}case 2:{u.startTimeUnixNano=s.fixed64();break}case 3:{u.timeUnixNano=s.fixed64();break}case 4:{u.count=s.fixed64();break}case 5:{u.sum=s.double();break}case 6:{u.quantileValues&&u.quantileValues.length||(u.quantileValues=[]),u.quantileValues.push(Ne.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.decode(s,s.uint32()));break}case 8:{u.flags=s.uint32();break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.attributes!=null&&s.hasOwnProperty("attributes")){if(!Array.isArray(s.attributes))return"attributes: array expected";for(var a=0;a<s.attributes.length;++a){var c=Ne.opentelemetry.proto.common.v1.KeyValue.verify(s.attributes[a]);if(c)return"attributes."+c}}if(s.startTimeUnixNano!=null&&s.hasOwnProperty("startTimeUnixNano")&&!Me.isInteger(s.startTimeUnixNano)&&!(s.startTimeUnixNano&&Me.isInteger(s.startTimeUnixNano.low)&&Me.isInteger(s.startTimeUnixNano.high)))return"startTimeUnixNano: integer|Long expected";if(s.timeUnixNano!=null&&s.hasOwnProperty("timeUnixNano")&&!Me.isInteger(s.timeUnixNano)&&!(s.timeUnixNano&&Me.isInteger(s.timeUnixNano.low)&&Me.isInteger(s.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(s.count!=null&&s.hasOwnProperty("count")&&!Me.isInteger(s.count)&&!(s.count&&Me.isInteger(s.count.low)&&Me.isInteger(s.count.high)))return"count: integer|Long expected";if(s.sum!=null&&s.hasOwnProperty("sum")&&typeof s.sum!="number")return"sum: number expected";if(s.quantileValues!=null&&s.hasOwnProperty("quantileValues")){if(!Array.isArray(s.quantileValues))return"quantileValues: array expected";for(var a=0;a<s.quantileValues.length;++a){var c=Ne.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.verify(s.quantileValues[a]);if(c)return"quantileValues."+c}}return s.flags!=null&&s.hasOwnProperty("flags")&&!Me.isInteger(s.flags)?"flags: integer expected":null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.metrics.v1.SummaryDataPoint)return s;var a=new Ne.opentelemetry.proto.metrics.v1.SummaryDataPoint;if(s.attributes){if(!Array.isArray(s.attributes))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: array expected");a.attributes=[];for(var c=0;c<s.attributes.length;++c){if(typeof s.attributes[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.attributes: object expected");a.attributes[c]=Ne.opentelemetry.proto.common.v1.KeyValue.fromObject(s.attributes[c])}}if(s.startTimeUnixNano!=null&&(Me.Long?(a.startTimeUnixNano=Me.Long.fromValue(s.startTimeUnixNano)).unsigned=!1:typeof s.startTimeUnixNano=="string"?a.startTimeUnixNano=parseInt(s.startTimeUnixNano,10):typeof s.startTimeUnixNano=="number"?a.startTimeUnixNano=s.startTimeUnixNano:typeof s.startTimeUnixNano=="object"&&(a.startTimeUnixNano=new Me.LongBits(s.startTimeUnixNano.low>>>0,s.startTimeUnixNano.high>>>0).toNumber())),s.timeUnixNano!=null&&(Me.Long?(a.timeUnixNano=Me.Long.fromValue(s.timeUnixNano)).unsigned=!1:typeof s.timeUnixNano=="string"?a.timeUnixNano=parseInt(s.timeUnixNano,10):typeof s.timeUnixNano=="number"?a.timeUnixNano=s.timeUnixNano:typeof s.timeUnixNano=="object"&&(a.timeUnixNano=new Me.LongBits(s.timeUnixNano.low>>>0,s.timeUnixNano.high>>>0).toNumber())),s.count!=null&&(Me.Long?(a.count=Me.Long.fromValue(s.count)).unsigned=!1:typeof s.count=="string"?a.count=parseInt(s.count,10):typeof s.count=="number"?a.count=s.count:typeof s.count=="object"&&(a.count=new Me.LongBits(s.count.low>>>0,s.count.high>>>0).toNumber())),s.sum!=null&&(a.sum=Number(s.sum)),s.quantileValues){if(!Array.isArray(s.quantileValues))throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: array expected");a.quantileValues=[];for(var c=0;c<s.quantileValues.length;++c){if(typeof s.quantileValues[c]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.SummaryDataPoint.quantileValues: object expected");a.quantileValues[c]=Ne.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.fromObject(s.quantileValues[c])}}return s.flags!=null&&(a.flags=s.flags>>>0),a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.quantileValues=[],c.attributes=[]),a.defaults){if(Me.Long){var u=new Me.Long(0,0,!1);c.startTimeUnixNano=a.longs===String?u.toString():a.longs===Number?u.toNumber():u}else c.startTimeUnixNano=a.longs===String?"0":0;if(Me.Long){var u=new Me.Long(0,0,!1);c.timeUnixNano=a.longs===String?u.toString():a.longs===Number?u.toNumber():u}else c.timeUnixNano=a.longs===String?"0":0;if(Me.Long){var u=new Me.Long(0,0,!1);c.count=a.longs===String?u.toString():a.longs===Number?u.toNumber():u}else c.count=a.longs===String?"0":0;c.sum=0,c.flags=0}if(s.startTimeUnixNano!=null&&s.hasOwnProperty("startTimeUnixNano")&&(typeof s.startTimeUnixNano=="number"?c.startTimeUnixNano=a.longs===String?String(s.startTimeUnixNano):s.startTimeUnixNano:c.startTimeUnixNano=a.longs===String?Me.Long.prototype.toString.call(s.startTimeUnixNano):a.longs===Number?new Me.LongBits(s.startTimeUnixNano.low>>>0,s.startTimeUnixNano.high>>>0).toNumber():s.startTimeUnixNano),s.timeUnixNano!=null&&s.hasOwnProperty("timeUnixNano")&&(typeof s.timeUnixNano=="number"?c.timeUnixNano=a.longs===String?String(s.timeUnixNano):s.timeUnixNano:c.timeUnixNano=a.longs===String?Me.Long.prototype.toString.call(s.timeUnixNano):a.longs===Number?new Me.LongBits(s.timeUnixNano.low>>>0,s.timeUnixNano.high>>>0).toNumber():s.timeUnixNano),s.count!=null&&s.hasOwnProperty("count")&&(typeof s.count=="number"?c.count=a.longs===String?String(s.count):s.count:c.count=a.longs===String?Me.Long.prototype.toString.call(s.count):a.longs===Number?new Me.LongBits(s.count.low>>>0,s.count.high>>>0).toNumber():s.count),s.sum!=null&&s.hasOwnProperty("sum")&&(c.sum=a.json&&!isFinite(s.sum)?String(s.sum):s.sum),s.quantileValues&&s.quantileValues.length){c.quantileValues=[];for(var d=0;d<s.quantileValues.length;++d)c.quantileValues[d]=Ne.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile.toObject(s.quantileValues[d],a)}if(s.attributes&&s.attributes.length){c.attributes=[];for(var d=0;d<s.attributes.length;++d)c.attributes[d]=Ne.opentelemetry.proto.common.v1.KeyValue.toObject(s.attributes[d],a)}return s.flags!=null&&s.hasOwnProperty("flags")&&(c.flags=s.flags),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.metrics.v1.SummaryDataPoint"},i.ValueAtQuantile=(function(){function o(s){if(s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}return o.prototype.quantile=null,o.prototype.value=null,o.create=function(a){return new o(a)},o.encode=function(a,c){return c||(c=Po.create()),a.quantile!=null&&Object.hasOwnProperty.call(a,"quantile")&&c.uint32(9).double(a.quantile),a.value!=null&&Object.hasOwnProperty.call(a,"value")&&c.uint32(17).double(a.value),c},o.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},o.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;a.pos<u;){var f=a.uint32();switch(f>>>3){case 1:{d.quantile=a.double();break}case 2:{d.value=a.double();break}default:a.skipType(f&7);break}}return d},o.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},o.verify=function(a){return typeof a!="object"||a===null?"object expected":a.quantile!=null&&a.hasOwnProperty("quantile")&&typeof a.quantile!="number"?"quantile: number expected":a.value!=null&&a.hasOwnProperty("value")&&typeof a.value!="number"?"value: number expected":null},o.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile)return a;var c=new Ne.opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile;return a.quantile!=null&&(c.quantile=Number(a.quantile)),a.value!=null&&(c.value=Number(a.value)),c},o.toObject=function(a,c){c||(c={});var u={};return c.defaults&&(u.quantile=0,u.value=0),a.quantile!=null&&a.hasOwnProperty("quantile")&&(u.quantile=c.json&&!isFinite(a.quantile)?String(a.quantile):a.quantile),a.value!=null&&a.hasOwnProperty("value")&&(u.value=c.json&&!isFinite(a.value)?String(a.value):a.value),u},o.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},o.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.SummaryDataPoint.ValueAtQuantile"},o})(),i})(),n.Exemplar=(function(){function i(s){if(this.filteredAttributes=[],s)for(var a=Object.keys(s),c=0;c<a.length;++c)s[a[c]]!=null&&(this[a[c]]=s[a[c]])}i.prototype.filteredAttributes=Me.emptyArray,i.prototype.timeUnixNano=null,i.prototype.asDouble=null,i.prototype.asInt=null,i.prototype.spanId=null,i.prototype.traceId=null;var o;return Object.defineProperty(i.prototype,"value",{get:Me.oneOfGetter(o=["asDouble","asInt"]),set:Me.oneOfSetter(o)}),i.create=function(a){return new i(a)},i.encode=function(a,c){if(c||(c=Po.create()),a.timeUnixNano!=null&&Object.hasOwnProperty.call(a,"timeUnixNano")&&c.uint32(17).fixed64(a.timeUnixNano),a.asDouble!=null&&Object.hasOwnProperty.call(a,"asDouble")&&c.uint32(25).double(a.asDouble),a.spanId!=null&&Object.hasOwnProperty.call(a,"spanId")&&c.uint32(34).bytes(a.spanId),a.traceId!=null&&Object.hasOwnProperty.call(a,"traceId")&&c.uint32(42).bytes(a.traceId),a.asInt!=null&&Object.hasOwnProperty.call(a,"asInt")&&c.uint32(49).sfixed64(a.asInt),a.filteredAttributes!=null&&a.filteredAttributes.length)for(var u=0;u<a.filteredAttributes.length;++u)Ne.opentelemetry.proto.common.v1.KeyValue.encode(a.filteredAttributes[u],c.uint32(58).fork()).ldelim();return c},i.encodeDelimited=function(a,c){return this.encode(a,c).ldelim()},i.decode=function(a,c){a instanceof vt||(a=vt.create(a));for(var u=c===void 0?a.len:a.pos+c,d=new Ne.opentelemetry.proto.metrics.v1.Exemplar;a.pos<u;){var f=a.uint32();switch(f>>>3){case 7:{d.filteredAttributes&&d.filteredAttributes.length||(d.filteredAttributes=[]),d.filteredAttributes.push(Ne.opentelemetry.proto.common.v1.KeyValue.decode(a,a.uint32()));break}case 2:{d.timeUnixNano=a.fixed64();break}case 3:{d.asDouble=a.double();break}case 6:{d.asInt=a.sfixed64();break}case 4:{d.spanId=a.bytes();break}case 5:{d.traceId=a.bytes();break}default:a.skipType(f&7);break}}return d},i.decodeDelimited=function(a){return a instanceof vt||(a=new vt(a)),this.decode(a,a.uint32())},i.verify=function(a){if(typeof a!="object"||a===null)return"object expected";var c={};if(a.filteredAttributes!=null&&a.hasOwnProperty("filteredAttributes")){if(!Array.isArray(a.filteredAttributes))return"filteredAttributes: array expected";for(var u=0;u<a.filteredAttributes.length;++u){var d=Ne.opentelemetry.proto.common.v1.KeyValue.verify(a.filteredAttributes[u]);if(d)return"filteredAttributes."+d}}if(a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&!Me.isInteger(a.timeUnixNano)&&!(a.timeUnixNano&&Me.isInteger(a.timeUnixNano.low)&&Me.isInteger(a.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(a.asDouble!=null&&a.hasOwnProperty("asDouble")&&(c.value=1,typeof a.asDouble!="number"))return"asDouble: number expected";if(a.asInt!=null&&a.hasOwnProperty("asInt")){if(c.value===1)return"value: multiple values";if(c.value=1,!Me.isInteger(a.asInt)&&!(a.asInt&&Me.isInteger(a.asInt.low)&&Me.isInteger(a.asInt.high)))return"asInt: integer|Long expected"}return a.spanId!=null&&a.hasOwnProperty("spanId")&&!(a.spanId&&typeof a.spanId.length=="number"||Me.isString(a.spanId))?"spanId: buffer expected":a.traceId!=null&&a.hasOwnProperty("traceId")&&!(a.traceId&&typeof a.traceId.length=="number"||Me.isString(a.traceId))?"traceId: buffer expected":null},i.fromObject=function(a){if(a instanceof Ne.opentelemetry.proto.metrics.v1.Exemplar)return a;var c=new Ne.opentelemetry.proto.metrics.v1.Exemplar;if(a.filteredAttributes){if(!Array.isArray(a.filteredAttributes))throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: array expected");c.filteredAttributes=[];for(var u=0;u<a.filteredAttributes.length;++u){if(typeof a.filteredAttributes[u]!="object")throw TypeError(".opentelemetry.proto.metrics.v1.Exemplar.filteredAttributes: object expected");c.filteredAttributes[u]=Ne.opentelemetry.proto.common.v1.KeyValue.fromObject(a.filteredAttributes[u])}}return a.timeUnixNano!=null&&(Me.Long?(c.timeUnixNano=Me.Long.fromValue(a.timeUnixNano)).unsigned=!1:typeof a.timeUnixNano=="string"?c.timeUnixNano=parseInt(a.timeUnixNano,10):typeof a.timeUnixNano=="number"?c.timeUnixNano=a.timeUnixNano:typeof a.timeUnixNano=="object"&&(c.timeUnixNano=new Me.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber())),a.asDouble!=null&&(c.asDouble=Number(a.asDouble)),a.asInt!=null&&(Me.Long?(c.asInt=Me.Long.fromValue(a.asInt)).unsigned=!1:typeof a.asInt=="string"?c.asInt=parseInt(a.asInt,10):typeof a.asInt=="number"?c.asInt=a.asInt:typeof a.asInt=="object"&&(c.asInt=new Me.LongBits(a.asInt.low>>>0,a.asInt.high>>>0).toNumber())),a.spanId!=null&&(typeof a.spanId=="string"?Me.base64.decode(a.spanId,c.spanId=Me.newBuffer(Me.base64.length(a.spanId)),0):a.spanId.length>=0&&(c.spanId=a.spanId)),a.traceId!=null&&(typeof a.traceId=="string"?Me.base64.decode(a.traceId,c.traceId=Me.newBuffer(Me.base64.length(a.traceId)),0):a.traceId.length>=0&&(c.traceId=a.traceId)),c},i.toObject=function(a,c){c||(c={});var u={};if((c.arrays||c.defaults)&&(u.filteredAttributes=[]),c.defaults){if(Me.Long){var d=new Me.Long(0,0,!1);u.timeUnixNano=c.longs===String?d.toString():c.longs===Number?d.toNumber():d}else u.timeUnixNano=c.longs===String?"0":0;c.bytes===String?u.spanId="":(u.spanId=[],c.bytes!==Array&&(u.spanId=Me.newBuffer(u.spanId))),c.bytes===String?u.traceId="":(u.traceId=[],c.bytes!==Array&&(u.traceId=Me.newBuffer(u.traceId)))}if(a.timeUnixNano!=null&&a.hasOwnProperty("timeUnixNano")&&(typeof a.timeUnixNano=="number"?u.timeUnixNano=c.longs===String?String(a.timeUnixNano):a.timeUnixNano:u.timeUnixNano=c.longs===String?Me.Long.prototype.toString.call(a.timeUnixNano):c.longs===Number?new Me.LongBits(a.timeUnixNano.low>>>0,a.timeUnixNano.high>>>0).toNumber():a.timeUnixNano),a.asDouble!=null&&a.hasOwnProperty("asDouble")&&(u.asDouble=c.json&&!isFinite(a.asDouble)?String(a.asDouble):a.asDouble,c.oneofs&&(u.value="asDouble")),a.spanId!=null&&a.hasOwnProperty("spanId")&&(u.spanId=c.bytes===String?Me.base64.encode(a.spanId,0,a.spanId.length):c.bytes===Array?Array.prototype.slice.call(a.spanId):a.spanId),a.traceId!=null&&a.hasOwnProperty("traceId")&&(u.traceId=c.bytes===String?Me.base64.encode(a.traceId,0,a.traceId.length):c.bytes===Array?Array.prototype.slice.call(a.traceId):a.traceId),a.asInt!=null&&a.hasOwnProperty("asInt")&&(typeof a.asInt=="number"?u.asInt=c.longs===String?String(a.asInt):a.asInt:u.asInt=c.longs===String?Me.Long.prototype.toString.call(a.asInt):c.longs===Number?new Me.LongBits(a.asInt.low>>>0,a.asInt.high>>>0).toNumber():a.asInt,c.oneofs&&(u.value="asInt")),a.filteredAttributes&&a.filteredAttributes.length){u.filteredAttributes=[];for(var f=0;f<a.filteredAttributes.length;++f)u.filteredAttributes[f]=Ne.opentelemetry.proto.common.v1.KeyValue.toObject(a.filteredAttributes[f],c)}return u},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(a){return a===void 0&&(a="type.googleapis.com"),a+"/opentelemetry.proto.metrics.v1.Exemplar"},i})(),n})(),r})(),e.logs=(function(){var r={};return r.v1=(function(){var n={};return n.LogsData=(function(){function i(o){if(this.resourceLogs=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.resourceLogs=Me.emptyArray,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.resourceLogs!=null&&s.resourceLogs.length)for(var c=0;c<s.resourceLogs.length;++c)Ne.opentelemetry.proto.logs.v1.ResourceLogs.encode(s.resourceLogs[c],a.uint32(10).fork()).ldelim();return a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.logs.v1.LogsData;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.resourceLogs&&u.resourceLogs.length||(u.resourceLogs=[]),u.resourceLogs.push(Ne.opentelemetry.proto.logs.v1.ResourceLogs.decode(s,s.uint32()));break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.resourceLogs!=null&&s.hasOwnProperty("resourceLogs")){if(!Array.isArray(s.resourceLogs))return"resourceLogs: array expected";for(var a=0;a<s.resourceLogs.length;++a){var c=Ne.opentelemetry.proto.logs.v1.ResourceLogs.verify(s.resourceLogs[a]);if(c)return"resourceLogs."+c}}return null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.logs.v1.LogsData)return s;var a=new Ne.opentelemetry.proto.logs.v1.LogsData;if(s.resourceLogs){if(!Array.isArray(s.resourceLogs))throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: array expected");a.resourceLogs=[];for(var c=0;c<s.resourceLogs.length;++c){if(typeof s.resourceLogs[c]!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogsData.resourceLogs: object expected");a.resourceLogs[c]=Ne.opentelemetry.proto.logs.v1.ResourceLogs.fromObject(s.resourceLogs[c])}}return a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.resourceLogs=[]),s.resourceLogs&&s.resourceLogs.length){c.resourceLogs=[];for(var u=0;u<s.resourceLogs.length;++u)c.resourceLogs[u]=Ne.opentelemetry.proto.logs.v1.ResourceLogs.toObject(s.resourceLogs[u],a)}return c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.logs.v1.LogsData"},i})(),n.ResourceLogs=(function(){function i(o){if(this.scopeLogs=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.resource=null,i.prototype.scopeLogs=Me.emptyArray,i.prototype.schemaUrl=null,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.resource!=null&&Object.hasOwnProperty.call(s,"resource")&&Ne.opentelemetry.proto.resource.v1.Resource.encode(s.resource,a.uint32(10).fork()).ldelim(),s.scopeLogs!=null&&s.scopeLogs.length)for(var c=0;c<s.scopeLogs.length;++c)Ne.opentelemetry.proto.logs.v1.ScopeLogs.encode(s.scopeLogs[c],a.uint32(18).fork()).ldelim();return s.schemaUrl!=null&&Object.hasOwnProperty.call(s,"schemaUrl")&&a.uint32(26).string(s.schemaUrl),a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.logs.v1.ResourceLogs;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.resource=Ne.opentelemetry.proto.resource.v1.Resource.decode(s,s.uint32());break}case 2:{u.scopeLogs&&u.scopeLogs.length||(u.scopeLogs=[]),u.scopeLogs.push(Ne.opentelemetry.proto.logs.v1.ScopeLogs.decode(s,s.uint32()));break}case 3:{u.schemaUrl=s.string();break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.resource!=null&&s.hasOwnProperty("resource")){var a=Ne.opentelemetry.proto.resource.v1.Resource.verify(s.resource);if(a)return"resource."+a}if(s.scopeLogs!=null&&s.hasOwnProperty("scopeLogs")){if(!Array.isArray(s.scopeLogs))return"scopeLogs: array expected";for(var c=0;c<s.scopeLogs.length;++c){var a=Ne.opentelemetry.proto.logs.v1.ScopeLogs.verify(s.scopeLogs[c]);if(a)return"scopeLogs."+a}}return s.schemaUrl!=null&&s.hasOwnProperty("schemaUrl")&&!Me.isString(s.schemaUrl)?"schemaUrl: string expected":null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.logs.v1.ResourceLogs)return s;var a=new Ne.opentelemetry.proto.logs.v1.ResourceLogs;if(s.resource!=null){if(typeof s.resource!="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.resource: object expected");a.resource=Ne.opentelemetry.proto.resource.v1.Resource.fromObject(s.resource)}if(s.scopeLogs){if(!Array.isArray(s.scopeLogs))throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: array expected");a.scopeLogs=[];for(var c=0;c<s.scopeLogs.length;++c){if(typeof s.scopeLogs[c]!="object")throw TypeError(".opentelemetry.proto.logs.v1.ResourceLogs.scopeLogs: object expected");a.scopeLogs[c]=Ne.opentelemetry.proto.logs.v1.ScopeLogs.fromObject(s.scopeLogs[c])}}return s.schemaUrl!=null&&(a.schemaUrl=String(s.schemaUrl)),a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.scopeLogs=[]),a.defaults&&(c.resource=null,c.schemaUrl=""),s.resource!=null&&s.hasOwnProperty("resource")&&(c.resource=Ne.opentelemetry.proto.resource.v1.Resource.toObject(s.resource,a)),s.scopeLogs&&s.scopeLogs.length){c.scopeLogs=[];for(var u=0;u<s.scopeLogs.length;++u)c.scopeLogs[u]=Ne.opentelemetry.proto.logs.v1.ScopeLogs.toObject(s.scopeLogs[u],a)}return s.schemaUrl!=null&&s.hasOwnProperty("schemaUrl")&&(c.schemaUrl=s.schemaUrl),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.logs.v1.ResourceLogs"},i})(),n.ScopeLogs=(function(){function i(o){if(this.logRecords=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.scope=null,i.prototype.logRecords=Me.emptyArray,i.prototype.schemaUrl=null,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.scope!=null&&Object.hasOwnProperty.call(s,"scope")&&Ne.opentelemetry.proto.common.v1.InstrumentationScope.encode(s.scope,a.uint32(10).fork()).ldelim(),s.logRecords!=null&&s.logRecords.length)for(var c=0;c<s.logRecords.length;++c)Ne.opentelemetry.proto.logs.v1.LogRecord.encode(s.logRecords[c],a.uint32(18).fork()).ldelim();return s.schemaUrl!=null&&Object.hasOwnProperty.call(s,"schemaUrl")&&a.uint32(26).string(s.schemaUrl),a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.logs.v1.ScopeLogs;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.scope=Ne.opentelemetry.proto.common.v1.InstrumentationScope.decode(s,s.uint32());break}case 2:{u.logRecords&&u.logRecords.length||(u.logRecords=[]),u.logRecords.push(Ne.opentelemetry.proto.logs.v1.LogRecord.decode(s,s.uint32()));break}case 3:{u.schemaUrl=s.string();break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.scope!=null&&s.hasOwnProperty("scope")){var a=Ne.opentelemetry.proto.common.v1.InstrumentationScope.verify(s.scope);if(a)return"scope."+a}if(s.logRecords!=null&&s.hasOwnProperty("logRecords")){if(!Array.isArray(s.logRecords))return"logRecords: array expected";for(var c=0;c<s.logRecords.length;++c){var a=Ne.opentelemetry.proto.logs.v1.LogRecord.verify(s.logRecords[c]);if(a)return"logRecords."+a}}return s.schemaUrl!=null&&s.hasOwnProperty("schemaUrl")&&!Me.isString(s.schemaUrl)?"schemaUrl: string expected":null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.logs.v1.ScopeLogs)return s;var a=new Ne.opentelemetry.proto.logs.v1.ScopeLogs;if(s.scope!=null){if(typeof s.scope!="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.scope: object expected");a.scope=Ne.opentelemetry.proto.common.v1.InstrumentationScope.fromObject(s.scope)}if(s.logRecords){if(!Array.isArray(s.logRecords))throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: array expected");a.logRecords=[];for(var c=0;c<s.logRecords.length;++c){if(typeof s.logRecords[c]!="object")throw TypeError(".opentelemetry.proto.logs.v1.ScopeLogs.logRecords: object expected");a.logRecords[c]=Ne.opentelemetry.proto.logs.v1.LogRecord.fromObject(s.logRecords[c])}}return s.schemaUrl!=null&&(a.schemaUrl=String(s.schemaUrl)),a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.logRecords=[]),a.defaults&&(c.scope=null,c.schemaUrl=""),s.scope!=null&&s.hasOwnProperty("scope")&&(c.scope=Ne.opentelemetry.proto.common.v1.InstrumentationScope.toObject(s.scope,a)),s.logRecords&&s.logRecords.length){c.logRecords=[];for(var u=0;u<s.logRecords.length;++u)c.logRecords[u]=Ne.opentelemetry.proto.logs.v1.LogRecord.toObject(s.logRecords[u],a)}return s.schemaUrl!=null&&s.hasOwnProperty("schemaUrl")&&(c.schemaUrl=s.schemaUrl),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.logs.v1.ScopeLogs"},i})(),n.SeverityNumber=(function(){var i={},o=Object.create(i);return o[i[0]="SEVERITY_NUMBER_UNSPECIFIED"]=0,o[i[1]="SEVERITY_NUMBER_TRACE"]=1,o[i[2]="SEVERITY_NUMBER_TRACE2"]=2,o[i[3]="SEVERITY_NUMBER_TRACE3"]=3,o[i[4]="SEVERITY_NUMBER_TRACE4"]=4,o[i[5]="SEVERITY_NUMBER_DEBUG"]=5,o[i[6]="SEVERITY_NUMBER_DEBUG2"]=6,o[i[7]="SEVERITY_NUMBER_DEBUG3"]=7,o[i[8]="SEVERITY_NUMBER_DEBUG4"]=8,o[i[9]="SEVERITY_NUMBER_INFO"]=9,o[i[10]="SEVERITY_NUMBER_INFO2"]=10,o[i[11]="SEVERITY_NUMBER_INFO3"]=11,o[i[12]="SEVERITY_NUMBER_INFO4"]=12,o[i[13]="SEVERITY_NUMBER_WARN"]=13,o[i[14]="SEVERITY_NUMBER_WARN2"]=14,o[i[15]="SEVERITY_NUMBER_WARN3"]=15,o[i[16]="SEVERITY_NUMBER_WARN4"]=16,o[i[17]="SEVERITY_NUMBER_ERROR"]=17,o[i[18]="SEVERITY_NUMBER_ERROR2"]=18,o[i[19]="SEVERITY_NUMBER_ERROR3"]=19,o[i[20]="SEVERITY_NUMBER_ERROR4"]=20,o[i[21]="SEVERITY_NUMBER_FATAL"]=21,o[i[22]="SEVERITY_NUMBER_FATAL2"]=22,o[i[23]="SEVERITY_NUMBER_FATAL3"]=23,o[i[24]="SEVERITY_NUMBER_FATAL4"]=24,o})(),n.LogRecordFlags=(function(){var i={},o=Object.create(i);return o[i[0]="LOG_RECORD_FLAGS_DO_NOT_USE"]=0,o[i[255]="LOG_RECORD_FLAGS_TRACE_FLAGS_MASK"]=255,o})(),n.LogRecord=(function(){function i(o){if(this.attributes=[],o)for(var s=Object.keys(o),a=0;a<s.length;++a)o[s[a]]!=null&&(this[s[a]]=o[s[a]])}return i.prototype.timeUnixNano=null,i.prototype.observedTimeUnixNano=null,i.prototype.severityNumber=null,i.prototype.severityText=null,i.prototype.body=null,i.prototype.attributes=Me.emptyArray,i.prototype.droppedAttributesCount=null,i.prototype.flags=null,i.prototype.traceId=null,i.prototype.spanId=null,i.create=function(s){return new i(s)},i.encode=function(s,a){if(a||(a=Po.create()),s.timeUnixNano!=null&&Object.hasOwnProperty.call(s,"timeUnixNano")&&a.uint32(9).fixed64(s.timeUnixNano),s.severityNumber!=null&&Object.hasOwnProperty.call(s,"severityNumber")&&a.uint32(16).int32(s.severityNumber),s.severityText!=null&&Object.hasOwnProperty.call(s,"severityText")&&a.uint32(26).string(s.severityText),s.body!=null&&Object.hasOwnProperty.call(s,"body")&&Ne.opentelemetry.proto.common.v1.AnyValue.encode(s.body,a.uint32(42).fork()).ldelim(),s.attributes!=null&&s.attributes.length)for(var c=0;c<s.attributes.length;++c)Ne.opentelemetry.proto.common.v1.KeyValue.encode(s.attributes[c],a.uint32(50).fork()).ldelim();return s.droppedAttributesCount!=null&&Object.hasOwnProperty.call(s,"droppedAttributesCount")&&a.uint32(56).uint32(s.droppedAttributesCount),s.flags!=null&&Object.hasOwnProperty.call(s,"flags")&&a.uint32(69).fixed32(s.flags),s.traceId!=null&&Object.hasOwnProperty.call(s,"traceId")&&a.uint32(74).bytes(s.traceId),s.spanId!=null&&Object.hasOwnProperty.call(s,"spanId")&&a.uint32(82).bytes(s.spanId),s.observedTimeUnixNano!=null&&Object.hasOwnProperty.call(s,"observedTimeUnixNano")&&a.uint32(89).fixed64(s.observedTimeUnixNano),a},i.encodeDelimited=function(s,a){return this.encode(s,a).ldelim()},i.decode=function(s,a){s instanceof vt||(s=vt.create(s));for(var c=a===void 0?s.len:s.pos+a,u=new Ne.opentelemetry.proto.logs.v1.LogRecord;s.pos<c;){var d=s.uint32();switch(d>>>3){case 1:{u.timeUnixNano=s.fixed64();break}case 11:{u.observedTimeUnixNano=s.fixed64();break}case 2:{u.severityNumber=s.int32();break}case 3:{u.severityText=s.string();break}case 5:{u.body=Ne.opentelemetry.proto.common.v1.AnyValue.decode(s,s.uint32());break}case 6:{u.attributes&&u.attributes.length||(u.attributes=[]),u.attributes.push(Ne.opentelemetry.proto.common.v1.KeyValue.decode(s,s.uint32()));break}case 7:{u.droppedAttributesCount=s.uint32();break}case 8:{u.flags=s.fixed32();break}case 9:{u.traceId=s.bytes();break}case 10:{u.spanId=s.bytes();break}default:s.skipType(d&7);break}}return u},i.decodeDelimited=function(s){return s instanceof vt||(s=new vt(s)),this.decode(s,s.uint32())},i.verify=function(s){if(typeof s!="object"||s===null)return"object expected";if(s.timeUnixNano!=null&&s.hasOwnProperty("timeUnixNano")&&!Me.isInteger(s.timeUnixNano)&&!(s.timeUnixNano&&Me.isInteger(s.timeUnixNano.low)&&Me.isInteger(s.timeUnixNano.high)))return"timeUnixNano: integer|Long expected";if(s.observedTimeUnixNano!=null&&s.hasOwnProperty("observedTimeUnixNano")&&!Me.isInteger(s.observedTimeUnixNano)&&!(s.observedTimeUnixNano&&Me.isInteger(s.observedTimeUnixNano.low)&&Me.isInteger(s.observedTimeUnixNano.high)))return"observedTimeUnixNano: integer|Long expected";if(s.severityNumber!=null&&s.hasOwnProperty("severityNumber"))switch(s.severityNumber){default:return"severityNumber: enum value expected";case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:case 10:case 11:case 12:case 13:case 14:case 15:case 16:case 17:case 18:case 19:case 20:case 21:case 22:case 23:case 24:break}if(s.severityText!=null&&s.hasOwnProperty("severityText")&&!Me.isString(s.severityText))return"severityText: string expected";if(s.body!=null&&s.hasOwnProperty("body")){var a=Ne.opentelemetry.proto.common.v1.AnyValue.verify(s.body);if(a)return"body."+a}if(s.attributes!=null&&s.hasOwnProperty("attributes")){if(!Array.isArray(s.attributes))return"attributes: array expected";for(var c=0;c<s.attributes.length;++c){var a=Ne.opentelemetry.proto.common.v1.KeyValue.verify(s.attributes[c]);if(a)return"attributes."+a}}return s.droppedAttributesCount!=null&&s.hasOwnProperty("droppedAttributesCount")&&!Me.isInteger(s.droppedAttributesCount)?"droppedAttributesCount: integer expected":s.flags!=null&&s.hasOwnProperty("flags")&&!Me.isInteger(s.flags)?"flags: integer expected":s.traceId!=null&&s.hasOwnProperty("traceId")&&!(s.traceId&&typeof s.traceId.length=="number"||Me.isString(s.traceId))?"traceId: buffer expected":s.spanId!=null&&s.hasOwnProperty("spanId")&&!(s.spanId&&typeof s.spanId.length=="number"||Me.isString(s.spanId))?"spanId: buffer expected":null},i.fromObject=function(s){if(s instanceof Ne.opentelemetry.proto.logs.v1.LogRecord)return s;var a=new Ne.opentelemetry.proto.logs.v1.LogRecord;switch(s.timeUnixNano!=null&&(Me.Long?(a.timeUnixNano=Me.Long.fromValue(s.timeUnixNano)).unsigned=!1:typeof s.timeUnixNano=="string"?a.timeUnixNano=parseInt(s.timeUnixNano,10):typeof s.timeUnixNano=="number"?a.timeUnixNano=s.timeUnixNano:typeof s.timeUnixNano=="object"&&(a.timeUnixNano=new Me.LongBits(s.timeUnixNano.low>>>0,s.timeUnixNano.high>>>0).toNumber())),s.observedTimeUnixNano!=null&&(Me.Long?(a.observedTimeUnixNano=Me.Long.fromValue(s.observedTimeUnixNano)).unsigned=!1:typeof s.observedTimeUnixNano=="string"?a.observedTimeUnixNano=parseInt(s.observedTimeUnixNano,10):typeof s.observedTimeUnixNano=="number"?a.observedTimeUnixNano=s.observedTimeUnixNano:typeof s.observedTimeUnixNano=="object"&&(a.observedTimeUnixNano=new Me.LongBits(s.observedTimeUnixNano.low>>>0,s.observedTimeUnixNano.high>>>0).toNumber())),s.severityNumber){default:if(typeof s.severityNumber=="number"){a.severityNumber=s.severityNumber;break}break;case"SEVERITY_NUMBER_UNSPECIFIED":case 0:a.severityNumber=0;break;case"SEVERITY_NUMBER_TRACE":case 1:a.severityNumber=1;break;case"SEVERITY_NUMBER_TRACE2":case 2:a.severityNumber=2;break;case"SEVERITY_NUMBER_TRACE3":case 3:a.severityNumber=3;break;case"SEVERITY_NUMBER_TRACE4":case 4:a.severityNumber=4;break;case"SEVERITY_NUMBER_DEBUG":case 5:a.severityNumber=5;break;case"SEVERITY_NUMBER_DEBUG2":case 6:a.severityNumber=6;break;case"SEVERITY_NUMBER_DEBUG3":case 7:a.severityNumber=7;break;case"SEVERITY_NUMBER_DEBUG4":case 8:a.severityNumber=8;break;case"SEVERITY_NUMBER_INFO":case 9:a.severityNumber=9;break;case"SEVERITY_NUMBER_INFO2":case 10:a.severityNumber=10;break;case"SEVERITY_NUMBER_INFO3":case 11:a.severityNumber=11;break;case"SEVERITY_NUMBER_INFO4":case 12:a.severityNumber=12;break;case"SEVERITY_NUMBER_WARN":case 13:a.severityNumber=13;break;case"SEVERITY_NUMBER_WARN2":case 14:a.severityNumber=14;break;case"SEVERITY_NUMBER_WARN3":case 15:a.severityNumber=15;break;case"SEVERITY_NUMBER_WARN4":case 16:a.severityNumber=16;break;case"SEVERITY_NUMBER_ERROR":case 17:a.severityNumber=17;break;case"SEVERITY_NUMBER_ERROR2":case 18:a.severityNumber=18;break;case"SEVERITY_NUMBER_ERROR3":case 19:a.severityNumber=19;break;case"SEVERITY_NUMBER_ERROR4":case 20:a.severityNumber=20;break;case"SEVERITY_NUMBER_FATAL":case 21:a.severityNumber=21;break;case"SEVERITY_NUMBER_FATAL2":case 22:a.severityNumber=22;break;case"SEVERITY_NUMBER_FATAL3":case 23:a.severityNumber=23;break;case"SEVERITY_NUMBER_FATAL4":case 24:a.severityNumber=24;break}if(s.severityText!=null&&(a.severityText=String(s.severityText)),s.body!=null){if(typeof s.body!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.body: object expected");a.body=Ne.opentelemetry.proto.common.v1.AnyValue.fromObject(s.body)}if(s.attributes){if(!Array.isArray(s.attributes))throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: array expected");a.attributes=[];for(var c=0;c<s.attributes.length;++c){if(typeof s.attributes[c]!="object")throw TypeError(".opentelemetry.proto.logs.v1.LogRecord.attributes: object expected");a.attributes[c]=Ne.opentelemetry.proto.common.v1.KeyValue.fromObject(s.attributes[c])}}return s.droppedAttributesCount!=null&&(a.droppedAttributesCount=s.droppedAttributesCount>>>0),s.flags!=null&&(a.flags=s.flags>>>0),s.traceId!=null&&(typeof s.traceId=="string"?Me.base64.decode(s.traceId,a.traceId=Me.newBuffer(Me.base64.length(s.traceId)),0):s.traceId.length>=0&&(a.traceId=s.traceId)),s.spanId!=null&&(typeof s.spanId=="string"?Me.base64.decode(s.spanId,a.spanId=Me.newBuffer(Me.base64.length(s.spanId)),0):s.spanId.length>=0&&(a.spanId=s.spanId)),a},i.toObject=function(s,a){a||(a={});var c={};if((a.arrays||a.defaults)&&(c.attributes=[]),a.defaults){if(Me.Long){var u=new Me.Long(0,0,!1);c.timeUnixNano=a.longs===String?u.toString():a.longs===Number?u.toNumber():u}else c.timeUnixNano=a.longs===String?"0":0;if(c.severityNumber=a.enums===String?"SEVERITY_NUMBER_UNSPECIFIED":0,c.severityText="",c.body=null,c.droppedAttributesCount=0,c.flags=0,a.bytes===String?c.traceId="":(c.traceId=[],a.bytes!==Array&&(c.traceId=Me.newBuffer(c.traceId))),a.bytes===String?c.spanId="":(c.spanId=[],a.bytes!==Array&&(c.spanId=Me.newBuffer(c.spanId))),Me.Long){var u=new Me.Long(0,0,!1);c.observedTimeUnixNano=a.longs===String?u.toString():a.longs===Number?u.toNumber():u}else c.observedTimeUnixNano=a.longs===String?"0":0}if(s.timeUnixNano!=null&&s.hasOwnProperty("timeUnixNano")&&(typeof s.timeUnixNano=="number"?c.timeUnixNano=a.longs===String?String(s.timeUnixNano):s.timeUnixNano:c.timeUnixNano=a.longs===String?Me.Long.prototype.toString.call(s.timeUnixNano):a.longs===Number?new Me.LongBits(s.timeUnixNano.low>>>0,s.timeUnixNano.high>>>0).toNumber():s.timeUnixNano),s.severityNumber!=null&&s.hasOwnProperty("severityNumber")&&(c.severityNumber=a.enums===String?Ne.opentelemetry.proto.logs.v1.SeverityNumber[s.severityNumber]===void 0?s.severityNumber:Ne.opentelemetry.proto.logs.v1.SeverityNumber[s.severityNumber]:s.severityNumber),s.severityText!=null&&s.hasOwnProperty("severityText")&&(c.severityText=s.severityText),s.body!=null&&s.hasOwnProperty("body")&&(c.body=Ne.opentelemetry.proto.common.v1.AnyValue.toObject(s.body,a)),s.attributes&&s.attributes.length){c.attributes=[];for(var d=0;d<s.attributes.length;++d)c.attributes[d]=Ne.opentelemetry.proto.common.v1.KeyValue.toObject(s.attributes[d],a)}return s.droppedAttributesCount!=null&&s.hasOwnProperty("droppedAttributesCount")&&(c.droppedAttributesCount=s.droppedAttributesCount),s.flags!=null&&s.hasOwnProperty("flags")&&(c.flags=s.flags),s.traceId!=null&&s.hasOwnProperty("traceId")&&(c.traceId=a.bytes===String?Me.base64.encode(s.traceId,0,s.traceId.length):a.bytes===Array?Array.prototype.slice.call(s.traceId):s.traceId),s.spanId!=null&&s.hasOwnProperty("spanId")&&(c.spanId=a.bytes===String?Me.base64.encode(s.spanId,0,s.spanId.length):a.bytes===Array?Array.prototype.slice.call(s.spanId):s.spanId),s.observedTimeUnixNano!=null&&s.hasOwnProperty("observedTimeUnixNano")&&(typeof s.observedTimeUnixNano=="number"?c.observedTimeUnixNano=a.longs===String?String(s.observedTimeUnixNano):s.observedTimeUnixNano:c.observedTimeUnixNano=a.longs===String?Me.Long.prototype.toString.call(s.observedTimeUnixNano):a.longs===Number?new Me.LongBits(s.observedTimeUnixNano.low>>>0,s.observedTimeUnixNano.high>>>0).toNumber():s.observedTimeUnixNano),c},i.prototype.toJSON=function(){return this.constructor.toObject(this,bi.util.toJSONOptions)},i.getTypeUrl=function(s){return s===void 0&&(s="type.googleapis.com"),s+"/opentelemetry.proto.logs.v1.LogRecord"},i})(),n})(),r})(),e})(),t})();tGr.exports=Ne});var nGr=D(tT=>{"use strict";Object.defineProperty(tT,"__esModule",{value:!0});tT.ProtobufTraceSerializer=tT.ProtobufMetricsSerializer=tT.ProtobufLogsSerializer=void 0;var C$=rGr(),Mio=V9e(),Pio=c7e(),Lio=u7e(),Fio=C$.opentelemetry.proto.collector.logs.v1.ExportLogsServiceResponse,Uio=C$.opentelemetry.proto.collector.logs.v1.ExportLogsServiceRequest,Qio=C$.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceResponse,qio=C$.opentelemetry.proto.collector.metrics.v1.ExportMetricsServiceRequest,Gio=C$.opentelemetry.proto.collector.trace.v1.ExportTraceServiceResponse,Hio=C$.opentelemetry.proto.collector.trace.v1.ExportTraceServiceRequest;tT.ProtobufLogsSerializer={serializeRequest:t=>{let e=(0,Lio.createExportLogsServiceRequest)(t);return Uio.encode(e).finish()},deserializeResponse:t=>Fio.decode(t)};tT.ProtobufMetricsSerializer={serializeRequest:t=>{let e=(0,Pio.createExportMetricsServiceRequest)(t);return qio.encode(e).finish()},deserializeResponse:t=>Qio.decode(t)};tT.ProtobufTraceSerializer={serializeRequest:t=>{let e=(0,Mio.createExportTraceServiceRequest)(t);return Hio.encode(e).finish()},deserializeResponse:t=>Gio.decode(t)}});var iGr=D(rT=>{"use strict";Object.defineProperty(rT,"__esModule",{value:!0});rT.JsonLogsSerializer=rT.JsonMetricsSerializer=rT.JsonTraceSerializer=void 0;var Vio=V9e(),Wio=c7e(),$io=u7e();rT.JsonTraceSerializer={serializeRequest:t=>{let e=(0,Vio.createExportTraceServiceRequest)(t,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{let e=new TextDecoder;return JSON.parse(e.decode(t))}};rT.JsonMetricsSerializer={serializeRequest:t=>{let e=(0,Wio.createExportMetricsServiceRequest)(t,{useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{let e=new TextDecoder;return JSON.parse(e.decode(t))}};rT.JsonLogsSerializer={serializeRequest:t=>{let e=(0,$io.createExportLogsServiceRequest)(t,{useHex:!0,useLongBits:!1});return new TextEncoder().encode(JSON.stringify(e))},deserializeResponse:t=>{let e=new TextDecoder;return JSON.parse(e.decode(t))}}});var fk=D(Ia=>{"use strict";Object.defineProperty(Ia,"__esModule",{value:!0});Ia.JsonMetricsSerializer=Ia.JsonLogsSerializer=Ia.JsonTraceSerializer=Ia.ProtobufTraceSerializer=Ia.ProtobufMetricsSerializer=Ia.ProtobufLogsSerializer=Ia.createExportLogsServiceRequest=Ia.createExportMetricsServiceRequest=Ia.createExportTraceServiceRequest=Ia.ESpanKind=Ia.hrTimeToNanos=Ia.encodeAsString=Ia.encodeAsLongBits=Ia.getOtlpEncoder=Ia.toLongBits=void 0;var Eae=iae();Object.defineProperty(Ia,"toLongBits",{enumerable:!0,get:function(){return Eae.toLongBits}});Object.defineProperty(Ia,"getOtlpEncoder",{enumerable:!0,get:function(){return Eae.getOtlpEncoder}});Object.defineProperty(Ia,"encodeAsLongBits",{enumerable:!0,get:function(){return Eae.encodeAsLongBits}});Object.defineProperty(Ia,"encodeAsString",{enumerable:!0,get:function(){return Eae.encodeAsString}});Object.defineProperty(Ia,"hrTimeToNanos",{enumerable:!0,get:function(){return Eae.hrTimeToNanos}});var jio=dQr();Object.defineProperty(Ia,"ESpanKind",{enumerable:!0,get:function(){return jio.ESpanKind}});var zio=V9e();Object.defineProperty(Ia,"createExportTraceServiceRequest",{enumerable:!0,get:function(){return zio.createExportTraceServiceRequest}});var Yio=c7e();Object.defineProperty(Ia,"createExportMetricsServiceRequest",{enumerable:!0,get:function(){return Yio.createExportMetricsServiceRequest}});var Jio=u7e();Object.defineProperty(Ia,"createExportLogsServiceRequest",{enumerable:!0,get:function(){return Jio.createExportLogsServiceRequest}});var Z2t=nGr();Object.defineProperty(Ia,"ProtobufLogsSerializer",{enumerable:!0,get:function(){return Z2t.ProtobufLogsSerializer}});Object.defineProperty(Ia,"ProtobufMetricsSerializer",{enumerable:!0,get:function(){return Z2t.ProtobufMetricsSerializer}});Object.defineProperty(Ia,"ProtobufTraceSerializer",{enumerable:!0,get:function(){return Z2t.ProtobufTraceSerializer}});var e1t=iGr();Object.defineProperty(Ia,"JsonTraceSerializer",{enumerable:!0,get:function(){return e1t.JsonTraceSerializer}});Object.defineProperty(Ia,"JsonLogsSerializer",{enumerable:!0,get:function(){return e1t.JsonLogsSerializer}});Object.defineProperty(Ia,"JsonMetricsSerializer",{enumerable:!0,get:function(){return e1t.JsonMetricsSerializer}})});var oGr=D(d7e=>{"use strict";Object.defineProperty(d7e,"__esModule",{value:!0});d7e.VERSION=void 0;d7e.VERSION="0.52.1"});var sGr=D(p7e=>{"use strict";Object.defineProperty(p7e,"__esModule",{value:!0});p7e.OTLPTraceExporter=void 0;var f7e=jn(),t1t=U9e(),Kio=fk(),Xio=oGr(),Zio={"User-Agent":`OTel-OTLP-Exporter-JavaScript/${Xio.VERSION}`},r1t=class extends t1t.OTLPGRPCExporterNodeBase{constructor(e={}){let r=Object.assign(Object.assign({},Zio),f7e.baggageUtils.parseKeyPairsIntoRecord((0,f7e.getEnv)().OTEL_EXPORTER_OTLP_TRACES_HEADERS));super(e,r,"TraceExportService","/opentelemetry.proto.collector.trace.v1.TraceService/Export",Kio.ProtobufTraceSerializer)}getDefaultUrl(e){return(0,t1t.validateAndNormalizeUrl)(this.getUrlFromConfig(e))}getUrlFromConfig(e){return typeof e.url=="string"?e.url:(0,f7e.getEnv)().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||(0,f7e.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT||t1t.DEFAULT_COLLECTOR_URL}};p7e.OTLPTraceExporter=r1t});var n1t=D(pk=>{"use strict";var eoo=pk&&pk.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),too=pk&&pk.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&eoo(e,t,r)};Object.defineProperty(pk,"__esModule",{value:!0});too(sGr(),pk)});var aGr=D(h7e=>{"use strict";Object.defineProperty(h7e,"__esModule",{value:!0});h7e.VERSION=void 0;h7e.VERSION="0.52.1"});var lGr=D(g7e=>{"use strict";Object.defineProperty(g7e,"__esModule",{value:!0});g7e.OTLPLogExporter=void 0;var m7e=jn(),i1t=U9e(),roo=fk(),noo=aGr(),ioo={"User-Agent":`OTel-OTLP-Exporter-JavaScript/${noo.VERSION}`},o1t=class extends i1t.OTLPGRPCExporterNodeBase{constructor(e={}){let r=Object.assign(Object.assign({},ioo),m7e.baggageUtils.parseKeyPairsIntoRecord((0,m7e.getEnv)().OTEL_EXPORTER_OTLP_LOGS_HEADERS));super(e,r,"LogsExportService","/opentelemetry.proto.collector.logs.v1.LogsService/Export",roo.ProtobufLogsSerializer)}getDefaultUrl(e){return(0,i1t.validateAndNormalizeUrl)(this.getUrlFromConfig(e))}getUrlFromConfig(e){return typeof e.url=="string"?e.url:(0,m7e.getEnv)().OTEL_EXPORTER_OTLP_LOGS_ENDPOINT||(0,m7e.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT||i1t.DEFAULT_COLLECTOR_URL}};g7e.OTLPLogExporter=o1t});var cGr=D(hk=>{"use strict";var ooo=hk&&hk.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),soo=hk&&hk.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ooo(e,t,r)};Object.defineProperty(hk,"__esModule",{value:!0});soo(lGr(),hk)});var s1t=D(vae=>{"use strict";Object.defineProperty(vae,"__esModule",{value:!0});vae.AggregationTemporalityPreference=void 0;var aoo;(function(t){t[t.DELTA=0]="DELTA",t[t.CUMULATIVE=1]="CUMULATIVE",t[t.LOWMEMORY=2]="LOWMEMORY"})(aoo=vae.AggregationTemporalityPreference||(vae.AggregationTemporalityPreference={}))});var l1t=D(t0=>{"use strict";Object.defineProperty(t0,"__esModule",{value:!0});t0.OTLPMetricExporterBase=t0.LowMemoryTemporalitySelector=t0.DeltaTemporalitySelector=t0.CumulativeTemporalitySelector=void 0;var loo=jn(),Cf=dk(),uGr=s1t(),coo=(Ur(),pr(Wr)),uoo=()=>Cf.AggregationTemporality.CUMULATIVE;t0.CumulativeTemporalitySelector=uoo;var doo=t=>{switch(t){case Cf.InstrumentType.COUNTER:case Cf.InstrumentType.OBSERVABLE_COUNTER:case Cf.InstrumentType.GAUGE:case Cf.InstrumentType.HISTOGRAM:case Cf.InstrumentType.OBSERVABLE_GAUGE:return Cf.AggregationTemporality.DELTA;case Cf.InstrumentType.UP_DOWN_COUNTER:case Cf.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return Cf.AggregationTemporality.CUMULATIVE}};t0.DeltaTemporalitySelector=doo;var foo=t=>{switch(t){case Cf.InstrumentType.COUNTER:case Cf.InstrumentType.HISTOGRAM:return Cf.AggregationTemporality.DELTA;case Cf.InstrumentType.GAUGE:case Cf.InstrumentType.UP_DOWN_COUNTER:case Cf.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:case Cf.InstrumentType.OBSERVABLE_COUNTER:case Cf.InstrumentType.OBSERVABLE_GAUGE:return Cf.AggregationTemporality.CUMULATIVE}};t0.LowMemoryTemporalitySelector=foo;function poo(){let t=(0,loo.getEnv)(),e=t.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE.trim().toLowerCase();return e==="cumulative"?t0.CumulativeTemporalitySelector:e==="delta"?t0.DeltaTemporalitySelector:e==="lowmemory"?t0.LowMemoryTemporalitySelector:(coo.diag.warn(`OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE is set to '${t.OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE}', but only 'cumulative' and 'delta' are allowed. Using default ('cumulative') instead.`),t0.CumulativeTemporalitySelector)}function hoo(t){return t!=null?t===uGr.AggregationTemporalityPreference.DELTA?t0.DeltaTemporalitySelector:t===uGr.AggregationTemporalityPreference.LOWMEMORY?t0.LowMemoryTemporalitySelector:t0.CumulativeTemporalitySelector:poo()}function moo(t){return t?.aggregationPreference?t.aggregationPreference:e=>Cf.Aggregation.Default()}var a1t=class{constructor(e,r){this._otlpExporter=e,this._aggregationSelector=moo(r),this._aggregationTemporalitySelector=hoo(r?.temporalityPreference)}export(e,r){this._otlpExporter.export([e],r)}async shutdown(){await this._otlpExporter.shutdown()}forceFlush(){return Promise.resolve()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}};t0.OTLPMetricExporterBase=a1t});var dGr=D(A7e=>{"use strict";Object.defineProperty(A7e,"__esModule",{value:!0});A7e.VERSION=void 0;A7e.VERSION="0.52.1"});var pGr=D(E7e=>{"use strict";Object.defineProperty(E7e,"__esModule",{value:!0});E7e.OTLPMetricExporter=void 0;var b$=jn(),goo=l1t(),y7e=k9(),Aoo=fk(),yoo=dGr(),fGr="v1/metrics",Eoo=`http://localhost:4318/${fGr}`,voo={"User-Agent":`OTel-OTLP-Exporter-JavaScript/${yoo.VERSION}`},c1t=class extends y7e.OTLPExporterNodeBase{constructor(e){super(e,Aoo.JsonMetricsSerializer,"application/json"),this.headers=Object.assign(Object.assign(Object.assign(Object.assign({},this.headers),voo),b$.baggageUtils.parseKeyPairsIntoRecord((0,b$.getEnv)().OTEL_EXPORTER_OTLP_METRICS_HEADERS)),(0,y7e.parseHeaders)(e?.headers))}getDefaultUrl(e){return typeof e.url=="string"?e.url:(0,b$.getEnv)().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT.length>0?(0,y7e.appendRootPathToUrlIfNeeded)((0,b$.getEnv)().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT):(0,b$.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT.length>0?(0,y7e.appendResourcePathToUrl)((0,b$.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT,fGr):Eoo}},u1t=class extends goo.OTLPMetricExporterBase{constructor(e){super(new c1t(e),e)}};E7e.OTLPMetricExporter=u1t});var hGr=D(mk=>{"use strict";var Coo=mk&&mk.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),boo=mk&&mk.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Coo(e,t,r)};Object.defineProperty(mk,"__esModule",{value:!0});boo(pGr(),mk)});var mGr=D(gk=>{"use strict";var xoo=gk&&gk.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Soo=gk&&gk.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&xoo(e,t,r)};Object.defineProperty(gk,"__esModule",{value:!0});Soo(hGr(),gk)});var gGr=D(z9=>{"use strict";var woo=z9&&z9.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),d1t=z9&&z9.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&woo(e,t,r)};Object.defineProperty(z9,"__esModule",{value:!0});d1t(mGr(),z9);d1t(s1t(),z9);d1t(l1t(),z9)});var AGr=D(v7e=>{"use strict";Object.defineProperty(v7e,"__esModule",{value:!0});v7e.VERSION=void 0;v7e.VERSION="0.52.1"});var yGr=D(b7e=>{"use strict";Object.defineProperty(b7e,"__esModule",{value:!0});b7e.OTLPMetricExporter=void 0;var _oo=gGr(),f1t=U9e(),C7e=jn(),Too=fk(),Ioo=AGr(),Doo=k9(),Roo={"User-Agent":`OTel-OTLP-Exporter-JavaScript/${Ioo.VERSION}`},p1t=class extends f1t.OTLPGRPCExporterNodeBase{constructor(e){let r=Object.assign(Object.assign(Object.assign({},Roo),C7e.baggageUtils.parseKeyPairsIntoRecord((0,C7e.getEnv)().OTEL_EXPORTER_OTLP_METRICS_HEADERS)),(0,Doo.parseHeaders)(e?.headers));super(e,r,"MetricsExportService","/opentelemetry.proto.collector.metrics.v1.MetricsService/Export",Too.ProtobufMetricsSerializer)}getDefaultUrl(e){return(0,f1t.validateAndNormalizeUrl)(this.getUrlFromConfig(e))}getUrlFromConfig(e){return typeof e.url=="string"?e.url:(0,C7e.getEnv)().OTEL_EXPORTER_OTLP_METRICS_ENDPOINT||(0,C7e.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT||f1t.DEFAULT_COLLECTOR_URL}},h1t=class extends _oo.OTLPMetricExporterBase{constructor(e){super(new p1t(e),e)}};b7e.OTLPMetricExporter=h1t});var EGr=D(Ak=>{"use strict";var Boo=Ak&&Ak.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Noo=Ak&&Ak.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Boo(e,t,r)};Object.defineProperty(Ak,"__esModule",{value:!0});Noo(yGr(),Ak)});var g1t=D(S7e=>{"use strict";Object.defineProperty(S7e,"__esModule",{value:!0});S7e.LogRecord=void 0;var Ooo=(Ur(),pr(Wr)),x$=(Ur(),pr(Wr)),x7e=jn(),m1t=class{constructor(e,r,n){this.attributes={},this.totalAttributesCount=0,this._isReadonly=!1;let{timestamp:i,observedTimestamp:o,severityNumber:s,severityText:a,body:c,attributes:u={},context:d}=n,f=Date.now();if(this.hrTime=(0,x7e.timeInputToHrTime)(i??f),this.hrTimeObserved=(0,x7e.timeInputToHrTime)(o??f),d){let p=x$.trace.getSpanContext(d);p&&x$.isSpanContextValid(p)&&(this.spanContext=p)}this.severityNumber=s,this.severityText=a,this.body=c,this.resource=e.resource,this.instrumentationScope=r,this._logRecordLimits=e.logRecordLimits,this.setAttributes(u)}set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}setAttribute(e,r){return this._isLogRecordReadonly()?this:r===null?this:e.length===0?(x$.diag.warn(`Invalid attribute key: ${e}`),this):!(0,x7e.isAttributeValue)(r)&&!(typeof r=="object"&&!Array.isArray(r)&&Object.keys(r).length>0)?(x$.diag.warn(`Invalid attribute value set for key: ${e}`),this):(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this.droppedAttributesCount===1&&x$.diag.warn("Dropping extra attributes."),this):((0,x7e.isAttributeValue)(r)?this.attributes[e]=this._truncateToSize(r):this.attributes[e]=r,this))}setAttributes(e){for(let[r,n]of Object.entries(e))this.setAttribute(r,n);return this}setBody(e){return this.body=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let r=this._logRecordLimits.attributeValueLengthLimit;return r<=0?(x$.diag.warn(`Attribute value limit must be positive, got ${r}`),e):typeof e=="string"?this._truncateToLimitUtil(e,r):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,r):n):e}_truncateToLimitUtil(e,r){return e.length<=r?e:e.substring(0,r)}_isLogRecordReadonly(){return this._isReadonly&&Ooo.diag.warn("Can not execute the operation on emitted log record"),this._isReadonly}};S7e.LogRecord=m1t});var vGr=D(w7e=>{"use strict";Object.defineProperty(w7e,"__esModule",{value:!0});w7e.Logger=void 0;var koo=(Ur(),pr(Wr)),Moo=g1t(),A1t=class{constructor(e,r){this.instrumentationScope=e,this._sharedState=r}emit(e){let r=e.context||koo.context.active(),n=new Moo.LogRecord(this._sharedState,this.instrumentationScope,Object.assign({context:r},e));this._sharedState.activeProcessor.onEmit(n,r),n._makeReadonly()}};w7e.Logger=A1t});var CGr=D(S$=>{"use strict";Object.defineProperty(S$,"__esModule",{value:!0});S$.reconfigureLimits=S$.loadDefaultConfig=void 0;var Cae=jn();function Poo(){return{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:(0,Cae.getEnv)().OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,Cae.getEnv)().OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT},includeTraceContext:!0}}S$.loadDefaultConfig=Poo;function Loo(t){var e,r,n,i,o,s;let a=(0,Cae.getEnvWithoutDefaults)();return{attributeCountLimit:(n=(r=(e=t.attributeCountLimit)!==null&&e!==void 0?e:a.OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT)!==null&&r!==void 0?r:a.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&n!==void 0?n:Cae.DEFAULT_ATTRIBUTE_COUNT_LIMIT,attributeValueLengthLimit:(s=(o=(i=t.attributeValueLengthLimit)!==null&&i!==void 0?i:a.OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&o!==void 0?o:a.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&s!==void 0?s:Cae.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT}}S$.reconfigureLimits=Loo});var bGr=D(_7e=>{"use strict";Object.defineProperty(_7e,"__esModule",{value:!0});_7e.MultiLogRecordProcessor=void 0;var Foo=jn(),y1t=class{constructor(e,r){this.processors=e,this.forceFlushTimeoutMillis=r}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(r=>(0,Foo.callWithTimeout)(r.forceFlush(),e)))}onEmit(e,r){this.processors.forEach(n=>n.onEmit(e,r))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}};_7e.MultiLogRecordProcessor=y1t});var v1t=D(T7e=>{"use strict";Object.defineProperty(T7e,"__esModule",{value:!0});T7e.NoopLogRecordProcessor=void 0;var E1t=class{forceFlush(){return Promise.resolve()}onEmit(e,r){}shutdown(){return Promise.resolve()}};T7e.NoopLogRecordProcessor=E1t});var xGr=D(I7e=>{"use strict";Object.defineProperty(I7e,"__esModule",{value:!0});I7e.LoggerProviderSharedState=void 0;var Uoo=v1t(),C1t=class{constructor(e,r,n){this.resource=e,this.forceFlushTimeoutMillis=r,this.logRecordLimits=n,this.loggers=new Map,this.registeredLogRecordProcessors=[],this.activeProcessor=new Uoo.NoopLogRecordProcessor}};I7e.LoggerProviderSharedState=C1t});var TGr=D(yk=>{"use strict";Object.defineProperty(yk,"__esModule",{value:!0});yk.LoggerProvider=yk.DEFAULT_LOGGER_NAME=void 0;var bae=(Ur(),pr(Wr)),Qoo=sW(),SGr=K_(),wGr=jn(),qoo=vGr(),_Gr=CGr(),Goo=bGr(),Hoo=xGr();yk.DEFAULT_LOGGER_NAME="unknown";var b1t=class{constructor(e={}){var r;let n=(0,wGr.merge)({},(0,_Gr.loadDefaultConfig)(),e),i=SGr.Resource.default().merge((r=n.resource)!==null&&r!==void 0?r:SGr.Resource.empty());this._sharedState=new Hoo.LoggerProviderSharedState(i,n.forceFlushTimeoutMillis,(0,_Gr.reconfigureLimits)(n.logRecordLimits)),this._shutdownOnce=new wGr.BindOnceFuture(this._shutdown,this)}getLogger(e,r,n){if(this._shutdownOnce.isCalled)return bae.diag.warn("A shutdown LoggerProvider cannot provide a Logger"),Qoo.NOOP_LOGGER;e||bae.diag.warn("Logger requested without instrumentation scope name.");let i=e||yk.DEFAULT_LOGGER_NAME,o=`${i}@${r||""}:${n?.schemaUrl||""}`;return this._sharedState.loggers.has(o)||this._sharedState.loggers.set(o,new qoo.Logger({name:i,version:r,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(o)}addLogRecordProcessor(e){this._sharedState.registeredLogRecordProcessors.length===0&&this._sharedState.activeProcessor.shutdown().catch(r=>bae.diag.error("Error while trying to shutdown current log record processor",r)),this._sharedState.registeredLogRecordProcessors.push(e),this._sharedState.activeProcessor=new Goo.MultiLogRecordProcessor(this._sharedState.registeredLogRecordProcessors,this._sharedState.forceFlushTimeoutMillis)}forceFlush(){return this._shutdownOnce.isCalled?(bae.diag.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(bae.diag.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}};yk.LoggerProvider=b1t});var IGr=D(D7e=>{"use strict";Object.defineProperty(D7e,"__esModule",{value:!0});D7e.ConsoleLogRecordExporter=void 0;var Voo=jn(),Woo=jn(),x1t=class{export(e,r){this._sendLogRecords(e,r)}shutdown(){return Promise.resolve()}_exportInfo(e){var r,n,i;return{resource:{attributes:e.resource.attributes},timestamp:(0,Voo.hrTimeToMicroseconds)(e.hrTime),traceId:(r=e.spanContext)===null||r===void 0?void 0:r.traceId,spanId:(n=e.spanContext)===null||n===void 0?void 0:n.spanId,traceFlags:(i=e.spanContext)===null||i===void 0?void 0:i.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,body:e.body,attributes:e.attributes}}_sendLogRecords(e,r){for(let n of e)console.dir(this._exportInfo(n),{depth:3});r?.({code:Woo.ExportResultCode.SUCCESS})}};D7e.ConsoleLogRecordExporter=x1t});var DGr=D(R7e=>{"use strict";Object.defineProperty(R7e,"__esModule",{value:!0});R7e.SimpleLogRecordProcessor=void 0;var w$=jn(),S1t=class{constructor(e){this._exporter=e,this._shutdownOnce=new w$.BindOnceFuture(this._shutdown,this),this._unresolvedExports=new Set}onEmit(e){var r,n;if(this._shutdownOnce.isCalled)return;let i=()=>w$.internal._export(this._exporter,[e]).then(o=>{var s;o.code!==w$.ExportResultCode.SUCCESS&&(0,w$.globalErrorHandler)((s=o.error)!==null&&s!==void 0?s:new Error(`SimpleLogRecordProcessor: log record export failed (status ${o})`))}).catch(w$.globalErrorHandler);if(e.resource.asyncAttributesPending){let o=(n=(r=e.resource).waitForAsyncAttributes)===null||n===void 0?void 0:n.call(r).then(()=>(this._unresolvedExports.delete(o),i()),w$.globalErrorHandler);o!=null&&this._unresolvedExports.add(o)}else i()}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports))}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};R7e.SimpleLogRecordProcessor=S1t});var BGr=D(B7e=>{"use strict";Object.defineProperty(B7e,"__esModule",{value:!0});B7e.InMemoryLogRecordExporter=void 0;var RGr=jn(),w1t=class{constructor(){this._finishedLogRecords=[],this._stopped=!1}export(e,r){if(this._stopped)return r({code:RGr.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedLogRecords.push(...e),r({code:RGr.ExportResultCode.SUCCESS})}shutdown(){return this._stopped=!0,this.reset(),Promise.resolve()}getFinishedLogRecords(){return this._finishedLogRecords}reset(){this._finishedLogRecords=[]}};B7e.InMemoryLogRecordExporter=w1t});var NGr=D(N7e=>{"use strict";Object.defineProperty(N7e,"__esModule",{value:!0});N7e.BatchLogRecordProcessorBase=void 0;var $oo=(Ur(),pr(Wr)),cC=jn(),_1t=class{constructor(e,r){var n,i,o,s;this._exporter=e,this._finishedLogRecords=[];let a=(0,cC.getEnv)();this._maxExportBatchSize=(n=r?.maxExportBatchSize)!==null&&n!==void 0?n:a.OTEL_BLRP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=(i=r?.maxQueueSize)!==null&&i!==void 0?i:a.OTEL_BLRP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=(o=r?.scheduledDelayMillis)!==null&&o!==void 0?o:a.OTEL_BLRP_SCHEDULE_DELAY,this._exportTimeoutMillis=(s=r?.exportTimeoutMillis)!==null&&s!==void 0?s:a.OTEL_BLRP_EXPORT_TIMEOUT,this._shutdownOnce=new cC.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&($oo.diag.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise((e,r)=>{let n=[],i=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let o=0;o<i;o++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(r)})}_flushOneBatch(){return this._clearTimer(),this._finishedLogRecords.length===0?Promise.resolve():new Promise((e,r)=>{(0,cC.callWithTimeout)(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then(()=>e()).catch(r)})}_maybeStartTimer(){this._timer===void 0&&(this._timer=setTimeout(()=>{this._flushOneBatch().then(()=>{this._finishedLogRecords.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{(0,cC.globalErrorHandler)(e)})},this._scheduledDelayMillis),(0,cC.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}_export(e){let r=()=>cC.internal._export(this._exporter,e).then(i=>{var o;i.code!==cC.ExportResultCode.SUCCESS&&(0,cC.globalErrorHandler)((o=i.error)!==null&&o!==void 0?o:new Error(`BatchLogRecordProcessor: log record export failed (status ${i})`))}).catch(cC.globalErrorHandler),n=e.map(i=>i.resource).filter(i=>i.asyncAttributesPending);return n.length===0?r():Promise.all(n.map(i=>{var o;return(o=i.waitForAsyncAttributes)===null||o===void 0?void 0:o.call(i)})).then(r,cC.globalErrorHandler)}};N7e.BatchLogRecordProcessorBase=_1t});var OGr=D(O7e=>{"use strict";Object.defineProperty(O7e,"__esModule",{value:!0});O7e.BatchLogRecordProcessor=void 0;var joo=NGr(),T1t=class extends joo.BatchLogRecordProcessorBase{onShutdown(){}};O7e.BatchLogRecordProcessor=T1t});var kGr=D(k7e=>{"use strict";Object.defineProperty(k7e,"__esModule",{value:!0});k7e.BatchLogRecordProcessor=void 0;var zoo=OGr();Object.defineProperty(k7e,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return zoo.BatchLogRecordProcessor}})});var MGr=D(M7e=>{"use strict";Object.defineProperty(M7e,"__esModule",{value:!0});M7e.BatchLogRecordProcessor=void 0;var Yoo=kGr();Object.defineProperty(M7e,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return Yoo.BatchLogRecordProcessor}})});var P7e=D(rm=>{"use strict";Object.defineProperty(rm,"__esModule",{value:!0});rm.BatchLogRecordProcessor=rm.InMemoryLogRecordExporter=rm.SimpleLogRecordProcessor=rm.ConsoleLogRecordExporter=rm.NoopLogRecordProcessor=rm.LogRecord=rm.LoggerProvider=void 0;var Joo=TGr();Object.defineProperty(rm,"LoggerProvider",{enumerable:!0,get:function(){return Joo.LoggerProvider}});var Koo=g1t();Object.defineProperty(rm,"LogRecord",{enumerable:!0,get:function(){return Koo.LogRecord}});var Xoo=v1t();Object.defineProperty(rm,"NoopLogRecordProcessor",{enumerable:!0,get:function(){return Xoo.NoopLogRecordProcessor}});var Zoo=IGr();Object.defineProperty(rm,"ConsoleLogRecordExporter",{enumerable:!0,get:function(){return Zoo.ConsoleLogRecordExporter}});var eso=DGr();Object.defineProperty(rm,"SimpleLogRecordProcessor",{enumerable:!0,get:function(){return eso.SimpleLogRecordProcessor}});var tso=BGr();Object.defineProperty(rm,"InMemoryLogRecordExporter",{enumerable:!0,get:function(){return tso.InMemoryLogRecordExporter}});var rso=MGr();Object.defineProperty(rm,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return rso.BatchLogRecordProcessor}})});var D1t=D(L7e=>{"use strict";Object.defineProperty(L7e,"__esModule",{value:!0});L7e.AbstractAsyncHooksContextManager=void 0;var nso=ye("events"),iso=["addListener","on","once","prependListener","prependOnceListener"],I1t=class{constructor(){this._kOtListeners=Symbol("OtListeners"),this._wrapped=!1}bind(e,r){return r instanceof nso.EventEmitter?this._bindEventEmitter(e,r):typeof r=="function"?this._bindFunction(e,r):r}_bindFunction(e,r){let n=this,i=function(...o){return n.with(e,()=>r.apply(this,o))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:r.length}),i}_bindEventEmitter(e,r){return this._getPatchMap(r)!==void 0||(this._createPatchMap(r),iso.forEach(i=>{r[i]!==void 0&&(r[i]=this._patchAddListener(r,r[i],e))}),typeof r.removeListener=="function"&&(r.removeListener=this._patchRemoveListener(r,r.removeListener)),typeof r.off=="function"&&(r.off=this._patchRemoveListener(r,r.off)),typeof r.removeAllListeners=="function"&&(r.removeAllListeners=this._patchRemoveAllListeners(r,r.removeAllListeners))),r}_patchRemoveListener(e,r){let n=this;return function(i,o){var s;let a=(s=n._getPatchMap(e))===null||s===void 0?void 0:s[i];if(a===void 0)return r.call(this,i,o);let c=a.get(o);return r.call(this,i,c||o)}}_patchRemoveAllListeners(e,r){let n=this;return function(i){let o=n._getPatchMap(e);return o!==void 0&&(arguments.length===0?n._createPatchMap(e):o[i]!==void 0&&delete o[i]),r.apply(this,arguments)}}_patchAddListener(e,r,n){let i=this;return function(o,s){if(i._wrapped)return r.call(this,o,s);let a=i._getPatchMap(e);a===void 0&&(a=i._createPatchMap(e));let c=a[o];c===void 0&&(c=new WeakMap,a[o]=c);let u=i.bind(n,s);c.set(s,u),i._wrapped=!0;try{return r.call(this,o,u)}finally{i._wrapped=!1}}}_createPatchMap(e){let r=Object.create(null);return e[this._kOtListeners]=r,r}_getPatchMap(e){return e[this._kOtListeners]}};L7e.AbstractAsyncHooksContextManager=I1t});var PGr=D(F7e=>{"use strict";Object.defineProperty(F7e,"__esModule",{value:!0});F7e.AsyncHooksContextManager=void 0;var oso=(Ur(),pr(Wr)),sso=ye("async_hooks"),aso=D1t(),R1t=class extends aso.AbstractAsyncHooksContextManager{constructor(){super(),this._contexts=new Map,this._stack=[],this._asyncHook=sso.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){var e;return(e=this._stack[this._stack.length-1])!==null&&e!==void 0?e:oso.ROOT_CONTEXT}with(e,r,n,...i){this._enterContext(e);try{return r.call(n,...i)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(e,r){if(r==="TIMERWRAP")return;let n=this._stack[this._stack.length-1];n!==void 0&&this._contexts.set(e,n)}_destroy(e){this._contexts.delete(e)}_before(e){let r=this._contexts.get(e);r!==void 0&&this._enterContext(r)}_after(){this._exitContext()}_enterContext(e){this._stack.push(e)}_exitContext(){this._stack.pop()}};F7e.AsyncHooksContextManager=R1t});var LGr=D(U7e=>{"use strict";Object.defineProperty(U7e,"__esModule",{value:!0});U7e.AsyncLocalStorageContextManager=void 0;var lso=(Ur(),pr(Wr)),cso=ye("async_hooks"),uso=D1t(),B1t=class extends uso.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new cso.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&&e!==void 0?e:lso.ROOT_CONTEXT}with(e,r,n,...i){let o=n==null?r:r.bind(n);return this._asyncLocalStorage.run(e,o,...i)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};U7e.AsyncLocalStorageContextManager=B1t});var FGr=D(_$=>{"use strict";Object.defineProperty(_$,"__esModule",{value:!0});_$.AsyncLocalStorageContextManager=_$.AsyncHooksContextManager=void 0;var dso=PGr();Object.defineProperty(_$,"AsyncHooksContextManager",{enumerable:!0,get:function(){return dso.AsyncHooksContextManager}});var fso=LGr();Object.defineProperty(_$,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return fso.AsyncLocalStorageContextManager}})});var N1t=D(Q7e=>{"use strict";Object.defineProperty(Q7e,"__esModule",{value:!0});Q7e.B3_DEBUG_FLAG_KEY=void 0;var pso=(Ur(),pr(Wr));Q7e.B3_DEBUG_FLAG_KEY=(0,pso.createContextKey)("OpenTelemetry Context Key B3 Debug Flag")});var xae=D(L2=>{"use strict";Object.defineProperty(L2,"__esModule",{value:!0});L2.X_B3_FLAGS=L2.X_B3_PARENT_SPAN_ID=L2.X_B3_SAMPLED=L2.X_B3_SPAN_ID=L2.X_B3_TRACE_ID=L2.B3_CONTEXT_HEADER=void 0;L2.B3_CONTEXT_HEADER="b3";L2.X_B3_TRACE_ID="x-b3-traceid";L2.X_B3_SPAN_ID="x-b3-spanid";L2.X_B3_SAMPLED="x-b3-sampled";L2.X_B3_PARENT_SPAN_ID="x-b3-parentspanid";L2.X_B3_FLAGS="x-b3-flags"});var qGr=D(G7e=>{"use strict";Object.defineProperty(G7e,"__esModule",{value:!0});G7e.B3MultiPropagator=void 0;var AE=(Ur(),pr(Wr)),hso=jn(),UGr=N1t(),dA=xae(),mso=new Set([!0,"true","True","1",1]),gso=new Set([!1,"false","False","0",0]);function Aso(t){return t===AE.TraceFlags.SAMPLED||t===AE.TraceFlags.NONE}function yso(t){return Array.isArray(t)?t[0]:t}function q7e(t,e,r){let n=e.get(t,r);return yso(n)}function Eso(t,e){let r=q7e(t,e,dA.X_B3_TRACE_ID);return typeof r=="string"?r.padStart(32,"0"):""}function vso(t,e){let r=q7e(t,e,dA.X_B3_SPAN_ID);return typeof r=="string"?r:""}function QGr(t,e){return q7e(t,e,dA.X_B3_FLAGS)==="1"?"1":void 0}function Cso(t,e){let r=q7e(t,e,dA.X_B3_SAMPLED);if(QGr(t,e)==="1"||mso.has(r))return AE.TraceFlags.SAMPLED;if(r===void 0||gso.has(r))return AE.TraceFlags.NONE}var O1t=class{inject(e,r,n){let i=AE.trace.getSpanContext(e);if(!i||!(0,AE.isSpanContextValid)(i)||(0,hso.isTracingSuppressed)(e))return;let o=e.getValue(UGr.B3_DEBUG_FLAG_KEY);n.set(r,dA.X_B3_TRACE_ID,i.traceId),n.set(r,dA.X_B3_SPAN_ID,i.spanId),o==="1"?n.set(r,dA.X_B3_FLAGS,o):i.traceFlags!==void 0&&n.set(r,dA.X_B3_SAMPLED,(AE.TraceFlags.SAMPLED&i.traceFlags)===AE.TraceFlags.SAMPLED?"1":"0")}extract(e,r,n){let i=Eso(r,n),o=vso(r,n),s=Cso(r,n),a=QGr(r,n);return(0,AE.isValidTraceId)(i)&&(0,AE.isValidSpanId)(o)&&Aso(s)?(e=e.setValue(UGr.B3_DEBUG_FLAG_KEY,a),AE.trace.setSpanContext(e,{traceId:i,spanId:o,isRemote:!0,traceFlags:s})):e}fields(){return[dA.X_B3_TRACE_ID,dA.X_B3_SPAN_ID,dA.X_B3_FLAGS,dA.X_B3_SAMPLED,dA.X_B3_PARENT_SPAN_ID]}};G7e.B3MultiPropagator=O1t});var HGr=D(H7e=>{"use strict";Object.defineProperty(H7e,"__esModule",{value:!0});H7e.B3SinglePropagator=void 0;var Ek=(Ur(),pr(Wr)),bso=jn(),GGr=N1t(),k1t=xae(),xso=/((?:[0-9a-f]{16}){1,2})-([0-9a-f]{16})(?:-([01d](?![0-9a-f])))?(?:-([0-9a-f]{16}))?/,Sso="0".repeat(16),wso=new Set(["d","1"]),_so="d";function Tso(t){return t.length===32?t:`${Sso}${t}`}function Iso(t){return t&&wso.has(t)?Ek.TraceFlags.SAMPLED:Ek.TraceFlags.NONE}var M1t=class{inject(e,r,n){let i=Ek.trace.getSpanContext(e);if(!i||!(0,Ek.isSpanContextValid)(i)||(0,bso.isTracingSuppressed)(e))return;let o=e.getValue(GGr.B3_DEBUG_FLAG_KEY)||i.traceFlags&1,s=`${i.traceId}-${i.spanId}-${o}`;n.set(r,k1t.B3_CONTEXT_HEADER,s)}extract(e,r,n){let i=n.get(r,k1t.B3_CONTEXT_HEADER),o=Array.isArray(i)?i[0]:i;if(typeof o!="string")return e;let s=o.match(xso);if(!s)return e;let[,a,c,u]=s,d=Tso(a);if(!(0,Ek.isValidTraceId)(d)||!(0,Ek.isValidSpanId)(c))return e;let f=Iso(u);return u===_so&&(e=e.setValue(GGr.B3_DEBUG_FLAG_KEY,u)),Ek.trace.setSpanContext(e,{traceId:d,spanId:c,isRemote:!0,traceFlags:f})}fields(){return[k1t.B3_CONTEXT_HEADER]}};H7e.B3SinglePropagator=M1t});var P1t=D(Sae=>{"use strict";Object.defineProperty(Sae,"__esModule",{value:!0});Sae.B3InjectEncoding=void 0;var Dso;(function(t){t[t.SINGLE_HEADER=0]="SINGLE_HEADER",t[t.MULTI_HEADER=1]="MULTI_HEADER"})(Dso=Sae.B3InjectEncoding||(Sae.B3InjectEncoding={}))});var VGr=D(V7e=>{"use strict";Object.defineProperty(V7e,"__esModule",{value:!0});V7e.B3Propagator=void 0;var Rso=jn(),Bso=qGr(),Nso=HGr(),Oso=xae(),kso=P1t(),L1t=class{constructor(e={}){this._b3MultiPropagator=new Bso.B3MultiPropagator,this._b3SinglePropagator=new Nso.B3SinglePropagator,e.injectEncoding===kso.B3InjectEncoding.MULTI_HEADER?(this._inject=this._b3MultiPropagator.inject,this._fields=this._b3MultiPropagator.fields()):(this._inject=this._b3SinglePropagator.inject,this._fields=this._b3SinglePropagator.fields())}inject(e,r,n){(0,Rso.isTracingSuppressed)(e)||this._inject(e,r,n)}extract(e,r,n){let i=n.get(r,Oso.B3_CONTEXT_HEADER);return(Array.isArray(i)?i[0]:i)?this._b3SinglePropagator.extract(e,r,n):this._b3MultiPropagator.extract(e,r,n)}fields(){return this._fields}};V7e.B3Propagator=L1t});var WGr=D(Y9=>{"use strict";var Mso=Y9&&Y9.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),F1t=Y9&&Y9.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Mso(e,t,r)};Object.defineProperty(Y9,"__esModule",{value:!0});F1t(VGr(),Y9);F1t(xae(),Y9);F1t(P1t(),Y9)});var $Gr=D(W7e=>{"use strict";Object.defineProperty(W7e,"__esModule",{value:!0});W7e.ExceptionEventName=void 0;W7e.ExceptionEventName="exception"});var Q1t=D($7e=>{"use strict";Object.defineProperty($7e,"__esModule",{value:!0});$7e.Span=void 0;var yE=(Ur(),pr(Wr)),nm=jn(),vk=Zh(),Pso=$Gr(),U1t=class{constructor(e,r,n,i,o,s,a=[],c,u,d){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:yE.SpanStatusCode.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=n,this._spanContext=i,this.parentSpanId=s,this.kind=o,this.links=a;let f=Date.now();this._performanceStartTime=nm.otperformance.now(),this._performanceOffset=f-(this._performanceStartTime+(0,nm.getTimeOrigin)()),this._startTimeProvided=c!=null,this.startTime=this._getTime(c??f),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,d!=null&&this.setAttributes(d),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,r)}spanContext(){return this._spanContext}setAttribute(e,r){return r==null||this._isSpanEnded()?this:e.length===0?(yE.diag.warn(`Invalid attribute key: ${e}`),this):(0,nm.isAttributeValue)(r)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(r),this):(yE.diag.warn(`Invalid attribute value set for key: ${e}`),this)}setAttributes(e){for(let[r,n]of Object.entries(e))this.setAttribute(r,n);return this}addEvent(e,r,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return yE.diag.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&yE.diag.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),(0,nm.isTimeInput)(r)&&((0,nm.isTimeInput)(n)||(n=r),r=void 0);let i=(0,nm.sanitizeAttributes)(r);return this.events.push({name:e,attributes:i,time:this._getTime(n),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()?this:(this.status=e,this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){yE.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=(0,nm.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(yE.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&yE.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<nm.otperformance.now())return(0,nm.hrTime)(e+this._performanceOffset);if(typeof e=="number")return(0,nm.millisToHrTime)(e);if(e instanceof Date)return(0,nm.millisToHrTime)(e.getTime());if((0,nm.isTimeInputHrTime)(e))return e;if(this._startTimeProvided)return(0,nm.millisToHrTime)(Date.now());let r=nm.otperformance.now()-this._performanceStartTime;return(0,nm.addHrTimes)(this.startTime,(0,nm.millisToHrTime)(r))}isRecording(){return this._ended===!1}recordException(e,r){let n={};typeof e=="string"?n[vk.SEMATTRS_EXCEPTION_MESSAGE]=e:e&&(e.code?n[vk.SEMATTRS_EXCEPTION_TYPE]=e.code.toString():e.name&&(n[vk.SEMATTRS_EXCEPTION_TYPE]=e.name),e.message&&(n[vk.SEMATTRS_EXCEPTION_MESSAGE]=e.message),e.stack&&(n[vk.SEMATTRS_EXCEPTION_STACKTRACE]=e.stack)),n[vk.SEMATTRS_EXCEPTION_TYPE]||n[vk.SEMATTRS_EXCEPTION_MESSAGE]?this.addEvent(Pso.ExceptionEventName,n,r):yE.diag.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){return this._ended&&yE.diag.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`),this._ended}_truncateToLimitUtil(e,r){return e.length<=r?e:e.substr(0,r)}_truncateToSize(e){let r=this._attributeValueLengthLimit;return r<=0?(yE.diag.warn(`Attribute value limit must be positive, got ${r}`),e):typeof e=="string"?this._truncateToLimitUtil(e,r):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,r):n):e}};$7e.Span=U1t});var _ae=D(wae=>{"use strict";Object.defineProperty(wae,"__esModule",{value:!0});wae.SamplingDecision=void 0;var Lso;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Lso=wae.SamplingDecision||(wae.SamplingDecision={}))});var z7e=D(j7e=>{"use strict";Object.defineProperty(j7e,"__esModule",{value:!0});j7e.AlwaysOffSampler=void 0;var Fso=_ae(),q1t=class{shouldSample(){return{decision:Fso.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};j7e.AlwaysOffSampler=q1t});var J7e=D(Y7e=>{"use strict";Object.defineProperty(Y7e,"__esModule",{value:!0});Y7e.AlwaysOnSampler=void 0;var Uso=_ae(),G1t=class{shouldSample(){return{decision:Uso.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};Y7e.AlwaysOnSampler=G1t});var W1t=D(X7e=>{"use strict";Object.defineProperty(X7e,"__esModule",{value:!0});X7e.ParentBasedSampler=void 0;var K7e=(Ur(),pr(Wr)),Qso=jn(),jGr=z7e(),H1t=J7e(),V1t=class{constructor(e){var r,n,i,o;this._root=e.root,this._root||((0,Qso.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new H1t.AlwaysOnSampler),this._remoteParentSampled=(r=e.remoteParentSampled)!==null&&r!==void 0?r:new H1t.AlwaysOnSampler,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new jGr.AlwaysOffSampler,this._localParentSampled=(i=e.localParentSampled)!==null&&i!==void 0?i:new H1t.AlwaysOnSampler,this._localParentNotSampled=(o=e.localParentNotSampled)!==null&&o!==void 0?o:new jGr.AlwaysOffSampler}shouldSample(e,r,n,i,o,s){let a=K7e.trace.getSpanContext(e);return!a||!(0,K7e.isSpanContextValid)(a)?this._root.shouldSample(e,r,n,i,o,s):a.isRemote?a.traceFlags&K7e.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,r,n,i,o,s):this._remoteParentNotSampled.shouldSample(e,r,n,i,o,s):a.traceFlags&K7e.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,r,n,i,o,s):this._localParentNotSampled.shouldSample(e,r,n,i,o,s)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};X7e.ParentBasedSampler=V1t});var j1t=D(Z7e=>{"use strict";Object.defineProperty(Z7e,"__esModule",{value:!0});Z7e.TraceIdRatioBasedSampler=void 0;var qso=(Ur(),pr(Wr)),zGr=_ae(),$1t=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,r){return{decision:(0,qso.isValidTraceId)(r)&&this._accumulate(r)<this._upperBound?zGr.SamplingDecision.RECORD_AND_SAMPLED:zGr.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let r=0;for(let n=0;n<e.length/8;n++){let i=n*8,o=parseInt(e.slice(i,i+8),16);r=(r^o)>>>0}return r}};Z7e.TraceIdRatioBasedSampler=$1t});var J1t=D(I$=>{"use strict";Object.defineProperty(I$,"__esModule",{value:!0});I$.buildSamplerFromEnv=I$.loadDefaultConfig=void 0;var eSe=(Ur(),pr(Wr)),r0=jn(),YGr=z7e(),z1t=J7e(),Y1t=W1t(),JGr=j1t(),Gso=(0,r0.getEnv)(),Hso=r0.TracesSamplerValues.AlwaysOn,T$=1;function Vso(){return{sampler:XGr(Gso),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,r0.getEnv)().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,r0.getEnv)().OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:(0,r0.getEnv)().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,r0.getEnv)().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:(0,r0.getEnv)().OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:(0,r0.getEnv)().OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:(0,r0.getEnv)().OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:(0,r0.getEnv)().OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT}}}I$.loadDefaultConfig=Vso;function XGr(t=(0,r0.getEnv)()){switch(t.OTEL_TRACES_SAMPLER){case r0.TracesSamplerValues.AlwaysOn:return new z1t.AlwaysOnSampler;case r0.TracesSamplerValues.AlwaysOff:return new YGr.AlwaysOffSampler;case r0.TracesSamplerValues.ParentBasedAlwaysOn:return new Y1t.ParentBasedSampler({root:new z1t.AlwaysOnSampler});case r0.TracesSamplerValues.ParentBasedAlwaysOff:return new Y1t.ParentBasedSampler({root:new YGr.AlwaysOffSampler});case r0.TracesSamplerValues.TraceIdRatio:return new JGr.TraceIdRatioBasedSampler(KGr(t));case r0.TracesSamplerValues.ParentBasedTraceIdRatio:return new Y1t.ParentBasedSampler({root:new JGr.TraceIdRatioBasedSampler(KGr(t))});default:return eSe.diag.error(`OTEL_TRACES_SAMPLER value "${t.OTEL_TRACES_SAMPLER} invalid, defaulting to ${Hso}".`),new z1t.AlwaysOnSampler}}I$.buildSamplerFromEnv=XGr;function KGr(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return eSe.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${T$}.`),T$;let e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(eSe.diag.error(`OTEL_TRACES_SAMPLER_ARG=${t.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${T$}.`),T$):e<0||e>1?(eSe.diag.error(`OTEL_TRACES_SAMPLER_ARG=${t.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${T$}.`),T$):e}});var X1t=D(D$=>{"use strict";Object.defineProperty(D$,"__esModule",{value:!0});D$.reconfigureLimits=D$.mergeConfig=void 0;var ZGr=J1t(),K1t=jn();function Wso(t){let e={sampler:(0,ZGr.buildSamplerFromEnv)()},r=(0,ZGr.loadDefaultConfig)(),n=Object.assign({},r,e,t);return n.generalLimits=Object.assign({},r.generalLimits,t.generalLimits||{}),n.spanLimits=Object.assign({},r.spanLimits,t.spanLimits||{}),n}D$.mergeConfig=Wso;function $so(t){var e,r,n,i,o,s,a,c,u,d,f,p;let h=Object.assign({},t.spanLimits),m=(0,K1t.getEnvWithoutDefaults)();return h.attributeCountLimit=(s=(o=(i=(r=(e=t.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&r!==void 0?r:(n=t.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&i!==void 0?i:m.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&o!==void 0?o:m.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:K1t.DEFAULT_ATTRIBUTE_COUNT_LIMIT,h.attributeValueLengthLimit=(p=(f=(d=(c=(a=t.spanLimits)===null||a===void 0?void 0:a.attributeValueLengthLimit)!==null&&c!==void 0?c:(u=t.generalLimits)===null||u===void 0?void 0:u.attributeValueLengthLimit)!==null&&d!==void 0?d:m.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&f!==void 0?f:m.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&p!==void 0?p:K1t.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},t,{spanLimits:h})}D$.reconfigureLimits=$so});var eHr=D(tSe=>{"use strict";Object.defineProperty(tSe,"__esModule",{value:!0});tSe.BatchSpanProcessorBase=void 0;var R$=(Ur(),pr(Wr)),Ck=jn(),Z1t=class{constructor(e,r){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;let n=(0,Ck.getEnv)();this._maxExportBatchSize=typeof r?.maxExportBatchSize=="number"?r.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof r?.maxQueueSize=="number"?r.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof r?.scheduledDelayMillis=="number"?r.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof r?.exportTimeoutMillis=="number"?r.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new Ck.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(R$.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,r){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&R$.TraceFlags.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&R$.diag.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(R$.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,r)=>{let n=[],i=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let o=0,s=i;o<s;o++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(r)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,r)=>{let n=setTimeout(()=>{r(new Error("Timeout"))},this._exportTimeoutMillis);R$.context.with((0,Ck.suppressTracing)(R$.context.active()),()=>{let i;this._finishedSpans.length<=this._maxExportBatchSize?(i=this._finishedSpans,this._finishedSpans=[]):i=this._finishedSpans.splice(0,this._maxExportBatchSize);let o=()=>this._exporter.export(i,a=>{var c;clearTimeout(n),a.code===Ck.ExportResultCode.SUCCESS?e():r((c=a.error)!==null&&c!==void 0?c:new Error("BatchSpanProcessor: span export failed"))}),s=null;for(let a=0,c=i.length;a<c;a++){let u=i[a];u.resource.asyncAttributesPending&&u.resource.waitForAsyncAttributes&&(s??(s=[]),s.push(u.resource.waitForAsyncAttributes()))}s===null?o():Promise.all(s).then(o,a=>{(0,Ck.globalErrorHandler)(a),r(a)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(r=>{this._isExporting=!1,(0,Ck.globalErrorHandler)(r)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),(0,Ck.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};tSe.BatchSpanProcessorBase=Z1t});var tHr=D(rSe=>{"use strict";Object.defineProperty(rSe,"__esModule",{value:!0});rSe.BatchSpanProcessor=void 0;var jso=eHr(),eAt=class extends jso.BatchSpanProcessorBase{onShutdown(){}};rSe.BatchSpanProcessor=eAt});var iHr=D(iSe=>{"use strict";Object.defineProperty(iSe,"__esModule",{value:!0});iSe.RandomIdGenerator=void 0;var zso=8,nHr=16,tAt=class{constructor(){this.generateTraceId=rHr(nHr),this.generateSpanId=rHr(zso)}};iSe.RandomIdGenerator=tAt;var nSe=Buffer.allocUnsafe(nHr);function rHr(t){return function(){for(let r=0;r<t/4;r++)nSe.writeUInt32BE(Math.random()*2**32>>>0,r*4);for(let r=0;r<t&&!(nSe[r]>0);r++)r===t-1&&(nSe[t-1]=1);return nSe.toString("hex",0,t)}}});var sHr=D(nT=>{"use strict";var Yso=nT&&nT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),oHr=nT&&nT.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Yso(e,t,r)};Object.defineProperty(nT,"__esModule",{value:!0});oHr(tHr(),nT);oHr(iHr(),nT)});var oSe=D(bk=>{"use strict";var Jso=bk&&bk.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),Kso=bk&&bk.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Jso(e,t,r)};Object.defineProperty(bk,"__esModule",{value:!0});Kso(sHr(),bk)});var aHr=D(aSe=>{"use strict";Object.defineProperty(aSe,"__esModule",{value:!0});aSe.Tracer=void 0;var n0=(Ur(),pr(Wr)),sSe=jn(),Xso=Q1t(),Zso=X1t(),eao=oSe(),rAt=class{constructor(e,r,n){this._tracerProvider=n;let i=(0,Zso.mergeConfig)(r);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=r.idGenerator||new eao.RandomIdGenerator,this.resource=n.resource,this.instrumentationLibrary=e}startSpan(e,r={},n=n0.context.active()){var i,o,s;r.root&&(n=n0.trace.deleteSpan(n));let a=n0.trace.getSpan(n);if((0,sSe.isTracingSuppressed)(n))return n0.diag.debug("Instrumentation suppressed, returning Noop Span"),n0.trace.wrapSpanContext(n0.INVALID_SPAN_CONTEXT);let c=a?.spanContext(),u=this._idGenerator.generateSpanId(),d,f,p;!c||!n0.trace.isSpanContextValid(c)?d=this._idGenerator.generateTraceId():(d=c.traceId,f=c.traceState,p=c.spanId);let h=(i=r.kind)!==null&&i!==void 0?i:n0.SpanKind.INTERNAL,m=((o=r.links)!==null&&o!==void 0?o:[]).map(w=>({context:w.context,attributes:(0,sSe.sanitizeAttributes)(w.attributes)})),g=(0,sSe.sanitizeAttributes)(r.attributes),A=this._sampler.shouldSample(n,d,e,h,g,m);f=(s=A.traceState)!==null&&s!==void 0?s:f;let y=A.decision===n0.SamplingDecision.RECORD_AND_SAMPLED?n0.TraceFlags.SAMPLED:n0.TraceFlags.NONE,E={traceId:d,spanId:u,traceFlags:y,traceState:f};if(A.decision===n0.SamplingDecision.NOT_RECORD)return n0.diag.debug("Recording is off, propagating context in a non-recording span"),n0.trace.wrapSpanContext(E);let C=(0,sSe.sanitizeAttributes)(Object.assign(g,A.attributes));return new Xso.Span(this,n,e,E,h,p,m,r.startTime,void 0,C)}startActiveSpan(e,r,n,i){let o,s,a;if(arguments.length<2)return;arguments.length===2?a=r:arguments.length===3?(o=r,a=n):(o=r,s=n,a=i);let c=s??n0.context.active(),u=this.startSpan(e,o,c),d=n0.trace.setSpan(c,u);return n0.context.with(d,a,void 0,u)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}getActiveSpanProcessor(){return this._tracerProvider.getActiveSpanProcessor()}};aSe.Tracer=rAt});var lHr=D(lSe=>{"use strict";Object.defineProperty(lSe,"__esModule",{value:!0});lSe.MultiSpanProcessor=void 0;var tao=jn(),nAt=class{constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let r of this._spanProcessors)e.push(r.forceFlush());return new Promise(r=>{Promise.all(e).then(()=>{r()}).catch(n=>{(0,tao.globalErrorHandler)(n||new Error("MultiSpanProcessor: forceFlush failed")),r()})})}onStart(e,r){for(let n of this._spanProcessors)n.onStart(e,r)}onEnd(e){for(let r of this._spanProcessors)r.onEnd(e)}shutdown(){let e=[];for(let r of this._spanProcessors)e.push(r.shutdown());return new Promise((r,n)=>{Promise.all(e).then(()=>{r()},n)})}};lSe.MultiSpanProcessor=nAt});var oAt=D(cSe=>{"use strict";Object.defineProperty(cSe,"__esModule",{value:!0});cSe.NoopSpanProcessor=void 0;var iAt=class{onStart(e,r){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};cSe.NoopSpanProcessor=iAt});var uHr=D(xk=>{"use strict";Object.defineProperty(xk,"__esModule",{value:!0});xk.BasicTracerProvider=xk.ForceFlushState=void 0;var B$=(Ur(),pr(Wr)),O$=jn(),cHr=K_(),rao=Sk(),nao=J1t(),iao=lHr(),oao=oAt(),sao=oSe(),aao=X1t(),N$;(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(N$=xk.ForceFlushState||(xk.ForceFlushState={}));var Tae=class{constructor(e={}){var r;this._registeredSpanProcessors=[],this._tracers=new Map;let n=(0,O$.merge)({},(0,nao.loadDefaultConfig)(),(0,aao.reconfigureLimits)(e));this.resource=(r=n.resource)!==null&&r!==void 0?r:cHr.Resource.empty(),this.resource=cHr.Resource.default().merge(this.resource),this._config=Object.assign({},n,{resource:this.resource});let i=this._buildExporterFromEnv();if(i!==void 0){let o=new sao.BatchSpanProcessor(i);this.activeSpanProcessor=o}else this.activeSpanProcessor=new oao.NoopSpanProcessor}getTracer(e,r,n){let i=`${e}@${r||""}:${n?.schemaUrl||""}`;return this._tracers.has(i)||this._tracers.set(i,new rao.Tracer({name:e,version:r,schemaUrl:n?.schemaUrl},this._config,this)),this._tracers.get(i)}addSpanProcessor(e){this._registeredSpanProcessors.length===0&&this.activeSpanProcessor.shutdown().catch(r=>B$.diag.error("Error while trying to shutdown current span processor",r)),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new iao.MultiSpanProcessor(this._registeredSpanProcessors)}getActiveSpanProcessor(){return this.activeSpanProcessor}register(e={}){B$.trace.setGlobalTracerProvider(this),e.propagator===void 0&&(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&&B$.context.setGlobalContextManager(e.contextManager),e.propagator&&B$.propagation.setGlobalPropagator(e.propagator)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,r=this._registeredSpanProcessors.map(n=>new Promise(i=>{let o,s=setTimeout(()=>{i(new Error(`Span processor did not completed within timeout period of ${e} ms`)),o=N$.timeout},e);n.forceFlush().then(()=>{clearTimeout(s),o!==N$.timeout&&(o=N$.resolved,i(o))}).catch(a=>{clearTimeout(s),o=N$.error,i(a)})}));return new Promise((n,i)=>{Promise.all(r).then(o=>{let s=o.filter(a=>a!==N$.resolved);s.length>0?i(s):n()}).catch(o=>i([o]))})}shutdown(){return this.activeSpanProcessor.shutdown()}_getPropagator(e){var r;return(r=this.constructor._registeredPropagators.get(e))===null||r===void 0?void 0:r()}_getSpanExporter(e){var r;return(r=this.constructor._registeredExporters.get(e))===null||r===void 0?void 0:r()}_buildPropagatorFromEnv(){let e=Array.from(new Set((0,O$.getEnv)().OTEL_PROPAGATORS)),n=e.map(i=>{let o=this._getPropagator(i);return o||B$.diag.warn(`Propagator "${i}" requested through environment variable is unavailable.`),o}).reduce((i,o)=>(o&&i.push(o),i),[]);if(n.length!==0)return e.length===1?n[0]:new O$.CompositePropagator({propagators:n})}_buildExporterFromEnv(){let e=(0,O$.getEnv)().OTEL_TRACES_EXPORTER;if(e==="none"||e==="")return;let r=this._getSpanExporter(e);return r||B$.diag.error(`Exporter "${e}" requested through environment variable is unavailable.`),r}};xk.BasicTracerProvider=Tae;Tae._registeredPropagators=new Map([["tracecontext",()=>new O$.W3CTraceContextPropagator],["baggage",()=>new O$.W3CBaggagePropagator]]);Tae._registeredExporters=new Map});var dHr=D(uSe=>{"use strict";Object.defineProperty(uSe,"__esModule",{value:!0});uSe.ConsoleSpanExporter=void 0;var sAt=jn(),aAt=class{export(e,r){return this._sendSpans(e,r)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){var r;return{resource:{attributes:e.resource.attributes},traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(r=e.spanContext().traceState)===null||r===void 0?void 0:r.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:(0,sAt.hrTimeToMicroseconds)(e.startTime),duration:(0,sAt.hrTimeToMicroseconds)(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,r){for(let n of e)console.dir(this._exportInfo(n),{depth:3});if(r)return r({code:sAt.ExportResultCode.SUCCESS})}};uSe.ConsoleSpanExporter=aAt});var pHr=D(dSe=>{"use strict";Object.defineProperty(dSe,"__esModule",{value:!0});dSe.InMemorySpanExporter=void 0;var fHr=jn(),lAt=class{constructor(){this._finishedSpans=[],this._stopped=!1}export(e,r){if(this._stopped)return r({code:fHr.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>r({code:fHr.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}};dSe.InMemorySpanExporter=lAt});var mHr=D(hHr=>{"use strict";Object.defineProperty(hHr,"__esModule",{value:!0})});var gHr=D(fSe=>{"use strict";Object.defineProperty(fSe,"__esModule",{value:!0});fSe.SimpleSpanProcessor=void 0;var lao=(Ur(),pr(Wr)),k$=jn(),cAt=class{constructor(e){this._exporter=e,this._shutdownOnce=new k$.BindOnceFuture(this._shutdown,this),this._unresolvedExports=new Set}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,r){}onEnd(e){var r,n;if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&lao.TraceFlags.SAMPLED)===0)return;let i=()=>k$.internal._export(this._exporter,[e]).then(o=>{var s;o.code!==k$.ExportResultCode.SUCCESS&&(0,k$.globalErrorHandler)((s=o.error)!==null&&s!==void 0?s:new Error(`SimpleSpanProcessor: span export failed (status ${o})`))}).catch(o=>{(0,k$.globalErrorHandler)(o)});if(e.resource.asyncAttributesPending){let o=(n=(r=e.resource).waitForAsyncAttributes)===null||n===void 0?void 0:n.call(r).then(()=>(o!=null&&this._unresolvedExports.delete(o),i()),s=>(0,k$.globalErrorHandler)(s));o!=null&&this._unresolvedExports.add(o)}else i()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};fSe.SimpleSpanProcessor=cAt});var yHr=D(AHr=>{"use strict";Object.defineProperty(AHr,"__esModule",{value:!0})});var vHr=D(EHr=>{"use strict";Object.defineProperty(EHr,"__esModule",{value:!0})});var bHr=D(CHr=>{"use strict";Object.defineProperty(CHr,"__esModule",{value:!0})});var SHr=D(xHr=>{"use strict";Object.defineProperty(xHr,"__esModule",{value:!0})});var _Hr=D(wHr=>{"use strict";Object.defineProperty(wHr,"__esModule",{value:!0})});var Sk=D(Qc=>{"use strict";var cao=Qc&&Qc.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),tp=Qc&&Qc.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cao(e,t,r)};Object.defineProperty(Qc,"__esModule",{value:!0});tp(aHr(),Qc);tp(uHr(),Qc);tp(oSe(),Qc);tp(dHr(),Qc);tp(pHr(),Qc);tp(mHr(),Qc);tp(gHr(),Qc);tp(yHr(),Qc);tp(oAt(),Qc);tp(z7e(),Qc);tp(J7e(),Qc);tp(W1t(),Qc);tp(j1t(),Qc);tp(_ae(),Qc);tp(Q1t(),Qc);tp(vHr(),Qc);tp(bHr(),Qc);tp(SHr(),Qc);tp(_Hr(),Qc)});var Iae=D((O9s,THr)=>{"use strict";var uao="2.0.0",dao=Number.MAX_SAFE_INTEGER||9007199254740991,fao=16,pao=250,hao=["major","premajor","minor","preminor","patch","prepatch","prerelease"];THr.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:fao,MAX_SAFE_BUILD_LENGTH:pao,MAX_SAFE_INTEGER:dao,RELEASE_TYPES:hao,SEMVER_SPEC_VERSION:uao,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var Dae=D((k9s,IHr)=>{"use strict";var mao=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};IHr.exports=mao});var M$=D((uC,DHr)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:uAt,MAX_SAFE_BUILD_LENGTH:gao,MAX_LENGTH:Aao}=Iae(),yao=Dae();uC=DHr.exports={};var Eao=uC.re=[],vao=uC.safeRe=[],cn=uC.src=[],Cao=uC.safeSrc=[],un=uC.t={},bao=0,dAt="[a-zA-Z0-9-]",xao=[["\\s",1],["\\d",Aao],[dAt,gao]],Sao=t=>{for(let[e,r]of xao)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},Bo=(t,e,r)=>{let n=Sao(e),i=bao++;yao(t,i,e),un[t]=i,cn[i]=e,Cao[i]=n,Eao[i]=new RegExp(e,r?"g":void 0),vao[i]=new RegExp(n,r?"g":void 0)};Bo("NUMERICIDENTIFIER","0|[1-9]\\d*");Bo("NUMERICIDENTIFIERLOOSE","\\d+");Bo("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${dAt}*`);Bo("MAINVERSION",`(${cn[un.NUMERICIDENTIFIER]})\\.(${cn[un.NUMERICIDENTIFIER]})\\.(${cn[un.NUMERICIDENTIFIER]})`);Bo("MAINVERSIONLOOSE",`(${cn[un.NUMERICIDENTIFIERLOOSE]})\\.(${cn[un.NUMERICIDENTIFIERLOOSE]})\\.(${cn[un.NUMERICIDENTIFIERLOOSE]})`);Bo("PRERELEASEIDENTIFIER",`(?:${cn[un.NONNUMERICIDENTIFIER]}|${cn[un.NUMERICIDENTIFIER]})`);Bo("PRERELEASEIDENTIFIERLOOSE",`(?:${cn[un.NONNUMERICIDENTIFIER]}|${cn[un.NUMERICIDENTIFIERLOOSE]})`);Bo("PRERELEASE",`(?:-(${cn[un.PRERELEASEIDENTIFIER]}(?:\\.${cn[un.PRERELEASEIDENTIFIER]})*))`);Bo("PRERELEASELOOSE",`(?:-?(${cn[un.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${cn[un.PRERELEASEIDENTIFIERLOOSE]})*))`);Bo("BUILDIDENTIFIER",`${dAt}+`);Bo("BUILD",`(?:\\+(${cn[un.BUILDIDENTIFIER]}(?:\\.${cn[un.BUILDIDENTIFIER]})*))`);Bo("FULLPLAIN",`v?${cn[un.MAINVERSION]}${cn[un.PRERELEASE]}?${cn[un.BUILD]}?`);Bo("FULL",`^${cn[un.FULLPLAIN]}$`);Bo("LOOSEPLAIN",`[v=\\s]*${cn[un.MAINVERSIONLOOSE]}${cn[un.PRERELEASELOOSE]}?${cn[un.BUILD]}?`);Bo("LOOSE",`^${cn[un.LOOSEPLAIN]}$`);Bo("GTLT","((?:<|>)?=?)");Bo("XRANGEIDENTIFIERLOOSE",`${cn[un.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Bo("XRANGEIDENTIFIER",`${cn[un.NUMERICIDENTIFIER]}|x|X|\\*`);Bo("XRANGEPLAIN",`[v=\\s]*(${cn[un.XRANGEIDENTIFIER]})(?:\\.(${cn[un.XRANGEIDENTIFIER]})(?:\\.(${cn[un.XRANGEIDENTIFIER]})(?:${cn[un.PRERELEASE]})?${cn[un.BUILD]}?)?)?`);Bo("XRANGEPLAINLOOSE",`[v=\\s]*(${cn[un.XRANGEIDENTIFIERLOOSE]})(?:\\.(${cn[un.XRANGEIDENTIFIERLOOSE]})(?:\\.(${cn[un.XRANGEIDENTIFIERLOOSE]})(?:${cn[un.PRERELEASELOOSE]})?${cn[un.BUILD]}?)?)?`);Bo("XRANGE",`^${cn[un.GTLT]}\\s*${cn[un.XRANGEPLAIN]}$`);Bo("XRANGELOOSE",`^${cn[un.GTLT]}\\s*${cn[un.XRANGEPLAINLOOSE]}$`);Bo("COERCEPLAIN",`(^|[^\\d])(\\d{1,${uAt}})(?:\\.(\\d{1,${uAt}}))?(?:\\.(\\d{1,${uAt}}))?`);Bo("COERCE",`${cn[un.COERCEPLAIN]}(?:$|[^\\d])`);Bo("COERCEFULL",cn[un.COERCEPLAIN]+`(?:${cn[un.PRERELEASE]})?(?:${cn[un.BUILD]})?(?:$|[^\\d])`);Bo("COERCERTL",cn[un.COERCE],!0);Bo("COERCERTLFULL",cn[un.COERCEFULL],!0);Bo("LONETILDE","(?:~>?)");Bo("TILDETRIM",`(\\s*)${cn[un.LONETILDE]}\\s+`,!0);uC.tildeTrimReplace="$1~";Bo("TILDE",`^${cn[un.LONETILDE]}${cn[un.XRANGEPLAIN]}$`);Bo("TILDELOOSE",`^${cn[un.LONETILDE]}${cn[un.XRANGEPLAINLOOSE]}$`);Bo("LONECARET","(?:\\^)");Bo("CARETTRIM",`(\\s*)${cn[un.LONECARET]}\\s+`,!0);uC.caretTrimReplace="$1^";Bo("CARET",`^${cn[un.LONECARET]}${cn[un.XRANGEPLAIN]}$`);Bo("CARETLOOSE",`^${cn[un.LONECARET]}${cn[un.XRANGEPLAINLOOSE]}$`);Bo("COMPARATORLOOSE",`^${cn[un.GTLT]}\\s*(${cn[un.LOOSEPLAIN]})$|^$`);Bo("COMPARATOR",`^${cn[un.GTLT]}\\s*(${cn[un.FULLPLAIN]})$|^$`);Bo("COMPARATORTRIM",`(\\s*)${cn[un.GTLT]}\\s*(${cn[un.LOOSEPLAIN]}|${cn[un.XRANGEPLAIN]})`,!0);uC.comparatorTrimReplace="$1$2$3";Bo("HYPHENRANGE",`^\\s*(${cn[un.XRANGEPLAIN]})\\s+-\\s+(${cn[un.XRANGEPLAIN]})\\s*$`);Bo("HYPHENRANGELOOSE",`^\\s*(${cn[un.XRANGEPLAINLOOSE]})\\s+-\\s+(${cn[un.XRANGEPLAINLOOSE]})\\s*$`);Bo("STAR","(<|>)?=?\\s*\\*");Bo("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Bo("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var pSe=D((M9s,RHr)=>{"use strict";var wao=Object.freeze({loose:!0}),_ao=Object.freeze({}),Tao=t=>t?typeof t!="object"?wao:t:_ao;RHr.exports=Tao});var fAt=D((P9s,OHr)=>{"use strict";var BHr=/^[0-9]+$/,NHr=(t,e)=>{let r=BHr.test(t),n=BHr.test(e);return r&&n&&(t=+t,e=+e),t===e?0:r&&!n?-1:n&&!r?1:t<e?-1:1},Iao=(t,e)=>NHr(e,t);OHr.exports={compareIdentifiers:NHr,rcompareIdentifiers:Iao}});var im=D((L9s,MHr)=>{"use strict";var hSe=Dae(),{MAX_LENGTH:kHr,MAX_SAFE_INTEGER:mSe}=Iae(),{safeRe:gSe,t:ASe}=M$(),Dao=pSe(),{compareIdentifiers:P$}=fAt(),pAt=class t{constructor(e,r){if(r=Dao(r),e instanceof t){if(e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>kHr)throw new TypeError(`version is longer than ${kHr} characters`);hSe("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?gSe[ASe.LOOSE]:gSe[ASe.FULL]);if(!n)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+n[1],this.minor=+n[2],this.patch=+n[3],this.major>mSe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>mSe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>mSe||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(i=>{if(/^[0-9]+$/.test(i)){let o=+i;if(o>=0&&o<mSe)return o}return i}):this.prerelease=[],this.build=n[5]?n[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(hSe("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),P$(this.major,e.major)||P$(this.minor,e.minor)||P$(this.patch,e.patch)}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let r=0;do{let n=this.prerelease[r],i=e.prerelease[r];if(hSe("prerelease compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return P$(n,i)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],i=e.build[r];if(hSe("build compare",r,n,i),n===void 0&&i===void 0)return 0;if(i===void 0)return 1;if(n===void 0)return-1;if(n===i)continue;return P$(n,i)}while(++r)}inc(e,r,n){if(e.startsWith("pre")){if(!r&&n===!1)throw new Error("invalid increment argument: identifier is empty");if(r){let i=`-${r}`.match(this.options.loose?gSe[ASe.PRERELEASELOOSE]:gSe[ASe.PRERELEASE]);if(!i||i[1]!==r)throw new Error(`invalid identifier: ${r}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",r,n);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",r,n);break;case"prepatch":this.prerelease.length=0,this.inc("patch",r,n),this.inc("pre",r,n);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",r,n),this.inc("pre",r,n);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let i=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[i];else{let o=this.prerelease.length;for(;--o>=0;)typeof this.prerelease[o]=="number"&&(this.prerelease[o]++,o=-2);if(o===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(i)}}if(r){let o=[r,i];n===!1&&(o=[r]),P$(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=o):this.prerelease=o}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};MHr.exports=pAt});var wk=D((F9s,LHr)=>{"use strict";var PHr=im(),Rao=(t,e,r=!1)=>{if(t instanceof PHr)return t;try{return new PHr(t,e)}catch(n){if(!r)return null;throw n}};LHr.exports=Rao});var hAt=D((U9s,FHr)=>{"use strict";var Bao=wk(),Nao=(t,e)=>{let r=Bao(t,e);return r?r.version:null};FHr.exports=Nao});var mAt=D((Q9s,UHr)=>{"use strict";var Oao=wk(),kao=(t,e)=>{let r=Oao(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};UHr.exports=kao});var GHr=D((q9s,qHr)=>{"use strict";var QHr=im(),Mao=(t,e,r,n,i)=>{typeof r=="string"&&(i=n,n=r,r=void 0);try{return new QHr(t instanceof QHr?t.version:t,r).inc(e,n,i).version}catch{return null}};qHr.exports=Mao});var gAt=D((G9s,VHr)=>{"use strict";var HHr=wk(),Pao=(t,e)=>{let r=HHr(t,null,!0),n=HHr(e,null,!0),i=r.compare(n);if(i===0)return null;let o=i>0,s=o?r:n,a=o?n:r,c=!!s.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(s)===0)return a.minor&&!a.patch?"minor":"patch"}let d=c?"pre":"";return r.major!==n.major?d+"major":r.minor!==n.minor?d+"minor":r.patch!==n.patch?d+"patch":"prerelease"};VHr.exports=Pao});var $Hr=D((H9s,WHr)=>{"use strict";var Lao=im(),Fao=(t,e)=>new Lao(t,e).major;WHr.exports=Fao});var zHr=D((V9s,jHr)=>{"use strict";var Uao=im(),Qao=(t,e)=>new Uao(t,e).minor;jHr.exports=Qao});var JHr=D((W9s,YHr)=>{"use strict";var qao=im(),Gao=(t,e)=>new qao(t,e).patch;YHr.exports=Gao});var XHr=D(($9s,KHr)=>{"use strict";var Hao=wk(),Vao=(t,e)=>{let r=Hao(t,e);return r&&r.prerelease.length?r.prerelease:null};KHr.exports=Vao});var Hy=D((j9s,eVr)=>{"use strict";var ZHr=im(),Wao=(t,e,r)=>new ZHr(t,r).compare(new ZHr(e,r));eVr.exports=Wao});var rVr=D((z9s,tVr)=>{"use strict";var $ao=Hy(),jao=(t,e,r)=>$ao(e,t,r);tVr.exports=jao});var iVr=D((Y9s,nVr)=>{"use strict";var zao=Hy(),Yao=(t,e)=>zao(t,e,!0);nVr.exports=Yao});var ySe=D((J9s,sVr)=>{"use strict";var oVr=im(),Jao=(t,e,r)=>{let n=new oVr(t,r),i=new oVr(e,r);return n.compare(i)||n.compareBuild(i)};sVr.exports=Jao});var lVr=D((K9s,aVr)=>{"use strict";var Kao=ySe(),Xao=(t,e)=>t.sort((r,n)=>Kao(r,n,e));aVr.exports=Xao});var uVr=D((X9s,cVr)=>{"use strict";var Zao=ySe(),elo=(t,e)=>t.sort((r,n)=>Zao(n,r,e));cVr.exports=elo});var L$=D((Z9s,dVr)=>{"use strict";var tlo=Hy(),rlo=(t,e,r)=>tlo(t,e,r)>0;dVr.exports=rlo});var ESe=D((exs,fVr)=>{"use strict";var nlo=Hy(),ilo=(t,e,r)=>nlo(t,e,r)<0;fVr.exports=ilo});var AAt=D((txs,pVr)=>{"use strict";var olo=Hy(),slo=(t,e,r)=>olo(t,e,r)===0;pVr.exports=slo});var yAt=D((rxs,hVr)=>{"use strict";var alo=Hy(),llo=(t,e,r)=>alo(t,e,r)!==0;hVr.exports=llo});var vSe=D((nxs,mVr)=>{"use strict";var clo=Hy(),ulo=(t,e,r)=>clo(t,e,r)>=0;mVr.exports=ulo});var CSe=D((ixs,gVr)=>{"use strict";var dlo=Hy(),flo=(t,e,r)=>dlo(t,e,r)<=0;gVr.exports=flo});var EAt=D((oxs,AVr)=>{"use strict";var plo=AAt(),hlo=yAt(),mlo=L$(),glo=vSe(),Alo=ESe(),ylo=CSe(),Elo=(t,e,r,n)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t===r;case"!==":return typeof t=="object"&&(t=t.version),typeof r=="object"&&(r=r.version),t!==r;case"":case"=":case"==":return plo(t,r,n);case"!=":return hlo(t,r,n);case">":return mlo(t,r,n);case">=":return glo(t,r,n);case"<":return Alo(t,r,n);case"<=":return ylo(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};AVr.exports=Elo});var EVr=D((sxs,yVr)=>{"use strict";var vlo=im(),Clo=wk(),{safeRe:bSe,t:xSe}=M$(),blo=(t,e)=>{if(t instanceof vlo)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let r=null;if(!e.rtl)r=t.match(e.includePrerelease?bSe[xSe.COERCEFULL]:bSe[xSe.COERCE]);else{let c=e.includePrerelease?bSe[xSe.COERCERTLFULL]:bSe[xSe.COERCERTL],u;for(;(u=c.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||u.index+u[0].length!==r.index+r[0].length)&&(r=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(r===null)return null;let n=r[2],i=r[3]||"0",o=r[4]||"0",s=e.includePrerelease&&r[5]?`-${r[5]}`:"",a=e.includePrerelease&&r[6]?`+${r[6]}`:"";return Clo(`${n}.${i}.${o}${s}${a}`,e)};yVr.exports=blo});var CVr=D((axs,vVr)=>{"use strict";var vAt=class{constructor(){this.max=1e3,this.map=new Map}get(e){let r=this.map.get(e);if(r!==void 0)return this.map.delete(e),this.map.set(e,r),r}delete(e){return this.map.delete(e)}set(e,r){if(!this.delete(e)&&r!==void 0){if(this.map.size>=this.max){let i=this.map.keys().next().value;this.delete(i)}this.map.set(e,r)}return this}};vVr.exports=vAt});var Vy=D((lxs,wVr)=>{"use strict";var xlo=/\s+/g,CAt=class t{constructor(e,r){if(r=wlo(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof bAt)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease,this.raw=e.trim().replace(xlo," "),this.set=this.raw.split("||").map(n=>this.parseRange(n.trim())).filter(n=>n.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let n=this.set[0];if(this.set=this.set.filter(i=>!xVr(i[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let i of this.set)if(i.length===1&&Nlo(i[0])){this.set=[i];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n<r.length;n++)n>0&&(this.formatted+=" "),this.formatted+=r[n].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let n=((this.options.includePrerelease&&Rlo)|(this.options.loose&&Blo))+":"+e,i=bVr.get(n);if(i)return i;let o=this.options.loose,s=o?F2[dg.HYPHENRANGELOOSE]:F2[dg.HYPHENRANGE];e=e.replace(s,Glo(this.options.includePrerelease)),qc("hyphen replace",e),e=e.replace(F2[dg.COMPARATORTRIM],Tlo),qc("comparator trim",e),e=e.replace(F2[dg.TILDETRIM],Ilo),qc("tilde trim",e),e=e.replace(F2[dg.CARETTRIM],Dlo),qc("caret trim",e);let a=e.split(" ").map(f=>Olo(f,this.options)).join(" ").split(/\s+/).map(f=>qlo(f,this.options));o&&(a=a.filter(f=>(qc("loose invalid filter",f,this.options),!!f.match(F2[dg.COMPARATORLOOSE])))),qc("range list",a);let c=new Map,u=a.map(f=>new bAt(f,this.options));for(let f of u){if(xVr(f))return[f];c.set(f.value,f)}c.size>1&&c.has("")&&c.delete("");let d=[...c.values()];return bVr.set(n,d),d}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>SVr(n,r)&&e.set.some(i=>SVr(i,r)&&n.every(o=>i.every(s=>o.intersects(s,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new _lo(e,this.options)}catch{return!1}for(let r=0;r<this.set.length;r++)if(Hlo(this.set[r],e,this.options))return!0;return!1}};wVr.exports=CAt;var Slo=CVr(),bVr=new Slo,wlo=pSe(),bAt=Rae(),qc=Dae(),_lo=im(),{safeRe:F2,t:dg,comparatorTrimReplace:Tlo,tildeTrimReplace:Ilo,caretTrimReplace:Dlo}=M$(),{FLAG_INCLUDE_PRERELEASE:Rlo,FLAG_LOOSE:Blo}=Iae(),xVr=t=>t.value==="<0.0.0-0",Nlo=t=>t.value==="",SVr=(t,e)=>{let r=!0,n=t.slice(),i=n.pop();for(;r&&n.length;)r=n.every(o=>i.intersects(o,e)),i=n.pop();return r},Olo=(t,e)=>(qc("comp",t,e),t=Plo(t,e),qc("caret",t),t=klo(t,e),qc("tildes",t),t=Flo(t,e),qc("xrange",t),t=Qlo(t,e),qc("stars",t),t),fg=t=>!t||t.toLowerCase()==="x"||t==="*",klo=(t,e)=>t.trim().split(/\s+/).map(r=>Mlo(r,e)).join(" "),Mlo=(t,e)=>{let r=e.loose?F2[dg.TILDELOOSE]:F2[dg.TILDE];return t.replace(r,(n,i,o,s,a)=>{qc("tilde",t,n,i,o,s,a);let c;return fg(i)?c="":fg(o)?c=`>=${i}.0.0 <${+i+1}.0.0-0`:fg(s)?c=`>=${i}.${o}.0 <${i}.${+o+1}.0-0`:a?(qc("replaceTilde pr",a),c=`>=${i}.${o}.${s}-${a} <${i}.${+o+1}.0-0`):c=`>=${i}.${o}.${s} <${i}.${+o+1}.0-0`,qc("tilde return",c),c})},Plo=(t,e)=>t.trim().split(/\s+/).map(r=>Llo(r,e)).join(" "),Llo=(t,e)=>{qc("caret",t,e);let r=e.loose?F2[dg.CARETLOOSE]:F2[dg.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(i,o,s,a,c)=>{qc("caret",t,i,o,s,a,c);let u;return fg(o)?u="":fg(s)?u=`>=${o}.0.0${n} <${+o+1}.0.0-0`:fg(a)?o==="0"?u=`>=${o}.${s}.0${n} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.0${n} <${+o+1}.0.0-0`:c?(qc("replaceCaret pr",c),o==="0"?s==="0"?u=`>=${o}.${s}.${a}-${c} <${o}.${s}.${+a+1}-0`:u=`>=${o}.${s}.${a}-${c} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.${a}-${c} <${+o+1}.0.0-0`):(qc("no pr"),o==="0"?s==="0"?u=`>=${o}.${s}.${a}${n} <${o}.${s}.${+a+1}-0`:u=`>=${o}.${s}.${a}${n} <${o}.${+s+1}.0-0`:u=`>=${o}.${s}.${a} <${+o+1}.0.0-0`),qc("caret return",u),u})},Flo=(t,e)=>(qc("replaceXRanges",t,e),t.split(/\s+/).map(r=>Ulo(r,e)).join(" ")),Ulo=(t,e)=>{t=t.trim();let r=e.loose?F2[dg.XRANGELOOSE]:F2[dg.XRANGE];return t.replace(r,(n,i,o,s,a,c)=>{qc("xRange",t,n,i,o,s,a,c);let u=fg(o),d=u||fg(s),f=d||fg(a),p=f;return i==="="&&p&&(i=""),c=e.includePrerelease?"-0":"",u?i===">"||i==="<"?n="<0.0.0-0":n="*":i&&p?(d&&(s=0),a=0,i===">"?(i=">=",d?(o=+o+1,s=0,a=0):(s=+s+1,a=0)):i==="<="&&(i="<",d?o=+o+1:s=+s+1),i==="<"&&(c="-0"),n=`${i+o}.${s}.${a}${c}`):d?n=`>=${o}.0.0${c} <${+o+1}.0.0-0`:f&&(n=`>=${o}.${s}.0${c} <${o}.${+s+1}.0-0`),qc("xRange return",n),n})},Qlo=(t,e)=>(qc("replaceStars",t,e),t.trim().replace(F2[dg.STAR],"")),qlo=(t,e)=>(qc("replaceGTE0",t,e),t.trim().replace(F2[e.includePrerelease?dg.GTE0PRE:dg.GTE0],"")),Glo=t=>(e,r,n,i,o,s,a,c,u,d,f,p)=>(fg(n)?r="":fg(i)?r=`>=${n}.0.0${t?"-0":""}`:fg(o)?r=`>=${n}.${i}.0${t?"-0":""}`:s?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,fg(u)?c="":fg(d)?c=`<${+u+1}.0.0-0`:fg(f)?c=`<${u}.${+d+1}.0-0`:p?c=`<=${u}.${d}.${f}-${p}`:t?c=`<${u}.${d}.${+f+1}-0`:c=`<=${c}`,`${r} ${c}`.trim()),Hlo=(t,e,r)=>{for(let n=0;n<t.length;n++)if(!t[n].test(e))return!1;if(e.prerelease.length&&!r.includePrerelease){for(let n=0;n<t.length;n++)if(qc(t[n].semver),t[n].semver!==bAt.ANY&&t[n].semver.prerelease.length>0){let i=t[n].semver;if(i.major===e.major&&i.minor===e.minor&&i.patch===e.patch)return!0}return!1}return!0}});var Rae=D((cxs,BVr)=>{"use strict";var Bae=Symbol("SemVer ANY"),wAt=class t{static get ANY(){return Bae}constructor(e,r){if(r=_Vr(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),SAt("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===Bae?this.value="":this.value=this.operator+this.semver.version,SAt("comp",this)}parse(e){let r=this.options.loose?TVr[IVr.COMPARATORLOOSE]:TVr[IVr.COMPARATOR],n=e.match(r);if(!n)throw new TypeError(`Invalid comparator: ${e}`);this.operator=n[1]!==void 0?n[1]:"",this.operator==="="&&(this.operator=""),n[2]?this.semver=new DVr(n[2],this.options.loose):this.semver=Bae}toString(){return this.value}test(e){if(SAt("Comparator.test",e,this.options.loose),this.semver===Bae||e===Bae)return!0;if(typeof e=="string")try{e=new DVr(e,this.options)}catch{return!1}return xAt(e,this.operator,this.semver,this.options)}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new RVr(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new RVr(this.value,r).test(e.semver):(r=_Vr(r),r.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!r.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||xAt(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||xAt(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};BVr.exports=wAt;var _Vr=pSe(),{safeRe:TVr,t:IVr}=M$(),xAt=EAt(),SAt=Dae(),DVr=im(),RVr=Vy()});var Nae=D((uxs,NVr)=>{"use strict";var Vlo=Vy(),Wlo=(t,e,r)=>{try{e=new Vlo(e,r)}catch{return!1}return e.test(t)};NVr.exports=Wlo});var kVr=D((dxs,OVr)=>{"use strict";var $lo=Vy(),jlo=(t,e)=>new $lo(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));OVr.exports=jlo});var PVr=D((fxs,MVr)=>{"use strict";var zlo=im(),Ylo=Vy(),Jlo=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Ylo(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===-1)&&(n=s,i=new zlo(n,r))}),n};MVr.exports=Jlo});var FVr=D((pxs,LVr)=>{"use strict";var Klo=im(),Xlo=Vy(),Zlo=(t,e,r)=>{let n=null,i=null,o=null;try{o=new Xlo(e,r)}catch{return null}return t.forEach(s=>{o.test(s)&&(!n||i.compare(s)===1)&&(n=s,i=new Klo(n,r))}),n};LVr.exports=Zlo});var qVr=D((hxs,QVr)=>{"use strict";var _At=im(),eco=Vy(),UVr=L$(),tco=(t,e)=>{t=new eco(t,e);let r=new _At("0.0.0");if(t.test(r)||(r=new _At("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n<t.set.length;++n){let i=t.set[n],o=null;i.forEach(s=>{let a=new _At(s.semver.version);switch(s.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!o||UVr(a,o))&&(o=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${s.operator}`)}}),o&&(!r||UVr(r,o))&&(r=o)}return r&&t.test(r)?r:null};QVr.exports=tco});var HVr=D((mxs,GVr)=>{"use strict";var rco=Vy(),nco=(t,e)=>{try{return new rco(t,e).range||"*"}catch{return null}};GVr.exports=nco});var SSe=D((gxs,jVr)=>{"use strict";var ico=im(),$Vr=Rae(),{ANY:oco}=$Vr,sco=Vy(),aco=Nae(),VVr=L$(),WVr=ESe(),lco=CSe(),cco=vSe(),uco=(t,e,r,n)=>{t=new ico(t,n),e=new sco(e,n);let i,o,s,a,c;switch(r){case">":i=VVr,o=lco,s=WVr,a=">",c=">=";break;case"<":i=WVr,o=cco,s=VVr,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(aco(t,e,n))return!1;for(let u=0;u<e.set.length;++u){let d=e.set[u],f=null,p=null;if(d.forEach(h=>{h.semver===oco&&(h=new $Vr(">=0.0.0")),f=f||h,p=p||h,i(h.semver,f.semver,n)?f=h:s(h.semver,p.semver,n)&&(p=h)}),f.operator===a||f.operator===c||(!p.operator||p.operator===a)&&o(t,p.semver))return!1;if(p.operator===c&&s(t,p.semver))return!1}return!0};jVr.exports=uco});var YVr=D((Axs,zVr)=>{"use strict";var dco=SSe(),fco=(t,e,r)=>dco(t,e,">",r);zVr.exports=fco});var KVr=D((yxs,JVr)=>{"use strict";var pco=SSe(),hco=(t,e,r)=>pco(t,e,"<",r);JVr.exports=hco});var eWr=D((Exs,ZVr)=>{"use strict";var XVr=Vy(),mco=(t,e,r)=>(t=new XVr(t,r),e=new XVr(e,r),t.intersects(e,r));ZVr.exports=mco});var rWr=D((vxs,tWr)=>{"use strict";var gco=Nae(),Aco=Hy();tWr.exports=(t,e,r)=>{let n=[],i=null,o=null,s=t.sort((d,f)=>Aco(d,f,r));for(let d of s)gco(d,e,r)?(o=d,i||(i=d)):(o&&n.push([i,o]),o=null,i=null);i&&n.push([i,null]);let a=[];for(let[d,f]of n)d===f?a.push(d):!f&&d===s[0]?a.push("*"):f?d===s[0]?a.push(`<=${f}`):a.push(`${d} - ${f}`):a.push(`>=${d}`);let c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length<u.length?c:e}});var lWr=D((Cxs,aWr)=>{"use strict";var nWr=Vy(),IAt=Rae(),{ANY:TAt}=IAt,Oae=Nae(),DAt=Hy(),yco=(t,e,r={})=>{if(t===e)return!0;t=new nWr(t,r),e=new nWr(e,r);let n=!1;e:for(let i of t.set){for(let o of e.set){let s=vco(i,o,r);if(n=n||s!==null,s)continue e}if(n)return!1}return!0},Eco=[new IAt(">=0.0.0-0")],iWr=[new IAt(">=0.0.0")],vco=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===TAt){if(e.length===1&&e[0].semver===TAt)return!0;r.includePrerelease?t=Eco:t=iWr}if(e.length===1&&e[0].semver===TAt){if(r.includePrerelease)return!0;e=iWr}let n=new Set,i,o;for(let h of t)h.operator===">"||h.operator===">="?i=oWr(i,h,r):h.operator==="<"||h.operator==="<="?o=sWr(o,h,r):n.add(h.semver);if(n.size>1)return null;let s;if(i&&o){if(s=DAt(i.semver,o.semver,r),s>0)return null;if(s===0&&(i.operator!==">="||o.operator!=="<="))return null}for(let h of n){if(i&&!Oae(h,String(i),r)||o&&!Oae(h,String(o),r))return null;for(let m of e)if(!Oae(h,String(m),r))return!1;return!0}let a,c,u,d,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1,p=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1;f&&f.prerelease.length===1&&o.operator==="<"&&f.prerelease[0]===0&&(f=!1);for(let h of e){if(d=d||h.operator===">"||h.operator===">=",u=u||h.operator==="<"||h.operator==="<=",i){if(p&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===p.major&&h.semver.minor===p.minor&&h.semver.patch===p.patch&&(p=!1),h.operator===">"||h.operator===">="){if(a=oWr(i,h,r),a===h&&a!==i)return!1}else if(i.operator===">="&&!Oae(i.semver,String(h),r))return!1}if(o){if(f&&h.semver.prerelease&&h.semver.prerelease.length&&h.semver.major===f.major&&h.semver.minor===f.minor&&h.semver.patch===f.patch&&(f=!1),h.operator==="<"||h.operator==="<="){if(c=sWr(o,h,r),c===h&&c!==o)return!1}else if(o.operator==="<="&&!Oae(o.semver,String(h),r))return!1}if(!h.operator&&(o||i)&&s!==0)return!1}return!(i&&u&&!o&&s!==0||o&&d&&!i&&s!==0||p||f)},oWr=(t,e,r)=>{if(!t)return e;let n=DAt(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},sWr=(t,e,r)=>{if(!t)return e;let n=DAt(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};aWr.exports=yco});var F$=D((bxs,dWr)=>{"use strict";var RAt=M$(),cWr=Iae(),Cco=im(),uWr=fAt(),bco=wk(),xco=hAt(),Sco=mAt(),wco=GHr(),_co=gAt(),Tco=$Hr(),Ico=zHr(),Dco=JHr(),Rco=XHr(),Bco=Hy(),Nco=rVr(),Oco=iVr(),kco=ySe(),Mco=lVr(),Pco=uVr(),Lco=L$(),Fco=ESe(),Uco=AAt(),Qco=yAt(),qco=vSe(),Gco=CSe(),Hco=EAt(),Vco=EVr(),Wco=Rae(),$co=Vy(),jco=Nae(),zco=kVr(),Yco=PVr(),Jco=FVr(),Kco=qVr(),Xco=HVr(),Zco=SSe(),euo=YVr(),tuo=KVr(),ruo=eWr(),nuo=rWr(),iuo=lWr();dWr.exports={parse:bco,valid:xco,clean:Sco,inc:wco,diff:_co,major:Tco,minor:Ico,patch:Dco,prerelease:Rco,compare:Bco,rcompare:Nco,compareLoose:Oco,compareBuild:kco,sort:Mco,rsort:Pco,gt:Lco,lt:Fco,eq:Uco,neq:Qco,gte:qco,lte:Gco,cmp:Hco,coerce:Vco,Comparator:Wco,Range:$co,satisfies:jco,toComparators:zco,maxSatisfying:Yco,minSatisfying:Jco,minVersion:Kco,validRange:Xco,outside:Zco,gtr:euo,ltr:tuo,intersects:ruo,simplifyRange:nuo,subset:iuo,SemVer:Cco,re:RAt.re,src:RAt.src,tokens:RAt.t,SEMVER_SPEC_VERSION:cWr.SEMVER_SPEC_VERSION,RELEASE_TYPES:cWr.RELEASE_TYPES,compareIdentifiers:uWr.compareIdentifiers,rcompareIdentifiers:uWr.rcompareIdentifiers}});var fWr=D(EE=>{"use strict";Object.defineProperty(EE,"__esModule",{value:!0});EE.JaegerPropagator=EE.UBER_BAGGAGE_HEADER_PREFIX=EE.UBER_TRACE_ID_HEADER=void 0;var _k=(Ur(),pr(Wr)),ouo=jn();EE.UBER_TRACE_ID_HEADER="uber-trace-id";EE.UBER_BAGGAGE_HEADER_PREFIX="uberctx";var BAt=class{constructor(e){typeof e=="string"?(this._jaegerTraceHeader=e,this._jaegerBaggageHeaderPrefix=EE.UBER_BAGGAGE_HEADER_PREFIX):(this._jaegerTraceHeader=e?.customTraceHeader||EE.UBER_TRACE_ID_HEADER,this._jaegerBaggageHeaderPrefix=e?.customBaggageHeaderPrefix||EE.UBER_BAGGAGE_HEADER_PREFIX)}inject(e,r,n){let i=_k.trace.getSpanContext(e),o=_k.propagation.getBaggage(e);if(i&&(0,ouo.isTracingSuppressed)(e)===!1){let s=`0${(i.traceFlags||_k.TraceFlags.NONE).toString(16)}`;n.set(r,this._jaegerTraceHeader,`${i.traceId}:${i.spanId}:0:${s}`)}if(o)for(let[s,a]of o.getAllEntries())n.set(r,`${this._jaegerBaggageHeaderPrefix}-${s}`,encodeURIComponent(a.value))}extract(e,r,n){var i;let o=n.get(r,this._jaegerTraceHeader),s=Array.isArray(o)?o[0]:o,a=n.keys(r).filter(d=>d.startsWith(`${this._jaegerBaggageHeaderPrefix}-`)).map(d=>{let f=n.get(r,d);return{key:d.substring(this._jaegerBaggageHeaderPrefix.length+1),value:Array.isArray(f)?f[0]:f}}),c=e;if(typeof s=="string"){let d=auo(s);d&&(c=_k.trace.setSpanContext(c,d))}if(a.length===0)return c;let u=(i=_k.propagation.getBaggage(e))!==null&&i!==void 0?i:_k.propagation.createBaggage();for(let d of a)d.value!==void 0&&(u=u.setEntry(d.key,{value:decodeURIComponent(d.value)}));return c=_k.propagation.setBaggage(c,u),c}fields(){return[this._jaegerTraceHeader]}};EE.JaegerPropagator=BAt;var suo=/^[0-9a-f]{1,2}$/i;function auo(t){let e=decodeURIComponent(t).split(":");if(e.length!==4)return null;let[r,n,,i]=e,o=r.padStart(32,"0"),s=n.padStart(16,"0"),a=suo.test(i)?parseInt(i,16)&1:1;return{traceId:o,spanId:s,isRemote:!0,traceFlags:a}}});var pWr=D(Tk=>{"use strict";var luo=Tk&&Tk.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),cuo=Tk&&Tk.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&luo(e,t,r)};Object.defineProperty(Tk,"__esModule",{value:!0});cuo(fWr(),Tk)});var gWr=D(TSe=>{"use strict";Object.defineProperty(TSe,"__esModule",{value:!0});TSe.NodeTracerProvider=void 0;var hWr=FGr(),wSe=WGr(),mWr=Sk(),uuo=F$(),duo=pWr(),_Se=class extends mWr.BasicTracerProvider{constructor(e={}){super(e)}register(e={}){if(e.contextManager===void 0){let r=uuo.gte(process.version,"14.8.0")?hWr.AsyncLocalStorageContextManager:hWr.AsyncHooksContextManager;e.contextManager=new r,e.contextManager.enable()}super.register(e)}};TSe.NodeTracerProvider=_Se;_Se._registeredPropagators=new Map([...mWr.BasicTracerProvider._registeredPropagators,["b3",()=>new wSe.B3Propagator({injectEncoding:wSe.B3InjectEncoding.SINGLE_HEADER})],["b3multi",()=>new wSe.B3Propagator({injectEncoding:wSe.B3InjectEncoding.MULTI_HEADER})],["jaeger",()=>new duo.JaegerPropagator]])});var kae=D(iT=>{"use strict";var fuo=iT&&iT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),AWr=iT&&iT.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&fuo(e,t,r)};Object.defineProperty(iT,"__esModule",{value:!0});AWr(gWr(),iT);AWr(Sk(),iT)});var yWr=D(U$=>{"use strict";Object.defineProperty(U$,"__esModule",{value:!0});U$.disableInstrumentations=U$.enableInstrumentations=void 0;function puo(t,e,r,n){for(let i=0,o=t.length;i<o;i++){let s=t[i];e&&s.setTracerProvider(e),r&&s.setMeterProvider(r),n&&s.setLoggerProvider&&s.setLoggerProvider(n),s.getConfig().enabled||s.enable()}}U$.enableInstrumentations=puo;function huo(t){t.forEach(e=>e.disable())}U$.disableInstrumentations=huo});var CWr=D(ISe=>{"use strict";Object.defineProperty(ISe,"__esModule",{value:!0});ISe.registerInstrumentations=void 0;var EWr=(Ur(),pr(Wr)),muo=sW(),vWr=yWr();function guo(t){var e,r;let n=t.tracerProvider||EWr.trace.getTracerProvider(),i=t.meterProvider||EWr.metrics.getMeterProvider(),o=t.loggerProvider||muo.logs.getLoggerProvider(),s=(r=(e=t.instrumentations)===null||e===void 0?void 0:e.flat())!==null&&r!==void 0?r:[];return(0,vWr.enableInstrumentations)(s,n,i,o),()=>{(0,vWr.disableInstrumentations)(s)}}ISe.registerInstrumentations=guo});var OAt=D((Dxs,SWr)=>{"use strict";function NAt(t){return typeof t=="function"}var pg=console.error.bind(console);function Mae(t,e,r){var n=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:n,writable:!0,value:r})}function Pae(t){t&&t.logger&&(NAt(t.logger)?pg=t.logger:pg("new logger isn't a function, not replacing"))}function bWr(t,e,r){if(!t||!t[e]){pg("no original function "+e+" to wrap");return}if(!r){pg("no wrapper function"),pg(new Error().stack);return}if(!NAt(t[e])||!NAt(r)){pg("original object and wrapper must be functions");return}var n=t[e],i=r(n,e);return Mae(i,"__original",n),Mae(i,"__unwrap",function(){t[e]===i&&Mae(t,e,n)}),Mae(i,"__wrapped",!0),Mae(t,e,i),i}function Auo(t,e,r){if(t)Array.isArray(t)||(t=[t]);else{pg("must provide one or more modules to patch"),pg(new Error().stack);return}if(!(e&&Array.isArray(e))){pg("must provide one or more functions to wrap on modules");return}t.forEach(function(n){e.forEach(function(i){bWr(n,i,r)})})}function xWr(t,e){if(!t||!t[e]){pg("no function to unwrap."),pg(new Error().stack);return}if(!t[e].__unwrap)pg("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}function yuo(t,e){if(t)Array.isArray(t)||(t=[t]);else{pg("must provide one or more modules to patch"),pg(new Error().stack);return}if(!(e&&Array.isArray(e))){pg("must provide one or more functions to unwrap on modules");return}t.forEach(function(r){e.forEach(function(n){xWr(r,n)})})}Pae.wrap=bWr;Pae.massWrap=Auo;Pae.unwrap=xWr;Pae.massUnwrap=yuo;SWr.exports=Pae});var wWr=D(RSe=>{"use strict";Object.defineProperty(RSe,"__esModule",{value:!0});RSe.InstrumentationAbstract=void 0;var kAt=(Ur(),pr(Wr)),Euo=sW(),DSe=OAt(),MAt=class{constructor(e,r,n){this.instrumentationName=e,this.instrumentationVersion=r,this._wrap=DSe.wrap,this._unwrap=DSe.unwrap,this._massWrap=DSe.massWrap,this._massUnwrap=DSe.massUnwrap,this._config=Object.assign({enabled:!0},n),this._diag=kAt.diag.createComponentLogger({namespace:e}),this._tracer=kAt.trace.getTracer(e,r),this._meter=kAt.metrics.getMeter(e,r),this._logger=Euo.logs.getLogger(e,r),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var e;let r=(e=this.init())!==null&&e!==void 0?e:[];return Array.isArray(r)?r:[r]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config=Object.assign({},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,r,n,i){if(e)try{e(n,i)}catch(o){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:r},o)}}};RSe.InstrumentationAbstract=MAt});var LAt=D((Bxs,_Wr)=>{"use strict";var PAt=ye("path").sep;_Wr.exports=function(t){var e=t.split(PAt),r=e.lastIndexOf("node_modules");if(r!==-1&&e[r+1]){for(var n=e[r+1][0]==="@",i=n?e[r+1]+"/"+e[r+2]:e[r+1],o=n?3:2,s="",a=r+o-1,c=0;c<=a;c++)c===a?s+=e[c]:s+=e[c]+PAt;for(var u="",d=e.length-1,f=r+o;f<=d;f++)f===d?u+=e[f]:u+=e[f]+PAt;return{name:i,basedir:s,path:u}}}});var FAt=D((Nxs,TWr)=>{"use strict";var vuo=ye("os");TWr.exports=vuo.homedir||function(){var e=process.env.HOME,r=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform==="win32"?process.env.USERPROFILE||process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:process.platform==="darwin"?e||(r?"/Users/"+r:null):process.platform==="linux"?e||(process.getuid()===0?"/root":r?"/home/"+r:null):e||null}});var UAt=D((Oxs,IWr)=>{IWr.exports=function(){var t=Error.prepareStackTrace;Error.prepareStackTrace=function(r,n){return n};var e=new Error().stack;return Error.prepareStackTrace=t,e[2].getFileName()}});var DWr=D((kxs,Lae)=>{"use strict";var Cuo=process.platform==="win32",buo=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,QAt={};function xuo(t){return buo.exec(t).slice(1)}QAt.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=xuo(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0]===e[1]?e[0]:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};var Suo=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,qAt={};function wuo(t){return Suo.exec(t).slice(1)}qAt.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=wuo(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};Cuo?Lae.exports=QAt.parse:Lae.exports=qAt.parse;Lae.exports.posix=qAt.parse;Lae.exports.win32=QAt.parse});var GAt=D((Mxs,OWr)=>{var NWr=ye("path"),RWr=NWr.parse||DWr(),BWr=function(e,r){var n="/";/^([A-Za-z]:)/.test(e)?n="":/^\\\\/.test(e)&&(n="\\\\");for(var i=[e],o=RWr(e);o.dir!==i[i.length-1];)i.push(o.dir),o=RWr(o.dir);return i.reduce(function(s,a){return s.concat(r.map(function(c){return NWr.resolve(n,a,c)}))},[])};OWr.exports=function(e,r,n){var i=r&&r.moduleDirectory?[].concat(r.moduleDirectory):["node_modules"];if(r&&typeof r.paths=="function")return r.paths(n,e,function(){return BWr(e,i)},r);var o=BWr(e,i);return r&&r.paths?o.concat(r.paths):o}});var HAt=D((Pxs,kWr)=>{kWr.exports=function(t,e){return e||{}}});var LWr=D((Lxs,PWr)=>{"use strict";var _uo="Function.prototype.bind called on incompatible ",Tuo=Object.prototype.toString,Iuo=Math.max,Duo="[object Function]",MWr=function(e,r){for(var n=[],i=0;i<e.length;i+=1)n[i]=e[i];for(var o=0;o<r.length;o+=1)n[o+e.length]=r[o];return n},Ruo=function(e,r){for(var n=[],i=r||0,o=0;i<e.length;i+=1,o+=1)n[o]=e[i];return n},Buo=function(t,e){for(var r="",n=0;n<t.length;n+=1)r+=t[n],n+1<t.length&&(r+=e);return r};PWr.exports=function(e){var r=this;if(typeof r!="function"||Tuo.apply(r)!==Duo)throw new TypeError(_uo+r);for(var n=Ruo(arguments,1),i,o=function(){if(this instanceof i){var d=r.apply(this,MWr(n,arguments));return Object(d)===d?d:this}return r.apply(e,MWr(n,arguments))},s=Iuo(0,r.length-n.length),a=[],c=0;c<s;c++)a[c]="$"+c;if(i=Function("binder","return function ("+Buo(a,",")+"){ return binder.apply(this,arguments); }")(o),r.prototype){var u=function(){};u.prototype=r.prototype,i.prototype=new u,u.prototype=null}return i}});var UWr=D((Fxs,FWr)=>{"use strict";var Nuo=LWr();FWr.exports=Function.prototype.bind||Nuo});var qWr=D((Uxs,QWr)=>{"use strict";var Ouo=Function.prototype.call,kuo=Object.prototype.hasOwnProperty,Muo=UWr();QWr.exports=Muo.call(Ouo,kuo)});var GWr=D((Qxs,Puo)=>{Puo.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var Fae=D((qxs,WWr)=>{"use strict";var Luo=qWr();function Fuo(t,e){for(var r=t.split("."),n=e.split(" "),i=n.length>1?n[0]:"=",o=(n.length>1?n[1]:n[0]).split("."),s=0;s<3;++s){var a=parseInt(r[s]||0,10),c=parseInt(o[s]||0,10);if(a!==c)return i==="<"?a<c:i===">="?a>=c:!1}return i===">="}function HWr(t,e){var r=e.split(/ ?&& ?/);if(r.length===0)return!1;for(var n=0;n<r.length;++n)if(!Fuo(t,r[n]))return!1;return!0}function Uuo(t,e){if(typeof e=="boolean")return e;var r=typeof t>"u"?process.versions&&process.versions.node:t;if(typeof r!="string")throw new TypeError(typeof t>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(e&&typeof e=="object"){for(var n=0;n<e.length;++n)if(HWr(r,e[n]))return!0;return!1}return HWr(r,e)}var VWr=GWr();WWr.exports=function(e,r){return Luo(VWr,e)&&Uuo(r,VWr[e])}});var zWr=D((Gxs,jWr)=>{var Ik=ye("fs"),Quo=FAt(),bf=ye("path"),quo=UAt(),Guo=GAt(),Huo=HAt(),Vuo=Fae(),Wuo=process.platform!=="win32"&&Ik.realpath&&typeof Ik.realpath.native=="function"?Ik.realpath.native:Ik.realpath,$Wr=Quo(),$uo=function(){return[bf.join($Wr,".node_modules"),bf.join($Wr,".node_libraries")]},juo=function(e,r){Ik.stat(e,function(n,i){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,i.isFile()||i.isFIFO())})},zuo=function(e,r){Ik.stat(e,function(n,i){return n?n.code==="ENOENT"||n.code==="ENOTDIR"?r(null,!1):r(n):r(null,i.isDirectory())})},Yuo=function(e,r){Wuo(e,function(n,i){n&&n.code!=="ENOENT"?r(n):r(null,n?e:i)})},Uae=function(e,r,n,i){n&&n.preserveSymlinks===!1?e(r,i):i(null,r)},Juo=function(e,r,n){e(r,function(i,o){if(i)n(i);else try{var s=JSON.parse(o);n(null,s)}catch{n(null)}})},Kuo=function(e,r,n){for(var i=Guo(r,n,e),o=0;o<i.length;o++)i[o]=bf.join(i[o],e);return i};jWr.exports=function(e,r,n){var i=n,o=r;if(typeof r=="function"&&(i=o,o={}),typeof e!="string"){var s=new TypeError("Path must be a string.");return process.nextTick(function(){i(s)})}o=Huo(e,o);var a=o.isFile||juo,c=o.isDirectory||zuo,u=o.readFile||Ik.readFile,d=o.realpath||Yuo,f=o.readPackage||Juo;if(o.readFile&&o.readPackage){var p=new TypeError("`readFile` and `readPackage` are mutually exclusive.");return process.nextTick(function(){i(p)})}var h=o.packageIterator,m=o.extensions||[".js"],g=o.includeCoreModules!==!1,A=o.basedir||bf.dirname(quo()),y=o.filename||A;o.paths=o.paths||$uo();var E=bf.resolve(A);Uae(d,E,o,function(B,F){B?i(B):x(F)});var C;function x(B){if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e))C=bf.resolve(B,e),(e==="."||e===".."||e.slice(-1)==="/")&&(C+="/"),/\/$/.test(e)&&C===B?U(C,o.package,w):O(C,o.package,w);else{if(g&&Vuo(e))return i(null,e);k(e,B,function(F,L,R){if(F)i(F);else{if(L)return Uae(d,L,o,function(Q,V){Q?i(Q):i(null,V,R)});var q=new Error("Cannot find module '"+e+"' from '"+y+"'");q.code="MODULE_NOT_FOUND",i(q)}})}}function w(B,F,L){B?i(B):F?i(null,F,L):U(C,function(R,q,Q){if(R)i(R);else if(q)Uae(d,q,o,function(H,J){H?i(H):i(null,J,Q)});else{var V=new Error("Cannot find module '"+e+"' from '"+y+"'");V.code="MODULE_NOT_FOUND",i(V)}})}function O(B,F,L){var R=F,q=L;typeof R=="function"&&(q=R,R=void 0);var Q=[""].concat(m);V(Q,B,R);function V(H,J,X){if(H.length===0)return q(null,void 0,X);var he=J+H[0],Ce=X;Ce?ge(null,Ce):N(bf.dirname(he),ge);function ge(xe,se,me){if(Ce=se,xe)return q(xe);if(me&&Ce&&o.pathFilter){var ve=bf.relative(me,he),ee=ve.slice(0,ve.length-H[0].length),ce=o.pathFilter(Ce,J,ee);if(ce)return V([""].concat(m.slice()),bf.resolve(me,ce),Ce)}a(he,be)}function be(xe,se){if(xe)return q(xe);if(se)return q(null,he,Ce);V(H.slice(1),J,Ce)}}}function N(B,F){if(B===""||B==="/"||process.platform==="win32"&&/^\w:[/\\]*$/.test(B)||/[/\\]node_modules[/\\]*$/.test(B))return F(null);Uae(d,B,o,function(L,R){if(L)return N(bf.dirname(B),F);var q=bf.join(R,"package.json");a(q,function(Q,V){if(!V)return N(bf.dirname(B),F);f(u,q,function(H,J){H&&F(H);var X=J;X&&o.packageFilter&&(X=o.packageFilter(X,q)),F(null,X,B)})})})}function U(B,F,L){var R=L,q=F;typeof q=="function"&&(R=q,q=o.package),Uae(d,B,o,function(Q,V){if(Q)return R(Q);var H=bf.join(V,"package.json");a(H,function(J,X){if(J)return R(J);if(!X)return O(bf.join(B,"index"),q,R);f(u,H,function(he,Ce){if(he)return R(he);var ge=Ce;if(ge&&o.packageFilter&&(ge=o.packageFilter(ge,H)),ge&&ge.main){if(typeof ge.main!="string"){var be=new TypeError("package \u201C"+ge.name+"\u201D `main` must be a string");return be.code="INVALID_PACKAGE_MAIN",R(be)}(ge.main==="."||ge.main==="./")&&(ge.main="index"),O(bf.resolve(B,ge.main),ge,function(xe,se,me){if(xe)return R(xe);if(se)return R(null,se,me);if(!me)return O(bf.join(B,"index"),me,R);var ve=bf.resolve(B,me.main);U(ve,me,function(ee,ce,Y){if(ee)return R(ee);if(ce)return R(null,ce,Y);O(bf.join(B,"index"),Y,R)})});return}O(bf.join(B,"/index"),ge,R)})})})}function S(B,F){if(F.length===0)return B(null,void 0);var L=F[0];c(bf.dirname(L),R);function R(V,H){if(V)return B(V);if(!H)return S(B,F.slice(1));O(L,o.package,q)}function q(V,H,J){if(V)return B(V);if(H)return B(null,H,J);U(L,o.package,Q)}function Q(V,H,J){if(V)return B(V);if(H)return B(null,H,J);S(B,F.slice(1))}}function k(B,F,L){var R=function(){return Kuo(B,F,o)};S(L,h?h(B,F,R,o):R())}}});var YWr=D((Hxs,Xuo)=>{Xuo.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":">= 23.4",_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var ZWr=D((Vxs,XWr)=>{"use strict";var Zuo=Fae(),JWr=YWr(),KWr={};for(BSe in JWr)Object.prototype.hasOwnProperty.call(JWr,BSe)&&(KWr[BSe]=Zuo(BSe));var BSe;XWr.exports=KWr});var t$r=D((Wxs,e$r)=>{var edo=Fae();e$r.exports=function(e){return edo(e)}});var i$r=D(($xs,n$r)=>{var tdo=Fae(),Dk=ye("fs"),om=ye("path"),rdo=FAt(),ndo=UAt(),ido=GAt(),odo=HAt(),sdo=process.platform!=="win32"&&Dk.realpathSync&&typeof Dk.realpathSync.native=="function"?Dk.realpathSync.native:Dk.realpathSync,r$r=rdo(),ado=function(){return[om.join(r$r,".node_modules"),om.join(r$r,".node_libraries")]},ldo=function(e){try{var r=Dk.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&(r.isFile()||r.isFIFO())},cdo=function(e){try{var r=Dk.statSync(e,{throwIfNoEntry:!1})}catch(n){if(n&&(n.code==="ENOENT"||n.code==="ENOTDIR"))return!1;throw n}return!!r&&r.isDirectory()},udo=function(e){try{return sdo(e)}catch(r){if(r.code!=="ENOENT")throw r}return e},Qae=function(e,r,n){return n&&n.preserveSymlinks===!1?e(r):r},ddo=function(e,r){var n=e(r);try{var i=JSON.parse(n);return i}catch{}},fdo=function(e,r,n){for(var i=ido(r,n,e),o=0;o<i.length;o++)i[o]=om.join(i[o],e);return i};n$r.exports=function(e,r){if(typeof e!="string")throw new TypeError("Path must be a string.");var n=odo(e,r),i=n.isFile||ldo,o=n.readFileSync||Dk.readFileSync,s=n.isDirectory||cdo,a=n.realpathSync||udo,c=n.readPackageSync||ddo;if(n.readFileSync&&n.readPackageSync)throw new TypeError("`readFileSync` and `readPackageSync` are mutually exclusive.");var u=n.packageIterator,d=n.extensions||[".js"],f=n.includeCoreModules!==!1,p=n.basedir||om.dirname(ndo()),h=n.filename||p;n.paths=n.paths||ado();var m=Qae(a,om.resolve(p),n);if(/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/.test(e)){var g=om.resolve(m,e);(e==="."||e===".."||e.slice(-1)==="/")&&(g+="/");var A=C(g)||w(g);if(A)return Qae(a,A,n)}else{if(f&&tdo(e))return e;var y=O(e,m);if(y)return Qae(a,y,n)}var E=new Error("Cannot find module '"+e+"' from '"+h+"'");throw E.code="MODULE_NOT_FOUND",E;function C(N){var U=x(om.dirname(N));if(U&&U.dir&&U.pkg&&n.pathFilter){var S=om.relative(U.dir,N),k=n.pathFilter(U.pkg,N,S);k&&(N=om.resolve(U.dir,k))}if(i(N))return N;for(var B=0;B<d.length;B++){var F=N+d[B];if(i(F))return F}}function x(N){if(!(N===""||N==="/")&&!(process.platform==="win32"&&/^\w:[/\\]*$/.test(N))&&!/[/\\]node_modules[/\\]*$/.test(N)){var U=om.join(Qae(a,N,n),"package.json");if(!i(U))return x(om.dirname(N));var S=c(o,U);return S&&n.packageFilter&&(S=n.packageFilter(S,N)),{pkg:S,dir:N}}}function w(N){var U=om.join(Qae(a,N,n),"/package.json");if(i(U)){try{var S=c(o,U)}catch{}if(S&&n.packageFilter&&(S=n.packageFilter(S,N)),S&&S.main){if(typeof S.main!="string"){var k=new TypeError("package \u201C"+S.name+"\u201D `main` must be a string");throw k.code="INVALID_PACKAGE_MAIN",k}(S.main==="."||S.main==="./")&&(S.main="index");try{var B=C(om.resolve(N,S.main));if(B)return B;var F=w(om.resolve(N,S.main));if(F)return F}catch{}}}return C(om.join(N,"/index"))}function O(N,U){for(var S=function(){return fdo(N,U,n)},k=u?u(N,U,S,n):S(),B=0;B<k.length;B++){var F=k[B];if(s(om.dirname(F))){var L=C(F);if(L)return L;var R=w(F);if(R)return R}}}}});var VAt=D((jxs,o$r)=>{var NSe=zWr();NSe.core=ZWr();NSe.isCore=t$r();NSe.sync=i$r();o$r.exports=NSe});var s$r=D((zxs,pdo)=>{pdo.exports={name:"require-in-the-middle",version:"7.5.2",description:"Module to hook into the Node.js require function",main:"index.js",types:"types/index.d.ts",dependencies:{debug:"^4.3.5","module-details-from-path":"^1.0.3",resolve:"^1.22.8"},devDependencies:{"@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@babel/preset-typescript":"^7.9.0","@babel/register":"^7.9.0","ipp-printer":"^1.0.0",patterns:"^1.0.3",roundround:"^0.2.0",semver:"^6.3.0",standard:"^14.3.1",tape:"^4.11.0"},scripts:{test:"npm run test:lint && npm run test:tape && npm run test:babel","test:lint":"standard","test:tape":"tape test/*.js","test:babel":"node test/babel/babel-register.js"},repository:{type:"git",url:"git+https://github.com/nodejs/require-in-the-middle.git"},keywords:["require","hook","shim","shimmer","shimming","patch","monkey","monkeypatch","module","load"],files:["types"],author:"Thomas Watson Steen <w@tson.dk> (https://twitter.com/wa7son)",license:"MIT",bugs:{url:"https://github.com/nodejs/require-in-the-middle/issues"},homepage:"https://github.com/nodejs/require-in-the-middle#readme",engines:{node:">=8.6.0"}}});var zAt=D((Yxs,jAt)=>{"use strict";var q$=ye("path"),vE=ye("module"),Ud=WL()("require-in-the-middle"),hdo=LAt();jAt.exports=qae;jAt.exports.Hook=qae;var WAt,Q$;if(vE.isBuiltin)Q$=vE.isBuiltin;else if(vE.builtinModules)Q$=t=>t.startsWith("node:")?!0:(WAt===void 0&&(WAt=new Set(vE.builtinModules)),WAt.has(t));else{let t=VAt(),[e,r]=process.versions.node.split(".").map(Number);e===8&&r<8?Q$=n=>n==="http2"?!0:!!t.core[n]:Q$=n=>!!t.core[n]}var OSe;function mdo(t,e){if(!OSe)if(ye.resolve&&ye.resolve.paths)OSe=function(r,n){return ye.resolve(r,{paths:[n]})};else{let r=VAt();OSe=function(n,i){return r.sync(n,{basedir:i})}}return OSe(t,e)}var gdo=/([/\\]index)?(\.js)?$/,$At=class{constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,r){if(this._localCache.has(e))return!0;if(r)return!1;{let n=ye.cache[e];return!!(n&&this._kRitmExports in n)}}get(e,r){let n=this._localCache.get(e);if(n!==void 0)return n;if(!r){let i=ye.cache[e];return i&&i[this._kRitmExports]}}set(e,r,n){n?this._localCache.set(e,r):e in ye.cache?ye.cache[e][this._kRitmExports]=r:(Ud('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,r))}};function qae(t,e,r){if(!(this instanceof qae))return new qae(t,e,r);if(typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null),typeof vE._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof vE._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,s$r().bugs.url);return}this._cache=new $At,this._unhooked=!1,this._origRequire=vE.prototype.require;let n=this,i=new Set,o=e?e.internals===!0:!1,s=Array.isArray(t);Ud("registering require hook"),this._require=vE.prototype.require=function(c){return n._unhooked===!0?(Ud("ignoring require call - module is soft-unhooked"),n._origRequire.apply(this,arguments)):a.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(c){return n._unhooked===!0?(Ud("ignoring process.getBuiltinModule call - module is soft-unhooked"),n._origGetBuiltinModule.apply(this,arguments)):a.call(this,arguments,!0)});function a(c,u){let d=c[0],f=Q$(d),p;if(f){if(p=d,d.startsWith("node:")){let E=d.slice(5);Q$(E)&&(p=E)}}else{if(u)return Ud("call to process.getBuiltinModule with unknown built-in id"),n._origGetBuiltinModule.apply(this,c);try{p=vE._resolveFilename(d,this)}catch(E){return Ud('Module._resolveFilename("%s") threw %j, calling original Module.require',d,E.message),n._origRequire.apply(this,c)}}let h,m;if(Ud("processing %s module require('%s'): %s",f===!0?"core":"non-core",d,p),n._cache.has(p,f)===!0)return Ud("returning already patched cached module: %s",p),n._cache.get(p,f);let g=i.has(p);g===!1&&i.add(p);let A=u?n._origGetBuiltinModule.apply(this,c):n._origRequire.apply(this,c);if(g===!0)return Ud("module is in the process of being patched already - ignoring: %s",p),A;if(i.delete(p),f===!0){if(s===!0&&t.includes(p)===!1)return Ud("ignoring core module not on whitelist: %s",p),A;h=p}else if(s===!0&&t.includes(p)){let E=q$.parse(p);h=E.name,m=E.dir}else{let E=hdo(p);if(E===void 0)return Ud("could not parse filename: %s",p),A;h=E.name,m=E.basedir;let C=Ado(E);Ud("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",h,d,C,m);let x=!1;if(s){if(!d.startsWith(".")&&t.includes(d)&&(h=d,x=!0),!t.includes(h)&&!t.includes(C))return A;t.includes(C)&&C!==h&&(h=C,x=!0)}if(!x){let w;try{w=mdo(h,m)}catch{return Ud("could not resolve module: %s",h),n._cache.set(p,A,f),A}if(w!==p)if(o===!0)h=h+q$.sep+q$.relative(m,p),Ud("preparing to process require of internal file: %s",h);else return Ud("ignoring require of non-main module file: %s",w),n._cache.set(p,A,f),A}}n._cache.set(p,A,f),Ud("calling require hook: %s",h);let y=r(A,h,m);return n._cache.set(p,y,f),Ud("returning module: %s",h),y}}qae.prototype.unhook=function(){this._unhooked=!0,this._require===vE.prototype.require?(vE.prototype.require=this._origRequire,Ud("require unhook successful")):Ud("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,Ud("process.getBuiltinModule unhook successful")):Ud("process.getBuiltinModule unhook unsuccessful"))};function Ado(t){let e=q$.sep!=="/"?t.path.split(q$.sep).join("/"):t.path;return q$.posix.join(t.name,e).replace(gdo,"")}});var a$r=D(oT=>{"use strict";Object.defineProperty(oT,"__esModule",{value:!0});oT.ModuleNameTrie=oT.ModuleNameSeparator=void 0;oT.ModuleNameSeparator="/";var kSe=class{constructor(){this.hooks=[],this.children=new Map}},YAt=class{constructor(){this._trie=new kSe,this._counter=0}insert(e){let r=this._trie;for(let n of e.moduleName.split(oT.ModuleNameSeparator)){let i=r.children.get(n);i||(i=new kSe,r.children.set(n,i)),r=i}r.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:r,fullOnly:n}={}){let i=this._trie,o=[],s=!0;for(let a of e.split(oT.ModuleNameSeparator)){let c=i.children.get(a);if(!c){s=!1;break}n||o.push(...c.hooks),i=c}return n&&s&&o.push(...i.hooks),o.length===0?[]:o.length===1?[o[0].hook]:(r&&o.sort((a,c)=>a.insertedId-c.insertedId),o.map(({hook:a})=>a))}};oT.ModuleNameTrie=YAt});var c$r=D(MSe=>{"use strict";Object.defineProperty(MSe,"__esModule",{value:!0});MSe.RequireInTheMiddleSingleton=void 0;var ydo=zAt(),l$r=ye("path"),JAt=a$r(),Edo=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),KAt=class t{constructor(){this._moduleNameTrie=new JAt.ModuleNameTrie,this._initialize()}_initialize(){new ydo.Hook(null,{internals:!0},(e,r,n)=>{let i=vdo(r),o=this._moduleNameTrie.search(i,{maintainInsertionOrder:!0,fullOnly:n===void 0});for(let{onRequire:s}of o)e=s(e,r,n);return e})}register(e,r){let n={moduleName:e,onRequire:r};return this._moduleNameTrie.insert(n),n}static getInstance(){var e;return Edo?new t:this._instance=(e=this._instance)!==null&&e!==void 0?e:new t}};MSe.RequireInTheMiddleSingleton=KAt;function vdo(t){return l$r.sep!==JAt.ModuleNameSeparator?t.split(l$r.sep).join(JAt.ModuleNameSeparator):t}});var m$r=D(Rk=>{var u$r=[],XAt=new WeakMap,d$r=new WeakMap,f$r=new Map,p$r=[],Cdo={set(t,e,r){return XAt.get(t)[e](r)},get(t,e){if(e===Symbol.toStringTag)return"Module";let r=d$r.get(t)[e];if(typeof r=="function")return r()},defineProperty(t,e,r){if(!("value"in r))throw new Error("Getters/setters are not supported for exports property descriptors.");return XAt.get(t)[e](r.value)}};function bdo(t,e,r,n,i){f$r.set(t,i),XAt.set(e,r),d$r.set(e,n);let o=new Proxy(e,Cdo);u$r.forEach(s=>s(t,o)),p$r.push([t,o])}var h$r=!1;function xdo(){return h$r}function Sdo(t){h$r=t}Rk.register=bdo;Rk.importHooks=u$r;Rk.specifiers=f$r;Rk.toHook=p$r;Rk.getExperimentalPatchInternals=xdo;Rk.setExperimentalPatchInternals=Sdo});var C$r=D((e7s,G$)=>{var g$r=ye("path"),wdo=LAt(),{fileURLToPath:A$r}=ye("url"),{MessageChannel:_do}=ye("worker_threads"),{importHooks:ZAt,specifiers:Tdo,toHook:Ido,getExperimentalPatchInternals:Ddo}=m$r();function E$r(t){ZAt.push(t),Ido.forEach(([e,r])=>t(e,r))}function v$r(t){let e=ZAt.indexOf(t);e>-1&&ZAt.splice(e,1)}function y$r(t,e,r,n){let i=t(e,r,n);i&&i!==e&&(e.default=i)}var e3t;function Rdo(){let{port1:t,port2:e}=new _do,r=0,n;e3t=a=>{r++,t.postMessage(a)},t.on("message",()=>{r--,n&&r<=0&&n()}).unref();function i(){let a=setInterval(()=>{},1e3),c=new Promise(u=>{n=u}).then(()=>{clearInterval(a)});return r===0&&n(),c}let o=e;return{registerOptions:{data:{addHookMessagePort:o,include:[]},transferList:[o]},addHookMessagePort:o,waitForAllMessagesAcknowledged:i}}function Gae(t,e,r){if(!(this instanceof Gae))return new Gae(t,e,r);typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let n=e?e.internals===!0:!1;e3t&&Array.isArray(t)&&e3t(t),this._iitmHook=(i,o)=>{let s=i,a=i.startsWith("node:"),c;if(a)i=i.replace(/^node:/,"");else{if(i.startsWith("file://"))try{i=A$r(i)}catch{}let u=wdo(i);u&&(i=u.name,c=u.basedir)}if(t){for(let u of t)if(u===i){if(c){if(n)i=i+g$r.sep+g$r.relative(c,A$r(s));else if(!Ddo()&&!c.endsWith(Tdo.get(s)))continue}y$r(r,o,i,c)}}else y$r(r,o,i,c)},E$r(this._iitmHook)}Gae.prototype.unhook=function(){v$r(this._iitmHook)};G$.exports=Gae;G$.exports.Hook=Gae;G$.exports.addHook=E$r;G$.exports.removeHook=v$r;G$.exports.createAddHookMessageChannel=Rdo});var t3t=D(sT=>{"use strict";Object.defineProperty(sT,"__esModule",{value:!0});sT.isWrapped=sT.safeExecuteInTheMiddleAsync=sT.safeExecuteInTheMiddle=void 0;function Bdo(t,e,r){let n,i;try{i=t()}catch(o){n=o}finally{if(e(n,i),n&&!r)throw n;return i}}sT.safeExecuteInTheMiddle=Bdo;async function Ndo(t,e,r){let n,i;try{i=await t()}catch(o){n=o}finally{if(e(n,i),n&&!r)throw n;return i}}sT.safeExecuteInTheMiddleAsync=Ndo;function Odo(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}sT.isWrapped=Odo});var S$r=D(PSe=>{"use strict";Object.defineProperty(PSe,"__esModule",{value:!0});PSe.InstrumentationBase=void 0;var r3t=ye("path"),b$r=ye("util"),kdo=F$(),n3t=OAt(),Mdo=wWr(),Pdo=c$r(),Ldo=C$r(),H$=(Ur(),pr(Wr)),Fdo=zAt(),Udo=ye("fs"),Qdo=t3t(),i3t=class extends Mdo.InstrumentationAbstract{constructor(e,r,n){super(e,r,n),this._hooks=[],this._requireInTheMiddleSingleton=Pdo.RequireInTheMiddleSingleton.getInstance(),this._enabled=!1,this._wrap=(o,s,a)=>{if((0,Qdo.isWrapped)(o[s])&&this._unwrap(o,s),b$r.types.isProxy(o)){let c=(0,n3t.wrap)(Object.assign({},o),s,a);return Object.defineProperty(o,s,{value:c})}else return(0,n3t.wrap)(o,s,a)},this._unwrap=(o,s)=>b$r.types.isProxy(o)?Object.defineProperty(o,s,{value:o[s]}):(0,n3t.unwrap)(o,s),this._massWrap=(o,s,a)=>{if(o)Array.isArray(o)||(o=[o]);else{H$.diag.error("must provide one or more modules to patch");return}if(!(s&&Array.isArray(s))){H$.diag.error("must provide one or more functions to wrap on modules");return}o.forEach(c=>{s.forEach(u=>{this._wrap(c,u,a)})})},this._massUnwrap=(o,s)=>{if(o)Array.isArray(o)||(o=[o]);else{H$.diag.error("must provide one or more modules to patch");return}if(!(s&&Array.isArray(s))){H$.diag.error("must provide one or more functions to wrap on modules");return}o.forEach(a=>{s.forEach(c=>{this._unwrap(a,c)})})};let i=this.init();i&&!Array.isArray(i)&&(i=[i]),this._modules=i||[],this._modules.length===0&&H$.diag.debug(`No modules instrumentation has been defined for '${this.instrumentationName}@${this.instrumentationVersion}', nothing will be patched`),this._config.enabled&&this.enable()}_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:r}=e;try{let n=ye.resolve(r);ye.cache[n]&&this._diag.warn(`Module ${r} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${r}`)}catch{}})}_extractPackageVersion(e){try{let r=(0,Udo.readFileSync)(r3t.join(e,"package.json"),{encoding:"utf8"}),n=JSON.parse(r).version;return typeof n=="string"?n:void 0}catch{H$.diag.warn("Failed extracting version",e)}}_onRequire(e,r,n,i){var o;if(!i)return typeof e.patch=="function"&&(e.moduleExports=r,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(r)):r;let s=this._extractPackageVersion(i);if(e.moduleVersion=s,e.name===n)return x$r(e.supportedVersions,s,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=r,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:i}),e.patch(r,e.moduleVersion)):r;let a=(o=e.files)!==null&&o!==void 0?o:[],c=r3t.normalize(n);return a.filter(d=>d.name===c).filter(d=>x$r(d.supportedVersions,s,e.includePrerelease)).reduce((d,f)=>(f.moduleExports=d,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:f.name,baseDir:i}),f.patch(d,e.moduleVersion)):d),r)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let r of e.files)r.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:r.name}),r.patch(r.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let r=(s,a,c)=>this._onRequire(e,s,a,c),n=(s,a,c)=>this._onRequire(e,s,a,c),i=r3t.isAbsolute(e.name)?new Fdo.Hook([e.name],{internals:!0},n):this._requireInTheMiddleSingleton.register(e.name,n);this._hooks.push(i);let o=new Ldo.Hook([e.name],{internals:!1},r);this._hooks.push(o)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let r of e.files)r.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:r.name}),r.unpatch(r.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};PSe.InstrumentationBase=i3t;function x$r(t,e,r){return typeof e>"u"?t.includes("*"):t.some(n=>(0,kdo.satisfies)(e,n,{includePrerelease:r}))}});var w$r=D(LSe=>{"use strict";Object.defineProperty(LSe,"__esModule",{value:!0});LSe.normalize=void 0;var qdo=ye("path");Object.defineProperty(LSe,"normalize",{enumerable:!0,get:function(){return qdo.normalize}})});var _$r=D(V$=>{"use strict";Object.defineProperty(V$,"__esModule",{value:!0});V$.normalize=V$.InstrumentationBase=void 0;var Gdo=S$r();Object.defineProperty(V$,"InstrumentationBase",{enumerable:!0,get:function(){return Gdo.InstrumentationBase}});var Hdo=w$r();Object.defineProperty(V$,"normalize",{enumerable:!0,get:function(){return Hdo.normalize}})});var o3t=D(W$=>{"use strict";Object.defineProperty(W$,"__esModule",{value:!0});W$.normalize=W$.InstrumentationBase=void 0;var T$r=_$r();Object.defineProperty(W$,"InstrumentationBase",{enumerable:!0,get:function(){return T$r.InstrumentationBase}});Object.defineProperty(W$,"normalize",{enumerable:!0,get:function(){return T$r.normalize}})});var I$r=D(FSe=>{"use strict";Object.defineProperty(FSe,"__esModule",{value:!0});FSe.InstrumentationNodeModuleDefinition=void 0;var s3t=class{constructor(e,r,n,i,o){this.name=e,this.supportedVersions=r,this.patch=n,this.unpatch=i,this.files=o||[]}};FSe.InstrumentationNodeModuleDefinition=s3t});var D$r=D(USe=>{"use strict";Object.defineProperty(USe,"__esModule",{value:!0});USe.InstrumentationNodeModuleFile=void 0;var Vdo=o3t(),a3t=class{constructor(e,r,n,i){this.supportedVersions=r,this.patch=n,this.unpatch=i,this.name=(0,Vdo.normalize)(e)}};USe.InstrumentationNodeModuleFile=a3t});var B$r=D(R$r=>{"use strict";Object.defineProperty(R$r,"__esModule",{value:!0})});var O$r=D(N$r=>{"use strict";Object.defineProperty(N$r,"__esModule",{value:!0})});var c3t=D(i0=>{"use strict";var Wdo=i0&&i0.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),l3t=i0&&i0.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Wdo(e,t,r)};Object.defineProperty(i0,"__esModule",{value:!0});i0.InstrumentationNodeModuleFile=i0.InstrumentationNodeModuleDefinition=i0.InstrumentationBase=i0.registerInstrumentations=void 0;var $do=CWr();Object.defineProperty(i0,"registerInstrumentations",{enumerable:!0,get:function(){return $do.registerInstrumentations}});var jdo=o3t();Object.defineProperty(i0,"InstrumentationBase",{enumerable:!0,get:function(){return jdo.InstrumentationBase}});var zdo=I$r();Object.defineProperty(i0,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return zdo.InstrumentationNodeModuleDefinition}});var Ydo=D$r();Object.defineProperty(i0,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return Ydo.InstrumentationNodeModuleFile}});l3t(B$r(),i0);l3t(O$r(),i0);l3t(t3t(),i0)});var k$r=D(QSe=>{"use strict";Object.defineProperty(QSe,"__esModule",{value:!0});QSe.VERSION=void 0;QSe.VERSION="0.52.1"});var P$r=D(GSe=>{"use strict";Object.defineProperty(GSe,"__esModule",{value:!0});GSe.OTLPTraceExporter=void 0;var $$=jn(),qSe=k9(),Jdo=fk(),Kdo=k$r(),M$r="v1/traces",Xdo=`http://localhost:4318/${M$r}`,Zdo={"User-Agent":`OTel-OTLP-Exporter-JavaScript/${Kdo.VERSION}`},u3t=class extends qSe.OTLPExporterNodeBase{constructor(e={}){super(e,Jdo.ProtobufTraceSerializer,"application/x-protobuf"),this.headers=Object.assign(Object.assign(Object.assign(Object.assign({},this.headers),Zdo),$$.baggageUtils.parseKeyPairsIntoRecord((0,$$.getEnv)().OTEL_EXPORTER_OTLP_TRACES_HEADERS)),(0,qSe.parseHeaders)(e?.headers))}getDefaultUrl(e){return typeof e.url=="string"?e.url:(0,$$.getEnv)().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length>0?(0,qSe.appendRootPathToUrlIfNeeded)((0,$$.getEnv)().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT):(0,$$.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT.length>0?(0,qSe.appendResourcePathToUrl)((0,$$.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT,M$r):Xdo}};GSe.OTLPTraceExporter=u3t});var L$r=D(HSe=>{"use strict";Object.defineProperty(HSe,"__esModule",{value:!0});HSe.OTLPTraceExporter=void 0;var efo=P$r();Object.defineProperty(HSe,"OTLPTraceExporter",{enumerable:!0,get:function(){return efo.OTLPTraceExporter}})});var F$r=D(VSe=>{"use strict";Object.defineProperty(VSe,"__esModule",{value:!0});VSe.OTLPTraceExporter=void 0;var tfo=L$r();Object.defineProperty(VSe,"OTLPTraceExporter",{enumerable:!0,get:function(){return tfo.OTLPTraceExporter}})});var U$r=D(WSe=>{"use strict";Object.defineProperty(WSe,"__esModule",{value:!0});WSe.OTLPTraceExporter=void 0;var rfo=F$r();Object.defineProperty(WSe,"OTLPTraceExporter",{enumerable:!0,get:function(){return rfo.OTLPTraceExporter}})});var Q$r=D($Se=>{"use strict";Object.defineProperty($Se,"__esModule",{value:!0});$Se.VERSION=void 0;$Se.VERSION="0.52.1"});var V$r=D(jSe=>{"use strict";Object.defineProperty(jSe,"__esModule",{value:!0});jSe.OTLPTraceExporter=void 0;var j$=jn(),q$r=k9(),G$r=k9(),nfo=Q$r(),ifo=fk(),H$r="v1/traces",ofo=`http://localhost:4318/${H$r}`,sfo={"User-Agent":`OTel-OTLP-Exporter-JavaScript/${nfo.VERSION}`},d3t=class extends q$r.OTLPExporterNodeBase{constructor(e={}){super(e,ifo.JsonTraceSerializer,"application/json"),this.headers=Object.assign(Object.assign(Object.assign(Object.assign({},this.headers),sfo),j$.baggageUtils.parseKeyPairsIntoRecord((0,j$.getEnv)().OTEL_EXPORTER_OTLP_TRACES_HEADERS)),(0,q$r.parseHeaders)(e?.headers))}getDefaultUrl(e){return typeof e.url=="string"?e.url:(0,j$.getEnv)().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT.length>0?(0,G$r.appendRootPathToUrlIfNeeded)((0,j$.getEnv)().OTEL_EXPORTER_OTLP_TRACES_ENDPOINT):(0,j$.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT.length>0?(0,G$r.appendResourcePathToUrl)((0,j$.getEnv)().OTEL_EXPORTER_OTLP_ENDPOINT,H$r):ofo}};jSe.OTLPTraceExporter=d3t});var W$r=D(Bk=>{"use strict";var afo=Bk&&Bk.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),lfo=Bk&&Bk.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&afo(e,t,r)};Object.defineProperty(Bk,"__esModule",{value:!0});lfo(V$r(),Bk)});var $$r=D(Nk=>{"use strict";var cfo=Nk&&Nk.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ufo=Nk&&Nk.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cfo(e,t,r)};Object.defineProperty(Nk,"__esModule",{value:!0});ufo(W$r(),Nk)});var j$r=D(Ok=>{"use strict";var dfo=Ok&&Ok.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ffo=Ok&&Ok.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&dfo(e,t,r)};Object.defineProperty(Ok,"__esModule",{value:!0});ffo($$r(),Ok)});var z$r=D(YSe=>{"use strict";Object.defineProperty(YSe,"__esModule",{value:!0});YSe.prepareSend=void 0;var f3t=(Ur(),pr(Wr)),zSe=jn(),pfo=ye("http"),hfo=ye("https"),mfo=ye("url");function gfo(t,e){let r=mfo.parse(t),n=Object.assign({method:"POST",headers:Object.assign({"Content-Type":"application/json"},e)},r);return function(o,s){if(o.length===0)return f3t.diag.debug("Zipkin send with empty spans"),s({code:zSe.ExportResultCode.SUCCESS});let{request:a}=n.protocol==="http:"?pfo:hfo,c=a(n,d=>{let f="";d.on("data",p=>{f+=p}),d.on("end",()=>{let p=d.statusCode||0;return f3t.diag.debug(`Zipkin response status code: ${p}, body: ${f}`),p<400?s({code:zSe.ExportResultCode.SUCCESS}):s({code:zSe.ExportResultCode.FAILED,error:new Error(`Got unexpected status code from zipkin: ${p}`)})})});c.on("error",d=>s({code:zSe.ExportResultCode.FAILED,error:d}));let u=JSON.stringify(o);f3t.diag.debug(`Zipkin request payload: ${u}`),c.write(u,"utf8"),c.end()}}YSe.prepareSend=gfo});var Y$r=D(kk=>{"use strict";var Afo=kk&&kk.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),yfo=kk&&kk.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Afo(e,t,r)};Object.defineProperty(kk,"__esModule",{value:!0});yfo(z$r(),kk)});var p3t=D(Mk=>{"use strict";var Efo=Mk&&Mk.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),vfo=Mk&&Mk.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Efo(e,t,r)};Object.defineProperty(Mk,"__esModule",{value:!0});vfo(Y$r(),Mk)});var J$r=D(Hae=>{"use strict";Object.defineProperty(Hae,"__esModule",{value:!0});Hae.SpanKind=void 0;var Cfo;(function(t){t.CLIENT="CLIENT",t.SERVER="SERVER",t.CONSUMER="CONSUMER",t.PRODUCER="PRODUCER"})(Cfo=Hae.SpanKind||(Hae.SpanKind={}))});var Z$r=D(Wy=>{"use strict";Object.defineProperty(Wy,"__esModule",{value:!0});Wy._toZipkinAnnotations=Wy._toZipkinTags=Wy.toZipkinSpan=Wy.defaultStatusErrorTagName=Wy.defaultStatusCodeTagName=void 0;var aT=(Ur(),pr(Wr)),h3t=jn(),JSe=J$r(),bfo={[aT.SpanKind.CLIENT]:JSe.SpanKind.CLIENT,[aT.SpanKind.SERVER]:JSe.SpanKind.SERVER,[aT.SpanKind.CONSUMER]:JSe.SpanKind.CONSUMER,[aT.SpanKind.PRODUCER]:JSe.SpanKind.PRODUCER,[aT.SpanKind.INTERNAL]:void 0};Wy.defaultStatusCodeTagName="otel.status_code";Wy.defaultStatusErrorTagName="error";function xfo(t,e,r,n){return{traceId:t.spanContext().traceId,parentId:t.parentSpanId,name:t.name,id:t.spanContext().spanId,kind:bfo[t.kind],timestamp:(0,h3t.hrTimeToMicroseconds)(t.startTime),duration:Math.round((0,h3t.hrTimeToMicroseconds)(t.duration)),localEndpoint:{serviceName:e},tags:K$r(t,r,n),annotations:t.events.length?X$r(t.events):void 0}}Wy.toZipkinSpan=xfo;function K$r({attributes:t,resource:e,status:r,droppedAttributesCount:n,droppedEventsCount:i,droppedLinksCount:o},s,a){let c={};for(let u of Object.keys(t))c[u]=String(t[u]);return r.code!==aT.SpanStatusCode.UNSET&&(c[s]=String(aT.SpanStatusCode[r.code])),r.code===aT.SpanStatusCode.ERROR&&r.message&&(c[a]=r.message),n&&(c["otel.dropped_attributes_count"]=String(n)),i&&(c["otel.dropped_events_count"]=String(i)),o&&(c["otel.dropped_links_count"]=String(o)),Object.keys(e.attributes).forEach(u=>c[u]=String(e.attributes[u])),c}Wy._toZipkinTags=K$r;function X$r(t){return t.map(e=>({timestamp:Math.round((0,h3t.hrTimeToMicroseconds)(e.time)),value:e.name}))}Wy._toZipkinAnnotations=X$r});var ejr=D(KSe=>{"use strict";Object.defineProperty(KSe,"__esModule",{value:!0});KSe.prepareGetHeaders=void 0;function Sfo(t){return function(){return t()}}KSe.prepareGetHeaders=Sfo});var ijr=D(XSe=>{"use strict";Object.defineProperty(XSe,"__esModule",{value:!0});XSe.ZipkinExporter=void 0;var tjr=(Ur(),pr(Wr)),rjr=jn(),njr=p3t(),m3t=Z$r(),g3t=Zh(),wfo=ejr(),A3t=class{constructor(e={}){this.DEFAULT_SERVICE_NAME="OpenTelemetry Service",this._sendingPromises=[],this._urlStr=e.url||(0,rjr.getEnv)().OTEL_EXPORTER_ZIPKIN_ENDPOINT,this._send=(0,njr.prepareSend)(this._urlStr,e.headers),this._serviceName=e.serviceName,this._statusCodeTagName=e.statusCodeTagName||m3t.defaultStatusCodeTagName,this._statusDescriptionTagName=e.statusDescriptionTagName||m3t.defaultStatusErrorTagName,this._isShutdown=!1,typeof e.getExportRequestHeaders=="function"?this._getHeaders=(0,wfo.prepareGetHeaders)(e.getExportRequestHeaders):this._beforeSend=function(){}}export(e,r){let n=String(this._serviceName||e[0].resource.attributes[g3t.SEMRESATTRS_SERVICE_NAME]||this.DEFAULT_SERVICE_NAME);if(tjr.diag.debug("Zipkin exporter export"),this._isShutdown){setTimeout(()=>r({code:rjr.ExportResultCode.FAILED,error:new Error("Exporter has been shutdown")}));return}let i=new Promise(s=>{this._sendSpans(e,n,a=>{s(),r(a)})});this._sendingPromises.push(i);let o=()=>{let s=this._sendingPromises.indexOf(i);this._sendingPromises.splice(s,1)};i.then(o,o)}shutdown(){return tjr.diag.debug("Zipkin exporter shutdown"),this._isShutdown=!0,this.forceFlush()}forceFlush(){return new Promise((e,r)=>{Promise.all(this._sendingPromises).then(()=>{e()},r)})}_beforeSend(){this._getHeaders&&(this._send=(0,njr.prepareSend)(this._urlStr,this._getHeaders()))}_sendSpans(e,r,n){let i=e.map(o=>(0,m3t.toZipkinSpan)(o,String(o.attributes[g3t.SEMRESATTRS_SERVICE_NAME]||o.resource.attributes[g3t.SEMRESATTRS_SERVICE_NAME]||r),this._statusCodeTagName,this._statusDescriptionTagName));return this._beforeSend(),this._send(i,o=>{if(n)return n(o)})}};XSe.ZipkinExporter=A3t});var sjr=D(lT=>{"use strict";var _fo=lT&&lT.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),ojr=lT&&lT.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_fo(e,t,r)};Object.defineProperty(lT,"__esModule",{value:!0});ojr(p3t(),lT);ojr(ijr(),lT)});var ljr=D(twe=>{"use strict";var y3t;Object.defineProperty(twe,"__esModule",{value:!0});twe.TracerProviderWithEnvExporters=void 0;var z$=(Ur(),pr(Wr)),ZSe=jn(),ewe=Sk(),Tfo=kae(),ajr=U$r(),Ifo=j$r(),Dfo=n1t(),Rfo=sjr(),Vae=class extends Tfo.NodeTracerProvider{constructor(e={}){super(e),this._configuredExporters=[],this._hasSpanProcessors=!1;let r=this.filterBlanksAndNulls(Array.from(new Set((0,ZSe.getEnv)().OTEL_TRACES_EXPORTER.split(","))));r[0]==="none"?z$.diag.warn('OTEL_TRACES_EXPORTER contains "none". SDK will not be initialized.'):r.length===0?(z$.diag.warn("OTEL_TRACES_EXPORTER is empty. Using default otlp exporter."),r=["otlp"],this.createExportersFromList(r),this._spanProcessors=this.configureSpanProcessors(this._configuredExporters),this._spanProcessors.forEach(n=>{this.addSpanProcessor(n)})):(r.length>1&&r.includes("none")&&(z$.diag.warn('OTEL_TRACES_EXPORTER contains "none" along with other exporters. Using default otlp exporter.'),r=["otlp"]),this.createExportersFromList(r),this._configuredExporters.length>0?(this._spanProcessors=this.configureSpanProcessors(this._configuredExporters),this._spanProcessors.forEach(n=>{this.addSpanProcessor(n)})):z$.diag.warn("Unable to set up trace exporter(s) due to invalid exporter and/or protocol values."))}static configureOtlp(){let e=this.getOtlpProtocol();switch(e){case"grpc":return new Dfo.OTLPTraceExporter;case"http/json":return new Ifo.OTLPTraceExporter;case"http/protobuf":return new ajr.OTLPTraceExporter;default:return z$.diag.warn(`Unsupported OTLP traces protocol: ${e}. Using http/protobuf.`),new ajr.OTLPTraceExporter}}static getOtlpProtocol(){var e,r,n;let i=(0,ZSe.getEnvWithoutDefaults)();return(n=(r=(e=i.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL)!==null&&e!==void 0?e:i.OTEL_EXPORTER_OTLP_PROTOCOL)!==null&&r!==void 0?r:(0,ZSe.getEnv)().OTEL_EXPORTER_OTLP_TRACES_PROTOCOL)!==null&&n!==void 0?n:(0,ZSe.getEnv)().OTEL_EXPORTER_OTLP_PROTOCOL}static configureJaeger(){try{let{JaegerExporter:e}=ye("@opentelemetry/exporter-jaeger");return new e}catch(e){throw new Error(`Could not instantiate JaegerExporter. This could be due to the JaegerExporter's lack of support for bundling. If possible, use @opentelemetry/exporter-trace-otlp-proto instead. Original Error: ${e}`)}}addSpanProcessor(e){super.addSpanProcessor(e),this._hasSpanProcessors=!0}register(e){this._hasSpanProcessors&&super.register(e)}createExportersFromList(e){e.forEach(r=>{let n=this._getSpanExporter(r);n?this._configuredExporters.push(n):z$.diag.warn(`Unrecognized OTEL_TRACES_EXPORTER value: ${r}.`)})}configureSpanProcessors(e){return e.map(r=>r instanceof ewe.ConsoleSpanExporter?new ewe.SimpleSpanProcessor(r):new ewe.BatchSpanProcessor(r))}filterBlanksAndNulls(e){return e.map(r=>r.trim()).filter(r=>r!=="null"&&r!=="")}};twe.TracerProviderWithEnvExporters=Vae;y3t=Vae;Vae._registeredExporters=new Map([["otlp",()=>y3t.configureOtlp()],["zipkin",()=>new Rfo.ZipkinExporter],["jaeger",()=>y3t.configureJaeger()],["console",()=>new ewe.ConsoleSpanExporter]])});var cjr=D(rwe=>{"use strict";Object.defineProperty(rwe,"__esModule",{value:!0});rwe.getResourceDetectorsFromEnv=void 0;var Bfo=(Ur(),pr(Wr)),Wae=K_(),Nfo="env",Ofo="host",kfo="os",Mfo="process",Pfo="serviceinstance";function Lfo(){var t,e;let r=new Map([[Nfo,Wae.envDetectorSync],[Ofo,Wae.hostDetectorSync],[kfo,Wae.osDetectorSync],[Pfo,Wae.serviceInstanceIdDetectorSync],[Mfo,Wae.processDetectorSync]]),n=(e=(t=process.env.OTEL_NODE_RESOURCE_DETECTORS)===null||t===void 0?void 0:t.split(","))!==null&&e!==void 0?e:["all"];return n.includes("all")?[...r.values()].flat():n.includes("none")?[]:n.flatMap(i=>{let o=r.get(i);return o||Bfo.diag.error(`Invalid resource detector "${i}" specified in the environment variable OTEL_NODE_RESOURCE_DETECTORS`),o||[]})}rwe.getResourceDetectorsFromEnv=Lfo});var djr=D(nwe=>{"use strict";Object.defineProperty(nwe,"__esModule",{value:!0});nwe.NodeSDK=void 0;var $ae=(Ur(),pr(Wr)),Ffo=sW(),Ufo=c3t(),Y$=K_(),Qfo=P7e(),qfo=dk(),Gfo=Sk(),Hfo=kae(),Vfo=Zh(),Wfo=ljr(),ujr=jn(),$fo=cjr(),E3t=class{constructor(e={}){var r,n,i,o,s,a,c;let u=(0,ujr.getEnv)(),d=(0,ujr.getEnvWithoutDefaults)();u.OTEL_SDK_DISABLED&&(this._disabled=!0),d.OTEL_LOG_LEVEL&&$ae.diag.setLogger(new $ae.DiagConsoleLogger,{logLevel:d.OTEL_LOG_LEVEL}),this._configuration=e,this._resource=(r=e.resource)!==null&&r!==void 0?r:new Y$.Resource({});let f=[];if(process.env.OTEL_NODE_RESOURCE_DETECTORS!=null?f=(0,$fo.getResourceDetectorsFromEnv)():f=[Y$.envDetector,Y$.processDetector,Y$.hostDetector],this._resourceDetectors=(n=e.resourceDetectors)!==null&&n!==void 0?n:f,this._serviceName=e.serviceName,this._autoDetectResources=(i=e.autoDetectResources)!==null&&i!==void 0?i:!0,e.traceExporter||e.spanProcessor||e.spanProcessors){let p={};e.sampler&&(p.sampler=e.sampler),e.spanLimits&&(p.spanLimits=e.spanLimits),e.idGenerator&&(p.idGenerator=e.idGenerator),e.spanProcessor&&$ae.diag.warn("The 'spanProcessor' option is deprecated. Please use 'spanProcessors' instead.");let h=(o=e.spanProcessor)!==null&&o!==void 0?o:new Gfo.BatchSpanProcessor(e.traceExporter),m=(s=e.spanProcessors)!==null&&s!==void 0?s:[h];this._tracerProviderConfig={tracerConfig:p,spanProcessors:m,contextManager:e.contextManager,textMapPropagator:e.textMapPropagator}}if(e.logRecordProcessor&&(this._loggerProviderConfig={logRecordProcessor:e.logRecordProcessor}),e.metricReader||e.views){let p={};e.metricReader&&(p.reader=e.metricReader),e.views&&(p.views=e.views),this._meterProviderConfig=p}this._instrumentations=(c=(a=e.instrumentations)===null||a===void 0?void 0:a.flat())!==null&&c!==void 0?c:[]}start(){var e,r,n,i,o,s;if(this._disabled)return;if((0,Ufo.registerInstrumentations)({instrumentations:this._instrumentations}),this._autoDetectResources){let u={detectors:this._resourceDetectors};this._resource=this._resource.merge((0,Y$.detectResourcesSync)(u))}this._resource=this._serviceName===void 0?this._resource:this._resource.merge(new Y$.Resource({[Vfo.SEMRESATTRS_SERVICE_NAME]:this._serviceName}));let a=this._tracerProviderConfig?Hfo.NodeTracerProvider:Wfo.TracerProviderWithEnvExporters,c=new a(Object.assign(Object.assign({},this._configuration),{resource:this._resource}));if(this._tracerProvider=c,this._tracerProviderConfig)for(let u of this._tracerProviderConfig.spanProcessors)c.addSpanProcessor(u);if(c.register({contextManager:(r=(e=this._tracerProviderConfig)===null||e===void 0?void 0:e.contextManager)!==null&&r!==void 0?r:(n=this._configuration)===null||n===void 0?void 0:n.contextManager,propagator:(i=this._tracerProviderConfig)===null||i===void 0?void 0:i.textMapPropagator}),this._loggerProviderConfig){let u=new Qfo.LoggerProvider({resource:this._resource});u.addLogRecordProcessor(this._loggerProviderConfig.logRecordProcessor),this._loggerProvider=u,Ffo.logs.setGlobalLoggerProvider(u)}if(this._meterProviderConfig){let u=[];this._meterProviderConfig.reader&&u.push(this._meterProviderConfig.reader);let d=new qfo.MeterProvider({resource:this._resource,views:(s=(o=this._meterProviderConfig)===null||o===void 0?void 0:o.views)!==null&&s!==void 0?s:[],readers:u});this._meterProvider=d,$ae.metrics.setGlobalMeterProvider(d);for(let f of this._instrumentations)f.setMeterProvider($ae.metrics.getMeterProvider())}}shutdown(){let e=[];return this._tracerProvider&&e.push(this._tracerProvider.shutdown()),this._loggerProvider&&e.push(this._loggerProvider.shutdown()),this._meterProvider&&e.push(this._meterProvider.shutdown()),Promise.all(e).then(()=>{})}};nwe.NodeSDK=E3t});var pjr=D(fjr=>{"use strict";Object.defineProperty(fjr,"__esModule",{value:!0})});var mjr=D(Au=>{"use strict";var jfo=Au&&Au.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),hjr=Au&&Au.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&jfo(e,t,r)};Object.defineProperty(Au,"__esModule",{value:!0});Au.tracing=Au.resources=Au.node=Au.metrics=Au.logs=Au.core=Au.contextBase=Au.api=void 0;Au.api=(Ur(),pr(Wr));Au.contextBase=(Ur(),pr(Wr));Au.core=jn();Au.logs=P7e();Au.metrics=dk();Au.node=kae();Au.resources=K_();Au.tracing=Sk();hjr(djr(),Au);hjr(pjr(),Au)});var gjr=D(jae=>{"use strict";Object.defineProperty(jae,"__esModule",{value:!0});jae.AttributeNames=void 0;var zfo;(function(t){t.HTTP_ERROR_NAME="http.error_name",t.HTTP_ERROR_MESSAGE="http.error_message",t.HTTP_STATUS_TEXT="http.status_text"})(zfo=jae.AttributeNames||(jae.AttributeNames={}))});var v3t=D(xi=>{"use strict";Object.defineProperty(xi,"__esModule",{value:!0});xi.headerCapture=xi.getIncomingRequestMetricAttributesOnResponse=xi.getIncomingRequestAttributesOnResponse=xi.getIncomingRequestMetricAttributes=xi.getIncomingRequestAttributes=xi.getOutgoingRequestMetricAttributesOnResponse=xi.getOutgoingRequestAttributesOnResponse=xi.setAttributesFromHttpKind=xi.getOutgoingRequestMetricAttributes=xi.getOutgoingRequestAttributes=xi.extractHostnameAndPort=xi.isValidOptionsType=xi.getRequestInfo=xi.isCompressed=xi.setResponseContentLengthAttribute=xi.setRequestContentLengthAttribute=xi.setSpanWithError=xi.isIgnored=xi.satisfiesPattern=xi.parseResponseStatus=xi.getAbsoluteUrl=void 0;var zae=(Ur(),pr(Wr)),zn=Zh(),Ajr=jn(),iwe=ye("url"),owe=gjr(),Yfo=(t,e,r="http:")=>{let n=t||{},i=n.protocol||r,o=(n.port||"").toString(),s=n.path||"/",a=n.host||n.hostname||e.host||"localhost";return a.indexOf(":")===-1&&o&&o!=="80"&&o!=="443"&&(a+=`:${o}`),`${i}//${a}${s}`};xi.getAbsoluteUrl=Yfo;var Jfo=(t,e)=>{let r=t===zae.SpanKind.CLIENT?400:500;return e&&e>=100&&e<r?zae.SpanStatusCode.UNSET:zae.SpanStatusCode.ERROR};xi.parseResponseStatus=Jfo;var Kfo=(t,e)=>{if(typeof e=="string")return e===t;if(e instanceof RegExp)return e.test(t);if(typeof e=="function")return e(t);throw new TypeError("Pattern is in unsupported datatype")};xi.satisfiesPattern=Kfo;var Xfo=(t,e,r)=>{if(!e)return!1;try{for(let n of e)if((0,xi.satisfiesPattern)(t,n))return!0}catch(n){r&&r(n)}return!1};xi.isIgnored=Xfo;var Zfo=(t,e)=>{let r=e.message;t.setAttribute(owe.AttributeNames.HTTP_ERROR_NAME,e.name),t.setAttribute(owe.AttributeNames.HTTP_ERROR_MESSAGE,r),t.setStatus({code:zae.SpanStatusCode.ERROR,message:r}),t.recordException(e)};xi.setSpanWithError=Zfo;var epo=(t,e)=>{let r=yjr(t.headers);r!==null&&((0,xi.isCompressed)(t.headers)?e[zn.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH]=r:e[zn.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED]=r)};xi.setRequestContentLengthAttribute=epo;var tpo=(t,e)=>{let r=yjr(t.headers);r!==null&&((0,xi.isCompressed)(t.headers)?e[zn.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH]=r:e[zn.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED]=r)};xi.setResponseContentLengthAttribute=tpo;function yjr(t){let e=t["content-length"];if(e===void 0)return null;let r=parseInt(e,10);return isNaN(r)?null:r}var rpo=t=>{let e=t["content-encoding"];return!!e&&e!=="identity"};xi.isCompressed=rpo;var npo=(t,e)=>{let r="/",n="",i;if(typeof t=="string")i=iwe.parse(t),r=i.pathname||"/",n=`${i.protocol||"http:"}//${i.host}`,e!==void 0&&Object.assign(i,e);else if(t instanceof iwe.URL)i={protocol:t.protocol,hostname:typeof t.hostname=="string"&&t.hostname.startsWith("[")?t.hostname.slice(1,-1):t.hostname,path:`${t.pathname||""}${t.search||""}`},t.port!==""&&(i.port=Number(t.port)),(t.username||t.password)&&(i.auth=`${t.username}:${t.password}`),r=t.pathname,n=t.origin,e!==void 0&&Object.assign(i,e);else{i=Object.assign({protocol:t.host?"http:":void 0},t),r=t.pathname,!r&&i.path&&(r=iwe.parse(i.path).pathname||"/");let s=i.host||(i.port!=null?`${i.hostname}${i.port}`:i.hostname);n=`${i.protocol||"http:"}//${s}`}let o=i.method?i.method.toUpperCase():"GET";return{origin:n,pathname:r,method:o,optionsParsed:i}};xi.getRequestInfo=npo;var ipo=t=>{if(!t)return!1;let e=typeof t;return e==="string"||e==="object"&&!Array.isArray(t)};xi.isValidOptionsType=ipo;var opo=t=>{var e;if(t.hostname&&t.port)return{hostname:t.hostname,port:t.port};let r=((e=t.host)===null||e===void 0?void 0:e.match(/^([^:/ ]+)(:\d{1,5})?/))||null,n=t.hostname||(r===null?"localhost":r[1]),i=t.port;return i||(r&&r[2]?i=r[2].substring(1):i=t.protocol==="https:"?"443":"80"),{hostname:n,port:i}};xi.extractHostnameAndPort=opo;var spo=(t,e)=>{var r;let n=e.hostname,i=e.port,o=t.method,s=o?o.toUpperCase():"GET",a=t.headers||{},c=a["user-agent"],u={[zn.SEMATTRS_HTTP_URL]:(0,xi.getAbsoluteUrl)(t,a,`${e.component}:`),[zn.SEMATTRS_HTTP_METHOD]:s,[zn.SEMATTRS_HTTP_TARGET]:t.path||"/",[zn.SEMATTRS_NET_PEER_NAME]:n,[zn.SEMATTRS_HTTP_HOST]:(r=a.host)!==null&&r!==void 0?r:`${n}:${i}`};return c!==void 0&&(u[zn.SEMATTRS_HTTP_USER_AGENT]=c),Object.assign(u,e.hookAttributes)};xi.getOutgoingRequestAttributes=spo;var apo=t=>{let e={};return e[zn.SEMATTRS_HTTP_METHOD]=t[zn.SEMATTRS_HTTP_METHOD],e[zn.SEMATTRS_NET_PEER_NAME]=t[zn.SEMATTRS_NET_PEER_NAME],e};xi.getOutgoingRequestMetricAttributes=apo;var lpo=(t,e)=>{t&&(e[zn.SEMATTRS_HTTP_FLAVOR]=t,t.toUpperCase()!=="QUIC"?e[zn.SEMATTRS_NET_TRANSPORT]=zn.NETTRANSPORTVALUES_IP_TCP:e[zn.SEMATTRS_NET_TRANSPORT]=zn.NETTRANSPORTVALUES_IP_UDP)};xi.setAttributesFromHttpKind=lpo;var cpo=t=>{let{statusCode:e,statusMessage:r,httpVersion:n,socket:i}=t,o={};if(i){let{remoteAddress:s,remotePort:a}=i;o[zn.SEMATTRS_NET_PEER_IP]=s,o[zn.SEMATTRS_NET_PEER_PORT]=a}return(0,xi.setResponseContentLengthAttribute)(t,o),e&&(o[zn.SEMATTRS_HTTP_STATUS_CODE]=e,o[owe.AttributeNames.HTTP_STATUS_TEXT]=(r||"").toUpperCase()),(0,xi.setAttributesFromHttpKind)(n,o),o};xi.getOutgoingRequestAttributesOnResponse=cpo;var upo=t=>{let e={};return e[zn.SEMATTRS_NET_PEER_PORT]=t[zn.SEMATTRS_NET_PEER_PORT],e[zn.SEMATTRS_HTTP_STATUS_CODE]=t[zn.SEMATTRS_HTTP_STATUS_CODE],e[zn.SEMATTRS_HTTP_FLAVOR]=t[zn.SEMATTRS_HTTP_FLAVOR],e};xi.getOutgoingRequestMetricAttributesOnResponse=upo;var dpo=(t,e)=>{let r=t.headers,n=r["user-agent"],i=r["x-forwarded-for"],o=t.method||"GET",s=t.httpVersion,a=t.url?iwe.parse(t.url):null,c=a?.host||r.host,u=a?.hostname||c?.replace(/^(.*)(:[0-9]{1,5})/,"$1")||"localhost",d=e.serverName,f={[zn.SEMATTRS_HTTP_URL]:(0,xi.getAbsoluteUrl)(a,r,`${e.component}:`),[zn.SEMATTRS_HTTP_HOST]:c,[zn.SEMATTRS_NET_HOST_NAME]:u,[zn.SEMATTRS_HTTP_METHOD]:o,[zn.SEMATTRS_HTTP_SCHEME]:e.component};return typeof i=="string"&&(f[zn.SEMATTRS_HTTP_CLIENT_IP]=i.split(",")[0]),typeof d=="string"&&(f[zn.SEMATTRS_HTTP_SERVER_NAME]=d),a&&(f[zn.SEMATTRS_HTTP_TARGET]=a.path||"/"),n!==void 0&&(f[zn.SEMATTRS_HTTP_USER_AGENT]=n),(0,xi.setRequestContentLengthAttribute)(t,f),(0,xi.setAttributesFromHttpKind)(s,f),Object.assign(f,e.hookAttributes)};xi.getIncomingRequestAttributes=dpo;var fpo=t=>{let e={};return e[zn.SEMATTRS_HTTP_SCHEME]=t[zn.SEMATTRS_HTTP_SCHEME],e[zn.SEMATTRS_HTTP_METHOD]=t[zn.SEMATTRS_HTTP_METHOD],e[zn.SEMATTRS_NET_HOST_NAME]=t[zn.SEMATTRS_NET_HOST_NAME],e[zn.SEMATTRS_HTTP_FLAVOR]=t[zn.SEMATTRS_HTTP_FLAVOR],e};xi.getIncomingRequestMetricAttributes=fpo;var ppo=(t,e)=>{let{socket:r}=t,{statusCode:n,statusMessage:i}=e,o=(0,Ajr.getRPCMetadata)(zae.context.active()),s={};if(r){let{localAddress:a,localPort:c,remoteAddress:u,remotePort:d}=r;s[zn.SEMATTRS_NET_HOST_IP]=a,s[zn.SEMATTRS_NET_HOST_PORT]=c,s[zn.SEMATTRS_NET_PEER_IP]=u,s[zn.SEMATTRS_NET_PEER_PORT]=d}return s[zn.SEMATTRS_HTTP_STATUS_CODE]=n,s[owe.AttributeNames.HTTP_STATUS_TEXT]=(i||"").toUpperCase(),o?.type===Ajr.RPCType.HTTP&&o.route!==void 0&&(s[zn.SEMATTRS_HTTP_ROUTE]=o.route),s};xi.getIncomingRequestAttributesOnResponse=ppo;var hpo=t=>{let e={};return e[zn.SEMATTRS_HTTP_STATUS_CODE]=t[zn.SEMATTRS_HTTP_STATUS_CODE],e[zn.SEMATTRS_NET_HOST_PORT]=t[zn.SEMATTRS_NET_HOST_PORT],t[zn.SEMATTRS_HTTP_ROUTE]!==void 0&&(e[zn.SEMATTRS_HTTP_ROUTE]=t[zn.SEMATTRS_HTTP_ROUTE]),e};xi.getIncomingRequestMetricAttributesOnResponse=hpo;function mpo(t,e){let r=new Map;for(let n=0,i=e.length;n<i;n++){let o=e[n].toLowerCase();r.set(o,o.replace(/-/g,"_"))}return(n,i)=>{for(let o of r.keys()){let s=i(o);if(s===void 0)continue;let a=r.get(o),c=`http.${t}.header.${a}`;typeof s=="string"?n.setAttribute(c,[s]):Array.isArray(s)?n.setAttribute(c,s):n.setAttribute(c,[s])}}}xi.headerCapture=mpo});var Ejr=D(swe=>{"use strict";Object.defineProperty(swe,"__esModule",{value:!0});swe.VERSION=void 0;swe.VERSION="0.52.1"});var xjr=D(awe=>{"use strict";Object.defineProperty(awe,"__esModule",{value:!0});awe.HttpInstrumentation=void 0;var mo=(Ur(),pr(Wr)),J$=jn(),vjr=F$(),Cjr=ye("url"),yu=v3t(),gpo=Ejr(),$y=c3t(),bjr=jn(),C3t=ye("events"),Apo=Zh(),b3t=class extends $y.InstrumentationBase{constructor(e={}){super("@opentelemetry/instrumentation-http",gpo.VERSION,e),this._spanNotEnded=new WeakSet,this._headerCapture=this._createHeaderCapture()}_updateMetricInstruments(){this._httpServerDurationHistogram=this.meter.createHistogram("http.server.duration",{description:"Measures the duration of inbound HTTP requests.",unit:"ms",valueType:mo.ValueType.DOUBLE}),this._httpClientDurationHistogram=this.meter.createHistogram("http.client.duration",{description:"Measures the duration of outbound HTTP requests.",unit:"ms",valueType:mo.ValueType.DOUBLE})}setConfig(e={}){super.setConfig(e),this._headerCapture=this._createHeaderCapture()}init(){return[this._getHttpsInstrumentation(),this._getHttpInstrumentation()]}_getHttpInstrumentation(){return new $y.InstrumentationNodeModuleDefinition("http",["*"],e=>(this._wrap(e,"request",this._getPatchOutgoingRequestFunction("http")),this._wrap(e,"get",this._getPatchOutgoingGetFunction(e.request)),this._wrap(e.Server.prototype,"emit",this._getPatchIncomingRequestFunction("http")),e),e=>{e!==void 0&&(this._unwrap(e,"request"),this._unwrap(e,"get"),this._unwrap(e.Server.prototype,"emit"))})}_getHttpsInstrumentation(){return new $y.InstrumentationNodeModuleDefinition("https",["*"],e=>(this._wrap(e,"request",this._getPatchHttpsOutgoingRequestFunction("https")),this._wrap(e,"get",this._getPatchHttpsOutgoingGetFunction(e.request)),this._wrap(e.Server.prototype,"emit",this._getPatchIncomingRequestFunction("https")),e),e=>{e!==void 0&&(this._unwrap(e,"request"),this._unwrap(e,"get"),this._unwrap(e.Server.prototype,"emit"))})}_getPatchIncomingRequestFunction(e){return r=>this._incomingRequestFunction(e,r)}_getPatchOutgoingRequestFunction(e){return r=>this._outgoingRequestFunction(e,r)}_getPatchOutgoingGetFunction(e){return r=>function(i,...o){let s=e(i,...o);return s.end(),s}}_getPatchHttpsOutgoingRequestFunction(e){return r=>{let n=this;return function(o,...s){var a;return e==="https"&&typeof o=="object"&&((a=o?.constructor)===null||a===void 0?void 0:a.name)!=="URL"&&(o=Object.assign({},o),n._setDefaultOptions(o)),n._getPatchOutgoingRequestFunction(e)(r)(o,...s)}}}_setDefaultOptions(e){e.protocol=e.protocol||"https:",e.port=e.port||443}_getPatchHttpsOutgoingGetFunction(e){return r=>{let n=this;return function(o,...s){return n._getPatchOutgoingGetFunction(e)(r)(o,...s)}}}_traceClientRequest(e,r,n,i){this.getConfig().requestHook&&this._callRequestHook(r,e);let o=!1;return e.prependListener("response",s=>{this._diag.debug("outgoingRequest on response()"),e.listenerCount("response")<=1&&s.resume();let a=yu.getOutgoingRequestAttributesOnResponse(s);r.setAttributes(a),i=Object.assign(i,yu.getOutgoingRequestMetricAttributesOnResponse(a)),this.getConfig().responseHook&&this._callResponseHook(r,s),this._headerCapture.client.captureRequestHeaders(r,u=>e.getHeader(u)),this._headerCapture.client.captureResponseHeaders(r,u=>s.headers[u]),mo.context.bind(mo.context.active(),s);let c=()=>{if(this._diag.debug("outgoingRequest on end()"),o)return;o=!0;let u;s.aborted&&!s.complete?u={code:mo.SpanStatusCode.ERROR}:u={code:yu.parseResponseStatus(mo.SpanKind.CLIENT,s.statusCode)},r.setStatus(u),this.getConfig().applyCustomAttributesOnSpan&&(0,$y.safeExecuteInTheMiddle)(()=>this.getConfig().applyCustomAttributesOnSpan(r,e,s),()=>{},!0),this._closeHttpSpan(r,mo.SpanKind.CLIENT,n,i)};s.on("end",c),vjr.lt(process.version,"16.0.0")&&s.on("close",c),s.on(C3t.errorMonitor,u=>{this._diag.debug("outgoingRequest on error()",u),!o&&(o=!0,yu.setSpanWithError(r,u),r.setStatus({code:mo.SpanStatusCode.ERROR,message:u.message}),this._closeHttpSpan(r,mo.SpanKind.CLIENT,n,i))})}),e.on("close",()=>{this._diag.debug("outgoingRequest on request close()"),!(e.aborted||o)&&(o=!0,this._closeHttpSpan(r,mo.SpanKind.CLIENT,n,i))}),e.on(C3t.errorMonitor,s=>{this._diag.debug("outgoingRequest on request error()",s),!o&&(o=!0,yu.setSpanWithError(r,s),this._closeHttpSpan(r,mo.SpanKind.CLIENT,n,i))}),this._diag.debug("http.ClientRequest return request"),e}_incomingRequestFunction(e,r){let n=this;return function(o,...s){if(o!=="request")return r.apply(this,[o,...s]);let a=s[0],c=s[1],u=a.url&&Cjr.parse(a.url).pathname||"/",d=a.method||"GET";if(n._diag.debug(`${e} instrumentation incomingRequest`),yu.isIgnored(u,n.getConfig().ignoreIncomingPaths,C=>n._diag.error("caught ignoreIncomingPaths error: ",C))||(0,$y.safeExecuteInTheMiddle)(()=>{var C,x;return(x=(C=n.getConfig()).ignoreIncomingRequestHook)===null||x===void 0?void 0:x.call(C,a)},C=>{C!=null&&n._diag.error("caught ignoreIncomingRequestHook error: ",C)},!0))return mo.context.with((0,J$.suppressTracing)(mo.context.active()),()=>(mo.context.bind(mo.context.active(),a),mo.context.bind(mo.context.active(),c),r.apply(this,[o,...s])));let f=a.headers,p=yu.getIncomingRequestAttributes(a,{component:e,serverName:n.getConfig().serverName,hookAttributes:n._callStartSpanHook(a,n.getConfig().startIncomingSpanHook)}),h={kind:mo.SpanKind.SERVER,attributes:p},m=(0,J$.hrTime)(),g=yu.getIncomingRequestMetricAttributes(p),A=mo.propagation.extract(mo.ROOT_CONTEXT,f),y=n._startHttpSpan(d,h,A),E={type:bjr.RPCType.HTTP,span:y};return mo.context.with((0,bjr.setRPCMetadata)(mo.trace.setSpan(A,y),E),()=>{mo.context.bind(mo.context.active(),a),mo.context.bind(mo.context.active(),c),n.getConfig().requestHook&&n._callRequestHook(y,a),n.getConfig().responseHook&&n._callResponseHook(y,c),n._headerCapture.server.captureRequestHeaders(y,x=>a.headers[x]);let C=!1;return c.on("close",()=>{C||n._onServerResponseFinish(a,c,y,g,m)}),c.on(C3t.errorMonitor,x=>{C=!0,n._onServerResponseError(y,g,m,x)}),(0,$y.safeExecuteInTheMiddle)(()=>r.apply(this,[o,...s]),x=>{if(x)throw yu.setSpanWithError(y,x),n._closeHttpSpan(y,mo.SpanKind.SERVER,m,g),x})})}}_outgoingRequestFunction(e,r){let n=this;return function(o,...s){if(!yu.isValidOptionsType(o))return r.apply(this,[o,...s]);let a=typeof s[0]=="object"&&(typeof o=="string"||o instanceof Cjr.URL)?s.shift():void 0,{origin:c,pathname:u,method:d,optionsParsed:f}=yu.getRequestInfo(o,a);if(e==="http"&&vjr.lt(process.version,"9.0.0")&&f.protocol==="https:")return r.apply(this,[f,...s]);if(yu.isIgnored(c+u,n.getConfig().ignoreOutgoingUrls,w=>n._diag.error("caught ignoreOutgoingUrls error: ",w))||(0,$y.safeExecuteInTheMiddle)(()=>{var w,O;return(O=(w=n.getConfig()).ignoreOutgoingRequestHook)===null||O===void 0?void 0:O.call(w,f)},w=>{w!=null&&n._diag.error("caught ignoreOutgoingRequestHook error: ",w)},!0))return r.apply(this,[f,...s]);let{hostname:p,port:h}=yu.extractHostnameAndPort(f),m=yu.getOutgoingRequestAttributes(f,{component:e,port:h,hostname:p,hookAttributes:n._callStartSpanHook(f,n.getConfig().startOutgoingSpanHook)}),g=(0,J$.hrTime)(),A=yu.getOutgoingRequestMetricAttributes(m),y={kind:mo.SpanKind.CLIENT,attributes:m},E=n._startHttpSpan(d,y),C=mo.context.active(),x=mo.trace.setSpan(C,E);return f.headers?f.headers=Object.assign({},f.headers):f.headers={},mo.propagation.inject(x,f.headers),mo.context.with(x,()=>{let w=s[s.length-1];typeof w=="function"&&(s[s.length-1]=mo.context.bind(C,w));let O=(0,$y.safeExecuteInTheMiddle)(()=>r.apply(this,[f,...s]),N=>{if(N)throw yu.setSpanWithError(E,N),n._closeHttpSpan(E,mo.SpanKind.CLIENT,g,A),N});return n._diag.debug(`${e} instrumentation outgoingRequest`),mo.context.bind(C,O),n._traceClientRequest(O,E,g,A)})}}_onServerResponseFinish(e,r,n,i,o){let s=yu.getIncomingRequestAttributesOnResponse(e,r);i=Object.assign(i,yu.getIncomingRequestMetricAttributesOnResponse(s)),this._headerCapture.server.captureResponseHeaders(n,c=>r.getHeader(c)),n.setAttributes(s).setStatus({code:yu.parseResponseStatus(mo.SpanKind.SERVER,r.statusCode)});let a=s[Apo.SEMATTRS_HTTP_ROUTE];a&&n.updateName(`${e.method||"GET"} ${a}`),this.getConfig().applyCustomAttributesOnSpan&&(0,$y.safeExecuteInTheMiddle)(()=>this.getConfig().applyCustomAttributesOnSpan(n,e,r),()=>{},!0),this._closeHttpSpan(n,mo.SpanKind.SERVER,o,i)}_onServerResponseError(e,r,n,i){yu.setSpanWithError(e,i),this._closeHttpSpan(e,mo.SpanKind.SERVER,n,r)}_startHttpSpan(e,r,n=mo.context.active()){let i=r.kind===mo.SpanKind.CLIENT?this.getConfig().requireParentforOutgoingSpans:this.getConfig().requireParentforIncomingSpans,o,s=mo.trace.getSpan(n);return i===!0&&s===void 0?o=mo.trace.wrapSpanContext(mo.INVALID_SPAN_CONTEXT):i===!0&&s?.spanContext().isRemote?o=s:o=this.tracer.startSpan(e,r,n),this._spanNotEnded.add(o),o}_closeHttpSpan(e,r,n,i){if(!this._spanNotEnded.has(e))return;e.end(),this._spanNotEnded.delete(e);let o=(0,J$.hrTimeToMilliseconds)((0,J$.hrTimeDuration)(n,(0,J$.hrTime)()));r===mo.SpanKind.SERVER?this._httpServerDurationHistogram.record(o,i):r===mo.SpanKind.CLIENT&&this._httpClientDurationHistogram.record(o,i)}_callResponseHook(e,r){(0,$y.safeExecuteInTheMiddle)(()=>this.getConfig().responseHook(e,r),()=>{},!0)}_callRequestHook(e,r){(0,$y.safeExecuteInTheMiddle)(()=>this.getConfig().requestHook(e,r),()=>{},!0)}_callStartSpanHook(e,r){if(typeof r=="function")return(0,$y.safeExecuteInTheMiddle)(()=>r(e),()=>{},!0)}_createHeaderCapture(){var e,r,n,i,o,s,a,c,u,d,f,p;let h=this.getConfig();return{client:{captureRequestHeaders:yu.headerCapture("request",(n=(r=(e=h.headersToSpanAttributes)===null||e===void 0?void 0:e.client)===null||r===void 0?void 0:r.requestHeaders)!==null&&n!==void 0?n:[]),captureResponseHeaders:yu.headerCapture("response",(s=(o=(i=h.headersToSpanAttributes)===null||i===void 0?void 0:i.client)===null||o===void 0?void 0:o.responseHeaders)!==null&&s!==void 0?s:[])},server:{captureRequestHeaders:yu.headerCapture("request",(u=(c=(a=h.headersToSpanAttributes)===null||a===void 0?void 0:a.server)===null||c===void 0?void 0:c.requestHeaders)!==null&&u!==void 0?u:[]),captureResponseHeaders:yu.headerCapture("response",(p=(f=(d=h.headersToSpanAttributes)===null||d===void 0?void 0:d.server)===null||f===void 0?void 0:f.responseHeaders)!==null&&p!==void 0?p:[])}}}};awe.HttpInstrumentation=b3t});var wjr=D(Sjr=>{"use strict";Object.defineProperty(Sjr,"__esModule",{value:!0})});var _jr=D(J9=>{"use strict";var ypo=J9&&J9.__createBinding||(Object.create?(function(t,e,r,n){n===void 0&&(n=r),Object.defineProperty(t,n,{enumerable:!0,get:function(){return e[r]}})}):(function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]})),x3t=J9&&J9.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ypo(e,t,r)};Object.defineProperty(J9,"__esModule",{value:!0});x3t(xjr(),J9);x3t(wjr(),J9);x3t(v3t(),J9)});var Mn,Tjr=ae(()=>{"use strict";(function(t){t[t.IFLOW_CLI_KEY_UNKNOWN=0]="IFLOW_CLI_KEY_UNKNOWN",t[t.IFLOW_CLI_START_SESSION_MODEL=1]="IFLOW_CLI_START_SESSION_MODEL",t[t.IFLOW_CLI_START_SESSION_EMBEDDING_MODEL=2]="IFLOW_CLI_START_SESSION_EMBEDDING_MODEL",t[t.IFLOW_CLI_START_SESSION_SANDBOX=3]="IFLOW_CLI_START_SESSION_SANDBOX",t[t.IFLOW_CLI_START_SESSION_CORE_TOOLS=4]="IFLOW_CLI_START_SESSION_CORE_TOOLS",t[t.IFLOW_CLI_START_SESSION_APPROVAL_MODE=5]="IFLOW_CLI_START_SESSION_APPROVAL_MODE",t[t.IFLOW_CLI_START_SESSION_API_KEY_ENABLED=6]="IFLOW_CLI_START_SESSION_API_KEY_ENABLED",t[t.IFLOW_CLI_START_SESSION_VERTEX_API_ENABLED=7]="IFLOW_CLI_START_SESSION_VERTEX_API_ENABLED",t[t.IFLOW_CLI_START_SESSION_DEBUG_MODE_ENABLED=8]="IFLOW_CLI_START_SESSION_DEBUG_MODE_ENABLED",t[t.IFLOW_CLI_START_SESSION_MCP_SERVERS=9]="IFLOW_CLI_START_SESSION_MCP_SERVERS",t[t.IFLOW_CLI_START_SESSION_TELEMETRY_ENABLED=10]="IFLOW_CLI_START_SESSION_TELEMETRY_ENABLED",t[t.IFLOW_CLI_START_SESSION_TELEMETRY_LOG_USER_PROMPTS_ENABLED=11]="IFLOW_CLI_START_SESSION_TELEMETRY_LOG_USER_PROMPTS_ENABLED",t[t.IFLOW_CLI_START_SESSION_RESPECT_GITIGNORE=12]="IFLOW_CLI_START_SESSION_RESPECT_GITIGNORE",t[t.IFLOW_CLI_USER_PROMPT_LENGTH=13]="IFLOW_CLI_USER_PROMPT_LENGTH",t[t.IFLOW_CLI_TOOL_CALL_NAME=14]="IFLOW_CLI_TOOL_CALL_NAME",t[t.IFLOW_CLI_TOOL_CALL_DECISION=15]="IFLOW_CLI_TOOL_CALL_DECISION",t[t.IFLOW_CLI_TOOL_CALL_SUCCESS=16]="IFLOW_CLI_TOOL_CALL_SUCCESS",t[t.IFLOW_CLI_TOOL_CALL_DURATION_MS=17]="IFLOW_CLI_TOOL_CALL_DURATION_MS",t[t.IFLOW_CLI_TOOL_ERROR_MESSAGE=18]="IFLOW_CLI_TOOL_ERROR_MESSAGE",t[t.IFLOW_CLI_TOOL_CALL_ERROR_TYPE=19]="IFLOW_CLI_TOOL_CALL_ERROR_TYPE",t[t.IFLOW_CLI_API_REQUEST_MODEL=20]="IFLOW_CLI_API_REQUEST_MODEL",t[t.IFLOW_CLI_API_RESPONSE_MODEL=21]="IFLOW_CLI_API_RESPONSE_MODEL",t[t.IFLOW_CLI_API_RESPONSE_STATUS_CODE=22]="IFLOW_CLI_API_RESPONSE_STATUS_CODE",t[t.IFLOW_CLI_API_RESPONSE_DURATION_MS=23]="IFLOW_CLI_API_RESPONSE_DURATION_MS",t[t.IFLOW_CLI_API_ERROR_MESSAGE=24]="IFLOW_CLI_API_ERROR_MESSAGE",t[t.IFLOW_CLI_API_RESPONSE_INPUT_TOKEN_COUNT=25]="IFLOW_CLI_API_RESPONSE_INPUT_TOKEN_COUNT",t[t.IFLOW_CLI_API_RESPONSE_OUTPUT_TOKEN_COUNT=26]="IFLOW_CLI_API_RESPONSE_OUTPUT_TOKEN_COUNT",t[t.IFLOW_CLI_API_RESPONSE_CACHED_TOKEN_COUNT=27]="IFLOW_CLI_API_RESPONSE_CACHED_TOKEN_COUNT",t[t.IFLOW_CLI_API_RESPONSE_THINKING_TOKEN_COUNT=28]="IFLOW_CLI_API_RESPONSE_THINKING_TOKEN_COUNT",t[t.IFLOW_CLI_API_RESPONSE_TOOL_TOKEN_COUNT=29]="IFLOW_CLI_API_RESPONSE_TOOL_TOKEN_COUNT",t[t.IFLOW_CLI_API_ERROR_MODEL=30]="IFLOW_CLI_API_ERROR_MODEL",t[t.IFLOW_CLI_API_ERROR_TYPE=31]="IFLOW_CLI_API_ERROR_TYPE",t[t.IFLOW_CLI_API_ERROR_STATUS_CODE=32]="IFLOW_CLI_API_ERROR_STATUS_CODE",t[t.IFLOW_CLI_API_ERROR_DURATION_MS=33]="IFLOW_CLI_API_ERROR_DURATION_MS",t[t.IFLOW_CLI_END_SESSION_ID=34]="IFLOW_CLI_END_SESSION_ID",t[t.IFLOW_CLI_PROMPT_ID=35]="IFLOW_CLI_PROMPT_ID",t[t.IFLOW_CLI_AUTH_TYPE=36]="IFLOW_CLI_AUTH_TYPE",t[t.IFLOW_CLI_GOOGLE_ACCOUNTS_COUNT=37]="IFLOW_CLI_GOOGLE_ACCOUNTS_COUNT",t[t.IFLOW_CLI_SURFACE=39]="IFLOW_CLI_SURFACE",t[t.IFLOW_CLI_SESSION_ID=40]="IFLOW_CLI_SESSION_ID",t[t.IFLOW_CLI_LOOP_DETECTED_TYPE=38]="IFLOW_CLI_LOOP_DETECTED_TYPE",t[t.IFLOW_CLI_SLASH_COMMAND_NAME=41]="IFLOW_CLI_SLASH_COMMAND_NAME",t[t.IFLOW_CLI_SLASH_COMMAND_SUBCOMMAND=42]="IFLOW_CLI_SLASH_COMMAND_SUBCOMMAND",t[t.IFLOW_CLI_RESPONSE_FINISH_REASON=43]="IFLOW_CLI_RESPONSE_FINISH_REASON",t[t.IFLOW_CLI_NEXT_SPEAKER_CHECK_RESULT=44]="IFLOW_CLI_NEXT_SPEAKER_CHECK_RESULT",t[t.IFLOW_CLI_MALFORMED_JSON_RESPONSE_MODEL=45]="IFLOW_CLI_MALFORMED_JSON_RESPONSE_MODEL"})(Mn||(Mn={}))});import Epo from"node:path";import{promises as V7s,existsSync as Ijr,readFileSync as Djr}from"node:fs";import*as Rjr from"os";function Bjr(){return Epo.join(Rjr.homedir(),Tp,ALe)}function Njr(){try{let t=Bjr();if(Ijr(t)){let e=Djr(t,"utf-8").trim();return e?JSON.parse(e).active:null}return null}catch(t){return console.debug("Error reading cached Google Account:",t),null}}function Ojr(){try{let t=Bjr();if(!Ijr(t))return 0;let e=Djr(t,"utf-8").trim();if(!e)return 0;let r=JSON.parse(e),n=r.old.length;return r.active&&n++,n}catch(t){return console.debug("Error reading lifetime Google Accounts:",t),0}}var kjr=ae(()=>{"use strict";Ou();});var Mjr,vpo,Cpo,bpo,xpo,Spo,wpo,_po,Tpo,Ipo,Dpo,Rpo,Bpo,rp,Yae=ae(()=>{"use strict";Mjr=Fe(hke(),1);A_();Tjr();C0e();kjr();CLe();vpo="start_session",Cpo="new_prompt",bpo="tool_call",xpo="api_request",Spo="api_response",wpo="api_error",_po="end_session",Tpo="flash_fallback",Ipo="loop_detected",Dpo="next_speaker_check",Rpo="slash_command",Bpo="malformed_json_response",rp=class t{static instance;config;events=[];last_flush_time=Date.now();flush_interval_ms=1e3*60;constructor(e){this.config=e}static getInstance(e){if(!(e===void 0||!e?.getUsageStatisticsEnabled()))return t.instance||(t.instance=new t(e)),t.instance}enqueueLogEvent(e){this.events.push([{event_time_ms:Date.now(),source_extension_json:SD(e)}])}createLogEvent(e,r){let n=Njr(),i=Ojr();r.push({iflow_cli_key:Mn.IFLOW_CLI_GOOGLE_ACCOUNTS_COUNT,value:i.toString()});let o={console_type:"IFLOW_CLI",application:102,event_name:e,event_metadata:[r]};return n?o.client_email=n:o.client_install_id=xhe(),o}flushIfNeeded(){Date.now()-this.last_flush_time<this.flush_interval_ms||this.flushToClearcut().catch(e=>{console.debug("Error flushing to Clearcut:",e)})}async flushToClearcut(){return this.config?.getDebugMode()&&console.log("Telemetry disabled - not sending log events to Clearcut."),this.events.length=0,this.last_flush_time=Date.now(),Promise.resolve({})}decodeLogResponse(e){if(e.length<1||e.readUInt8(0)!==8)return;let r=BigInt(0),n=!0;for(let o=1;n&&o<e.length;o++){let s=e.readUInt8(o);r|=BigInt(s&127)<<BigInt(7*(o-1)),n=(s&128)!==0}return n?void 0:{nextRequestWaitMs:Number(r)}}logStartSessionEvent(e){let r=process.env.SURFACE||"SURFACE_NOT_SET",n=[{iflow_cli_key:Mn.IFLOW_CLI_START_SESSION_MODEL,value:e.model},{iflow_cli_key:Mn.IFLOW_CLI_SESSION_ID,value:this.config?.getSessionId()??""},{iflow_cli_key:Mn.IFLOW_CLI_START_SESSION_EMBEDDING_MODEL,value:e.embedding_model},{iflow_cli_key:Mn.IFLOW_CLI_START_SESSION_SANDBOX,value:e.sandbox_enabled.toString()},{iflow_cli_key:Mn.IFLOW_CLI_START_SESSION_CORE_TOOLS,value:e.core_tools_enabled},{iflow_cli_key:Mn.IFLOW_CLI_START_SESSION_APPROVAL_MODE,value:e.approval_mode},{iflow_cli_key:Mn.IFLOW_CLI_START_SESSION_API_KEY_ENABLED,value:e.api_key_enabled.toString()},{iflow_cli_key:Mn.IFLOW_CLI_START_SESSION_VERTEX_API_ENABLED,value:e.vertex_ai_enabled.toString()},{iflow_cli_key:Mn.IFLOW_CLI_START_SESSION_DEBUG_MODE_ENABLED,value:e.debug_enabled.toString()},{iflow_cli_key:Mn.IFLOW_CLI_START_SESSION_VERTEX_API_ENABLED,value:e.vertex_ai_enabled.toString()},{iflow_cli_key:Mn.IFLOW_CLI_START_SESSION_MCP_SERVERS,value:e.mcp_servers},{iflow_cli_key:Mn.IFLOW_CLI_START_SESSION_VERTEX_API_ENABLED,value:e.vertex_ai_enabled.toString()},{iflow_cli_key:Mn.IFLOW_CLI_START_SESSION_TELEMETRY_ENABLED,value:e.telemetry_enabled.toString()},{iflow_cli_key:Mn.IFLOW_CLI_START_SESSION_TELEMETRY_LOG_USER_PROMPTS_ENABLED,value:e.telemetry_log_user_prompts_enabled.toString()},{iflow_cli_key:Mn.IFLOW_CLI_SURFACE,value:r}];this.enqueueLogEvent(this.createLogEvent(vpo,n)),this.flushToClearcut().catch(i=>{console.debug("Error flushing to Clearcut:",i)})}logNewPromptEvent(e){let r=[{iflow_cli_key:Mn.IFLOW_CLI_USER_PROMPT_LENGTH,value:JSON.stringify(e.prompt_length)},{iflow_cli_key:Mn.IFLOW_CLI_SESSION_ID,value:this.config?.getSessionId()??""},{iflow_cli_key:Mn.IFLOW_CLI_PROMPT_ID,value:JSON.stringify(e.prompt_id)},{iflow_cli_key:Mn.IFLOW_CLI_AUTH_TYPE,value:JSON.stringify(e.auth_type)}];this.enqueueLogEvent(this.createLogEvent(Cpo,r)),this.flushIfNeeded()}logToolCallEvent(e){let r=[{iflow_cli_key:Mn.IFLOW_CLI_TOOL_CALL_NAME,value:JSON.stringify(e.function_name)},{iflow_cli_key:Mn.IFLOW_CLI_PROMPT_ID,value:JSON.stringify(e.prompt_id)},{iflow_cli_key:Mn.IFLOW_CLI_TOOL_CALL_DECISION,value:JSON.stringify(e.decision)},{iflow_cli_key:Mn.IFLOW_CLI_TOOL_CALL_SUCCESS,value:JSON.stringify(e.success)},{iflow_cli_key:Mn.IFLOW_CLI_TOOL_CALL_DURATION_MS,value:JSON.stringify(e.duration_ms)},{iflow_cli_key:Mn.IFLOW_CLI_TOOL_ERROR_MESSAGE,value:JSON.stringify(e.error)},{iflow_cli_key:Mn.IFLOW_CLI_TOOL_CALL_ERROR_TYPE,value:JSON.stringify(e.error_type)}],n=this.createLogEvent(bpo,r);this.enqueueLogEvent(n),this.flushIfNeeded()}logApiRequestEvent(e){let r=[{iflow_cli_key:Mn.IFLOW_CLI_API_REQUEST_MODEL,value:JSON.stringify(e.model)},{iflow_cli_key:Mn.IFLOW_CLI_PROMPT_ID,value:JSON.stringify(e.prompt_id)}];this.enqueueLogEvent(this.createLogEvent(xpo,r)),this.flushIfNeeded()}logApiResponseEvent(e){let r=[{iflow_cli_key:Mn.IFLOW_CLI_API_RESPONSE_MODEL,value:JSON.stringify(e.model)},{iflow_cli_key:Mn.IFLOW_CLI_PROMPT_ID,value:JSON.stringify(e.prompt_id)},{iflow_cli_key:Mn.IFLOW_CLI_API_RESPONSE_STATUS_CODE,value:JSON.stringify(e.status_code)},{iflow_cli_key:Mn.IFLOW_CLI_API_RESPONSE_DURATION_MS,value:JSON.stringify(e.duration_ms)},{iflow_cli_key:Mn.IFLOW_CLI_API_ERROR_MESSAGE,value:JSON.stringify(e.error)},{iflow_cli_key:Mn.IFLOW_CLI_API_RESPONSE_INPUT_TOKEN_COUNT,value:JSON.stringify(e.input_token_count)},{iflow_cli_key:Mn.IFLOW_CLI_API_RESPONSE_OUTPUT_TOKEN_COUNT,value:JSON.stringify(e.output_token_count)},{iflow_cli_key:Mn.IFLOW_CLI_API_RESPONSE_CACHED_TOKEN_COUNT,value:JSON.stringify(e.cached_content_token_count)},{iflow_cli_key:Mn.IFLOW_CLI_API_RESPONSE_THINKING_TOKEN_COUNT,value:JSON.stringify(e.thoughts_token_count)},{iflow_cli_key:Mn.IFLOW_CLI_API_RESPONSE_TOOL_TOKEN_COUNT,value:JSON.stringify(e.tool_token_count)},{iflow_cli_key:Mn.IFLOW_CLI_AUTH_TYPE,value:JSON.stringify(e.auth_type)}];this.enqueueLogEvent(this.createLogEvent(Spo,r)),this.flushIfNeeded()}logApiErrorEvent(e){let r=[{iflow_cli_key:Mn.IFLOW_CLI_API_ERROR_MODEL,value:JSON.stringify(e.model)},{iflow_cli_key:Mn.IFLOW_CLI_PROMPT_ID,value:JSON.stringify(e.prompt_id)},{iflow_cli_key:Mn.IFLOW_CLI_API_ERROR_TYPE,value:JSON.stringify(e.error_type)},{iflow_cli_key:Mn.IFLOW_CLI_API_ERROR_STATUS_CODE,value:JSON.stringify(e.status_code)},{iflow_cli_key:Mn.IFLOW_CLI_API_ERROR_DURATION_MS,value:JSON.stringify(e.duration_ms)},{iflow_cli_key:Mn.IFLOW_CLI_AUTH_TYPE,value:JSON.stringify(e.auth_type)}];this.enqueueLogEvent(this.createLogEvent(wpo,r)),this.flushIfNeeded()}logFlashFallbackEvent(e){let r=[{iflow_cli_key:Mn.IFLOW_CLI_AUTH_TYPE,value:JSON.stringify(e.auth_type)},{iflow_cli_key:Mn.IFLOW_CLI_SESSION_ID,value:this.config?.getSessionId()??""}];this.enqueueLogEvent(this.createLogEvent(Tpo,r)),this.flushToClearcut().catch(n=>{console.debug("Error flushing to Clearcut:",n)})}logLoopDetectedEvent(e){let r=[{iflow_cli_key:Mn.IFLOW_CLI_PROMPT_ID,value:JSON.stringify(e.prompt_id)},{iflow_cli_key:Mn.IFLOW_CLI_LOOP_DETECTED_TYPE,value:JSON.stringify(e.loop_type)}];this.enqueueLogEvent(this.createLogEvent(Ipo,r)),this.flushIfNeeded()}logNextSpeakerCheck(e){let r=[{iflow_cli_key:Mn.IFLOW_CLI_PROMPT_ID,value:JSON.stringify(e.prompt_id)},{iflow_cli_key:Mn.IFLOW_CLI_RESPONSE_FINISH_REASON,value:JSON.stringify(e.finish_reason)},{iflow_cli_key:Mn.IFLOW_CLI_NEXT_SPEAKER_CHECK_RESULT,value:JSON.stringify(e.result)},{iflow_cli_key:Mn.IFLOW_CLI_SESSION_ID,value:this.config?.getSessionId()??""}];this.enqueueLogEvent(this.createLogEvent(Dpo,r)),this.flushIfNeeded()}logSlashCommandEvent(e){let r=[{iflow_cli_key:Mn.IFLOW_CLI_SLASH_COMMAND_NAME,value:JSON.stringify(e.command)}];e.subcommand&&r.push({iflow_cli_key:Mn.IFLOW_CLI_SLASH_COMMAND_SUBCOMMAND,value:JSON.stringify(e.subcommand)}),this.enqueueLogEvent(this.createLogEvent(Rpo,r)),this.flushIfNeeded()}logMalformedJsonResponseEvent(e){let r=[{iflow_cli_key:Mn.IFLOW_CLI_MALFORMED_JSON_RESPONSE_MODEL,value:JSON.stringify(e.model)}];this.enqueueLogEvent(this.createLogEvent(Bpo,r)),this.flushIfNeeded()}logEndSessionEvent(e){let r=[{iflow_cli_key:Mn.IFLOW_CLI_SESSION_ID,value:e?.session_id?.toString()??""}];this.enqueueLogEvent(this.createLogEvent(_po,r)),this.flushToClearcut().catch(n=>{console.debug("Error flushing to Clearcut:",n)})}getProxyAgent(){let e=this.config?.getProxy();if(e){if(e.startsWith("http"))return new Mjr.HttpsProxyAgent(e);throw new Error("Unsupported proxy type")}}shutdown(){let e=new CV(this.config);this.logEndSessionEvent(e)}}});import*as Pjr from"node:fs";var Pk,Ljr,Jae,lwe,cwe,uwe,Fjr=ae(()=>{"use strict";Pk=Fe(jn(),1),Ljr=Fe(dk(),1);Jae=class{writeStream;constructor(e){this.writeStream=Pjr.createWriteStream(e,{flags:"a"})}serialize(e){return JSON.stringify(e,null,2)+`
3285
- `}shutdown(){return new Promise(e=>{this.writeStream.end(e)})}},lwe=class extends Jae{export(e,r){let n=e.map(i=>this.serialize(i)).join("");this.writeStream.write(n,i=>{r({code:i?Pk.ExportResultCode.FAILED:Pk.ExportResultCode.SUCCESS,error:i||void 0})})}},cwe=class extends Jae{export(e,r){let n=e.map(i=>this.serialize(i)).join("");this.writeStream.write(n,i=>{r({code:i?Pk.ExportResultCode.FAILED:Pk.ExportResultCode.SUCCESS,error:i||void 0})})}},uwe=class extends Jae{export(e,r){let n=this.serialize(e);this.writeStream.write(n,i=>{r({code:i?Pk.ExportResultCode.FAILED:Pk.ExportResultCode.SUCCESS,error:i||void 0})})}getPreferredAggregationTemporality(){return Ljr.AggregationTemporality.CUMULATIVE}async forceFlush(){return Promise.resolve()}}});function hg(){return Kae}function Npo(t){if(!t)return;let e=t.replace(/^["']|["']$/g,"");try{return new URL(e).origin}catch(r){tH.error("Invalid OTLP endpoint URL provided:",e,r);return}}function mwe(t){if(Kae||!t.getTelemetryEnabled())return;let e=new Hjr.Resource({[S3t.SemanticResourceAttributes.SERVICE_NAME]:Xm,[S3t.SemanticResourceAttributes.SERVICE_VERSION]:process.version,"session.id":t.getSessionId()}),r=t.getTelemetryOtlpEndpoint(),n=Npo(r),i=!!n,o=t.getTelemetryOutfile(),s=i?new Ujr.OTLPTraceExporter({url:n,compression:dwe.CompressionAlgorithm.GZIP}):o?new lwe(o):new pwe.ConsoleSpanExporter,a=i?new Qjr.OTLPLogExporter({url:n,compression:dwe.CompressionAlgorithm.GZIP}):o?new cwe(o):new hwe.ConsoleLogRecordExporter,c=i?new K$.PeriodicExportingMetricReader({exporter:new qjr.OTLPMetricExporter({url:n,compression:dwe.CompressionAlgorithm.GZIP}),exportIntervalMillis:1e4}):o?new K$.PeriodicExportingMetricReader({exporter:new uwe(o),exportIntervalMillis:1e4}):new K$.PeriodicExportingMetricReader({exporter:new K$.ConsoleMetricExporter,exportIntervalMillis:1e4});fwe=new Gjr.NodeSDK({resource:e,spanProcessors:[new pwe.BatchSpanProcessor(s)],logRecordProcessor:new hwe.BatchLogRecordProcessor(a),metricReader:c,instrumentations:[new Vjr.HttpInstrumentation]});try{fwe.start(),console.log("OpenTelemetry SDK started successfully."),Kae=!0,pyr(t)}catch(u){console.error("Error starting OpenTelemetry SDK:",u)}process.on("SIGTERM",X$),process.on("SIGINT",X$)}async function X$(){if(!(!Kae||!fwe))try{rp.getInstance()?.shutdown(),await fwe.shutdown(),console.log("OpenTelemetry SDK shut down successfully.")}catch(t){console.error("Error shutting down SDK:",t)}finally{Kae=!1}}var Ujr,Qjr,qjr,dwe,Gjr,S3t,Hjr,pwe,hwe,K$,Vjr,fwe,Kae,w3t=ae(()=>{"use strict";Ur();Ujr=Fe(n1t(),1),Qjr=Fe(cGr(),1),qjr=Fe(EGr(),1),dwe=Fe(k9(),1),Gjr=Fe(mjr(),1),S3t=Fe(Zh(),1),Hjr=Fe(K_(),1),pwe=Fe(kae(),1),hwe=Fe(P7e(),1),K$=Fe(dk(),1),Vjr=Fe(_jr(),1);Qne();nH();Yae();Fjr();tH.setLogger(new v4e,Kf.INFO);Kae=!1});import{EventEmitter as Opo}from"events";var kpo,Mpo,gwe,fA,_3t=ae(()=>{"use strict";Qne();A_();kpo=()=>({api:{totalRequests:0,totalErrors:0,totalLatencyMs:0},tokens:{prompt:0,candidates:0,total:0,cached:0,thoughts:0,tool:0}}),Mpo=()=>({models:{},tools:{totalCalls:0,totalSuccess:0,totalFail:0,totalDurationMs:0,totalDecisions:{[Sy.ACCEPT]:0,[Sy.REJECT]:0,[Sy.MODIFY]:0},byName:{}}}),gwe=class extends Opo{#e=Mpo();#t=0;addEvent(e){switch(e["event.name"]){case Une:this.processApiResponse(e);break;case Fne:this.processApiError(e);break;case Lne:this.processToolCall(e);break;default:return}this.emit("update",{metrics:this.#e,lastPromptTokenCount:this.#t})}getMetrics(){return this.#e}getLastPromptTokenCount(){return this.#t}resetLastPromptTokenCount(){this.#t=0,this.emit("update",{metrics:this.#e,lastPromptTokenCount:this.#t})}getOrCreateModelMetrics(e){return this.#e.models[e]||(this.#e.models[e]=kpo()),this.#e.models[e]}processApiResponse(e){let r=this.getOrCreateModelMetrics(e.model);r.api.totalRequests++,r.api.totalLatencyMs+=e.duration_ms,r.tokens.prompt+=e.input_token_count,r.tokens.candidates+=e.output_token_count,r.tokens.total+=e.total_token_count,r.tokens.cached+=e.cached_content_token_count,r.tokens.thoughts+=e.thoughts_token_count,r.tokens.tool+=e.tool_token_count,this.#t=e.input_token_count}processApiError(e){let r=this.getOrCreateModelMetrics(e.model);r.api.totalRequests++,r.api.totalErrors++,r.api.totalLatencyMs+=e.duration_ms}processToolCall(e){let{tools:r}=this.#e;r.totalCalls++,r.totalDurationMs+=e.duration_ms,e.success?r.totalSuccess++:r.totalFail++,r.byName[e.function_name]||(r.byName[e.function_name]={count:0,success:0,fail:0,durationMs:0,decisions:{[Sy.ACCEPT]:0,[Sy.REJECT]:0,[Sy.MODIFY]:0}});let n=r.byName[e.function_name];n.count++,n.durationMs+=e.duration_ms,e.success?n.success++:n.fail++,e.decision&&(r.totalDecisions[e.decision]++,n.decisions[e.decision]++)}},fA=new gwe});function dC(t){return{"session.id":t.getSessionId()}}function Lpo(t,e){let r=e instanceof Error&&e.message?e.message:String(e);Vg(new Error(`Telemetry ${t} failed: ${r}`))}function fC(t,e){try{e()}catch(r){Lpo(t,r)}}function Wjr(t,e){fC("logCliConfiguration",()=>{if(rp.getInstance(t)?.logStartSessionEvent(e),!hg())return;let r={...dC(t),"event.name":ryr,"event.timestamp":new Date().toISOString(),model:e.model,embedding_model:e.embedding_model,sandbox_enabled:e.sandbox_enabled,core_tools_enabled:e.core_tools_enabled,approval_mode:e.approval_mode,api_key_enabled:e.api_key_enabled,vertex_ai_enabled:e.vertex_ai_enabled,log_user_prompts_enabled:e.telemetry_log_user_prompts_enabled,file_filtering_respect_git_ignore:e.file_filtering_respect_git_ignore,debug_mode:e.debug_enabled,mcp_servers:e.mcp_servers},n=CE.logs.getLogger(Xm),i={body:"CLI configuration loaded.",attributes:r};n.emit(i)})}function Z$(t,e){fC("logUserPrompt",()=>{if(rp.getInstance(t)?.logNewPromptEvent(e),!hg())return;let r={...dC(t),"event.name":eyr,"event.timestamp":new Date().toISOString(),prompt_length:e.prompt_length};Ppo(t)&&(r.prompt=e.prompt);let n=CE.logs.getLogger(Xm),i={body:`User prompt. Length: ${e.prompt_length}.`,attributes:r};n.emit(i)})}function _y(t,e){fC("logToolCall",()=>{let r={...e,"event.name":Lne,"event.timestamp":new Date().toISOString()};if(fA.addEvent(r),rp.getInstance(t)?.logToolCallEvent(e),!hg())return;let n={...dC(t),...e,"event.name":Lne,"event.timestamp":new Date().toISOString(),function_args:SD(e.function_args,2)};e.error&&(n["error.message"]=e.error,e.error_type&&(n["error.type"]=e.error_type));let i=CE.logs.getLogger(Xm),o={body:`Tool call: ${e.function_name}${e.decision?`. Decision: ${e.decision}`:""}. Success: ${e.success}. Duration: ${e.duration_ms}ms.`,attributes:n};i.emit(o),hyr(t,e.function_name,e.duration_ms,e.success,e.decision)})}function Awe(t,e){fC("logApiRequest",()=>{if(rp.getInstance(t)?.logApiRequestEvent(e),!hg())return;let r={...dC(t),...e,"event.name":tyr,"event.timestamp":new Date().toISOString()},n=CE.logs.getLogger(Xm),i={body:`API request to ${e.model}.`,attributes:r};n.emit(i)})}function ywe(t,e){fC("logFlashFallback",()=>{if(rp.getInstance(t)?.logFlashFallbackEvent(e),!hg())return;let r={...dC(t),...e,"event.name":nyr,"event.timestamp":new Date().toISOString()},n=CE.logs.getLogger(Xm),i={body:"Switching to flash as Fallback.",attributes:r};n.emit(i)})}function Ewe(t,e){fC("logApiError",()=>{let r={...e,"event.name":Fne,"event.timestamp":new Date().toISOString()};if(fA.addEvent(r),rp.getInstance(t)?.logApiErrorEvent(e),!hg())return;let n={...dC(t),...e,"event.name":Fne,"event.timestamp":new Date().toISOString(),"error.message":e.error,model_name:e.model,duration:e.duration_ms};e.error_type&&(n["error.type"]=e.error_type),typeof e.status_code=="number"&&(n[T3t.SemanticAttributes.HTTP_STATUS_CODE]=e.status_code);let i=CE.logs.getLogger(Xm),o={body:`API error for ${e.model}. Error: ${e.error}. Duration: ${e.duration_ms}ms.`,attributes:n};i.emit(o),gyr(t,e.model,e.duration_ms,e.status_code,e.error_type)})}function vwe(t,e){fC("logApiResponse",()=>{let r={...e,"event.name":Une,"event.timestamp":new Date().toISOString()};if(fA.addEvent(r),rp.getInstance(t)?.logApiResponseEvent(e),!hg())return;let n={...dC(t),...e,"event.name":Une,"event.timestamp":new Date().toISOString()};e.response_text&&(n.response_text=e.response_text),e.error?n["error.message"]=e.error:e.status_code&&typeof e.status_code=="number"&&(n[T3t.SemanticAttributes.HTTP_STATUS_CODE]=e.status_code);let i=CE.logs.getLogger(Xm),o={body:`API response from ${e.model}. Status: ${e.status_code||"N/A"}. Duration: ${e.duration_ms}ms.`,attributes:n};i.emit(o),myr(t,e.model,e.duration_ms,e.status_code,e.error),rH(t,e.model,e.input_token_count,"input"),rH(t,e.model,e.output_token_count,"output"),rH(t,e.model,e.cached_content_token_count,"cache"),rH(t,e.model,e.thoughts_token_count,"thought"),rH(t,e.model,e.tool_token_count,"tool")})}function Cwe(t,e){fC("logLoopDetected",()=>{if(rp.getInstance(t)?.logLoopDetectedEvent(e),!hg())return;let r={...dC(t),...e},n=CE.logs.getLogger(Xm),i={body:`Loop detected. Type: ${e.loop_type}.`,attributes:r};n.emit(i)})}function $jr(t,e){fC("logNextSpeakerCheck",()=>{if(rp.getInstance(t)?.logNextSpeakerCheck(e),!hg())return;let r={...dC(t),...e,"event.name":iyr},n=CE.logs.getLogger(Xm),i={body:"Next speaker check.",attributes:r};n.emit(i)})}function bwe(t,e){fC("logSlashCommand",()=>{if(rp.getInstance(t)?.logSlashCommandEvent(e),!hg())return;let r={...dC(t),...e,"event.name":oyr},n=CE.logs.getLogger(Xm),i={body:`Slash command: ${e.command}.`,attributes:r};n.emit(i)})}var CE,T3t,Ppo,Xae=ae(()=>{"use strict";CE=Fe(sW(),1),T3t=Fe(Zh(),1);Qne();nH();w3t();_3t();Yae();C0e();u0e();Ppo=t=>t.getTelemetryLogPromptsEnabled()});function Fpo(t){if(t.candidates===void 0||t.candidates.length===0)return!1;let e=t.candidates[0]?.content;return e===void 0?!1:zjr(e)}function zjr(t){if(t.parts===void 0||t.parts.length===0)return!1;for(let e of t.parts)if(e===void 0||Object.keys(e).length===0||!e.thought&&e.text!==void 0&&e.text==="")return!1;return!0}function Upo(t){for(let e of t)if(e.role!=="user"&&e.role!=="model")throw new Error(`Role must be user or model, but got ${e.role}.`)}function jjr(t){if(t===void 0||t.length===0)return[];let e=[],r=t.length,n=0;for(;n<r;)if(t[n].role==="user")e.push(t[n]),n++;else{let i=[],o=!0;for(;n<r&&t[n].role==="model";)i.push(t[n]),o&&!zjr(t[n])&&(o=!1),n++;o?e.push(...i):e.pop()}return e}var Zae,I3t=ae(()=>{"use strict";il();l_r();KCe();pve();g3();Xae();A_();a4();E_();Zae=class{config;contentGenerator;generationConfig;history;sendPromise=Promise.resolve();reminderManager;constructor(e,r,n={},i=[],o){this.config=e,this.contentGenerator=r,this.generationConfig=n,this.history=i,Upo(i),this.reminderManager=o??new y_({enabled:e.getSystemReminderEnabled?.()??!0,eventTypes:e.getSystemReminderEventTypes?.()??Object.values(kn),maxRemindersPerSession:10,telemetryEnabled:!0})}_getRequestTextFromContents(e){return JSON.stringify(e)}async _logApiRequest(e,r,n){let i=this._getRequestTextFromContents(e);Awe(this.config,new SV(r,n,i))}async _logApiResponse(e,r,n,i){vwe(this.config,new _V(this.config.getModel(),e,r,this.config.getContentGeneratorConfig()?.authType,n,i))}_logApiError(e,r,n){let i=r instanceof Error?r.message:String(r),o=r instanceof Error?r.name:"unknown";Ewe(this.config,new wV(this.config.getModel(),i,e,n,this.config.getContentGeneratorConfig()?.authType,o))}async handleFlashFallback(e,r){if(e!==$t.LOGIN_WITH_IFLOW)return null;let n=this.config.getModel(),i=Xu;if(n===i)return null;let o=this.config.flashFallbackHandler;if(typeof o=="function")try{let s=await o(n,i,r);if(s!==!1&&s!==null)return this.config.setModel(i),this.config.setFallbackMode(!0),i;if(this.config.getModel()===i)return null}catch(s){console.warn("Flash fallback handler failed:",s)}return null}async sendMessage(e,r){await this.sendPromise;let n=UPe(e.message),i=this.getHistory(!0).concat(n);this._logApiRequest(i,this.config.getModel(),r);let o=Date.now(),s;try{s=await CO(()=>{let u=this.config.getModel()||Xu;if(this.config.getQuotaErrorOccurred()&&u===Xu)throw new Error("Please submit a new query to continue with the Flash model.");return this.contentGenerator.generateContent({model:u,contents:i,config:{...this.generationConfig,...e.config}},r)},{shouldRetry:u=>!!(u&&u.message&&(u.message.includes("429")||u.message.match(/5\d{2}/))),onPersistent429:async(u,d)=>await this.handleFlashFallback(u,d),authType:this.config.getContentGeneratorConfig()?.authType});let c=Date.now()-o;return await this._logApiResponse(c,r,s.usageMetadata,JSON.stringify(s)),this.sendPromise=(async()=>{let u=s.candidates?.[0]?.content,d=s.automaticFunctionCallingHistory,f=this.getHistory(!0).length,p=[];d!=null&&(p=d.slice(f)??[]);let h=u?[u]:[];this.recordHistory(n,h,p)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),s}catch(a){let c=Date.now()-o;throw this._logApiError(c,a,r),this.sendPromise=Promise.resolve(),a}}async sendMessageStream(e,r){await this.sendPromise;let n=UPe(e.message),i;b9(n)?i={role:n.role,parts:n.parts}:i=await this.reminderManager.injectReminders(Array.isArray(e.message)?e.message:[e.message],this.config);let o=a_r(i),s;b9(o)?(this.addHistory(i),s=this.getHistory(!0)):s=this.getHistory(!0).concat([i]),this._logApiRequest(s,this.config.getModel(),r);let a=Date.now();try{let u=await CO(()=>{let f=this.config.getModel();if(this.config.getQuotaErrorOccurred()&&f===Xu)throw new Error("Please submit a new query to continue with the Flash model.");return this.contentGenerator.generateContentStream({model:f,contents:s,config:{...this.generationConfig,...e.config}},r)},{shouldRetry:f=>!!(f&&f.message&&(f.message.includes("429")||f.message.match(/5\d{2}/))),onPersistent429:async(f,p)=>await this.handleFlashFallback(f,p),authType:this.config.getContentGeneratorConfig()?.authType});return this.sendPromise=Promise.resolve(u).then(()=>{}).catch(()=>{}),this.processStreamResponse(u,o,a,r)}catch(c){let u=Date.now()-a;throw this._logApiError(u,c,r),this.sendPromise=Promise.resolve(),c}}getHistory(e=!1){let r=e?jjr(this.history):this.history;return structuredClone(r)}clearHistory(){this.history=[]}addHistory(e){this.history.push(e)}setHistory(e){this.history=e}setTools(e){this.generationConfig.tools=e}getFinalUsageMetadata(e){return e.slice().reverse().find(n=>n.usageMetadata)?.usageMetadata}async*processStreamResponse(e,r,n,i){let o=[],s=[],a=!1;try{for await(let c of e){if(Fpo(c)){s.push(c);let u=c.candidates?.[0]?.content;if(u!==void 0){if(this.isOnlyThoughtContent(u)){yield c;continue}o.push(u)}}yield c}}catch(c){a=!0;let u=Date.now()-n;throw this._logApiError(u,c,i),c}if(!a){let c=Date.now()-n,u=[];for(let d of o)d.parts&&u.push(...d.parts);await this._logApiResponse(c,i,this.getFinalUsageMetadata(s),JSON.stringify(s))}this.recordHistory(r,o)}recordHistory(e,r,n){let i=r.filter(a=>!this.isOnlyThoughtContent(a)),o=[];i.length>0&&i.every(a=>a.role!==void 0)?o=i:i.length===0&&r.length>0||b9(e)||o.push({role:"model",parts:[]}),n&&n.length>0?this.history.push(...jjr(n)):b9(e)||this.history.push(e);let s=[];for(let a of o){if(this.isOnlyThoughtContent(a))continue;let c=s[s.length-1];this.isTextContent(c)&&this.isTextContent(a)?(c.parts[0].text+=a.parts[0].text||"",a.parts.length>1&&c.parts.push(...a.parts.slice(1))):s.push(a)}if(s.length>0){let a=this.history[this.history.length-1];(!n||n.length===0)&&this.isTextContent(a)&&this.isTextContent(s[0])&&(a.parts[0].text+=s[0].parts[0].text||"",s[0].parts.length>1&&a.parts.push(...s[0].parts.slice(1)),s.shift()),this.history.push(...s)}}isTextContent(e){return!!(e&&e.role==="model"&&e.parts&&e.parts.length>0&&typeof e.parts[0].text=="string"&&e.parts[0].text!=="")}isThoughtContent(e){return!!(e&&e.role==="model"&&e.parts&&e.parts.length>0&&typeof e.parts[0].thought=="boolean"&&e.parts[0].thought===!0)}isOnlyThoughtContent(e){return!!(e&&e.role==="model"&&e.parts&&e.parts.length==1&&typeof e.parts[0].thought=="boolean"&&e.parts[0].thought===!0)}}});import{createHash as Yjr}from"crypto";var Qpo,D3t,xwe,Jjr,qpo,Gpo,Kjr,Xjr,Hpo,Swe,Zjr=ae(()=>{"use strict";LV();Xae();A_();Fm();il();E_();Qpo=5,D3t=10,xwe=50,Jjr=1e3,qpo=20,Gpo=30,Kjr=3,Xjr=5,Hpo=15,Swe=class{config;reminderManager;promptId="";lastToolCallKey=null;toolCallRepetitionCount=0;streamContentHistory="";contentStats=new Map;lastContentIndex=0;loopDetected=!1;inCodeBlock=!1;turnsInCurrentPrompt=0;llmCheckInterval=Kjr;lastCheckTurn=0;constructor(e,r){this.config=e,this.reminderManager=r}getToolCallKey(e){let r=JSON.stringify(e.args),n=`${e.name}:${r}`;return Yjr("sha256").update(n).digest("hex")}addAndCheck(e){switch(e.type){case wo.ToolCallRequest:this.resetContentTracking(),this.checkToolCallLoop(e.value);break;case wo.Content:this.checkContentLoop(e.value);break;default:break}return!1}async turnStarted(e){return this.turnsInCurrentPrompt++,this.turnsInCurrentPrompt>=Gpo&&this.turnsInCurrentPrompt-this.lastCheckTurn>=this.llmCheckInterval&&(this.lastCheckTurn=this.turnsInCurrentPrompt,await this.checkForLoopWithLLM(e)),!1}checkToolCallLoop(e){let r=this.getToolCallKey(e);this.lastToolCallKey===r?this.toolCallRepetitionCount++:(this.lastToolCallKey=r,this.toolCallRepetitionCount=1),this.toolCallRepetitionCount>=Qpo&&(Cwe(this.config,new IV(wy.CONSECUTIVE_IDENTICAL_TOOL_CALLS,this.promptId)),this.emitLoopReminder(wy.CONSECUTIVE_IDENTICAL_TOOL_CALLS,`The same tool call (${e.name}) has been repeated ${this.toolCallRepetitionCount} times consecutively.`),this.resetToolCallCount(),this.loopDetected=!0)}checkContentLoop(e){let r=(e.match(/```/g)??[]).length;r&&this.resetContentTracking();let n=this.inCodeBlock;this.inCodeBlock=r%2===0?this.inCodeBlock:!this.inCodeBlock,!n&&(this.streamContentHistory+=e,this.truncateAndUpdate(),this.analyzeContentChunksForLoop())}truncateAndUpdate(){if(this.streamContentHistory.length<=Jjr)return;let e=this.streamContentHistory.length-Jjr;this.streamContentHistory=this.streamContentHistory.slice(e),this.lastContentIndex=Math.max(0,this.lastContentIndex-e);for(let[r,n]of this.contentStats.entries()){let i=n.map(o=>o-e).filter(o=>o>=0);i.length>0?this.contentStats.set(r,i):this.contentStats.delete(r)}}analyzeContentChunksForLoop(){for(;this.hasMoreChunksToProcess();){let e=this.streamContentHistory.substring(this.lastContentIndex,this.lastContentIndex+xwe),r=Yjr("sha256").update(e).digest("hex");if(this.isLoopDetectedForChunk(e,r)){Cwe(this.config,new IV(wy.CHANTING_IDENTICAL_SENTENCES,this.promptId)),this.emitLoopReminder(wy.CHANTING_IDENTICAL_SENTENCES,"Repetitive content patterns detected in response generation."),this.loopDetected=!0;return}this.lastContentIndex++}}hasMoreChunksToProcess(){return this.lastContentIndex+xwe<=this.streamContentHistory.length}isLoopDetectedForChunk(e,r){let n=this.contentStats.get(r);if(!n)return this.contentStats.set(r,[this.lastContentIndex]),!1;if(!this.isActualContentMatch(e,n[0])||(n.push(this.lastContentIndex),n.length<D3t))return!1;let i=n.slice(-D3t),s=(i[i.length-1]-i[0])/(D3t-1),a=xwe*1.5;return s<=a}isActualContentMatch(e,r){return this.streamContentHistory.substring(r,r+xwe)===e}async checkForLoopWithLLM(e){let i=[...this.config.getGeminiClient().getHistory().slice(-qpo),{role:"user",parts:[{text:`You are a sophisticated AI diagnostic agent specializing in identifying when a conversational AI is stuck in an unproductive state. Your task is to analyze the provided conversation history and determine if the assistant has ceased to make meaningful progress.
3285
+ `}shutdown(){return new Promise(e=>{this.writeStream.end(e)})}},lwe=class extends Jae{export(e,r){let n=e.map(i=>this.serialize(i)).join("");this.writeStream.write(n,i=>{r({code:i?Pk.ExportResultCode.FAILED:Pk.ExportResultCode.SUCCESS,error:i||void 0})})}},cwe=class extends Jae{export(e,r){let n=e.map(i=>this.serialize(i)).join("");this.writeStream.write(n,i=>{r({code:i?Pk.ExportResultCode.FAILED:Pk.ExportResultCode.SUCCESS,error:i||void 0})})}},uwe=class extends Jae{export(e,r){let n=this.serialize(e);this.writeStream.write(n,i=>{r({code:i?Pk.ExportResultCode.FAILED:Pk.ExportResultCode.SUCCESS,error:i||void 0})})}getPreferredAggregationTemporality(){return Ljr.AggregationTemporality.CUMULATIVE}async forceFlush(){return Promise.resolve()}}});function hg(){return Kae}function Npo(t){if(!t)return;let e=t.replace(/^["']|["']$/g,"");try{return new URL(e).origin}catch(r){tH.error("Invalid OTLP endpoint URL provided:",e,r);return}}function mwe(t){if(Kae||!t.getTelemetryEnabled())return;let e=new Hjr.Resource({[S3t.SemanticResourceAttributes.SERVICE_NAME]:Xm,[S3t.SemanticResourceAttributes.SERVICE_VERSION]:process.version,"session.id":t.getSessionId()}),r=t.getTelemetryOtlpEndpoint(),n=Npo(r),i=!!n,o=t.getTelemetryOutfile(),s=i?new Ujr.OTLPTraceExporter({url:n,compression:dwe.CompressionAlgorithm.GZIP}):o?new lwe(o):new pwe.ConsoleSpanExporter,a=i?new Qjr.OTLPLogExporter({url:n,compression:dwe.CompressionAlgorithm.GZIP}):o?new cwe(o):new hwe.ConsoleLogRecordExporter,c=i?new K$.PeriodicExportingMetricReader({exporter:new qjr.OTLPMetricExporter({url:n,compression:dwe.CompressionAlgorithm.GZIP}),exportIntervalMillis:1e4}):o?new K$.PeriodicExportingMetricReader({exporter:new uwe(o),exportIntervalMillis:1e4}):new K$.PeriodicExportingMetricReader({exporter:new K$.ConsoleMetricExporter,exportIntervalMillis:1e4});fwe=new Gjr.NodeSDK({resource:e,spanProcessors:[new pwe.BatchSpanProcessor(s)],logRecordProcessor:new hwe.BatchLogRecordProcessor(a),metricReader:c,instrumentations:[new Vjr.HttpInstrumentation]});try{fwe.start(),console.log("OpenTelemetry SDK started successfully."),Kae=!0,pyr(t)}catch(u){console.error("Error starting OpenTelemetry SDK:",u)}process.on("SIGTERM",X$),process.on("SIGINT",X$)}async function X$(){if(!(!Kae||!fwe))try{rp.getInstance()?.shutdown(),await fwe.shutdown(),console.log("OpenTelemetry SDK shut down successfully.")}catch(t){console.error("Error shutting down SDK:",t)}finally{Kae=!1}}var Ujr,Qjr,qjr,dwe,Gjr,S3t,Hjr,pwe,hwe,K$,Vjr,fwe,Kae,w3t=ae(()=>{"use strict";Ur();Ujr=Fe(n1t(),1),Qjr=Fe(cGr(),1),qjr=Fe(EGr(),1),dwe=Fe(k9(),1),Gjr=Fe(mjr(),1),S3t=Fe(Zh(),1),Hjr=Fe(K_(),1),pwe=Fe(kae(),1),hwe=Fe(P7e(),1),K$=Fe(dk(),1),Vjr=Fe(_jr(),1);Qne();nH();Yae();Fjr();tH.setLogger(new v4e,Kf.INFO);Kae=!1});import{EventEmitter as Opo}from"events";var kpo,Mpo,gwe,fA,_3t=ae(()=>{"use strict";Qne();A_();kpo=()=>({api:{totalRequests:0,totalErrors:0,totalLatencyMs:0},tokens:{prompt:0,candidates:0,total:0,cached:0,thoughts:0,tool:0}}),Mpo=()=>({models:{},tools:{totalCalls:0,totalSuccess:0,totalFail:0,totalDurationMs:0,totalDecisions:{[Sy.ACCEPT]:0,[Sy.REJECT]:0,[Sy.MODIFY]:0},byName:{}}}),gwe=class extends Opo{#e=Mpo();#t=0;addEvent(e){switch(e["event.name"]){case Une:this.processApiResponse(e);break;case Fne:this.processApiError(e);break;case Lne:this.processToolCall(e);break;default:return}this.emit("update",{metrics:this.#e,lastPromptTokenCount:this.#t})}getMetrics(){return this.#e}getLastPromptTokenCount(){return this.#t}resetLastPromptTokenCount(){this.#t=0,this.emit("update",{metrics:this.#e,lastPromptTokenCount:this.#t})}getOrCreateModelMetrics(e){return this.#e.models[e]||(this.#e.models[e]=kpo()),this.#e.models[e]}processApiResponse(e){let r=this.getOrCreateModelMetrics(e.model);r.api.totalRequests++,r.api.totalLatencyMs+=e.duration_ms,r.tokens.prompt+=e.input_token_count,r.tokens.candidates+=e.output_token_count,r.tokens.total+=e.total_token_count,r.tokens.cached+=e.cached_content_token_count,r.tokens.thoughts+=e.thoughts_token_count,r.tokens.tool+=e.tool_token_count,this.#t=e.input_token_count}processApiError(e){let r=this.getOrCreateModelMetrics(e.model);r.api.totalRequests++,r.api.totalErrors++,r.api.totalLatencyMs+=e.duration_ms}processToolCall(e){let{tools:r}=this.#e;r.totalCalls++,r.totalDurationMs+=e.duration_ms,e.success?r.totalSuccess++:r.totalFail++,r.byName[e.function_name]||(r.byName[e.function_name]={count:0,success:0,fail:0,durationMs:0,decisions:{[Sy.ACCEPT]:0,[Sy.REJECT]:0,[Sy.MODIFY]:0}});let n=r.byName[e.function_name];n.count++,n.durationMs+=e.duration_ms,e.success?n.success++:n.fail++,e.decision&&(r.totalDecisions[e.decision]++,n.decisions[e.decision]++)}},fA=new gwe});function dC(t){return{"session.id":t.getSessionId()}}function Lpo(t,e){let r=e instanceof Error&&e.message?e.message:String(e);Vg(new Error(`Telemetry ${t} failed: ${r}`))}function fC(t,e){try{e()}catch(r){Lpo(t,r)}}function Wjr(t,e){fC("logCliConfiguration",()=>{if(rp.getInstance(t)?.logStartSessionEvent(e),!hg())return;let r={...dC(t),"event.name":ryr,"event.timestamp":new Date().toISOString(),model:e.model,embedding_model:e.embedding_model,sandbox_enabled:e.sandbox_enabled,core_tools_enabled:e.core_tools_enabled,approval_mode:e.approval_mode,api_key_enabled:e.api_key_enabled,vertex_ai_enabled:e.vertex_ai_enabled,log_user_prompts_enabled:e.telemetry_log_user_prompts_enabled,file_filtering_respect_git_ignore:e.file_filtering_respect_git_ignore,debug_mode:e.debug_enabled,mcp_servers:e.mcp_servers},n=CE.logs.getLogger(Xm),i={body:"CLI configuration loaded.",attributes:r};n.emit(i)})}function Z$(t,e){fC("logUserPrompt",()=>{if(rp.getInstance(t)?.logNewPromptEvent(e),!hg())return;let r={...dC(t),"event.name":eyr,"event.timestamp":new Date().toISOString(),prompt_length:e.prompt_length};Ppo(t)&&(r.prompt=e.prompt);let n=CE.logs.getLogger(Xm),i={body:`User prompt. Length: ${e.prompt_length}.`,attributes:r};n.emit(i)})}function _y(t,e){fC("logToolCall",()=>{let r={...e,"event.name":Lne,"event.timestamp":new Date().toISOString()};if(fA.addEvent(r),rp.getInstance(t)?.logToolCallEvent(e),!hg())return;let n={...dC(t),...e,"event.name":Lne,"event.timestamp":new Date().toISOString(),function_args:SD(e.function_args,2)};e.error&&(n["error.message"]=e.error,e.error_type&&(n["error.type"]=e.error_type));let i=CE.logs.getLogger(Xm),o={body:`Tool call: ${e.function_name}${e.decision?`. Decision: ${e.decision}`:""}. Success: ${e.success}. Duration: ${e.duration_ms}ms.`,attributes:n};i.emit(o),hyr(t,e.function_name,e.duration_ms,e.success,e.decision)})}function Awe(t,e){fC("logApiRequest",()=>{if(rp.getInstance(t)?.logApiRequestEvent(e),!hg())return;let r={...dC(t),...e,"event.name":tyr,"event.timestamp":new Date().toISOString()},n=CE.logs.getLogger(Xm),i={body:`API request to ${e.model}.`,attributes:r};n.emit(i)})}function ywe(t,e){fC("logFlashFallback",()=>{if(rp.getInstance(t)?.logFlashFallbackEvent(e),!hg())return;let r={...dC(t),...e,"event.name":nyr,"event.timestamp":new Date().toISOString()},n=CE.logs.getLogger(Xm),i={body:"Switching to flash as Fallback.",attributes:r};n.emit(i)})}function Ewe(t,e){fC("logApiError",()=>{let r={...e,"event.name":Fne,"event.timestamp":new Date().toISOString()};if(fA.addEvent(r),rp.getInstance(t)?.logApiErrorEvent(e),!hg())return;let n={...dC(t),...e,"event.name":Fne,"event.timestamp":new Date().toISOString(),"error.message":e.error,model_name:e.model,duration:e.duration_ms};e.error_type&&(n["error.type"]=e.error_type),typeof e.status_code=="number"&&(n[T3t.SemanticAttributes.HTTP_STATUS_CODE]=e.status_code);let i=CE.logs.getLogger(Xm),o={body:`API error for ${e.model}. Error: ${e.error}. Duration: ${e.duration_ms}ms.`,attributes:n};i.emit(o),gyr(t,e.model,e.duration_ms,e.status_code,e.error_type)})}function vwe(t,e){fC("logApiResponse",()=>{let r={...e,"event.name":Une,"event.timestamp":new Date().toISOString()};if(fA.addEvent(r),rp.getInstance(t)?.logApiResponseEvent(e),!hg())return;let n={...dC(t),...e,"event.name":Une,"event.timestamp":new Date().toISOString()};e.response_text&&(n.response_text=e.response_text),e.error?n["error.message"]=e.error:e.status_code&&typeof e.status_code=="number"&&(n[T3t.SemanticAttributes.HTTP_STATUS_CODE]=e.status_code);let i=CE.logs.getLogger(Xm),o={body:`API response from ${e.model}. Status: ${e.status_code||"N/A"}. Duration: ${e.duration_ms}ms.`,attributes:n};i.emit(o),myr(t,e.model,e.duration_ms,e.status_code,e.error),rH(t,e.model,e.input_token_count,"input"),rH(t,e.model,e.output_token_count,"output"),rH(t,e.model,e.cached_content_token_count,"cache"),rH(t,e.model,e.thoughts_token_count,"thought"),rH(t,e.model,e.tool_token_count,"tool")})}function Cwe(t,e){fC("logLoopDetected",()=>{if(rp.getInstance(t)?.logLoopDetectedEvent(e),!hg())return;let r={...dC(t),...e},n=CE.logs.getLogger(Xm),i={body:`Loop detected. Type: ${e.loop_type}.`,attributes:r};n.emit(i)})}function $jr(t,e){fC("logNextSpeakerCheck",()=>{if(rp.getInstance(t)?.logNextSpeakerCheck(e),!hg())return;let r={...dC(t),...e,"event.name":iyr},n=CE.logs.getLogger(Xm),i={body:"Next speaker check.",attributes:r};n.emit(i)})}function bwe(t,e){fC("logSlashCommand",()=>{if(rp.getInstance(t)?.logSlashCommandEvent(e),!hg())return;let r={...dC(t),...e,"event.name":oyr},n=CE.logs.getLogger(Xm),i={body:`Slash command: ${e.command}.`,attributes:r};n.emit(i)})}var CE,T3t,Ppo,Xae=ae(()=>{"use strict";CE=Fe(sW(),1),T3t=Fe(Zh(),1);Qne();nH();w3t();_3t();Yae();C0e();u0e();Ppo=t=>t.getTelemetryLogPromptsEnabled()});function Fpo(t){if(t.candidates===void 0||t.candidates.length===0)return!1;let e=t.candidates[0]?.content;return e===void 0?!1:zjr(e)}function zjr(t){if(t.parts===void 0||t.parts.length===0)return!1;for(let e of t.parts)if(e===void 0||Object.keys(e).length===0||!e.thought&&e.text!==void 0&&e.text==="")return!1;return!0}function Upo(t){for(let e of t)if(e.role!=="user"&&e.role!=="model")throw new Error(`Role must be user or model, but got ${e.role}.`)}function jjr(t){if(t===void 0||t.length===0)return[];let e=[],r=t.length,n=0;for(;n<r;)if(t[n].role==="user")e.push(t[n]),n++;else{let i=[],o=!0;for(;n<r&&t[n].role==="model";)i.push(t[n]),o&&!zjr(t[n])&&(o=!1),n++;o?e.push(...i):e.pop()}return e}var Zae,I3t=ae(()=>{"use strict";il();l_r();KCe();pve();g3();Xae();A_();a4();E_();Zae=class{config;contentGenerator;generationConfig;history;sendPromise=Promise.resolve();reminderManager;environmentParts;constructor(e,r,n={},i=[],o,s){this.config=e,this.contentGenerator=r,this.generationConfig=n,this.history=i,Upo(i),this.reminderManager=o??new y_({enabled:e.getSystemReminderEnabled?.()??!0,eventTypes:e.getSystemReminderEventTypes?.()??Object.values(kn),maxRemindersPerSession:10,telemetryEnabled:!0}),this.environmentParts=s??[]}_getRequestTextFromContents(e){return JSON.stringify(e)}async _logApiRequest(e,r,n){let i=this._getRequestTextFromContents(e);Awe(this.config,new SV(r,n,i))}async _logApiResponse(e,r,n,i){vwe(this.config,new _V(this.config.getModel(),e,r,this.config.getContentGeneratorConfig()?.authType,n,i))}_logApiError(e,r,n){let i=r instanceof Error?r.message:String(r),o=r instanceof Error?r.name:"unknown";Ewe(this.config,new wV(this.config.getModel(),i,e,n,this.config.getContentGeneratorConfig()?.authType,o))}async handleFlashFallback(e,r){if(e!==$t.LOGIN_WITH_IFLOW)return null;let n=this.config.getModel(),i=Xu;if(n===i)return null;let o=this.config.flashFallbackHandler;if(typeof o=="function")try{let s=await o(n,i,r);if(s!==!1&&s!==null)return this.config.setModel(i),this.config.setFallbackMode(!0),i;if(this.config.getModel()===i)return null}catch(s){console.warn("Flash fallback handler failed:",s)}return null}async sendMessage(e,r){await this.sendPromise;let n=UPe(e.message),i=this.getHistory(!0).concat(n);this._logApiRequest(i,this.config.getModel(),r);let o=Date.now(),s;try{s=await CO(()=>{let u=this.config.getModel()||Xu;if(this.config.getQuotaErrorOccurred()&&u===Xu)throw new Error("Please submit a new query to continue with the Flash model.");return this.contentGenerator.generateContent({model:u,contents:i,config:{...this.generationConfig,...e.config}},r)},{shouldRetry:u=>!!(u&&u.message&&(u.message.includes("429")||u.message.match(/5\d{2}/))),onPersistent429:async(u,d)=>await this.handleFlashFallback(u,d),authType:this.config.getContentGeneratorConfig()?.authType});let c=Date.now()-o;return await this._logApiResponse(c,r,s.usageMetadata,JSON.stringify(s)),this.sendPromise=(async()=>{let u=s.candidates?.[0]?.content,d=s.automaticFunctionCallingHistory,f=this.getHistory(!0).length,p=[];d!=null&&(p=d.slice(f)??[]);let h=u?[u]:[];this.recordHistory(n,h,p)})(),await this.sendPromise.catch(()=>{this.sendPromise=Promise.resolve()}),s}catch(a){let c=Date.now()-o;throw this._logApiError(c,a,r),this.sendPromise=Promise.resolve(),a}}async sendMessageStream(e,r){await this.sendPromise;let n=UPe(e.message),i;b9(n)?i={role:n.role,parts:n.parts}:i=await this.reminderManager.injectReminders(Array.isArray(e.message)?e.message:[e.message],this.config);let o=a_r(i),s;if(b9(o))this.addHistory(i),s=this.getHistory(!0);else{let c=this.getHistory(!0),u=[];this.environmentParts.length>0&&(u=[{role:"user",parts:this.environmentParts},{role:"model",parts:[{text:"Got it. Thanks for the context!"}]}]),s=u.concat(c).concat([i])}this._logApiRequest(s,this.config.getModel(),r);let a=Date.now();try{let u=await CO(()=>{let f=this.config.getModel();if(this.config.getQuotaErrorOccurred()&&f===Xu)throw new Error("Please submit a new query to continue with the Flash model.");return this.contentGenerator.generateContentStream({model:f,contents:s,config:{...this.generationConfig,...e.config}},r)},{shouldRetry:f=>!!(f&&f.message&&(f.message.includes("429")||f.message.match(/5\d{2}/))),onPersistent429:async(f,p)=>await this.handleFlashFallback(f,p),authType:this.config.getContentGeneratorConfig()?.authType});return this.sendPromise=Promise.resolve(u).then(()=>{}).catch(()=>{}),this.processStreamResponse(u,o,a,r)}catch(c){let u=Date.now()-a;throw this._logApiError(u,c,r),this.sendPromise=Promise.resolve(),c}}getHistory(e=!1){let r=e?jjr(this.history):this.history;return structuredClone(r)}clearHistory(){this.history=[]}addHistory(e){this.history.push(e)}setHistory(e){this.history=e}setTools(e){this.generationConfig.tools=e}getFinalUsageMetadata(e){return e.slice().reverse().find(n=>n.usageMetadata)?.usageMetadata}async*processStreamResponse(e,r,n,i){let o=[],s=[],a=!1;try{for await(let c of e){if(Fpo(c)){s.push(c);let u=c.candidates?.[0]?.content;if(u!==void 0){if(this.isOnlyThoughtContent(u)){yield c;continue}o.push(u)}}yield c}}catch(c){a=!0;let u=Date.now()-n;throw this._logApiError(u,c,i),c}if(!a){let c=Date.now()-n,u=[];for(let d of o)d.parts&&u.push(...d.parts);await this._logApiResponse(c,i,this.getFinalUsageMetadata(s),JSON.stringify(s))}this.recordHistory(r,o)}recordHistory(e,r,n){let i=r.filter(a=>!this.isOnlyThoughtContent(a)),o=[];i.length>0&&i.every(a=>a.role!==void 0)?o=i:i.length===0&&r.length>0||b9(e)||o.push({role:"model",parts:[]}),n&&n.length>0?this.history.push(...jjr(n)):b9(e)||this.history.push(e);let s=[];for(let a of o){if(this.isOnlyThoughtContent(a))continue;let c=s[s.length-1];this.isTextContent(c)&&this.isTextContent(a)?(c.parts[0].text+=a.parts[0].text||"",a.parts.length>1&&c.parts.push(...a.parts.slice(1))):s.push(a)}if(s.length>0){let a=this.history[this.history.length-1];(!n||n.length===0)&&this.isTextContent(a)&&this.isTextContent(s[0])&&(a.parts[0].text+=s[0].parts[0].text||"",s[0].parts.length>1&&a.parts.push(...s[0].parts.slice(1)),s.shift()),this.history.push(...s)}}isTextContent(e){return!!(e&&e.role==="model"&&e.parts&&e.parts.length>0&&typeof e.parts[0].text=="string"&&e.parts[0].text!=="")}isThoughtContent(e){return!!(e&&e.role==="model"&&e.parts&&e.parts.length>0&&typeof e.parts[0].thought=="boolean"&&e.parts[0].thought===!0)}isOnlyThoughtContent(e){return!!(e&&e.role==="model"&&e.parts&&e.parts.length==1&&typeof e.parts[0].thought=="boolean"&&e.parts[0].thought===!0)}}});import{createHash as Yjr}from"crypto";var Qpo,D3t,xwe,Jjr,qpo,Gpo,Kjr,Xjr,Hpo,Swe,Zjr=ae(()=>{"use strict";LV();Xae();A_();Fm();il();E_();Qpo=5,D3t=10,xwe=50,Jjr=1e3,qpo=20,Gpo=30,Kjr=3,Xjr=5,Hpo=15,Swe=class{config;reminderManager;promptId="";lastToolCallKey=null;toolCallRepetitionCount=0;streamContentHistory="";contentStats=new Map;lastContentIndex=0;loopDetected=!1;inCodeBlock=!1;turnsInCurrentPrompt=0;llmCheckInterval=Kjr;lastCheckTurn=0;constructor(e,r){this.config=e,this.reminderManager=r}getToolCallKey(e){let r=JSON.stringify(e.args),n=`${e.name}:${r}`;return Yjr("sha256").update(n).digest("hex")}addAndCheck(e){switch(e.type){case wo.ToolCallRequest:this.resetContentTracking(),this.checkToolCallLoop(e.value);break;case wo.Content:this.checkContentLoop(e.value);break;default:break}return!1}async turnStarted(e){return this.turnsInCurrentPrompt++,this.turnsInCurrentPrompt>=Gpo&&this.turnsInCurrentPrompt-this.lastCheckTurn>=this.llmCheckInterval&&(this.lastCheckTurn=this.turnsInCurrentPrompt,await this.checkForLoopWithLLM(e)),!1}checkToolCallLoop(e){let r=this.getToolCallKey(e);this.lastToolCallKey===r?this.toolCallRepetitionCount++:(this.lastToolCallKey=r,this.toolCallRepetitionCount=1),this.toolCallRepetitionCount>=Qpo&&(Cwe(this.config,new IV(wy.CONSECUTIVE_IDENTICAL_TOOL_CALLS,this.promptId)),this.emitLoopReminder(wy.CONSECUTIVE_IDENTICAL_TOOL_CALLS,`The same tool call (${e.name}) has been repeated ${this.toolCallRepetitionCount} times consecutively.`),this.resetToolCallCount(),this.loopDetected=!0)}checkContentLoop(e){let r=(e.match(/```/g)??[]).length;r&&this.resetContentTracking();let n=this.inCodeBlock;this.inCodeBlock=r%2===0?this.inCodeBlock:!this.inCodeBlock,!n&&(this.streamContentHistory+=e,this.truncateAndUpdate(),this.analyzeContentChunksForLoop())}truncateAndUpdate(){if(this.streamContentHistory.length<=Jjr)return;let e=this.streamContentHistory.length-Jjr;this.streamContentHistory=this.streamContentHistory.slice(e),this.lastContentIndex=Math.max(0,this.lastContentIndex-e);for(let[r,n]of this.contentStats.entries()){let i=n.map(o=>o-e).filter(o=>o>=0);i.length>0?this.contentStats.set(r,i):this.contentStats.delete(r)}}analyzeContentChunksForLoop(){for(;this.hasMoreChunksToProcess();){let e=this.streamContentHistory.substring(this.lastContentIndex,this.lastContentIndex+xwe),r=Yjr("sha256").update(e).digest("hex");if(this.isLoopDetectedForChunk(e,r)){Cwe(this.config,new IV(wy.CHANTING_IDENTICAL_SENTENCES,this.promptId)),this.emitLoopReminder(wy.CHANTING_IDENTICAL_SENTENCES,"Repetitive content patterns detected in response generation."),this.loopDetected=!0;return}this.lastContentIndex++}}hasMoreChunksToProcess(){return this.lastContentIndex+xwe<=this.streamContentHistory.length}isLoopDetectedForChunk(e,r){let n=this.contentStats.get(r);if(!n)return this.contentStats.set(r,[this.lastContentIndex]),!1;if(!this.isActualContentMatch(e,n[0])||(n.push(this.lastContentIndex),n.length<D3t))return!1;let i=n.slice(-D3t),s=(i[i.length-1]-i[0])/(D3t-1),a=xwe*1.5;return s<=a}isActualContentMatch(e,r){return this.streamContentHistory.substring(r,r+xwe)===e}async checkForLoopWithLLM(e){let i=[...this.config.getGeminiClient().getHistory().slice(-qpo),{role:"user",parts:[{text:`You are a sophisticated AI diagnostic agent specializing in identifying when a conversational AI is stuck in an unproductive state. Your task is to analyze the provided conversation history and determine if the assistant has ceased to make meaningful progress.
3286
3286
 
3287
3287
  An unproductive state is characterized by one or more of the following patterns over the last 5 or more assistant turns:
3288
3288
 
@@ -3333,9 +3333,9 @@ ${i.map(p=>` - ${p}`).join(`
3333
3333
  `.trim()}],d=await this.config.getToolRegistry();if(this.config.getFullContext())try{let f=d.getTool("read_many_files");if(f){let p=await f.execute({paths:["**/*"],useDefaultExcludes:!0},AbortSignal.timeout(3e4));p.llmContent?u.push({text:`
3334
3334
  --- Full File Context ---
3335
3335
  ${p.llmContent}`}):console.warn("Full context requested, but read_many_files returned no content.")}else console.warn("Full context requested, but read_many_files tool not found.")}catch(f){console.error("Error reading full file context:",f),u.push({text:`
3336
- --- Error reading full file context ---`})}return u}async startChat(e){this.forceFullIdeContext=!0;let r=await this.getEnvironment(),n=await this.enhanceEnvironment(r),i=await this.config.getToolRegistry();this.currentChatApprovalMode=this.config.getApprovalMode();let o;if(this.currentChatApprovalMode===$n.PLAN){let c=["read_file","glob","save_memory","todo_read","todo_write","exit_plan_mode","list_directory","search_file_content","run_shell_command"];o=i.getFunctionDeclarations().filter(d=>c.includes(d.name||""))}else o=i.getFunctionDeclarations().filter(c=>c.name!=="read_many_files");let s=[{functionDeclarations:o}],a=[{role:"user",parts:n},{role:"model",parts:[{text:"Got it. Thanks for the context!"}]},...e??[]];try{let c=this.config.getUserMemory(),u;this.systemPrompt?u=this.systemPrompt:this.currentChatApprovalMode===$n.PLAN?u=await hft(this.config,c):u=await rW(this.config,c),this.appendSystemPrompt&&(u=u+`
3337
- `+this.appendSystemPrompt);let d=Vpo(this.config.getModel())?{...this.generateContentConfig,thinkingConfig:{includeThoughts:!0}}:this.generateContentConfig;return new Zae(this.config,this.getContentGenerator(),{systemInstruction:u,...d,tools:s},a,this.reminderManager)}catch(c){throw await I9(c,"Error initializing iFlow chat session.",a,"startChat"),new Error(`Failed to initialize chat: ${or(c)}`)}}async*sendMessageStream(e,r,n,i=this.MAX_TURNS,o){let s=eS.client;s.start("SendMessageStream-Total");try{let a=this.config.getApprovalMode();if(this.currentChatApprovalMode!==a){let E=this.getHistory();this.chat=await this.startChat(E)}let c=this.config.getPendingHistoryRestore();if(c&&c.length>0&&(this.getChat().setHistory(c),this.config.clearPendingHistoryRestore()),await this.updateChatTools(),this.lastPromptId!==n&&(this.loopDetector.reset(n),this.lastPromptId=n),this.sessionTurnCount++,this.config.getApprovalMode()===$n.PLAN){let E=this.getChat();E&&E.reminderManager&&E.reminderManager.emitEvent(kn.PLAN_MODE_ACTIVATED,this.config.getSessionId(),{approvalMode:$n.PLAN,timestamp:Date.now()},"high")}if(this.config.getMaxSessionTurns()>0&&this.sessionTurnCount>this.config.getMaxSessionTurns())return yield{type:wo.MaxSessionTurns},new gO(this.getChat(),n);let u=Math.min(i,this.MAX_TURNS);if(!u)return new gO(this.getChat(),n);let d=o||this.config.getModel();await this.shouldCompressChat()&&(yield{type:wo.ChatCompressionStarted});let p=await this.tryCompressChat(n);p&&(yield{type:wo.ChatCompressed,value:p});let h=this.getHistory(),m=h.length>0?h[h.length-1]:void 0,g=!!m&&m.role==="model"&&(m.parts?.some(E=>"functionCall"in E)||!1);if(this.config.getIdeClient().getConnectionStatus().status===Is.Connected&&!g){let{contextParts:E,newIdeContext:C}=this.getIdeContextParts(this.forceFullIdeContext||h.length===0);E.length>0&&this.getChat().addHistory({role:"user",parts:[{text:E.join(`
3338
- `)}]}),this.lastSentIdeContext=C,this.forceFullIdeContext=!1}let A=new gO(this.getChat(),n);await this.loopDetector.turnStarted(r);let y=A.run(e,r);for await(let E of y)this.loopDetector.addAndCheck(E),yield E;if(!A.pendingToolCalls.length&&r&&!r.aborted){if(this.config.getModel()!==d||this.config.getSkipNextSpeakerCheck())return A;let C=await n_r(this.getChat(),this,r);if($jr(this.config,new Yve(n,A.finishReason?.toString()||"",C?.next_speaker||"")),C?.next_speaker==="model"){let x=[{text:"Please continue."}];yield*this.sendMessageStream(x,r,n,u-1,d)}}return A}finally{s.end("SendMessageStream-Total")}}async generateJson(e,r,n,i,o={}){let s=i||this.config.getModel()||Xu;try{let a=this.config.getUserMemory(),c=await rW(this.config,a),u={abortSignal:n,...this.generateContentConfig,...o},f=await this.getContentGenerator().generateContent({model:s,config:{...u,systemInstruction:c,responseSchema:r,responseMimeType:"application/json"},contents:e},this.lastPromptId),p=sg(f);if(!p){let g=new Error("API returned an empty response for generateJson.");throw await I9(g,"Error in generateJson: API returned an empty response.",e,"generateJson-empty-response"),g}let h=/```json\s*([\s\S]*?)\s*```/,m=p.match(h);m&&(rp.getInstance(this.config)?.logMalformedJsonResponseEvent(new Jve(s)),p=m[1].trim());try{return JSON.parse(p)}catch(g){throw await I9(g,"Failed to parse JSON response from generateJson.",{responseTextFailedToParse:p,originalRequestContents:e},"generateJson-parse"),new Error(`Failed to parse API response as JSON: ${or(g)}`)}}catch(a){throw n.aborted||a instanceof Error&&a.message==="API returned an empty response for generateJson."?a:(await I9(a,"Error generating JSON content via API.",e,"generateJson-api"),new Error(`Failed to generate JSON content: ${or(a)}`))}}async generateContent(e,r,n,i){let o=i??this.config.getModel(),s={...this.generateContentConfig,...r};try{let a=this.config.getUserMemory(),c=await rW(this.config,a),u={abortSignal:n,...s,systemInstruction:c};return await CO(()=>this.getContentGenerator().generateContent({model:o,config:u,contents:e},this.lastPromptId),{onPersistent429:async(p,h)=>await this.handleFlashFallback(p,h),authType:this.config.getContentGeneratorConfig()?.authType})}catch(a){throw n.aborted?a:(await I9(a,`Error generating content via API with model ${o}.`,{requestContents:e,requestConfig:s},"generateContent-api"),new Error(`Failed to generate content with model ${o}: ${or(a)}`))}}async generateTextOnly(e,r,n,i){let o=i??this.config.getModel(),s={...this.generateContentConfig,...r};try{let a={abortSignal:n,...s};return await CO(()=>this.getContentGenerator().generateContent({model:o,config:a,contents:e},this.lastPromptId),{onPersistent429:async(d,f)=>await this.handleFlashFallback(d,f),authType:this.config.getContentGeneratorConfig()?.authType})}catch(a){throw I9({error:a,debugInfo:{userId:"",sessionId:this.config.getSessionId(),conversationId:"",model:o,authType:this.config.getContentGeneratorConfig()?.authType}},"generateTextOnly-api"),new Error(`Failed to generate text content with model ${o}: ${or(a)}`)}}async generateEmbedding(e){if(!e||e.length===0)return[];let r={model:this.embeddingModel,contents:e},n=await this.getContentGenerator().embedContent(r);if(!n.embeddings||n.embeddings.length===0)throw new Error("No embeddings found in API response.");if(n.embeddings.length!==e.length)throw new Error(`API returned a mismatched number of embeddings. Expected ${e.length}, got ${n.embeddings.length}.`);return n.embeddings.map((i,o)=>{let s=i.values;if(!s||s.length===0)throw new Error(`API returned an empty embedding for input text at index ${o}: "${e[o]}"`);return s})}async shouldCompressChat(e=!1){let r=this.getChat().getHistory(!0);if(r.length===0)return!1;let n=this.config.getModel(),{totalTokens:i}=await this.getContentGenerator().countTokens({model:n,contents:r});return!(i===void 0||!e&&i<this.COMPRESSION_TOKEN_THRESHOLD*XF(n,this.config.getTokensLimit()))}async tryCompressChat(e,r=!1){if(!await this.shouldCompressChat(r))return null;let i=this.getChat().getHistory(!0),o=this.config.getModel(),{totalTokens:s}=await this.getContentGenerator().countTokens({model:o,contents:i});if(s===void 0)return console.warn(`Could not determine token count for model ${o}.`),null;let a=this.readFileStateManager.createBackup();this.readFileStateManager.clearState();let c=i.slice(2);this.getChat().setHistory(c);let u=await this.getChat().sendMessage({message:{text:pft()},config:{systemInstruction:{text:fft()},tools:[]}},e),d=sg(u);if(!d)return console.warn("No summary generated during compression."),null;let p=`
3336
+ --- Error reading full file context ---`})}return u}async startChat(e){this.forceFullIdeContext=!0;let r=await this.getEnvironment(),n=await this.enhanceEnvironment(r),i=await this.config.getToolRegistry();this.currentChatApprovalMode=this.config.getApprovalMode();let o;if(this.currentChatApprovalMode===$n.PLAN){let c=["read_file","glob","save_memory","todo_read","todo_write","exit_plan_mode","list_directory","search_file_content","run_shell_command"];o=i.getFunctionDeclarations().filter(d=>c.includes(d.name||""))}else o=i.getFunctionDeclarations().filter(c=>c.name!=="read_many_files");let s=[{functionDeclarations:o}],a=e??[];try{let c=this.config.getUserMemory(),u;this.systemPrompt?u=this.systemPrompt:this.currentChatApprovalMode===$n.PLAN?u=await hft(this.config,c):u=await rW(this.config,c),this.appendSystemPrompt&&(u=u+`
3337
+ `+this.appendSystemPrompt);let d=Vpo(this.config.getModel())?{...this.generateContentConfig,thinkingConfig:{includeThoughts:!0}}:this.generateContentConfig;return new Zae(this.config,this.getContentGenerator(),{systemInstruction:u,...d,tools:s},a,this.reminderManager,n)}catch(c){throw await I9(c,"Error initializing iFlow chat session.",a,"startChat"),new Error(`Failed to initialize chat: ${or(c)}`)}}async*sendMessageStream(e,r,n,i=this.MAX_TURNS,o){let s=eS.client;s.start("SendMessageStream-Total");try{let a=this.config.getApprovalMode();if(this.currentChatApprovalMode!==a){let E=this.getHistory();this.chat=await this.startChat(E)}let c=this.config.getPendingHistoryRestore();if(c&&c.length>0&&(this.getChat().setHistory(c),this.config.clearPendingHistoryRestore()),await this.updateChatTools(),this.lastPromptId!==n&&(this.loopDetector.reset(n),this.lastPromptId=n),this.sessionTurnCount++,this.config.getApprovalMode()===$n.PLAN){let E=this.getChat();E&&E.reminderManager&&E.reminderManager.emitEvent(kn.PLAN_MODE_ACTIVATED,this.config.getSessionId(),{approvalMode:$n.PLAN,timestamp:Date.now()},"high")}if(this.config.getMaxSessionTurns()>0&&this.sessionTurnCount>this.config.getMaxSessionTurns())return yield{type:wo.MaxSessionTurns},new gO(this.getChat(),n);let u=Math.min(i,this.MAX_TURNS);if(!u)return new gO(this.getChat(),n);let d=o||this.config.getModel();await this.shouldCompressChat()&&(yield{type:wo.ChatCompressionStarted});let p=await this.tryCompressChat(n);p&&(yield{type:wo.ChatCompressed,value:p});let h=this.getHistory(),m=h.length>0?h[h.length-1]:void 0,g=!!m&&m.role==="model"&&(m.parts?.some(E=>"functionCall"in E)||!1);if(this.config.getIdeClient().getConnectionStatus().status===Is.Connected&&!g){let{contextParts:E,newIdeContext:C}=this.getIdeContextParts(this.forceFullIdeContext||h.length===0);E.length>0&&this.getChat().addHistory({role:"user",parts:[{text:E.join(`
3338
+ `)}]}),this.lastSentIdeContext=C,this.forceFullIdeContext=!1}let A=new gO(this.getChat(),n);await this.loopDetector.turnStarted(r);let y=A.run(e,r);for await(let E of y)this.loopDetector.addAndCheck(E),yield E;if(!A.pendingToolCalls.length&&r&&!r.aborted){if(this.config.getModel()!==d||this.config.getSkipNextSpeakerCheck())return A;let C=await n_r(this.getChat(),this,r);if($jr(this.config,new Yve(n,A.finishReason?.toString()||"",C?.next_speaker||"")),C?.next_speaker==="model"){let x=[{text:"Please continue."}];yield*this.sendMessageStream(x,r,n,u-1,d)}}return A}finally{s.end("SendMessageStream-Total")}}async generateJson(e,r,n,i,o={}){let s=i||this.config.getModel()||Xu;try{let a=this.config.getUserMemory(),c=await rW(this.config,a),u={abortSignal:n,...this.generateContentConfig,...o},f=await this.getContentGenerator().generateContent({model:s,config:{...u,systemInstruction:c,responseSchema:r,responseMimeType:"application/json"},contents:e},this.lastPromptId),p=sg(f);if(!p){let g=new Error("API returned an empty response for generateJson.");throw await I9(g,"Error in generateJson: API returned an empty response.",e,"generateJson-empty-response"),g}let h=/```json\s*([\s\S]*?)\s*```/,m=p.match(h);m&&(rp.getInstance(this.config)?.logMalformedJsonResponseEvent(new Jve(s)),p=m[1].trim());try{return JSON.parse(p)}catch(g){throw await I9(g,"Failed to parse JSON response from generateJson.",{responseTextFailedToParse:p,originalRequestContents:e},"generateJson-parse"),new Error(`Failed to parse API response as JSON: ${or(g)}`)}}catch(a){throw n.aborted||a instanceof Error&&a.message==="API returned an empty response for generateJson."?a:(await I9(a,"Error generating JSON content via API.",e,"generateJson-api"),new Error(`Failed to generate JSON content: ${or(a)}`))}}async generateContent(e,r,n,i){let o=i??this.config.getModel(),s={...this.generateContentConfig,...r};try{let a=this.config.getUserMemory(),c=await rW(this.config,a),u={abortSignal:n,...s,systemInstruction:c};return await CO(()=>this.getContentGenerator().generateContent({model:o,config:u,contents:e},this.lastPromptId),{onPersistent429:async(p,h)=>await this.handleFlashFallback(p,h),authType:this.config.getContentGeneratorConfig()?.authType})}catch(a){throw n.aborted?a:(await I9(a,`Error generating content via API with model ${o}.`,{requestContents:e,requestConfig:s},"generateContent-api"),new Error(`Failed to generate content with model ${o}: ${or(a)}`))}}async generateTextOnly(e,r,n,i){let o=i??this.config.getModel(),s={...this.generateContentConfig,...r};try{let a={abortSignal:n,...s};return await CO(()=>this.getContentGenerator().generateContent({model:o,config:a,contents:e},this.lastPromptId),{onPersistent429:async(d,f)=>await this.handleFlashFallback(d,f),authType:this.config.getContentGeneratorConfig()?.authType})}catch(a){throw I9({error:a,debugInfo:{userId:"",sessionId:this.config.getSessionId(),conversationId:"",model:o,authType:this.config.getContentGeneratorConfig()?.authType}},"generateTextOnly-api"),new Error(`Failed to generate text content with model ${o}: ${or(a)}`)}}async generateEmbedding(e){if(!e||e.length===0)return[];let r={model:this.embeddingModel,contents:e},n=await this.getContentGenerator().embedContent(r);if(!n.embeddings||n.embeddings.length===0)throw new Error("No embeddings found in API response.");if(n.embeddings.length!==e.length)throw new Error(`API returned a mismatched number of embeddings. Expected ${e.length}, got ${n.embeddings.length}.`);return n.embeddings.map((i,o)=>{let s=i.values;if(!s||s.length===0)throw new Error(`API returned an empty embedding for input text at index ${o}: "${e[o]}"`);return s})}async shouldCompressChat(e=!1){let r=this.getChat().getHistory(!0);if(r.length===0)return!1;let n=this.config.getModel(),{totalTokens:i}=await this.getContentGenerator().countTokens({model:n,contents:r});return!(i===void 0||!e&&i<this.COMPRESSION_TOKEN_THRESHOLD*XF(n,this.config.getTokensLimit()))}async tryCompressChat(e,r=!1){if(!await this.shouldCompressChat(r))return null;let i=this.getChat().getHistory(!0),o=this.config.getModel(),{totalTokens:s}=await this.getContentGenerator().countTokens({model:o,contents:i});if(s===void 0)return console.warn(`Could not determine token count for model ${o}.`),null;let a=this.readFileStateManager.createBackup();this.readFileStateManager.clearState();let c=i.slice();this.getChat().setHistory(c);let u=await this.getChat().sendMessage({message:{text:pft()},config:{systemInstruction:{text:fft()},tools:[]}},e),d=sg(u);if(!d)return console.warn("No summary generated during compression."),null;let p=`
3339
3339
  `+"This session is being continued from a previous conversation that ran out of context. The conversation is summarized below:"+`
3340
3340
  `+d,h=[];if(Object.keys(a).length>0)try{h=await this.fileRecoveryService.recoverFiles(a),console.log(`Recovered ${h.length} files from backup`)}catch(E){console.warn("File recovery failed:",E)}let m=h.flatMap(E=>E.parts||[]),g;try{g={role:"user",parts:(await this.reminderManager.injectReminders([{text:p},...m],this.config)).parts}}catch(E){console.warn("Reminder injection during compression failed:",E),g={role:"user",parts:[{text:p},...m]}}let A=[g];this.chat=await this.startChat(A),this.forceFullIdeContext=!0;let{totalTokens:y}=await this.getContentGenerator().countTokens({model:this.config.getModel(),contents:this.getChat().getHistory(!0)},!0);return y===void 0?(console.warn("Could not determine compressed history token count."),null):{originalTokenCount:s,newTokenCount:y,summary:p}}async handleFlashFallback(e,r){if(e!==$t.LOGIN_WITH_IFLOW)return null;let n=this.config.getModel(),i=Xu;if(n===i)return null;let o=this.config.flashFallbackHandler;if(typeof o=="function")try{let s=await o(n,i,r);if(s!==!1&&s!==null)return this.config.setModel(i),this.config.setFallbackMode(!0),i;if(this.config.getModel()===i)return null}catch(s){console.warn("Flash fallback handler failed:",s)}return null}emitReminderEvent(e,r,n,i="medium"){this.reminderManager.emitEvent(e,r,n,i)}getReminderManager(){return this.reminderManager}restoreHistory(e){if(!this.chat)throw new Error("Chat not initialized. Call startChat() first.");this.getChat().setHistory(e)}async enhanceEnvironment(e){return await new zCe(this.config).enhanceEnvironmentParts(e)}}});var _we,ezr=ae(()=>{"use strict";ele();AO();qn();_we=class{sessions=new Map;async initializeClientTools(e,r,n){if(n&&n.length>0){let i=await r.getToolRegistry(),o=new Set(n.map(c=>c.name)),s=i.getAllTools(),a=[...n,...s.filter(c=>o.has(c.name)&&!n.some(u=>u.name===c.name))];i.tools=new Map,a.forEach(c=>i.registerTool(c))}else{let i=await r.getToolRegistry();i.tools=new Map}await e.setTools(),r.setGeminiClient(e)}async createSession(e,r,n,i,o,s){let a=await n.clone();a.setAgentCoreSystemPrompt(i.systemPrompt),a.setAgentColor(i.color);let c=new K9(a),u=a.getContentGeneratorConfig();if(!u)throw new Error(M.t("subAgentSessionManager.errors.contentGeneratorConfigNotAvailable"));await c.initialize(u),await this.initializeClientTools(c,a,s);let d={sessionId:i.sessionId,agentId:e,config:a,geminiClient:c,sessionConfig:i,messageHistory:[],startTime:Date.now(),currentRound:0};return this.sessions.set(i.sessionId,d),o.emit({type:Xr.SESSION_CREATED,agentId:e,agentIndex:r,timestamp:Date.now(),sessionConfig:i,data:{messageCount:0}}),d}getSession(e){return this.sessions.get(e)}addMessageToSession(e,r,n,i){let o=this.sessions.get(e);o&&(o.messageHistory.push(r),i.emit({type:Xr.SESSION_MESSAGE_ADDED,agentId:o.agentId,agentIndex:n,timestamp:Date.now(),sessionConfig:o.sessionConfig,data:{messageCount:o.messageHistory.length}}))}cleanupSession(e){this.sessions.delete(e)}getAllActiveSessions(){return Array.from(this.sessions.values())}getSessionCount(){return this.sessions.size}}});var ej,tzr=ae(()=>{"use strict";a4();ej=class{static SUPPORTED_MODELS=[{label:"Qwen3-Coder-480B-A35B(recommend)",value:"Qwen3-Coder"},{label:"Qwen3-235B-A22B",value:"Qwen3-235B"},{label:"Kimi K2",value:"KIMI-K2"},{label:"GLM-4.5",value:"glm-4.5"},{label:"Qwen3-235B-A22B-Thinking",value:"Qwen3-235B-A22B-Thinking-2507"},{label:"Qwen3-235B-A22B-Instruct",value:"Qwen3-235B-A22B-Instruct"}];static isModelSupported(e){return e?this.SUPPORTED_MODELS.some(r=>r.value===e):!1}static getAvailableModels(){return[...this.SUPPORTED_MODELS]}static getSupportedModelValues(){return this.SUPPORTED_MODELS.map(e=>e.value)}static getDefaultModel(){return C1}static getClosestSupportedModel(e,r){if(this.isModelSupported(e))return e;let n=e.toLowerCase(),i=this.SUPPORTED_MODELS.find(o=>o.value.toLowerCase().includes(n)||n.includes(o.value.toLowerCase()));return i?i.value:r||this.getDefaultModel()}static getModelLabel(e){let r=this.SUPPORTED_MODELS.find(n=>n.value===e);return r?r.label:e}static validateModel(e,r,n){if(!e)return{isValid:!1,model:e,reason:"Model name is empty",suggestedModel:r};if(n==="openai-compatible")return{isValid:!0,model:e};if(r&&e===r)return{isValid:!0,model:e};if(this.isModelSupported(e))return{isValid:!0,model:e};let i=this.getClosestSupportedModel(e,r);return{isValid:!1,model:e,reason:`Model '${e}' is not supported`,suggestedModel:i,availableModels:this.getAvailableModels()}}}});import*as Twe from"fs";import*as R3t from"path";import*as rzr from"os";var tj,B3t=ae(()=>{"use strict";AO();tj=class t{static SESSION_PREFERENCES=new Map;static CONFIG_DIR=R3t.join(rzr.homedir(),".iflow");static PREFERENCES_FILE=R3t.join(t.CONFIG_DIR,"model-preferences.json");static setSessionPreference(e,r){this.SESSION_PREFERENCES.set(e,r)}static getSessionPreference(e){return this.SESSION_PREFERENCES.get(e)||null}static clearSessionPreferences(){this.SESSION_PREFERENCES.clear()}static async setUserPreference(e,r){try{await this.ensureConfigDir();let n=await this.loadUserPreferences();n[e]={originalModel:e,fallbackModel:r,preference:ag.RememberAlways,createdAt:Date.now()},await this.saveUserPreferences(n)}catch(n){console.error("Failed to save user model preference:",n)}}static async getUserPreference(e){try{let n=(await this.loadUserPreferences())[e];return n?n.fallbackModel:null}catch(r){return console.error("Failed to load user model preference:",r),null}}static async getPreferredFallback(e){let r=this.getSessionPreference(e);return r||await this.getUserPreference(e)}static async savePreference(e,r,n){switch(n){case ag.OnceOnly:break;case ag.RememberSession:this.setSessionPreference(e,r);break;case ag.RememberAlways:await this.setUserPreference(e,r);break}}static async removeUserPreference(e){try{let r=await this.loadUserPreferences();delete r[e],await this.saveUserPreferences(r)}catch(r){console.error("Failed to remove user model preference:",r)}}static async getAllUserPreferences(){try{let e=await this.loadUserPreferences();return Object.values(e)}catch(e){return console.error("Failed to load user preferences:",e),[]}}static async clearAllUserPreferences(){try{await this.saveUserPreferences({})}catch(e){console.error("Failed to clear user preferences:",e)}}static async ensureConfigDir(){try{await Twe.promises.mkdir(this.CONFIG_DIR,{recursive:!0})}catch{}}static async loadUserPreferences(){try{let e=await Twe.promises.readFile(this.PREFERENCES_FILE,"utf-8");return JSON.parse(e)}catch{return{}}}static async saveUserPreferences(e){let r=JSON.stringify(e,null,2);await Twe.promises.writeFile(this.PREFERENCES_FILE,r,"utf-8")}}});function tle(t){let e=/^---\s*\n([\s\S]*?)---\s*\n?/,r=t.match(e);if(!r)return{frontmatter:{},content:t};let n=r[1]||"",i=t.slice(r[0].length),o={},s=n.split(`
3341
3341
  `);for(let a of s){let c=a.trim();if(!c||c.startsWith("#"))continue;let u=c.indexOf(":");if(u>0){let d=c.slice(0,u).trim(),f=c.slice(u+1).trim();if(d&&f){let p=$po(f);o[d]=p}}}return{frontmatter:o,content:i}}function $po(t){return t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'")?t.slice(1,-1):t==="true"||t==="yes"||t==="on"?!0:t==="false"||t==="no"||t==="off"?!1:t==="null"||t==="~"?null:/^-?\d+$/.test(t)?parseInt(t,10):/^-?\d*\.\d+$/.test(t)?parseFloat(t):t.includes(",")?t.split(",").map(e=>e.trim()):t}function jpo(t,e){if(Object.keys(t).length===0)return e;let r=`---
@@ -4100,7 +4100,7 @@ ${de.description}`:de.subject||de.description||"Thinking...",[]),ue=(0,Aa.useCal
4100
4100
  `,e-1);return{line:r===-1?0:t.slice(0,r+1).match(/\n/g).length,column:e-r-1}}function z6t(t,e,{oneBased:r=!1}={}){if(typeof t!="string")throw new TypeError("Text parameter should be a string");if(!Number.isInteger(e))throw new TypeError("Index parameter should be an integer");if(e<0||e>t.length)throw new RangeError("Index out of bounds");let n=EAo(t,e);return r?{line:n.line+1,column:n.column+1}:n}var vAo=t=>`\\u{${t.codePointAt(0).toString(16)}}`,Y6t=class t extends Error{name="JSONError";fileName;#e;#t;#r;#n;#o;constructor(e){if(typeof e=="string")super(),this.#r=e;else{let{jsonParseError:r,fileName:n,input:i}=e;super(void 0,{cause:r}),this.#e=i,this.#t=r,this.fileName=n}Error.captureStackTrace?.(this,t)}get message(){this.#r??=`${bAo(this.#t.message)}${this.#e===""?" while parsing empty string":""}`;let{codeFrame:e}=this;return`${this.#r}${this.fileName?` in ${this.fileName}`:""}${e?`
4101
4101
 
4102
4102
  ${e}
4103
- `:""}`}set message(e){this.#r=e}#i(e){if(!this.#t)return;let r=this.#e,n=CAo(r,this.#t.message);if(n)return(0,rtn.codeFrameColumns)(r,{start:n},{highlightCode:e})}get codeFrame(){return this.#n??=this.#i(!0),this.#n}get rawCodeFrame(){return this.#o??=this.#i(!1),this.#o}},CAo=(t,e)=>{let r=e.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);if(!r)return;let{index:n,line:i,column:o}=r.groups;return i&&o?{line:Number(i),column:Number(o)}:z6t(t,Number(n),{oneBased:!0})},bAo=t=>t.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(e,r,n)=>`"${n}"(${vAo(n)})`);function J6t(t,e,r){typeof e=="string"&&(r=e,e=void 0);try{return JSON.parse(t,e)}catch(n){throw new Y6t({jsonParseError:n,fileName:r,input:t})}}var Ztn=Fe(Ktn(),1);import{fileURLToPath as v3o}from"node:url";function Xtn(t){return t instanceof URL?v3o(t):t}var x3o=t=>b3o.resolve(Xtn(t)??".","package.json"),S3o=(t,e)=>{let r=typeof t=="string"?J6t(t):t;return e&&(0,Ztn.default)(r),r};async function ern({cwd:t,normalize:e=!0}={}){let r=await C3o.readFile(x3o(t),"utf8");return S3o(r,e)}async function trn(t){let e=await Ben("package.json",t);if(e)return{packageJson:await ern({...t,cwd:w3o.dirname(e)}),path:e}}import{fileURLToPath as _3o}from"url";import T3o from"path";var I3o=_3o(import.meta.url),D3o=T3o.dirname(I3o),cTe;async function qj(){if(cTe)return cTe;let t=await trn({cwd:D3o});if(t)return cTe=t.packageJson,cTe}async function CT(){let t=await qj();return"0.2.36"}Cs();Ot();import cM from"node:process";var rrn={name:"about",description:M.t("command.about"),kind:"built-in",action:async t=>{let e=cM.platform,r=M.t("aboutCommand.noSandbox");cM.env.SANDBOX&&cM.env.SANDBOX!=="sandbox-exec"?r=cM.env.SANDBOX:cM.env.SANDBOX==="sandbox-exec"&&(r=`sandbox-exec (${cM.env.SEATBELT_PROFILE||M.t("aboutCommand.unknown")})`);let n=t.services.config?.getModel()||M.t("aboutCommand.unknown"),i=await CT(),o=t.services.settings.merged.selectedAuthType||"",s=cM.env.GOOGLE_CLOUD_PROJECT||"",a={type:"about",cliVersion:i,osVersion:e,sandboxEnv:r,modelVersion:n,selectedAuthType:o,gcpProject:s};t.ui.addItem(a,Date.now())}};Ot();Ot();Cs();var dTe="\x1B[32m";var irn="\x1B[31m",bT="\x1B[36m",s0="\x1B[90m";var tl="\x1B[0m";function uTe(t,e,r,n=!1){let i="";if(t.length===0)return i="\u{1F534} ",`${i}${e}
4103
+ `:""}`}set message(e){this.#r=e}#i(e){if(!this.#t)return;let r=this.#e,n=CAo(r,this.#t.message);if(n)return(0,rtn.codeFrameColumns)(r,{start:n},{highlightCode:e})}get codeFrame(){return this.#n??=this.#i(!0),this.#n}get rawCodeFrame(){return this.#o??=this.#i(!1),this.#o}},CAo=(t,e)=>{let r=e.match(/in JSON at position (?<index>\d+)(?: \(line (?<line>\d+) column (?<column>\d+)\))?$/);if(!r)return;let{index:n,line:i,column:o}=r.groups;return i&&o?{line:Number(i),column:Number(o)}:z6t(t,Number(n),{oneBased:!0})},bAo=t=>t.replace(/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,(e,r,n)=>`"${n}"(${vAo(n)})`);function J6t(t,e,r){typeof e=="string"&&(r=e,e=void 0);try{return JSON.parse(t,e)}catch(n){throw new Y6t({jsonParseError:n,fileName:r,input:t})}}var Ztn=Fe(Ktn(),1);import{fileURLToPath as v3o}from"node:url";function Xtn(t){return t instanceof URL?v3o(t):t}var x3o=t=>b3o.resolve(Xtn(t)??".","package.json"),S3o=(t,e)=>{let r=typeof t=="string"?J6t(t):t;return e&&(0,Ztn.default)(r),r};async function ern({cwd:t,normalize:e=!0}={}){let r=await C3o.readFile(x3o(t),"utf8");return S3o(r,e)}async function trn(t){let e=await Ben("package.json",t);if(e)return{packageJson:await ern({...t,cwd:w3o.dirname(e)}),path:e}}import{fileURLToPath as _3o}from"url";import T3o from"path";var I3o=_3o(import.meta.url),D3o=T3o.dirname(I3o),cTe;async function qj(){if(cTe)return cTe;let t=await trn({cwd:D3o});if(t)return cTe=t.packageJson,cTe}async function CT(){let t=await qj();return"0.2.37-beta.0"}Cs();Ot();import cM from"node:process";var rrn={name:"about",description:M.t("command.about"),kind:"built-in",action:async t=>{let e=cM.platform,r=M.t("aboutCommand.noSandbox");cM.env.SANDBOX&&cM.env.SANDBOX!=="sandbox-exec"?r=cM.env.SANDBOX:cM.env.SANDBOX==="sandbox-exec"&&(r=`sandbox-exec (${cM.env.SEATBELT_PROFILE||M.t("aboutCommand.unknown")})`);let n=t.services.config?.getModel()||M.t("aboutCommand.unknown"),i=await CT(),o=t.services.settings.merged.selectedAuthType||"",s=cM.env.GOOGLE_CLOUD_PROJECT||"",a={type:"about",cliVersion:i,osVersion:e,sandboxEnv:r,modelVersion:n,selectedAuthType:o,gcpProject:s};t.ui.addItem(a,Date.now())}};Ot();Ot();Cs();var dTe="\x1B[32m";var irn="\x1B[31m",bT="\x1B[36m",s0="\x1B[90m";var tl="\x1B[0m";function uTe(t,e,r,n=!1){let i="";if(t.length===0)return i="\u{1F534} ",`${i}${e}
4104
4104
  ${irn}${M.t("agentsCommand.list.noAgentsFound")}${tl}
4105
4105
  `;i="\u{1F7E2} ";let o=`${i}${e}
4106
4106
  `;for(let s of t)n?o+=R3o(s):o+=`${dTe}- ${s.agentType}${tl}
@@ -4143,7 +4143,7 @@ ${s0}${M.t("agentsCommand.list.builtinAgents")}${tl}
4143
4143
  ${s0}${M.t("agentsCommand.list.generalPurpose")}
4144
4144
  ${tl}`;let c=n.length+i.length;t.ui.addItem({type:"info",text:`${dTe}${M.t("agentsCommand.refresh.success",{count:c})}${tl}
4145
4145
 
4146
- ${dTe}${a.trim()}${tl}`},Date.now())}catch(e){let r=or(e);t.ui.addItem({type:"error",text:`${irn}${M.t("agentsCommand.refresh.error",{error:r})}${tl}`},Date.now())}}},{name:"online",description:M.t("agentsCommand.subCommands.online"),kind:"built-in",action:(t,e)=>({type:"dialog",dialog:"agents-online"})},{name:"install",description:M.t("agentsCommand.subCommands.install"),kind:"built-in",action:(t,e)=>({type:"dialog",dialog:"agent-install"})}]};Ot();var srn={name:"auth",description:M.t("command.auth"),kind:"built-in",action:(t,e)=>({type:"dialog",dialog:"auth"})};lD();import gx from"node:process";import B3o from"node:os";Cs();Ot();var Gj="b9840864 (local modifications)";Ot();async function N3o(t,e){let r="https://apis.iflow.cn/v1/bug/report",i={content:JSON.stringify(t,null,2)},o={"Content-Type":"application/json"};e&&(o.Authorization=`Bearer ${e}`);try{let s=await fetch(r,{method:"POST",headers:o,body:JSON.stringify(i)});if(s.ok){let a=await s.json();return console.log("Bug report data sent successfully to endpoint"),a.success&&a.data?a.data:(console.warn("Unexpected response format from endpoint:",a),null)}else return console.warn(`Failed to send bug report to endpoint: ${s.status} ${s.statusText}`),null}catch(s){return console.warn("Failed to send bug report to endpoint:",s),null}}var arn={name:"bug",description:M.t("command.bug"),kind:"built-in",action:async(t,e)=>{let r=(e||"").trim(),{config:n}=t.services,i=xD(),o=`${gx.platform} ${gx.version}`,s=M.t("bugCommand.noSandbox");gx.env.SANDBOX&&gx.env.SANDBOX!=="sandbox-exec"?s=gx.env.SANDBOX.replace(/^iflow-(?:code-)?/,""):gx.env.SANDBOX==="sandbox-exec"&&(s=`sandbox-exec (${gx.env.SEATBELT_PROFILE||"unknown"})`);let a=n?.getModel()||M.t("bugCommand.unknown"),c=await CT(),u=bj(gx.memoryUsage().rss),d=i.getInMemoryErrors(),f=M.t("bugCommand.noRecentErrors");d.length>0&&(f=d.slice(-3).map(O=>M.t("bugCommand.errorWithTimestamp",{timestamp:O.timestamp,error:O.error})).join(`
4146
+ ${dTe}${a.trim()}${tl}`},Date.now())}catch(e){let r=or(e);t.ui.addItem({type:"error",text:`${irn}${M.t("agentsCommand.refresh.error",{error:r})}${tl}`},Date.now())}}},{name:"online",description:M.t("agentsCommand.subCommands.online"),kind:"built-in",action:(t,e)=>({type:"dialog",dialog:"agents-online"})},{name:"install",description:M.t("agentsCommand.subCommands.install"),kind:"built-in",action:(t,e)=>({type:"dialog",dialog:"agent-install"})}]};Ot();var srn={name:"auth",description:M.t("command.auth"),kind:"built-in",action:(t,e)=>({type:"dialog",dialog:"auth"})};lD();import gx from"node:process";import B3o from"node:os";Cs();Ot();var Gj="df0412a64 (local modifications)";Ot();async function N3o(t,e){let r="https://apis.iflow.cn/v1/bug/report",i={content:JSON.stringify(t,null,2)},o={"Content-Type":"application/json"};e&&(o.Authorization=`Bearer ${e}`);try{let s=await fetch(r,{method:"POST",headers:o,body:JSON.stringify(i)});if(s.ok){let a=await s.json();return console.log("Bug report data sent successfully to endpoint"),a.success&&a.data?a.data:(console.warn("Unexpected response format from endpoint:",a),null)}else return console.warn(`Failed to send bug report to endpoint: ${s.status} ${s.statusText}`),null}catch(s){return console.warn("Failed to send bug report to endpoint:",s),null}}var arn={name:"bug",description:M.t("command.bug"),kind:"built-in",action:async(t,e)=>{let r=(e||"").trim(),{config:n}=t.services,i=xD(),o=`${gx.platform} ${gx.version}`,s=M.t("bugCommand.noSandbox");gx.env.SANDBOX&&gx.env.SANDBOX!=="sandbox-exec"?s=gx.env.SANDBOX.replace(/^iflow-(?:code-)?/,""):gx.env.SANDBOX==="sandbox-exec"&&(s=`sandbox-exec (${gx.env.SEATBELT_PROFILE||"unknown"})`);let a=n?.getModel()||M.t("bugCommand.unknown"),c=await CT(),u=bj(gx.memoryUsage().rss),d=i.getInMemoryErrors(),f=M.t("bugCommand.noRecentErrors");d.length>0&&(f=d.slice(-3).map(O=>M.t("bugCommand.errorWithTimestamp",{timestamp:O.timestamp,error:O.error})).join(`
4147
4147
 
4148
4148
  `));let p=B3o.userInfo().username,h=w=>{if(!p)return w;let O=new RegExp(`/${p}/`,"g");return w.replace(O,"/user/")},m=`CLI Version: ${c}
4149
4149
  Git Commit: ${Gj}
@@ -5186,7 +5186,7 @@ ${M.t("gemini.errors.criticalUnhandledRejection")}
5186
5186
  =========================================
5187
5187
  ${M.t("gemini.errors.reason",{reason:e})}${e instanceof Error&&e.stack?`
5188
5188
  ${M.t("gemini.errors.stackTrace")}
5189
- ${e.stack}`:""}`;ea.emit("log-error",n),t||(t=!0,ea.emit("open-debug-console"))})}function CSo(){console.log(M.t("gemini.crashDiagnosticsEnabled")),process.setUncaughtExceptionCaptureCallback(t=>{let e={timestamp:new Date().toISOString(),error:{name:t.name,message:t.message,stack:t.stack},memory:process.memoryUsage(),pid:process.pid,cwd:process.cwd(),nodeVersion:process.version,platform:process.platform,arch:process.arch,uptime:process.uptime(),env:{NODE_ENV:"production",SANDBOX:process.env.SANDBOX,CLI_VERSION:"0.2.36"}},r=`crash-${Date.now()}-${process.pid}.json`,n=dSo.join(process.cwd(),r);try{gSo.writeFileSync(n,JSON.stringify(e,null,2)),console.error(M.t("gemini.crashDetected",{crashFilePath:n})),console.error(M.t("gemini.coreDumpWillBeGenerated"))}catch(i){console.error(M.t("gemini.failedToWriteCrashFile"),i)}process.abort()}),process.on("warning",t=>{console.warn(M.t("gemini.debug.nodejsWarning"),{name:t.name,message:t.message,stack:t.stack})}),process.on("unhandledRejection",(t,e)=>{console.error(M.t("gemini.debug.unhandledPromiseRejectionDetected"),{reason:t,promise:e.toString()})})}async function $mn(){vSo();let t=process.cwd(),e=jl(t);if(!e.user.settings.cna){let p=await s0e();p&&e.setValue("User","cna",p)}if(await Eun(),e.errors.length>0){for(let p of e.errors){let h=M.t("gemini.errorInFile",{path:p.path,message:p.message});process.env.NO_COLOR||(h=`\x1B[31m${h}\x1B[0m`),console.error(h),console.error(M.t("gemini.pleaseFixFileAndTryAgain",{path:p.path}))}process.exit(1)}let r=await QIe();(!!r.prompt&&!r.promptInteractive&&!r.continue&&!r.resume||r.experimentalAcp)&&(process.env.IFLOW_NON_INTERACTIVE="true");let i=kT(t),o=await LM(e.merged,i,o0.generateSessionId(),r);if(M.changeLanguage(o.getLanguage()),o.getDebugMode()&&CSo(),hSo.setDefaultResultOrder(ASo(e.merged.dnsResolutionOrder)),r.promptInteractive&&!process.stdin.isTTY&&(console.error(M.t("gemini.errors.promptInteractiveFlagNotSupported")),process.exit(1)),o.getListExtensions()){console.debug(M.t("gemini.installedExtensions"));for(let p of i)console.debug(`- ${p.config.name}`);process.exit(0)}if(r._&&r._[0]==="agent"){let{agentCommand:p}=await Promise.resolve().then(()=>(V5t(),gun)),h=(await Promise.resolve().then(()=>(C8t(),v8t))).default;await h().scriptName("iflow").command(p).help().version(!1).parse(),process.exit(0)}if(r._&&r._[0]==="commands"){let{commandsCommand:p}=await Promise.resolve().then(()=>(G5t(),nun)),h=(await Promise.resolve().then(()=>(C8t(),v8t))).default;await h().scriptName("iflow").command(p).help().version(!1).parse(),process.exit(0)}if(e.merged.selectedAuthType||process.env.CLOUD_SHELL==="true"&&e.setValue("User","selectedAuthType",$t.CLOUD_SHELL),Gsn(o.getDebugMode()),await o.initialize(),Ma.loadCustomThemes(e.merged.customThemes),e.merged.theme&&(Ma.setActiveTheme(e.merged.theme)||console.warn(M.t("gemini.themeNotFound",{theme:e.merged.theme}))),!process.env.SANDBOX){let p=e.merged.autoConfigureMaxOldSpaceSize?ySo(o):[],h=o.getSandbox();if(h){if(e.merged.selectedAuthType&&!e.merged.useExternalAuth)try{let m=SM(e.merged.selectedAuthType);if(m)throw new Error(m);await o.refreshAuth(e.merged.selectedAuthType,{apiKey:e.merged.apiKey,baseUrl:e.merged.baseUrl,modelName:e.merged.modelName})}catch(m){console.error(M.t("gemini.errorAuthenticating"),m),process.exit(1)}await Cfn(h,p,o),process.exit(0)}else p.length>0&&(await ESo(p),process.exit(0))}if(e.merged.selectedAuthType===$t.LOGIN_WITH_IFLOW&&o.isBrowserLaunchSuppressed()&&await uD(e.merged.selectedAuthType,o),o.getExperimentalAcp())return o.getAcpPort()?await nmn(o,e,i,r,o.getAcpPort()):J0n(o,e,i,r);let s=o.getQuestion(),a=[...await bfn(),...await Sfn(t)];if(!!r.promptInteractive||!!r.continue||!!r.resume||process.stdin.isTTY&&s?.length===0){console.clear();let p=await CT();Wmn(Vmn(t),e);try{await o.setIdeModeAndSyncConnection(!0)}catch(E){console.error(M.t("gemini.failedToConnectToIdeServer"),E)}let h,m=async()=>{try{if(console.clear(),Wmn(Vmn(t),e),h)try{h.unmount(),await new Promise(x=>process.nextTick(x))}catch(x){console.error(M.t("gemini.errorDuringUnmount"),x)}let{executeSessionStartHooks:E}=await Promise.resolve().then(()=>(fM(),dM)),C=await E(o,"resume");h=ufe((0,oue.jsx)(b8t.default.StrictMode,{children:(0,oue.jsx)(wvt,{instance:()=>h,config:o,settings:e,startupWarnings:a,version:p,continueMode:!!r.continue,resumeMode:!!r.resume,resumeSessionId:r.resume,fgMode:!0,sessionStartContext:C})}),{exitOnCtrlC:!1,isScreenReaderEnabled:!1})}catch(E){console.error(M.t("gemini.errorDuringResume"),E)}};process.on("SIGCONT",m),_ce(()=>{process.off("SIGCONT",m)});let g="startup";(r.continue||r.resume)&&(g="resume");let{executeSessionStartHooks:A}=await Promise.resolve().then(()=>(fM(),dM)),y=await A(o,g);h=ufe((0,oue.jsx)(b8t.default.StrictMode,{children:(0,oue.jsx)(wvt,{instance:()=>h,config:o,settings:e,startupWarnings:a,version:p,continueMode:!!r.continue,resumeMode:!!r.resume,resumeSessionId:r.resume,sessionStartContext:y})}),{exitOnCtrlC:!1,isScreenReaderEnabled:!1}),e.merged.disableAutoUpdate||G0n().then(E=>{Fdn(E,e,o.getProjectRoot())}).catch(E=>{o.getDebugMode()&&console.error(M.t("gemini.updateCheckFailed"),E)}),_ce(()=>h.unmount());return}!process.stdin.isTTY&&!s&&(s+=await Afn()),s||(console.error(M.t("gemini.noInputProvidedViaStdin")),process.exit(1));let u=Math.random().toString(16).slice(2);Z$(o,{"event.name":"user_prompt","event.timestamp":new Date().toISOString(),prompt:s,prompt_id:u,auth_type:o.getContentGeneratorConfig()?.authType,prompt_length:s.length});let d=await bSo(o,i,e,r),f=r.outputFile||r.output_file;await _fn(d,s,u,f),process.exit(0)}function Wmn(t,e){if(!e.merged.hideWindowTitle){let r=(process.env.CLI_TITLE||`iFlow - ${t}`).replace(/[\x00-\x1F\x7F]/g,"");process.stdout.write(`\x1B]2;${r}\x07`),process.on("exit",()=>{process.stdout.write("\x1B]2;\x07")})}}async function bSo(t,e,r,n){let i=t;if(t.getApprovalMode()!==$n.YOLO){let o=r.merged.excludeTools||[],s=[pu.Name,Af.Name,ld.Name],a=[...new Set([...o,...s])],c={...r.merged,excludeTools:a},u={...n};i=await LM(c,e,t.getSessionId(),u),await i.initialize()}return await xSo(r.merged.selectedAuthType,i,r)}async function xSo(t,e,r){!t&&!process.env.GEMINI_API_KEY&&!E0e()&&(console.error(M.t("gemini.pleaseSetAuthMethod",{userSettingsPath:sM})),process.exit(1)),t||(E0e()?t=$t.IFLOW:t=$t.IFLOW);let n=SM(t);return n!=null&&(console.error(n),process.exit(1)),await e.refreshAuth(t,{apiKey:r.merged.apiKey,baseUrl:r.merged.baseUrl,modelName:r.merged.modelName}),e}$mn().catch(t=>{console.error("An unexpected critical error occurred:"),t instanceof Error?console.error(t.stack):console.error(String(t)),process.exit(1)});
5189
+ ${e.stack}`:""}`;ea.emit("log-error",n),t||(t=!0,ea.emit("open-debug-console"))})}function CSo(){console.log(M.t("gemini.crashDiagnosticsEnabled")),process.setUncaughtExceptionCaptureCallback(t=>{let e={timestamp:new Date().toISOString(),error:{name:t.name,message:t.message,stack:t.stack},memory:process.memoryUsage(),pid:process.pid,cwd:process.cwd(),nodeVersion:process.version,platform:process.platform,arch:process.arch,uptime:process.uptime(),env:{NODE_ENV:"production",SANDBOX:process.env.SANDBOX,CLI_VERSION:"0.2.37-beta.0"}},r=`crash-${Date.now()}-${process.pid}.json`,n=dSo.join(process.cwd(),r);try{gSo.writeFileSync(n,JSON.stringify(e,null,2)),console.error(M.t("gemini.crashDetected",{crashFilePath:n})),console.error(M.t("gemini.coreDumpWillBeGenerated"))}catch(i){console.error(M.t("gemini.failedToWriteCrashFile"),i)}process.abort()}),process.on("warning",t=>{console.warn(M.t("gemini.debug.nodejsWarning"),{name:t.name,message:t.message,stack:t.stack})}),process.on("unhandledRejection",(t,e)=>{console.error(M.t("gemini.debug.unhandledPromiseRejectionDetected"),{reason:t,promise:e.toString()})})}async function $mn(){vSo();let t=process.cwd(),e=jl(t);if(!e.user.settings.cna){let p=await s0e();p&&e.setValue("User","cna",p)}if(await Eun(),e.errors.length>0){for(let p of e.errors){let h=M.t("gemini.errorInFile",{path:p.path,message:p.message});process.env.NO_COLOR||(h=`\x1B[31m${h}\x1B[0m`),console.error(h),console.error(M.t("gemini.pleaseFixFileAndTryAgain",{path:p.path}))}process.exit(1)}let r=await QIe();(!!r.prompt&&!r.promptInteractive&&!r.continue&&!r.resume||r.experimentalAcp)&&(process.env.IFLOW_NON_INTERACTIVE="true");let i=kT(t),o=await LM(e.merged,i,o0.generateSessionId(),r);if(M.changeLanguage(o.getLanguage()),o.getDebugMode()&&CSo(),hSo.setDefaultResultOrder(ASo(e.merged.dnsResolutionOrder)),r.promptInteractive&&!process.stdin.isTTY&&(console.error(M.t("gemini.errors.promptInteractiveFlagNotSupported")),process.exit(1)),o.getListExtensions()){console.debug(M.t("gemini.installedExtensions"));for(let p of i)console.debug(`- ${p.config.name}`);process.exit(0)}if(r._&&r._[0]==="agent"){let{agentCommand:p}=await Promise.resolve().then(()=>(V5t(),gun)),h=(await Promise.resolve().then(()=>(C8t(),v8t))).default;await h().scriptName("iflow").command(p).help().version(!1).parse(),process.exit(0)}if(r._&&r._[0]==="commands"){let{commandsCommand:p}=await Promise.resolve().then(()=>(G5t(),nun)),h=(await Promise.resolve().then(()=>(C8t(),v8t))).default;await h().scriptName("iflow").command(p).help().version(!1).parse(),process.exit(0)}if(e.merged.selectedAuthType||process.env.CLOUD_SHELL==="true"&&e.setValue("User","selectedAuthType",$t.CLOUD_SHELL),Gsn(o.getDebugMode()),await o.initialize(),Ma.loadCustomThemes(e.merged.customThemes),e.merged.theme&&(Ma.setActiveTheme(e.merged.theme)||console.warn(M.t("gemini.themeNotFound",{theme:e.merged.theme}))),!process.env.SANDBOX){let p=e.merged.autoConfigureMaxOldSpaceSize?ySo(o):[],h=o.getSandbox();if(h){if(e.merged.selectedAuthType&&!e.merged.useExternalAuth)try{let m=SM(e.merged.selectedAuthType);if(m)throw new Error(m);await o.refreshAuth(e.merged.selectedAuthType,{apiKey:e.merged.apiKey,baseUrl:e.merged.baseUrl,modelName:e.merged.modelName})}catch(m){console.error(M.t("gemini.errorAuthenticating"),m),process.exit(1)}await Cfn(h,p,o),process.exit(0)}else p.length>0&&(await ESo(p),process.exit(0))}if(e.merged.selectedAuthType===$t.LOGIN_WITH_IFLOW&&o.isBrowserLaunchSuppressed()&&await uD(e.merged.selectedAuthType,o),o.getExperimentalAcp())return o.getAcpPort()?await nmn(o,e,i,r,o.getAcpPort()):J0n(o,e,i,r);let s=o.getQuestion(),a=[...await bfn(),...await Sfn(t)];if(!!r.promptInteractive||!!r.continue||!!r.resume||process.stdin.isTTY&&s?.length===0){console.clear();let p=await CT();Wmn(Vmn(t),e);try{await o.setIdeModeAndSyncConnection(!0)}catch(E){console.error(M.t("gemini.failedToConnectToIdeServer"),E)}let h,m=async()=>{try{if(console.clear(),Wmn(Vmn(t),e),h)try{h.unmount(),await new Promise(x=>process.nextTick(x))}catch(x){console.error(M.t("gemini.errorDuringUnmount"),x)}let{executeSessionStartHooks:E}=await Promise.resolve().then(()=>(fM(),dM)),C=await E(o,"resume");h=ufe((0,oue.jsx)(b8t.default.StrictMode,{children:(0,oue.jsx)(wvt,{instance:()=>h,config:o,settings:e,startupWarnings:a,version:p,continueMode:!!r.continue,resumeMode:!!r.resume,resumeSessionId:r.resume,fgMode:!0,sessionStartContext:C})}),{exitOnCtrlC:!1,isScreenReaderEnabled:!1})}catch(E){console.error(M.t("gemini.errorDuringResume"),E)}};process.on("SIGCONT",m),_ce(()=>{process.off("SIGCONT",m)});let g="startup";(r.continue||r.resume)&&(g="resume");let{executeSessionStartHooks:A}=await Promise.resolve().then(()=>(fM(),dM)),y=await A(o,g);h=ufe((0,oue.jsx)(b8t.default.StrictMode,{children:(0,oue.jsx)(wvt,{instance:()=>h,config:o,settings:e,startupWarnings:a,version:p,continueMode:!!r.continue,resumeMode:!!r.resume,resumeSessionId:r.resume,sessionStartContext:y})}),{exitOnCtrlC:!1,isScreenReaderEnabled:!1}),e.merged.disableAutoUpdate||G0n().then(E=>{Fdn(E,e,o.getProjectRoot())}).catch(E=>{o.getDebugMode()&&console.error(M.t("gemini.updateCheckFailed"),E)}),_ce(()=>h.unmount());return}!process.stdin.isTTY&&!s&&(s+=await Afn()),s||(console.error(M.t("gemini.noInputProvidedViaStdin")),process.exit(1));let u=Math.random().toString(16).slice(2);Z$(o,{"event.name":"user_prompt","event.timestamp":new Date().toISOString(),prompt:s,prompt_id:u,auth_type:o.getContentGeneratorConfig()?.authType,prompt_length:s.length});let d=await bSo(o,i,e,r),f=r.outputFile||r.output_file;await _fn(d,s,u,f),process.exit(0)}function Wmn(t,e){if(!e.merged.hideWindowTitle){let r=(process.env.CLI_TITLE||`iFlow - ${t}`).replace(/[\x00-\x1F\x7F]/g,"");process.stdout.write(`\x1B]2;${r}\x07`),process.on("exit",()=>{process.stdout.write("\x1B]2;\x07")})}}async function bSo(t,e,r,n){let i=t;if(t.getApprovalMode()!==$n.YOLO){let o=r.merged.excludeTools||[],s=[pu.Name,Af.Name,ld.Name],a=[...new Set([...o,...s])],c={...r.merged,excludeTools:a},u={...n};i=await LM(c,e,t.getSessionId(),u),await i.initialize()}return await xSo(r.merged.selectedAuthType,i,r)}async function xSo(t,e,r){!t&&!process.env.GEMINI_API_KEY&&!E0e()&&(console.error(M.t("gemini.pleaseSetAuthMethod",{userSettingsPath:sM})),process.exit(1)),t||(E0e()?t=$t.IFLOW:t=$t.IFLOW);let n=SM(t);return n!=null&&(console.error(n),process.exit(1)),await e.refreshAuth(t,{apiKey:r.merged.apiKey,baseUrl:r.merged.baseUrl,modelName:r.merged.modelName}),e}$mn().catch(t=>{console.error("An unexpected critical error occurred:"),t instanceof Error?console.error(t.stack):console.error(String(t)),process.exit(1)});
5190
5190
  /**
5191
5191
  * @license
5192
5192
  * Copyright 2025 Google LLC