diff --git a/docs/projects/pokemon-professor/.obsidian/app.json b/docs/projects/pokemon-professor/.obsidian/app.json new file mode 100644 index 0000000..c66fd55 --- /dev/null +++ b/docs/projects/pokemon-professor/.obsidian/app.json @@ -0,0 +1,5 @@ +{ + "promptDelete": false, + "alwaysUpdateLinks": true, + "attachmentFolderPath": "Attachements" +} \ No newline at end of file diff --git a/docs/projects/pokemon-professor/.obsidian/appearance.json b/docs/projects/pokemon-professor/.obsidian/appearance.json new file mode 100644 index 0000000..9e26dfe --- /dev/null +++ b/docs/projects/pokemon-professor/.obsidian/appearance.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/docs/projects/pokemon-professor/.obsidian/community-plugins.json b/docs/projects/pokemon-professor/.obsidian/community-plugins.json new file mode 100644 index 0000000..b3b377f --- /dev/null +++ b/docs/projects/pokemon-professor/.obsidian/community-plugins.json @@ -0,0 +1,4 @@ +[ + "dataview", + "copilot" +] \ No newline at end of file diff --git a/docs/projects/pokemon-professor/.obsidian/core-plugins.json b/docs/projects/pokemon-professor/.obsidian/core-plugins.json new file mode 100644 index 0000000..1e23978 --- /dev/null +++ b/docs/projects/pokemon-professor/.obsidian/core-plugins.json @@ -0,0 +1,33 @@ +{ + "file-explorer": true, + "global-search": true, + "switcher": true, + "graph": true, + "backlink": true, + "canvas": true, + "outgoing-link": true, + "tag-pane": true, + "properties": false, + "page-preview": true, + "daily-notes": true, + "templates": true, + "note-composer": true, + "command-palette": true, + "slash-command": false, + "editor-status": true, + "bookmarks": true, + "markdown-importer": false, + "zk-prefixer": false, + "random-note": false, + "outline": true, + "word-count": true, + "slides": false, + "audio-recorder": false, + "workspaces": false, + "file-recovery": true, + "publish": false, + "sync": true, + "webviewer": false, + "footnotes": false, + "bases": true +} \ No newline at end of file diff --git a/docs/projects/pokemon-professor/.obsidian/graph.json b/docs/projects/pokemon-professor/.obsidian/graph.json new file mode 100644 index 0000000..42a46ec --- /dev/null +++ b/docs/projects/pokemon-professor/.obsidian/graph.json @@ -0,0 +1,22 @@ +{ + "collapse-filter": true, + "search": "", + "showTags": false, + "showAttachments": false, + "hideUnresolved": false, + "showOrphans": true, + "collapse-color-groups": true, + "colorGroups": [], + "collapse-display": true, + "showArrow": false, + "textFadeMultiplier": 0, + "nodeSizeMultiplier": 1, + "lineSizeMultiplier": 1, + "collapse-forces": true, + "centerStrength": 0.518713248970312, + "repelStrength": 10, + "linkStrength": 1, + "linkDistance": 250, + "scale": 1, + "close": true +} \ No newline at end of file diff --git a/docs/projects/pokemon-professor/.obsidian/plugins/copilot/data.json b/docs/projects/pokemon-professor/.obsidian/plugins/copilot/data.json new file mode 100644 index 0000000..91f8502 --- /dev/null +++ b/docs/projects/pokemon-professor/.obsidian/plugins/copilot/data.json @@ -0,0 +1,386 @@ +{ + "userId": "7d368208-99d0-458a-9891-ac6edf40d8a7", + "isPlusUser": false, + "plusLicenseKey": "", + "openAIApiKey": "", + "openAIOrgId": "", + "huggingfaceApiKey": "", + "cohereApiKey": "", + "anthropicApiKey": "", + "azureOpenAIApiKey": "", + "azureOpenAIApiInstanceName": "", + "azureOpenAIApiDeploymentName": "", + "azureOpenAIApiVersion": "", + "azureOpenAIApiEmbeddingDeploymentName": "", + "googleApiKey": "", + "openRouterAiApiKey": "", + "xaiApiKey": "", + "mistralApiKey": "", + "deepseekApiKey": "", + "amazonBedrockApiKey": "", + "amazonBedrockRegion": "", + "siliconflowApiKey": "", + "defaultChainType": "llm_chain", + "defaultModelKey": "google/gemini-2.5-flash|openrouterai", + "embeddingModelKey": "text-embedding-3-small|openai", + "temperature": 0.1, + "maxTokens": 6000, + "contextTurns": 15, + "userSystemPrompt": "", + "openAIProxyBaseUrl": "", + "openAIEmbeddingProxyBaseUrl": "", + "stream": true, + "defaultSaveFolder": "copilot/copilot-conversations", + "defaultConversationTag": "copilot-conversation", + "autosaveChat": true, + "generateAIChatTitleOnSave": true, + "includeActiveNoteAsContext": true, + "defaultOpenArea": "view", + "defaultSendShortcut": "enter", + "customPromptsFolder": "copilot/copilot-custom-prompts", + "indexVaultToVectorStore": "ON MODE SWITCH", + "qaExclusions": "copilot", + "qaInclusions": "", + "chatNoteContextPath": "", + "chatNoteContextTags": [], + "enableIndexSync": true, + "debug": false, + "enableEncryption": false, + "maxSourceChunks": 15, + "enableInlineCitations": true, + "groqApiKey": "", + "activeModels": [ + { + "name": "copilot-plus-flash", + "provider": "copilot-plus", + "enabled": true, + "isBuiltIn": true, + "core": true, + "plusExclusive": true, + "projectEnabled": false, + "capabilities": [ + "vision" + ] + }, + { + "name": "google/gemini-2.5-flash-lite", + "provider": "openrouterai", + "enabled": true, + "isBuiltIn": true, + "core": true, + "projectEnabled": true, + "capabilities": [ + "vision" + ] + }, + { + "name": "google/gemini-2.5-flash", + "provider": "openrouterai", + "enabled": true, + "isBuiltIn": true, + "core": true, + "projectEnabled": true, + "capabilities": [ + "vision" + ] + }, + { + "name": "google/gemini-2.5-pro", + "provider": "openrouterai", + "enabled": true, + "isBuiltIn": true, + "core": true, + "projectEnabled": true, + "capabilities": [ + "vision" + ] + }, + { + "name": "gpt-5", + "provider": "openai", + "enabled": true, + "isBuiltIn": true, + "core": true, + "capabilities": [ + "vision" + ] + }, + { + "name": "gpt-5-mini", + "provider": "openai", + "enabled": true, + "isBuiltIn": true, + "core": true, + "capabilities": [ + "vision" + ] + }, + { + "name": "gpt-4.1", + "provider": "openai", + "enabled": true, + "isBuiltIn": true, + "core": true, + "projectEnabled": true, + "capabilities": [ + "vision" + ] + }, + { + "name": "gpt-4.1-mini", + "provider": "openai", + "enabled": true, + "isBuiltIn": true, + "core": true, + "projectEnabled": true, + "capabilities": [ + "vision" + ] + }, + { + "name": "openai/gpt-4.1", + "provider": "openrouterai", + "enabled": true, + "isBuiltIn": true, + "core": false, + "projectEnabled": true, + "capabilities": [ + "vision" + ] + }, + { + "name": "openai/gpt-4.1-mini", + "provider": "openrouterai", + "enabled": true, + "isBuiltIn": true, + "core": false, + "projectEnabled": true, + "capabilities": [ + "vision" + ] + }, + { + "name": "grok-4-fast", + "provider": "xai", + "enabled": true, + "isBuiltIn": true, + "core": false, + "projectEnabled": true, + "capabilities": [ + "vision" + ] + }, + { + "name": "x-ai/grok-4-fast", + "provider": "openrouterai", + "enabled": true, + "isBuiltIn": true, + "core": false, + "projectEnabled": true, + "capabilities": [ + "vision" + ] + }, + { + "name": "claude-sonnet-4-20250514", + "provider": "anthropic", + "enabled": true, + "isBuiltIn": true, + "capabilities": [ + "vision", + "reasoning" + ] + }, + { + "name": "gemini-2.5-flash", + "provider": "google", + "enabled": true, + "isBuiltIn": true, + "projectEnabled": true, + "capabilities": [ + "vision" + ] + }, + { + "name": "gemini-2.5-flash-lite", + "provider": "google", + "enabled": true, + "isBuiltIn": true, + "projectEnabled": true, + "capabilities": [ + "vision" + ] + }, + { + "name": "gemini-2.5-pro", + "provider": "google", + "enabled": true, + "isBuiltIn": true, + "projectEnabled": true, + "capabilities": [ + "vision" + ] + }, + { + "name": "azure-openai", + "provider": "azure openai", + "enabled": true, + "isBuiltIn": true + }, + { + "name": "deepseek-chat", + "provider": "deepseek", + "enabled": true, + "isBuiltIn": true + }, + { + "name": "deepseek-reasoner", + "provider": "deepseek", + "enabled": true, + "isBuiltIn": true, + "capabilities": [ + "reasoning" + ] + }, + { + "name": "deepseek-ai/DeepSeek-V3", + "provider": "siliconflow", + "enabled": false, + "isBuiltIn": false, + "baseUrl": "https://api.siliconflow.com/v1" + }, + { + "name": "deepseek-ai/DeepSeek-R1", + "provider": "siliconflow", + "enabled": false, + "isBuiltIn": false, + "baseUrl": "https://api.siliconflow.com/v1", + "capabilities": [ + "reasoning" + ] + } + ], + "activeEmbeddingModels": [ + { + "name": "copilot-plus-small", + "provider": "copilot-plus", + "enabled": true, + "isBuiltIn": true, + "isEmbeddingModel": true, + "core": true, + "plusExclusive": true + }, + { + "name": "copilot-plus-large", + "provider": "copilot-plus-jina", + "enabled": true, + "isBuiltIn": true, + "isEmbeddingModel": true, + "core": true, + "plusExclusive": true, + "believerExclusive": true, + "dimensions": 1024 + }, + { + "name": "copilot-plus-multilingual", + "provider": "copilot-plus-jina", + "enabled": true, + "isBuiltIn": true, + "isEmbeddingModel": true, + "core": true, + "plusExclusive": true, + "dimensions": 512 + }, + { + "name": "text-embedding-3-small", + "provider": "openai", + "enabled": true, + "isBuiltIn": true, + "isEmbeddingModel": true, + "core": true + }, + { + "name": "gemini-embedding-001", + "provider": "google", + "enabled": true, + "isBuiltIn": true, + "isEmbeddingModel": true, + "core": true + }, + { + "name": "Qwen/Qwen3-Embedding-0.6B", + "provider": "siliconflow", + "enabled": true, + "isBuiltIn": true, + "isEmbeddingModel": true, + "core": true, + "baseUrl": "https://api.siliconflow.com/v1" + }, + { + "name": "text-embedding-3-large", + "provider": "openai", + "enabled": true, + "isBuiltIn": true, + "isEmbeddingModel": true + }, + { + "name": "embed-multilingual-light-v3.0", + "provider": "cohereai", + "enabled": true, + "isBuiltIn": true, + "isEmbeddingModel": true + }, + { + "name": "text-embedding-004", + "provider": "google", + "enabled": true, + "isBuiltIn": true, + "isEmbeddingModel": true + }, + { + "name": "azure-openai", + "provider": "azure openai", + "enabled": true, + "isBuiltIn": true, + "isEmbeddingModel": true + } + ], + "embeddingRequestsPerMin": 60, + "embeddingBatchSize": 16, + "disableIndexOnMobile": true, + "showSuggestedPrompts": true, + "showRelevantNotes": true, + "numPartitions": 1, + "lexicalSearchRamLimit": 100, + "promptUsageTimestamps": {}, + "promptSortStrategy": "timestamp", + "defaultConversationNoteName": "{$topic}@{$date}_{$time}", + "inlineEditCommands": [], + "projectList": [], + "lastDismissedVersion": null, + "passMarkdownImages": true, + "enableAutonomousAgent": true, + "enableCustomPromptTemplating": true, + "enableSemanticSearchV3": false, + "enableLexicalBoosts": true, + "suggestedDefaultCommands": true, + "autonomousAgentMaxIterations": 4, + "autonomousAgentEnabledToolIds": [ + "localSearch", + "readNote", + "webSearch", + "pomodoro", + "youtubeTranscription", + "writeToFile", + "replaceInFile", + "updateMemory" + ], + "reasoningEffort": "low", + "verbosity": "medium", + "memoryFolderName": "copilot/memory", + "enableRecentConversations": true, + "maxRecentConversations": 30, + "enableSavedMemory": true, + "quickCommandIncludeNoteContext": true, + "autoIncludeTextSelection": false +} \ No newline at end of file diff --git a/docs/projects/pokemon-professor/.obsidian/plugins/copilot/main.js b/docs/projects/pokemon-professor/.obsidian/plugins/copilot/main.js new file mode 100644 index 0000000..80d31bc --- /dev/null +++ b/docs/projects/pokemon-professor/.obsidian/plugins/copilot/main.js @@ -0,0 +1,3063 @@ +/* +THIS IS A GENERATED/BUNDLED FILE BY ESBUILD +if you want to view the source, please visit the github repository of this plugin +*/ + +// Polyfill for import.meta in CommonJS context +if (typeof import_meta === 'undefined') { + var import_meta = { + url: typeof __filename !== 'undefined' ? 'file://' + __filename : 'file:///obsidian-plugin' + }; +} + +var Win=Object.create;var sY=Object.defineProperty;var Gin=Object.getOwnPropertyDescriptor;var Zin=Object.getOwnPropertyNames;var Xin=Object.getPrototypeOf,Yin=Object.prototype.hasOwnProperty;var nwt=t=>{throw TypeError(t)};var Qin=(t,e,r)=>e in t?sY(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var v=(t,e)=>()=>(t&&(e=t(t=0)),e);var S=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Jn=(t,e)=>{for(var r in e)sY(t,r,{get:e[r],enumerable:!0})},owt=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Zin(e))!Yin.call(t,o)&&o!==r&&sY(t,o,{get:()=>e[o],enumerable:!(n=Gin(e,o))||n.enumerable});return t};var L=(t,e,r)=>(r=t!=null?Win(Xin(t)):{},owt(e||!t||!t.__esModule?sY(r,"default",{value:t,enumerable:!0}):r,t)),Pfe=t=>owt(sY({},"__esModule",{value:!0}),t);var M=(t,e,r)=>Qin(t,typeof e!="symbol"?e+"":e,r),ean=(t,e,r)=>e.has(t)||nwt("Cannot "+r);var uY=(t,e,r)=>e.has(t)?nwt("Cannot add the same private member more than once"):e instanceof WeakSet?e.add(t):e.set(t,r);var iwt=(t,e,r)=>(ean(t,e,"access private method"),r);function jFe(){if(!Mfe&&(Mfe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Mfe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Mfe(tan)}var Mfe,tan,awt=v(()=>{tan=new Uint8Array(16)});function swt(t,e=0){return Kh[t[e+0]]+Kh[t[e+1]]+Kh[t[e+2]]+Kh[t[e+3]]+"-"+Kh[t[e+4]]+Kh[t[e+5]]+"-"+Kh[t[e+6]]+Kh[t[e+7]]+"-"+Kh[t[e+8]]+Kh[t[e+9]]+"-"+Kh[t[e+10]]+Kh[t[e+11]]+Kh[t[e+12]]+Kh[t[e+13]]+Kh[t[e+14]]+Kh[t[e+15]]}var Kh,uwt=v(()=>{Kh=[];for(let t=0;t<256;++t)Kh.push((t+256).toString(16).slice(1))});var ran,DFe,lwt=v(()=>{ran=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),DFe={randomUUID:ran}});function nan(t,e,r){if(DFe.randomUUID&&!e&&!t)return DFe.randomUUID();t=t||{};let n=t.random||(t.rng||jFe)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(let o=0;o<16;++o)e[r+o]=n[o];return e}return swt(n)}var gv,cwt=v(()=>{lwt();awt();uwt();gv=nan});var kU=v(()=>{cwt()});var oan,Tt,Do=v(()=>{oan=Object.defineProperty,Tt=(t,e)=>{for(var r in e)oan(t,r,{get:e[r],enumerable:!0})}});function lY(t,e=qU){t=t.trim();let r=t.indexOf("```");if(r===-1)return e(t);let n=t.substring(r+3);n.startsWith(`json +`)?n=n.substring(5):n.startsWith("json")?n=n.substring(4):n.startsWith(` +`)&&(n=n.substring(1));let o=n.indexOf("```"),i=n;return o!==-1&&(i=n.substring(0,o)),e(i.trim())}function qU(t){if(typeof t>"u")return null;try{return JSON.parse(t)}catch{}let e="",r=[],n=!1,o=!1;for(let i of t){if(n)i==='"'&&!o?n=!1:i===` +`&&!o?i="\\n":i==="\\"?o=!o:o=!1;else if(i==='"')n=!0,o=!1;else if(i==="{")r.push("}");else if(i==="[")r.push("]");else if(i==="}"||i==="]")if(r&&r[r.length-1]===i)r.pop();else return null;e+=i}n&&(e+='"');for(let i=r.length-1;i>=0;i-=1)e+=r[i];try{return JSON.parse(e)}catch{return null}}var cY=v(()=>{});function L$(t,e){return t.lc_error_code=e,t.message=`${t.message} + +Troubleshooting URL: https://js.langchain.com/docs/troubleshooting/errors/${e}/ +`,t}var dY=v(()=>{});var fwt=S((rmi,dwt)=>{"use strict";dwt.exports=function(t,e){if(typeof t!="string")throw new TypeError("Expected a string");return e=typeof e>"u"?"_":e,t.replace(/([a-z\d])([A-Z])/g,"$1"+e+"$2").replace(/([A-Z]+)([A-Z][a-z\d]+)/g,"$1"+e+"$2").toLowerCase()}});var _wt=S((nmi,$Fe)=>{"use strict";var ian=/[\p{Lu}]/u,aan=/[\p{Ll}]/u,pwt=/^[\p{Lu}](?![\p{Lu}])/gu,gwt=/([\p{Alpha}\p{N}_]|$)/u,ywt=/[_.\- ]+/,san=new RegExp("^"+ywt.source),mwt=new RegExp(ywt.source+gwt.source,"gu"),hwt=new RegExp("\\d+"+gwt.source,"gu"),uan=(t,e,r)=>{let n=!1,o=!1,i=!1;for(let a=0;a(pwt.lastIndex=0,t.replace(pwt,r=>e(r))),can=(t,e)=>(mwt.lastIndex=0,hwt.lastIndex=0,t.replace(mwt,(r,n)=>e(n)).replace(hwt,r=>e(r))),bwt=(t,e)=>{if(!(typeof t=="string"||Array.isArray(t)))throw new TypeError("Expected the input to be `string | string[]`");if(e={pascalCase:!1,preserveConsecutiveUppercase:!1,...e},Array.isArray(t)?t=t.map(i=>i.trim()).filter(i=>i.length).join("-"):t=t.trim(),t.length===0)return"";let r=e.locale===!1?i=>i.toLowerCase():i=>i.toLocaleLowerCase(e.locale),n=e.locale===!1?i=>i.toUpperCase():i=>i.toLocaleUpperCase(e.locale);return t.length===1?e.pascalCase?n(t):r(t):(t!==r(t)&&(t=uan(t,r,n)),t=t.replace(san,""),e.preserveConsecutiveUppercase?t=lan(t,r):t=r(t),e.pascalCase&&(t=n(t.charAt(0))+t.slice(1)),can(t,n))};$Fe.exports=bwt;$Fe.exports.default=bwt});function wwt(t,e){return e?.[t]||(0,vwt.default)(t)}function Swt(t,e,r){let n={};for(let o in t)Object.hasOwn(t,o)&&(n[e(o,r)]=t[o]);return n}var vwt,dan,Cwt=v(()=>{vwt=L(fwt(),1),dan=L(_wt(),1)});function xwt(t){return Array.isArray(t)?[...t]:{...t}}function pan(t,e){let r=xwt(t);for(let[n,o]of Object.entries(e)){let[i,...a]=n.split(".").reverse(),s=r;for(let u of a.reverse()){if(s[u]===void 0)break;s[u]=xwt(s[u]),s=s[u]}s[i]!==void 0&&(s[i]={lc:1,type:"secret",id:[o]})}return r}function Rfe(t){let e=Object.getPrototypeOf(t);return typeof t.lc_name=="function"&&(typeof e.lc_name!="function"||t.lc_name()!==e.lc_name())?t.lc_name():t.name}var fan,Wh,F$=v(()=>{Do();Cwt();fan={};Tt(fan,{Serializable:()=>Wh,get_lc_unique_name:()=>Rfe});Wh=class Owt{constructor(e,...r){M(this,"lc_serializable",!1);M(this,"lc_kwargs");this.lc_serializable_keys!==void 0?this.lc_kwargs=Object.fromEntries(Object.entries(e||{}).filter(([n])=>this.lc_serializable_keys?.includes(n))):this.lc_kwargs=e??{}}static lc_name(){return this.name}get lc_id(){return[...this.lc_namespace,Rfe(this.constructor)]}get lc_secrets(){}get lc_attributes(){}get lc_aliases(){}get lc_serializable_keys(){}toJSON(){if(!this.lc_serializable)return this.toJSONNotImplemented();if(this.lc_kwargs instanceof Owt||typeof this.lc_kwargs!="object"||Array.isArray(this.lc_kwargs))return this.toJSONNotImplemented();let e={},r={},n=Object.keys(this.lc_kwargs).reduce((o,i)=>(o[i]=i in this?this[i]:this.lc_kwargs[i],o),{});for(let o=Object.getPrototypeOf(this);o;o=Object.getPrototypeOf(o))Object.assign(e,Reflect.get(o,"lc_aliases",this)),Object.assign(r,Reflect.get(o,"lc_secrets",this)),Object.assign(n,Reflect.get(o,"lc_attributes",this));return Object.keys(r).forEach(o=>{let i=this,a=n,[s,...u]=o.split(".").reverse();for(let l of u.reverse()){if(!(l in i)||i[l]===void 0)return;(!(l in a)||a[l]===void 0)&&(typeof i[l]=="object"&&i[l]!=null?a[l]={}:Array.isArray(i[l])&&(a[l]=[])),i=i[l],a=a[l]}s in i&&i[s]!==void 0&&(a[s]=a[s]||i[s])}),{lc:1,type:"constructor",id:this.lc_id,kwargs:Swt(Object.keys(r).length?pan(n,r):n,wwt,e)}}toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:this.lc_id}}}});function k$(t){return!!(t&&typeof t=="object"&&"type"in t&&t.type==="tool_call")}function Twt(t){return!!(t&&typeof t=="object"&&"toolCall"in t&&t.toolCall!=null&&typeof t.toolCall=="object"&&"id"in t.toolCall&&typeof t.toolCall.id=="string")}var G3,Afe=v(()=>{G3=class extends Error{constructor(e,r){super(e);M(this,"output");this.output=r}}});var Ewt,q$,Pwt,B$,fY=v(()=>{Ewt=Symbol.for("ls:tracing_async_local_storage"),q$=Symbol.for("lc:context_variables"),Pwt=t=>{globalThis[Ewt]=t},B$=()=>globalThis[Ewt]});function Qm(t){return typeof t=="object"&&t!==null&&"type"in t&&typeof t.type=="string"&&"source_type"in t&&(t.source_type==="url"||t.source_type==="base64"||t.source_type==="text"||t.source_type==="id")}function Z3(t){return Qm(t)&&t.source_type==="url"&&"url"in t&&typeof t.url=="string"}function X3(t){return Qm(t)&&t.source_type==="base64"&&"data"in t&&typeof t.data=="string"}function Mwt(t){return Qm(t)&&t.source_type==="text"&&"text"in t&&typeof t.text=="string"}function Ife(t){return Qm(t)&&t.source_type==="id"&&"id"in t&&typeof t.id=="string"}function Nfe(t){if(Qm(t)){if(t.source_type==="url")return{type:"image_url",image_url:{url:t.url}};if(t.source_type==="base64"){if(!t.mime_type)throw new Error("mime_type key is required for base64 data.");return{type:"image_url",image_url:{url:`data:${t.mime_type};base64,${t.data}`}}}}throw new Error("Unsupported source type. Only 'url' and 'base64' are supported.")}function pY(t){let e=t.split(";")[0].split("/");if(e.length!==2)throw new Error(`Invalid mime type: "${t}" - does not match type/subtype format.`);let r=e[0].trim(),n=e[1].trim();if(r===""||n==="")throw new Error(`Invalid mime type: "${t}" - type or subtype is empty.`);let o={};for(let i of t.split(";").slice(1)){let a=i.split("=");if(a.length!==2)throw new Error(`Invalid parameter syntax in mime type: "${t}".`);let s=a[0].trim(),u=a[1].trim();if(s==="")throw new Error(`Invalid parameter syntax in mime type: "${t}".`);o[s]=u}return{type:r,subtype:n,parameters:o}}function Wg({dataUrl:t,asTypedArray:e=!1}){let r=t.match(/^data:(\w+\/\w+);base64,([A-Za-z0-9+/]+=*)$/),n;if(r){n=r[1].toLowerCase();let o=e?Uint8Array.from(atob(r[2]),i=>i.charCodeAt(0)):r[2];return{mime_type:n,data:o}}}function oO(t,e){if(t.type==="text"){if(!e.fromStandardTextBlock)throw new Error(`Converter for ${e.providerName} does not implement \`fromStandardTextBlock\` method.`);return e.fromStandardTextBlock(t)}if(t.type==="image"){if(!e.fromStandardImageBlock)throw new Error(`Converter for ${e.providerName} does not implement \`fromStandardImageBlock\` method.`);return e.fromStandardImageBlock(t)}if(t.type==="audio"){if(!e.fromStandardAudioBlock)throw new Error(`Converter for ${e.providerName} does not implement \`fromStandardAudioBlock\` method.`);return e.fromStandardAudioBlock(t)}if(t.type==="file"){if(!e.fromStandardFileBlock)throw new Error(`Converter for ${e.providerName} does not implement \`fromStandardFileBlock\` method.`);return e.fromStandardFileBlock(t)}throw new Error(`Unable to convert content block type '${t.type}' to provider-specific format: not recognized.`)}var mY=v(()=>{});function Er(t,e){return wn(t)&&t.type===e}function wn(t){return typeof t=="object"&&t!==null}function Jb(t){return Array.isArray(t)}function Qt(t){return typeof t=="string"}function yv(t){return typeof t=="number"}function jfe(t){return t instanceof Uint8Array}function LFe(t){try{return JSON.parse(t)}catch{return}}var rN,BU=v(()=>{rN=t=>t()});function man(t){if(t.type==="char_location"&&Qt(t.document_title)&&yv(t.start_char_index)&&yv(t.end_char_index)&&Qt(t.cited_text)){let{document_title:e,start_char_index:r,end_char_index:n,cited_text:o,...i}=t;return{...i,type:"citation",source:"char",title:e??void 0,startIndex:r,endIndex:n,citedText:o}}if(t.type==="page_location"&&Qt(t.document_title)&&yv(t.start_page_number)&&yv(t.end_page_number)&&Qt(t.cited_text)){let{document_title:e,start_page_number:r,end_page_number:n,cited_text:o,...i}=t;return{...i,type:"citation",source:"page",title:e??void 0,startIndex:r,endIndex:n,citedText:o}}if(t.type==="content_block_location"&&Qt(t.document_title)&&yv(t.start_block_index)&&yv(t.end_block_index)&&Qt(t.cited_text)){let{document_title:e,start_block_index:r,end_block_index:n,cited_text:o,...i}=t;return{...i,type:"citation",source:"block",title:e??void 0,startIndex:r,endIndex:n,citedText:o}}if(t.type==="web_search_result_location"&&Qt(t.url)&&Qt(t.title)&&Qt(t.encrypted_index)&&Qt(t.cited_text)){let{url:e,title:r,encrypted_index:n,cited_text:o,...i}=t;return{...i,type:"citation",source:"url",url:e,title:r,startIndex:Number(n),endIndex:Number(n),citedText:o}}if(t.type==="search_result_location"&&Qt(t.source)&&Qt(t.title)&&yv(t.start_block_index)&&yv(t.end_block_index)&&Qt(t.cited_text)){let{source:e,title:r,start_block_index:n,end_block_index:o,cited_text:i,...a}=t;return{...a,type:"citation",source:"search",url:e,title:r??void 0,startIndex:n,endIndex:o,citedText:i}}}function Awt(t){if(Er(t,"document")&&wn(t.source)&&"type"in t.source){if(t.source.type==="base64"&&Qt(t.source.media_type)&&Qt(t.source.data))return{type:"file",mimeType:t.source.media_type,data:t.source.data};if(t.source.type==="url"&&Qt(t.source.url))return{type:"file",url:t.source.url};if(t.source.type==="file"&&Qt(t.source.file_id))return{type:"file",fileId:t.source.file_id};if(t.source.type==="text"&&Qt(t.source.data))return{type:"file",mimeType:String(t.source.media_type??"text/plain"),data:t.source.data}}else if(Er(t,"image")&&wn(t.source)&&"type"in t.source){if(t.source.type==="base64"&&Qt(t.source.media_type)&&Qt(t.source.data))return{type:"image",mimeType:t.source.media_type,data:t.source.data};if(t.source.type==="url"&&Qt(t.source.url))return{type:"image",url:t.source.url};if(t.source.type==="file"&&Qt(t.source.file_id))return{type:"image",fileId:t.source.file_id}}}function Iwt(t){function*e(){for(let r of t){let n=Awt(r);n?yield n:yield r}}return Array.from(e())}function Rwt(t){function*e(){let r=typeof t.content=="string"?[{type:"text",text:t.content}]:t.content;for(let n of r){if(Er(n,"text")&&Qt(n.text)){let{text:o,citations:i,...a}=n;if(Jb(i)&&i.length){let s=i.reduce((u,l)=>{let c=man(l);return c?[...u,c]:u},[]);yield{...a,type:"text",text:o,annotations:s};continue}else{yield{...a,type:"text",text:o};continue}}else if(Er(n,"thinking")&&Qt(n.thinking)){let{thinking:o,signature:i,...a}=n;yield{...a,type:"reasoning",reasoning:o,signature:i};continue}else if(Er(n,"redacted_thinking")){yield{type:"non_standard",value:n};continue}else if(Er(n,"tool_use")&&Qt(n.name)&&Qt(n.id)){yield{type:"tool_call",id:n.id,name:n.name,args:n.input};continue}else if(Er(n,"input_json_delta")){if(han(t)&&t.tool_call_chunks?.length){let o=t.tool_call_chunks[0];yield{type:"tool_call_chunk",id:o.id,name:o.name,args:o.args,index:o.index};continue}}else if(Er(n,"server_tool_use")&&Qt(n.name)&&Qt(n.id)){let{name:o,id:i}=n;if(o==="web_search"){let a=rN(()=>{if(typeof n.input=="string")return n.input;if(wn(n.input)&&Qt(n.input.query))return n.input.query;if(Qt(n.partial_json)){let s=LFe(n.partial_json);if(s?.query)return s.query}return""});yield{id:i,type:"server_tool_call",name:"web_search",args:{query:a}};continue}else if(n.name==="code_execution"){let a=rN(()=>{if(typeof n.input=="string")return n.input;if(wn(n.input)&&Qt(n.input.code))return n.input.code;if(Qt(n.partial_json)){let s=LFe(n.partial_json);if(s?.code)return s.code}return""});yield{id:i,type:"server_tool_call",name:"code_execution",args:{code:a}};continue}}else if(Er(n,"web_search_tool_result")&&Qt(n.tool_use_id)&&Jb(n.content)){let{content:o,tool_use_id:i}=n,a=o.reduce((s,u)=>Er(u,"web_search_result")?[...s,u.url]:s,[]);yield{type:"server_tool_call_result",name:"web_search",toolCallId:i,status:"success",output:{urls:a}};continue}else if(Er(n,"code_execution_tool_result")&&Qt(n.tool_use_id)&&wn(n.content)){yield{type:"server_tool_call_result",name:"code_execution",toolCallId:n.tool_use_id,status:"success",output:n.content};continue}else if(Er(n,"mcp_tool_use")){yield{id:n.id,type:"server_tool_call",name:"mcp_tool_use",args:n.input};continue}else if(Er(n,"mcp_tool_result")&&Qt(n.tool_use_id)&&wn(n.content)){yield{type:"server_tool_call_result",name:"mcp_tool_use",toolCallId:n.tool_use_id,status:"success",output:n.content};continue}else if(Er(n,"container_upload")){yield{type:"server_tool_call",name:"container_upload",args:n.input};continue}else if(Er(n,"search_result")){yield{id:n.id,type:"non_standard",value:n};continue}else if(Er(n,"tool_result")){yield{id:n.id,type:"non_standard",value:n};continue}else{let o=Awt(n);if(o){yield o;continue}}yield{type:"non_standard",value:n}}}return Array.from(e())}function han(t){return typeof t?._getType=="function"&&typeof t.concat=="function"&&t._getType()==="ai"}var Nwt,FFe=v(()=>{BU();Nwt={translateContent:Rwt,translateContentChunk:Rwt}});function gan(t){return Z3(t)?{type:t.type,mimeType:t.mime_type,url:t.url,metadata:t.metadata}:X3(t)?{type:t.type,mimeType:t.mime_type??"application/octet-stream",data:t.data,metadata:t.metadata}:Ife(t)?{type:t.type,mimeType:t.mime_type,fileId:t.id,metadata:t.metadata}:t}function jwt(t){return t.map(gan)}function Dwt(t){return!!(Er(t,"image_url")&&wn(t.image_url)||Er(t,"input_audio")&&wn(t.input_audio)||Er(t,"file")&&wn(t.file))}function $wt(t){if(Er(t,"image_url")&&wn(t.image_url)&&Qt(t.image_url.url)){let e=Wg({dataUrl:t.image_url.url});return e?{type:"image",mimeType:e.mime_type,data:e.data}:{type:"image",url:t.image_url.url}}else{if(Er(t,"input_audio")&&wn(t.input_audio)&&Qt(t.input_audio.data)&&Qt(t.input_audio.format))return{type:"audio",data:t.input_audio.data,mimeType:`audio/${t.input_audio.format}`};if(Er(t,"file")&&wn(t.file)&&Qt(t.file.data)){let e=Wg({dataUrl:t.file.data});if(e)return{type:"file",data:e.data,mimeType:e.mime_type};if(Qt(t.file.file_id))return{type:"file",fileId:t.file.file_id}}}return t}var kFe=v(()=>{mY();BU()});function yan(t){let e=[];typeof t.content=="string"?e.push({type:"text",text:t.content}):e.push(...Dfe(t.content));for(let r of t.tool_calls??[])e.push({type:"tool_call",id:r.id,name:r.name,args:r.args});return e}function ban(t){let e=[];typeof t.content=="string"?e.push({type:"text",text:t.content}):e.push(...Dfe(t.content));for(let r of t.tool_calls??[])e.push({type:"tool_call",id:r.id,name:r.name,args:r.args});return e}function Dfe(t){let e=[];for(let r of t)Dwt(r)?e.push($wt(r)):e.push(r);return e}function _an(t){if(t.type==="url_citation"){let{url:e,title:r,start_index:n,end_index:o}=t;return{type:"citation",url:e,title:r,startIndex:n,endIndex:o}}if(t.type==="file_citation"){let{file_id:e,filename:r,index:n}=t;return{type:"citation",title:r,startIndex:n,endIndex:n,fileId:e}}return t}function Lwt(t){function*e(){wn(t.additional_kwargs?.reasoning)&&Jb(t.additional_kwargs.reasoning.summary)&&(yield{type:"reasoning",reasoning:t.additional_kwargs.reasoning.summary.reduce((o,i)=>wn(i)&&Qt(i.text)?`${o}${i.text}`:o,"")});let r=typeof t.content=="string"?[{type:"text",text:t.content}]:t.content;for(let n of r)if(Er(n,"text")){let{text:o,annotations:i,...a}=n;Array.isArray(i)?yield{...a,type:"text",text:String(o),annotations:i.map(_an)}:yield{...a,type:"text",text:String(o)}}for(let n of t.tool_calls??[])yield{type:"tool_call",id:n.id,name:n.name,args:n.args};if(wn(t.additional_kwargs)&&Jb(t.additional_kwargs.tool_outputs))for(let n of t.additional_kwargs.tool_outputs){if(Er(n,"web_search_call")){yield{id:n.id,type:"server_tool_call",name:"web_search",args:{query:n.query}};continue}else if(Er(n,"file_search_call")){yield{id:n.id,type:"server_tool_call",name:"file_search",args:{query:n.query}};continue}else if(Er(n,"computer_call")){yield{type:"non_standard",value:n};continue}else if(Er(n,"code_interpreter_call")){if(Qt(n.code)&&(yield{id:n.id,type:"server_tool_call",name:"code_interpreter",args:{code:n.code}}),Jb(n.outputs)){let o=rN(()=>{if(n.status!=="in_progress"){if(n.status==="completed")return 0;if(n.status==="incomplete")return 127;if(n.status!=="interpreting"&&n.status==="failed")return 1}});for(let i of n.outputs)if(Er(i,"logs")){yield{type:"server_tool_call_result",toolCallId:n.id??"",status:"success",output:{type:"code_interpreter_output",returnCode:o??0,stderr:[0,void 0].includes(o)?void 0:String(i.logs),stdout:[0,void 0].includes(o)?String(i.logs):void 0}};continue}}continue}else if(Er(n,"mcp_call")){yield{id:n.id,type:"server_tool_call",name:"mcp_call",args:n.input};continue}else if(Er(n,"mcp_list_tools")){yield{id:n.id,type:"server_tool_call",name:"mcp_list_tools",args:n.input};continue}else if(Er(n,"mcp_approval_request")){yield{type:"non_standard",value:n};continue}else if(Er(n,"image_generation_call")){yield{type:"non_standard",value:n};continue}wn(n)&&(yield{type:"non_standard",value:n})}}return Array.from(e())}function van(t){function*e(){yield*Lwt(t);for(let r of t.tool_call_chunks??[])yield{type:"tool_call_chunk",id:r.id,name:r.name,args:r.args}}return Array.from(e())}var Fwt,qFe=v(()=>{BU();kFe();Fwt={translateContent:t=>typeof t.content=="string"?yan(t):Lwt(t),translateContentChunk:t=>typeof t.content=="string"?ban(t):van(t)}});function $fe(t){return typeof t=="object"&&t!==null&&"type"in t&&"content"in t&&(typeof t.content=="string"||Array.isArray(t.content))}var BFe=v(()=>{});function Kb(t,e){return typeof t=="string"?t===""?e:typeof e=="string"?t+e:Array.isArray(e)&&e.some(r=>Qm(r))?[{type:"text",source_type:"text",text:t},...e]:[{type:"text",text:t},...e]:Array.isArray(e)?UU(t,e)??[...t,...e]:e===""?t:Array.isArray(t)&&t.some(r=>Qm(r))?[...t,{type:"file",source_type:"text",text:e}]:[...t,{type:"text",text:e}]}function Lfe(t,e){return t==="error"||e==="error"?"error":"success"}function wan(t,e){function r(n,o){if(typeof n!="object"||n===null||n===void 0)return n;if(o>=e)return Array.isArray(n)?"[Array]":"[Object]";if(Array.isArray(n))return n.map(a=>r(a,o+1));let i={};for(let a of Object.keys(n))i[a]=r(n[a],o+1);return i}return JSON.stringify(r(t,0),null,2)}function qwt(t){return Array.isArray(t)&&t.every(e=>typeof e.index=="number")}function _l(t={},e={}){let r={...t};for(let[n,o]of Object.entries(e))if(r[n]==null)r[n]=o;else{if(o==null)continue;if(typeof r[n]!=typeof o||Array.isArray(r[n])!==Array.isArray(o))throw new Error(`field[${n}] already exists in the message chunk, but with a different type.`);if(typeof r[n]=="string"){if(n==="type")continue;["id","name","output_version","model_provider"].includes(n)?r[n]=o:r[n]+=o}else if(typeof r[n]=="object"&&!Array.isArray(r[n]))r[n]=_l(r[n],o);else if(Array.isArray(r[n]))r[n]=UU(r[n],o);else{if(r[n]===o)continue;console.warn(`field[${n}] already exists in this message chunk and value has unsupported type.`)}}return r}function UU(t,e){if(!(t===void 0&&e===void 0)){if(t===void 0||e===void 0)return t||e;{let r=[...t];for(let n of e)if(typeof n=="object"&&n!==null&&"index"in n&&typeof n.index=="number"){let o=r.findIndex(i=>{let a=typeof i=="object",s="index"in i&&i.index===n.index,u="id"in i&&"id"in n&&i?.id===n?.id,l=!("id"in i)||!i?.id||!("id"in n)||!n?.id;return a&&s&&(u||l)});o!==-1&&typeof r[o]=="object"&&r[o]!==null?r[o]=_l(r[o],n):r.push(n)}else{if(typeof n=="object"&&n!==null&&"text"in n&&n.text==="")continue;r.push(n)}return r}}}function Ffe(t,e){if(!t&&!e)throw new Error("Cannot merge two undefined objects.");if(!t||!e)return t||e;if(typeof t!=typeof e)throw new Error(`Cannot merge objects of different types. +Left ${typeof t} +Right ${typeof e}`);if(typeof t=="string"&&typeof e=="string")return t+e;if(Array.isArray(t)&&Array.isArray(e))return UU(t,e);if(typeof t=="object"&&typeof e=="object")return _l(t,e);if(t===e)return t;throw new Error(`Can not merge objects of different types. +Left ${t} +Right ${e}`)}function kfe(t){return typeof t.role=="string"}function eh(t){return typeof t?._getType=="function"}function Y3(t){return eh(t)&&typeof t.concat=="function"}var UFe,kwt,Uc,Wb,Gg=v(()=>{F$();mY();FFe();kFe();qFe();BFe();UFe=Symbol.for("langchain.message");Uc=class extends Wh{constructor(e){let r=typeof e=="string"||Array.isArray(e)?{content:e}:e;r.additional_kwargs||(r.additional_kwargs={}),r.response_metadata||(r.response_metadata={});super(r);M(this,"lc_namespace",["langchain_core","messages"]);M(this,"lc_serializable",!0);M(this,kwt,!0);M(this,"id");M(this,"name");M(this,"content");M(this,"additional_kwargs");M(this,"response_metadata");this.name=r.name,r.content===void 0&&r.contentBlocks!==void 0?(this.content=r.contentBlocks,this.response_metadata={output_version:"v1",...r.response_metadata}):r.content!==void 0?(this.content=r.content??[],this.response_metadata=r.response_metadata):(this.content=[],this.response_metadata=r.response_metadata),this.additional_kwargs=r.additional_kwargs,this.id=r.id}get lc_aliases(){return{additional_kwargs:"additional_kwargs",response_metadata:"response_metadata"}}_getType(){return this.type}getType(){return this._getType()}get text(){return typeof this.content=="string"?this.content:Array.isArray(this.content)?this.content.map(e=>typeof e=="string"?e:e.type==="text"?e.text:"").join(""):""}get contentBlocks(){let e=typeof this.content=="string"?[{type:"text",text:this.content}]:this.content;return[jwt,Dfe,Iwt].reduce((o,i)=>i(o),e)}toDict(){return{type:this.getType(),data:this.toJSON().kwargs}}static lc_name(){return"BaseMessage"}get _printableFields(){return{id:this.id,content:this.content,name:this.name,additional_kwargs:this.additional_kwargs,response_metadata:this.response_metadata}}static isInstance(e){return typeof e=="object"&&e!==null&&UFe in e&&e[UFe]===!0&&$fe(e)}_updateId(e){this.id=e,this.lc_kwargs.id=e}get[(kwt=UFe,Symbol.toStringTag)](){return this.constructor.lc_name()}[Symbol.for("nodejs.util.inspect.custom")](e){if(e===null)return this;let r=wan(this._printableFields,Math.max(4,e));return`${this.constructor.lc_name()} ${r}`}};Wb=class extends Uc{static isInstance(t){return super.isInstance(t)&&"concat"in t&&typeof t.concat=="function"}}});function hY(t){return t!=null&&typeof t=="object"&&"lc_direct_tool_output"in t&&t.lc_direct_tool_output===!0}function gY(t){let e=[],r=[];for(let n of t)if(n.function){let o=n.function.name;try{let i=JSON.parse(n.function.arguments);e.push({name:o||"",args:i||{},id:n.id})}catch{r.push({name:o,args:n.function.arguments,id:n.id,error:"Malformed args."})}}else continue;return[e,r]}function yY(t){return typeof t=="object"&&t!==null&&"getType"in t&&typeof t.getType=="function"&&t.getType()==="tool"}function zFe(t){return t._getType()==="tool"}var San,Gb,Iw,Q3=v(()=>{Do();Gg();San={};Tt(San,{ToolMessage:()=>Gb,ToolMessageChunk:()=>Iw,defaultToolCallParser:()=>gY,isDirectToolOutput:()=>hY,isToolMessage:()=>yY,isToolMessageChunk:()=>zFe});Gb=class extends Uc{constructor(e,r,n){let o=typeof e=="string"||Array.isArray(e)?{content:e,name:n,tool_call_id:r}:e;super(o);M(this,"lc_direct_tool_output",!0);M(this,"type","tool");M(this,"status");M(this,"tool_call_id");M(this,"metadata");M(this,"artifact");this.tool_call_id=o.tool_call_id,this.artifact=o.artifact,this.status=o.status,this.metadata=o.metadata}static lc_name(){return"ToolMessage"}get lc_aliases(){return{tool_call_id:"tool_call_id"}}static isInstance(e){return super.isInstance(e)&&e.type==="tool"}get _printableFields(){return{...super._printableFields,tool_call_id:this.tool_call_id,artifact:this.artifact}}},Iw=class extends Wb{constructor(e){super(e);M(this,"type","tool");M(this,"tool_call_id");M(this,"status");M(this,"artifact");this.tool_call_id=e.tool_call_id,this.artifact=e.artifact,this.status=e.status}static lc_name(){return"ToolMessageChunk"}concat(e){let r=this.constructor;return new r({content:Kb(this.content,e.content),additional_kwargs:_l(this.additional_kwargs,e.additional_kwargs),response_metadata:_l(this.response_metadata,e.response_metadata),artifact:Ffe(this.artifact,e.artifact),tool_call_id:this.tool_call_id,id:this.id??e.id,status:Lfe(this.status,e.status)})}get _printableFields(){return{...super._printableFields,tool_call_id:this.tool_call_id,artifact:this.artifact}}}});function HFe(t){switch(t){case"csv":return"text/csv";case"doc":return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";case"docx":return"application/vnd.openxmlformats-officedocument.wordprocessingml.document";case"html":return"text/html";case"md":return"text/markdown";case"pdf":return"application/pdf";case"txt":return"text/plain";case"xls":return"application/vnd.ms-excel";case"xlsx":return"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet";case"gif":return"image/gif";case"jpeg":return"image/jpeg";case"jpg":return"image/jpeg";case"png":return"image/png";case"webp":return"image/webp";case"flv":return"video/flv";case"mkv":return"video/mkv";case"mov":return"video/mov";case"mp4":return"video/mp4";case"mpeg":return"video/mpeg";case"mpg":return"video/mpg";case"three_gp":return"video/three_gp";case"webm":return"video/webm";case"wmv":return"video/wmv";default:return"application/octet-stream"}}function Can(t){if(wn(t.document)&&wn(t.document.source)){let e=wn(t.document)&&Qt(t.document.format)?t.document.format:"",r=HFe(e);if(wn(t.document.source)){if(wn(t.document.source.s3Location)&&Qt(t.document.source.s3Location.uri))return{type:"file",mimeType:r,fileId:t.document.source.s3Location.uri};if(jfe(t.document.source.bytes))return{type:"file",mimeType:r,data:t.document.source.bytes};if(Qt(t.document.source.text))return{type:"file",mimeType:r,data:Buffer.from(t.document.source.text).toString("base64")};if(Jb(t.document.source.content)){let n=t.document.source.content.reduce((o,i)=>wn(i)&&Qt(i.text)?o+i.text:o,"");return{type:"file",mimeType:r,data:n}}}}return{type:"non_standard",value:t}}function xan(t){if(Er(t,"image")&&wn(t.image)){let e=wn(t.image)&&Qt(t.image.format)?t.image.format:"",r=HFe(e);if(wn(t.image.source)){if(wn(t.image.source.s3Location)&&Qt(t.image.source.s3Location.uri))return{type:"image",mimeType:r,fileId:t.image.source.s3Location.uri};if(jfe(t.image.source.bytes))return{type:"image",mimeType:r,data:t.image.source.bytes}}}return{type:"non_standard",value:t}}function Oan(t){if(Er(t,"video")&&wn(t.video)){let e=wn(t.video)&&Qt(t.video.format)?t.video.format:"",r=HFe(e);if(wn(t.video.source)){if(wn(t.video.source.s3Location)&&Qt(t.video.source.s3Location.uri))return{type:"video",mimeType:r,fileId:t.video.source.s3Location.uri};if(jfe(t.video.source.bytes))return{type:"video",mimeType:r,data:t.video.source.bytes}}}return{type:"non_standard",value:t}}function Bwt(t){function*e(){let r=typeof t.content=="string"?[{type:"text",text:t.content}]:t.content;for(let n of r){if(Er(n,"cache_point")){yield{type:"non_standard",value:n};continue}else if(Er(n,"citations_content")&&wn(n.citationsContent)){let o=Jb(n.citationsContent.content)?n.citationsContent.content.reduce((a,s)=>wn(s)&&Qt(s.text)?a+s.text:a,""):"",i=Jb(n.citationsContent.citations)?n.citationsContent.citations.reduce((a,s)=>{if(wn(s)){let u=Jb(s.sourceContent)?s.sourceContent.reduce((c,d)=>wn(d)&&Qt(d.text)?c+d.text:c,""):"",l=rN(()=>{if(wn(s.location)){let c=s.location.documentChar||s.location.documentPage||s.location.documentChunk;if(wn(c))return{source:yv(c.documentIndex)?c.documentIndex.toString():void 0,startIndex:yv(c.start)?c.start:void 0,endIndex:yv(c.end)?c.end:void 0}}return{}});a.push({type:"citation",citedText:u,...l})}return a},[]):[];yield{type:"text",text:o,annotations:i};continue}else if(Er(n,"document")&&wn(n.document)){yield Can(n);continue}else if(Er(n,"guard_content")){yield{type:"non_standard",value:n};continue}else if(Er(n,"image")&&wn(n.image)){yield xan(n);continue}else if(Er(n,"reasoning_content")&&Qt(n.reasoningText)){yield{type:"reasoning",reasoning:n.reasoningText};continue}else if(Er(n,"text")&&Qt(n.text)){yield{type:"text",text:n.text};continue}else if(Er(n,"tool_result")){yield{type:"non_standard",value:n};continue}else{if(Er(n,"tool_call"))continue;if(Er(n,"video")&&wn(n.video)){yield Oan(n);continue}}yield{type:"non_standard",value:n}}}return Array.from(e())}var Uwt,zwt=v(()=>{BU();Uwt={translateContent:Bwt,translateContentChunk:Bwt}});function Hwt(t){function*e(){let r=typeof t.content=="string"?[{type:"text",text:t.content}]:t.content;for(let n of r){if(Er(n,"text")&&Qt(n.text)){yield{type:"text",text:n.text};continue}else if(Er(n,"inlineData")&&wn(n.inlineData)&&Qt(n.inlineData.mimeType)&&Qt(n.inlineData.data)){yield{type:"file",mimeType:n.inlineData.mimeType,data:n.inlineData.data};continue}else if(Er(n,"functionCall")&&wn(n.functionCall)&&Qt(n.functionCall.name)&&wn(n.functionCall.args)){yield{type:"tool_call",id:t.id,name:n.functionCall.name,args:n.functionCall.args};continue}else if(Er(n,"functionResponse")){yield{type:"non_standard",value:n};continue}else if(Er(n,"fileData")&&wn(n.fileData)&&Qt(n.fileData.mimeType)&&Qt(n.fileData.fileUri)){yield{type:"file",mimeType:n.fileData.mimeType,fileId:n.fileData.fileUri};continue}else if(Er(n,"executableCode")){yield{type:"non_standard",value:n};continue}else if(Er(n,"codeExecutionResult")){yield{type:"non_standard",value:n};continue}yield{type:"non_standard",value:n}}}return Array.from(e())}var Vwt,Jwt=v(()=>{BU();Vwt={translateContent:Hwt,translateContentChunk:Hwt}});function Kwt(t){function*e(){let r=typeof t.content=="string"?[{type:"text",text:t.content}]:t.content;for(let n of r){if(Er(n,"reasoning")&&Qt(n.reasoning)){let o=rN(()=>{let i=r.indexOf(n);if(Jb(t.additional_kwargs?.signatures)&&i>=0)return t.additional_kwargs.signatures.at(i)});Qt(o)?yield{type:"reasoning",reasoning:n.reasoning,signature:o}:yield{type:"reasoning",reasoning:n.reasoning};continue}else if(Er(n,"text")&&Qt(n.text)){yield{type:"text",text:n.text};continue}else if(Er(n,"image_url")){if(Qt(n.image_url))if(n.image_url.startsWith("data:")){let o=/^data:([^;]+);base64,(.+)$/,i=n.image_url.match(o);i?yield{type:"image",data:i[2],mimeType:i[1]}:yield{type:"image",url:n.image_url}}else yield{type:"image",url:n.image_url};continue}else if(Er(n,"media")&&Qt(n.mimeType)&&Qt(n.data)){yield{type:"file",mimeType:n.mimeType,data:n.data};continue}yield{type:"non_standard",value:n}}}return Array.from(e())}var Wwt,Gwt=v(()=>{BU();Wwt={translateContent:Kwt,translateContentChunk:Kwt}});function VFe(t){return globalThis.lc_block_translators_registry.get(t)}var Zwt=v(()=>{FFe();qFe();zwt();Jwt();Gwt();globalThis.lc_block_translators_registry??(globalThis.lc_block_translators_registry=new Map([["anthropic",Nwt],["bedrock-converse",Uwt],["google-genai",Vwt],["google-vertexai",Wwt],["openai",Fwt]]))});function qfe(t,e){return _l(t??{},e??{})}function Xwt(t,e){let r={};return(t?.audio!==void 0||e?.audio!==void 0)&&(r.audio=(t?.audio??0)+(e?.audio??0)),(t?.image!==void 0||e?.image!==void 0)&&(r.image=(t?.image??0)+(e?.image??0)),(t?.video!==void 0||e?.video!==void 0)&&(r.video=(t?.video??0)+(e?.video??0)),(t?.document!==void 0||e?.document!==void 0)&&(r.document=(t?.document??0)+(e?.document??0)),(t?.text!==void 0||e?.text!==void 0)&&(r.text=(t?.text??0)+(e?.text??0)),r}function Tan(t,e){let r={...Xwt(t,e)};return(t?.cache_read!==void 0||e?.cache_read!==void 0)&&(r.cache_read=(t?.cache_read??0)+(e?.cache_read??0)),(t?.cache_creation!==void 0||e?.cache_creation!==void 0)&&(r.cache_creation=(t?.cache_creation??0)+(e?.cache_creation??0)),r}function Ean(t,e){let r={...Xwt(t,e)};return(t?.reasoning!==void 0||e?.reasoning!==void 0)&&(r.reasoning=(t?.reasoning??0)+(e?.reasoning??0)),r}function Bfe(t,e){return{input_tokens:(t?.input_tokens??0)+(e?.input_tokens??0),output_tokens:(t?.output_tokens??0)+(e?.output_tokens??0),total_tokens:(t?.total_tokens??0)+(e?.total_tokens??0),input_token_details:Tan(t?.input_token_details,e?.input_token_details),output_token_details:Ean(t?.output_token_details,e?.output_token_details)}}var JFe=v(()=>{Gg()});function qs(t){return t._getType()==="ai"}function bY(t){return t._getType()==="ai"}var li,Nr,z0=v(()=>{cY();Gg();Zwt();JFe();Q3();li=class extends Uc{constructor(e){let r;if(typeof e=="string"||Array.isArray(e))r={content:e,tool_calls:[],invalid_tool_calls:[],additional_kwargs:{}};else{r=e;let n=r.additional_kwargs?.tool_calls,o=r.tool_calls;n!=null&&n.length>0&&(o===void 0||o.length===0)&&console.warn(["New LangChain packages are available that more efficiently handle",`tool calling. + +Please upgrade your packages to versions that set`,"message tool calls. e.g., `pnpm install @langchain/anthropic`,","pnpm install @langchain/openai`, etc."].join(" "));try{if(n!=null&&o===void 0){let[i,a]=gY(n);r.tool_calls=i??[],r.invalid_tool_calls=a??[]}else r.tool_calls=r.tool_calls??[],r.invalid_tool_calls=r.invalid_tool_calls??[]}catch{r.tool_calls=[],r.invalid_tool_calls=[]}if(r.response_metadata!==void 0&&"output_version"in r.response_metadata&&r.response_metadata.output_version==="v1"&&(r.contentBlocks=r.content,r.content=void 0),r.contentBlocks!==void 0){r.contentBlocks.push(...r.tool_calls.map(a=>({type:"tool_call",id:a.id,name:a.name,args:a.args})));let i=r.contentBlocks.filter(a=>a.type==="tool_call").filter(a=>!r.tool_calls?.some(s=>s.id===a.id&&s.name===a.name));i.length>0&&(r.tool_calls=i.map(a=>({type:"tool_call",id:a.id,name:a.name,args:a.args})))}}super(r);M(this,"type","ai");M(this,"tool_calls",[]);M(this,"invalid_tool_calls",[]);M(this,"usage_metadata");typeof r!="string"&&(this.tool_calls=r.tool_calls??this.tool_calls,this.invalid_tool_calls=r.invalid_tool_calls??this.invalid_tool_calls),this.usage_metadata=r.usage_metadata}get lc_aliases(){return{...super.lc_aliases,tool_calls:"tool_calls",invalid_tool_calls:"invalid_tool_calls"}}static lc_name(){return"AIMessage"}get contentBlocks(){if(this.response_metadata&&"output_version"in this.response_metadata&&this.response_metadata.output_version==="v1")return this.content;if(this.response_metadata&&"model_provider"in this.response_metadata&&typeof this.response_metadata.model_provider=="string"){let r=VFe(this.response_metadata.model_provider);if(r)return r.translateContent(this)}let e=super.contentBlocks;if(this.tool_calls){let r=this.tool_calls.filter(n=>!e.some(o=>o.id===n.id&&o.name===n.name));e.push(...r.map(n=>({...n,type:"tool_call",id:n.id,name:n.name,args:n.args})))}return e}get _printableFields(){return{...super._printableFields,tool_calls:this.tool_calls,invalid_tool_calls:this.invalid_tool_calls,usage_metadata:this.usage_metadata}}static isInstance(e){return super.isInstance(e)&&e.type==="ai"}};Nr=class extends Wb{constructor(e){let r;if(typeof e=="string"||Array.isArray(e))r={content:e,tool_calls:[],invalid_tool_calls:[],tool_call_chunks:[]};else if(e.tool_call_chunks===void 0)r={...e,tool_calls:e.tool_calls??[],invalid_tool_calls:[],tool_call_chunks:[],usage_metadata:e.usage_metadata!==void 0?e.usage_metadata:void 0};else{let n=e.tool_call_chunks.reduce((a,s)=>{let u=a.findIndex(([l])=>"id"in s&&s.id&&"index"in s&&s.index!==void 0?s.id===l.id&&s.index===l.index:"id"in s&&s.id?s.id===l.id:"index"in s&&s.index!==void 0?s.index===l.index:!1);return u!==-1?a[u].push(s):a.push([s]),a},[]),o=[],i=[];for(let a of n){let s=null,u=a[0]?.name??"",l=a.map(f=>f.args||"").join(""),c=l.length?l:"{}",d=a[0]?.id;try{if(s=qU(c),!d||s===null||typeof s!="object"||Array.isArray(s))throw new Error("Malformed tool call chunk args.");o.push({name:u,args:s,id:d,type:"tool_call"})}catch{i.push({name:u,args:c,id:d,error:"Malformed args.",type:"invalid_tool_call"})}}r={...e,tool_calls:o,invalid_tool_calls:i,usage_metadata:e.usage_metadata!==void 0?e.usage_metadata:void 0}}super(r);M(this,"type","ai");M(this,"tool_calls",[]);M(this,"invalid_tool_calls",[]);M(this,"tool_call_chunks",[]);M(this,"usage_metadata");this.tool_call_chunks=r.tool_call_chunks??this.tool_call_chunks,this.tool_calls=r.tool_calls??this.tool_calls,this.invalid_tool_calls=r.invalid_tool_calls??this.invalid_tool_calls,this.usage_metadata=r.usage_metadata}get lc_aliases(){return{...super.lc_aliases,tool_calls:"tool_calls",invalid_tool_calls:"invalid_tool_calls",tool_call_chunks:"tool_call_chunks"}}static lc_name(){return"AIMessageChunk"}get contentBlocks(){if(this.response_metadata&&"output_version"in this.response_metadata&&this.response_metadata.output_version==="v1")return this.content;if(this.response_metadata&&"model_provider"in this.response_metadata&&typeof this.response_metadata.model_provider=="string"){let r=VFe(this.response_metadata.model_provider);if(r)return r.translateContent(this)}let e=super.contentBlocks;if(this.tool_calls&&typeof this.content!="string"){let r=this.content.filter(n=>n.type==="tool_call").map(n=>n.id);for(let n of this.tool_calls)n.id&&!r.includes(n.id)&&e.push({...n,type:"tool_call",id:n.id,name:n.name,args:n.args})}return e}get _printableFields(){return{...super._printableFields,tool_calls:this.tool_calls,tool_call_chunks:this.tool_call_chunks,invalid_tool_calls:this.invalid_tool_calls,usage_metadata:this.usage_metadata}}concat(e){let r={content:Kb(this.content,e.content),additional_kwargs:_l(this.additional_kwargs,e.additional_kwargs),response_metadata:qfe(this.response_metadata,e.response_metadata),tool_call_chunks:[],id:this.id??e.id};if(this.tool_call_chunks!==void 0||e.tool_call_chunks!==void 0){let o=UU(this.tool_call_chunks,e.tool_call_chunks);o!==void 0&&o.length>0&&(r.tool_call_chunks=o)}(this.usage_metadata!==void 0||e.usage_metadata!==void 0)&&(r.usage_metadata=Bfe(this.usage_metadata,e.usage_metadata));let n=this.constructor;return new n(r)}static isInstance(e){return super.isInstance(e)&&e.type==="ai"}}});function Qwt(t){return t._getType()==="generic"}function eSt(t){return t._getType()==="generic"}var ud,bv,_Y=v(()=>{Gg();ud=class Ywt extends Uc{constructor(r,n){(typeof r=="string"||Array.isArray(r))&&(r={content:r,role:n});super(r);M(this,"type","generic");M(this,"role");this.role=r.role}static lc_name(){return"ChatMessage"}static _chatMessageClass(){return Ywt}static isInstance(r){return super.isInstance(r)&&r.type==="generic"}get _printableFields(){return{...super._printableFields,role:this.role}}},bv=class extends Wb{constructor(e,r){(typeof e=="string"||Array.isArray(e))&&(e={content:e,role:r});super(e);M(this,"type","generic");M(this,"role");this.role=e.role}static lc_name(){return"ChatMessageChunk"}concat(e){let r=this.constructor;return new r({content:Kb(this.content,e.content),additional_kwargs:_l(this.additional_kwargs,e.additional_kwargs),response_metadata:_l(this.response_metadata,e.response_metadata),role:this.role,id:this.id??e.id})}static isInstance(e){return super.isInstance(e)&&e.type==="generic"}get _printableFields(){return{...super._printableFields,role:this.role}}}});function tSt(t){return t._getType()==="function"}function rSt(t){return t._getType()==="function"}var zU,_v,Ufe=v(()=>{Gg();zU=class extends Uc{constructor(e){super(e);M(this,"type","function");M(this,"name");this.name=e.name}static lc_name(){return"FunctionMessage"}},_v=class extends Wb{constructor(){super(...arguments);M(this,"type","function")}static lc_name(){return"FunctionMessageChunk"}concat(e){let r=this.constructor;return new r({content:Kb(this.content,e.content),additional_kwargs:_l(this.additional_kwargs,e.additional_kwargs),response_metadata:_l(this.response_metadata,e.response_metadata),name:this.name??"",id:this.id??e.id})}}});function nSt(t){return t.getType()==="human"}function oSt(t){return t.getType()==="human"}var au,vv,U$=v(()=>{Gg();au=class extends Uc{constructor(e){super(e);M(this,"type","human")}static lc_name(){return"HumanMessage"}static isInstance(e){return super.isInstance(e)&&e.type==="human"}},vv=class extends Wb{constructor(e){super(e);M(this,"type","human")}static lc_name(){return"HumanMessageChunk"}concat(e){let r=this.constructor;return new r({content:Kb(this.content,e.content),additional_kwargs:_l(this.additional_kwargs,e.additional_kwargs),response_metadata:_l(this.response_metadata,e.response_metadata),id:this.id??e.id})}static isInstance(e){return super.isInstance(e)&&e.type==="human"}}});function iSt(t){return t._getType()==="system"}function aSt(t){return t._getType()==="system"}var th,Ky,vY=v(()=>{Gg();th=class extends Uc{constructor(e){super(e);M(this,"type","system")}static lc_name(){return"SystemMessage"}static isInstance(e){return super.isInstance(e)&&e.type==="system"}},Ky=class extends Wb{constructor(e){super(e);M(this,"type","system")}static lc_name(){return"SystemMessageChunk"}concat(e){let r=this.constructor;return new r({content:Kb(this.content,e.content),additional_kwargs:_l(this.additional_kwargs,e.additional_kwargs),response_metadata:_l(this.response_metadata,e.response_metadata),id:this.id??e.id})}static isInstance(e){return super.isInstance(e)&&e.type==="system"}}});var HU,zfe=v(()=>{Gg();HU=class extends Uc{constructor(e){super({...e,content:[]});M(this,"type","remove");M(this,"id");this.id=e.id}get _printableFields(){return{...super._printableFields,id:this.id}}static isInstance(e){return super.isInstance(e)&&e.type==="remove"}}});function Pan(t){return k$(t)?t:typeof t.id=="string"&&t.type==="function"&&typeof t.function=="object"&&t.function!==null&&"arguments"in t.function&&typeof t.function.arguments=="string"&&"name"in t.function&&typeof t.function.name=="string"?{id:t.id,args:JSON.parse(t.function.arguments),name:t.function.name,type:"tool_call"}:t}function Man(t){return typeof t=="object"&&t!=null&&t.lc===1&&Array.isArray(t.id)&&t.kwargs!=null&&typeof t.kwargs=="object"}function KFe(t){let e,r;if(Man(t)){let n=t.id.at(-1);n==="HumanMessage"||n==="HumanMessageChunk"?e="user":n==="AIMessage"||n==="AIMessageChunk"?e="assistant":n==="SystemMessage"||n==="SystemMessageChunk"?e="system":n==="FunctionMessage"||n==="FunctionMessageChunk"?e="function":n==="ToolMessage"||n==="ToolMessageChunk"?e="tool":e="unknown",r=t.kwargs}else{let{type:n,...o}=t;e=n,r=o}if(e==="human"||e==="user")return new au(r);if(e==="ai"||e==="assistant"){let{tool_calls:n,...o}=r;if(!Array.isArray(n))return new li(r);let i=n.map(Pan);return new li({...o,tool_calls:i})}else{if(e==="system")return new th(r);if(e==="developer")return new th({...r,additional_kwargs:{...r.additional_kwargs,__openai_role__:"developer"}});if(e==="tool"&&"tool_call_id"in r)return new Gb({...r,content:r.content,tool_call_id:r.tool_call_id,name:r.name});if(e==="remove"&&"id"in r&&typeof r.id=="string")return new HU({...r,id:r.id});throw L$(new Error(`Unable to coerce message from array: only human, AI, system, developer, or tool message coercion is currently supported. + +Received: ${JSON.stringify(t,null,2)}`),"MESSAGE_COERCION_FAILURE")}}function Nw(t){if(typeof t=="string")return new au(t);if(eh(t))return t;if(Array.isArray(t)){let[e,r]=t;return KFe({type:e,content:r})}else if(kfe(t)){let{role:e,...r}=t;return KFe({...r,type:e})}else return KFe(t)}function Xu(t,e="Human",r="AI"){let n=[];for(let o of t){let i;if(o._getType()==="human")i=e;else if(o._getType()==="ai")i=r;else if(o._getType()==="system")i="System";else if(o._getType()==="tool")i="Tool";else if(o._getType()==="generic")i=o.role;else throw new Error(`Got unsupported message type: ${o._getType()}`);let a=o.name?`${o.name}, `:"",s=typeof o.content=="string"?o.content:JSON.stringify(o.content,null,2);n.push(`${i}: ${a}${s}`)}return n.join(` +`)}function Ran(t){if(t.data!==void 0)return t;{let e=t;return{type:e.type,data:{content:e.text,role:e.role,name:void 0,tool_call_id:void 0}}}}function wY(t){let e=Ran(t);switch(e.type){case"human":return new au(e.data);case"ai":return new li(e.data);case"system":return new th(e.data);case"function":if(e.data.name===void 0)throw new Error("Name must be defined for function messages");return new zU(e.data);case"tool":if(e.data.tool_call_id===void 0)throw new Error("Tool call ID must be defined for tool messages");return new Gb(e.data);case"generic":if(e.data.role===void 0)throw new Error("Role must be defined for chat messages");return new ud(e.data);default:throw new Error(`Got unexpected type: ${e.type}`)}}function uSt(t){return t.map(wY)}function lSt(t){return t.map(e=>e.toDict())}function VU(t){let e=t._getType();if(e==="human")return new vv({...t});if(e==="ai"){let r={...t};return"tool_calls"in r&&(r={...r,tool_call_chunks:r.tool_calls?.map(n=>({...n,type:"tool_call_chunk",index:void 0,args:JSON.stringify(n.args)}))}),new Nr({...r})}else{if(e==="system")return new Ky({...t});if(e==="function")return new _v({...t});if(ud.isInstance(t))return new bv({...t});throw new Error("Unknown message type.")}}var sSt,iO=v(()=>{Gg();Q3();z0();_Y();Ufe();U$();vY();dY();Afe();zfe();sSt=t=>t()});function ZFe(){return WFe===void 0&&(WFe={library:"langchain-js",runtime:GFe()}),WFe}function dn(t){try{return typeof process<"u"?process.env?.[t]:Hfe()?Deno?.env.get(t):void 0}catch{return}}var Aan,cSt,dSt,fSt,Hfe,pSt,GFe,WFe,Yu=v(()=>{Do();Aan={};Tt(Aan,{getEnv:()=>GFe,getEnvironmentVariable:()=>dn,getRuntimeEnvironment:()=>ZFe,isBrowser:()=>cSt,isDeno:()=>Hfe,isJsDom:()=>fSt,isNode:()=>pSt,isWebWorker:()=>dSt});cSt=()=>typeof window<"u"&&typeof window.document<"u",dSt=()=>typeof globalThis=="object"&&globalThis.constructor&&globalThis.constructor.name==="DedicatedWorkerGlobalScope",fSt=()=>typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent.includes("jsdom"),Hfe=()=>typeof Deno<"u",pSt=()=>typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"&&!Hfe(),GFe=()=>{let t;return cSt()?t="browser":pSt()?t="node":dSt()?t="webworker":fSt()?t="jsdom":Hfe()?t="deno":t="other",t}});var mSt,hSt=v(()=>{mSt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});function Ian(t){return typeof t=="string"&&mSt.test(t)}var e6,gSt=v(()=>{hSt();e6=Ian});function ySt(t,e=0){return(Gh[t[e+0]]+Gh[t[e+1]]+Gh[t[e+2]]+Gh[t[e+3]]+"-"+Gh[t[e+4]]+Gh[t[e+5]]+"-"+Gh[t[e+6]]+Gh[t[e+7]]+"-"+Gh[t[e+8]]+Gh[t[e+9]]+"-"+Gh[t[e+10]]+Gh[t[e+11]]+Gh[t[e+12]]+Gh[t[e+13]]+Gh[t[e+14]]+Gh[t[e+15]]).toLowerCase()}var Gh,Vfe,bSt=v(()=>{Gh=[];for(Vfe=0;Vfe<256;++Vfe)Gh.push((Vfe+256).toString(16).slice(1))});function XFe(){if(!Jfe&&(Jfe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Jfe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Jfe(Nan)}var Jfe,Nan,_St=v(()=>{Nan=new Uint8Array(16)});var jan,YFe,vSt=v(()=>{jan=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),YFe={randomUUID:jan}});function Dan(t,e,r){if(YFe.randomUUID&&!e&&!t)return YFe.randomUUID();t=t||{};var n=t.random||(t.rng||XFe)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(var o=0;o<16;++o)e[r+o]=n[o];return e}return ySt(n)}var Zb,wSt=v(()=>{vSt();_St();bSt();Zb=Dan});var SY=v(()=>{wSt();gSt()});function CY(t){return"lc_prefer_streaming"in t&&t.lc_prefer_streaming}var Lan,Fan,JU,QFe,xY=v(()=>{Do();F$();Yu();SY();Lan={};Tt(Lan,{BaseCallbackHandler:()=>JU,callbackHandlerPrefersStreaming:()=>CY,isBaseCallbackHandler:()=>QFe});Fan=class{};JU=class extends Fan{constructor(e){super();M(this,"lc_serializable",!1);M(this,"lc_kwargs");M(this,"ignoreLLM",!1);M(this,"ignoreChain",!1);M(this,"ignoreAgent",!1);M(this,"ignoreRetriever",!1);M(this,"ignoreCustomEvent",!1);M(this,"raiseError",!1);M(this,"awaitHandlers",dn("LANGCHAIN_CALLBACKS_BACKGROUND")==="false");this.lc_kwargs=e||{},e&&(this.ignoreLLM=e.ignoreLLM??this.ignoreLLM,this.ignoreChain=e.ignoreChain??this.ignoreChain,this.ignoreAgent=e.ignoreAgent??this.ignoreAgent,this.ignoreRetriever=e.ignoreRetriever??this.ignoreRetriever,this.ignoreCustomEvent=e.ignoreCustomEvent??this.ignoreCustomEvent,this.raiseError=e.raiseError??this.raiseError,this.awaitHandlers=this.raiseError||(e._awaitHandler??this.awaitHandlers))}get lc_namespace(){return["langchain_core","callbacks",this.name]}get lc_secrets(){}get lc_attributes(){}get lc_aliases(){}get lc_serializable_keys(){}static lc_name(){return this.name}get lc_id(){return[...this.lc_namespace,Rfe(this.constructor)]}copy(){return new this.constructor(this)}toJSON(){return Wh.prototype.toJSON.call(this)}toJSONNotImplemented(){return Wh.prototype.toJSONNotImplemented.call(this)}static fromMethods(e){class r extends JU{constructor(){super();M(this,"name",Zb());Object.assign(this,e)}}return new r}},QFe=t=>{let e=t;return e!==void 0&&typeof e.copy=="function"&&typeof e.name=="string"&&typeof e.awaitHandlers=="boolean"}});var SSt,CSt=v(()=>{SSt=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-8][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/i});function kan(t){return typeof t=="string"&&SSt.test(t)}var xSt,OSt=v(()=>{CSt();xSt=kan});function qan(t){if(!xSt(t))throw TypeError("Invalid UUID");var e,r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=e&255,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=e&255,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=e&255,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=e&255,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=e&255,r}var TSt,ESt=v(()=>{OSt();TSt=qan});function Wfe(t,e=0){return(Zh[t[e+0]]+Zh[t[e+1]]+Zh[t[e+2]]+Zh[t[e+3]]+"-"+Zh[t[e+4]]+Zh[t[e+5]]+"-"+Zh[t[e+6]]+Zh[t[e+7]]+"-"+Zh[t[e+8]]+Zh[t[e+9]]+"-"+Zh[t[e+10]]+Zh[t[e+11]]+Zh[t[e+12]]+Zh[t[e+13]]+Zh[t[e+14]]+Zh[t[e+15]]).toLowerCase()}var Zh,Kfe,eke=v(()=>{Zh=[];for(Kfe=0;Kfe<256;++Kfe)Zh.push((Kfe+256).toString(16).slice(1))});function tke(){if(!Gfe&&(Gfe=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!Gfe))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Gfe(Ban)}var Gfe,Ban,PSt=v(()=>{Ban=new Uint8Array(16)});function Uan(t){t=unescape(encodeURIComponent(t));for(var e=[],r=0;r{eke();ESt();zan="6ba7b810-9dad-11d1-80b4-00c04fd430c8",Han="6ba7b811-9dad-11d1-80b4-00c04fd430c8"});var Van,nke,RSt=v(()=>{Van=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),nke={randomUUID:Van}});function Jan(t,e,r){if(nke.randomUUID&&!e&&!t)return nke.randomUUID();t=t||{};var n=t.random||(t.rng||tke)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(var o=0;o<16;++o)e[r+o]=n[o];return e}return Wfe(n)}var nN,ASt=v(()=>{RSt();PSt();eke();nN=Jan});function Kan(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:return e^r^n;case 2:return e&r^e&n^r&n;case 3:return e^r^n}}function oke(t,e){return t<>>32-e}function Wan(t){var e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if(typeof t=="string"){var n=unescape(encodeURIComponent(t));t=[];for(var o=0;o>>0;_=b,b=y,y=oke(g,30)>>>0,g=h,h=O}r[0]=r[0]+h>>>0,r[1]=r[1]+g>>>0,r[2]=r[2]+y>>>0,r[3]=r[3]+b>>>0,r[4]=r[4]+_>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,r[0]&255,r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,r[1]&255,r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,r[2]&255,r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,r[3]&255,r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,r[4]&255]}var ISt,NSt=v(()=>{ISt=Wan});var Gan,Zfe,jSt=v(()=>{MSt();NSt();Gan=rke("v5",80,ISt),Zfe=Gan});var ike=v(()=>{ASt();jSt()});var $St,LSt,ake,FSt,ske,uke,lke,kSt,qSt,BSt,USt,zSt,HSt,VSt,JSt,KSt,WSt,GSt,ZSt,XSt,YSt,QSt,e0t,t0t,r0t,n0t,o0t,i0t,a0t,s0t,cke,u0t,l0t,c0t=v(()=>{$St="gen_ai.operation.name",LSt="gen_ai.system",ake="gen_ai.request.model",FSt="gen_ai.response.model",ske="gen_ai.usage.input_tokens",uke="gen_ai.usage.output_tokens",lke="gen_ai.usage.total_tokens",kSt="gen_ai.request.max_tokens",qSt="gen_ai.request.temperature",BSt="gen_ai.request.top_p",USt="gen_ai.request.frequency_penalty",zSt="gen_ai.request.presence_penalty",HSt="gen_ai.response.finish_reasons",VSt="gen_ai.prompt",JSt="gen_ai.completion",KSt="gen_ai.request.extra_query",WSt="gen_ai.request.extra_body",GSt="gen_ai.serialized.name",ZSt="gen_ai.serialized.signature",XSt="gen_ai.serialized.doc",YSt="gen_ai.response.id",QSt="gen_ai.response.service_tier",e0t="gen_ai.response.system_fingerprint",t0t="gen_ai.usage.input_token_details",r0t="gen_ai.usage.output_token_details",n0t="langsmith.trace.session_id",o0t="langsmith.trace.session_name",i0t="langsmith.span.kind",a0t="langsmith.trace.name",s0t="langsmith.metadata",cke="langsmith.span.tags",u0t="langsmith.request.streaming",l0t="langsmith.request.headers"});var Xan,d0t,f0t,p0t,dke=v(()=>{oN();Xan=(...t)=>fetch(...t),d0t=Symbol.for("ls:fetch_implementation"),f0t=()=>{let t=globalThis[d0t];return t?typeof t=="function"&&"Headers"in t&&"Request"in t&&"Response"in t:!1},p0t=t=>async(...e)=>{if(t||ld("DEBUG")==="true"){let[n,o]=e;console.log(`\u2192 ${o?.method||"GET"} ${n}`)}let r=await(globalThis[d0t]??Xan)(...e);return(t||ld("DEBUG")==="true")&&console.log(`\u2190 ${r.status} ${r.statusText} ${r.url}`),r}});var OY,fke=v(()=>{oN();OY=()=>ld("PROJECT")??wv("LANGCHAIN_SESSION")??"default"});var Xfe,Yfe=v(()=>{pke();mke();dke();fke();Xfe="0.3.74"});function Qfe(){if(hke===void 0){let t=yke(),e=nsn();hke={library:"langsmith",runtime:t,sdk:"langsmith-js",sdk_version:Xfe,...e}}return hke}function bke(){let t=rsn(),e={},r=["LANGCHAIN_API_KEY","LANGCHAIN_ENDPOINT","LANGCHAIN_TRACING_V2","LANGCHAIN_PROJECT","LANGCHAIN_SESSION","LANGSMITH_API_KEY","LANGSMITH_ENDPOINT","LANGSMITH_TRACING_V2","LANGSMITH_PROJECT","LANGSMITH_SESSION"];for(let[n,o]of Object.entries(t))typeof o=="string"&&!r.includes(n)&&!n.toLowerCase().includes("key")&&!n.toLowerCase().includes("secret")&&!n.toLowerCase().includes("token")&&(n==="LANGCHAIN_REVISION_ID"?e.revision_id=o:e[n]=o);return e}function rsn(){let t={};try{if(typeof process<"u"&&process.env)for(let[e,r]of Object.entries(process.env))(e.startsWith("LANGCHAIN_")||e.startsWith("LANGSMITH_"))&&r!=null&&((e.toLowerCase().includes("key")||e.toLowerCase().includes("secret")||e.toLowerCase().includes("token"))&&typeof r=="string"?t[e]=r.slice(0,2)+"*".repeat(r.length-4)+r.slice(-2):t[e]=r)}catch{}return t}function wv(t){try{return typeof process<"u"?process.env?.[t]:void 0}catch{return}}function ld(t){return wv(`LANGSMITH_${t}`)||wv(`LANGCHAIN_${t}`)}function nsn(){if(gke!==void 0)return gke;let t=["VERCEL_GIT_COMMIT_SHA","NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA","COMMIT_REF","RENDER_GIT_COMMIT","CI_COMMIT_SHA","CIRCLE_SHA1","CF_PAGES_COMMIT_SHA","REACT_APP_GIT_SHA","SOURCE_VERSION","GITHUB_SHA","TRAVIS_COMMIT","GIT_COMMIT","BUILD_VCS_NUMBER","bamboo_planRepository_revision","Build.SourceVersion","BITBUCKET_COMMIT","DRONE_COMMIT_SHA","SEMAPHORE_GIT_SHA","BUILDKITE_COMMIT"],e={};for(let r of t){let n=wv(r);n!==void 0&&(e[r]=n)}return gke=e,e}function epe(){return wv("OTEL_ENABLED")==="true"||ld("OTEL_ENABLED")==="true"}var aO,Yan,Qan,esn,m0t,tsn,yke,hke,gke,oN=v(()=>{Yfe();Yan=()=>typeof window<"u"&&typeof window.document<"u",Qan=()=>typeof globalThis=="object"&&globalThis.constructor&&globalThis.constructor.name==="DedicatedWorkerGlobalScope",esn=()=>typeof window<"u"&&window.name==="nodejs"||typeof navigator<"u"&&navigator.userAgent.includes("jsdom"),m0t=()=>typeof Deno<"u",tsn=()=>typeof process<"u"&&typeof process.versions<"u"&&typeof process.versions.node<"u"&&!m0t(),yke=()=>aO||(typeof Bun<"u"?aO="bun":Yan()?aO="browser":tsn()?aO="node":Qan()?aO="webworker":esn()?aO="jsdom":m0t()?aO="deno":aO="other",aO)});function tpe(){return Oke.getTraceInstance()}function g0t(){return Oke.getContextInstance()}function y0t(){return Oke.getDefaultOTLPTracerComponents()}var wke,Ske,Cke,_ke,vke,h0t,osn,isn,xke,Oke,Tke=v(()=>{oN();wke=class{constructor(){Object.defineProperty(this,"hasWarned",{enumerable:!0,configurable:!0,writable:!0,value:!1})}startActiveSpan(e,...r){!this.hasWarned&&epe()&&(console.warn('You have enabled OTEL export via the `OTEL_ENABLED` or `LANGSMITH_OTEL_ENABLED` environment variable, but have not initialized the required OTEL instances. Please add:\n```\nimport { initializeOTEL } from "langsmith/experimental/otel/setup";\ninitializeOTEL();\n```\nat the beginning of your code.'),this.hasWarned=!0);let n;if(r.length===1&&typeof r[0]=="function"?n=r[0]:r.length===2&&typeof r[1]=="function"?n=r[1]:r.length===3&&typeof r[2]=="function"&&(n=r[2]),typeof n=="function")return n()}},Ske=class{constructor(){Object.defineProperty(this,"mockTracer",{enumerable:!0,configurable:!0,writable:!0,value:new wke})}getTracer(e,r){return this.mockTracer}getActiveSpan(){}setSpan(e,r){return e}getSpan(e){}setSpanContext(e,r){return e}getTracerProvider(){}setGlobalTracerProvider(e){return!1}},Cke=class{active(){return{}}with(e,r){return r()}},_ke=Symbol.for("ls:otel_trace"),vke=Symbol.for("ls:otel_context"),h0t=Symbol.for("ls:otel_get_default_otlp_tracer_provider"),osn=new Ske,isn=new Cke,xke=class{getTraceInstance(){return globalThis[_ke]??osn}getContextInstance(){return globalThis[vke]??isn}initializeGlobalInstances(e){globalThis[_ke]===void 0&&(globalThis[_ke]=e.trace),globalThis[vke]===void 0&&(globalThis[vke]=e.context)}setDefaultOTLPTracerComponents(e){globalThis[h0t]=e}getDefaultOTLPTracerComponents(){return globalThis[h0t]??void 0}},Oke=new xke});function ssn(t){return asn[t]||t}var asn,rpe,b0t=v(()=>{c0t();Tke();asn={llm:"chat",tool:"execute_tool",retriever:"embeddings",embedding:"embeddings",prompt:"chat"};rpe=class{constructor(){Object.defineProperty(this,"spans",{enumerable:!0,configurable:!0,writable:!0,value:new Map})}exportBatch(e,r){for(let n of e)try{if(!n.run)continue;if(n.operation==="post"){let o=this.createSpanForRun(n,n.run,r.get(n.id));o&&!n.run.end_time&&this.spans.set(n.id,o)}else this.updateSpanForRun(n,n.run)}catch(o){console.error(`Error processing operation ${n.id}:`,o)}}createSpanForRun(e,r,n){let o=n&&tpe().getSpan(n);if(o)try{return this.finishSpanSetup(o,r,e)}catch(i){console.error(`Failed to create span for run ${e.id}:`,i);return}}finishSpanSetup(e,r,n){return this.setSpanAttributes(e,r,n),r.error?(e.setStatus({code:2}),e.recordException(new Error(r.error))):e.setStatus({code:1}),r.end_time&&e.end(new Date(r.end_time)),e}updateSpanForRun(e,r){try{let n=this.spans.get(e.id);if(!n){console.debug(`No span found for run ${e.id} during update`);return}this.setSpanAttributes(n,r,e),r.error?(n.setStatus({code:2}),n.recordException(new Error(r.error))):n.setStatus({code:1});let o=r.end_time;o&&(n.end(new Date(o)),this.spans.delete(e.id))}catch(n){console.error(`Failed to update span for run ${e.id}:`,n)}}extractModelName(e){if(e.extra?.metadata){let r=e.extra.metadata;if(r.ls_model_name)return r.ls_model_name;if(r.invocation_params){let n=r.invocation_params;if(n.model)return n.model;if(n.model_name)return n.model_name}}}setSpanAttributes(e,r,n){if("run_type"in r&&r.run_type){e.setAttribute(i0t,r.run_type);let s=ssn(r.run_type||"chain");e.setAttribute($St,s)}"name"in r&&r.name&&e.setAttribute(a0t,r.name),"session_id"in r&&r.session_id&&e.setAttribute(n0t,r.session_id),"session_name"in r&&r.session_name&&e.setAttribute(o0t,r.session_name),this.setGenAiSystem(e,r);let o=this.extractModelName(r);o&&e.setAttribute(ake,o),"prompt_tokens"in r&&typeof r.prompt_tokens=="number"&&e.setAttribute(ske,r.prompt_tokens),"completion_tokens"in r&&typeof r.completion_tokens=="number"&&e.setAttribute(uke,r.completion_tokens),"total_tokens"in r&&typeof r.total_tokens=="number"&&e.setAttribute(lke,r.total_tokens),this.setInvocationParameters(e,r);let i=r.extra?.metadata||{};for(let[s,u]of Object.entries(i))u!=null&&e.setAttribute(`${s0t}.${s}`,String(u));let a=r.tags;if(a&&Array.isArray(a)?e.setAttribute(cke,a.join(", ")):a&&e.setAttribute(cke,String(a)),"serialized"in r&&typeof r.serialized=="object"){let s=r.serialized;s.name&&e.setAttribute(GSt,String(s.name)),s.signature&&e.setAttribute(ZSt,String(s.signature)),s.doc&&e.setAttribute(XSt,String(s.doc))}this.setIOAttributes(e,n)}setGenAiSystem(e,r){let n="langchain",o=this.extractModelName(r);if(o){let i=o.toLowerCase();i.includes("anthropic")||i.startsWith("claude")?n="anthropic":i.includes("bedrock")?n="aws.bedrock":i.includes("azure")&&i.includes("openai")?n="az.ai.openai":i.includes("azure")&&i.includes("inference")?n="az.ai.inference":i.includes("cohere")?n="cohere":i.includes("deepseek")?n="deepseek":i.includes("gemini")?n="gemini":i.includes("groq")?n="groq":i.includes("watson")||i.includes("ibm")?n="ibm.watsonx.ai":i.includes("mistral")?n="mistral_ai":i.includes("gpt")||i.includes("openai")?n="openai":i.includes("perplexity")||i.includes("sonar")?n="perplexity":i.includes("vertex")?n="vertex_ai":(i.includes("xai")||i.includes("grok"))&&(n="xai")}e.setAttribute(LSt,n)}setInvocationParameters(e,r){if(!r.extra?.metadata?.invocation_params)return;let n=r.extra.metadata.invocation_params;n.max_tokens!==void 0&&e.setAttribute(kSt,n.max_tokens),n.temperature!==void 0&&e.setAttribute(qSt,n.temperature),n.top_p!==void 0&&e.setAttribute(BSt,n.top_p),n.frequency_penalty!==void 0&&e.setAttribute(USt,n.frequency_penalty),n.presence_penalty!==void 0&&e.setAttribute(zSt,n.presence_penalty)}setIOAttributes(e,r){if(r.run.inputs)try{let n=r.run.inputs;typeof n=="object"&&n!==null&&(n.model&&Array.isArray(n.messages)&&e.setAttribute(ake,n.model),n.stream!==void 0&&e.setAttribute(u0t,n.stream),n.extra_headers&&e.setAttribute(l0t,JSON.stringify(n.extra_headers)),n.extra_query&&e.setAttribute(KSt,JSON.stringify(n.extra_query)),n.extra_body&&e.setAttribute(WSt,JSON.stringify(n.extra_body))),e.setAttribute(VSt,JSON.stringify(n))}catch(n){console.debug(`Failed to process inputs for run ${r.id}`,n)}if(r.run.outputs)try{let n=r.run.outputs,o=this.getUnifiedRunTokens(n);if(o&&(e.setAttribute(ske,o[0]),e.setAttribute(uke,o[1]),e.setAttribute(lke,o[0]+o[1])),n&&typeof n=="object"){if(n.model&&e.setAttribute(FSt,String(n.model)),n.id&&e.setAttribute(YSt,n.id),n.choices&&Array.isArray(n.choices)){let i=n.choices.map(a=>a.finish_reason).filter(a=>a).map(String);i.length>0&&e.setAttribute(HSt,i.join(", "))}if(n.service_tier&&e.setAttribute(QSt,n.service_tier),n.system_fingerprint&&e.setAttribute(e0t,n.system_fingerprint),n.usage_metadata&&typeof n.usage_metadata=="object"){let i=n.usage_metadata;i.input_token_details&&e.setAttribute(t0t,JSON.stringify(i.input_token_details)),i.output_token_details&&e.setAttribute(r0t,JSON.stringify(i.output_token_details))}}e.setAttribute(JSt,JSON.stringify(n))}catch(n){console.debug(`Failed to process outputs for run ${r.id}`,n)}}getUnifiedRunTokens(e){if(!e)return null;let r=this.extractUnifiedRunTokens(e.usage_metadata);if(r)return r;let n=Object.keys(e);for(let a of n){let s=e[a];if(!(!s||typeof s!="object")&&(r=this.extractUnifiedRunTokens(s.usage_metadata),r||s.lc===1&&s.kwargs&&typeof s.kwargs=="object"&&(r=this.extractUnifiedRunTokens(s.kwargs.usage_metadata),r)))return r}let o=e.generations||[];if(!Array.isArray(o))return null;let i=Array.isArray(o[0])?o.flat():o;for(let a of i)if(typeof a=="object"&&a.message&&typeof a.message=="object"&&a.message.kwargs&&typeof a.message.kwargs=="object"&&(r=this.extractUnifiedRunTokens(a.message.kwargs.usage_metadata),r))return r;return null}extractUnifiedRunTokens(e){return!e||typeof e!="object"||typeof e.input_tokens!="number"||typeof e.output_tokens!="number"?null:[e.input_tokens,e.output_tokens]}}});var v0t=S((Kgi,_0t)=>{function jw(t,e){typeof e=="boolean"&&(e={forever:e}),this._originalTimeouts=JSON.parse(JSON.stringify(t)),this._timeouts=t,this._options=e||{},this._maxRetryTime=e&&e.maxRetryTime||1/0,this._fn=null,this._errors=[],this._attempts=1,this._operationTimeout=null,this._operationTimeoutCb=null,this._timeout=null,this._operationStart=null,this._timer=null,this._options.forever&&(this._cachedTimeouts=this._timeouts.slice(0))}_0t.exports=jw;jw.prototype.reset=function(){this._attempts=1,this._timeouts=this._originalTimeouts.slice(0)};jw.prototype.stop=function(){this._timeout&&clearTimeout(this._timeout),this._timer&&clearTimeout(this._timer),this._timeouts=[],this._cachedTimeouts=null};jw.prototype.retry=function(t){if(this._timeout&&clearTimeout(this._timeout),!t)return!1;var e=new Date().getTime();if(t&&e-this._operationStart>=this._maxRetryTime)return this._errors.push(t),this._errors.unshift(new Error("RetryOperation timeout occurred")),!1;this._errors.push(t);var r=this._timeouts.shift();if(r===void 0)if(this._cachedTimeouts)this._errors.splice(0,this._errors.length-1),r=this._cachedTimeouts.slice(-1);else return!1;var n=this;return this._timer=setTimeout(function(){n._attempts++,n._operationTimeoutCb&&(n._timeout=setTimeout(function(){n._operationTimeoutCb(n._attempts)},n._operationTimeout),n._options.unref&&n._timeout.unref()),n._fn(n._attempts)},r),this._options.unref&&this._timer.unref(),!0};jw.prototype.attempt=function(t,e){this._fn=t,e&&(e.timeout&&(this._operationTimeout=e.timeout),e.cb&&(this._operationTimeoutCb=e.cb));var r=this;this._operationTimeoutCb&&(this._timeout=setTimeout(function(){r._operationTimeoutCb()},r._operationTimeout)),this._operationStart=new Date().getTime(),this._fn(this._attempts)};jw.prototype.try=function(t){console.log("Using RetryOperation.try() is deprecated"),this.attempt(t)};jw.prototype.start=function(t){console.log("Using RetryOperation.start() is deprecated"),this.attempt(t)};jw.prototype.start=jw.prototype.try;jw.prototype.errors=function(){return this._errors};jw.prototype.attempts=function(){return this._attempts};jw.prototype.mainError=function(){if(this._errors.length===0)return null;for(var t={},e=null,r=0,n=0;n=r&&(e=o,r=a)}return e}});var w0t=S(WU=>{var usn=v0t();WU.operation=function(t){var e=WU.timeouts(t);return new usn(e,{forever:t&&(t.forever||t.retries===1/0),unref:t&&t.unref,maxRetryTime:t&&t.maxRetryTime})};WU.timeouts=function(t){if(t instanceof Array)return[].concat(t);var e={retries:10,factor:2,minTimeout:1*1e3,maxTimeout:1/0,randomize:!1};for(var r in t)e[r]=t[r];if(e.minTimeout>e.maxTimeout)throw new Error("minTimeout is greater than maxTimeout");for(var n=[],o=0;o{S0t.exports=w0t()});var ipe=S((Zgi,ope)=>{"use strict";var lsn=C0t(),csn=["Failed to fetch","NetworkError when attempting to fetch resource.","The Internet connection appears to be offline.","Network request failed"],npe=class extends Error{constructor(e){super(),e instanceof Error?(this.originalError=e,{message:e}=e):(this.originalError=new Error(e),this.originalError.stack=this.stack),this.name="AbortError",this.message=e}},dsn=(t,e,r)=>{let n=r.retries-(e-1);return t.attemptNumber=e,t.retriesLeft=n,t},fsn=t=>csn.includes(t),x0t=(t,e)=>new Promise((r,n)=>{e={onFailedAttempt:()=>{},retries:10,...e};let o=lsn.operation(e);o.attempt(async i=>{try{r(await t(i))}catch(a){if(!(a instanceof Error)){n(new TypeError(`Non-error was thrown: "${a}". You should only throw errors.`));return}if(a instanceof npe)o.stop(),n(a.originalError);else if(a instanceof TypeError&&!fsn(a.message))o.stop(),n(a);else{dsn(a,i,e);try{await e.onFailedAttempt(a)}catch(s){n(s);return}o.retry(a)||n(o.mainError())}}})});ope.exports=x0t;ope.exports.default=x0t;ope.exports.AbortError=npe});var Pke=S((Xgi,Eke)=>{"use strict";var psn=Object.prototype.hasOwnProperty,Wy="~";function TY(){}Object.create&&(TY.prototype=Object.create(null),new TY().__proto__||(Wy=!1));function msn(t,e,r){this.fn=t,this.context=e,this.once=r||!1}function O0t(t,e,r,n,o){if(typeof r!="function")throw new TypeError("The listener must be a function");var i=new msn(r,n||t,o),a=Wy?Wy+e:e;return t._events[a]?t._events[a].fn?t._events[a]=[t._events[a],i]:t._events[a].push(i):(t._events[a]=i,t._eventsCount++),t}function ape(t,e){--t._eventsCount===0?t._events=new TY:delete t._events[e]}function Zg(){this._events=new TY,this._eventsCount=0}Zg.prototype.eventNames=function(){var e=[],r,n;if(this._eventsCount===0)return e;for(n in r=this._events)psn.call(r,n)&&e.push(Wy?n.slice(1):n);return Object.getOwnPropertySymbols?e.concat(Object.getOwnPropertySymbols(r)):e};Zg.prototype.listeners=function(e){var r=Wy?Wy+e:e,n=this._events[r];if(!n)return[];if(n.fn)return[n.fn];for(var o=0,i=n.length,a=new Array(i);o{"use strict";T0t.exports=(t,e)=>(e=e||(()=>{}),t.then(r=>new Promise(n=>{n(e())}).then(()=>r),r=>new Promise(n=>{n(e())}).then(()=>{throw r})))});var P0t=S((Qgi,upe)=>{"use strict";var hsn=Mke(),spe=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},E0t=(t,e,r)=>new Promise((n,o)=>{if(typeof e!="number"||e<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(e===1/0){n(t);return}let i=setTimeout(()=>{if(typeof r=="function"){try{n(r())}catch(u){o(u)}return}let a=typeof r=="string"?r:`Promise timed out after ${e} milliseconds`,s=r instanceof Error?r:new spe(a);typeof t.cancel=="function"&&t.cancel(),o(s)},e);hsn(t.then(n,o),()=>{clearTimeout(i)})});upe.exports=E0t;upe.exports.default=E0t;upe.exports.TimeoutError=spe});var M0t=S(Rke=>{"use strict";Object.defineProperty(Rke,"__esModule",{value:!0});function gsn(t,e,r){let n=0,o=t.length;for(;o>0;){let i=o/2|0,a=n+i;r(t[a],e)<=0?(n=++a,o-=i+1):o=i}return n}Rke.default=gsn});var R0t=S(Ike=>{"use strict";Object.defineProperty(Ike,"__esModule",{value:!0});var ysn=M0t(),Ake=class{constructor(){this._queue=[]}enqueue(e,r){r=Object.assign({priority:0},r);let n={priority:r.priority,run:e};if(this.size&&this._queue[this.size-1].priority>=r.priority){this._queue.push(n);return}let o=ysn.default(this._queue,n,(i,a)=>a.priority-i.priority);this._queue.splice(o,0,n)}dequeue(){let e=this._queue.shift();return e?.run}filter(e){return this._queue.filter(r=>r.priority===e.priority).map(r=>r.run)}get size(){return this._queue.length}};Ike.default=Ake});var I0t=S(jke=>{"use strict";Object.defineProperty(jke,"__esModule",{value:!0});var bsn=Pke(),A0t=P0t(),_sn=R0t(),lpe=()=>{},vsn=new A0t.TimeoutError,Nke=class extends bsn{constructor(e){var r,n,o,i;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=lpe,this._resolveIdle=lpe,e=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:_sn.default},e),!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(r=e.intervalCap)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(i=(o=e.interval)===null||o===void 0?void 0:o.toString())!==null&&i!==void 0?i:""}\` (${typeof e.interval})`);this._carryoverConcurrencyCount=e.carryoverConcurrencyCount,this._isIntervalIgnored=e.intervalCap===1/0||e.interval===0,this._intervalCap=e.intervalCap,this._interval=e.interval,this._queue=new e.queueClass,this._queueClass=e.queueClass,this.concurrency=e.concurrency,this._timeout=e.timeout,this._throwOnTimeout=e.throwOnTimeout===!0,this._isPaused=e.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount{this._onResumeInterval()},r)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){let e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){let r=this._queue.dequeue();return r?(this.emit("active"),r(),e&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this._concurrency=e,this._processQueue()}async add(e,r={}){return new Promise((n,o)=>{let i=async()=>{this._pendingCount++,this._intervalCount++;try{let a=this._timeout===void 0&&r.timeout===void 0?e():A0t.default(Promise.resolve(e()),r.timeout===void 0?this._timeout:r.timeout,()=>{(r.throwOnTimeout===void 0?this._throwOnTimeout:r.throwOnTimeout)&&o(vsn)});n(await a)}catch(a){o(a)}this._next()};this._queue.enqueue(i,r),this._tryToStartAnother(),this.emit("add")})}async addAll(e,r){return Promise.all(e.map(async n=>this.add(n,r)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(e=>{let r=this._resolveEmpty;this._resolveEmpty=()=>{r(),e()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(e=>{let r=this._resolveIdle;this._resolveIdle=()=>{r(),e()}})}get size(){return this._queue.size}sizeBy(e){return this._queue.filter(e).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(e){this._timeout=e}};jke.default=Nke});var N0t,cpe,wsn,EY,j0t=v(()=>{N0t=L(ipe(),1),cpe=L(I0t(),1),wsn=[429,500,502,503,504],EY=class{constructor(e){Object.defineProperty(this,"maxConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"maxRetries",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"queue",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"onFailedResponseHook",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.maxConcurrency=e.maxConcurrency??1/0,this.maxRetries=e.maxRetries??6,"default"in cpe.default?this.queue=new cpe.default.default({concurrency:this.maxConcurrency}):this.queue=new cpe.default({concurrency:this.maxConcurrency}),this.onFailedResponseHook=e?.onFailedResponseHook}call(e,...r){let n=this.onFailedResponseHook;return this.queue.add(()=>(0,N0t.default)(()=>e(...r).catch(o=>{throw o instanceof Error?o:new Error(o)}),{async onFailedAttempt(o){if(o.message.startsWith("Cancel")||o.message.startsWith("TimeoutError")||o.name==="TimeoutError"||o.message.startsWith("AbortError")||o?.code==="ECONNABORTED")throw o;let i=o?.response;if(n&&await n(i))return;let a=i?.status??o?.status;if(a&&!wsn.includes(+a))throw o},retries:this.maxRetries,randomize:!0}),{throwOnTimeout:!0})}callWithOptions(e,r,...n){return e.signal?Promise.race([this.call(r,...n),new Promise((o,i)=>{e.signal?.addEventListener("abort",()=>{i(new Error("AbortError"))})})]):this.call(r,...n)}}});function Dke(t){return typeof t?._getType=="function"}function $ke(t){let e={type:t._getType(),data:{content:t.content}};return t?.additional_kwargs&&Object.keys(t.additional_kwargs).length>0&&(e.data.additional_kwargs={...t.additional_kwargs}),e}var D0t=v(()=>{});function Po(t,e){if(!Ssn.test(t)){let r=e!==void 0?`Invalid UUID for ${e}: ${t}`:`Invalid UUID: ${t}`;throw new Error(r)}return t}var Ssn,$0t=v(()=>{Ssn=/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i});function PY(t){L0t[t]||(console.warn(t),L0t[t]=!0)}var L0t,Lke=v(()=>{L0t={}});var MY=S((syi,F0t)=>{"use strict";var Csn="2.0.0",xsn=Number.MAX_SAFE_INTEGER||9007199254740991,Osn=16,Tsn=250,Esn=["major","premajor","minor","preminor","patch","prepatch","prerelease"];F0t.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Osn,MAX_SAFE_BUILD_LENGTH:Tsn,MAX_SAFE_INTEGER:xsn,RELEASE_TYPES:Esn,SEMVER_SPEC_VERSION:Csn,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var RY=S((uyi,k0t)=>{"use strict";var Psn=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};k0t.exports=Psn});var t6=S((sO,q0t)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:Fke,MAX_SAFE_BUILD_LENGTH:Msn,MAX_LENGTH:Rsn}=MY(),Asn=RY();sO=q0t.exports={};var Isn=sO.re=[],Nsn=sO.safeRe=[],cr=sO.src=[],jsn=sO.safeSrc=[],dr=sO.t={},Dsn=0,kke="[a-zA-Z0-9-]",$sn=[["\\s",1],["\\d",Rsn],[kke,Msn]],Lsn=t=>{for(let[e,r]of $sn)t=t.split(`${e}*`).join(`${e}{0,${r}}`).split(`${e}+`).join(`${e}{1,${r}}`);return t},Ao=(t,e,r)=>{let n=Lsn(e),o=Dsn++;Asn(t,o,e),dr[t]=o,cr[o]=e,jsn[o]=n,Isn[o]=new RegExp(e,r?"g":void 0),Nsn[o]=new RegExp(n,r?"g":void 0)};Ao("NUMERICIDENTIFIER","0|[1-9]\\d*");Ao("NUMERICIDENTIFIERLOOSE","\\d+");Ao("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${kke}*`);Ao("MAINVERSION",`(${cr[dr.NUMERICIDENTIFIER]})\\.(${cr[dr.NUMERICIDENTIFIER]})\\.(${cr[dr.NUMERICIDENTIFIER]})`);Ao("MAINVERSIONLOOSE",`(${cr[dr.NUMERICIDENTIFIERLOOSE]})\\.(${cr[dr.NUMERICIDENTIFIERLOOSE]})\\.(${cr[dr.NUMERICIDENTIFIERLOOSE]})`);Ao("PRERELEASEIDENTIFIER",`(?:${cr[dr.NONNUMERICIDENTIFIER]}|${cr[dr.NUMERICIDENTIFIER]})`);Ao("PRERELEASEIDENTIFIERLOOSE",`(?:${cr[dr.NONNUMERICIDENTIFIER]}|${cr[dr.NUMERICIDENTIFIERLOOSE]})`);Ao("PRERELEASE",`(?:-(${cr[dr.PRERELEASEIDENTIFIER]}(?:\\.${cr[dr.PRERELEASEIDENTIFIER]})*))`);Ao("PRERELEASELOOSE",`(?:-?(${cr[dr.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${cr[dr.PRERELEASEIDENTIFIERLOOSE]})*))`);Ao("BUILDIDENTIFIER",`${kke}+`);Ao("BUILD",`(?:\\+(${cr[dr.BUILDIDENTIFIER]}(?:\\.${cr[dr.BUILDIDENTIFIER]})*))`);Ao("FULLPLAIN",`v?${cr[dr.MAINVERSION]}${cr[dr.PRERELEASE]}?${cr[dr.BUILD]}?`);Ao("FULL",`^${cr[dr.FULLPLAIN]}$`);Ao("LOOSEPLAIN",`[v=\\s]*${cr[dr.MAINVERSIONLOOSE]}${cr[dr.PRERELEASELOOSE]}?${cr[dr.BUILD]}?`);Ao("LOOSE",`^${cr[dr.LOOSEPLAIN]}$`);Ao("GTLT","((?:<|>)?=?)");Ao("XRANGEIDENTIFIERLOOSE",`${cr[dr.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);Ao("XRANGEIDENTIFIER",`${cr[dr.NUMERICIDENTIFIER]}|x|X|\\*`);Ao("XRANGEPLAIN",`[v=\\s]*(${cr[dr.XRANGEIDENTIFIER]})(?:\\.(${cr[dr.XRANGEIDENTIFIER]})(?:\\.(${cr[dr.XRANGEIDENTIFIER]})(?:${cr[dr.PRERELEASE]})?${cr[dr.BUILD]}?)?)?`);Ao("XRANGEPLAINLOOSE",`[v=\\s]*(${cr[dr.XRANGEIDENTIFIERLOOSE]})(?:\\.(${cr[dr.XRANGEIDENTIFIERLOOSE]})(?:\\.(${cr[dr.XRANGEIDENTIFIERLOOSE]})(?:${cr[dr.PRERELEASELOOSE]})?${cr[dr.BUILD]}?)?)?`);Ao("XRANGE",`^${cr[dr.GTLT]}\\s*${cr[dr.XRANGEPLAIN]}$`);Ao("XRANGELOOSE",`^${cr[dr.GTLT]}\\s*${cr[dr.XRANGEPLAINLOOSE]}$`);Ao("COERCEPLAIN",`(^|[^\\d])(\\d{1,${Fke}})(?:\\.(\\d{1,${Fke}}))?(?:\\.(\\d{1,${Fke}}))?`);Ao("COERCE",`${cr[dr.COERCEPLAIN]}(?:$|[^\\d])`);Ao("COERCEFULL",cr[dr.COERCEPLAIN]+`(?:${cr[dr.PRERELEASE]})?(?:${cr[dr.BUILD]})?(?:$|[^\\d])`);Ao("COERCERTL",cr[dr.COERCE],!0);Ao("COERCERTLFULL",cr[dr.COERCEFULL],!0);Ao("LONETILDE","(?:~>?)");Ao("TILDETRIM",`(\\s*)${cr[dr.LONETILDE]}\\s+`,!0);sO.tildeTrimReplace="$1~";Ao("TILDE",`^${cr[dr.LONETILDE]}${cr[dr.XRANGEPLAIN]}$`);Ao("TILDELOOSE",`^${cr[dr.LONETILDE]}${cr[dr.XRANGEPLAINLOOSE]}$`);Ao("LONECARET","(?:\\^)");Ao("CARETTRIM",`(\\s*)${cr[dr.LONECARET]}\\s+`,!0);sO.caretTrimReplace="$1^";Ao("CARET",`^${cr[dr.LONECARET]}${cr[dr.XRANGEPLAIN]}$`);Ao("CARETLOOSE",`^${cr[dr.LONECARET]}${cr[dr.XRANGEPLAINLOOSE]}$`);Ao("COMPARATORLOOSE",`^${cr[dr.GTLT]}\\s*(${cr[dr.LOOSEPLAIN]})$|^$`);Ao("COMPARATOR",`^${cr[dr.GTLT]}\\s*(${cr[dr.FULLPLAIN]})$|^$`);Ao("COMPARATORTRIM",`(\\s*)${cr[dr.GTLT]}\\s*(${cr[dr.LOOSEPLAIN]}|${cr[dr.XRANGEPLAIN]})`,!0);sO.comparatorTrimReplace="$1$2$3";Ao("HYPHENRANGE",`^\\s*(${cr[dr.XRANGEPLAIN]})\\s+-\\s+(${cr[dr.XRANGEPLAIN]})\\s*$`);Ao("HYPHENRANGELOOSE",`^\\s*(${cr[dr.XRANGEPLAINLOOSE]})\\s+-\\s+(${cr[dr.XRANGEPLAINLOOSE]})\\s*$`);Ao("STAR","(<|>)?=?\\s*\\*");Ao("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");Ao("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var dpe=S((lyi,B0t)=>{"use strict";var Fsn=Object.freeze({loose:!0}),ksn=Object.freeze({}),qsn=t=>t?typeof t!="object"?Fsn:t:ksn;B0t.exports=qsn});var qke=S((cyi,H0t)=>{"use strict";var U0t=/^[0-9]+$/,z0t=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:tz0t(e,t);H0t.exports={compareIdentifiers:z0t,rcompareIdentifiers:Bsn}});var Xg=S((dyi,J0t)=>{"use strict";var fpe=RY(),{MAX_LENGTH:V0t,MAX_SAFE_INTEGER:ppe}=MY(),{safeRe:mpe,t:hpe}=t6(),Usn=dpe(),{compareIdentifiers:Bke}=qke(),Uke=class t{constructor(e,r){if(r=Usn(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>V0t)throw new TypeError(`version is longer than ${V0t} characters`);fpe("SemVer",e,r),this.options=r,this.loose=!!r.loose,this.includePrerelease=!!r.includePrerelease;let n=e.trim().match(r.loose?mpe[hpe.LOOSE]:mpe[hpe.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>ppe||this.major<0)throw new TypeError("Invalid major version");if(this.minor>ppe||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>ppe||this.patch<0)throw new TypeError("Invalid patch version");n[4]?this.prerelease=n[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let i=+o;if(i>=0&&ie.major?1:this.minore.minor?1:this.patche.patch?1:0}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],o=e.prerelease[r];if(fpe("prerelease compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return Bke(n,o)}while(++r)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let r=0;do{let n=this.build[r],o=e.build[r];if(fpe("build compare",r,n,o),n===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(n===void 0)return-1;if(n===o)continue;return Bke(n,o)}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 o=`-${r}`.match(this.options.loose?mpe[hpe.PRERELEASELOOSE]:mpe[hpe.PRERELEASE]);if(!o||o[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 o=Number(n)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let i=this.prerelease.length;for(;--i>=0;)typeof this.prerelease[i]=="number"&&(this.prerelease[i]++,i=-2);if(i===-1){if(r===this.prerelease.join(".")&&n===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(r){let i=[r,o];n===!1&&(i=[r]),Bke(this.prerelease[0],r)===0?isNaN(this.prerelease[1])&&(this.prerelease=i):this.prerelease=i}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};J0t.exports=Uke});var GU=S((fyi,W0t)=>{"use strict";var K0t=Xg(),zsn=(t,e,r=!1)=>{if(t instanceof K0t)return t;try{return new K0t(t,e)}catch(n){if(!r)return null;throw n}};W0t.exports=zsn});var Z0t=S((pyi,G0t)=>{"use strict";var Hsn=GU(),Vsn=(t,e)=>{let r=Hsn(t,e);return r?r.version:null};G0t.exports=Vsn});var Y0t=S((myi,X0t)=>{"use strict";var Jsn=GU(),Ksn=(t,e)=>{let r=Jsn(t.trim().replace(/^[=v]+/,""),e);return r?r.version:null};X0t.exports=Ksn});var tCt=S((hyi,eCt)=>{"use strict";var Q0t=Xg(),Wsn=(t,e,r,n,o)=>{typeof r=="string"&&(o=n,n=r,r=void 0);try{return new Q0t(t instanceof Q0t?t.version:t,r).inc(e,n,o).version}catch{return null}};eCt.exports=Wsn});var oCt=S((gyi,nCt)=>{"use strict";var rCt=GU(),Gsn=(t,e)=>{let r=rCt(t,null,!0),n=rCt(e,null,!0),o=r.compare(n);if(o===0)return null;let i=o>0,a=i?r:n,s=i?n:r,u=!!a.prerelease.length;if(!!s.prerelease.length&&!u){if(!s.patch&&!s.minor)return"major";if(s.compareMain(a)===0)return s.minor&&!s.patch?"minor":"patch"}let c=u?"pre":"";return r.major!==n.major?c+"major":r.minor!==n.minor?c+"minor":r.patch!==n.patch?c+"patch":"prerelease"};nCt.exports=Gsn});var aCt=S((yyi,iCt)=>{"use strict";var Zsn=Xg(),Xsn=(t,e)=>new Zsn(t,e).major;iCt.exports=Xsn});var uCt=S((byi,sCt)=>{"use strict";var Ysn=Xg(),Qsn=(t,e)=>new Ysn(t,e).minor;sCt.exports=Qsn});var cCt=S((_yi,lCt)=>{"use strict";var eun=Xg(),tun=(t,e)=>new eun(t,e).patch;lCt.exports=tun});var fCt=S((vyi,dCt)=>{"use strict";var run=GU(),nun=(t,e)=>{let r=run(t,e);return r&&r.prerelease.length?r.prerelease:null};dCt.exports=nun});var Dw=S((wyi,mCt)=>{"use strict";var pCt=Xg(),oun=(t,e,r)=>new pCt(t,r).compare(new pCt(e,r));mCt.exports=oun});var gCt=S((Syi,hCt)=>{"use strict";var iun=Dw(),aun=(t,e,r)=>iun(e,t,r);hCt.exports=aun});var bCt=S((Cyi,yCt)=>{"use strict";var sun=Dw(),uun=(t,e)=>sun(t,e,!0);yCt.exports=uun});var gpe=S((xyi,vCt)=>{"use strict";var _Ct=Xg(),lun=(t,e,r)=>{let n=new _Ct(t,r),o=new _Ct(e,r);return n.compare(o)||n.compareBuild(o)};vCt.exports=lun});var SCt=S((Oyi,wCt)=>{"use strict";var cun=gpe(),dun=(t,e)=>t.sort((r,n)=>cun(r,n,e));wCt.exports=dun});var xCt=S((Tyi,CCt)=>{"use strict";var fun=gpe(),pun=(t,e)=>t.sort((r,n)=>fun(n,r,e));CCt.exports=pun});var AY=S((Eyi,OCt)=>{"use strict";var mun=Dw(),hun=(t,e,r)=>mun(t,e,r)>0;OCt.exports=hun});var ype=S((Pyi,TCt)=>{"use strict";var gun=Dw(),yun=(t,e,r)=>gun(t,e,r)<0;TCt.exports=yun});var zke=S((Myi,ECt)=>{"use strict";var bun=Dw(),_un=(t,e,r)=>bun(t,e,r)===0;ECt.exports=_un});var Hke=S((Ryi,PCt)=>{"use strict";var vun=Dw(),wun=(t,e,r)=>vun(t,e,r)!==0;PCt.exports=wun});var bpe=S((Ayi,MCt)=>{"use strict";var Sun=Dw(),Cun=(t,e,r)=>Sun(t,e,r)>=0;MCt.exports=Cun});var _pe=S((Iyi,RCt)=>{"use strict";var xun=Dw(),Oun=(t,e,r)=>xun(t,e,r)<=0;RCt.exports=Oun});var Vke=S((Nyi,ACt)=>{"use strict";var Tun=zke(),Eun=Hke(),Pun=AY(),Mun=bpe(),Run=ype(),Aun=_pe(),Iun=(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 Tun(t,r,n);case"!=":return Eun(t,r,n);case">":return Pun(t,r,n);case">=":return Mun(t,r,n);case"<":return Run(t,r,n);case"<=":return Aun(t,r,n);default:throw new TypeError(`Invalid operator: ${e}`)}};ACt.exports=Iun});var NCt=S((jyi,ICt)=>{"use strict";var Nun=Xg(),jun=GU(),{safeRe:vpe,t:wpe}=t6(),Dun=(t,e)=>{if(t instanceof Nun)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?vpe[wpe.COERCEFULL]:vpe[wpe.COERCE]);else{let u=e.includePrerelease?vpe[wpe.COERCERTLFULL]:vpe[wpe.COERCERTL],l;for(;(l=u.exec(t))&&(!r||r.index+r[0].length!==t.length);)(!r||l.index+l[0].length!==r.index+r[0].length)&&(r=l),u.lastIndex=l.index+l[1].length+l[2].length;u.lastIndex=-1}if(r===null)return null;let n=r[2],o=r[3]||"0",i=r[4]||"0",a=e.includePrerelease&&r[5]?`-${r[5]}`:"",s=e.includePrerelease&&r[6]?`+${r[6]}`:"";return jun(`${n}.${o}.${i}${a}${s}`,e)};ICt.exports=Dun});var DCt=S((Dyi,jCt)=>{"use strict";var Jke=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 o=this.map.keys().next().value;this.delete(o)}this.map.set(e,r)}return this}};jCt.exports=Jke});var $w=S(($yi,kCt)=>{"use strict";var $un=/\s+/g,Kke=class t{constructor(e,r){if(r=Fun(r),e instanceof t)return e.loose===!!r.loose&&e.includePrerelease===!!r.includePrerelease?e:new t(e.raw,r);if(e instanceof Wke)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($un," "),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(o=>!LCt(o[0])),this.set.length===0)this.set=[n];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&Jun(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e0&&(this.formatted+="||");let r=this.set[e];for(let n=0;n0&&(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&&Hun)|(this.options.loose&&Vun))+":"+e,o=$Ct.get(n);if(o)return o;let i=this.options.loose,a=i?Gy[Yg.HYPHENRANGELOOSE]:Gy[Yg.HYPHENRANGE];e=e.replace(a,rln(this.options.includePrerelease)),Qu("hyphen replace",e),e=e.replace(Gy[Yg.COMPARATORTRIM],qun),Qu("comparator trim",e),e=e.replace(Gy[Yg.TILDETRIM],Uun),Qu("tilde trim",e),e=e.replace(Gy[Yg.CARETTRIM],zun),Qu("caret trim",e);let s=e.split(" ").map(d=>Kun(d,this.options)).join(" ").split(/\s+/).map(d=>tln(d,this.options));i&&(s=s.filter(d=>(Qu("loose invalid filter",d,this.options),!!d.match(Gy[Yg.COMPARATORLOOSE])))),Qu("range list",s);let u=new Map,l=s.map(d=>new Wke(d,this.options));for(let d of l){if(LCt(d))return[d];u.set(d.value,d)}u.size>1&&u.has("")&&u.delete("");let c=[...u.values()];return $Ct.set(n,c),c}intersects(e,r){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(n=>FCt(n,r)&&e.set.some(o=>FCt(o,r)&&n.every(i=>o.every(a=>i.intersects(a,r)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new kun(e,this.options)}catch{return!1}for(let r=0;rt.value==="<0.0.0-0",Jun=t=>t.value==="",FCt=(t,e)=>{let r=!0,n=t.slice(),o=n.pop();for(;r&&n.length;)r=n.every(i=>o.intersects(i,e)),o=n.pop();return r},Kun=(t,e)=>(t=t.replace(Gy[Yg.BUILD],""),Qu("comp",t,e),t=Zun(t,e),Qu("caret",t),t=Wun(t,e),Qu("tildes",t),t=Yun(t,e),Qu("xrange",t),t=eln(t,e),Qu("stars",t),t),Zy=t=>!t||t.toLowerCase()==="x"||t==="*",Wun=(t,e)=>t.trim().split(/\s+/).map(r=>Gun(r,e)).join(" "),Gun=(t,e)=>{let r=e.loose?Gy[Yg.TILDELOOSE]:Gy[Yg.TILDE];return t.replace(r,(n,o,i,a,s)=>{Qu("tilde",t,n,o,i,a,s);let u;return Zy(o)?u="":Zy(i)?u=`>=${o}.0.0 <${+o+1}.0.0-0`:Zy(a)?u=`>=${o}.${i}.0 <${o}.${+i+1}.0-0`:s?(Qu("replaceTilde pr",s),u=`>=${o}.${i}.${a}-${s} <${o}.${+i+1}.0-0`):u=`>=${o}.${i}.${a} <${o}.${+i+1}.0-0`,Qu("tilde return",u),u})},Zun=(t,e)=>t.trim().split(/\s+/).map(r=>Xun(r,e)).join(" "),Xun=(t,e)=>{Qu("caret",t,e);let r=e.loose?Gy[Yg.CARETLOOSE]:Gy[Yg.CARET],n=e.includePrerelease?"-0":"";return t.replace(r,(o,i,a,s,u)=>{Qu("caret",t,o,i,a,s,u);let l;return Zy(i)?l="":Zy(a)?l=`>=${i}.0.0${n} <${+i+1}.0.0-0`:Zy(s)?i==="0"?l=`>=${i}.${a}.0${n} <${i}.${+a+1}.0-0`:l=`>=${i}.${a}.0${n} <${+i+1}.0.0-0`:u?(Qu("replaceCaret pr",u),i==="0"?a==="0"?l=`>=${i}.${a}.${s}-${u} <${i}.${a}.${+s+1}-0`:l=`>=${i}.${a}.${s}-${u} <${i}.${+a+1}.0-0`:l=`>=${i}.${a}.${s}-${u} <${+i+1}.0.0-0`):(Qu("no pr"),i==="0"?a==="0"?l=`>=${i}.${a}.${s}${n} <${i}.${a}.${+s+1}-0`:l=`>=${i}.${a}.${s}${n} <${i}.${+a+1}.0-0`:l=`>=${i}.${a}.${s} <${+i+1}.0.0-0`),Qu("caret return",l),l})},Yun=(t,e)=>(Qu("replaceXRanges",t,e),t.split(/\s+/).map(r=>Qun(r,e)).join(" ")),Qun=(t,e)=>{t=t.trim();let r=e.loose?Gy[Yg.XRANGELOOSE]:Gy[Yg.XRANGE];return t.replace(r,(n,o,i,a,s,u)=>{Qu("xRange",t,n,o,i,a,s,u);let l=Zy(i),c=l||Zy(a),d=c||Zy(s),f=d;return o==="="&&f&&(o=""),u=e.includePrerelease?"-0":"",l?o===">"||o==="<"?n="<0.0.0-0":n="*":o&&f?(c&&(a=0),s=0,o===">"?(o=">=",c?(i=+i+1,a=0,s=0):(a=+a+1,s=0)):o==="<="&&(o="<",c?i=+i+1:a=+a+1),o==="<"&&(u="-0"),n=`${o+i}.${a}.${s}${u}`):c?n=`>=${i}.0.0${u} <${+i+1}.0.0-0`:d&&(n=`>=${i}.${a}.0${u} <${i}.${+a+1}.0-0`),Qu("xRange return",n),n})},eln=(t,e)=>(Qu("replaceStars",t,e),t.trim().replace(Gy[Yg.STAR],"")),tln=(t,e)=>(Qu("replaceGTE0",t,e),t.trim().replace(Gy[e.includePrerelease?Yg.GTE0PRE:Yg.GTE0],"")),rln=t=>(e,r,n,o,i,a,s,u,l,c,d,f)=>(Zy(n)?r="":Zy(o)?r=`>=${n}.0.0${t?"-0":""}`:Zy(i)?r=`>=${n}.${o}.0${t?"-0":""}`:a?r=`>=${r}`:r=`>=${r}${t?"-0":""}`,Zy(l)?u="":Zy(c)?u=`<${+l+1}.0.0-0`:Zy(d)?u=`<${l}.${+c+1}.0-0`:f?u=`<=${l}.${c}.${d}-${f}`:t?u=`<${l}.${c}.${+d+1}-0`:u=`<=${u}`,`${r} ${u}`.trim()),nln=(t,e,r)=>{for(let n=0;n0){let o=t[n].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}});var IY=S((Lyi,VCt)=>{"use strict";var NY=Symbol("SemVer ANY"),Xke=class t{static get ANY(){return NY}constructor(e,r){if(r=qCt(r),e instanceof t){if(e.loose===!!r.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Zke("comparator",e,r),this.options=r,this.loose=!!r.loose,this.parse(e),this.semver===NY?this.value="":this.value=this.operator+this.semver.version,Zke("comp",this)}parse(e){let r=this.options.loose?BCt[UCt.COMPARATORLOOSE]:BCt[UCt.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 zCt(n[2],this.options.loose):this.semver=NY}toString(){return this.value}test(e){if(Zke("Comparator.test",e,this.options.loose),this.semver===NY||e===NY)return!0;if(typeof e=="string")try{e=new zCt(e,this.options)}catch{return!1}return Gke(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 HCt(e.value,r).test(this.value):e.operator===""?e.value===""?!0:new HCt(this.value,r).test(e.semver):(r=qCt(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("=")||Gke(this.semver,"<",e.semver,r)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Gke(this.semver,">",e.semver,r)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};VCt.exports=Xke;var qCt=dpe(),{safeRe:BCt,t:UCt}=t6(),Gke=Vke(),Zke=RY(),zCt=Xg(),HCt=$w()});var jY=S((Fyi,JCt)=>{"use strict";var oln=$w(),iln=(t,e,r)=>{try{e=new oln(e,r)}catch{return!1}return e.test(t)};JCt.exports=iln});var WCt=S((kyi,KCt)=>{"use strict";var aln=$w(),sln=(t,e)=>new aln(t,e).set.map(r=>r.map(n=>n.value).join(" ").trim().split(" "));KCt.exports=sln});var ZCt=S((qyi,GCt)=>{"use strict";var uln=Xg(),lln=$w(),cln=(t,e,r)=>{let n=null,o=null,i=null;try{i=new lln(e,r)}catch{return null}return t.forEach(a=>{i.test(a)&&(!n||o.compare(a)===-1)&&(n=a,o=new uln(n,r))}),n};GCt.exports=cln});var YCt=S((Byi,XCt)=>{"use strict";var dln=Xg(),fln=$w(),pln=(t,e,r)=>{let n=null,o=null,i=null;try{i=new fln(e,r)}catch{return null}return t.forEach(a=>{i.test(a)&&(!n||o.compare(a)===1)&&(n=a,o=new dln(n,r))}),n};XCt.exports=pln});var txt=S((Uyi,ext)=>{"use strict";var Yke=Xg(),mln=$w(),QCt=AY(),hln=(t,e)=>{t=new mln(t,e);let r=new Yke("0.0.0");if(t.test(r)||(r=new Yke("0.0.0-0"),t.test(r)))return r;r=null;for(let n=0;n{let s=new Yke(a.semver.version);switch(a.operator){case">":s.prerelease.length===0?s.patch++:s.prerelease.push(0),s.raw=s.format();case"":case">=":(!i||QCt(s,i))&&(i=s);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${a.operator}`)}}),i&&(!r||QCt(r,i))&&(r=i)}return r&&t.test(r)?r:null};ext.exports=hln});var nxt=S((zyi,rxt)=>{"use strict";var gln=$w(),yln=(t,e)=>{try{return new gln(t,e).range||"*"}catch{return null}};rxt.exports=yln});var Spe=S((Hyi,sxt)=>{"use strict";var bln=Xg(),axt=IY(),{ANY:_ln}=axt,vln=$w(),wln=jY(),oxt=AY(),ixt=ype(),Sln=_pe(),Cln=bpe(),xln=(t,e,r,n)=>{t=new bln(t,n),e=new vln(e,n);let o,i,a,s,u;switch(r){case">":o=oxt,i=Sln,a=ixt,s=">",u=">=";break;case"<":o=ixt,i=Cln,a=oxt,s="<",u="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(wln(t,e,n))return!1;for(let l=0;l{p.semver===_ln&&(p=new axt(">=0.0.0")),d=d||p,f=f||p,o(p.semver,d.semver,n)?d=p:a(p.semver,f.semver,n)&&(f=p)}),d.operator===s||d.operator===u||(!f.operator||f.operator===s)&&i(t,f.semver))return!1;if(f.operator===u&&a(t,f.semver))return!1}return!0};sxt.exports=xln});var lxt=S((Vyi,uxt)=>{"use strict";var Oln=Spe(),Tln=(t,e,r)=>Oln(t,e,">",r);uxt.exports=Tln});var dxt=S((Jyi,cxt)=>{"use strict";var Eln=Spe(),Pln=(t,e,r)=>Eln(t,e,"<",r);cxt.exports=Pln});var mxt=S((Kyi,pxt)=>{"use strict";var fxt=$w(),Mln=(t,e,r)=>(t=new fxt(t,r),e=new fxt(e,r),t.intersects(e,r));pxt.exports=Mln});var gxt=S((Wyi,hxt)=>{"use strict";var Rln=jY(),Aln=Dw();hxt.exports=(t,e,r)=>{let n=[],o=null,i=null,a=t.sort((c,d)=>Aln(c,d,r));for(let c of a)Rln(c,e,r)?(i=c,o||(o=c)):(i&&n.push([o,i]),i=null,o=null);o&&n.push([o,null]);let s=[];for(let[c,d]of n)c===d?s.push(c):!d&&c===a[0]?s.push("*"):d?c===a[0]?s.push(`<=${d}`):s.push(`${c} - ${d}`):s.push(`>=${c}`);let u=s.join(" || "),l=typeof e.raw=="string"?e.raw:String(e);return u.length{"use strict";var yxt=$w(),eqe=IY(),{ANY:Qke}=eqe,DY=jY(),tqe=Dw(),Iln=(t,e,r={})=>{if(t===e)return!0;t=new yxt(t,r),e=new yxt(e,r);let n=!1;e:for(let o of t.set){for(let i of e.set){let a=jln(o,i,r);if(n=n||a!==null,a)continue e}if(n)return!1}return!0},Nln=[new eqe(">=0.0.0-0")],bxt=[new eqe(">=0.0.0")],jln=(t,e,r)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Qke){if(e.length===1&&e[0].semver===Qke)return!0;r.includePrerelease?t=Nln:t=bxt}if(e.length===1&&e[0].semver===Qke){if(r.includePrerelease)return!0;e=bxt}let n=new Set,o,i;for(let p of t)p.operator===">"||p.operator===">="?o=_xt(o,p,r):p.operator==="<"||p.operator==="<="?i=vxt(i,p,r):n.add(p.semver);if(n.size>1)return null;let a;if(o&&i){if(a=tqe(o.semver,i.semver,r),a>0)return null;if(a===0&&(o.operator!==">="||i.operator!=="<="))return null}for(let p of n){if(o&&!DY(p,String(o),r)||i&&!DY(p,String(i),r))return null;for(let m of e)if(!DY(p,String(m),r))return!1;return!0}let s,u,l,c,d=i&&!r.includePrerelease&&i.semver.prerelease.length?i.semver:!1,f=o&&!r.includePrerelease&&o.semver.prerelease.length?o.semver:!1;d&&d.prerelease.length===1&&i.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let p of e){if(c=c||p.operator===">"||p.operator===">=",l=l||p.operator==="<"||p.operator==="<=",o){if(f&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===f.major&&p.semver.minor===f.minor&&p.semver.patch===f.patch&&(f=!1),p.operator===">"||p.operator===">="){if(s=_xt(o,p,r),s===p&&s!==o)return!1}else if(o.operator===">="&&!DY(o.semver,String(p),r))return!1}if(i){if(d&&p.semver.prerelease&&p.semver.prerelease.length&&p.semver.major===d.major&&p.semver.minor===d.minor&&p.semver.patch===d.patch&&(d=!1),p.operator==="<"||p.operator==="<="){if(u=vxt(i,p,r),u===p&&u!==i)return!1}else if(i.operator==="<="&&!DY(i.semver,String(p),r))return!1}if(!p.operator&&(i||o)&&a!==0)return!1}return!(o&&l&&!i&&a!==0||i&&c&&!o&&a!==0||f||d)},_xt=(t,e,r)=>{if(!t)return e;let n=tqe(t.semver,e.semver,r);return n>0?t:n<0||e.operator===">"&&t.operator===">="?e:t},vxt=(t,e,r)=>{if(!t)return e;let n=tqe(t.semver,e.semver,r);return n<0?t:n>0||e.operator==="<"&&t.operator==="<="?e:t};wxt.exports=Iln});var Txt=S((Zyi,Oxt)=>{"use strict";var rqe=t6(),Cxt=MY(),Dln=Xg(),xxt=qke(),$ln=GU(),Lln=Z0t(),Fln=Y0t(),kln=tCt(),qln=oCt(),Bln=aCt(),Uln=uCt(),zln=cCt(),Hln=fCt(),Vln=Dw(),Jln=gCt(),Kln=bCt(),Wln=gpe(),Gln=SCt(),Zln=xCt(),Xln=AY(),Yln=ype(),Qln=zke(),ecn=Hke(),tcn=bpe(),rcn=_pe(),ncn=Vke(),ocn=NCt(),icn=IY(),acn=$w(),scn=jY(),ucn=WCt(),lcn=ZCt(),ccn=YCt(),dcn=txt(),fcn=nxt(),pcn=Spe(),mcn=lxt(),hcn=dxt(),gcn=mxt(),ycn=gxt(),bcn=Sxt();Oxt.exports={parse:$ln,valid:Lln,clean:Fln,inc:kln,diff:qln,major:Bln,minor:Uln,patch:zln,prerelease:Hln,compare:Vln,rcompare:Jln,compareLoose:Kln,compareBuild:Wln,sort:Gln,rsort:Zln,gt:Xln,lt:Yln,eq:Qln,neq:ecn,gte:tcn,lte:rcn,cmp:ncn,coerce:ocn,Comparator:icn,Range:acn,satisfies:scn,toComparators:ucn,maxSatisfying:lcn,minSatisfying:ccn,minVersion:dcn,validRange:fcn,outside:pcn,gtr:mcn,ltr:hcn,intersects:gcn,simplifyRange:ycn,subset:bcn,SemVer:Dln,re:rqe.re,src:rqe.src,tokens:rqe.t,SEMVER_SPEC_VERSION:Cxt.SEMVER_SPEC_VERSION,RELEASE_TYPES:Cxt.RELEASE_TYPES,compareIdentifiers:xxt.compareIdentifiers,rcompareIdentifiers:xxt.rcompareIdentifiers}});function iN(t){if(!t||t.split("/").length>2||t.startsWith("/")||t.endsWith("/")||t.split(":").length>2)throw new Error(`Invalid identifier format: ${t}`);let[e,r]=t.split(":"),n=r||"latest";if(e.includes("/")){let[o,i]=e.split("/",2);if(!o||!i)throw new Error(`Invalid identifier format: ${t}`);return[o,i,n]}else{if(!e)throw new Error(`Invalid identifier format: ${t}`);return["-",e,n]}}var _cn,Ext=v(()=>{_cn=L(Txt(),1)});async function $r(t,e,r){let n;if(t.ok){r&&(n=await t.text());return}if(t.status===403)try{(await t.json())?.error==="org_scoped_key_requires_workspace"&&(n="This API key is org-scoped and requires workspace specification. Please provide 'workspaceId' parameter, or set LANGSMITH_WORKSPACE_ID environment variable.")}catch{let s=new Error(`${t.status} ${t.statusText}`);throw s.status=t?.status,s}if(n===void 0)try{n=await t.text()}catch{n=""}let o=`Failed to ${e}. Received status [${t.status}]: ${t.statusText}. Message: ${n}`;if(t.status===409)throw new nqe(o);let i=new Error(o);throw i.status=t.status,i}function Mxt(t){return typeof t=="object"&&t!==null&&t.code===Pxt}var nqe,Pxt,Cpe,oqe=v(()=>{nqe=class extends Error{constructor(e){super(e),Object.defineProperty(this,"status",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.name="LangSmithConflictError",this.status=409}};Pxt="ERR_CONFLICTING_ENDPOINTS",Cpe=class extends Error{constructor(){super("You cannot provide both LANGSMITH_ENDPOINT / LANGCHAIN_ENDPOINT and LANGSMITH_RUNS_ENDPOINTS."),Object.defineProperty(this,"code",{enumerable:!0,configurable:!0,writable:!0,value:Pxt}),this.name="ConflictingEndpointsError"}}});function Scn(){return{depthLimit:Number.MAX_SAFE_INTEGER,edgesLimit:Number.MAX_SAFE_INTEGER}}function xpe(t){return wcn.encode(t)}function Axt(t){if(t&&typeof t=="object"&&t!==null){if(t instanceof Map)return Object.fromEntries(t);if(t instanceof Set)return Array.from(t);if(t instanceof Date)return t.toISOString();if(t instanceof RegExp)return t.toString();if(t instanceof Error)return{name:t.name,message:t.message}}else if(typeof t=="bigint")return t.toString();return t}function Ccn(t){return function(e,r){if(t){let n=t.call(this,e,r);if(n!==void 0)return n}return Axt(r)}}function Xb(t,e,r,n,o){try{let i=JSON.stringify(t,Ccn(r),n);return xpe(i)}catch(i){if(!i.message?.includes("Converting circular structure to JSON"))return console.warn(`[WARNING]: LangSmith received unserializable value.${e?` +Context: ${e}`:""}`),xpe("[Unserializable]");ld("SUPPRESS_CIRCULAR_JSON_WARNINGS")!=="true"&&console.warn(`[WARNING]: LangSmith received circular JSON. This will decrease tracer performance. ${e?` +Context: ${e}`:""}`),typeof o>"u"&&(o=Scn()),aqe(t,"",0,[],void 0,0,o);let a;try{r6.length===0?a=JSON.stringify(t,r,n):a=JSON.stringify(t,xcn(r),n)}catch{return xpe("[unable to serialize, circular reference is too complex to analyze]")}finally{for(;Ope.length!==0;){let s=Ope.pop();s.length===4?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}}return xpe(a)}}function iqe(t,e,r,n){var o=Object.getOwnPropertyDescriptor(n,r);o.get!==void 0?o.configurable?(Object.defineProperty(n,r,{value:t}),Ope.push([n,r,e,o])):r6.push([e,r,t]):(n[r]=t,Ope.push([n,r,e]))}function aqe(t,e,r,n,o,i,a){i+=1;var s;if(typeof t=="object"&&t!==null){for(s=0;sa.depthLimit){iqe(Rxt,t,e,o);return}if(typeof a.edgesLimit<"u"&&r+1>a.edgesLimit){iqe(Rxt,t,e,o);return}if(n.push(t),Array.isArray(t))for(s=0;s0)for(var n=0;n{oN();Rxt="[...]",vcn={result:"[Circular]"},Ope=[],r6=[],wcn=new TextEncoder});function Nxt(t,e){let r=Qfe(),n=e??bke(),o=t.extra??{},i=o.metadata;return t.extra={...o,runtime:{...r,...o?.runtime},metadata:{...n,...n.revision_id||"revision_id"in t&&t.revision_id?{revision_id:("revision_id"in t?t.revision_id:void 0)??n.revision_id}:{},...i}},t}async function Ecn(t){let e=[];for await(let r of t)e.push(r);return e}function Tpe(t){if(t!==void 0)return t.trim().replace(/^"(.*)"$/,"$1").replace(/^'(.*)'$/,"$1")}function jxt(t){return typeof t=="number"?Number(t.toFixed(4)):t}function $xt(t){return"dataset_id"in t||"dataset_name"in t}var Ocn,Tcn,Pcn,sqe,Mcn,Rcn,Acn,Dxt,KU,pke=v(()=>{ike();b0t();Tke();j0t();D0t();oN();Yfe();$0t();Lke();Ext();oqe();dke();Ixt();Ocn=t=>{let e=t?.toString()??ld("TRACING_SAMPLING_RATE");if(e===void 0)return;let r=parseFloat(e);if(r<0||r>1)throw new Error(`LANGSMITH_TRACING_SAMPLING_RATE must be between 0 and 1 if set. Got: ${r}`);return r},Tcn=t=>{let r=t.replace("http://","").replace("https://","").split("/")[0].split(":")[0];return r==="localhost"||r==="127.0.0.1"||r==="::1"};Pcn=async t=>{if(t?.status===429){let e=parseInt(t.headers.get("retry-after")??"10",10)*1e3;if(e>0)return await new Promise(r=>setTimeout(r,e)),!0}return!1};sqe=class{constructor(){Object.defineProperty(this,"items",{enumerable:!0,configurable:!0,writable:!0,value:[]}),Object.defineProperty(this,"sizeBytes",{enumerable:!0,configurable:!0,writable:!0,value:0})}peek(){return this.items[0]}push(e){let r,n=new Promise(i=>{r=i}),o=Xb(e.item,`Serializing run with id: ${e.item.id}`).length;return this.items.push({action:e.action,payload:e.item,otelContext:e.otelContext,apiKey:e.apiKey,apiUrl:e.apiUrl,itemPromiseResolve:r,itemPromise:n,size:o}),this.sizeBytes+=o,n}pop({upToSizeBytes:e,upToSize:r}){if(e<1)throw new Error("Number of bytes to pop off may not be less than 1.");let n=[],o=0;for(;o+(this.peek()?.size??0)0&&n.length0){let i=this.items.shift();n.push(i),o+=i.size,this.sizeBytes-=i.size}return[n.map(i=>({action:i.action,item:i.payload,otelContext:i.otelContext,apiKey:i.apiKey,apiUrl:i.apiUrl})),()=>n.forEach(i=>i.itemPromiseResolve())]}},Mcn=24*1024*1024,Rcn=1e4,Acn=100,Dxt="https://api.smith.langchain.com",KU=class t{get _fetch(){return this.fetchImplementation||p0t(this.debug)}constructor(e={}){Object.defineProperty(this,"apiKey",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"apiUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"webUrl",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"workspaceId",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"caller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"batchIngestCaller",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"timeout_ms",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_tenantId",{enumerable:!0,configurable:!0,writable:!0,value:null}),Object.defineProperty(this,"hideInputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"hideOutputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracingSampleRate",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"filteredPostUuids",{enumerable:!0,configurable:!0,writable:!0,value:new Set}),Object.defineProperty(this,"autoBatchTracing",{enumerable:!0,configurable:!0,writable:!0,value:!0}),Object.defineProperty(this,"autoBatchQueue",{enumerable:!0,configurable:!0,writable:!0,value:new sqe}),Object.defineProperty(this,"autoBatchTimeout",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"autoBatchAggregationDelayMs",{enumerable:!0,configurable:!0,writable:!0,value:250}),Object.defineProperty(this,"batchSizeBytesLimit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"batchSizeLimit",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fetchOptions",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"settings",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"blockOnRootRunFinalization",{enumerable:!0,configurable:!0,writable:!0,value:wv("LANGSMITH_TRACING_BACKGROUND")==="false"}),Object.defineProperty(this,"traceBatchConcurrency",{enumerable:!0,configurable:!0,writable:!0,value:5}),Object.defineProperty(this,"_serverInfo",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_getServerInfoPromise",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"manualFlushMode",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"langSmithToOTELTranslator",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"fetchImplementation",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"cachedLSEnvVarsForMetadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"multipartStreamingDisabled",{enumerable:!0,configurable:!0,writable:!0,value:!1}),Object.defineProperty(this,"debug",{enumerable:!0,configurable:!0,writable:!0,value:wv("LANGSMITH_DEBUG")==="true"});let r=t.getDefaultClientConfig();if(this.tracingSampleRate=Ocn(e.tracingSamplingRate),this.apiUrl=Tpe(e.apiUrl??r.apiUrl)??"",this.apiUrl.endsWith("/")&&(this.apiUrl=this.apiUrl.slice(0,-1)),this.apiKey=Tpe(e.apiKey??r.apiKey),this.webUrl=Tpe(e.webUrl??r.webUrl),this.webUrl?.endsWith("/")&&(this.webUrl=this.webUrl.slice(0,-1)),this.workspaceId=Tpe(e.workspaceId??ld("WORKSPACE_ID")),this.timeout_ms=e.timeout_ms??9e4,this.caller=new EY({...e.callerOptions??{},maxRetries:4,debug:e.debug??this.debug}),this.traceBatchConcurrency=e.traceBatchConcurrency??this.traceBatchConcurrency,this.traceBatchConcurrency<1)throw new Error("Trace batch concurrency must be positive.");this.debug=e.debug??this.debug,this.fetchImplementation=e.fetchImplementation,this.batchIngestCaller=new EY({maxRetries:2,maxConcurrency:this.traceBatchConcurrency,...e.callerOptions??{},onFailedResponseHook:Pcn,debug:e.debug??this.debug}),this.hideInputs=e.hideInputs??e.anonymizer??r.hideInputs,this.hideOutputs=e.hideOutputs??e.anonymizer??r.hideOutputs,this.autoBatchTracing=e.autoBatchTracing??this.autoBatchTracing,this.blockOnRootRunFinalization=e.blockOnRootRunFinalization??this.blockOnRootRunFinalization,this.batchSizeBytesLimit=e.batchSizeBytesLimit,this.batchSizeLimit=e.batchSizeLimit,this.fetchOptions=e.fetchOptions||{},this.manualFlushMode=e.manualFlushMode??this.manualFlushMode,epe()&&(this.langSmithToOTELTranslator=new rpe),this.cachedLSEnvVarsForMetadata=bke()}static getDefaultClientConfig(){let e=ld("API_KEY"),r=ld("ENDPOINT")??Dxt,n=ld("HIDE_INPUTS")==="true",o=ld("HIDE_OUTPUTS")==="true";return{apiUrl:r,apiKey:e,webUrl:void 0,hideInputs:n,hideOutputs:o}}getHostUrl(){return this.webUrl?this.webUrl:Tcn(this.apiUrl)?(this.webUrl="http://localhost:3000",this.webUrl):this.apiUrl.endsWith("/api/v1")?(this.webUrl=this.apiUrl.replace("/api/v1",""),this.webUrl):this.apiUrl.includes("/api")&&!this.apiUrl.split(".",1)[0].endsWith("api")?(this.webUrl=this.apiUrl.replace("/api",""),this.webUrl):this.apiUrl.split(".",1)[0].includes("dev")?(this.webUrl="https://dev.smith.langchain.com",this.webUrl):this.apiUrl.split(".",1)[0].includes("eu")?(this.webUrl="https://eu.smith.langchain.com",this.webUrl):this.apiUrl.split(".",1)[0].includes("beta")?(this.webUrl="https://beta.smith.langchain.com",this.webUrl):(this.webUrl="https://smith.langchain.com",this.webUrl)}get headers(){let e={"User-Agent":`langsmith-js/${Xfe}`};return this.apiKey&&(e["x-api-key"]=`${this.apiKey}`),this.workspaceId&&(e["x-tenant-id"]=this.workspaceId),e}_getPlatformEndpointPath(e){return this.apiUrl.slice(-3)!=="/v1"&&this.apiUrl.slice(-4)!=="/v1/"?`/v1/platform/${e}`:`/platform/${e}`}async processInputs(e){return this.hideInputs===!1?e:this.hideInputs===!0?{}:typeof this.hideInputs=="function"?this.hideInputs(e):e}async processOutputs(e){return this.hideOutputs===!1?e:this.hideOutputs===!0?{}:typeof this.hideOutputs=="function"?this.hideOutputs(e):e}async prepareRunCreateOrUpdateInputs(e){let r={...e};return r.inputs!==void 0&&(r.inputs=await this.processInputs(r.inputs)),r.outputs!==void 0&&(r.outputs=await this.processOutputs(r.outputs)),r}async _getResponse(e,r){let n=r?.toString()??"",o=`${this.apiUrl}${e}?${n}`;return await this.caller.call(async()=>{let a=await this._fetch(o,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(a,`fetch ${e}`),a})}async _get(e,r){return(await this._getResponse(e,r)).json()}async*_getPaginated(e,r=new URLSearchParams,n){let o=Number(r.get("offset"))||0,i=Number(r.get("limit"))||100;for(;;){r.set("offset",String(o)),r.set("limit",String(i));let a=`${this.apiUrl}${e}?${r}`,s=await this.caller.call(async()=>{let l=await this._fetch(a,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(l,`fetch ${e}`),l}),u=n?n(await s.json()):await s.json();if(u.length===0||(yield u,u.length{let c=await this._fetch(`${this.apiUrl}${e}`,{method:n,headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:a});return await $r(c,`fetch ${e}`),c})).json();if(!u||!u[o])break;yield u[o];let l=u.cursors;if(!l||!l.next)break;i.cursor=l.next}}_shouldSample(){return this.tracingSampleRate===void 0?!0:Math.random()0;){let[o,i]=this.autoBatchQueue.pop({upToSizeBytes:e,upToSize:r});if(!o.length){i();break}let a=o.reduce((l,c)=>{let d=c.apiUrl??this.apiUrl,f=c.apiKey??this.apiKey,m=c.apiKey===this.apiKey&&c.apiUrl===this.apiUrl?"default":`${d}|${f}`;return l[m]||(l[m]=[]),l[m].push(c),l},{}),s=[];for(let[l,c]of Object.entries(a)){let d=this._processBatch(c,{apiUrl:l==="default"?void 0:l.split("|")[0],apiKey:l==="default"?void 0:l.split("|")[1]});s.push(d)}let u=Promise.all(s).finally(i);n.push(u)}return Promise.all(n)}async _processBatch(e,r){if(e.length)try{if(this.langSmithToOTELTranslator!==void 0)this._sendBatchToOTELTranslator(e);else{let n={runCreates:e.filter(i=>i.action==="create").map(i=>i.item),runUpdates:e.filter(i=>i.action==="update").map(i=>i.item)},o=await this._ensureServerInfo();if(o?.batch_ingest_config?.use_multipart_endpoint){let i=o?.instance_flags?.gzip_body_enabled;await this.multipartIngestRuns(n,{...r,useGzip:i})}else await this.batchIngestRuns(n,r)}}catch(n){console.error("Error exporting batch:",n)}}_sendBatchToOTELTranslator(e){if(this.langSmithToOTELTranslator!==void 0){let r=new Map,n=[];for(let o of e)o.item.id&&o.otelContext&&(r.set(o.item.id,o.otelContext),o.action==="create"?n.push({operation:"post",id:o.item.id,trace_id:o.item.trace_id??o.item.id,run:o.item}):n.push({operation:"patch",id:o.item.id,trace_id:o.item.trace_id??o.item.id,run:o.item}));this.langSmithToOTELTranslator.exportBatch(n,r)}}async processRunOperation(e){clearTimeout(this.autoBatchTimeout),this.autoBatchTimeout=void 0,e.item=Nxt(e.item,this.cachedLSEnvVarsForMetadata);let r=this.autoBatchQueue.push(e);if(this.manualFlushMode)return r;let n=await this._getBatchSizeLimitBytes(),o=await this._getBatchSizeLimit();return(this.autoBatchQueue.sizeBytes>n||this.autoBatchQueue.items.length>o)&&this.drainAutoBatchQueue({batchSizeLimitBytes:n,batchSizeLimit:o}),this.autoBatchQueue.items.length>0&&(this.autoBatchTimeout=setTimeout(()=>{this.autoBatchTimeout=void 0,this.drainAutoBatchQueue({batchSizeLimitBytes:n,batchSizeLimit:o})},this.autoBatchAggregationDelayMs)),r}async _getServerInfo(){let r=await(await this.caller.call(async()=>{let n=await this._fetch(`${this.apiUrl}/info`,{method:"GET",headers:{Accept:"application/json"},signal:AbortSignal.timeout(Rcn),...this.fetchOptions});return await $r(n,"get server info"),n})).json();return this.debug&&console.log(` +=== LangSmith Server Configuration === +`+JSON.stringify(r,null,2)+` +`),r}async _ensureServerInfo(){return this._getServerInfoPromise===void 0&&(this._getServerInfoPromise=(async()=>{if(this._serverInfo===void 0)try{this._serverInfo=await this._getServerInfo()}catch(e){console.warn(`[LANGSMITH]: Failed to fetch info on supported operations. Falling back to batch operations and default limits. Info: ${e.status??"Unspecified status code"} ${e.message}`)}return this._serverInfo??{}})()),this._getServerInfoPromise.then(e=>(this._serverInfo===void 0&&(this._getServerInfoPromise=void 0),e))}async _getSettings(){return this.settings||(this.settings=this._get("/settings")),await this.settings}async flush(){let e=await this._getBatchSizeLimitBytes(),r=await this._getBatchSizeLimit();await this.drainAutoBatchQueue({batchSizeLimitBytes:e,batchSizeLimit:r})}_cloneCurrentOTELContext(){let e=tpe(),r=g0t();if(this.langSmithToOTELTranslator!==void 0){let n=e.getActiveSpan();if(n)return e.setSpan(r.active(),n)}}async createRun(e,r){if(!this._filterForSampling([e]).length)return;let n={...this.headers,"Content-Type":"application/json"},o=e.project_name;delete e.project_name;let i=await this.prepareRunCreateOrUpdateInputs({session_name:o,...e,start_time:e.start_time??Date.now()});if(this.autoBatchTracing&&i.trace_id!==void 0&&i.dotted_order!==void 0){let u=this._cloneCurrentOTELContext();this.processRunOperation({action:"create",item:i,otelContext:u,apiKey:r?.apiKey,apiUrl:r?.apiUrl}).catch(console.error);return}let a=Nxt(i,this.cachedLSEnvVarsForMetadata);r?.apiKey!==void 0&&(n["x-api-key"]=r.apiKey),r?.workspaceId!==void 0&&(n["x-tenant-id"]=r.workspaceId);let s=Xb(a,`Creating run with id: ${a.id}`);await this.caller.call(async()=>{let u=await this._fetch(`${r?.apiUrl??this.apiUrl}/runs`,{method:"POST",headers:n,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:s});return await $r(u,"create run",!0),u})}async batchIngestRuns({runCreates:e,runUpdates:r},n){if(e===void 0&&r===void 0)return;let o=await Promise.all(e?.map(u=>this.prepareRunCreateOrUpdateInputs(u))??[]),i=await Promise.all(r?.map(u=>this.prepareRunCreateOrUpdateInputs(u))??[]);if(o.length>0&&i.length>0){let u=o.reduce((c,d)=>(d.id&&(c[d.id]=d),c),{}),l=[];for(let c of i)c.id!==void 0&&u[c.id]?u[c.id]={...u[c.id],...c}:l.push(c);o=Object.values(u),i=l}let a={post:o,patch:i};if(!a.post.length&&!a.patch.length)return;let s={post:[],patch:[]};for(let u of["post","patch"]){let l=u,c=a[l].reverse(),d=c.pop();for(;d!==void 0;)s[l].push(d),d=c.pop()}if(s.post.length>0||s.patch.length>0){let u=s.post.map(l=>l.id).concat(s.patch.map(l=>l.id)).join(",");await this._postBatchIngestRuns(Xb(s,`Ingesting runs with ids: ${u}`),n)}}async _postBatchIngestRuns(e,r){let n={...this.headers,"Content-Type":"application/json",Accept:"application/json"};r?.apiKey!==void 0&&(n["x-api-key"]=r.apiKey),await this.batchIngestCaller.call(async()=>{let o=await this._fetch(`${r?.apiUrl??this.apiUrl}/runs/batch`,{method:"POST",headers:n,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:e});return await $r(o,"batch create run",!0),o})}async multipartIngestRuns({runCreates:e,runUpdates:r},n){if(e===void 0&&r===void 0)return;let o={},i=[];for(let d of e??[]){let f=await this.prepareRunCreateOrUpdateInputs(d);f.id!==void 0&&f.attachments!==void 0&&(o[f.id]=f.attachments),delete f.attachments,i.push(f)}let a=[];for(let d of r??[])a.push(await this.prepareRunCreateOrUpdateInputs(d));if(i.find(d=>d.trace_id===void 0||d.dotted_order===void 0)!==void 0)throw new Error('Multipart ingest requires "trace_id" and "dotted_order" to be set when creating a run');if(a.find(d=>d.trace_id===void 0||d.dotted_order===void 0)!==void 0)throw new Error('Multipart ingest requires "trace_id" and "dotted_order" to be set when updating a run');if(i.length>0&&a.length>0){let d=i.reduce((p,m)=>(m.id&&(p[m.id]=m),p),{}),f=[];for(let p of a)p.id!==void 0&&d[p.id]?d[p.id]={...d[p.id],...p}:f.push(p);i=Object.values(d),a=f}if(i.length===0&&a.length===0)return;let l=[],c=[];for(let[d,f]of[["post",i],["patch",a]])for(let p of f){let{inputs:m,outputs:h,events:g,extra:y,error:b,serialized:_,attachments:w,...x}=p,O={inputs:m,outputs:h,events:g,extra:y,error:b,serialized:_},E=Xb(x,`Serializing for multipart ingestion of run with id: ${x.id}`);c.push({name:`${d}.${x.id}`,payload:new Blob([E],{type:`application/json; length=${E.length}`})});for(let[T,R]of Object.entries(O)){if(R===void 0)continue;let I=Xb(R,`Serializing ${T} for multipart ingestion of run with id: ${x.id}`);c.push({name:`${d}.${x.id}.${T}`,payload:new Blob([I],{type:`application/json; length=${I.length}`})})}if(x.id!==void 0){let T=o[x.id];if(T){delete o[x.id];for(let[R,I]of Object.entries(T)){let j,F;if(Array.isArray(I)?[j,F]=I:(j=I.mimeType,F=I.data),R.includes(".")){console.warn(`Skipping attachment '${R}' for run ${x.id}: Invalid attachment name. Attachment names must not contain periods ('.'). Please rename the attachment and try again.`);continue}c.push({name:`attachment.${x.id}.${R}`,payload:new Blob([F],{type:`${j}; length=${F.byteLength}`})})}}}l.push(`trace=${x.trace_id},id=${x.id}`)}await this._sendMultipartRequest(c,l.join("; "),n)}async _createNodeFetchBody(e,r){let n=[];for(let a of e)n.push(new Blob([`--${r}\r +`])),n.push(new Blob([`Content-Disposition: form-data; name="${a.name}"\r +`,`Content-Type: ${a.payload.type}\r +\r +`])),n.push(a.payload),n.push(new Blob([`\r +`]));return n.push(new Blob([`--${r}--\r +`])),await new Blob(n).arrayBuffer()}async _createMultipartStream(e,r){let n=new TextEncoder;return new ReadableStream({async start(i){let a=async s=>{typeof s=="string"?i.enqueue(n.encode(s)):i.enqueue(s)};for(let s of e){await a(`--${r}\r +`),await a(`Content-Disposition: form-data; name="${s.name}"\r +`),await a(`Content-Type: ${s.payload.type}\r +\r +`);let l=s.payload.stream().getReader();try{let c;for(;!(c=await l.read()).done;)i.enqueue(c.value)}finally{l.releaseLock()}await a(`\r +`)}await a(`--${r}--\r +`),i.close()}})}async _sendMultipartRequest(e,r,n){let o="----LangSmithFormBoundary"+Math.random().toString(36).slice(2),i=f0t(),a=()=>this._createNodeFetchBody(e,o),s=()=>this._createMultipartStream(e,o),u=async l=>this.batchIngestCaller.call(async()=>{let c=await l(),d={...this.headers,"Content-Type":`multipart/form-data; boundary=${o}`};n?.apiKey!==void 0&&(d["x-api-key"]=n.apiKey);let f=c;n?.useGzip&&typeof c=="object"&&"pipeThrough"in c&&(f=c.pipeThrough(new CompressionStream("gzip")),d["Content-Encoding"]="gzip");let p=await this._fetch(`${n?.apiUrl??this.apiUrl}/runs/multipart`,{method:"POST",headers:d,body:f,duplex:"half",signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(p,"Failed to send multipart request",!0),p});try{let l,c=!1;!i&&!this.multipartStreamingDisabled&&yke()!=="bun"?(c=!0,l=await u(s)):l=await u(a),(!this.multipartStreamingDisabled||c)&&l.status===422&&(n?.apiUrl??this.apiUrl)!==Dxt&&(console.warn(`Streaming multipart upload to ${n?.apiUrl??this.apiUrl}/runs/multipart failed. This usually means the host does not support chunked uploads. Retrying with a buffered upload for operation "${r}".`),this.multipartStreamingDisabled=!0,l=await u(a))}catch(l){console.warn(`${l.message.trim()} + +Context: ${r}`)}}async updateRun(e,r,n){Po(e),r.inputs&&(r.inputs=await this.processInputs(r.inputs)),r.outputs&&(r.outputs=await this.processOutputs(r.outputs));let o={...r,id:e};if(!this._filterForSampling([o],!0).length)return;if(this.autoBatchTracing&&o.trace_id!==void 0&&o.dotted_order!==void 0){let s=this._cloneCurrentOTELContext();if(r.end_time!==void 0&&o.parent_run_id===void 0&&this.blockOnRootRunFinalization&&!this.manualFlushMode){await this.processRunOperation({action:"update",item:o,otelContext:s,apiKey:n?.apiKey,apiUrl:n?.apiUrl}).catch(console.error);return}else this.processRunOperation({action:"update",item:o,otelContext:s,apiKey:n?.apiKey,apiUrl:n?.apiUrl}).catch(console.error);return}let i={...this.headers,"Content-Type":"application/json"};n?.apiKey!==void 0&&(i["x-api-key"]=n.apiKey),n?.workspaceId!==void 0&&(i["x-tenant-id"]=n.workspaceId);let a=Xb(r,`Serializing payload to update run with id: ${e}`);await this.caller.call(async()=>{let s=await this._fetch(`${n?.apiUrl??this.apiUrl}/runs/${e}`,{method:"PATCH",headers:i,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:a});return await $r(s,"update run",!0),s})}async readRun(e,{loadChildRuns:r}={loadChildRuns:!1}){Po(e);let n=await this._get(`/runs/${e}`);return r&&(n=await this._loadChildRuns(n)),n}async getRunUrl({runId:e,run:r,projectOpts:n}){if(r!==void 0){let o;r.session_id?o=r.session_id:n?.projectName?o=(await this.readProject({projectName:n?.projectName})).id:n?.projectId?o=n?.projectId:o=(await this.readProject({projectName:ld("PROJECT")||"default"})).id;let i=await this._getTenantId();return`${this.getHostUrl()}/o/${i}/projects/p/${o}/r/${r.id}?poll=true`}else if(e!==void 0){let o=await this.readRun(e);if(!o.app_path)throw new Error(`Run ${e} has no app_path`);return`${this.getHostUrl()}${o.app_path}`}else throw new Error("Must provide either runId or run")}async _loadChildRuns(e){let r=await Ecn(this.listRuns({isRoot:!1,projectId:e.session_id,traceId:e.trace_id})),n={},o={};r.sort((i,a)=>(i?.dotted_order??"").localeCompare(a?.dotted_order??""));for(let i of r){if(i.parent_run_id===null||i.parent_run_id===void 0)throw new Error(`Child run ${i.id} has no parent`);i.dotted_order?.startsWith(e.dotted_order??"")&&i.id!==e.id&&(i.parent_run_id in n||(n[i.parent_run_id]=[]),n[i.parent_run_id].push(i),o[i.id]=i)}e.child_runs=n[e.id]||[];for(let i in n)i!==e.id&&(o[i].child_runs=n[i]);return e}async*listRuns(e){let{projectId:r,projectName:n,parentRunId:o,traceId:i,referenceExampleId:a,startTime:s,executionOrder:u,isRoot:l,runType:c,error:d,id:f,query:p,filter:m,traceFilter:h,treeFilter:g,limit:y,select:b,order:_}=e,w=[];if(r&&(w=Array.isArray(r)?r:[r]),n){let T=Array.isArray(n)?n:[n],R=await Promise.all(T.map(I=>this.readProject({projectName:I}).then(j=>j.id)));w.push(...R)}let x=["app_path","completion_cost","completion_tokens","dotted_order","end_time","error","events","extra","feedback_stats","first_token_time","id","inputs","name","outputs","parent_run_id","parent_run_ids","prompt_cost","prompt_tokens","reference_example_id","run_type","session_id","start_time","status","tags","total_cost","total_tokens","trace_id"],O={session:w.length?w:null,run_type:c,reference_example:a,query:p,filter:m,trace_filter:h,tree_filter:g,execution_order:u,parent_run:o,start_time:s?s.toISOString():null,error:d,id:f,limit:y,trace:i,select:b||x,is_root:l,order:_};O.select.includes("child_run_ids")&&PY("Deprecated: 'child_run_ids' in the listRuns select parameter is deprecated and will be removed in a future version.");let E=0;for await(let T of this._getCursorPaginatedList("/runs/query",O))if(y){if(E>=y)break;if(T.length+E>y){yield*T.slice(0,y-E);break}E+=T.length,yield*T}else yield*T}async*listGroupRuns(e){let{projectId:r,projectName:n,groupBy:o,filter:i,startTime:a,endTime:s,limit:u,offset:l}=e,d={session_id:r||(await this.readProject({projectName:n})).id,group_by:o,filter:i,start_time:a?a.toISOString():null,end_time:s?s.toISOString():null,limit:Number(u)||100},f=Number(l)||0,p="/runs/group",m=`${this.apiUrl}${p}`;for(;;){let h={...d,offset:f},g=Object.fromEntries(Object.entries(h).filter(([O,E])=>E!==void 0)),y=JSON.stringify(g),_=await(await this.caller.call(async()=>{let O=await this._fetch(m,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:y});return await $r(O,`Failed to fetch ${p}`),O})).json(),{groups:w,total:x}=_;if(w.length===0)break;for(let O of w)yield O;if(f+=w.length,f>=x)break}}async getRunStats({id:e,trace:r,parentRun:n,runType:o,projectNames:i,projectIds:a,referenceExampleIds:s,startTime:u,endTime:l,error:c,query:d,filter:f,traceFilter:p,treeFilter:m,isRoot:h,dataSourceType:g}){let y=a||[];i&&(y=[...a||[],...await Promise.all(i.map(E=>this.readProject({projectName:E}).then(T=>T.id)))]);let _=Object.fromEntries(Object.entries({id:e,trace:r,parent_run:n,run_type:o,session:y,reference_example:s,start_time:u,end_time:l,error:c,query:d,filter:f,trace_filter:p,tree_filter:m,is_root:h,data_source_type:g}).filter(([E,T])=>T!==void 0)),w=JSON.stringify(_);return await(await this.caller.call(async()=>{let E=await this._fetch(`${this.apiUrl}/runs/stats`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:w});return await $r(E,"get run stats"),E})).json()}async shareRun(e,{shareId:r}={}){let n={run_id:e,share_token:r||nN()};Po(e);let o=JSON.stringify(n),a=await(await this.caller.call(async()=>{let s=await this._fetch(`${this.apiUrl}/runs/${e}/share`,{method:"PUT",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:o});return await $r(s,"share run"),s})).json();if(a===null||!("share_token"in a))throw new Error("Invalid response from server");return`${this.getHostUrl()}/public/${a.share_token}/r`}async unshareRun(e){Po(e),await this.caller.call(async()=>{let r=await this._fetch(`${this.apiUrl}/runs/${e}/share`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(r,"unshare run",!0),r})}async readRunSharedLink(e){Po(e);let n=await(await this.caller.call(async()=>{let o=await this._fetch(`${this.apiUrl}/runs/${e}/share`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(o,"read run shared link"),o})).json();if(!(n===null||!("share_token"in n)))return`${this.getHostUrl()}/public/${n.share_token}/r`}async listSharedRuns(e,{runIds:r}={}){let n=new URLSearchParams({share_token:e});if(r!==void 0)for(let a of r)n.append("id",a);return Po(e),await(await this.caller.call(async()=>{let a=await this._fetch(`${this.apiUrl}/public/${e}/runs${n}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(a,"list shared runs"),a})).json()}async readDatasetSharedSchema(e,r){if(!e&&!r)throw new Error("Either datasetId or datasetName must be given");e||(e=(await this.readDataset({datasetName:r})).id),Po(e);let o=await(await this.caller.call(async()=>{let i=await this._fetch(`${this.apiUrl}/datasets/${e}/share`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(i,"read dataset shared schema"),i})).json();return o.url=`${this.getHostUrl()}/public/${o.share_token}/d`,o}async shareDataset(e,r){if(!e&&!r)throw new Error("Either datasetId or datasetName must be given");e||(e=(await this.readDataset({datasetName:r})).id);let n={dataset_id:e};Po(e);let o=JSON.stringify(n),a=await(await this.caller.call(async()=>{let s=await this._fetch(`${this.apiUrl}/datasets/${e}/share`,{method:"PUT",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:o});return await $r(s,"share dataset"),s})).json();return a.url=`${this.getHostUrl()}/public/${a.share_token}/d`,a}async unshareDataset(e){Po(e),await this.caller.call(async()=>{let r=await this._fetch(`${this.apiUrl}/datasets/${e}/share`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(r,"unshare dataset",!0),r})}async readSharedDataset(e){return Po(e),await(await this.caller.call(async()=>{let o=await this._fetch(`${this.apiUrl}/public/${e}/datasets`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(o,"read shared dataset"),o})).json()}async listSharedExamples(e,r){let n={};r?.exampleIds&&(n.id=r.exampleIds);let o=new URLSearchParams;Object.entries(n).forEach(([s,u])=>{Array.isArray(u)?u.forEach(l=>o.append(s,l)):o.append(s,u)});let i=await this.caller.call(async()=>{let s=await this._fetch(`${this.apiUrl}/public/${e}/examples?${o.toString()}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(s,"list shared examples"),s}),a=await i.json();if(!i.ok)throw"detail"in a?new Error(`Failed to list shared examples. +Status: ${i.status} +Message: ${Array.isArray(a.detail)?a.detail.join(` +`):"Unspecified error"}`):new Error(`Failed to list shared examples: ${i.status} ${i.statusText}`);return a.map(s=>({...s,_hostUrl:this.getHostUrl()}))}async createProject({projectName:e,description:r=null,metadata:n=null,upsert:o=!1,projectExtra:i=null,referenceDatasetId:a=null}){let s=o?"?upsert=true":"",u=`${this.apiUrl}/sessions${s}`,l=i||{};n&&(l.metadata=n);let c={name:e,extra:l,description:r};a!==null&&(c.reference_dataset_id=a);let d=JSON.stringify(c);return await(await this.caller.call(async()=>{let m=await this._fetch(u,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:d});return await $r(m,"create project"),m})).json()}async updateProject(e,{name:r=null,description:n=null,metadata:o=null,projectExtra:i=null,endTime:a=null}){let s=`${this.apiUrl}/sessions/${e}`,u=i;o&&(u={...u||{},metadata:o});let l=JSON.stringify({name:r,extra:u,description:n,end_time:a?new Date(a).toISOString():null});return await(await this.caller.call(async()=>{let f=await this._fetch(s,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:l});return await $r(f,"update project"),f})).json()}async hasProject({projectId:e,projectName:r}){let n="/sessions",o=new URLSearchParams;if(e!==void 0&&r!==void 0)throw new Error("Must provide either projectName or projectId, not both");if(e!==void 0)Po(e),n+=`/${e}`;else if(r!==void 0)o.append("name",r);else throw new Error("Must provide projectName or projectId");let i=await this.caller.call(async()=>{let a=await this._fetch(`${this.apiUrl}${n}?${o}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(a,"has project"),a});try{let a=await i.json();return i.ok?Array.isArray(a)?a.length>0:!0:!1}catch{return!1}}async readProject({projectId:e,projectName:r,includeStats:n}){let o="/sessions",i=new URLSearchParams;if(e!==void 0&&r!==void 0)throw new Error("Must provide either projectName or projectId, not both");if(e!==void 0)Po(e),o+=`/${e}`;else if(r!==void 0)i.append("name",r);else throw new Error("Must provide projectName or projectId");n!==void 0&&i.append("include_stats",n.toString());let a=await this._get(o,i),s;if(Array.isArray(a)){if(a.length===0)throw new Error(`Project[id=${e}, name=${r}] not found`);s=a[0]}else s=a;return s}async getProjectUrl({projectId:e,projectName:r}){if(e===void 0&&r===void 0)throw new Error("Must provide either projectName or projectId");let n=await this.readProject({projectId:e,projectName:r}),o=await this._getTenantId();return`${this.getHostUrl()}/o/${o}/projects/p/${n.id}`}async getDatasetUrl({datasetId:e,datasetName:r}){if(e===void 0&&r===void 0)throw new Error("Must provide either datasetName or datasetId");let n=await this.readDataset({datasetId:e,datasetName:r}),o=await this._getTenantId();return`${this.getHostUrl()}/o/${o}/datasets/${n.id}`}async _getTenantId(){if(this._tenantId!==null)return this._tenantId;let e=new URLSearchParams({limit:"1"});for await(let r of this._getPaginated("/sessions",e))return this._tenantId=r[0].tenant_id,r[0].tenant_id;throw new Error("No projects found to resolve tenant.")}async*listProjects({projectIds:e,name:r,nameContains:n,referenceDatasetId:o,referenceDatasetName:i,includeStats:a,datasetVersion:s,referenceFree:u,metadata:l}={}){let c=new URLSearchParams;if(e!==void 0)for(let d of e)c.append("id",d);if(r!==void 0&&c.append("name",r),n!==void 0&&c.append("name_contains",n),o!==void 0)c.append("reference_dataset",o);else if(i!==void 0){let d=await this.readDataset({datasetName:i});c.append("reference_dataset",d.id)}a!==void 0&&c.append("include_stats",a.toString()),s!==void 0&&c.append("dataset_version",s),u!==void 0&&c.append("reference_free",u.toString()),l!==void 0&&c.append("metadata",JSON.stringify(l));for await(let d of this._getPaginated("/sessions",c))yield*d}async deleteProject({projectId:e,projectName:r}){let n;if(e===void 0&&r===void 0)throw new Error("Must provide projectName or projectId");if(e!==void 0&&r!==void 0)throw new Error("Must provide either projectName or projectId, not both");e===void 0?n=(await this.readProject({projectName:r})).id:n=e,Po(n),await this.caller.call(async()=>{let o=await this._fetch(`${this.apiUrl}/sessions/${n}`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(o,`delete session ${n} (${r})`,!0),o})}async uploadCsv({csvFile:e,fileName:r,inputKeys:n,outputKeys:o,description:i,dataType:a,name:s}){let u=`${this.apiUrl}/datasets/upload`,l=new FormData;return l.append("file",e,r),n.forEach(f=>{l.append("input_keys",f)}),o.forEach(f=>{l.append("output_keys",f)}),i&&l.append("description",i),a&&l.append("data_type",a),s&&l.append("name",s),await(await this.caller.call(async()=>{let f=await this._fetch(u,{method:"POST",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:l});return await $r(f,"upload CSV"),f})).json()}async createDataset(e,{description:r,dataType:n,inputsSchema:o,outputsSchema:i,metadata:a}={}){let s={name:e,description:r,extra:a?{metadata:a}:void 0};n&&(s.data_type=n),o&&(s.inputs_schema_definition=o),i&&(s.outputs_schema_definition=i);let u=JSON.stringify(s);return await(await this.caller.call(async()=>{let d=await this._fetch(`${this.apiUrl}/datasets`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:u});return await $r(d,"create dataset"),d})).json()}async readDataset({datasetId:e,datasetName:r}){let n="/datasets",o=new URLSearchParams({limit:"1"});if(e&&r)throw new Error("Must provide either datasetName or datasetId, not both");if(e)Po(e),n+=`/${e}`;else if(r)o.append("name",r);else throw new Error("Must provide datasetName or datasetId");let i=await this._get(n,o),a;if(Array.isArray(i)){if(i.length===0)throw new Error(`Dataset[id=${e}, name=${r}] not found`);a=i[0]}else a=i;return a}async hasDataset({datasetId:e,datasetName:r}){try{return await this.readDataset({datasetId:e,datasetName:r}),!0}catch(n){if(n instanceof Error&&n.message.toLocaleLowerCase().includes("not found"))return!1;throw n}}async diffDatasetVersions({datasetId:e,datasetName:r,fromVersion:n,toVersion:o}){let i=e;if(i===void 0&&r===void 0)throw new Error("Must provide either datasetName or datasetId");if(i!==void 0&&r!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");i===void 0&&(i=(await this.readDataset({datasetName:r})).id);let a=new URLSearchParams({from_version:typeof n=="string"?n:n.toISOString(),to_version:typeof o=="string"?o:o.toISOString()});return await this._get(`/datasets/${i}/versions/diff`,a)}async readDatasetOpenaiFinetuning({datasetId:e,datasetName:r}){let n="/datasets";if(e===void 0)if(r!==void 0)e=(await this.readDataset({datasetName:r})).id;else throw new Error("Must provide either datasetName or datasetId");return(await(await this._getResponse(`${n}/${e}/openai_ft`)).text()).trim().split(` +`).map(s=>JSON.parse(s))}async*listDatasets({limit:e=100,offset:r=0,datasetIds:n,datasetName:o,datasetNameContains:i,metadata:a}={}){let s="/datasets",u=new URLSearchParams({limit:e.toString(),offset:r.toString()});if(n!==void 0)for(let l of n)u.append("id",l);o!==void 0&&u.append("name",o),i!==void 0&&u.append("name_contains",i),a!==void 0&&u.append("metadata",JSON.stringify(a));for await(let l of this._getPaginated(s,u))yield*l}async updateDataset(e){let{datasetId:r,datasetName:n,...o}=e;if(!r&&!n)throw new Error("Must provide either datasetName or datasetId");let i=r??(await this.readDataset({datasetName:n})).id;Po(i);let a=JSON.stringify(o);return await(await this.caller.call(async()=>{let u=await this._fetch(`${this.apiUrl}/datasets/${i}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:a});return await $r(u,"update dataset"),u})).json()}async updateDatasetTag(e){let{datasetId:r,datasetName:n,asOf:o,tag:i}=e;if(!r&&!n)throw new Error("Must provide either datasetName or datasetId");let a=r??(await this.readDataset({datasetName:n})).id;Po(a);let s=JSON.stringify({as_of:typeof o=="string"?o:o.toISOString(),tag:i});await this.caller.call(async()=>{let u=await this._fetch(`${this.apiUrl}/datasets/${a}/tags`,{method:"PUT",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:s});return await $r(u,"update dataset tags",!0),u})}async deleteDataset({datasetId:e,datasetName:r}){let n="/datasets",o=e;if(e!==void 0&&r!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");if(r!==void 0&&(o=(await this.readDataset({datasetName:r})).id),o!==void 0)Po(o),n+=`/${o}`;else throw new Error("Must provide datasetName or datasetId");await this.caller.call(async()=>{let i=await this._fetch(this.apiUrl+n,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(i,`delete ${n}`,!0),i})}async indexDataset({datasetId:e,datasetName:r,tag:n}){let o=e;if(!o&&!r)throw new Error("Must provide either datasetName or datasetId");if(o&&r)throw new Error("Must provide either datasetName or datasetId, not both");o||(o=(await this.readDataset({datasetName:r})).id),Po(o);let a=JSON.stringify({tag:n});await(await this.caller.call(async()=>{let u=await this._fetch(`${this.apiUrl}/datasets/${o}/index`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:a});return await $r(u,"index dataset"),u})).json()}async similarExamples(e,r,n,{filter:o}={}){let i={limit:n,inputs:e};o!==void 0&&(i.filter=o),Po(r);let a=JSON.stringify(i);return(await(await this.caller.call(async()=>{let l=await this._fetch(`${this.apiUrl}/datasets/${r}/search`,{headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,method:"POST",body:a});return await $r(l,"fetch similar examples"),l})).json()).examples}async createExample(e,r,n){if($xt(e)&&(r!==void 0||n!==void 0))throw new Error("Cannot provide outputs or options when using ExampleCreate object");let o=r?n?.datasetId:e.dataset_id,i=r?n?.datasetName:e.dataset_name;if(o===void 0&&i===void 0)throw new Error("Must provide either datasetName or datasetId");if(o!==void 0&&i!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");o===void 0&&(o=(await this.readDataset({datasetName:i})).id);let a=(r?n?.createdAt:e.created_at)||new Date,s;$xt(e)?s=e:s={inputs:e,outputs:r,created_at:a?.toISOString(),id:n?.exampleId,metadata:n?.metadata,split:n?.split,source_run_id:n?.sourceRunId,use_source_run_io:n?.useSourceRunIO,use_source_run_attachments:n?.useSourceRunAttachments,attachments:n?.attachments};let u=await this._uploadExamplesMultipart(o,[s]);return await this.readExample(u.example_ids?.[0]??nN())}async createExamples(e){if(Array.isArray(e)){if(e.length===0)return[];let b=e,_=b[0].dataset_id,w=b[0].dataset_name;if(_===void 0&&w===void 0)throw new Error("Must provide either datasetName or datasetId");if(_!==void 0&&w!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");_===void 0&&(_=(await this.readDataset({datasetName:w})).id);let x=await this._uploadExamplesMultipart(_,b);return await Promise.all(x.example_ids.map(E=>this.readExample(E)))}let{inputs:r,outputs:n,metadata:o,splits:i,sourceRunIds:a,useSourceRunIOs:s,useSourceRunAttachments:u,attachments:l,exampleIds:c,datasetId:d,datasetName:f}=e;if(r===void 0)throw new Error("Must provide inputs when using legacy parameters");let p=d,m=f;if(p===void 0&&m===void 0)throw new Error("Must provide either datasetName or datasetId");if(p!==void 0&&m!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");p===void 0&&(p=(await this.readDataset({datasetName:m})).id);let h=r.map((b,_)=>({dataset_id:p,inputs:b,outputs:n?.[_],metadata:o?.[_],split:i?.[_],id:c?.[_],attachments:l?.[_],source_run_id:a?.[_],use_source_run_io:s?.[_],use_source_run_attachments:u?.[_]})),g=await this._uploadExamplesMultipart(p,h);return await Promise.all(g.example_ids.map(b=>this.readExample(b)))}async createLLMExample(e,r,n){return this.createExample({input:e},{output:r},n)}async createChatExample(e,r,n){let o=e.map(a=>Dke(a)?$ke(a):a),i=Dke(r)?$ke(r):r;return this.createExample({input:o},{output:i},n)}async readExample(e){Po(e);let r=`/examples/${e}`,n=await this._get(r),{attachment_urls:o,...i}=n,a=i;return o&&(a.attachments=Object.entries(o).reduce((s,[u,l])=>(s[u.slice(11)]={presigned_url:l.presigned_url,mime_type:l.mime_type},s),{})),a}async*listExamples({datasetId:e,datasetName:r,exampleIds:n,asOf:o,splits:i,inlineS3Urls:a,metadata:s,limit:u,offset:l,filter:c,includeAttachments:d}={}){let f;if(e!==void 0&&r!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");if(e!==void 0)f=e;else if(r!==void 0)f=(await this.readDataset({datasetName:r})).id;else throw new Error("Must provide a datasetName or datasetId");let p=new URLSearchParams({dataset:f}),m=o?typeof o=="string"?o:o?.toISOString():void 0;m&&p.append("as_of",m);let h=a??!0;if(p.append("inline_s3_urls",h.toString()),n!==void 0)for(let y of n)p.append("id",y);if(i!==void 0)for(let y of i)p.append("splits",y);if(s!==void 0){let y=JSON.stringify(s);p.append("metadata",y)}u!==void 0&&p.append("limit",u.toString()),l!==void 0&&p.append("offset",l.toString()),c!==void 0&&p.append("filter",c),d===!0&&["attachment_urls","outputs","metadata"].forEach(y=>p.append("select",y));let g=0;for await(let y of this._getPaginated("/examples",p)){for(let b of y){let{attachment_urls:_,...w}=b,x=w;_&&(x.attachments=Object.entries(_).reduce((O,[E,T])=>(O[E.slice(11)]={presigned_url:T.presigned_url,mime_type:T.mime_type||void 0},O),{})),yield x,g++}if(u!==void 0&&g>=u)break}}async deleteExample(e){Po(e);let r=`/examples/${e}`;await this.caller.call(async()=>{let n=await this._fetch(this.apiUrl+r,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(n,`delete ${r}`,!0),n})}async updateExample(e,r){let n;r?n=e:n=e.id,Po(n);let o;r?o={id:n,...r}:o=e;let i;return o.dataset_id!==void 0?i=o.dataset_id:i=(await this.readExample(n)).dataset_id,this._updateExamplesMultipart(i,[o])}async updateExamples(e){let r;return e[0].dataset_id===void 0?r=(await this.readExample(e[0].id)).dataset_id:r=e[0].dataset_id,this._updateExamplesMultipart(r,e)}async readDatasetVersion({datasetId:e,datasetName:r,asOf:n,tag:o}){let i;if(e?i=e:i=(await this.readDataset({datasetName:r})).id,Po(i),n&&o||!n&&!o)throw new Error("Exactly one of asOf and tag must be specified.");let a=new URLSearchParams;return n!==void 0&&a.append("as_of",typeof n=="string"?n:n.toISOString()),o!==void 0&&a.append("tag",o),await(await this.caller.call(async()=>{let u=await this._fetch(`${this.apiUrl}/datasets/${i}/version?${a.toString()}`,{method:"GET",headers:{...this.headers},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(u,"read dataset version"),u})).json()}async listDatasetSplits({datasetId:e,datasetName:r,asOf:n}){let o;if(e===void 0&&r===void 0)throw new Error("Must provide dataset name or ID");if(e!==void 0&&r!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");e===void 0?o=(await this.readDataset({datasetName:r})).id:o=e,Po(o);let i=new URLSearchParams,a=n?typeof n=="string"?n:n?.toISOString():void 0;return a&&i.append("as_of",a),await this._get(`/datasets/${o}/splits`,i)}async updateDatasetSplits({datasetId:e,datasetName:r,splitName:n,exampleIds:o,remove:i=!1}){let a;if(e===void 0&&r===void 0)throw new Error("Must provide dataset name or ID");if(e!==void 0&&r!==void 0)throw new Error("Must provide either datasetName or datasetId, not both");e===void 0?a=(await this.readDataset({datasetName:r})).id:a=e,Po(a);let s={split_name:n,examples:o.map(l=>(Po(l),l)),remove:i},u=JSON.stringify(s);await this.caller.call(async()=>{let l=await this._fetch(`${this.apiUrl}/datasets/${a}/splits`,{method:"PUT",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:u});return await $r(l,"update dataset splits",!0),l})}async evaluateRun(e,r,{sourceInfo:n,loadChildRuns:o,referenceExample:i}={loadChildRuns:!1}){PY("This method is deprecated and will be removed in future LangSmith versions, use `evaluate` from `langsmith/evaluation` instead.");let a;if(typeof e=="string")a=await this.readRun(e,{loadChildRuns:o});else if(typeof e=="object"&&"id"in e)a=e;else throw new Error(`Invalid run type: ${typeof e}`);a.reference_example_id!==null&&a.reference_example_id!==void 0&&(i=await this.readExample(a.reference_example_id));let s=await r.evaluateRun(a,i),[u,l]=await this._logEvaluationFeedback(s,a,n);return l[0]}async createFeedback(e,r,{score:n,value:o,correction:i,comment:a,sourceInfo:s,feedbackSourceType:u="api",sourceRunId:l,feedbackId:c,feedbackConfig:d,projectId:f,comparativeExperimentId:p}){if(!e&&!f)throw new Error("One of runId or projectId must be provided");if(e&&f)throw new Error("Only one of runId or projectId can be provided");let m={type:u??"api",metadata:s??{}};l!==void 0&&m?.metadata!==void 0&&!m.metadata.__run&&(m.metadata.__run={run_id:l}),m?.metadata!==void 0&&m.metadata.__run?.run_id!==void 0&&Po(m.metadata.__run.run_id);let h={id:c??nN(),run_id:e,key:r,score:jxt(n),value:o,correction:i,comment:a,feedback_source:m,comparative_experiment_id:p,feedbackConfig:d,session_id:f},g=JSON.stringify(h),y=`${this.apiUrl}/feedback`;return await this.caller.call(async()=>{let b=await this._fetch(y,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:g});return await $r(b,"create feedback",!0),b}),h}async updateFeedback(e,{score:r,value:n,correction:o,comment:i}){let a={};r!=null&&(a.score=jxt(r)),n!=null&&(a.value=n),o!=null&&(a.correction=o),i!=null&&(a.comment=i),Po(e);let s=JSON.stringify(a);await this.caller.call(async()=>{let u=await this._fetch(`${this.apiUrl}/feedback/${e}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:s});return await $r(u,"update feedback",!0),u})}async readFeedback(e){Po(e);let r=`/feedback/${e}`;return await this._get(r)}async deleteFeedback(e){Po(e);let r=`/feedback/${e}`;await this.caller.call(async()=>{let n=await this._fetch(this.apiUrl+r,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(n,`delete ${r}`,!0),n})}async*listFeedback({runIds:e,feedbackKeys:r,feedbackSourceTypes:n}={}){let o=new URLSearchParams;if(e)for(let i of e)Po(i),o.append("run",i);if(r)for(let i of r)o.append("key",i);if(n)for(let i of n)o.append("source",i);for await(let i of this._getPaginated("/feedback",o))yield*i}async createPresignedFeedbackToken(e,r,{expiration:n,feedbackConfig:o}={}){let i={run_id:e,feedback_key:r,feedback_config:o};n?typeof n=="string"?i.expires_at=n:(n?.hours||n?.minutes||n?.days)&&(i.expires_in=n):i.expires_in={hours:3};let a=JSON.stringify(i);return await(await this.caller.call(async()=>{let u=await this._fetch(`${this.apiUrl}/feedback/tokens`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:a});return await $r(u,"create presigned feedback token"),u})).json()}async createComparativeExperiment({name:e,experimentIds:r,referenceDatasetId:n,createdAt:o,description:i,metadata:a,id:s}){if(r.length===0)throw new Error("At least one experiment is required");if(n||(n=(await this.readProject({projectId:r[0]})).reference_dataset_id),!n==null)throw new Error("A reference dataset is required");let u={id:s,name:e,experiment_ids:r,reference_dataset_id:n,description:i,created_at:(o??new Date)?.toISOString(),extra:{}};a&&(u.extra.metadata=a);let l=JSON.stringify(u);return(await this.caller.call(async()=>{let d=await this._fetch(`${this.apiUrl}/datasets/comparative`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:l});return await $r(d,"create comparative experiment"),d})).json()}async*listPresignedFeedbackTokens(e){Po(e);let r=new URLSearchParams({run_id:e});for await(let n of this._getPaginated("/feedback/tokens",r))yield*n}_selectEvalResults(e){let r;return"results"in e?r=e.results:Array.isArray(e)?r=e:r=[e],r}async _logEvaluationFeedback(e,r,n){let o=this._selectEvalResults(e),i=[];for(let a of o){let s=n||{};a.evaluatorInfo&&(s={...a.evaluatorInfo,...s});let u=null;a.targetRunId?u=a.targetRunId:r&&(u=r.id),i.push(await this.createFeedback(u,a.key,{score:a.score,value:a.value,comment:a.comment,correction:a.correction,sourceInfo:s,sourceRunId:a.sourceRunId,feedbackConfig:a.feedbackConfig,feedbackSourceType:"model"}))}return[o,i]}async logEvaluationFeedback(e,r,n){let[o]=await this._logEvaluationFeedback(e,r,n);return o}async*listAnnotationQueues(e={}){let{queueIds:r,name:n,nameContains:o,limit:i}=e,a=new URLSearchParams;r&&r.forEach((u,l)=>{Po(u,`queueIds[${l}]`),a.append("ids",u)}),n&&a.append("name",n),o&&a.append("name_contains",o),a.append("limit",(i!==void 0?Math.min(i,100):100).toString());let s=0;for await(let u of this._getPaginated("/annotation-queues",a))if(yield*u,s++,i!==void 0&&s>=i)break}async createAnnotationQueue(e){let{name:r,description:n,queueId:o,rubricInstructions:i}=e,a={name:r,description:n,id:o||nN(),rubric_instructions:i},s=JSON.stringify(Object.fromEntries(Object.entries(a).filter(([l,c])=>c!==void 0)));return(await this.caller.call(async()=>{let l=await this._fetch(`${this.apiUrl}/annotation-queues`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:s});return await $r(l,"create annotation queue"),l})).json()}async readAnnotationQueue(e){return(await this.caller.call(async()=>{let n=await this._fetch(`${this.apiUrl}/annotation-queues/${Po(e,"queueId")}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(n,"read annotation queue"),n})).json()}async updateAnnotationQueue(e,r){let{name:n,description:o,rubricInstructions:i}=r,a=JSON.stringify({name:n,description:o,rubric_instructions:i});await this.caller.call(async()=>{let s=await this._fetch(`${this.apiUrl}/annotation-queues/${Po(e,"queueId")}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:a});return await $r(s,"update annotation queue",!0),s})}async deleteAnnotationQueue(e){await this.caller.call(async()=>{let r=await this._fetch(`${this.apiUrl}/annotation-queues/${Po(e,"queueId")}`,{method:"DELETE",headers:{...this.headers,Accept:"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(r,"delete annotation queue",!0),r})}async addRunsToAnnotationQueue(e,r){let n=JSON.stringify(r.map((o,i)=>Po(o,`runIds[${i}]`).toString()));await this.caller.call(async()=>{let o=await this._fetch(`${this.apiUrl}/annotation-queues/${Po(e,"queueId")}/runs`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:n});return await $r(o,"add runs to annotation queue",!0),o})}async getRunFromAnnotationQueue(e,r){let n=`/annotation-queues/${Po(e,"queueId")}/run`;return(await this.caller.call(async()=>{let i=await this._fetch(`${this.apiUrl}${n}/${r}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(i,"get run from annotation queue"),i})).json()}async deleteRunFromAnnotationQueue(e,r){await this.caller.call(async()=>{let n=await this._fetch(`${this.apiUrl}/annotation-queues/${Po(e,"queueId")}/runs/${Po(r,"queueRunId")}`,{method:"DELETE",headers:{...this.headers,Accept:"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(n,"delete run from annotation queue",!0),n})}async getSizeFromAnnotationQueue(e){return(await this.caller.call(async()=>{let n=await this._fetch(`${this.apiUrl}/annotation-queues/${Po(e,"queueId")}/size`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(n,"get size from annotation queue"),n})).json()}async _currentTenantIsOwner(e){let r=await this._getSettings();return e=="-"||r.tenant_handle===e}async _ownerConflictError(e,r){let n=await this._getSettings();return new Error(`Cannot ${e} for another tenant. + + Current tenant: ${n.tenant_handle} + + Requested tenant: ${r}`)}async _getLatestCommitHash(e){let n=await(await this.caller.call(async()=>{let o=await this._fetch(`${this.apiUrl}/commits/${e}/?limit=1&offset=0`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(o,"get latest commit hash"),o})).json();if(n.commits.length!==0)return n.commits[0].commit_hash}async _likeOrUnlikePrompt(e,r){let[n,o,i]=iN(e),a=JSON.stringify({like:r});return(await this.caller.call(async()=>{let u=await this._fetch(`${this.apiUrl}/likes/${n}/${o}`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:a});return await $r(u,`${r?"like":"unlike"} prompt`),u})).json()}async _getPromptUrl(e){let[r,n,o]=iN(e);if(await this._currentTenantIsOwner(r)){let i=await this._getSettings();return o!=="latest"?`${this.getHostUrl()}/prompts/${n}/${o.substring(0,8)}?organizationId=${i.id}`:`${this.getHostUrl()}/prompts/${n}?organizationId=${i.id}`}else return o!=="latest"?`${this.getHostUrl()}/hub/${r}/${n}/${o.substring(0,8)}`:`${this.getHostUrl()}/hub/${r}/${n}`}async promptExists(e){return!!await this.getPrompt(e)}async likePrompt(e){return this._likeOrUnlikePrompt(e,!0)}async unlikePrompt(e){return this._likeOrUnlikePrompt(e,!1)}async*listCommits(e){for await(let r of this._getPaginated(`/commits/${e}/`,new URLSearchParams,n=>n.commits))yield*r}async*listPrompts(e){let r=new URLSearchParams;r.append("sort_field",e?.sortField??"updated_at"),r.append("sort_direction","desc"),r.append("is_archived",(!!e?.isArchived).toString()),e?.isPublic!==void 0&&r.append("is_public",e.isPublic.toString()),e?.query&&r.append("query",e.query);for await(let n of this._getPaginated("/repos",r,o=>o.repos))yield*n}async getPrompt(e){let[r,n,o]=iN(e),a=await(await this.caller.call(async()=>{let s=await this._fetch(`${this.apiUrl}/repos/${r}/${n}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return s?.status===404?null:(await $r(s,"get prompt"),s)}))?.json();return a?.repo?a.repo:null}async createPrompt(e,r){let n=await this._getSettings();if(r?.isPublic&&!n.tenant_handle)throw new Error(`Cannot create a public prompt without first + + creating a LangChain Hub handle. + You can add a handle by creating a public prompt at: + + https://smith.langchain.com/prompts`);let[o,i,a]=iN(e);if(!await this._currentTenantIsOwner(o))throw await this._ownerConflictError("create a prompt",o);let s={repo_handle:i,...r?.description&&{description:r.description},...r?.readme&&{readme:r.readme},...r?.tags&&{tags:r.tags},is_public:!!r?.isPublic},u=JSON.stringify(s),l=await this.caller.call(async()=>{let d=await this._fetch(`${this.apiUrl}/repos/`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:u});return await $r(d,"create prompt"),d}),{repo:c}=await l.json();return c}async createCommit(e,r,n){if(!await this.promptExists(e))throw new Error("Prompt does not exist, you must create it first.");let[o,i,a]=iN(e),s=n?.parentCommitHash==="latest"||!n?.parentCommitHash?await this._getLatestCommitHash(`${o}/${i}`):n?.parentCommitHash,u={manifest:JSON.parse(JSON.stringify(r)),parent_commit:s},l=JSON.stringify(u),d=await(await this.caller.call(async()=>{let f=await this._fetch(`${this.apiUrl}/commits/${o}/${i}`,{method:"POST",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:l});return await $r(f,"create commit"),f})).json();return this._getPromptUrl(`${o}/${i}${d.commit_hash?`:${d.commit_hash}`:""}`)}async updateExamplesMultipart(e,r=[]){return this._updateExamplesMultipart(e,r)}async _updateExamplesMultipart(e,r=[]){if(!await this._getDatasetExamplesMultiPartSupport())throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");let n=new FormData;for(let a of r){let s=a.id,u={...a.metadata&&{metadata:a.metadata},...a.split&&{split:a.split}},l=Xb(u,`Serializing body for example with id: ${s}`),c=new Blob([l],{type:"application/json"});if(n.append(s,c),a.inputs){let d=Xb(a.inputs,`Serializing inputs for example with id: ${s}`),f=new Blob([d],{type:"application/json"});n.append(`${s}.inputs`,f)}if(a.outputs){let d=Xb(a.outputs,`Serializing outputs whle updating example with id: ${s}`),f=new Blob([d],{type:"application/json"});n.append(`${s}.outputs`,f)}if(a.attachments)for(let[d,f]of Object.entries(a.attachments)){let p,m;Array.isArray(f)?[p,m]=f:(p=f.mimeType,m=f.data);let h=new Blob([m],{type:`${p}; length=${m.byteLength}`});n.append(`${s}.attachment.${d}`,h)}if(a.attachments_operations){let d=Xb(a.attachments_operations,`Serializing attachments while updating example with id: ${s}`),f=new Blob([d],{type:"application/json"});n.append(`${s}.attachments_operations`,f)}}let o=e??r[0]?.dataset_id;return(await this.caller.call(async()=>{let a=await this._fetch(`${this.apiUrl}${this._getPlatformEndpointPath(`datasets/${o}/examples`)}`,{method:"PATCH",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:n});return await $r(a,"update examples"),a})).json()}async uploadExamplesMultipart(e,r=[]){return this._uploadExamplesMultipart(e,r)}async _uploadExamplesMultipart(e,r=[]){if(!await this._getDatasetExamplesMultiPartSupport())throw new Error("Your LangSmith deployment does not allow using the multipart examples endpoint, please upgrade your deployment to the latest version.");let n=new FormData;for(let i of r){let a=(i.id??nN()).toString(),s={created_at:i.created_at,...i.metadata&&{metadata:i.metadata},...i.split&&{split:i.split},...i.source_run_id&&{source_run_id:i.source_run_id},...i.use_source_run_io&&{use_source_run_io:i.use_source_run_io},...i.use_source_run_attachments&&{use_source_run_attachments:i.use_source_run_attachments}},u=Xb(s,`Serializing body for uploaded example with id: ${a}`),l=new Blob([u],{type:"application/json"});if(n.append(a,l),i.inputs){let c=Xb(i.inputs,`Serializing inputs for uploaded example with id: ${a}`),d=new Blob([c],{type:"application/json"});n.append(`${a}.inputs`,d)}if(i.outputs){let c=Xb(i.outputs,`Serializing outputs for uploaded example with id: ${a}`),d=new Blob([c],{type:"application/json"});n.append(`${a}.outputs`,d)}if(i.attachments)for(let[c,d]of Object.entries(i.attachments)){let f,p;Array.isArray(d)?[f,p]=d:(f=d.mimeType,p=d.data);let m=new Blob([p],{type:`${f}; length=${p.byteLength}`});n.append(`${a}.attachment.${c}`,m)}}return(await this.caller.call(async()=>{let i=await this._fetch(`${this.apiUrl}${this._getPlatformEndpointPath(`datasets/${e}/examples`)}`,{method:"POST",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:n});return await $r(i,"upload examples"),i})).json()}async updatePrompt(e,r){if(!await this.promptExists(e))throw new Error("Prompt does not exist, you must create it first.");let[n,o]=iN(e);if(!await this._currentTenantIsOwner(n))throw await this._ownerConflictError("update a prompt",n);let i={};if(r?.description!==void 0&&(i.description=r.description),r?.readme!==void 0&&(i.readme=r.readme),r?.tags!==void 0&&(i.tags=r.tags),r?.isPublic!==void 0&&(i.is_public=r.isPublic),r?.isArchived!==void 0&&(i.is_archived=r.isArchived),Object.keys(i).length===0)throw new Error("No valid update options provided");let a=JSON.stringify(i);return(await this.caller.call(async()=>{let u=await this._fetch(`${this.apiUrl}/repos/${n}/${o}`,{method:"PATCH",headers:{...this.headers,"Content-Type":"application/json"},signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions,body:a});return await $r(u,"update prompt"),u})).json()}async deletePrompt(e){if(!await this.promptExists(e))throw new Error("Prompt does not exist, you must create it first.");let[r,n,o]=iN(e);if(!await this._currentTenantIsOwner(r))throw await this._ownerConflictError("delete a prompt",r);return(await this.caller.call(async()=>{let a=await this._fetch(`${this.apiUrl}/repos/${r}/${n}`,{method:"DELETE",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(a,"delete prompt"),a})).json()}async pullPromptCommit(e,r){let[n,o,i]=iN(e),s=await(await this.caller.call(async()=>{let u=await this._fetch(`${this.apiUrl}/commits/${n}/${o}/${i}${r?.includeModel?"?include_model=true":""}`,{method:"GET",headers:this.headers,signal:AbortSignal.timeout(this.timeout_ms),...this.fetchOptions});return await $r(u,"pull prompt commit"),u})).json();return{owner:n,repo:o,commit_hash:s.commit_hash,manifest:s.manifest,examples:s.examples}}async _pullPrompt(e,r){let n=await this.pullPromptCommit(e,{includeModel:r?.includeModel});return JSON.stringify(n.manifest)}async pushPrompt(e,r){return await this.promptExists(e)?r&&Object.keys(r).some(o=>o!=="object")&&await this.updatePrompt(e,{description:r?.description,readme:r?.readme,tags:r?.tags,isPublic:r?.isPublic}):await this.createPrompt(e,{description:r?.description,readme:r?.readme,tags:r?.tags,isPublic:r?.isPublic}),r?.object?await this.createCommit(e,r?.object,{parentCommitHash:r?.parentCommitHash}):await this._getPromptUrl(e)}async clonePublicDataset(e,r={}){let{sourceApiUrl:n=this.apiUrl,datasetName:o}=r,[i,a]=this.parseTokenOrUrl(e,n),s=new t({apiUrl:i,apiKey:"placeholder"}),u=await s.readSharedDataset(a),l=o||u.name;try{if(await this.hasDataset({datasetId:l})){console.log(`Dataset ${l} already exists in your tenant. Skipping.`);return}}catch{}let c=await s.listSharedExamples(a),d=await this.createDataset(l,{description:u.description,dataType:u.data_type||"kv",inputsSchema:u.inputs_schema_definition??void 0,outputsSchema:u.outputs_schema_definition??void 0});try{await this.createExamples({inputs:c.map(f=>f.inputs),outputs:c.flatMap(f=>f.outputs?[f.outputs]:[]),datasetId:d.id})}catch(f){throw console.error(`An error occurred while creating dataset ${l}. You should delete it manually.`),f}}parseTokenOrUrl(e,r,n=2,o="dataset"){try{return Po(e),[r,e]}catch{}try{let a=new URL(e).pathname.split("/").filter(s=>s!=="");if(a.length>=n){let s=a[a.length-n];return[r,s]}else throw new Error(`Invalid public ${o} URL: ${e}`)}catch{throw new Error(`Invalid public ${o} URL or token: ${e}`)}}async awaitPendingTraceBatches(){if(this.manualFlushMode)return console.warn("[WARNING]: When tracing in manual flush mode, you must call `await client.flush()` manually to submit trace batches."),Promise.resolve();await Promise.all([...this.autoBatchQueue.items.map(({itemPromise:e})=>e),this.batchIngestCaller.queue.onIdle()]),this.langSmithToOTELTranslator!==void 0&&await y0t()?.DEFAULT_LANGSMITH_SPAN_PROCESSOR?.forceFlush()}}});var Lxt,Fxt=v(()=>{oN();Lxt=t=>t!==void 0?t:!!["TRACING_V2","TRACING"].find(r=>ld(r)==="true")});var Epe,kxt=v(()=>{Epe=Symbol.for("lc:context_variables")});function Icn(t){return t.replace(/[-:.]/g,"")}function uqe(t,e,r=1){let n=r.toFixed(0).slice(0,3).padStart(3,"0"),o=`${new Date(t).toISOString().slice(0,-1)}${n}Z`;return{dottedOrder:Icn(o)+e,microsecondPrecisionDatestring:o}}function Bxt(t){return t!=null&&typeof t.createChild=="function"&&typeof t.postRun=="function"}function Uxt(t){return typeof t=="object"&&t!=null&&typeof t.name=="string"&&t.name==="langchain_tracer"}function qxt(t){return Array.isArray(t)&&t.some(e=>Uxt(e))}function Ncn(t){return typeof t=="object"&&t!=null&&Array.isArray(t.handlers)}function jcn(t){return t!=null&&typeof t.callbacks=="object"&&(qxt(t.callbacks?.handlers)||qxt(t.callbacks))}function Dcn(t){return t.split(".").map(r=>{let n=r.slice(0,-36),o=r.slice(-36),i=parseInt(n.slice(0,4)),a=parseInt(n.slice(4,6))-1,s=parseInt(n.slice(6,8)),u=parseInt(n.slice(9,11)),l=parseInt(n.slice(11,13)),c=parseInt(n.slice(13,15)),d=parseInt(n.slice(15,21));return[new Date(i,a,s,u,l,c,d/1e3),o]})}function $cn(){let t=wv("LANGSMITH_RUNS_ENDPOINTS");if(!t)return[];try{let e=JSON.parse(t);if(Array.isArray(e)){let r=[];for(let n of e){if(typeof n!="object"||n===null){console.warn(`Invalid item type in LANGSMITH_RUNS_ENDPOINTS: expected object, got ${typeof n}`);continue}if(typeof n.api_url!="string"){console.warn(`Invalid api_url type in LANGSMITH_RUNS_ENDPOINTS: expected string, got ${typeof n.api_url}`);continue}if(typeof n.api_key!="string"){console.warn(`Invalid api_key type in LANGSMITH_RUNS_ENDPOINTS: expected string, got ${typeof n.api_key}`);continue}r.push({apiUrl:n.api_url.replace(/\/$/,""),apiKey:n.api_key})}return r}else if(typeof e=="object"&&e!==null){Fcn(e);let r=[];for(let[n,o]of Object.entries(e)){let i=n.replace(/\/$/,"");if(typeof o=="string")r.push({apiUrl:i,apiKey:o});else{console.warn(`Invalid value type in LANGSMITH_RUNS_ENDPOINTS for URL ${n}: expected string, got ${typeof o}`);continue}}return r}else return console.warn(`Invalid LANGSMITH_RUNS_ENDPOINTS \u2013 must be valid JSON array of objects with api_url and api_key properties, or object mapping url->apiKey, got ${typeof e}`),[]}catch(e){if(Mxt(e))throw e;return console.warn("Invalid LANGSMITH_RUNS_ENDPOINTS \u2013 must be valid JSON array of objects with api_url and api_key properties, or object mapping url->apiKey"),[]}}function Lcn(t){return t?t.map(e=>Array.isArray(e)?{projectName:e[0],updates:e[1]}:e):$cn()}function Fcn(t){if(Object.keys(t).length>0&&ld("ENDPOINT"))throw new Cpe}var Ppe,H0,mke=v(()=>{ike();pke();Fxt();oqe();kxt();oN();fke();oN();Lke();Ppe=class t{constructor(e,r,n,o){Object.defineProperty(this,"metadata",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"project_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"replicas",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),this.metadata=e,this.tags=r,this.project_name=n,this.replicas=o}static fromHeader(e){let r=e.split(","),n={},o=[],i,a;for(let s of r){let[u,l]=s.split("="),c=decodeURIComponent(l);u==="langsmith-metadata"?n=JSON.parse(c):u==="langsmith-tags"?o=c.split(","):u==="langsmith-project"?i=c:u==="langsmith-replicas"&&(a=JSON.parse(c))}return new t(n,o,i,a)}toHeader(){let e=[];return this.metadata&&Object.keys(this.metadata).length>0&&e.push(`langsmith-metadata=${encodeURIComponent(JSON.stringify(this.metadata))}`),this.tags&&this.tags.length>0&&e.push(`langsmith-tags=${encodeURIComponent(this.tags.join(","))}`),this.project_name&&e.push(`langsmith-project=${encodeURIComponent(this.project_name)}`),e.join(",")}},H0=class t{constructor(e){if(Object.defineProperty(this,"id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"run_type",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"project_name",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"parent_run",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"parent_run_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"child_runs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"start_time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"end_time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"extra",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tags",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"error",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"serialized",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"inputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"outputs",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"reference_example_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"client",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"events",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"trace_id",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"dotted_order",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"tracingEnabled",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"execution_order",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"child_execution_order",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"attachments",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"replicas",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Object.defineProperty(this,"_serialized_start_time",{enumerable:!0,configurable:!0,writable:!0,value:void 0}),Bxt(e)){Object.assign(this,{...e});return}let r=t.getDefaultConfig(),{metadata:n,...o}=e,i=o.client??t.getSharedClient(),a={...n,...o?.extra?.metadata};if(o.extra={...o.extra,metadata:a},Object.assign(this,{...r,...o,client:i}),this.trace_id||(this.parent_run?this.trace_id=this.parent_run.trace_id??this.id:this.trace_id=this.id),this.replicas=Lcn(this.replicas),this.execution_order??(this.execution_order=1),this.child_execution_order??(this.child_execution_order=1),!this.dotted_order){let{dottedOrder:s,microsecondPrecisionDatestring:u}=uqe(this.start_time,this.id,this.execution_order);this.parent_run?this.dotted_order=this.parent_run.dotted_order+"."+s:this.dotted_order=s,this._serialized_start_time=u}}set metadata(e){this.extra={...this.extra,metadata:{...this.extra?.metadata,...e}}}get metadata(){return this.extra?.metadata}static getDefaultConfig(){return{id:nN(),run_type:"chain",project_name:OY(),child_runs:[],api_url:wv("LANGCHAIN_ENDPOINT")??"http://localhost:1984",api_key:wv("LANGCHAIN_API_KEY"),caller_options:{},start_time:Date.now(),serialized:{},inputs:{},extra:{}}}static getSharedClient(){return t.sharedClient||(t.sharedClient=new KU),t.sharedClient}createChild(e){let r=this.child_execution_order+1,n=new t({...e,parent_run:this,project_name:this.project_name,replicas:this.replicas,client:this.client,tracingEnabled:this.tracingEnabled,execution_order:r,child_execution_order:r});Epe in this&&(n[Epe]=this[Epe]);let o=Symbol.for("lc:child_config"),i=e.extra?.[o]??this.extra[o];if(jcn(i)){let u={...i},l=Ncn(u.callbacks)?u.callbacks.copy?.():void 0;l&&(Object.assign(l,{_parentRunId:n.id}),l.handlers?.find(Uxt)?.updateFromRunTree?.(n),u.callbacks=l),n.extra[o]=u}let a=new Set,s=this;for(;s!=null&&!a.has(s.id);)a.add(s.id),s.child_execution_order=Math.max(s.child_execution_order,r),s=s.parent_run;return this.child_runs.push(n),n}async end(e,r,n=Date.now(),o){this.outputs=this.outputs??e,this.error=this.error??r,this.end_time=this.end_time??n,o&&Object.keys(o).length>0&&(this.extra=this.extra?{...this.extra,metadata:{...this.extra.metadata,...o}}:{metadata:o})}_convertToCreate(e,r,n=!0){let o=e.extra??{};if(o?.runtime?.library===void 0&&(o.runtime||(o.runtime={}),r))for(let[s,u]of Object.entries(r))o.runtime[s]||(o.runtime[s]=u);let i,a;return n?(a=e.parent_run?.id??e.parent_run_id,i=[]):(i=e.child_runs.map(s=>this._convertToCreate(s,r,n)),a=void 0),{id:e.id,name:e.name,start_time:e._serialized_start_time??e.start_time,end_time:e.end_time,run_type:e.run_type,reference_example_id:e.reference_example_id,extra:o,serialized:e.serialized,error:e.error,inputs:e.inputs,outputs:e.outputs,session_name:e.project_name,child_runs:i,parent_run_id:a,trace_id:e.trace_id,dotted_order:e.dotted_order,tags:e.tags,attachments:e.attachments,events:e.events}}_remapForProject(e,r,n=!0){let o=this._convertToCreate(this,r,n);if(e===this.project_name)return o;let i=d=>Zfe(`${d}:${e}`,Zfe.DNS),a=i(o.id),s=o.trace_id?i(o.trace_id):void 0,u=o.parent_run_id?i(o.parent_run_id):void 0,l;if(o.dotted_order){let d=Dcn(o.dotted_order),f=[];for(let m=0;m0)for(let{projectName:n,apiKey:o,apiUrl:i,workspaceId:a}of this.replicas){let s=this._remapForProject(n??this.project_name,r,!0);await this.client.createRun(s,{apiKey:o,apiUrl:i,workspaceId:a})}else{let n=this._convertToCreate(this,r,e);await this.client.createRun(n)}if(!e){PY("Posting with excludeChildRuns=false is deprecated and will be removed in a future version.");for(let n of this.child_runs)await n.postRun(!1)}}catch(r){console.error(`Error in postRun for run ${this.id}:`,r)}}async patchRun(e){if(this.replicas&&this.replicas.length>0)for(let{projectName:r,apiKey:n,apiUrl:o,workspaceId:i,updates:a}of this.replicas){let s=this._remapForProject(r??this.project_name),u={id:s.id,outputs:s.outputs,error:s.error,parent_run_id:s.parent_run_id,session_name:s.session_name,reference_example_id:s.reference_example_id,end_time:s.end_time,dotted_order:s.dotted_order,trace_id:s.trace_id,events:s.events,tags:s.tags,extra:s.extra,attachments:this.attachments,...a};e?.excludeInputs||(u.inputs=s.inputs),await this.client.updateRun(s.id,u,{apiKey:n,apiUrl:o,workspaceId:i})}else try{let r={end_time:this.end_time,error:this.error,outputs:this.outputs,parent_run_id:this.parent_run?.id??this.parent_run_id,reference_example_id:this.reference_example_id,extra:this.extra,events:this.events,dotted_order:this.dotted_order,trace_id:this.trace_id,tags:this.tags,attachments:this.attachments,session_name:this.project_name};e?.excludeInputs||(r.inputs=this.inputs),await this.client.updateRun(this.id,r)}catch(r){console.error(`Error in patchRun for run ${this.id}`,r)}}toJSON(){return this._convertToCreate(this,void 0,!1)}addEvent(e){this.events||(this.events=[]),typeof e=="string"?this.events.push({name:"event",time:new Date().toISOString(),message:e}):this.events.push({...e,time:e.time??new Date().toISOString()})}static fromRunnableConfig(e,r){let n=e?.callbacks,o,i,a,s=Lxt();if(n){let l=n?.getParentRunId?.()??"",c=n?.handlers?.find(d=>d?.name=="langchain_tracer");o=c?.getRun?.(l),i=c?.projectName,a=c?.client,s=s||!!c}return o?new t({name:o.name,id:o.id,trace_id:o.trace_id,dotted_order:o.dotted_order,client:a,tracingEnabled:s,project_name:i,tags:[...new Set((o?.tags??[]).concat(e?.tags??[]))],extra:{metadata:{...o?.extra?.metadata,...e?.metadata}}}).createChild(r):new t({...r,client:a,tracingEnabled:s,project_name:i})}static fromDottedOrder(e){return this.fromHeaders({"langsmith-trace":e})}static fromHeaders(e,r){let n="get"in e&&typeof e.get=="function"?{"langsmith-trace":e.get("langsmith-trace"),baggage:e.get("baggage")}:e,o=n["langsmith-trace"];if(!o||typeof o!="string")return;let i=o.trim(),a=i.split(".").map(l=>{let[c,d]=l.split("Z");return{strTime:c,time:Date.parse(c+"Z"),uuid:d}}),s=a[0].uuid,u={...r,name:r?.name??"parent",run_type:r?.run_type??"chain",start_time:r?.start_time??Date.now(),id:a.at(-1)?.uuid,trace_id:s,dotted_order:i};if(n.baggage&&typeof n.baggage=="string"){let l=Ppe.fromHeader(n.baggage);u.metadata=l.metadata,u.tags=l.tags,u.project_name=l.project_name,u.replicas=l.replicas}return new t(u)}toHeaders(e){let r={"langsmith-trace":this.dotted_order,baggage:new Ppe(this.extra?.metadata,this.tags,this.project_name,this.replicas).toHeader()};if(e)for(let[n,o]of Object.entries(r))e.set(n,o);return r}};Object.defineProperty(H0,"sharedClient",{enumerable:!0,configurable:!0,writable:!0,value:null})});var Mpe=v(()=>{mke()});function cqe(t,e){if(t)return new H0({...t,start_time:t._serialized_start_time??t.start_time,parent_run:cqe(e),child_runs:t.child_runs.map(r=>cqe(r)).filter(r=>r!==void 0),extra:{...t.extra,runtime:ZFe()},tracingEnabled:!1})}function lqe(t,e){return t&&!Array.isArray(t)&&typeof t=="object"?t:{[e]:t}}function ZU(t){return typeof t._addRunToRunMap=="function"}var kcn,qcn,V0,XU=v(()=>{Do();Yu();xY();Mpe();kcn={};Tt(kcn,{BaseTracer:()=>V0,isBaseTracer:()=>ZU});qcn=t=>{if(t)return t.events=t.events??[],t.child_runs=t.child_runs??[],t};V0=class extends JU{constructor(e){super(...arguments);M(this,"runMap",new Map);M(this,"runTreeMap",new Map);M(this,"usesRunTreeMap",!1)}copy(){return this}getRunById(e){if(e!==void 0)return this.usesRunTreeMap?qcn(this.runTreeMap.get(e)):this.runMap.get(e)}stringifyError(e){return e instanceof Error?e.message+(e?.stack?` + +${e.stack}`:""):typeof e=="string"?e:`${e}`}_addChildRun(e,r){e.child_runs.push(r)}_addRunToRunMap(e){let{dottedOrder:r,microsecondPrecisionDatestring:n}=uqe(new Date(e.start_time).getTime(),e.id,e.execution_order),o={...e},i=this.getRunById(o.parent_run_id);if(o.parent_run_id!==void 0?i&&(this._addChildRun(i,o),i.child_execution_order=Math.max(i.child_execution_order,o.child_execution_order),o.trace_id=i.trace_id,i.dotted_order!==void 0&&(o.dotted_order=[i.dotted_order,r].join("."),o._serialized_start_time=n)):(o.trace_id=o.id,o.dotted_order=r,o._serialized_start_time=n),this.usesRunTreeMap){let a=cqe(o,i);a!==void 0&&this.runTreeMap.set(o.id,a)}else this.runMap.set(o.id,o);return o}async _endTrace(e){let r=e.parent_run_id!==void 0&&this.getRunById(e.parent_run_id);r?r.child_execution_order=Math.max(r.child_execution_order,e.child_execution_order):await this.persistRun(e),await this.onRunUpdate?.(e),this.usesRunTreeMap?this.runTreeMap.delete(e.id):this.runMap.delete(e.id)}_getExecutionOrder(e){let r=e!==void 0&&this.getRunById(e);return r?r.child_execution_order+1:1}_createRunForLLMStart(e,r,n,o,i,a,s,u){let l=this._getExecutionOrder(o),c=Date.now(),d=s?{...i,metadata:s}:i,f={id:n,name:u??e.id[e.id.length-1],parent_run_id:o,start_time:c,serialized:e,events:[{name:"start",time:new Date(c).toISOString()}],inputs:{prompts:r},execution_order:l,child_runs:[],child_execution_order:l,run_type:"llm",extra:d??{},tags:a||[]};return this._addRunToRunMap(f)}async handleLLMStart(e,r,n,o,i,a,s,u){let l=this.getRunById(n)??this._createRunForLLMStart(e,r,n,o,i,a,s,u);return await this.onRunCreate?.(l),await this.onLLMStart?.(l),l}_createRunForChatModelStart(e,r,n,o,i,a,s,u){let l=this._getExecutionOrder(o),c=Date.now(),d=s?{...i,metadata:s}:i,f={id:n,name:u??e.id[e.id.length-1],parent_run_id:o,start_time:c,serialized:e,events:[{name:"start",time:new Date(c).toISOString()}],inputs:{messages:r},execution_order:l,child_runs:[],child_execution_order:l,run_type:"llm",extra:d??{},tags:a||[]};return this._addRunToRunMap(f)}async handleChatModelStart(e,r,n,o,i,a,s,u){let l=this.getRunById(n)??this._createRunForChatModelStart(e,r,n,o,i,a,s,u);return await this.onRunCreate?.(l),await this.onLLMStart?.(l),l}async handleLLMEnd(e,r,n,o,i){let a=this.getRunById(r);if(!a||a?.run_type!=="llm")throw new Error("No LLM run to end.");return a.end_time=Date.now(),a.outputs=e,a.events.push({name:"end",time:new Date(a.end_time).toISOString()}),a.extra={...a.extra,...i},await this.onLLMEnd?.(a),await this._endTrace(a),a}async handleLLMError(e,r,n,o,i){let a=this.getRunById(r);if(!a||a?.run_type!=="llm")throw new Error("No LLM run to end.");return a.end_time=Date.now(),a.error=this.stringifyError(e),a.events.push({name:"error",time:new Date(a.end_time).toISOString()}),a.extra={...a.extra,...i},await this.onLLMError?.(a),await this._endTrace(a),a}_createRunForChainStart(e,r,n,o,i,a,s,u){let l=this._getExecutionOrder(o),c=Date.now(),d={id:n,name:u??e.id[e.id.length-1],parent_run_id:o,start_time:c,serialized:e,events:[{name:"start",time:new Date(c).toISOString()}],inputs:r,execution_order:l,child_execution_order:l,run_type:s??"chain",child_runs:[],extra:a?{metadata:a}:{},tags:i||[]};return this._addRunToRunMap(d)}async handleChainStart(e,r,n,o,i,a,s,u){let l=this.getRunById(n)??this._createRunForChainStart(e,r,n,o,i,a,s,u);return await this.onRunCreate?.(l),await this.onChainStart?.(l),l}async handleChainEnd(e,r,n,o,i){let a=this.getRunById(r);if(!a)throw new Error("No chain run to end.");return a.end_time=Date.now(),a.outputs=lqe(e,"output"),a.events.push({name:"end",time:new Date(a.end_time).toISOString()}),i?.inputs!==void 0&&(a.inputs=lqe(i.inputs,"input")),await this.onChainEnd?.(a),await this._endTrace(a),a}async handleChainError(e,r,n,o,i){let a=this.getRunById(r);if(!a)throw new Error("No chain run to end.");return a.end_time=Date.now(),a.error=this.stringifyError(e),a.events.push({name:"error",time:new Date(a.end_time).toISOString()}),i?.inputs!==void 0&&(a.inputs=lqe(i.inputs,"input")),await this.onChainError?.(a),await this._endTrace(a),a}_createRunForToolStart(e,r,n,o,i,a,s){let u=this._getExecutionOrder(o),l=Date.now(),c={id:n,name:s??e.id[e.id.length-1],parent_run_id:o,start_time:l,serialized:e,events:[{name:"start",time:new Date(l).toISOString()}],inputs:{input:r},execution_order:u,child_execution_order:u,run_type:"tool",child_runs:[],extra:a?{metadata:a}:{},tags:i||[]};return this._addRunToRunMap(c)}async handleToolStart(e,r,n,o,i,a,s){let u=this.getRunById(n)??this._createRunForToolStart(e,r,n,o,i,a,s);return await this.onRunCreate?.(u),await this.onToolStart?.(u),u}async handleToolEnd(e,r){let n=this.getRunById(r);if(!n||n?.run_type!=="tool")throw new Error("No tool run to end");return n.end_time=Date.now(),n.outputs={output:e},n.events.push({name:"end",time:new Date(n.end_time).toISOString()}),await this.onToolEnd?.(n),await this._endTrace(n),n}async handleToolError(e,r){let n=this.getRunById(r);if(!n||n?.run_type!=="tool")throw new Error("No tool run to end");return n.end_time=Date.now(),n.error=this.stringifyError(e),n.events.push({name:"error",time:new Date(n.end_time).toISOString()}),await this.onToolError?.(n),await this._endTrace(n),n}async handleAgentAction(e,r){let n=this.getRunById(r);if(!n||n?.run_type!=="chain")return;let o=n;o.actions=o.actions||[],o.actions.push(e),o.events.push({name:"agent_action",time:new Date().toISOString(),kwargs:{action:e}}),await this.onAgentAction?.(n)}async handleAgentEnd(e,r){let n=this.getRunById(r);!n||n?.run_type!=="chain"||(n.events.push({name:"agent_end",time:new Date().toISOString(),kwargs:{action:e}}),await this.onAgentEnd?.(n))}_createRunForRetrieverStart(e,r,n,o,i,a,s){let u=this._getExecutionOrder(o),l=Date.now(),c={id:n,name:s??e.id[e.id.length-1],parent_run_id:o,start_time:l,serialized:e,events:[{name:"start",time:new Date(l).toISOString()}],inputs:{query:r},execution_order:u,child_execution_order:u,run_type:"retriever",child_runs:[],extra:a?{metadata:a}:{},tags:i||[]};return this._addRunToRunMap(c)}async handleRetrieverStart(e,r,n,o,i,a,s){let u=this.getRunById(n)??this._createRunForRetrieverStart(e,r,n,o,i,a,s);return await this.onRunCreate?.(u),await this.onRetrieverStart?.(u),u}async handleRetrieverEnd(e,r){let n=this.getRunById(r);if(!n||n?.run_type!=="retriever")throw new Error("No retriever run to end");return n.end_time=Date.now(),n.outputs={documents:e},n.events.push({name:"end",time:new Date(n.end_time).toISOString()}),await this.onRetrieverEnd?.(n),await this._endTrace(n),n}async handleRetrieverError(e,r){let n=this.getRunById(r);if(!n||n?.run_type!=="retriever")throw new Error("No retriever run to end");return n.end_time=Date.now(),n.error=this.stringifyError(e),n.events.push({name:"error",time:new Date(n.end_time).toISOString()}),await this.onRetrieverError?.(n),await this._endTrace(n),n}async handleText(e,r){let n=this.getRunById(r);!n||n?.run_type!=="chain"||(n.events.push({name:"text",time:new Date().toISOString(),kwargs:{text:e}}),await this.onText?.(n))}async handleLLMNewToken(e,r,n,o,i,a){let s=this.getRunById(n);if(!s||s?.run_type!=="llm")throw new Error('Invalid "runId" provided to "handleLLMNewToken" callback.');return s.events.push({name:"new_token",time:new Date().toISOString(),kwargs:{token:e,idx:r,chunk:a?.chunk}}),await this.onLLMNewToken?.(s,e,{chunk:a?.chunk}),s}}});var Jxt=S((Dbi,Vxt)=>{"use strict";var zxt=(t=0)=>e=>`\x1B[${38+t};5;${e}m`,Hxt=(t=0)=>(e,r,n)=>`\x1B[${38+t};2;${e};${r};${n}m`;function Bcn(){let t=new Map,e={modifier:{reset:[0,0],bold:[1,22],dim:[2,22],italic:[3,23],underline:[4,24],overline:[53,55],inverse:[7,27],hidden:[8,28],strikethrough:[9,29]},color:{black:[30,39],red:[31,39],green:[32,39],yellow:[33,39],blue:[34,39],magenta:[35,39],cyan:[36,39],white:[37,39],blackBright:[90,39],redBright:[91,39],greenBright:[92,39],yellowBright:[93,39],blueBright:[94,39],magentaBright:[95,39],cyanBright:[96,39],whiteBright:[97,39]},bgColor:{bgBlack:[40,49],bgRed:[41,49],bgGreen:[42,49],bgYellow:[43,49],bgBlue:[44,49],bgMagenta:[45,49],bgCyan:[46,49],bgWhite:[47,49],bgBlackBright:[100,49],bgRedBright:[101,49],bgGreenBright:[102,49],bgYellowBright:[103,49],bgBlueBright:[104,49],bgMagentaBright:[105,49],bgCyanBright:[106,49],bgWhiteBright:[107,49]}};e.color.gray=e.color.blackBright,e.bgColor.bgGray=e.bgColor.bgBlackBright,e.color.grey=e.color.blackBright,e.bgColor.bgGrey=e.bgColor.bgBlackBright;for(let[r,n]of Object.entries(e)){for(let[o,i]of Object.entries(n))e[o]={open:`\x1B[${i[0]}m`,close:`\x1B[${i[1]}m`},n[o]=e[o],t.set(i[0],i[1]);Object.defineProperty(e,r,{value:n,enumerable:!1})}return Object.defineProperty(e,"codes",{value:t,enumerable:!1}),e.color.close="\x1B[39m",e.bgColor.close="\x1B[49m",e.color.ansi256=zxt(),e.color.ansi16m=Hxt(),e.bgColor.ansi256=zxt(10),e.bgColor.ansi16m=Hxt(10),Object.defineProperties(e,{rgbToAnsi256:{value:(r,n,o)=>r===n&&n===o?r<8?16:r>248?231:Math.round((r-8)/247*24)+232:16+36*Math.round(r/255*5)+6*Math.round(n/255*5)+Math.round(o/255*5),enumerable:!1},hexToRgb:{value:r=>{let n=/(?[a-f\d]{6}|[a-f\d]{3})/i.exec(r.toString(16));if(!n)return[0,0,0];let{colorString:o}=n.groups;o.length===3&&(o=o.split("").map(a=>a+a).join(""));let i=Number.parseInt(o,16);return[i>>16&255,i>>8&255,i&255]},enumerable:!1},hexToAnsi256:{value:r=>e.rgbToAnsi256(...e.hexToRgb(r)),enumerable:!1}}),e}Object.defineProperty(Vxt,"exports",{enumerable:!0,get:Bcn})});function Xy(t,e){return`${t.open}${e}${t.close}`}function Lw(t,e){try{return JSON.stringify(t,null,2)}catch{return e}}function Kxt(t){return typeof t=="string"?t.trim():t==null?t:Lw(t,t.toString())}function z$(t){if(!t.end_time)return"";let e=t.end_time-t.start_time;return e<1e3?`${e}ms`:`${(e/1e3).toFixed(2)}s`}var dqe,Ucn,Yb,Rpe,Wxt=v(()=>{Do();XU();dqe=L(Jxt(),1),Ucn={};Tt(Ucn,{ConsoleCallbackHandler:()=>Rpe});({color:Yb}=dqe.default),Rpe=class extends V0{constructor(){super(...arguments);M(this,"name","console_callback_handler")}persistRun(e){return Promise.resolve()}getParents(e){let r=[],n=e;for(;n.parent_run_id;){let o=this.runMap.get(n.parent_run_id);if(o)r.push(o),n=o;else break}return r}getBreadcrumbs(e){let n=[...this.getParents(e).reverse(),e].map((o,i,a)=>{let s=`${o.execution_order}:${o.run_type}:${o.name}`;return i===a.length-1?Xy(dqe.default.bold,s):s}).join(" > ");return Xy(Yb.grey,n)}onChainStart(e){let r=this.getBreadcrumbs(e);console.log(`${Xy(Yb.green,"[chain/start]")} [${r}] Entering Chain run with input: ${Lw(e.inputs,"[inputs]")}`)}onChainEnd(e){let r=this.getBreadcrumbs(e);console.log(`${Xy(Yb.cyan,"[chain/end]")} [${r}] [${z$(e)}] Exiting Chain run with output: ${Lw(e.outputs,"[outputs]")}`)}onChainError(e){let r=this.getBreadcrumbs(e);console.log(`${Xy(Yb.red,"[chain/error]")} [${r}] [${z$(e)}] Chain run errored with error: ${Lw(e.error,"[error]")}`)}onLLMStart(e){let r=this.getBreadcrumbs(e),n="prompts"in e.inputs?{prompts:e.inputs.prompts.map(o=>o.trim())}:e.inputs;console.log(`${Xy(Yb.green,"[llm/start]")} [${r}] Entering LLM run with input: ${Lw(n,"[inputs]")}`)}onLLMEnd(e){let r=this.getBreadcrumbs(e);console.log(`${Xy(Yb.cyan,"[llm/end]")} [${r}] [${z$(e)}] Exiting LLM run with output: ${Lw(e.outputs,"[response]")}`)}onLLMError(e){let r=this.getBreadcrumbs(e);console.log(`${Xy(Yb.red,"[llm/error]")} [${r}] [${z$(e)}] LLM run errored with error: ${Lw(e.error,"[error]")}`)}onToolStart(e){let r=this.getBreadcrumbs(e);console.log(`${Xy(Yb.green,"[tool/start]")} [${r}] Entering Tool run with input: "${Kxt(e.inputs.input)}"`)}onToolEnd(e){let r=this.getBreadcrumbs(e);console.log(`${Xy(Yb.cyan,"[tool/end]")} [${r}] [${z$(e)}] Exiting Tool run with output: "${Kxt(e.outputs?.output)}"`)}onToolError(e){let r=this.getBreadcrumbs(e);console.log(`${Xy(Yb.red,"[tool/error]")} [${r}] [${z$(e)}] Tool run errored with error: ${Lw(e.error,"[error]")}`)}onRetrieverStart(e){let r=this.getBreadcrumbs(e);console.log(`${Xy(Yb.green,"[retriever/start]")} [${r}] Entering Retriever run with input: ${Lw(e.inputs,"[inputs]")}`)}onRetrieverEnd(e){let r=this.getBreadcrumbs(e);console.log(`${Xy(Yb.cyan,"[retriever/end]")} [${r}] [${z$(e)}] Exiting Retriever run with output: ${Lw(e.outputs,"[outputs]")}`)}onRetrieverError(e){let r=this.getBreadcrumbs(e);console.log(`${Xy(Yb.red,"[retriever/error]")} [${r}] [${z$(e)}] Retriever run errored with error: ${Lw(e.error,"[error]")}`)}onAgentAction(e){let r=e,n=this.getBreadcrumbs(e);console.log(`${Xy(Yb.blue,"[agent/action]")} [${n}] Agent selected action: ${Lw(r.actions[r.actions.length-1],"[action]")}`)}}});var Ape=v(()=>{Yfe()});var fqe,Ipe,pqe=v(()=>{Yu();Ape();Ipe=()=>{if(fqe===void 0){let t=dn("LANGCHAIN_CALLBACKS_BACKGROUND")==="false"?{blockOnRootRunFinalization:!0}:{};fqe=new KU(t)}return fqe}});function Gxt(t=!1){let e=Hcn.getInstance().getStore();if(!t&&e===void 0)throw new Error(`Could not get the current run tree. + +Please make sure you are calling this method within a traceable function and that tracing is enabled.`);return e}function Npe(t){return typeof t=="function"&&"langsmith:traceable"in t}var hqe,mqe,zcn,gqe,Hcn,Jbi,Zxt=v(()=>{hqe=class{getStore(){}run(e,r){return r()}},mqe=Symbol.for("ls:tracing_async_local_storage"),zcn=new hqe,gqe=class{getInstance(){return globalThis[mqe]??zcn}initializeGlobalInstance(e){globalThis[mqe]===void 0&&(globalThis[mqe]=e)}},Hcn=new gqe;Jbi=Symbol.for("langsmith:traceable:root")});var yqe=v(()=>{Zxt()});var Vcn,$Y,Yxt=v(()=>{Do();XU();pqe();yqe();Mpe();Ape();Vcn={};Tt(Vcn,{LangChainTracer:()=>$Y});$Y=class Xxt extends V0{constructor(r={}){super(r);M(this,"name","langchain_tracer");M(this,"projectName");M(this,"exampleId");M(this,"client");M(this,"replicas");M(this,"usesRunTreeMap",!0);let{exampleId:n,projectName:o,client:i,replicas:a}=r;this.projectName=o??OY(),this.replicas=a,this.exampleId=n,this.client=i??Ipe();let s=Xxt.getTraceableRunTree();s&&this.updateFromRunTree(s)}async persistRun(r){}async onRunCreate(r){await this.getRunTreeWithTracingConfig(r.id)?.postRun()}async onRunUpdate(r){await this.getRunTreeWithTracingConfig(r.id)?.patchRun()}getRun(r){return this.runTreeMap.get(r)}updateFromRunTree(r){this.runTreeMap.set(r.id,r);let n=r,o=new Set;for(;n.parent_run&&!(o.has(n.id)||(o.add(n.id),!n.parent_run));)n=n.parent_run;o.clear();let i=[n];for(;i.length>0;){let a=i.shift();!a||o.has(a.id)||(o.add(a.id),this.runTreeMap.set(a.id,a),a.child_runs&&i.push(...a.child_runs))}this.client=r.client??this.client,this.replicas=r.replicas??this.replicas,this.projectName=r.project_name??this.projectName,this.exampleId=r.reference_example_id??this.exampleId}getRunTreeWithTracingConfig(r){let n=this.runTreeMap.get(r);if(n)return new H0({...n,client:this.client,project_name:this.projectName,replicas:this.replicas,reference_example_id:this.exampleId,tracingEnabled:!0})}static getTraceableRunTree(){try{return Gxt(!0)}catch{return}}}});var eOt=S((o_i,Dpe)=>{"use strict";var Jcn=Mke(),jpe=class extends Error{constructor(e){super(e),this.name="TimeoutError"}},Qxt=(t,e,r)=>new Promise((n,o)=>{if(typeof e!="number"||e<0)throw new TypeError("Expected `milliseconds` to be a positive number");if(e===1/0){n(t);return}let i=setTimeout(()=>{if(typeof r=="function"){try{n(r())}catch(u){o(u)}return}let a=typeof r=="string"?r:`Promise timed out after ${e} milliseconds`,s=r instanceof Error?r:new jpe(a);typeof t.cancel=="function"&&t.cancel(),o(s)},e);Jcn(t.then(n,o),()=>{clearTimeout(i)})});Dpe.exports=Qxt;Dpe.exports.default=Qxt;Dpe.exports.TimeoutError=jpe});var tOt=S(bqe=>{"use strict";Object.defineProperty(bqe,"__esModule",{value:!0});function Kcn(t,e,r){let n=0,o=t.length;for(;o>0;){let i=o/2|0,a=n+i;r(t[a],e)<=0?(n=++a,o-=i+1):o=i}return n}bqe.default=Kcn});var rOt=S(vqe=>{"use strict";Object.defineProperty(vqe,"__esModule",{value:!0});var Wcn=tOt(),_qe=class{constructor(){this._queue=[]}enqueue(e,r){r=Object.assign({priority:0},r);let n={priority:r.priority,run:e};if(this.size&&this._queue[this.size-1].priority>=r.priority){this._queue.push(n);return}let o=Wcn.default(this._queue,n,(i,a)=>a.priority-i.priority);this._queue.splice(o,0,n)}dequeue(){let e=this._queue.shift();return e?.run}filter(e){return this._queue.filter(r=>r.priority===e.priority).map(r=>r.run)}get size(){return this._queue.length}};vqe.default=_qe});var Cqe=S(Sqe=>{"use strict";Object.defineProperty(Sqe,"__esModule",{value:!0});var Gcn=Pke(),nOt=eOt(),Zcn=rOt(),$pe=()=>{},Xcn=new nOt.TimeoutError,wqe=class extends Gcn{constructor(e){var r,n,o,i;if(super(),this._intervalCount=0,this._intervalEnd=0,this._pendingCount=0,this._resolveEmpty=$pe,this._resolveIdle=$pe,e=Object.assign({carryoverConcurrencyCount:!1,intervalCap:1/0,interval:0,concurrency:1/0,autoStart:!0,queueClass:Zcn.default},e),!(typeof e.intervalCap=="number"&&e.intervalCap>=1))throw new TypeError(`Expected \`intervalCap\` to be a number from 1 and up, got \`${(n=(r=e.intervalCap)===null||r===void 0?void 0:r.toString())!==null&&n!==void 0?n:""}\` (${typeof e.intervalCap})`);if(e.interval===void 0||!(Number.isFinite(e.interval)&&e.interval>=0))throw new TypeError(`Expected \`interval\` to be a finite number >= 0, got \`${(i=(o=e.interval)===null||o===void 0?void 0:o.toString())!==null&&i!==void 0?i:""}\` (${typeof e.interval})`);this._carryoverConcurrencyCount=e.carryoverConcurrencyCount,this._isIntervalIgnored=e.intervalCap===1/0||e.interval===0,this._intervalCap=e.intervalCap,this._interval=e.interval,this._queue=new e.queueClass,this._queueClass=e.queueClass,this.concurrency=e.concurrency,this._timeout=e.timeout,this._throwOnTimeout=e.throwOnTimeout===!0,this._isPaused=e.autoStart===!1}get _doesIntervalAllowAnother(){return this._isIntervalIgnored||this._intervalCount{this._onResumeInterval()},r)),!0}return!1}_tryToStartAnother(){if(this._queue.size===0)return this._intervalId&&clearInterval(this._intervalId),this._intervalId=void 0,this._resolvePromises(),!1;if(!this._isPaused){let e=!this._isIntervalPaused();if(this._doesIntervalAllowAnother&&this._doesConcurrentAllowAnother){let r=this._queue.dequeue();return r?(this.emit("active"),r(),e&&this._initializeIntervalIfNeeded(),!0):!1}}return!1}_initializeIntervalIfNeeded(){this._isIntervalIgnored||this._intervalId!==void 0||(this._intervalId=setInterval(()=>{this._onInterval()},this._interval),this._intervalEnd=Date.now()+this._interval)}_onInterval(){this._intervalCount===0&&this._pendingCount===0&&this._intervalId&&(clearInterval(this._intervalId),this._intervalId=void 0),this._intervalCount=this._carryoverConcurrencyCount?this._pendingCount:0,this._processQueue()}_processQueue(){for(;this._tryToStartAnother(););}get concurrency(){return this._concurrency}set concurrency(e){if(!(typeof e=="number"&&e>=1))throw new TypeError(`Expected \`concurrency\` to be a number from 1 and up, got \`${e}\` (${typeof e})`);this._concurrency=e,this._processQueue()}async add(e,r={}){return new Promise((n,o)=>{let i=async()=>{this._pendingCount++,this._intervalCount++;try{let a=this._timeout===void 0&&r.timeout===void 0?e():nOt.default(Promise.resolve(e()),r.timeout===void 0?this._timeout:r.timeout,()=>{(r.throwOnTimeout===void 0?this._throwOnTimeout:r.throwOnTimeout)&&o(Xcn)});n(await a)}catch(a){o(a)}this._next()};this._queue.enqueue(i,r),this._tryToStartAnother(),this.emit("add")})}async addAll(e,r){return Promise.all(e.map(async n=>this.add(n,r)))}start(){return this._isPaused?(this._isPaused=!1,this._processQueue(),this):this}pause(){this._isPaused=!0}clear(){this._queue=new this._queueClass}async onEmpty(){if(this._queue.size!==0)return new Promise(e=>{let r=this._resolveEmpty;this._resolveEmpty=()=>{r(),e()}})}async onIdle(){if(!(this._pendingCount===0&&this._queue.size===0))return new Promise(e=>{let r=this._resolveIdle;this._resolveIdle=()=>{r(),e()}})}get size(){return this._queue.size}sizeBy(e){return this._queue.filter(e).length}get pending(){return this._pendingCount}get isPaused(){return this._isPaused}get timeout(){return this._timeout}set timeout(e){this._timeout=e}};Sqe.default=wqe});function Ycn(){let t="default"in Lpe.default?Lpe.default.default:Lpe.default;return new t({autoStart:!0,concurrency:1})}function Qcn(){return typeof YU>"u"&&(YU=Ycn()),YU}async function wc(t,e){if(e===!0){let r=B$();r!==void 0?await r.run(void 0,async()=>t()):await t()}else YU=Qcn(),YU.add(async()=>{let r=B$();r!==void 0?await r.run(void 0,async()=>t()):await t()})}async function oOt(){let t=Ipe();await Promise.allSettled([typeof YU<"u"?YU.onIdle():Promise.resolve(),t.awaitPendingTraceBatches()])}var Lpe,YU,xqe=v(()=>{pqe();fY();Lpe=L(Cqe(),1)});var edn,iOt=v(()=>{Do();xqe();edn={};Tt(edn,{awaitAllCallbacks:()=>oOt,consumeCallback:()=>wc})});var aOt,sOt=v(()=>{Yu();aOt=t=>t!==void 0?t:!!["LANGSMITH_TRACING_V2","LANGCHAIN_TRACING_V2","LANGSMITH_TRACING","LANGCHAIN_TRACING"].find(r=>dn(r)==="true")});function Oqe(t){let e=B$();return e===void 0?void 0:e.getStore()?.[q$]?.[t]}var tdn,uOt,lOt=v(()=>{fY();Mpe();tdn=Symbol("lc:configure_hooks"),uOt=()=>Oqe(tdn)||[]});function aN(t){return t?Array.isArray(t)||"name"in t?{callbacks:t}:t:{}}function n6(t){return"name"in t?t:JU.fromMethods(t)}var rdn,cOt,FY,dOt,Tqe,fOt,pOt,Gl,H$=v(()=>{Do();iO();Yu();xY();XU();Wxt();Yxt();xqe();iOt();sOt();lOt();SY();rdn={};Tt(rdn,{BaseCallbackManager:()=>cOt,BaseRunManager:()=>FY,CallbackManager:()=>Gl,CallbackManagerForChainRun:()=>fOt,CallbackManagerForLLMRun:()=>Tqe,CallbackManagerForRetrieverRun:()=>dOt,CallbackManagerForToolRun:()=>pOt,ensureHandler:()=>n6,parseCallbackConfigArg:()=>aN});cOt=class{setHandler(t){return this.setHandlers([t])}},FY=class{constructor(t,e,r,n,o,i,a,s){this.runId=t,this.handlers=e,this.inheritableHandlers=r,this.tags=n,this.inheritableTags=o,this.metadata=i,this.inheritableMetadata=a,this._parentRunId=s}get parentRunId(){return this._parentRunId}async handleText(t){await Promise.all(this.handlers.map(e=>wc(async()=>{try{await e.handleText?.(t,this.runId,this._parentRunId,this.tags)}catch(r){if((e.raiseError?console.error:console.warn)(`Error in handler ${e.constructor.name}, handleText: ${r}`),e.raiseError)throw r}},e.awaitHandlers)))}async handleCustomEvent(t,e,r,n,o){await Promise.all(this.handlers.map(i=>wc(async()=>{try{await i.handleCustomEvent?.(t,e,this.runId,this.tags,this.metadata)}catch(a){if((i.raiseError?console.error:console.warn)(`Error in handler ${i.constructor.name}, handleCustomEvent: ${a}`),i.raiseError)throw a}},i.awaitHandlers)))}},dOt=class extends FY{getChild(t){let e=new Gl(this.runId);return e.setHandlers(this.inheritableHandlers),e.addTags(this.inheritableTags),e.addMetadata(this.inheritableMetadata),t&&e.addTags([t],!1),e}async handleRetrieverEnd(t){await Promise.all(this.handlers.map(e=>wc(async()=>{if(!e.ignoreRetriever)try{await e.handleRetrieverEnd?.(t,this.runId,this._parentRunId,this.tags)}catch(r){if((e.raiseError?console.error:console.warn)(`Error in handler ${e.constructor.name}, handleRetriever`),e.raiseError)throw r}},e.awaitHandlers)))}async handleRetrieverError(t){await Promise.all(this.handlers.map(e=>wc(async()=>{if(!e.ignoreRetriever)try{await e.handleRetrieverError?.(t,this.runId,this._parentRunId,this.tags)}catch(r){if((e.raiseError?console.error:console.warn)(`Error in handler ${e.constructor.name}, handleRetrieverError: ${r}`),e.raiseError)throw t}},e.awaitHandlers)))}},Tqe=class extends FY{async handleLLMNewToken(t,e,r,n,o,i){await Promise.all(this.handlers.map(a=>wc(async()=>{if(!a.ignoreLLM)try{await a.handleLLMNewToken?.(t,e??{prompt:0,completion:0},this.runId,this._parentRunId,this.tags,i)}catch(s){if((a.raiseError?console.error:console.warn)(`Error in handler ${a.constructor.name}, handleLLMNewToken: ${s}`),a.raiseError)throw s}},a.awaitHandlers)))}async handleLLMError(t,e,r,n,o){await Promise.all(this.handlers.map(i=>wc(async()=>{if(!i.ignoreLLM)try{await i.handleLLMError?.(t,this.runId,this._parentRunId,this.tags,o)}catch(a){if((i.raiseError?console.error:console.warn)(`Error in handler ${i.constructor.name}, handleLLMError: ${a}`),i.raiseError)throw a}},i.awaitHandlers)))}async handleLLMEnd(t,e,r,n,o){await Promise.all(this.handlers.map(i=>wc(async()=>{if(!i.ignoreLLM)try{await i.handleLLMEnd?.(t,this.runId,this._parentRunId,this.tags,o)}catch(a){if((i.raiseError?console.error:console.warn)(`Error in handler ${i.constructor.name}, handleLLMEnd: ${a}`),i.raiseError)throw a}},i.awaitHandlers)))}},fOt=class extends FY{getChild(t){let e=new Gl(this.runId);return e.setHandlers(this.inheritableHandlers),e.addTags(this.inheritableTags),e.addMetadata(this.inheritableMetadata),t&&e.addTags([t],!1),e}async handleChainError(t,e,r,n,o){await Promise.all(this.handlers.map(i=>wc(async()=>{if(!i.ignoreChain)try{await i.handleChainError?.(t,this.runId,this._parentRunId,this.tags,o)}catch(a){if((i.raiseError?console.error:console.warn)(`Error in handler ${i.constructor.name}, handleChainError: ${a}`),i.raiseError)throw a}},i.awaitHandlers)))}async handleChainEnd(t,e,r,n,o){await Promise.all(this.handlers.map(i=>wc(async()=>{if(!i.ignoreChain)try{await i.handleChainEnd?.(t,this.runId,this._parentRunId,this.tags,o)}catch(a){if((i.raiseError?console.error:console.warn)(`Error in handler ${i.constructor.name}, handleChainEnd: ${a}`),i.raiseError)throw a}},i.awaitHandlers)))}async handleAgentAction(t){await Promise.all(this.handlers.map(e=>wc(async()=>{if(!e.ignoreAgent)try{await e.handleAgentAction?.(t,this.runId,this._parentRunId,this.tags)}catch(r){if((e.raiseError?console.error:console.warn)(`Error in handler ${e.constructor.name}, handleAgentAction: ${r}`),e.raiseError)throw r}},e.awaitHandlers)))}async handleAgentEnd(t){await Promise.all(this.handlers.map(e=>wc(async()=>{if(!e.ignoreAgent)try{await e.handleAgentEnd?.(t,this.runId,this._parentRunId,this.tags)}catch(r){if((e.raiseError?console.error:console.warn)(`Error in handler ${e.constructor.name}, handleAgentEnd: ${r}`),e.raiseError)throw r}},e.awaitHandlers)))}},pOt=class extends FY{getChild(t){let e=new Gl(this.runId);return e.setHandlers(this.inheritableHandlers),e.addTags(this.inheritableTags),e.addMetadata(this.inheritableMetadata),t&&e.addTags([t],!1),e}async handleToolError(t){await Promise.all(this.handlers.map(e=>wc(async()=>{if(!e.ignoreAgent)try{await e.handleToolError?.(t,this.runId,this._parentRunId,this.tags)}catch(r){if((e.raiseError?console.error:console.warn)(`Error in handler ${e.constructor.name}, handleToolError: ${r}`),e.raiseError)throw r}},e.awaitHandlers)))}async handleToolEnd(t){await Promise.all(this.handlers.map(e=>wc(async()=>{if(!e.ignoreAgent)try{await e.handleToolEnd?.(t,this.runId,this._parentRunId,this.tags)}catch(r){if((e.raiseError?console.error:console.warn)(`Error in handler ${e.constructor.name}, handleToolEnd: ${r}`),e.raiseError)throw r}},e.awaitHandlers)))}},Gl=class LY extends cOt{constructor(r,n){super();M(this,"handlers",[]);M(this,"inheritableHandlers",[]);M(this,"tags",[]);M(this,"inheritableTags",[]);M(this,"metadata",{});M(this,"inheritableMetadata",{});M(this,"name","callback_manager");M(this,"_parentRunId");this.handlers=n?.handlers??this.handlers,this.inheritableHandlers=n?.inheritableHandlers??this.inheritableHandlers,this.tags=n?.tags??this.tags,this.inheritableTags=n?.inheritableTags??this.inheritableTags,this.metadata=n?.metadata??this.metadata,this.inheritableMetadata=n?.inheritableMetadata??this.inheritableMetadata,this._parentRunId=r}getParentRunId(){return this._parentRunId}async handleLLMStart(r,n,o=void 0,i=void 0,a=void 0,s=void 0,u=void 0,l=void 0){return Promise.all(n.map(async(c,d)=>{let f=d===0&&o?o:Zb();return await Promise.all(this.handlers.map(p=>{if(!p.ignoreLLM)return ZU(p)&&p._createRunForLLMStart(r,[c],f,this._parentRunId,a,this.tags,this.metadata,l),wc(async()=>{try{await p.handleLLMStart?.(r,[c],f,this._parentRunId,a,this.tags,this.metadata,l)}catch(m){if((p.raiseError?console.error:console.warn)(`Error in handler ${p.constructor.name}, handleLLMStart: ${m}`),p.raiseError)throw m}},p.awaitHandlers)})),new Tqe(f,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}))}async handleChatModelStart(r,n,o=void 0,i=void 0,a=void 0,s=void 0,u=void 0,l=void 0){return Promise.all(n.map(async(c,d)=>{let f=d===0&&o?o:Zb();return await Promise.all(this.handlers.map(p=>{if(!p.ignoreLLM)return ZU(p)&&p._createRunForChatModelStart(r,[c],f,this._parentRunId,a,this.tags,this.metadata,l),wc(async()=>{try{if(p.handleChatModelStart)await p.handleChatModelStart?.(r,[c],f,this._parentRunId,a,this.tags,this.metadata,l);else if(p.handleLLMStart){let m=Xu(c);await p.handleLLMStart?.(r,[m],f,this._parentRunId,a,this.tags,this.metadata,l)}}catch(m){if((p.raiseError?console.error:console.warn)(`Error in handler ${p.constructor.name}, handleLLMStart: ${m}`),p.raiseError)throw m}},p.awaitHandlers)})),new Tqe(f,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}))}async handleChainStart(r,n,o=Zb(),i=void 0,a=void 0,s=void 0,u=void 0){return await Promise.all(this.handlers.map(l=>{if(!l.ignoreChain)return ZU(l)&&l._createRunForChainStart(r,n,o,this._parentRunId,this.tags,this.metadata,i,u),wc(async()=>{try{await l.handleChainStart?.(r,n,o,this._parentRunId,this.tags,this.metadata,i,u)}catch(c){if((l.raiseError?console.error:console.warn)(`Error in handler ${l.constructor.name}, handleChainStart: ${c}`),l.raiseError)throw c}},l.awaitHandlers)})),new fOt(o,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}async handleToolStart(r,n,o=Zb(),i=void 0,a=void 0,s=void 0,u=void 0){return await Promise.all(this.handlers.map(l=>{if(!l.ignoreAgent)return ZU(l)&&l._createRunForToolStart(r,n,o,this._parentRunId,this.tags,this.metadata,u),wc(async()=>{try{await l.handleToolStart?.(r,n,o,this._parentRunId,this.tags,this.metadata,u)}catch(c){if((l.raiseError?console.error:console.warn)(`Error in handler ${l.constructor.name}, handleToolStart: ${c}`),l.raiseError)throw c}},l.awaitHandlers)})),new pOt(o,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}async handleRetrieverStart(r,n,o=Zb(),i=void 0,a=void 0,s=void 0,u=void 0){return await Promise.all(this.handlers.map(l=>{if(!l.ignoreRetriever)return ZU(l)&&l._createRunForRetrieverStart(r,n,o,this._parentRunId,this.tags,this.metadata,u),wc(async()=>{try{await l.handleRetrieverStart?.(r,n,o,this._parentRunId,this.tags,this.metadata,u)}catch(c){if((l.raiseError?console.error:console.warn)(`Error in handler ${l.constructor.name}, handleRetrieverStart: ${c}`),l.raiseError)throw c}},l.awaitHandlers)})),new dOt(o,this.handlers,this.inheritableHandlers,this.tags,this.inheritableTags,this.metadata,this.inheritableMetadata,this._parentRunId)}async handleCustomEvent(r,n,o,i,a){await Promise.all(this.handlers.map(s=>wc(async()=>{if(!s.ignoreCustomEvent)try{await s.handleCustomEvent?.(r,n,o,this.tags,this.metadata)}catch(u){if((s.raiseError?console.error:console.warn)(`Error in handler ${s.constructor.name}, handleCustomEvent: ${u}`),s.raiseError)throw u}},s.awaitHandlers)))}addHandler(r,n=!0){this.handlers.push(r),n&&this.inheritableHandlers.push(r)}removeHandler(r){this.handlers=this.handlers.filter(n=>n!==r),this.inheritableHandlers=this.inheritableHandlers.filter(n=>n!==r)}setHandlers(r,n=!0){this.handlers=[],this.inheritableHandlers=[];for(let o of r)this.addHandler(o,n)}addTags(r,n=!0){this.removeTags(r),this.tags.push(...r),n&&this.inheritableTags.push(...r)}removeTags(r){this.tags=this.tags.filter(n=>!r.includes(n)),this.inheritableTags=this.inheritableTags.filter(n=>!r.includes(n))}addMetadata(r,n=!0){this.metadata={...this.metadata,...r},n&&(this.inheritableMetadata={...this.inheritableMetadata,...r})}removeMetadata(r){for(let n of Object.keys(r))delete this.metadata[n],delete this.inheritableMetadata[n]}copy(r=[],n=!0){let o=new LY(this._parentRunId);for(let i of this.handlers){let a=this.inheritableHandlers.includes(i);o.addHandler(i,a)}for(let i of this.tags){let a=this.inheritableTags.includes(i);o.addTags([i],a)}for(let i of Object.keys(this.metadata)){let a=Object.keys(this.inheritableMetadata).includes(i);o.addMetadata({[i]:this.metadata[i]},a)}for(let i of r)o.handlers.filter(a=>a.name==="console_callback_handler").some(a=>a.name===i.name)||o.addHandler(i,n);return o}static fromHandlers(r){class n extends JU{constructor(){super();M(this,"name",Zb());Object.assign(this,r)}}let o=new this;return o.addHandler(new n),o}static configure(r,n,o,i,a,s,u){return this._configureSync(r,n,o,i,a,s,u)}static _configureSync(r,n,o,i,a,s,u){let l;(r||n)&&(Array.isArray(r)||!r?(l=new LY,l.setHandlers(r?.map(n6)??[],!0)):l=r,l=l.copy(Array.isArray(n)?n.map(n6):n?.handlers,!1));let c=dn("LANGCHAIN_VERBOSE")==="true"||u?.verbose,d=$Y.getTraceableRunTree()?.tracingEnabled||aOt(),f=d||(dn("LANGCHAIN_TRACING")??!1);if(c||f){if(l||(l=new LY),c&&!l.handlers.some(p=>p.name===Rpe.prototype.name)){let p=new Rpe;l.addHandler(p,!0)}if(f&&!l.handlers.some(p=>p.name==="langchain_tracer")&&d){let p=new $Y;l.addHandler(p,!0)}if(d){let p=$Y.getTraceableRunTree();p&&l._parentRunId===void 0&&(l._parentRunId=p.id,l.handlers.find(h=>h.name==="langchain_tracer")?.updateFromRunTree(p))}}for(let{contextVar:p,inheritable:m=!0,handlerClass:h,envVar:g}of uOt()){let y=g&&dn(g)==="true"&&h,b,_=p!==void 0?Oqe(p):void 0;_&&QFe(_)?b=_:y&&(b=new h({})),b!==void 0&&(l||(l=new LY),l.handlers.some(w=>w.name===b.name)||l.addHandler(b,m))}return(o||i)&&l&&(l.addTags(o??[]),l.addTags(i??[],!1)),(a||s)&&l&&(l.addMetadata(a??{}),l.addMetadata(s??{},!1)),l}}});var Eqe,ndn,mOt,odn,rh,QU=v(()=>{fY();H$();Ape();Eqe=class{getStore(){}run(t,e){return e()}enterWith(t){}},ndn=new Eqe,mOt=Symbol.for("lc:child_config"),odn=class{getInstance(){return B$()??ndn}getRunnableConfig(){return this.getInstance().getStore()?.extra?.[mOt]}runWithConfig(t,e,r){let n=Gl._configureSync(t?.callbacks,void 0,t?.tags,void 0,t?.metadata),o=this.getInstance(),i=o.getStore(),a=n?.getParentRunId(),s=n?.handlers?.find(l=>l?.name==="langchain_tracer"),u;return s&&a?u=s.getRunTreeWithTracingConfig(a):r||(u=new H0({name:"",tracingEnabled:!1})),u&&(u.extra={...u.extra,[mOt]:t}),i!==void 0&&i[q$]!==void 0&&(u===void 0&&(u={}),u[q$]=i[q$]),o.run(u,e)}initializeGlobalInstance(t){B$()===void 0&&Pwt(t)}},rh=new odn});var idn,ez=v(()=>{Do();fY();QU();idn={};Tt(idn,{AsyncLocalStorageProviderSingleton:()=>rh,MockAsyncLocalStorage:()=>Eqe,_CONTEXT_VARIABLES_KEY:()=>q$})});async function Qg(t){return Gl._configureSync(t?.callbacks,void 0,t?.tags,void 0,t?.metadata)}function tz(...t){let e={};for(let r of t.filter(n=>!!n))for(let n of Object.keys(r))if(n==="metadata")e[n]={...e[n],...r[n]};else if(n==="tags"){let o=e[n]??[];e[n]=[...new Set(o.concat(r[n]??[]))]}else if(n==="configurable")e[n]={...e[n],...r[n]};else if(n==="timeout")e.timeout===void 0?e.timeout=r.timeout:r.timeout!==void 0&&(e.timeout=Math.min(e.timeout,r.timeout));else if(n==="signal")e.signal===void 0?e.signal=r.signal:r.signal!==void 0&&("any"in AbortSignal?e.signal=AbortSignal.any([e.signal,r.signal]):e.signal=r.signal);else if(n==="callbacks"){let o=e.callbacks,i=r.callbacks;if(Array.isArray(i))if(!o)e.callbacks=i;else if(Array.isArray(o))e.callbacks=o.concat(i);else{let a=o.copy();for(let s of i)a.addHandler(n6(s),!0);e.callbacks=a}else if(i)if(!o)e.callbacks=i;else if(Array.isArray(o)){let a=i.copy();for(let s of o)a.addHandler(n6(s),!0);e.callbacks=a}else e.callbacks=new Gl(i._parentRunId,{handlers:o.handlers.concat(i.handlers),inheritableHandlers:o.inheritableHandlers.concat(i.inheritableHandlers),tags:Array.from(new Set(o.tags.concat(i.tags))),inheritableTags:Array.from(new Set(o.inheritableTags.concat(i.inheritableTags))),metadata:{...o.metadata,...i.metadata}})}else{let o=n;e[o]=r[o]??e[o]}return e}function Jo(t){let e=rh.getRunnableConfig(),r={tags:[],metadata:{},recursionLimit:25,runId:void 0};if(e){let{runId:n,runName:o,...i}=e;r=Object.entries(i).reduce((a,[s,u])=>(u!==void 0&&(a[s]=u),a),r)}if(t&&(r=Object.entries(t).reduce((n,[o,i])=>(i!==void 0&&(n[o]=i),n),r)),r?.configurable)for(let n of Object.keys(r.configurable))adn.has(typeof r.configurable[n])&&!r.metadata?.[n]&&(r.metadata||(r.metadata={}),r.metadata[n]=r.configurable[n]);if(r.timeout!==void 0){if(r.timeout<=0)throw new Error("Timeout must be a positive number");let n=AbortSignal.timeout(r.timeout);r.signal!==void 0?"any"in AbortSignal&&(r.signal=AbortSignal.any([r.signal,n])):r.signal=n,delete r.timeout}return r}function Bs(t={},{callbacks:e,maxConcurrency:r,recursionLimit:n,runName:o,configurable:i,runId:a}={}){let s=Jo(t);return e!==void 0&&(delete s.runName,s.callbacks=e),n!==void 0&&(s.recursionLimit=n),r!==void 0&&(s.maxConcurrency=r),o!==void 0&&(s.runName=o),i!==void 0&&(s.configurable={...s.configurable,...i}),a!==void 0&&delete s.runId,s}function Yy(t){return t?{configurable:t.configurable,recursionLimit:t.recursionLimit,callbacks:t.callbacks,tags:t.tags,metadata:t.metadata,maxConcurrency:t.maxConcurrency,timeout:t.timeout,signal:t.signal}:void 0}var Fpe,adn,uO=v(()=>{H$();QU();ez();Fpe=25;adn=new Set(["string","number","boolean"])});async function lO(t,e){if(e===void 0)return t;let r;return Promise.race([t.catch(n=>{if(!e?.aborted)throw n}),new Promise((n,o)=>{r=()=>{o(V$(e))},e.addEventListener("abort",r),e.aborted&&o(V$(e))})]).finally(()=>e.removeEventListener("abort",r))}function V$(t){return t?.reason instanceof Error?t.reason:typeof t?.reason=="string"?new Error(t.reason):new Error("Aborted")}var kY=v(()=>{});function kpe(t,e=2){let r=Array.from({length:e},()=>[]);return r.map(async function*(o){for(;;)if(o.length===0){let i=await t.next();for(let a of r)a.push(i)}else{if(o[0].done)return;yield o.shift().value}})}function eb(t,e){if(Array.isArray(t)&&Array.isArray(e))return t.concat(e);if(typeof t=="string"&&typeof e=="string")return t+e;if(typeof t=="number"&&typeof e=="number")return t+e;if("concat"in t&&typeof t.concat=="function")return t.concat(e);if(typeof t=="object"&&typeof e=="object"){let r={...t};for(let[n,o]of Object.entries(e))n in r&&!Array.isArray(r[n])?r[n]=eb(r[n],o):r[n]=o;return r}else throw new Error(`Cannot concat ${typeof t} and ${typeof e}`)}async function Mqe(t,e,r,n,...o){let i=new J$({generator:e,startSetup:r,signal:n}),a=await i.setup;return{output:t(i,a,...o),setup:a}}var sdn,Qy,J$,cO=v(()=>{Do();QU();ez();uO();kY();sdn={};Tt(sdn,{AsyncGeneratorWithSetup:()=>J$,IterableReadableStream:()=>Qy,atee:()=>kpe,concat:()=>eb,pipeGeneratorWithSetup:()=>Mqe});Qy=class Pqe extends ReadableStream{constructor(){super(...arguments);M(this,"reader")}ensureReader(){this.reader||(this.reader=this.getReader())}async next(){this.ensureReader();try{let r=await this.reader.read();return r.done?(this.reader.releaseLock(),{done:!0,value:void 0}):{done:!1,value:r.value}}catch(r){throw this.reader.releaseLock(),r}}async return(){if(this.ensureReader(),this.locked){let r=this.reader.cancel();this.reader.releaseLock(),await r}return{done:!0,value:void 0}}async throw(r){if(this.ensureReader(),this.locked){let n=this.reader.cancel();this.reader.releaseLock(),await n}throw r}[Symbol.asyncIterator](){return this}async[Symbol.asyncDispose](){await this.return()}static fromReadableStream(r){let n=r.getReader();return new Pqe({start(o){return i();function i(){return n.read().then(({done:a,value:s})=>{if(a){o.close();return}return o.enqueue(s),i()})}},cancel(){n.releaseLock()}})}static fromAsyncGenerator(r){return new Pqe({async pull(n){let{value:o,done:i}=await r.next();i&&n.close(),n.enqueue(o)},async cancel(n){await r.return(n)}})}};J$=class{constructor(t){M(this,"generator");M(this,"setup");M(this,"config");M(this,"signal");M(this,"firstResult");M(this,"firstResultUsed",!1);this.generator=t.generator,this.config=t.config,this.signal=t.signal??this.config?.signal,this.setup=new Promise((e,r)=>{rh.runWithConfig(Yy(t.config),async()=>{this.firstResult=t.generator.next(),t.startSetup?this.firstResult.then(t.startSetup).then(e,r):this.firstResult.then(n=>e(void 0),r)},!0)})}async next(...t){return this.signal?.throwIfAborted(),this.firstResultUsed?rh.runWithConfig(Yy(this.config),this.signal?async()=>lO(this.generator.next(...t),this.signal):async()=>this.generator.next(...t),!0):(this.firstResultUsed=!0,this.firstResult)}async return(t){return this.generator.return(t)}async throw(t){return this.generator.throw(t)}[Symbol.asyncIterator](){return this}async[Symbol.asyncDispose](){await this.return()}}});function Bpe(t,e){return udn.call(t,e)}function Upe(t){if(Array.isArray(t)){let r=new Array(t.length);for(let n=0;n=48&&n<=57){e++;continue}return!1}return!0}function sN(t){return t.indexOf("/")===-1&&t.indexOf("~")===-1?t:t.replace(/~/g,"~0").replace(/\//g,"~1")}function Hpe(t){return t.replace(/~1/g,"/").replace(/~0/g,"~")}function qpe(t){if(t===void 0)return!0;if(t){if(Array.isArray(t)){for(let r=0,n=t.length;r{udn=Object.prototype.hasOwnProperty;Vpe=class extends Error{constructor(t,e,r,n,o){super(hOt(t,{name:e,index:r,operation:n,tree:o})),this.name=e,this.index=r,this.operation=n,this.tree=o,Object.setPrototypeOf(this,new.target.prototype),this.message=hOt(t,{name:e,index:r,operation:n,tree:o})}}});function Kpe(t,e){if(e=="")return t;var r={op:"_get",path:e};return rz(t,r),r.value}function rz(t,e,r=!1,n=!0,o=!0,i=0){if(r&&(typeof r=="function"?r(e,0,t,e.path):Wpe(e,0)),e.path===""){let a={newDocument:t};if(e.op==="add")return a.newDocument=e.value,a;if(e.op==="replace")return a.newDocument=e.value,a.removed=t,a;if(e.op==="move"||e.op==="copy")return a.newDocument=Kpe(t,e.from),e.op==="move"&&(a.removed=t),a;if(e.op==="test"){if(a.test=qY(t,e.value),a.test===!1)throw new Sc("Test operation failed","TEST_OPERATION_FAILED",i,e,t);return a.newDocument=t,a}else{if(e.op==="remove")return a.removed=t,a.newDocument=null,a;if(e.op==="_get")return e.value=t,a;if(r)throw new Sc("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",i,e,t);return a}}else{n||(t=tb(t));let s=(e.path||"").split("/"),u=t,l=1,c=s.length,d,f,p;for(typeof r=="function"?p=r:p=Wpe;;){if(f=s[l],f&&f.indexOf("~")!=-1&&(f=Hpe(f)),o&&(f=="__proto__"||f=="prototype"&&l>0&&s[l-1]=="constructor"))throw new TypeError("JSON-Patch: modifying `__proto__` or `constructor/prototype` prop is banned for security reasons, if this was on purpose, please set `banPrototypeModifications` flag false and pass it to this function. More info in fast-json-patch README");if(r&&d===void 0&&(u[f]===void 0?d=s.slice(0,l).join("/"):l==c-1&&(d=e.path),d!==void 0&&p(e,0,t,d)),l++,Array.isArray(u)){if(f==="-")f=u.length;else{if(r&&!zpe(f))throw new Sc("Expected an unsigned base-10 integer value, making the new referenced value the array element with the zero-based index","OPERATION_PATH_ILLEGAL_ARRAY_INDEX",i,e,t);zpe(f)&&(f=~~f)}if(l>=c){if(r&&e.op==="add"&&f>u.length)throw new Sc("The specified index MUST NOT be greater than the number of elements in the array","OPERATION_VALUE_OUT_OF_BOUNDS",i,e,t);let m=cdn[e.op].call(e,u,f,t);if(m.test===!1)throw new Sc("Test operation failed","TEST_OPERATION_FAILED",i,e,t);return m}}else if(l>=c){let m=o6[e.op].call(e,u,f,t);if(m.test===!1)throw new Sc("Test operation failed","TEST_OPERATION_FAILED",i,e,t);return m}if(u=u[f],r&&l0)throw new Sc('Operation `path` property must start with "/"',"OPERATION_PATH_INVALID",e,t,r);if((t.op==="move"||t.op==="copy")&&typeof t.from!="string")throw new Sc("Operation `from` property is not present (applicable in `move` and `copy` operations)","OPERATION_FROM_REQUIRED",e,t,r);if((t.op==="add"||t.op==="replace"||t.op==="test")&&t.value===void 0)throw new Sc("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_REQUIRED",e,t,r);if((t.op==="add"||t.op==="replace"||t.op==="test")&&qpe(t.value))throw new Sc("Operation `value` property is not present (applicable in `add`, `replace` and `test` operations)","OPERATION_VALUE_CANNOT_CONTAIN_UNDEFINED",e,t,r);if(r){if(t.op=="add"){var o=t.path.split("/").length,i=n.split("/").length;if(o!==i+1&&o!==i)throw new Sc("Cannot perform an `add` operation at the desired path","OPERATION_PATH_CANNOT_ADD",e,t,r)}else if(t.op==="replace"||t.op==="remove"||t.op==="_get"){if(t.path!==n)throw new Sc("Cannot perform the operation at a path that does not exist","OPERATION_PATH_UNRESOLVABLE",e,t,r)}else if(t.op==="move"||t.op==="copy"){var a={op:"_get",path:t.from,value:void 0},s=gOt([a],r);if(s&&s.name==="OPERATION_PATH_UNRESOLVABLE")throw new Sc("Cannot perform the operation from a path that does not exist","OPERATION_FROM_UNRESOLVABLE",e,t,r)}}}else throw new Sc("Operation `op` property is not one of operations defined in RFC-6902","OPERATION_OP_INVALID",e,t,r)}function gOt(t,e,r){try{if(!Array.isArray(t))throw new Sc("Patch sequence must be an array","SEQUENCE_NOT_AN_ARRAY");if(e)K$(tb(e),tb(t),r||!0);else{r=r||Wpe;for(var n=0;n{Do();Jpe();Rqe={};Tt(Rqe,{JsonPatchError:()=>Sc,_areEquals:()=>qY,applyOperation:()=>rz,applyPatch:()=>K$,applyReducer:()=>ddn,deepClone:()=>ldn,getValueByPointer:()=>Kpe,validate:()=>gOt,validator:()=>Wpe});Sc=Vpe,ldn=tb,o6={add:function(t,e,r){return t[e]=this.value,{newDocument:r}},remove:function(t,e,r){var n=t[e];return delete t[e],{newDocument:r,removed:n}},replace:function(t,e,r){var n=t[e];return t[e]=this.value,{newDocument:r,removed:n}},move:function(t,e,r){let n=Kpe(r,this.path);n&&(n=tb(n));let o=rz(r,{op:"remove",path:this.from}).removed;return rz(r,{op:"add",path:this.path,value:o}),{newDocument:r,removed:n}},copy:function(t,e,r){let n=Kpe(r,this.from);return rz(r,{op:"add",path:this.path,value:tb(n)}),{newDocument:r}},test:function(t,e,r){return{newDocument:r,test:qY(t[e],this.value)}},_get:function(t,e,r){return this.value=t[e],{newDocument:r}}},cdn={add:function(t,e,r){return zpe(e)?t.splice(e,0,this.value):t[e]=this.value,{newDocument:r,index:e}},remove:function(t,e,r){var n=t.splice(e,1);return{newDocument:r,removed:n[0]}},replace:function(t,e,r){var n=t[e];return t[e]=this.value,{newDocument:r,removed:n}},move:o6.move,copy:o6.copy,test:o6.test,_get:o6._get}});function yOt(t,e,r,n,o){if(e!==t){typeof e.toJSON=="function"&&(e=e.toJSON());for(var i=Upe(e),a=Upe(t),s=!1,u=!1,l=a.length-1;l>=0;l--){var c=a[l],d=t[c];if(Bpe(e,c)&&!(e[c]===void 0&&d!==void 0&&Array.isArray(e)===!1)){var f=e[c];typeof d=="object"&&d!=null&&typeof f=="object"&&f!=null&&Array.isArray(d)===Array.isArray(f)?yOt(d,f,r,n+"/"+sN(c),o):d!==f&&(s=!0,o&&r.push({op:"test",path:n+"/"+sN(c),value:tb(d)}),r.push({op:"replace",path:n+"/"+sN(c),value:tb(f)}))}else Array.isArray(t)===Array.isArray(e)?(o&&r.push({op:"test",path:n+"/"+sN(c),value:tb(d)}),r.push({op:"remove",path:n+"/"+sN(c)}),u=!0):(o&&r.push({op:"test",path:n,value:t}),r.push({op:"replace",path:n,value:e}),s=!0)}if(!(!u&&i.length==a.length))for(var l=0;l{Jpe();BY()});var Evi,Aqe=v(()=>{Jpe();BY();UY();Evi={...Rqe,JsonPatchError:Vpe,deepClone:tb,escapePathComponent:sN,unescapePathComponent:Hpe}});async function bOt(t,e){if(e==="original")throw new Error("Do not assign inputs with original schema drop the key for now. When inputs are added to streamLog they should be added with standardized schema for streaming events.");let{inputs:r}=t;if(["retriever","llm","prompt"].includes(t.run_type))return r;if(!(Object.keys(r).length===1&&r?.input===""))return r.input}async function _Ot(t,e){let{outputs:r}=t;return e==="original"||["retriever","llm","prompt"].includes(t.run_type)?r:r!==void 0&&Object.keys(r).length===1&&r?.output!==void 0?r.output:r}function pdn(t){return t!==void 0&&t.message!==void 0}var fdn,dO,Gpe,Nqe,Zpe,vOt=v(()=>{Do();z0();BY();Aqe();XU();cO();fdn={};Tt(fdn,{LogStreamCallbackHandler:()=>Zpe,RunLog:()=>Gpe,RunLogPatch:()=>dO,isLogStreamHandler:()=>Nqe});dO=class{constructor(t){M(this,"ops");this.ops=t.ops??[]}concat(t){let e=this.ops.concat(t.ops),r=K$({},e);return new Gpe({ops:e,state:r[r.length-1].newDocument})}},Gpe=class Iqe extends dO{constructor(r){super(r);M(this,"state");this.state=r.state}concat(r){let n=this.ops.concat(r.ops),o=K$(this.state,r.ops);return new Iqe({ops:n,state:o[o.length-1].newDocument})}static fromRunLogPatch(r){let n=K$({},r.ops);return new Iqe({ops:r.ops,state:n[n.length-1].newDocument})}},Nqe=t=>t.name==="log_stream_tracer";Zpe=class extends V0{constructor(e){super({_awaitHandler:!0,...e});M(this,"autoClose",!0);M(this,"includeNames");M(this,"includeTypes");M(this,"includeTags");M(this,"excludeNames");M(this,"excludeTypes");M(this,"excludeTags");M(this,"_schemaFormat","original");M(this,"rootId");M(this,"keyMapByRunId",{});M(this,"counterMapByRunName",{});M(this,"transformStream");M(this,"writer");M(this,"receiveStream");M(this,"name","log_stream_tracer");M(this,"lc_prefer_streaming",!0);this.autoClose=e?.autoClose??!0,this.includeNames=e?.includeNames,this.includeTypes=e?.includeTypes,this.includeTags=e?.includeTags,this.excludeNames=e?.excludeNames,this.excludeTypes=e?.excludeTypes,this.excludeTags=e?.excludeTags,this._schemaFormat=e?._schemaFormat??this._schemaFormat,this.transformStream=new TransformStream,this.writer=this.transformStream.writable.getWriter(),this.receiveStream=Qy.fromReadableStream(this.transformStream.readable)}[Symbol.asyncIterator](){return this.receiveStream}async persistRun(e){}_includeRun(e){if(e.id===this.rootId)return!1;let r=e.tags??[],n=this.includeNames===void 0&&this.includeTags===void 0&&this.includeTypes===void 0;return this.includeNames!==void 0&&(n=n||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(n=n||this.includeTypes.includes(e.run_type)),this.includeTags!==void 0&&(n=n||r.find(o=>this.includeTags?.includes(o))!==void 0),this.excludeNames!==void 0&&(n=n&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(n=n&&!this.excludeTypes.includes(e.run_type)),this.excludeTags!==void 0&&(n=n&&r.every(o=>!this.excludeTags?.includes(o))),n}async*tapOutputIterable(e,r){for await(let n of r){if(e!==this.rootId){let o=this.keyMapByRunId[e];o&&await this.writer.write(new dO({ops:[{op:"add",path:`/logs/${o}/streamed_output/-`,value:n}]}))}yield n}}async onRunCreate(e){if(this.rootId===void 0&&(this.rootId=e.id,await this.writer.write(new dO({ops:[{op:"replace",path:"",value:{id:e.id,name:e.name,type:e.run_type,streamed_output:[],final_output:void 0,logs:{}}}]}))),!this._includeRun(e))return;this.counterMapByRunName[e.name]===void 0&&(this.counterMapByRunName[e.name]=0),this.counterMapByRunName[e.name]+=1;let r=this.counterMapByRunName[e.name];this.keyMapByRunId[e.id]=r===1?e.name:`${e.name}:${r}`;let n={id:e.id,name:e.name,type:e.run_type,tags:e.tags??[],metadata:e.extra?.metadata??{},start_time:new Date(e.start_time).toISOString(),streamed_output:[],streamed_output_str:[],final_output:void 0,end_time:void 0};this._schemaFormat==="streaming_events"&&(n.inputs=await bOt(e,this._schemaFormat)),await this.writer.write(new dO({ops:[{op:"add",path:`/logs/${this.keyMapByRunId[e.id]}`,value:n}]}))}async onRunUpdate(e){try{let r=this.keyMapByRunId[e.id];if(r===void 0)return;let n=[];this._schemaFormat==="streaming_events"&&n.push({op:"replace",path:`/logs/${r}/inputs`,value:await bOt(e,this._schemaFormat)}),n.push({op:"add",path:`/logs/${r}/final_output`,value:await _Ot(e,this._schemaFormat)}),e.end_time!==void 0&&n.push({op:"add",path:`/logs/${r}/end_time`,value:new Date(e.end_time).toISOString()});let o=new dO({ops:n});await this.writer.write(o)}finally{if(e.id===this.rootId){let r=new dO({ops:[{op:"replace",path:"/final_output",value:await _Ot(e,this._schemaFormat)}]});await this.writer.write(r),this.autoClose&&await this.writer.close()}}}async onLLMNewToken(e,r,n){let o=this.keyMapByRunId[e.id];if(o===void 0)return;let i=e.inputs.messages!==void 0,a;i?pdn(n?.chunk)?a=n?.chunk:a=new Nr({id:`run-${e.id}`,content:r}):a=r;let s=new dO({ops:[{op:"add",path:`/logs/${o}/streamed_output_str/-`,value:r},{op:"add",path:`/logs/${o}/streamed_output/-`,value:a}]});await this.writer.write(s)}}});var mdn,uN,Fw,Oi,gm=v(()=>{Do();mdn={};Tt(mdn,{ChatGenerationChunk:()=>Oi,GenerationChunk:()=>Fw,RUN_KEY:()=>uN});uN="__run",Fw=class wOt{constructor(e){M(this,"text");M(this,"generationInfo");this.text=e.text,this.generationInfo=e.generationInfo}concat(e){return new wOt({text:this.text+e.text,generationInfo:{...this.generationInfo,...e.generationInfo}})}},Oi=class SOt extends Fw{constructor(r){super(r);M(this,"message");this.message=r.message}concat(r){return new SOt({text:this.text+r.text,generationInfo:{...this.generationInfo,...r.generationInfo},message:this.message.concat(r.message)})}}});function Xpe({name:t,serialized:e}){return t!==void 0?t:e?.name!==void 0?e.name:e?.id!==void 0&&Array.isArray(e?.id)?e.id[e.id.length-1]:"Unnamed"}var COt,xOt,OOt=v(()=>{z0();XU();cO();gm();COt=t=>t.name==="event_stream_tracer",xOt=class extends V0{constructor(e){super({_awaitHandler:!0,...e});M(this,"autoClose",!0);M(this,"includeNames");M(this,"includeTypes");M(this,"includeTags");M(this,"excludeNames");M(this,"excludeTypes");M(this,"excludeTags");M(this,"runInfoMap",new Map);M(this,"tappedPromises",new Map);M(this,"transformStream");M(this,"writer");M(this,"receiveStream");M(this,"name","event_stream_tracer");M(this,"lc_prefer_streaming",!0);this.autoClose=e?.autoClose??!0,this.includeNames=e?.includeNames,this.includeTypes=e?.includeTypes,this.includeTags=e?.includeTags,this.excludeNames=e?.excludeNames,this.excludeTypes=e?.excludeTypes,this.excludeTags=e?.excludeTags,this.transformStream=new TransformStream,this.writer=this.transformStream.writable.getWriter(),this.receiveStream=Qy.fromReadableStream(this.transformStream.readable)}[Symbol.asyncIterator](){return this.receiveStream}async persistRun(e){}_includeRun(e){let r=e.tags??[],n=this.includeNames===void 0&&this.includeTags===void 0&&this.includeTypes===void 0;return this.includeNames!==void 0&&(n=n||this.includeNames.includes(e.name)),this.includeTypes!==void 0&&(n=n||this.includeTypes.includes(e.runType)),this.includeTags!==void 0&&(n=n||r.find(o=>this.includeTags?.includes(o))!==void 0),this.excludeNames!==void 0&&(n=n&&!this.excludeNames.includes(e.name)),this.excludeTypes!==void 0&&(n=n&&!this.excludeTypes.includes(e.runType)),this.excludeTags!==void 0&&(n=n&&r.every(o=>!this.excludeTags?.includes(o))),n}async*tapOutputIterable(e,r){let n=await r.next();if(n.done)return;let o=this.runInfoMap.get(e);if(o===void 0){yield n.value;return}function i(s,u){return s==="llm"&&typeof u=="string"?new Fw({text:u}):u}let a=this.tappedPromises.get(e);if(a===void 0){let s;a=new Promise(u=>{s=u}),this.tappedPromises.set(e,a);try{let u={event:`on_${o.runType}_stream`,run_id:e,name:o.name,tags:o.tags,metadata:o.metadata,data:{}};await this.send({...u,data:{chunk:i(o.runType,n.value)}},o),yield n.value;for await(let l of r)o.runType!=="tool"&&o.runType!=="retriever"&&await this.send({...u,data:{chunk:i(o.runType,l)}},o),yield l}finally{s?.()}}else{yield n.value;for await(let s of r)yield s}}async send(e,r){this._includeRun(r)&&await this.writer.write(e)}async sendEndEvent(e,r){let n=this.tappedPromises.get(e.run_id);n!==void 0?n.then(()=>{this.send(e,r)}):await this.send(e,r)}async onLLMStart(e){let r=Xpe(e),n=e.inputs.messages!==void 0?"chat_model":"llm",o={tags:e.tags??[],metadata:e.extra?.metadata??{},name:r,runType:n,inputs:e.inputs};this.runInfoMap.set(e.id,o);let i=`on_${n}_start`;await this.send({event:i,data:{input:e.inputs},name:r,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},o)}async onLLMNewToken(e,r,n){let o=this.runInfoMap.get(e.id),i,a;if(o===void 0)throw new Error(`onLLMNewToken: Run ID ${e.id} not found in run map.`);if(this.runInfoMap.size!==1){if(o.runType==="chat_model")a="on_chat_model_stream",n?.chunk===void 0?i=new Nr({content:r,id:`run-${e.id}`}):i=n.chunk.message;else if(o.runType==="llm")a="on_llm_stream",n?.chunk===void 0?i=new Fw({text:r}):i=n.chunk;else throw new Error(`Unexpected run type ${o.runType}`);await this.send({event:a,data:{chunk:i},run_id:e.id,name:o.name,tags:o.tags,metadata:o.metadata},o)}}async onLLMEnd(e){let r=this.runInfoMap.get(e.id);this.runInfoMap.delete(e.id);let n;if(r===void 0)throw new Error(`onLLMEnd: Run ID ${e.id} not found in run map.`);let o=e.outputs?.generations,i;if(r.runType==="chat_model"){for(let a of o??[]){if(i!==void 0)break;i=a[0]?.message}n="on_chat_model_end"}else if(r.runType==="llm")i={generations:o?.map(a=>a.map(s=>({text:s.text,generationInfo:s.generationInfo}))),llmOutput:e.outputs?.llmOutput??{}},n="on_llm_end";else throw new Error(`onLLMEnd: Unexpected run type: ${r.runType}`);await this.sendEndEvent({event:n,data:{output:i,input:r.inputs},run_id:e.id,name:r.name,tags:r.tags,metadata:r.metadata},r)}async onChainStart(e){let r=Xpe(e),n=e.run_type??"chain",o={tags:e.tags??[],metadata:e.extra?.metadata??{},name:r,runType:e.run_type},i={};e.inputs.input===""&&Object.keys(e.inputs).length===1?(i={},o.inputs={}):e.inputs.input!==void 0?(i.input=e.inputs.input,o.inputs=e.inputs.input):(i.input=e.inputs,o.inputs=e.inputs),this.runInfoMap.set(e.id,o),await this.send({event:`on_${n}_start`,data:i,name:r,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},o)}async onChainEnd(e){let r=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),r===void 0)throw new Error(`onChainEnd: Run ID ${e.id} not found in run map.`);let n=`on_${e.run_type}_end`,o=e.inputs??r.inputs??{},a={output:e.outputs?.output??e.outputs,input:o};o.input&&Object.keys(o).length===1&&(a.input=o.input,r.inputs=o.input),await this.sendEndEvent({event:n,data:a,run_id:e.id,name:r.name,tags:r.tags,metadata:r.metadata??{}},r)}async onToolStart(e){let r=Xpe(e),n={tags:e.tags??[],metadata:e.extra?.metadata??{},name:r,runType:"tool",inputs:e.inputs??{}};this.runInfoMap.set(e.id,n),await this.send({event:"on_tool_start",data:{input:e.inputs??{}},name:r,run_id:e.id,tags:e.tags??[],metadata:e.extra?.metadata??{}},n)}async onToolEnd(e){let r=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),r===void 0)throw new Error(`onToolEnd: Run ID ${e.id} not found in run map.`);if(r.inputs===void 0)throw new Error(`onToolEnd: Run ID ${e.id} is a tool call, and is expected to have traced inputs.`);let n=e.outputs?.output===void 0?e.outputs:e.outputs.output;await this.sendEndEvent({event:"on_tool_end",data:{output:n,input:r.inputs},run_id:e.id,name:r.name,tags:r.tags,metadata:r.metadata},r)}async onRetrieverStart(e){let r=Xpe(e),o={tags:e.tags??[],metadata:e.extra?.metadata??{},name:r,runType:"retriever",inputs:{query:e.inputs.query}};this.runInfoMap.set(e.id,o),await this.send({event:"on_retriever_start",data:{input:{query:e.inputs.query}},name:r,tags:e.tags??[],run_id:e.id,metadata:e.extra?.metadata??{}},o)}async onRetrieverEnd(e){let r=this.runInfoMap.get(e.id);if(this.runInfoMap.delete(e.id),r===void 0)throw new Error(`onRetrieverEnd: Run ID ${e.id} not found in run map.`);await this.sendEndEvent({event:"on_retriever_end",data:{output:e.outputs?.documents??e.outputs,input:r.inputs},run_id:e.id,name:r.name,tags:r.tags,metadata:r.metadata},r)}async handleCustomEvent(e,r,n){let o=this.runInfoMap.get(n);if(o===void 0)throw new Error(`handleCustomEvent: Run ID ${n} not found in run map.`);await this.send({event:"on_custom_event",run_id:n,name:e,tags:o.tags,metadata:o.metadata,data:r},o)}async finish(){let e=[...this.tappedPromises.values()];Promise.all(e).finally(()=>{this.writer.close()})}}});var TOt,Ype,hdn,gdn,ydn,kw,nz=v(()=>{Do();kY();TOt=L(ipe(),1),Ype=L(Cqe(),1),hdn={};Tt(hdn,{AsyncCaller:()=>kw});gdn=[400,401,402,403,404,405,406,407,409],ydn=t=>{if(t.message.startsWith("Cancel")||t.message.startsWith("AbortError")||t.name==="AbortError"||t?.code==="ECONNABORTED")throw t;let e=t?.response?.status??t?.status;if(e&&gdn.includes(+e))throw t;if(t?.error?.code==="insufficient_quota"){let r=new Error(t?.message);throw r.name="InsufficientQuotaError",r}},kw=class{constructor(t){M(this,"maxConcurrency");M(this,"maxRetries");M(this,"onFailedAttempt");M(this,"queue");this.maxConcurrency=t.maxConcurrency??1/0,this.maxRetries=t.maxRetries??6,this.onFailedAttempt=t.onFailedAttempt??ydn;let e="default"in Ype.default?Ype.default.default:Ype.default;this.queue=new e({concurrency:this.maxConcurrency})}call(t,...e){return this.queue.add(()=>(0,TOt.default)(()=>t(...e).catch(r=>{throw r instanceof Error?r:new Error(r)}),{onFailedAttempt:this.onFailedAttempt,retries:this.maxRetries,randomize:!0}),{throwOnTimeout:!0})}callWithOptions(t,e,...r){return t.signal?Promise.race([this.call(e,...r),new Promise((n,o)=>{t.signal?.addEventListener("abort",()=>{o(V$(t.signal))})})]):this.call(e,...r)}fetch(...t){return this.call(()=>fetch(...t).then(e=>e.ok?e:Promise.reject(e)))}}});var jqe,EOt=v(()=>{XU();jqe=class extends V0{constructor({config:e,onStart:r,onEnd:n,onError:o}){super({_awaitHandler:!0});M(this,"name","RootListenersTracer");M(this,"rootId");M(this,"config");M(this,"argOnStart");M(this,"argOnEnd");M(this,"argOnError");this.config=e,this.argOnStart=r,this.argOnEnd=n,this.argOnError=o}persistRun(e){return Promise.resolve()}async onRunCreate(e){this.rootId||(this.rootId=e.id,this.argOnStart&&await this.argOnStart(e,this.config))}async onRunUpdate(e){e.id===this.rootId&&(e.error?this.argOnError&&await this.argOnError(e,this.config):this.argOnEnd&&await this.argOnEnd(e,this.config))}}});function zY(t){return t?t.lc_runnable:!1}var POt,Dqe=v(()=>{POt=class{constructor(t){M(this,"includeNames");M(this,"includeTypes");M(this,"includeTags");M(this,"excludeNames");M(this,"excludeTypes");M(this,"excludeTags");this.includeNames=t.includeNames,this.includeTypes=t.includeTypes,this.includeTags=t.includeTags,this.excludeNames=t.excludeNames,this.excludeTypes=t.excludeTypes,this.excludeTags=t.excludeTags}includeEvent(t,e){let r=this.includeNames===void 0&&this.includeTypes===void 0&&this.includeTags===void 0,n=t.tags??[];return this.includeNames!==void 0&&(r=r||this.includeNames.includes(t.name)),this.includeTypes!==void 0&&(r=r||this.includeTypes.includes(e)),this.includeTags!==void 0&&(r=r||n.some(o=>this.includeTags?.includes(o))),this.excludeNames!==void 0&&(r=r&&!this.excludeNames.includes(t.name)),this.excludeTypes!==void 0&&(r=r&&!this.excludeTypes.includes(e)),this.excludeTags!==void 0&&(r=r&&n.every(o=>!this.excludeTags?.includes(o))),r}}});function ve(t,e,r){function n(s,u){var l;Object.defineProperty(s,"_zod",{value:s._zod??{},enumerable:!1}),(l=s._zod).traits??(l.traits=new Set),s._zod.traits.add(t),e(s,u);for(let c in a.prototype)c in s||Object.defineProperty(s,c,{value:a.prototype[c].bind(s)});s._zod.constr=a,s._zod.def=u}let o=r?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:t});function a(s){var u;let l=r?.Parent?new i:this;n(l,s),(u=l._zod).deferred??(u.deferred=[]);for(let c of l._zod.deferred)c();return l}return Object.defineProperty(a,"init",{value:n}),Object.defineProperty(a,Symbol.hasInstance,{value:s=>r?.Parent&&s instanceof r.Parent?!0:s?._zod?.traits?.has(t)}),Object.defineProperty(a,"name",{value:t}),a}function cd(t){return t&&Object.assign(HY,t),HY}var $qe,Lqe,fO,HY,a6=v(()=>{$qe=Object.freeze({status:"aborted"});Lqe=Symbol("zod_brand"),fO=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},HY={}});var xt={};Jn(xt,{BIGINT_FORMAT_RANGES:()=>Kqe,Class:()=>kqe,NUMBER_FORMAT_RANGES:()=>Jqe,aborted:()=>iz,allowsEval:()=>zqe,assert:()=>Sdn,assertEqual:()=>bdn,assertIs:()=>vdn,assertNever:()=>wdn,assertNotEqual:()=>_dn,assignProp:()=>Uqe,cached:()=>KY,captureStackTrace:()=>Qpe,cleanEnum:()=>Ddn,cleanRegex:()=>WY,clone:()=>zc,createTransparentProxy:()=>Pdn,defineLazy:()=>Ns,esc:()=>oz,escapeRegex:()=>lN,extend:()=>Adn,finalizeIssue:()=>Sv,floatSafeRemainder:()=>Bqe,getElementAtPath:()=>Cdn,getEnumValues:()=>JY,getLengthableOrigin:()=>XY,getParsedType:()=>Edn,getSizableOrigin:()=>ZY,isObject:()=>s6,isPlainObject:()=>u6,issue:()=>Wqe,joinValues:()=>Le,jsonStringifyReplacer:()=>qqe,merge:()=>Idn,normalizeParams:()=>ct,nullish:()=>W$,numKeys:()=>Tdn,omit:()=>Rdn,optionalKeys:()=>Vqe,partial:()=>Ndn,pick:()=>Mdn,prefixIssues:()=>Qb,primitiveTypes:()=>Hqe,promiseAllObject:()=>xdn,propertyKeyTypes:()=>GY,randomString:()=>Odn,required:()=>jdn,stringifyPrimitive:()=>Nt,unwrapMessage:()=>VY});function bdn(t){return t}function _dn(t){return t}function vdn(t){}function wdn(t){throw new Error}function Sdn(t){}function JY(t){let e=Object.values(t).filter(n=>typeof n=="number");return Object.entries(t).filter(([n,o])=>e.indexOf(+n)===-1).map(([n,o])=>o)}function Le(t,e="|"){return t.map(r=>Nt(r)).join(e)}function qqe(t,e){return typeof e=="bigint"?e.toString():e}function KY(t){return{get value(){{let r=t();return Object.defineProperty(this,"value",{value:r}),r}throw new Error("cached value already set")}}}function W$(t){return t==null}function WY(t){let e=t.startsWith("^")?1:0,r=t.endsWith("$")?t.length-1:t.length;return t.slice(e,r)}function Bqe(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(t.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return i%a/10**o}function Ns(t,e,r){Object.defineProperty(t,e,{get(){{let o=r();return t[e]=o,o}throw new Error("cached value already set")},set(o){Object.defineProperty(t,e,{value:o})},configurable:!0})}function Uqe(t,e,r){Object.defineProperty(t,e,{value:r,writable:!0,enumerable:!0,configurable:!0})}function Cdn(t,e){return e?e.reduce((r,n)=>r?.[n],t):t}function xdn(t){let e=Object.keys(t),r=e.map(n=>t[n]);return Promise.all(r).then(n=>{let o={};for(let i=0;ie};if(e?.message!==void 0){if(e?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");e.error=e.message}return delete e.message,typeof e.error=="string"?{...e,error:()=>e.error}:e}function Pdn(t){let e;return new Proxy({},{get(r,n,o){return e??(e=t()),Reflect.get(e,n,o)},set(r,n,o,i){return e??(e=t()),Reflect.set(e,n,o,i)},has(r,n){return e??(e=t()),Reflect.has(e,n)},deleteProperty(r,n){return e??(e=t()),Reflect.deleteProperty(e,n)},ownKeys(r){return e??(e=t()),Reflect.ownKeys(e)},getOwnPropertyDescriptor(r,n){return e??(e=t()),Reflect.getOwnPropertyDescriptor(e,n)},defineProperty(r,n,o){return e??(e=t()),Reflect.defineProperty(e,n,o)}})}function Nt(t){return typeof t=="bigint"?t.toString()+"n":typeof t=="string"?`"${t}"`:`${t}`}function Vqe(t){return Object.keys(t).filter(e=>t[e]._zod.optin==="optional"&&t[e]._zod.optout==="optional")}function Mdn(t,e){let r={},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&(r[o]=n.shape[o])}return zc(t,{...t._zod.def,shape:r,checks:[]})}function Rdn(t,e){let r={...t._zod.def.shape},n=t._zod.def;for(let o in e){if(!(o in n.shape))throw new Error(`Unrecognized key: "${o}"`);e[o]&&delete r[o]}return zc(t,{...t._zod.def,shape:r,checks:[]})}function Adn(t,e){if(!u6(e))throw new Error("Invalid input to extend: expected a plain object");let r={...t._zod.def,get shape(){let n={...t._zod.def.shape,...e};return Uqe(this,"shape",n),n},checks:[]};return zc(t,r)}function Idn(t,e){return zc(t,{...t._zod.def,get shape(){let r={...t._zod.def.shape,...e._zod.def.shape};return Uqe(this,"shape",r),r},catchall:e._zod.def.catchall,checks:[]})}function Ndn(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let i in r){if(!(i in n))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=t?new t({type:"optional",innerType:n[i]}):n[i])}else for(let i in n)o[i]=t?new t({type:"optional",innerType:n[i]}):n[i];return zc(e,{...e._zod.def,shape:o,checks:[]})}function jdn(t,e,r){let n=e._zod.def.shape,o={...n};if(r)for(let i in r){if(!(i in o))throw new Error(`Unrecognized key: "${i}"`);r[i]&&(o[i]=new t({type:"nonoptional",innerType:n[i]}))}else for(let i in n)o[i]=new t({type:"nonoptional",innerType:n[i]});return zc(e,{...e._zod.def,shape:o,checks:[]})}function iz(t,e=0){for(let r=e;r{var n;return(n=r).path??(n.path=[]),r.path.unshift(t),r})}function VY(t){return typeof t=="string"?t:t?.message}function Sv(t,e,r){let n={...t,path:t.path??[]};if(!t.message){let o=VY(t.inst?._zod.def?.error?.(t))??VY(e?.error?.(t))??VY(r.customError?.(t))??VY(r.localeError?.(t))??"Invalid input";n.message=o}return delete n.inst,delete n.continue,e?.reportInput||delete n.input,n}function ZY(t){return t instanceof Set?"set":t instanceof Map?"map":t instanceof File?"file":"unknown"}function XY(t){return Array.isArray(t)?"array":typeof t=="string"?"string":"unknown"}function Wqe(...t){let[e,r,n]=t;return typeof e=="string"?{message:e,code:"custom",input:r,inst:n}:{...e}}function Ddn(t){return Object.entries(t).filter(([e,r])=>Number.isNaN(Number.parseInt(e,10))).map(e=>e[1])}var Qpe,zqe,Edn,GY,Hqe,Jqe,Kqe,kqe,An=v(()=>{Qpe=Error.captureStackTrace?Error.captureStackTrace:(...t)=>{};zqe=KY(()=>{if(typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let t=Function;return new t(""),!0}catch{return!1}});Edn=t=>{let e=typeof t;switch(e){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(t)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(t)?"array":t===null?"null":t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?"promise":typeof Map<"u"&&t instanceof Map?"map":typeof Set<"u"&&t instanceof Set?"set":typeof Date<"u"&&t instanceof Date?"date":typeof File<"u"&&t instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${e}`)}},GY=new Set(["string","number","symbol"]),Hqe=new Set(["string","number","bigint","boolean","symbol","undefined"]);Jqe={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},Kqe={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};kqe=class{constructor(...e){}}});function QY(t,e=r=>r.message){let r={},n=[];for(let o of t.issues)o.path.length>0?(r[o.path[0]]=r[o.path[0]]||[],r[o.path[0]].push(e(o))):n.push(e(o));return{formErrors:n,fieldErrors:r}}function eQ(t,e){let r=e||function(i){return i.message},n={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(s=>o({issues:s}));else if(a.code==="invalid_key")o({issues:a.issues});else if(a.code==="invalid_element")o({issues:a.issues});else if(a.path.length===0)n._errors.push(r(a));else{let s=n,u=0;for(;u{var s,u;for(let l of i.issues)if(l.code==="invalid_union"&&l.errors.length)l.errors.map(c=>o({issues:c},l.path));else if(l.code==="invalid_key")o({issues:l.issues},l.path);else if(l.code==="invalid_element")o({issues:l.issues},l.path);else{let c=[...a,...l.path];if(c.length===0){n.errors.push(r(l));continue}let d=n,f=0;for(;fn.path.length-o.path.length);for(let n of r)e.push(`\u2716 ${n.message}`),n.path?.length&&e.push(` \u2192 at ${ROt(n.path)}`);return e.join(` +`)}var MOt,YY,l6,Xqe=v(()=>{a6();An();MOt=(t,e)=>{t.name="$ZodError",Object.defineProperty(t,"_zod",{value:t._zod,enumerable:!1}),Object.defineProperty(t,"issues",{value:e,enumerable:!1}),Object.defineProperty(t,"message",{get(){return JSON.stringify(e,qqe,2)},enumerable:!0}),Object.defineProperty(t,"toString",{value:()=>t.message,enumerable:!1})},YY=ve("$ZodError",MOt),l6=ve("$ZodError",MOt,{Parent:Error})});var eme,pO,tme,az,rme,Yqe,nme,Qqe,ome=v(()=>{a6();Xqe();An();eme=t=>(e,r,n,o)=>{let i=n?Object.assign(n,{async:!1}):{async:!1},a=e._zod.run({value:r,issues:[]},i);if(a instanceof Promise)throw new fO;if(a.issues.length){let s=new(o?.Err??t)(a.issues.map(u=>Sv(u,i,cd())));throw Qpe(s,o?.callee),s}return a.value},pO=eme(l6),tme=t=>async(e,r,n,o)=>{let i=n?Object.assign(n,{async:!0}):{async:!0},a=e._zod.run({value:r,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let s=new(o?.Err??t)(a.issues.map(u=>Sv(u,i,cd())));throw Qpe(s,o?.callee),s}return a.value},az=tme(l6),rme=t=>(e,r,n)=>{let o=n?{...n,async:!1}:{async:!1},i=e._zod.run({value:r,issues:[]},o);if(i instanceof Promise)throw new fO;return i.issues.length?{success:!1,error:new(t??YY)(i.issues.map(a=>Sv(a,o,cd())))}:{success:!0,data:i.value}},Yqe=rme(l6),nme=t=>async(e,r,n)=>{let o=n?Object.assign(n,{async:!0}):{async:!0},i=e._zod.run({value:r,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new t(i.issues.map(a=>Sv(a,o,cd())))}:{success:!0,data:i.value}},Qqe=nme(l6)});var uz={};Jn(uz,{_emoji:()=>AOt,base64:()=>mBe,base64url:()=>ime,bigint:()=>wBe,boolean:()=>xBe,browserEmail:()=>Hdn,cidrv4:()=>fBe,cidrv6:()=>pBe,cuid:()=>eBe,cuid2:()=>tBe,date:()=>yBe,datetime:()=>_Be,domain:()=>Vdn,duration:()=>aBe,e164:()=>gBe,email:()=>uBe,emoji:()=>lBe,extendedDuration:()=>Ldn,guid:()=>sBe,hostname:()=>hBe,html5Email:()=>Bdn,integer:()=>SBe,ipv4:()=>cBe,ipv6:()=>dBe,ksuid:()=>oBe,lowercase:()=>EBe,nanoid:()=>iBe,null:()=>OBe,number:()=>CBe,rfc5322Email:()=>Udn,string:()=>vBe,time:()=>bBe,ulid:()=>rBe,undefined:()=>TBe,unicodeEmail:()=>zdn,uppercase:()=>PBe,uuid:()=>sz,uuid4:()=>Fdn,uuid6:()=>kdn,uuid7:()=>qdn,xid:()=>nBe});function lBe(){return new RegExp(AOt,"u")}function NOt(t){let e="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof t.precision=="number"?t.precision===-1?`${e}`:t.precision===0?`${e}:[0-5]\\d`:`${e}:[0-5]\\d\\.\\d{${t.precision}}`:`${e}(?::[0-5]\\d(?:\\.\\d+)?)?`}function bBe(t){return new RegExp(`^${NOt(t)}$`)}function _Be(t){let e=NOt({precision:t.precision}),r=["Z"];t.local&&r.push(""),t.offset&&r.push("([+-]\\d{2}:\\d{2})");let n=`${e}(?:${r.join("|")})`;return new RegExp(`^${IOt}T(?:${n})$`)}var eBe,tBe,rBe,nBe,oBe,iBe,aBe,Ldn,sBe,sz,Fdn,kdn,qdn,uBe,Bdn,Udn,zdn,Hdn,AOt,cBe,dBe,fBe,pBe,mBe,ime,hBe,Vdn,gBe,IOt,yBe,vBe,wBe,SBe,CBe,xBe,OBe,TBe,EBe,PBe,ame=v(()=>{eBe=/^[cC][^\s-]{8,}$/,tBe=/^[0-9a-z]+$/,rBe=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,nBe=/^[0-9a-vA-V]{20}$/,oBe=/^[A-Za-z0-9]{27}$/,iBe=/^[a-zA-Z0-9_-]{21}$/,aBe=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Ldn=/^[-+]?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)?)??$/,sBe=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,sz=t=>t?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${t}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000)$/,Fdn=sz(4),kdn=sz(6),qdn=sz(7),uBe=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Bdn=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,Udn=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,zdn=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,Hdn=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,AOt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";cBe=/^(?:(?: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])$/,dBe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})$/,fBe=/^((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])\/([0-9]|[1-2][0-9]|3[0-2])$/,pBe=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,mBe=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,ime=/^[A-Za-z0-9_-]*$/,hBe=/^([a-zA-Z0-9-]+\.)*[a-zA-Z0-9-]+$/,Vdn=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,gBe=/^\+(?:[0-9]){6,14}[0-9]$/,IOt="(?:(?:\\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])))",yBe=new RegExp(`^${IOt}$`);vBe=t=>{let e=t?`[\\s\\S]{${t?.minimum??0},${t?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${e}$`)},wBe=/^\d+n?$/,SBe=/^\d+$/,CBe=/^-?\d+(?:\.\d+)?/i,xBe=/true|false/i,OBe=/null/i,TBe=/undefined/i,EBe=/^[^A-Z]*$/,PBe=/^[^a-z]*$/});function jOt(t,e,r){t.issues.length&&e.issues.push(...Qb(r,t.issues))}var Zl,DOt,sme,ume,MBe,RBe,ABe,IBe,NBe,jBe,DBe,$Be,LBe,c6,FBe,kBe,qBe,BBe,UBe,zBe,HBe,VBe,JBe,lme=v(()=>{a6();ame();An();Zl=ve("$ZodCheck",(t,e)=>{var r;t._zod??(t._zod={}),t._zod.def=e,(r=t._zod).onattach??(r.onattach=[])}),DOt={number:"number",bigint:"bigint",object:"date"},sme=ve("$ZodCheckLessThan",(t,e)=>{Zl.init(t,e);let r=DOt[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,i=(e.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;e.value{(e.inclusive?n.value<=e.value:n.value{Zl.init(t,e);let r=DOt[typeof e.value];t._zod.onattach.push(n=>{let o=n._zod.bag,i=(e.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;e.value>i&&(e.inclusive?o.minimum=e.value:o.exclusiveMinimum=e.value)}),t._zod.check=n=>{(e.inclusive?n.value>=e.value:n.value>e.value)||n.issues.push({origin:r,code:"too_small",minimum:e.value,input:n.value,inclusive:e.inclusive,inst:t,continue:!e.abort})}}),MBe=ve("$ZodCheckMultipleOf",(t,e)=>{Zl.init(t,e),t._zod.onattach.push(r=>{var n;(n=r._zod.bag).multipleOf??(n.multipleOf=e.value)}),t._zod.check=r=>{if(typeof r.value!=typeof e.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof r.value=="bigint"?r.value%e.value===BigInt(0):Bqe(r.value,e.value)===0)||r.issues.push({origin:typeof r.value,code:"not_multiple_of",divisor:e.value,input:r.value,inst:t,continue:!e.abort})}}),RBe=ve("$ZodCheckNumberFormat",(t,e)=>{Zl.init(t,e),e.format=e.format||"float64";let r=e.format?.includes("int"),n=r?"int":"number",[o,i]=Jqe[e.format];t._zod.onattach.push(a=>{let s=a._zod.bag;s.format=e.format,s.minimum=o,s.maximum=i,r&&(s.pattern=SBe)}),t._zod.check=a=>{let s=a.value;if(r){if(!Number.isInteger(s)){a.issues.push({expected:n,format:e.format,code:"invalid_type",input:s,inst:t});return}if(!Number.isSafeInteger(s)){s>0?a.issues.push({input:s,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort}):a.issues.push({input:s,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:t,origin:n,continue:!e.abort});return}}si&&a.issues.push({origin:"number",input:s,code:"too_big",maximum:i,inst:t})}}),ABe=ve("$ZodCheckBigIntFormat",(t,e)=>{Zl.init(t,e);let[r,n]=Kqe[e.format];t._zod.onattach.push(o=>{let i=o._zod.bag;i.format=e.format,i.minimum=r,i.maximum=n}),t._zod.check=o=>{let i=o.value;in&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:n,inst:t})}}),IBe=ve("$ZodCheckMaxSize",(t,e)=>{var r;Zl.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!W$(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let o=n.value;o.size<=e.maximum||n.issues.push({origin:ZY(o),code:"too_big",maximum:e.maximum,input:o,inst:t,continue:!e.abort})}}),NBe=ve("$ZodCheckMinSize",(t,e)=>{var r;Zl.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!W$(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;o.size>=e.minimum||n.issues.push({origin:ZY(o),code:"too_small",minimum:e.minimum,input:o,inst:t,continue:!e.abort})}}),jBe=ve("$ZodCheckSizeEquals",(t,e)=>{var r;Zl.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!W$(o)&&o.size!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.size,o.maximum=e.size,o.size=e.size}),t._zod.check=n=>{let o=n.value,i=o.size;if(i===e.size)return;let a=i>e.size;n.issues.push({origin:ZY(o),...a?{code:"too_big",maximum:e.size}:{code:"too_small",minimum:e.size},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),DBe=ve("$ZodCheckMaxLength",(t,e)=>{var r;Zl.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!W$(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.maximum??Number.POSITIVE_INFINITY;e.maximum{let o=n.value;if(o.length<=e.maximum)return;let a=XY(o);n.issues.push({origin:a,code:"too_big",maximum:e.maximum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),$Be=ve("$ZodCheckMinLength",(t,e)=>{var r;Zl.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!W$(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag.minimum??Number.NEGATIVE_INFINITY;e.minimum>o&&(n._zod.bag.minimum=e.minimum)}),t._zod.check=n=>{let o=n.value;if(o.length>=e.minimum)return;let a=XY(o);n.issues.push({origin:a,code:"too_small",minimum:e.minimum,inclusive:!0,input:o,inst:t,continue:!e.abort})}}),LBe=ve("$ZodCheckLengthEquals",(t,e)=>{var r;Zl.init(t,e),(r=t._zod.def).when??(r.when=n=>{let o=n.value;return!W$(o)&&o.length!==void 0}),t._zod.onattach.push(n=>{let o=n._zod.bag;o.minimum=e.length,o.maximum=e.length,o.length=e.length}),t._zod.check=n=>{let o=n.value,i=o.length;if(i===e.length)return;let a=XY(o),s=i>e.length;n.issues.push({origin:a,...s?{code:"too_big",maximum:e.length}:{code:"too_small",minimum:e.length},inclusive:!0,exact:!0,input:n.value,inst:t,continue:!e.abort})}}),c6=ve("$ZodCheckStringFormat",(t,e)=>{var r,n;Zl.init(t,e),t._zod.onattach.push(o=>{let i=o._zod.bag;i.format=e.format,e.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(e.pattern))}),e.pattern?(r=t._zod).check??(r.check=o=>{e.pattern.lastIndex=0,!e.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:e.format,input:o.value,...e.pattern?{pattern:e.pattern.toString()}:{},inst:t,continue:!e.abort})}):(n=t._zod).check??(n.check=()=>{})}),FBe=ve("$ZodCheckRegex",(t,e)=>{c6.init(t,e),t._zod.check=r=>{e.pattern.lastIndex=0,!e.pattern.test(r.value)&&r.issues.push({origin:"string",code:"invalid_format",format:"regex",input:r.value,pattern:e.pattern.toString(),inst:t,continue:!e.abort})}}),kBe=ve("$ZodCheckLowerCase",(t,e)=>{e.pattern??(e.pattern=EBe),c6.init(t,e)}),qBe=ve("$ZodCheckUpperCase",(t,e)=>{e.pattern??(e.pattern=PBe),c6.init(t,e)}),BBe=ve("$ZodCheckIncludes",(t,e)=>{Zl.init(t,e);let r=lN(e.includes),n=new RegExp(typeof e.position=="number"?`^.{${e.position}}${r}`:r);e.pattern=n,t._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(n)}),t._zod.check=o=>{o.value.includes(e.includes,e.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:e.includes,input:o.value,inst:t,continue:!e.abort})}}),UBe=ve("$ZodCheckStartsWith",(t,e)=>{Zl.init(t,e);let r=new RegExp(`^${lN(e.prefix)}.*`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.startsWith(e.prefix)||n.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:e.prefix,input:n.value,inst:t,continue:!e.abort})}}),zBe=ve("$ZodCheckEndsWith",(t,e)=>{Zl.init(t,e);let r=new RegExp(`.*${lN(e.suffix)}$`);e.pattern??(e.pattern=r),t._zod.onattach.push(n=>{let o=n._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(r)}),t._zod.check=n=>{n.value.endsWith(e.suffix)||n.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:e.suffix,input:n.value,inst:t,continue:!e.abort})}});HBe=ve("$ZodCheckProperty",(t,e)=>{Zl.init(t,e),t._zod.check=r=>{let n=e.schema._zod.run({value:r.value[e.property],issues:[]},{});if(n instanceof Promise)return n.then(o=>jOt(o,r,e.property));jOt(n,r,e.property)}}),VBe=ve("$ZodCheckMimeType",(t,e)=>{Zl.init(t,e);let r=new Set(e.mime);t._zod.onattach.push(n=>{n._zod.bag.mime=e.mime}),t._zod.check=n=>{r.has(n.value.type)||n.issues.push({code:"invalid_value",values:e.mime,input:n.value.type,inst:t})}}),JBe=ve("$ZodCheckOverwrite",(t,e)=>{Zl.init(t,e),t._zod.check=r=>{r.value=e.tx(r.value)}})});var tQ,KBe=v(()=>{tQ=class{constructor(e=[]){this.content=[],this.indent=0,this&&(this.args=e)}indented(e){this.indent+=1,e(this),this.indent-=1}write(e){if(typeof e=="function"){e(this,{execution:"sync"}),e(this,{execution:"async"});return}let n=e.split(` +`).filter(a=>a),o=Math.min(...n.map(a=>a.length-a.trimStart().length)),i=n.map(a=>a.slice(o)).map(a=>" ".repeat(this.indent*2)+a);for(let a of i)this.content.push(a)}compile(){let e=Function,r=this?.args,o=[...(this?.content??[""]).map(i=>` ${i}`)];return new e(...r,o.join(` +`))}}});var WBe,GBe=v(()=>{WBe={major:4,minor:0,patch:0}});function gUe(t){if(t==="")return!0;if(t.length%4!==0)return!1;try{return atob(t),!0}catch{return!1}}function WOt(t){if(!ime.test(t))return!1;let e=t.replace(/[-_]/g,n=>n==="-"?"+":"/"),r=e.padEnd(Math.ceil(e.length/4)*4,"=");return gUe(r)}function GOt(t,e=null){try{let r=t.split(".");if(r.length!==3)return!1;let[n]=r;if(!n)return!1;let o=JSON.parse(atob(n));return!("typ"in o&&o?.typ!=="JWT"||!o.alg||e&&(!("alg"in o)||o.alg!==e))}catch{return!1}}function LOt(t,e,r){t.issues.length&&e.issues.push(...Qb(r,t.issues)),e.value[r]=t.value}function cme(t,e,r){t.issues.length&&e.issues.push(...Qb(r,t.issues)),e.value[r]=t.value}function FOt(t,e,r,n){t.issues.length?n[r]===void 0?r in n?e.value[r]=void 0:e.value[r]=t.value:e.issues.push(...Qb(r,t.issues)):t.value===void 0?r in n&&(e.value[r]=void 0):e.value[r]=t.value}function kOt(t,e,r,n){for(let o of t)if(o.issues.length===0)return e.value=o.value,e;return e.issues.push({code:"invalid_union",input:e.value,inst:r,errors:t.map(o=>o.issues.map(i=>Sv(i,n,cd())))}),e}function ZBe(t,e){if(t===e)return{valid:!0,data:t};if(t instanceof Date&&e instanceof Date&&+t==+e)return{valid:!0,data:t};if(u6(t)&&u6(e)){let r=Object.keys(e),n=Object.keys(t).filter(i=>r.indexOf(i)!==-1),o={...t,...e};for(let i of n){let a=ZBe(t[i],e[i]);if(!a.valid)return{valid:!1,mergeErrorPath:[i,...a.mergeErrorPath]};o[i]=a.data}return{valid:!0,data:o}}if(Array.isArray(t)&&Array.isArray(e)){if(t.length!==e.length)return{valid:!1,mergeErrorPath:[]};let r=[];for(let n=0;nSv(s,a,cd()))})),e.issues.length&&(GY.has(typeof n)?r.issues.push(...Qb(n,e.issues)):r.issues.push({origin:"map",code:"invalid_element",input:o,inst:i,key:n,issues:e.issues.map(s=>Sv(s,a,cd()))})),r.value.set(t.value,e.value)}function UOt(t,e){t.issues.length&&e.issues.push(...t.issues),e.value.add(t.value)}function zOt(t,e){return t.value===void 0&&(t.value=e.defaultValue),t}function HOt(t,e){return!t.issues.length&&t.value===void 0&&t.issues.push({code:"invalid_type",expected:"nonoptional",input:t.value,inst:e}),t}function VOt(t,e,r){return iz(t)?t:e.out._zod.run({value:t.value,issues:t.issues},r)}function JOt(t){return t.value=Object.freeze(t.value),t}function KOt(t,e,r,n){if(!t){let o={code:"custom",input:r,inst:n,path:[...n._zod.def.path??[]],continue:!n._zod.def.abort};n._zod.def.params&&(o.params=n._zod.def.params),e.issues.push(Wqe(o))}}var Yn,lz,vu,XBe,YBe,QBe,eUe,tUe,rUe,nUe,oUe,iUe,aUe,sUe,uUe,lUe,cUe,dUe,fUe,pUe,mUe,hUe,yUe,bUe,_Ue,vUe,wUe,fme,SUe,rQ,pme,CUe,xUe,OUe,TUe,EUe,G$,nQ,PUe,MUe,oQ,RUe,mme,AUe,IUe,cz,NUe,jUe,DUe,$Ue,LUe,FUe,iQ,d6,kUe,qUe,BUe,UUe,zUe,HUe,VUe,aQ,JUe,KUe,WUe,GUe,ZUe,sQ=v(()=>{lme();a6();KBe();ome();ame();An();GBe();An();Yn=ve("$ZodType",(t,e)=>{var r;t??(t={}),t._zod.def=e,t._zod.bag=t._zod.bag||{},t._zod.version=WBe;let n=[...t._zod.def.checks??[]];t._zod.traits.has("$ZodCheck")&&n.unshift(t);for(let o of n)for(let i of o._zod.onattach)i(t);if(n.length===0)(r=t._zod).deferred??(r.deferred=[]),t._zod.deferred?.push(()=>{t._zod.run=t._zod.parse});else{let o=(i,a,s)=>{let u=iz(i),l;for(let c of a){if(c._zod.def.when){if(!c._zod.def.when(i))continue}else if(u)continue;let d=i.issues.length,f=c._zod.check(i);if(f instanceof Promise&&s?.async===!1)throw new fO;if(l||f instanceof Promise)l=(l??Promise.resolve()).then(async()=>{await f,i.issues.length!==d&&(u||(u=iz(i,d)))});else{if(i.issues.length===d)continue;u||(u=iz(i,d))}}return l?l.then(()=>i):i};t._zod.run=(i,a)=>{let s=t._zod.parse(i,a);if(s instanceof Promise){if(a.async===!1)throw new fO;return s.then(u=>o(u,n,a))}return o(s,n,a)}}t["~standard"]={validate:o=>{try{let i=Yqe(t,o);return i.success?{value:i.data}:{issues:i.error?.issues}}catch{return Qqe(t,o).then(a=>a.success?{value:a.data}:{issues:a.error?.issues})}},vendor:"zod",version:1}}),lz=ve("$ZodString",(t,e)=>{Yn.init(t,e),t._zod.pattern=[...t?._zod.bag?.patterns??[]].pop()??vBe(t._zod.bag),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=String(r.value)}catch{}return typeof r.value=="string"||r.issues.push({expected:"string",code:"invalid_type",input:r.value,inst:t}),r}}),vu=ve("$ZodStringFormat",(t,e)=>{c6.init(t,e),lz.init(t,e)}),XBe=ve("$ZodGUID",(t,e)=>{e.pattern??(e.pattern=sBe),vu.init(t,e)}),YBe=ve("$ZodUUID",(t,e)=>{if(e.version){let n={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[e.version];if(n===void 0)throw new Error(`Invalid UUID version: "${e.version}"`);e.pattern??(e.pattern=sz(n))}else e.pattern??(e.pattern=sz());vu.init(t,e)}),QBe=ve("$ZodEmail",(t,e)=>{e.pattern??(e.pattern=uBe),vu.init(t,e)}),eUe=ve("$ZodURL",(t,e)=>{vu.init(t,e),t._zod.check=r=>{try{let n=r.value,o=new URL(n),i=o.href;e.hostname&&(e.hostname.lastIndex=0,e.hostname.test(o.hostname)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid hostname",pattern:hBe.source,input:r.value,inst:t,continue:!e.abort})),e.protocol&&(e.protocol.lastIndex=0,e.protocol.test(o.protocol.endsWith(":")?o.protocol.slice(0,-1):o.protocol)||r.issues.push({code:"invalid_format",format:"url",note:"Invalid protocol",pattern:e.protocol.source,input:r.value,inst:t,continue:!e.abort})),!n.endsWith("/")&&i.endsWith("/")?r.value=i.slice(0,-1):r.value=i;return}catch{r.issues.push({code:"invalid_format",format:"url",input:r.value,inst:t,continue:!e.abort})}}}),tUe=ve("$ZodEmoji",(t,e)=>{e.pattern??(e.pattern=lBe()),vu.init(t,e)}),rUe=ve("$ZodNanoID",(t,e)=>{e.pattern??(e.pattern=iBe),vu.init(t,e)}),nUe=ve("$ZodCUID",(t,e)=>{e.pattern??(e.pattern=eBe),vu.init(t,e)}),oUe=ve("$ZodCUID2",(t,e)=>{e.pattern??(e.pattern=tBe),vu.init(t,e)}),iUe=ve("$ZodULID",(t,e)=>{e.pattern??(e.pattern=rBe),vu.init(t,e)}),aUe=ve("$ZodXID",(t,e)=>{e.pattern??(e.pattern=nBe),vu.init(t,e)}),sUe=ve("$ZodKSUID",(t,e)=>{e.pattern??(e.pattern=oBe),vu.init(t,e)}),uUe=ve("$ZodISODateTime",(t,e)=>{e.pattern??(e.pattern=_Be(e)),vu.init(t,e)}),lUe=ve("$ZodISODate",(t,e)=>{e.pattern??(e.pattern=yBe),vu.init(t,e)}),cUe=ve("$ZodISOTime",(t,e)=>{e.pattern??(e.pattern=bBe(e)),vu.init(t,e)}),dUe=ve("$ZodISODuration",(t,e)=>{e.pattern??(e.pattern=aBe),vu.init(t,e)}),fUe=ve("$ZodIPv4",(t,e)=>{e.pattern??(e.pattern=cBe),vu.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv4"})}),pUe=ve("$ZodIPv6",(t,e)=>{e.pattern??(e.pattern=dBe),vu.init(t,e),t._zod.onattach.push(r=>{let n=r._zod.bag;n.format="ipv6"}),t._zod.check=r=>{try{new URL(`http://[${r.value}]`)}catch{r.issues.push({code:"invalid_format",format:"ipv6",input:r.value,inst:t,continue:!e.abort})}}}),mUe=ve("$ZodCIDRv4",(t,e)=>{e.pattern??(e.pattern=fBe),vu.init(t,e)}),hUe=ve("$ZodCIDRv6",(t,e)=>{e.pattern??(e.pattern=pBe),vu.init(t,e),t._zod.check=r=>{let[n,o]=r.value.split("/");try{if(!o)throw new Error;let i=Number(o);if(`${i}`!==o)throw new Error;if(i<0||i>128)throw new Error;new URL(`http://[${n}]`)}catch{r.issues.push({code:"invalid_format",format:"cidrv6",input:r.value,inst:t,continue:!e.abort})}}});yUe=ve("$ZodBase64",(t,e)=>{e.pattern??(e.pattern=mBe),vu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64"}),t._zod.check=r=>{gUe(r.value)||r.issues.push({code:"invalid_format",format:"base64",input:r.value,inst:t,continue:!e.abort})}});bUe=ve("$ZodBase64URL",(t,e)=>{e.pattern??(e.pattern=ime),vu.init(t,e),t._zod.onattach.push(r=>{r._zod.bag.contentEncoding="base64url"}),t._zod.check=r=>{WOt(r.value)||r.issues.push({code:"invalid_format",format:"base64url",input:r.value,inst:t,continue:!e.abort})}}),_Ue=ve("$ZodE164",(t,e)=>{e.pattern??(e.pattern=gBe),vu.init(t,e)});vUe=ve("$ZodJWT",(t,e)=>{vu.init(t,e),t._zod.check=r=>{GOt(r.value,e.alg)||r.issues.push({code:"invalid_format",format:"jwt",input:r.value,inst:t,continue:!e.abort})}}),wUe=ve("$ZodCustomStringFormat",(t,e)=>{vu.init(t,e),t._zod.check=r=>{e.fn(r.value)||r.issues.push({code:"invalid_format",format:e.format,input:r.value,inst:t,continue:!e.abort})}}),fme=ve("$ZodNumber",(t,e)=>{Yn.init(t,e),t._zod.pattern=t._zod.bag.pattern??CBe,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=Number(r.value)}catch{}let o=r.value;if(typeof o=="number"&&!Number.isNaN(o)&&Number.isFinite(o))return r;let i=typeof o=="number"?Number.isNaN(o)?"NaN":Number.isFinite(o)?void 0:"Infinity":void 0;return r.issues.push({expected:"number",code:"invalid_type",input:o,inst:t,...i?{received:i}:{}}),r}}),SUe=ve("$ZodNumber",(t,e)=>{RBe.init(t,e),fme.init(t,e)}),rQ=ve("$ZodBoolean",(t,e)=>{Yn.init(t,e),t._zod.pattern=xBe,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=!!r.value}catch{}let o=r.value;return typeof o=="boolean"||r.issues.push({expected:"boolean",code:"invalid_type",input:o,inst:t}),r}}),pme=ve("$ZodBigInt",(t,e)=>{Yn.init(t,e),t._zod.pattern=wBe,t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=BigInt(r.value)}catch{}return typeof r.value=="bigint"||r.issues.push({expected:"bigint",code:"invalid_type",input:r.value,inst:t}),r}}),CUe=ve("$ZodBigInt",(t,e)=>{ABe.init(t,e),pme.init(t,e)}),xUe=ve("$ZodSymbol",(t,e)=>{Yn.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o=="symbol"||r.issues.push({expected:"symbol",code:"invalid_type",input:o,inst:t}),r}}),OUe=ve("$ZodUndefined",(t,e)=>{Yn.init(t,e),t._zod.pattern=TBe,t._zod.values=new Set([void 0]),t._zod.optin="optional",t._zod.optout="optional",t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"undefined",code:"invalid_type",input:o,inst:t}),r}}),TUe=ve("$ZodNull",(t,e)=>{Yn.init(t,e),t._zod.pattern=OBe,t._zod.values=new Set([null]),t._zod.parse=(r,n)=>{let o=r.value;return o===null||r.issues.push({expected:"null",code:"invalid_type",input:o,inst:t}),r}}),EUe=ve("$ZodAny",(t,e)=>{Yn.init(t,e),t._zod.parse=r=>r}),G$=ve("$ZodUnknown",(t,e)=>{Yn.init(t,e),t._zod.parse=r=>r}),nQ=ve("$ZodNever",(t,e)=>{Yn.init(t,e),t._zod.parse=(r,n)=>(r.issues.push({expected:"never",code:"invalid_type",input:r.value,inst:t}),r)}),PUe=ve("$ZodVoid",(t,e)=>{Yn.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return typeof o>"u"||r.issues.push({expected:"void",code:"invalid_type",input:o,inst:t}),r}}),MUe=ve("$ZodDate",(t,e)=>{Yn.init(t,e),t._zod.parse=(r,n)=>{if(e.coerce)try{r.value=new Date(r.value)}catch{}let o=r.value,i=o instanceof Date;return i&&!Number.isNaN(o.getTime())||r.issues.push({expected:"date",code:"invalid_type",input:o,...i?{received:"Invalid Date"}:{},inst:t}),r}});oQ=ve("$ZodArray",(t,e)=>{Yn.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!Array.isArray(o))return r.issues.push({expected:"array",code:"invalid_type",input:o,inst:t}),r;r.value=Array(o.length);let i=[];for(let a=0;aLOt(l,r,a))):LOt(u,r,a)}return i.length?Promise.all(i).then(()=>r):r}});RUe=ve("$ZodObject",(t,e)=>{Yn.init(t,e);let r=KY(()=>{let d=Object.keys(e.shape);for(let p of d)if(!(e.shape[p]instanceof Yn))throw new Error(`Invalid element at key "${p}": expected a Zod schema`);let f=Vqe(e.shape);return{shape:e.shape,keys:d,keySet:new Set(d),numKeys:d.length,optionalKeys:new Set(f)}});Ns(t._zod,"propValues",()=>{let d=e.shape,f={};for(let p in d){let m=d[p]._zod;if(m.values){f[p]??(f[p]=new Set);for(let h of m.values)f[p].add(h)}}return f});let n=d=>{let f=new tQ(["shape","payload","ctx"]),p=r.value,m=b=>{let _=oz(b);return`shape[${_}]._zod.run({ value: input[${_}], issues: [] }, ctx)`};f.write("const input = payload.value;");let h=Object.create(null),g=0;for(let b of p.keys)h[b]=`key_${g++}`;f.write("const newResult = {}");for(let b of p.keys)if(p.optionalKeys.has(b)){let _=h[b];f.write(`const ${_} = ${m(b)};`);let w=oz(b);f.write(` + if (${_}.issues.length) { + if (input[${w}] === undefined) { + if (${w} in input) { + newResult[${w}] = undefined; + } + } else { + payload.issues = payload.issues.concat( + ${_}.issues.map((iss) => ({ + ...iss, + path: iss.path ? [${w}, ...iss.path] : [${w}], + })) + ); + } + } else if (${_}.value === undefined) { + if (${w} in input) newResult[${w}] = undefined; + } else { + newResult[${w}] = ${_}.value; + } + `)}else{let _=h[b];f.write(`const ${_} = ${m(b)};`),f.write(` + if (${_}.issues.length) payload.issues = payload.issues.concat(${_}.issues.map(iss => ({ + ...iss, + path: iss.path ? [${oz(b)}, ...iss.path] : [${oz(b)}] + })));`),f.write(`newResult[${oz(b)}] = ${_}.value`)}f.write("payload.value = newResult;"),f.write("return payload;");let y=f.compile();return(b,_)=>y(d,b,_)},o,i=s6,a=!HY.jitless,u=a&&zqe.value,l=e.catchall,c;t._zod.parse=(d,f)=>{c??(c=r.value);let p=d.value;if(!i(p))return d.issues.push({expected:"object",code:"invalid_type",input:p,inst:t}),d;let m=[];if(a&&u&&f?.async===!1&&f.jitless!==!0)o||(o=n(e.shape)),d=o(d,f);else{d.value={};let _=c.shape;for(let w of c.keys){let x=_[w],O=x._zod.run({value:p[w],issues:[]},f),E=x._zod.optin==="optional"&&x._zod.optout==="optional";O instanceof Promise?m.push(O.then(T=>E?FOt(T,d,w,p):cme(T,d,w))):E?FOt(O,d,w,p):cme(O,d,w)}}if(!l)return m.length?Promise.all(m).then(()=>d):d;let h=[],g=c.keySet,y=l._zod,b=y.def.type;for(let _ of Object.keys(p)){if(g.has(_))continue;if(b==="never"){h.push(_);continue}let w=y.run({value:p[_],issues:[]},f);w instanceof Promise?m.push(w.then(x=>cme(x,d,_))):cme(w,d,_)}return h.length&&d.issues.push({code:"unrecognized_keys",keys:h,input:p,inst:t}),m.length?Promise.all(m).then(()=>d):d}});mme=ve("$ZodUnion",(t,e)=>{Yn.init(t,e),Ns(t._zod,"optin",()=>e.options.some(r=>r._zod.optin==="optional")?"optional":void 0),Ns(t._zod,"optout",()=>e.options.some(r=>r._zod.optout==="optional")?"optional":void 0),Ns(t._zod,"values",()=>{if(e.options.every(r=>r._zod.values))return new Set(e.options.flatMap(r=>Array.from(r._zod.values)))}),Ns(t._zod,"pattern",()=>{if(e.options.every(r=>r._zod.pattern)){let r=e.options.map(n=>n._zod.pattern);return new RegExp(`^(${r.map(n=>WY(n.source)).join("|")})$`)}}),t._zod.parse=(r,n)=>{let o=!1,i=[];for(let a of e.options){let s=a._zod.run({value:r.value,issues:[]},n);if(s instanceof Promise)i.push(s),o=!0;else{if(s.issues.length===0)return s;i.push(s)}}return o?Promise.all(i).then(a=>kOt(a,r,t,n)):kOt(i,r,t,n)}}),AUe=ve("$ZodDiscriminatedUnion",(t,e)=>{mme.init(t,e);let r=t._zod.parse;Ns(t._zod,"propValues",()=>{let o={};for(let i of e.options){let a=i._zod.propValues;if(!a||Object.keys(a).length===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(i)}"`);for(let[s,u]of Object.entries(a)){o[s]||(o[s]=new Set);for(let l of u)o[s].add(l)}}return o});let n=KY(()=>{let o=e.options,i=new Map;for(let a of o){let s=a._zod.propValues[e.discriminator];if(!s||s.size===0)throw new Error(`Invalid discriminated union option at index "${e.options.indexOf(a)}"`);for(let u of s){if(i.has(u))throw new Error(`Duplicate discriminator value "${String(u)}"`);i.set(u,a)}}return i});t._zod.parse=(o,i)=>{let a=o.value;if(!s6(a))return o.issues.push({code:"invalid_type",expected:"object",input:a,inst:t}),o;let s=n.value.get(a?.[e.discriminator]);return s?s._zod.run(o,i):e.unionFallback?r(o,i):(o.issues.push({code:"invalid_union",errors:[],note:"No matching discriminator",input:a,path:[e.discriminator],inst:t}),o)}}),IUe=ve("$ZodIntersection",(t,e)=>{Yn.init(t,e),t._zod.parse=(r,n)=>{let o=r.value,i=e.left._zod.run({value:o,issues:[]},n),a=e.right._zod.run({value:o,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([u,l])=>qOt(r,u,l)):qOt(r,i,a)}});cz=ve("$ZodTuple",(t,e)=>{Yn.init(t,e);let r=e.items,n=r.length-[...r].reverse().findIndex(o=>o._zod.optin!=="optional");t._zod.parse=(o,i)=>{let a=o.value;if(!Array.isArray(a))return o.issues.push({input:a,inst:t,expected:"tuple",code:"invalid_type"}),o;o.value=[];let s=[];if(!e.rest){let l=a.length>r.length,c=a.length=a.length&&u>=n)continue;let c=l._zod.run({value:a[u],issues:[]},i);c instanceof Promise?s.push(c.then(d=>dme(d,o,u))):dme(c,o,u)}if(e.rest){let l=a.slice(r.length);for(let c of l){u++;let d=e.rest._zod.run({value:c,issues:[]},i);d instanceof Promise?s.push(d.then(f=>dme(f,o,u))):dme(d,o,u)}}return s.length?Promise.all(s).then(()=>o):o}});NUe=ve("$ZodRecord",(t,e)=>{Yn.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!u6(o))return r.issues.push({expected:"record",code:"invalid_type",input:o,inst:t}),r;let i=[];if(e.keyType._zod.values){let a=e.keyType._zod.values;r.value={};for(let u of a)if(typeof u=="string"||typeof u=="number"||typeof u=="symbol"){let l=e.valueType._zod.run({value:o[u],issues:[]},n);l instanceof Promise?i.push(l.then(c=>{c.issues.length&&r.issues.push(...Qb(u,c.issues)),r.value[u]=c.value})):(l.issues.length&&r.issues.push(...Qb(u,l.issues)),r.value[u]=l.value)}let s;for(let u in o)a.has(u)||(s=s??[],s.push(u));s&&s.length>0&&r.issues.push({code:"unrecognized_keys",input:o,inst:t,keys:s})}else{r.value={};for(let a of Reflect.ownKeys(o)){if(a==="__proto__")continue;let s=e.keyType._zod.run({value:a,issues:[]},n);if(s instanceof Promise)throw new Error("Async schemas not supported in object keys currently");if(s.issues.length){r.issues.push({origin:"record",code:"invalid_key",issues:s.issues.map(l=>Sv(l,n,cd())),input:a,path:[a],inst:t}),r.value[s.value]=s.value;continue}let u=e.valueType._zod.run({value:o[a],issues:[]},n);u instanceof Promise?i.push(u.then(l=>{l.issues.length&&r.issues.push(...Qb(a,l.issues)),r.value[s.value]=l.value})):(u.issues.length&&r.issues.push(...Qb(a,u.issues)),r.value[s.value]=u.value)}}return i.length?Promise.all(i).then(()=>r):r}}),jUe=ve("$ZodMap",(t,e)=>{Yn.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Map))return r.issues.push({expected:"map",code:"invalid_type",input:o,inst:t}),r;let i=[];r.value=new Map;for(let[a,s]of o){let u=e.keyType._zod.run({value:a,issues:[]},n),l=e.valueType._zod.run({value:s,issues:[]},n);u instanceof Promise||l instanceof Promise?i.push(Promise.all([u,l]).then(([c,d])=>{BOt(c,d,r,a,o,t,n)})):BOt(u,l,r,a,o,t,n)}return i.length?Promise.all(i).then(()=>r):r}});DUe=ve("$ZodSet",(t,e)=>{Yn.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;if(!(o instanceof Set))return r.issues.push({input:o,inst:t,expected:"set",code:"invalid_type"}),r;let i=[];r.value=new Set;for(let a of o){let s=e.valueType._zod.run({value:a,issues:[]},n);s instanceof Promise?i.push(s.then(u=>UOt(u,r))):UOt(s,r)}return i.length?Promise.all(i).then(()=>r):r}});$Ue=ve("$ZodEnum",(t,e)=>{Yn.init(t,e);let r=JY(e.entries);t._zod.values=new Set(r),t._zod.pattern=new RegExp(`^(${r.filter(n=>GY.has(typeof n)).map(n=>typeof n=="string"?lN(n):n.toString()).join("|")})$`),t._zod.parse=(n,o)=>{let i=n.value;return t._zod.values.has(i)||n.issues.push({code:"invalid_value",values:r,input:i,inst:t}),n}}),LUe=ve("$ZodLiteral",(t,e)=>{Yn.init(t,e),t._zod.values=new Set(e.values),t._zod.pattern=new RegExp(`^(${e.values.map(r=>typeof r=="string"?lN(r):r?r.toString():String(r)).join("|")})$`),t._zod.parse=(r,n)=>{let o=r.value;return t._zod.values.has(o)||r.issues.push({code:"invalid_value",values:e.values,input:o,inst:t}),r}}),FUe=ve("$ZodFile",(t,e)=>{Yn.init(t,e),t._zod.parse=(r,n)=>{let o=r.value;return o instanceof File||r.issues.push({expected:"file",code:"invalid_type",input:o,inst:t}),r}}),iQ=ve("$ZodTransform",(t,e)=>{Yn.init(t,e),t._zod.parse=(r,n)=>{let o=e.transform(r.value,r);if(n.async)return(o instanceof Promise?o:Promise.resolve(o)).then(a=>(r.value=a,r));if(o instanceof Promise)throw new fO;return r.value=o,r}}),d6=ve("$ZodOptional",(t,e)=>{Yn.init(t,e),t._zod.optin="optional",t._zod.optout="optional",Ns(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,void 0]):void 0),Ns(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${WY(r.source)})?$`):void 0}),t._zod.parse=(r,n)=>e.innerType._zod.optin==="optional"?e.innerType._zod.run(r,n):r.value===void 0?r:e.innerType._zod.run(r,n)}),kUe=ve("$ZodNullable",(t,e)=>{Yn.init(t,e),Ns(t._zod,"optin",()=>e.innerType._zod.optin),Ns(t._zod,"optout",()=>e.innerType._zod.optout),Ns(t._zod,"pattern",()=>{let r=e.innerType._zod.pattern;return r?new RegExp(`^(${WY(r.source)}|null)$`):void 0}),Ns(t._zod,"values",()=>e.innerType._zod.values?new Set([...e.innerType._zod.values,null]):void 0),t._zod.parse=(r,n)=>r.value===null?r:e.innerType._zod.run(r,n)}),qUe=ve("$ZodDefault",(t,e)=>{Yn.init(t,e),t._zod.optin="optional",Ns(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{if(r.value===void 0)return r.value=e.defaultValue,r;let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>zOt(i,e)):zOt(o,e)}});BUe=ve("$ZodPrefault",(t,e)=>{Yn.init(t,e),t._zod.optin="optional",Ns(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>(r.value===void 0&&(r.value=e.defaultValue),e.innerType._zod.run(r,n))}),UUe=ve("$ZodNonOptional",(t,e)=>{Yn.init(t,e),Ns(t._zod,"values",()=>{let r=e.innerType._zod.values;return r?new Set([...r].filter(n=>n!==void 0)):void 0}),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>HOt(i,t)):HOt(o,t)}});zUe=ve("$ZodSuccess",(t,e)=>{Yn.init(t,e),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.issues.length===0,r)):(r.value=o.issues.length===0,r)}}),HUe=ve("$ZodCatch",(t,e)=>{Yn.init(t,e),t._zod.optin="optional",Ns(t._zod,"optout",()=>e.innerType._zod.optout),Ns(t._zod,"values",()=>e.innerType._zod.values),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(i=>(r.value=i.value,i.issues.length&&(r.value=e.catchValue({...r,error:{issues:i.issues.map(a=>Sv(a,n,cd()))},input:r.value}),r.issues=[]),r)):(r.value=o.value,o.issues.length&&(r.value=e.catchValue({...r,error:{issues:o.issues.map(i=>Sv(i,n,cd()))},input:r.value}),r.issues=[]),r)}}),VUe=ve("$ZodNaN",(t,e)=>{Yn.init(t,e),t._zod.parse=(r,n)=>((typeof r.value!="number"||!Number.isNaN(r.value))&&r.issues.push({input:r.value,inst:t,expected:"nan",code:"invalid_type"}),r)}),aQ=ve("$ZodPipe",(t,e)=>{Yn.init(t,e),Ns(t._zod,"values",()=>e.in._zod.values),Ns(t._zod,"optin",()=>e.in._zod.optin),Ns(t._zod,"optout",()=>e.out._zod.optout),t._zod.parse=(r,n)=>{let o=e.in._zod.run(r,n);return o instanceof Promise?o.then(i=>VOt(i,e,n)):VOt(o,e,n)}});JUe=ve("$ZodReadonly",(t,e)=>{Yn.init(t,e),Ns(t._zod,"propValues",()=>e.innerType._zod.propValues),Ns(t._zod,"values",()=>e.innerType._zod.values),Ns(t._zod,"optin",()=>e.innerType._zod.optin),Ns(t._zod,"optout",()=>e.innerType._zod.optout),t._zod.parse=(r,n)=>{let o=e.innerType._zod.run(r,n);return o instanceof Promise?o.then(JOt):JOt(o)}});KUe=ve("$ZodTemplateLiteral",(t,e)=>{Yn.init(t,e);let r=[];for(let n of e.parts)if(n instanceof Yn){if(!n._zod.pattern)throw new Error(`Invalid template literal part, no pattern found: ${[...n._zod.traits].shift()}`);let o=n._zod.pattern instanceof RegExp?n._zod.pattern.source:n._zod.pattern;if(!o)throw new Error(`Invalid template literal part: ${n._zod.traits}`);let i=o.startsWith("^")?1:0,a=o.endsWith("$")?o.length-1:o.length;r.push(o.slice(i,a))}else if(n===null||Hqe.has(typeof n))r.push(lN(`${n}`));else throw new Error(`Invalid template literal part: ${n}`);t._zod.pattern=new RegExp(`^${r.join("")}$`),t._zod.parse=(n,o)=>typeof n.value!="string"?(n.issues.push({input:n.value,inst:t,expected:"template_literal",code:"invalid_type"}),n):(t._zod.pattern.lastIndex=0,t._zod.pattern.test(n.value)||n.issues.push({input:n.value,inst:t,code:"invalid_format",format:"template_literal",pattern:t._zod.pattern.source}),n)}),WUe=ve("$ZodPromise",(t,e)=>{Yn.init(t,e),t._zod.parse=(r,n)=>Promise.resolve(r.value).then(o=>e.innerType._zod.run({value:o,issues:[]},n))}),GUe=ve("$ZodLazy",(t,e)=>{Yn.init(t,e),Ns(t._zod,"innerType",()=>e.getter()),Ns(t._zod,"pattern",()=>t._zod.innerType._zod.pattern),Ns(t._zod,"propValues",()=>t._zod.innerType._zod.propValues),Ns(t._zod,"optin",()=>t._zod.innerType._zod.optin),Ns(t._zod,"optout",()=>t._zod.innerType._zod.optout),t._zod.parse=(r,n)=>t._zod.innerType._zod.run(r,n)}),ZUe=ve("$ZodCustom",(t,e)=>{Zl.init(t,e),Yn.init(t,e),t._zod.parse=(r,n)=>r,t._zod.check=r=>{let n=r.value,o=e.fn(n);if(o instanceof Promise)return o.then(i=>KOt(i,r,n,t));KOt(o,r,n,t)}})});function XOt(){return{localeError:Jdn()}}var Jdn,YOt=v(()=>{An();Jdn=()=>{let t={string:{unit:"\u062D\u0631\u0641",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},file:{unit:"\u0628\u0627\u064A\u062A",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},array:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"},set:{unit:"\u0639\u0646\u0635\u0631",verb:"\u0623\u0646 \u064A\u062D\u0648\u064A"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\u0645\u062F\u062E\u0644",email:"\u0628\u0631\u064A\u062F \u0625\u0644\u0643\u062A\u0631\u0648\u0646\u064A",url:"\u0631\u0627\u0628\u0637",emoji:"\u0625\u064A\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u064A\u062E \u0648\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",date:"\u062A\u0627\u0631\u064A\u062E \u0628\u0645\u0639\u064A\u0627\u0631 ISO",time:"\u0648\u0642\u062A \u0628\u0645\u0639\u064A\u0627\u0631 ISO",duration:"\u0645\u062F\u0629 \u0628\u0645\u0639\u064A\u0627\u0631 ISO",ipv4:"\u0639\u0646\u0648\u0627\u0646 IPv4",ipv6:"\u0639\u0646\u0648\u0627\u0646 IPv6",cidrv4:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv4",cidrv6:"\u0645\u062F\u0649 \u0639\u0646\u0627\u0648\u064A\u0646 \u0628\u0635\u064A\u063A\u0629 IPv6",base64:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64-encoded",base64url:"\u0646\u064E\u0635 \u0628\u062A\u0631\u0645\u064A\u0632 base64url-encoded",json_string:"\u0646\u064E\u0635 \u0639\u0644\u0649 \u0647\u064A\u0626\u0629 JSON",e164:"\u0631\u0642\u0645 \u0647\u0627\u062A\u0641 \u0628\u0645\u0639\u064A\u0627\u0631 E.164",jwt:"JWT",template_literal:"\u0645\u062F\u062E\u0644"};return o=>{switch(o.code){case"invalid_type":return`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${o.expected}\u060C \u0648\u0644\u0643\u0646 \u062A\u0645 \u0625\u062F\u062E\u0627\u0644 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0645\u062F\u062E\u0644\u0627\u062A \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644\u0629: \u064A\u0641\u062A\u0631\u0636 \u0625\u062F\u062E\u0627\u0644 ${Nt(o.values[0])}`:`\u0627\u062E\u062A\u064A\u0627\u0631 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062A\u0648\u0642\u0639 \u0627\u0646\u062A\u0642\u0627\u0621 \u0623\u062D\u062F \u0647\u0630\u0647 \u0627\u0644\u062E\u064A\u0627\u0631\u0627\u062A: ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?` \u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${o.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"}`:`\u0623\u0643\u0628\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0623\u0646 \u062A\u0643\u0648\u0646 ${o.origin??"\u0627\u0644\u0642\u064A\u0645\u0629"} ${i} ${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${o.minimum.toString()} ${a.unit}`:`\u0623\u0635\u063A\u0631 \u0645\u0646 \u0627\u0644\u0644\u0627\u0632\u0645: \u064A\u0641\u062A\u0631\u0636 \u0644\u0640 ${o.origin} \u0623\u0646 \u064A\u0643\u0648\u0646 ${i} ${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0628\u062F\u0623 \u0628\u0640 "${o.prefix}"`:i.format==="ends_with"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0646\u062A\u0647\u064A \u0628\u0640 "${i.suffix}"`:i.format==="includes"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u062A\u0636\u0645\u0651\u064E\u0646 "${i.includes}"`:i.format==="regex"?`\u0646\u064E\u0635 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0637\u0627\u0628\u0642 \u0627\u0644\u0646\u0645\u0637 ${i.pattern}`:`${n[i.format]??o.format} \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644`}case"not_multiple_of":return`\u0631\u0642\u0645 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644: \u064A\u062C\u0628 \u0623\u0646 \u064A\u0643\u0648\u0646 \u0645\u0646 \u0645\u0636\u0627\u0639\u0641\u0627\u062A ${o.divisor}`;case"unrecognized_keys":return`\u0645\u0639\u0631\u0641${o.keys.length>1?"\u0627\u062A":""} \u063A\u0631\u064A\u0628${o.keys.length>1?"\u0629":""}: ${Le(o.keys,"\u060C ")}`;case"invalid_key":return`\u0645\u0639\u0631\u0641 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;case"invalid_union":return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644";case"invalid_element":return`\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644 \u0641\u064A ${o.origin}`;default:return"\u0645\u062F\u062E\u0644 \u063A\u064A\u0631 \u0645\u0642\u0628\u0648\u0644"}}}});function QOt(){return{localeError:Kdn()}}var Kdn,eTt=v(()=>{An();Kdn=()=>{let t={string:{unit:"simvol",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"element",verb:"olmal\u0131d\u0131r"},set:{unit:"element",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${o.expected}, daxil olan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Yanl\u0131\u015F d\u0259y\u0259r: g\xF6zl\u0259nil\u0259n ${Nt(o.values[0])}`:`Yanl\u0131\u015F se\xE7im: a\u015Fa\u011F\u0131dak\u0131lardan biri olmal\u0131d\u0131r: ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${i}${o.maximum.toString()} ${a.unit??"element"}`:`\xC7ox b\xF6y\xFCk: g\xF6zl\u0259nil\u0259n ${o.origin??"d\u0259y\u0259r"} ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${i}${o.minimum.toString()} ${a.unit}`:`\xC7ox ki\xE7ik: g\xF6zl\u0259nil\u0259n ${o.origin} ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Yanl\u0131\u015F m\u0259tn: "${i.prefix}" il\u0259 ba\u015Flamal\u0131d\u0131r`:i.format==="ends_with"?`Yanl\u0131\u015F m\u0259tn: "${i.suffix}" il\u0259 bitm\u0259lidir`:i.format==="includes"?`Yanl\u0131\u015F m\u0259tn: "${i.includes}" daxil olmal\u0131d\u0131r`:i.format==="regex"?`Yanl\u0131\u015F m\u0259tn: ${i.pattern} \u015Fablonuna uy\u011Fun olmal\u0131d\u0131r`:`Yanl\u0131\u015F ${n[i.format]??o.format}`}case"not_multiple_of":return`Yanl\u0131\u015F \u0259d\u0259d: ${o.divisor} il\u0259 b\xF6l\xFCn\u0259 bil\u0259n olmal\u0131d\u0131r`;case"unrecognized_keys":return`Tan\u0131nmayan a\xE7ar${o.keys.length>1?"lar":""}: ${Le(o.keys,", ")}`;case"invalid_key":return`${o.origin} daxilind\u0259 yanl\u0131\u015F a\xE7ar`;case"invalid_union":return"Yanl\u0131\u015F d\u0259y\u0259r";case"invalid_element":return`${o.origin} daxilind\u0259 yanl\u0131\u015F d\u0259y\u0259r`;default:return"Yanl\u0131\u015F d\u0259y\u0259r"}}}});function tTt(t,e,r,n){let o=Math.abs(t),i=o%10,a=o%100;return a>=11&&a<=19?n:i===1?e:i>=2&&i<=4?r:n}function rTt(){return{localeError:Wdn()}}var Wdn,nTt=v(()=>{An();Wdn=()=>{let t={string:{unit:{one:"\u0441\u0456\u043C\u0432\u0430\u043B",few:"\u0441\u0456\u043C\u0432\u0430\u043B\u044B",many:"\u0441\u0456\u043C\u0432\u0430\u043B\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u044B",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u044B",many:"\u0431\u0430\u0439\u0442\u0430\u045E"},verb:"\u043C\u0435\u0446\u044C"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"\u043B\u0456\u043A";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0456\u045E";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\u0443\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0430\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0456 \u0447\u0430\u0441",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0447\u0430\u0441",duration:"ISO \u043F\u0440\u0430\u0446\u044F\u0433\u043B\u0430\u0441\u0446\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0430\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0430\u0441",cidrv4:"IPv4 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u044B\u044F\u043F\u0430\u0437\u043E\u043D",base64:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64",base64url:"\u0440\u0430\u0434\u043E\u043A \u0443 \u0444\u0430\u0440\u043C\u0430\u0446\u0435 base64url",json_string:"JSON \u0440\u0430\u0434\u043E\u043A",e164:"\u043D\u0443\u043C\u0430\u0440 E.164",jwt:"JWT",template_literal:"\u0443\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u045E\u0441\u044F ${o.expected}, \u0430\u0442\u0440\u044B\u043C\u0430\u043D\u0430 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F ${Nt(o.values[0])}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0432\u0430\u0440\u044B\u044F\u043D\u0442: \u0447\u0430\u043A\u0430\u045E\u0441\u044F \u0430\u0434\u0437\u0456\u043D \u0437 ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);if(a){let s=Number(o.maximum),u=tTt(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${o.maximum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u0432\u044F\u043B\u0456\u043A\u0456: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435"} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);if(a){let s=Number(o.minimum),u=tTt(s,a.unit.one,a.unit.few,a.unit.many);return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 ${a.verb} ${i}${o.minimum.toString()} ${u}`}return`\u0417\u0430\u043D\u0430\u0434\u0442\u0430 \u043C\u0430\u043B\u044B: \u0447\u0430\u043A\u0430\u043B\u0430\u0441\u044F, \u0448\u0442\u043E ${o.origin} \u043F\u0430\u0432\u0456\u043D\u043D\u0430 \u0431\u044B\u0446\u044C ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u043F\u0430\u0447\u044B\u043D\u0430\u0446\u0446\u0430 \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u0430\u043A\u0430\u043D\u0447\u0432\u0430\u0446\u0446\u0430 \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0437\u043C\u044F\u0448\u0447\u0430\u0446\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u0440\u0430\u0434\u043E\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0430\u0434\u043F\u0430\u0432\u044F\u0434\u0430\u0446\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B ${n[i.format]??o.format}`}case"not_multiple_of":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043B\u0456\u043A: \u043F\u0430\u0432\u0456\u043D\u0435\u043D \u0431\u044B\u0446\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u0430\u0437\u043D\u0430\u043D\u044B ${o.keys.length>1?"\u043A\u043B\u044E\u0447\u044B":"\u043A\u043B\u044E\u0447"}: ${Le(o.keys,", ")}`;case"invalid_key":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434";case"invalid_element":return`\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u0430\u0435 \u0437\u043D\u0430\u0447\u044D\u043D\u043D\u0435 \u045E ${o.origin}`;default:return"\u041D\u044F\u043F\u0440\u0430\u0432\u0456\u043B\u044C\u043D\u044B \u045E\u0432\u043E\u0434"}}}});function oTt(){return{localeError:Gdn()}}var Gdn,iTt=v(()=>{An();Gdn=()=>{let t={string:{unit:"car\xE0cters",verb:"contenir"},file:{unit:"bytes",verb:"contenir"},array:{unit:"elements",verb:"contenir"},set:{unit:"elements",verb:"contenir"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"entrada",email:"adre\xE7a electr\xF2nica",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i hora ISO",date:"data ISO",time:"hora ISO",duration:"durada ISO",ipv4:"adre\xE7a IPv4",ipv6:"adre\xE7a IPv6",cidrv4:"rang IPv4",cidrv6:"rang IPv6",base64:"cadena codificada en base64",base64url:"cadena codificada en base64url",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipus inv\xE0lid: s'esperava ${o.expected}, s'ha rebut ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Valor inv\xE0lid: s'esperava ${Nt(o.values[0])}`:`Opci\xF3 inv\xE0lida: s'esperava una de ${Le(o.values," o ")}`;case"too_big":{let i=o.inclusive?"com a m\xE0xim":"menys de",a=e(o.origin);return a?`Massa gran: s'esperava que ${o.origin??"el valor"} contingu\xE9s ${i} ${o.maximum.toString()} ${a.unit??"elements"}`:`Massa gran: s'esperava que ${o.origin??"el valor"} fos ${i} ${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?"com a m\xEDnim":"m\xE9s de",a=e(o.origin);return a?`Massa petit: s'esperava que ${o.origin} contingu\xE9s ${i} ${o.minimum.toString()} ${a.unit}`:`Massa petit: s'esperava que ${o.origin} fos ${i} ${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Format inv\xE0lid: ha de comen\xE7ar amb "${i.prefix}"`:i.format==="ends_with"?`Format inv\xE0lid: ha d'acabar amb "${i.suffix}"`:i.format==="includes"?`Format inv\xE0lid: ha d'incloure "${i.includes}"`:i.format==="regex"?`Format inv\xE0lid: ha de coincidir amb el patr\xF3 ${i.pattern}`:`Format inv\xE0lid per a ${n[i.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE0lid: ha de ser m\xFAltiple de ${o.divisor}`;case"unrecognized_keys":return`Clau${o.keys.length>1?"s":""} no reconeguda${o.keys.length>1?"s":""}: ${Le(o.keys,", ")}`;case"invalid_key":return`Clau inv\xE0lida a ${o.origin}`;case"invalid_union":return"Entrada inv\xE0lida";case"invalid_element":return`Element inv\xE0lid a ${o.origin}`;default:return"Entrada inv\xE0lida"}}}});function aTt(){return{localeError:Zdn()}}var Zdn,sTt=v(()=>{An();Zdn=()=>{let t={string:{unit:"znak\u016F",verb:"m\xEDt"},file:{unit:"bajt\u016F",verb:"m\xEDt"},array:{unit:"prvk\u016F",verb:"m\xEDt"},set:{unit:"prvk\u016F",verb:"m\xEDt"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"\u010D\xEDslo";case"string":return"\u0159et\u011Bzec";case"boolean":return"boolean";case"bigint":return"bigint";case"function":return"funkce";case"symbol":return"symbol";case"undefined":return"undefined";case"object":{if(Array.isArray(o))return"pole";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"regul\xE1rn\xED v\xFDraz",email:"e-mailov\xE1 adresa",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"datum a \u010Das ve form\xE1tu ISO",date:"datum ve form\xE1tu ISO",time:"\u010Das ve form\xE1tu ISO",duration:"doba trv\xE1n\xED ISO",ipv4:"IPv4 adresa",ipv6:"IPv6 adresa",cidrv4:"rozsah IPv4",cidrv6:"rozsah IPv6",base64:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64",base64url:"\u0159et\u011Bzec zak\xF3dovan\xFD ve form\xE1tu base64url",json_string:"\u0159et\u011Bzec ve form\xE1tu JSON",e164:"\u010D\xEDslo E.164",jwt:"JWT",template_literal:"vstup"};return o=>{switch(o.code){case"invalid_type":return`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${o.expected}, obdr\u017Eeno ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neplatn\xFD vstup: o\u010Dek\xE1v\xE1no ${Nt(o.values[0])}`:`Neplatn\xE1 mo\u017Enost: o\u010Dek\xE1v\xE1na jedna z hodnot ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${i}${o.maximum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 velk\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED m\xEDt ${i}${o.minimum.toString()} ${a.unit??"prvk\u016F"}`:`Hodnota je p\u0159\xEDli\u0161 mal\xE1: ${o.origin??"hodnota"} mus\xED b\xFDt ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED za\u010D\xEDnat na "${i.prefix}"`:i.format==="ends_with"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED kon\u010Dit na "${i.suffix}"`:i.format==="includes"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED obsahovat "${i.includes}"`:i.format==="regex"?`Neplatn\xFD \u0159et\u011Bzec: mus\xED odpov\xEDdat vzoru ${i.pattern}`:`Neplatn\xFD form\xE1t ${n[i.format]??o.format}`}case"not_multiple_of":return`Neplatn\xE9 \u010D\xEDslo: mus\xED b\xFDt n\xE1sobkem ${o.divisor}`;case"unrecognized_keys":return`Nezn\xE1m\xE9 kl\xED\u010De: ${Le(o.keys,", ")}`;case"invalid_key":return`Neplatn\xFD kl\xED\u010D v ${o.origin}`;case"invalid_union":return"Neplatn\xFD vstup";case"invalid_element":return`Neplatn\xE1 hodnota v ${o.origin}`;default:return"Neplatn\xFD vstup"}}}});function uTt(){return{localeError:Xdn()}}var Xdn,lTt=v(()=>{An();Xdn=()=>{let t={string:{unit:"Zeichen",verb:"zu haben"},file:{unit:"Bytes",verb:"zu haben"},array:{unit:"Elemente",verb:"zu haben"},set:{unit:"Elemente",verb:"zu haben"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"Zahl";case"object":{if(Array.isArray(o))return"Array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"Eingabe",email:"E-Mail-Adresse",url:"URL",emoji:"Emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-Datum und -Uhrzeit",date:"ISO-Datum",time:"ISO-Uhrzeit",duration:"ISO-Dauer",ipv4:"IPv4-Adresse",ipv6:"IPv6-Adresse",cidrv4:"IPv4-Bereich",cidrv6:"IPv6-Bereich",base64:"Base64-codierter String",base64url:"Base64-URL-codierter String",json_string:"JSON-String",e164:"E.164-Nummer",jwt:"JWT",template_literal:"Eingabe"};return o=>{switch(o.code){case"invalid_type":return`Ung\xFCltige Eingabe: erwartet ${o.expected}, erhalten ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ung\xFCltige Eingabe: erwartet ${Nt(o.values[0])}`:`Ung\xFCltige Option: erwartet eine von ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${i}${o.maximum.toString()} ${a.unit??"Elemente"} hat`:`Zu gro\xDF: erwartet, dass ${o.origin??"Wert"} ${i}${o.maximum.toString()} ist`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`Zu klein: erwartet, dass ${o.origin} ${i}${o.minimum.toString()} ${a.unit} hat`:`Zu klein: erwartet, dass ${o.origin} ${i}${o.minimum.toString()} ist`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Ung\xFCltiger String: muss mit "${i.prefix}" beginnen`:i.format==="ends_with"?`Ung\xFCltiger String: muss mit "${i.suffix}" enden`:i.format==="includes"?`Ung\xFCltiger String: muss "${i.includes}" enthalten`:i.format==="regex"?`Ung\xFCltiger String: muss dem Muster ${i.pattern} entsprechen`:`Ung\xFCltig: ${n[i.format]??o.format}`}case"not_multiple_of":return`Ung\xFCltige Zahl: muss ein Vielfaches von ${o.divisor} sein`;case"unrecognized_keys":return`${o.keys.length>1?"Unbekannte Schl\xFCssel":"Unbekannter Schl\xFCssel"}: ${Le(o.keys,", ")}`;case"invalid_key":return`Ung\xFCltiger Schl\xFCssel in ${o.origin}`;case"invalid_union":return"Ung\xFCltige Eingabe";case"invalid_element":return`Ung\xFCltiger Wert in ${o.origin}`;default:return"Ung\xFCltige Eingabe"}}}});function hme(){return{localeError:Qdn()}}var Ydn,Qdn,XUe=v(()=>{An();Ydn=t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},Qdn=()=>{let t={string:{unit:"characters",verb:"to have"},file:{unit:"bytes",verb:"to have"},array:{unit:"items",verb:"to have"},set:{unit:"items",verb:"to have"}};function e(n){return t[n]??null}let r={regex:"input",email:"email address",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datetime",date:"ISO date",time:"ISO time",duration:"ISO duration",ipv4:"IPv4 address",ipv6:"IPv6 address",cidrv4:"IPv4 range",cidrv6:"IPv6 range",base64:"base64-encoded string",base64url:"base64url-encoded string",json_string:"JSON string",e164:"E.164 number",jwt:"JWT",template_literal:"input"};return n=>{switch(n.code){case"invalid_type":return`Invalid input: expected ${n.expected}, received ${Ydn(n.input)}`;case"invalid_value":return n.values.length===1?`Invalid input: expected ${Nt(n.values[0])}`:`Invalid option: expected one of ${Le(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",i=e(n.origin);return i?`Too big: expected ${n.origin??"value"} to have ${o}${n.maximum.toString()} ${i.unit??"elements"}`:`Too big: expected ${n.origin??"value"} to be ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",i=e(n.origin);return i?`Too small: expected ${n.origin} to have ${o}${n.minimum.toString()} ${i.unit}`:`Too small: expected ${n.origin} to be ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Invalid string: must start with "${o.prefix}"`:o.format==="ends_with"?`Invalid string: must end with "${o.suffix}"`:o.format==="includes"?`Invalid string: must include "${o.includes}"`:o.format==="regex"?`Invalid string: must match pattern ${o.pattern}`:`Invalid ${r[o.format]??n.format}`}case"not_multiple_of":return`Invalid number: must be a multiple of ${n.divisor}`;case"unrecognized_keys":return`Unrecognized key${n.keys.length>1?"s":""}: ${Le(n.keys,", ")}`;case"invalid_key":return`Invalid key in ${n.origin}`;case"invalid_union":return"Invalid input";case"invalid_element":return`Invalid value in ${n.origin}`;default:return"Invalid input"}}}});function cTt(){return{localeError:tfn()}}var efn,tfn,dTt=v(()=>{An();efn=t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"nombro";case"object":{if(Array.isArray(t))return"tabelo";if(t===null)return"senvalora";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},tfn=()=>{let t={string:{unit:"karaktrojn",verb:"havi"},file:{unit:"bajtojn",verb:"havi"},array:{unit:"elementojn",verb:"havi"},set:{unit:"elementojn",verb:"havi"}};function e(n){return t[n]??null}let r={regex:"enigo",email:"retadreso",url:"URL",emoji:"emo\u011Dio",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datotempo",date:"ISO-dato",time:"ISO-tempo",duration:"ISO-da\u016Dro",ipv4:"IPv4-adreso",ipv6:"IPv6-adreso",cidrv4:"IPv4-rango",cidrv6:"IPv6-rango",base64:"64-ume kodita karaktraro",base64url:"URL-64-ume kodita karaktraro",json_string:"JSON-karaktraro",e164:"E.164-nombro",jwt:"JWT",template_literal:"enigo"};return n=>{switch(n.code){case"invalid_type":return`Nevalida enigo: atendi\u011Dis ${n.expected}, ricevi\u011Dis ${efn(n.input)}`;case"invalid_value":return n.values.length===1?`Nevalida enigo: atendi\u011Dis ${Nt(n.values[0])}`:`Nevalida opcio: atendi\u011Dis unu el ${Le(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",i=e(n.origin);return i?`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()} ${i.unit??"elementojn"}`:`Tro granda: atendi\u011Dis ke ${n.origin??"valoro"} havu ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",i=e(n.origin);return i?`Tro malgranda: atendi\u011Dis ke ${n.origin} havu ${o}${n.minimum.toString()} ${i.unit}`:`Tro malgranda: atendi\u011Dis ke ${n.origin} estu ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Nevalida karaktraro: devas komenci\u011Di per "${o.prefix}"`:o.format==="ends_with"?`Nevalida karaktraro: devas fini\u011Di per "${o.suffix}"`:o.format==="includes"?`Nevalida karaktraro: devas inkluzivi "${o.includes}"`:o.format==="regex"?`Nevalida karaktraro: devas kongrui kun la modelo ${o.pattern}`:`Nevalida ${r[o.format]??n.format}`}case"not_multiple_of":return`Nevalida nombro: devas esti oblo de ${n.divisor}`;case"unrecognized_keys":return`Nekonata${n.keys.length>1?"j":""} \u015Dlosilo${n.keys.length>1?"j":""}: ${Le(n.keys,", ")}`;case"invalid_key":return`Nevalida \u015Dlosilo en ${n.origin}`;case"invalid_union":return"Nevalida enigo";case"invalid_element":return`Nevalida valoro en ${n.origin}`;default:return"Nevalida enigo"}}}});function fTt(){return{localeError:rfn()}}var rfn,pTt=v(()=>{An();rfn=()=>{let t={string:{unit:"caracteres",verb:"tener"},file:{unit:"bytes",verb:"tener"},array:{unit:"elementos",verb:"tener"},set:{unit:"elementos",verb:"tener"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"arreglo";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype)return o.constructor.name}}return i},n={regex:"entrada",email:"direcci\xF3n de correo electr\xF3nico",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"fecha y hora ISO",date:"fecha ISO",time:"hora ISO",duration:"duraci\xF3n ISO",ipv4:"direcci\xF3n IPv4",ipv6:"direcci\xF3n IPv6",cidrv4:"rango IPv4",cidrv6:"rango IPv6",base64:"cadena codificada en base64",base64url:"URL codificada en base64",json_string:"cadena JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Entrada inv\xE1lida: se esperaba ${o.expected}, recibido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: se esperaba ${Nt(o.values[0])}`:`Opci\xF3n inv\xE1lida: se esperaba una de ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`Demasiado grande: se esperaba que ${o.origin??"valor"} tuviera ${i}${o.maximum.toString()} ${a.unit??"elementos"}`:`Demasiado grande: se esperaba que ${o.origin??"valor"} fuera ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`Demasiado peque\xF1o: se esperaba que ${o.origin} tuviera ${i}${o.minimum.toString()} ${a.unit}`:`Demasiado peque\xF1o: se esperaba que ${o.origin} fuera ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Cadena inv\xE1lida: debe comenzar con "${i.prefix}"`:i.format==="ends_with"?`Cadena inv\xE1lida: debe terminar en "${i.suffix}"`:i.format==="includes"?`Cadena inv\xE1lida: debe incluir "${i.includes}"`:i.format==="regex"?`Cadena inv\xE1lida: debe coincidir con el patr\xF3n ${i.pattern}`:`Inv\xE1lido ${n[i.format]??o.format}`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: debe ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Llave${o.keys.length>1?"s":""} desconocida${o.keys.length>1?"s":""}: ${Le(o.keys,", ")}`;case"invalid_key":return`Llave inv\xE1lida en ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido en ${o.origin}`;default:return"Entrada inv\xE1lida"}}}});function mTt(){return{localeError:nfn()}}var nfn,hTt=v(()=>{An();nfn=()=>{let t={string:{unit:"\u06A9\u0627\u0631\u0627\u06A9\u062A\u0631",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},file:{unit:"\u0628\u0627\u06CC\u062A",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},array:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"},set:{unit:"\u0622\u06CC\u062A\u0645",verb:"\u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0622\u0631\u0627\u06CC\u0647";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\u0648\u0631\u0648\u062F\u06CC",email:"\u0622\u062F\u0631\u0633 \u0627\u06CC\u0645\u06CC\u0644",url:"URL",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u062A\u0627\u0631\u06CC\u062E \u0648 \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",date:"\u062A\u0627\u0631\u06CC\u062E \u0627\u06CC\u0632\u0648",time:"\u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",duration:"\u0645\u062F\u062A \u0632\u0645\u0627\u0646 \u0627\u06CC\u0632\u0648",ipv4:"IPv4 \u0622\u062F\u0631\u0633",ipv6:"IPv6 \u0622\u062F\u0631\u0633",cidrv4:"IPv4 \u062F\u0627\u0645\u0646\u0647",cidrv6:"IPv6 \u062F\u0627\u0645\u0646\u0647",base64:"base64-encoded \u0631\u0634\u062A\u0647",base64url:"base64url-encoded \u0631\u0634\u062A\u0647",json_string:"JSON \u0631\u0634\u062A\u0647",e164:"E.164 \u0639\u062F\u062F",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u06CC"};return o=>{switch(o.code){case"invalid_type":return`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${o.expected} \u0645\u06CC\u200C\u0628\u0648\u062F\u060C ${r(o.input)} \u062F\u0631\u06CC\u0627\u0641\u062A \u0634\u062F`;case"invalid_value":return o.values.length===1?`\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A ${Nt(o.values[0])} \u0645\u06CC\u200C\u0628\u0648\u062F`:`\u06AF\u0632\u06CC\u0646\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0645\u06CC\u200C\u0628\u0627\u06CC\u0633\u062A \u06CC\u06A9\u06CC \u0627\u0632 ${Le(o.values,"|")} \u0645\u06CC\u200C\u0628\u0648\u062F`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${o.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631"} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u0628\u0632\u0631\u06AF: ${o.origin??"\u0645\u0642\u062F\u0627\u0631"} \u0628\u0627\u06CC\u062F ${i}${o.maximum.toString()} \u0628\u0627\u0634\u062F`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${i}${o.minimum.toString()} ${a.unit} \u0628\u0627\u0634\u062F`:`\u062E\u06CC\u0644\u06CC \u06A9\u0648\u0686\u06A9: ${o.origin} \u0628\u0627\u06CC\u062F ${i}${o.minimum.toString()} \u0628\u0627\u0634\u062F`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.prefix}" \u0634\u0631\u0648\u0639 \u0634\u0648\u062F`:i.format==="ends_with"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 "${i.suffix}" \u062A\u0645\u0627\u0645 \u0634\u0648\u062F`:i.format==="includes"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0634\u0627\u0645\u0644 "${i.includes}" \u0628\u0627\u0634\u062F`:i.format==="regex"?`\u0631\u0634\u062A\u0647 \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0628\u0627 \u0627\u0644\u06AF\u0648\u06CC ${i.pattern} \u0645\u0637\u0627\u0628\u0642\u062A \u062F\u0627\u0634\u062A\u0647 \u0628\u0627\u0634\u062F`:`${n[i.format]??o.format} \u0646\u0627\u0645\u0639\u062A\u0628\u0631`}case"not_multiple_of":return`\u0639\u062F\u062F \u0646\u0627\u0645\u0639\u062A\u0628\u0631: \u0628\u0627\u06CC\u062F \u0645\u0636\u0631\u0628 ${o.divisor} \u0628\u0627\u0634\u062F`;case"unrecognized_keys":return`\u06A9\u0644\u06CC\u062F${o.keys.length>1?"\u0647\u0627\u06CC":""} \u0646\u0627\u0634\u0646\u0627\u0633: ${Le(o.keys,", ")}`;case"invalid_key":return`\u06A9\u0644\u06CC\u062F \u0646\u0627\u0634\u0646\u0627\u0633 \u062F\u0631 ${o.origin}`;case"invalid_union":return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631";case"invalid_element":return`\u0645\u0642\u062F\u0627\u0631 \u0646\u0627\u0645\u0639\u062A\u0628\u0631 \u062F\u0631 ${o.origin}`;default:return"\u0648\u0631\u0648\u062F\u06CC \u0646\u0627\u0645\u0639\u062A\u0628\u0631"}}}});function gTt(){return{localeError:ofn()}}var ofn,yTt=v(()=>{An();ofn=()=>{let t={string:{unit:"merkki\xE4",subject:"merkkijonon"},file:{unit:"tavua",subject:"tiedoston"},array:{unit:"alkiota",subject:"listan"},set:{unit:"alkiota",subject:"joukon"},number:{unit:"",subject:"luvun"},bigint:{unit:"",subject:"suuren kokonaisluvun"},int:{unit:"",subject:"kokonaisluvun"},date:{unit:"",subject:"p\xE4iv\xE4m\xE4\xE4r\xE4n"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"s\xE4\xE4nn\xF6llinen lauseke",email:"s\xE4hk\xF6postiosoite",url:"URL-osoite",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-aikaleima",date:"ISO-p\xE4iv\xE4m\xE4\xE4r\xE4",time:"ISO-aika",duration:"ISO-kesto",ipv4:"IPv4-osoite",ipv6:"IPv6-osoite",cidrv4:"IPv4-alue",cidrv6:"IPv6-alue",base64:"base64-koodattu merkkijono",base64url:"base64url-koodattu merkkijono",json_string:"JSON-merkkijono",e164:"E.164-luku",jwt:"JWT",template_literal:"templaattimerkkijono"};return o=>{switch(o.code){case"invalid_type":return`Virheellinen tyyppi: odotettiin ${o.expected}, oli ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Virheellinen sy\xF6te: t\xE4ytyy olla ${Nt(o.values[0])}`:`Virheellinen valinta: t\xE4ytyy olla yksi seuraavista: ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`Liian suuri: ${a.subject} t\xE4ytyy olla ${i}${o.maximum.toString()} ${a.unit}`.trim():`Liian suuri: arvon t\xE4ytyy olla ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`Liian pieni: ${a.subject} t\xE4ytyy olla ${i}${o.minimum.toString()} ${a.unit}`.trim():`Liian pieni: arvon t\xE4ytyy olla ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Virheellinen sy\xF6te: t\xE4ytyy alkaa "${i.prefix}"`:i.format==="ends_with"?`Virheellinen sy\xF6te: t\xE4ytyy loppua "${i.suffix}"`:i.format==="includes"?`Virheellinen sy\xF6te: t\xE4ytyy sis\xE4lt\xE4\xE4 "${i.includes}"`:i.format==="regex"?`Virheellinen sy\xF6te: t\xE4ytyy vastata s\xE4\xE4nn\xF6llist\xE4 lauseketta ${i.pattern}`:`Virheellinen ${n[i.format]??o.format}`}case"not_multiple_of":return`Virheellinen luku: t\xE4ytyy olla luvun ${o.divisor} monikerta`;case"unrecognized_keys":return`${o.keys.length>1?"Tuntemattomat avaimet":"Tuntematon avain"}: ${Le(o.keys,", ")}`;case"invalid_key":return"Virheellinen avain tietueessa";case"invalid_union":return"Virheellinen unioni";case"invalid_element":return"Virheellinen arvo joukossa";default:return"Virheellinen sy\xF6te"}}}});function bTt(){return{localeError:ifn()}}var ifn,_Tt=v(()=>{An();ifn=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"nombre";case"object":{if(Array.isArray(o))return"tableau";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"entr\xE9e",email:"adresse e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date et heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : ${o.expected} attendu, ${r(o.input)} re\xE7u`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : ${Nt(o.values[0])} attendu`:`Option invalide : une valeur parmi ${Le(o.values,"|")} attendue`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`Trop grand : ${o.origin??"valeur"} doit ${a.verb} ${i}${o.maximum.toString()} ${a.unit??"\xE9l\xE9ment(s)"}`:`Trop grand : ${o.origin??"valeur"} doit \xEAtre ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`Trop petit : ${o.origin} doit ${a.verb} ${i}${o.minimum.toString()} ${a.unit}`:`Trop petit : ${o.origin} doit \xEAtre ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au mod\xE8le ${i.pattern}`:`${n[i.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${Le(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}}});function vTt(){return{localeError:afn()}}var afn,wTt=v(()=>{An();afn=()=>{let t={string:{unit:"caract\xE8res",verb:"avoir"},file:{unit:"octets",verb:"avoir"},array:{unit:"\xE9l\xE9ments",verb:"avoir"},set:{unit:"\xE9l\xE9ments",verb:"avoir"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"entr\xE9e",email:"adresse courriel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"date-heure ISO",date:"date ISO",time:"heure ISO",duration:"dur\xE9e ISO",ipv4:"adresse IPv4",ipv6:"adresse IPv6",cidrv4:"plage IPv4",cidrv6:"plage IPv6",base64:"cha\xEEne encod\xE9e en base64",base64url:"cha\xEEne encod\xE9e en base64url",json_string:"cha\xEEne JSON",e164:"num\xE9ro E.164",jwt:"JWT",template_literal:"entr\xE9e"};return o=>{switch(o.code){case"invalid_type":return`Entr\xE9e invalide : attendu ${o.expected}, re\xE7u ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entr\xE9e invalide : attendu ${Nt(o.values[0])}`:`Option invalide : attendu l'une des valeurs suivantes ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"\u2264":"<",a=e(o.origin);return a?`Trop grand : attendu que ${o.origin??"la valeur"} ait ${i}${o.maximum.toString()} ${a.unit}`:`Trop grand : attendu que ${o.origin??"la valeur"} soit ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?"\u2265":">",a=e(o.origin);return a?`Trop petit : attendu que ${o.origin} ait ${i}${o.minimum.toString()} ${a.unit}`:`Trop petit : attendu que ${o.origin} soit ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Cha\xEEne invalide : doit commencer par "${i.prefix}"`:i.format==="ends_with"?`Cha\xEEne invalide : doit se terminer par "${i.suffix}"`:i.format==="includes"?`Cha\xEEne invalide : doit inclure "${i.includes}"`:i.format==="regex"?`Cha\xEEne invalide : doit correspondre au motif ${i.pattern}`:`${n[i.format]??o.format} invalide`}case"not_multiple_of":return`Nombre invalide : doit \xEAtre un multiple de ${o.divisor}`;case"unrecognized_keys":return`Cl\xE9${o.keys.length>1?"s":""} non reconnue${o.keys.length>1?"s":""} : ${Le(o.keys,", ")}`;case"invalid_key":return`Cl\xE9 invalide dans ${o.origin}`;case"invalid_union":return"Entr\xE9e invalide";case"invalid_element":return`Valeur invalide dans ${o.origin}`;default:return"Entr\xE9e invalide"}}}});function STt(){return{localeError:sfn()}}var sfn,CTt=v(()=>{An();sfn=()=>{let t={string:{unit:"\u05D0\u05D5\u05EA\u05D9\u05D5\u05EA",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},file:{unit:"\u05D1\u05D9\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},array:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"},set:{unit:"\u05E4\u05E8\u05D9\u05D8\u05D9\u05DD",verb:"\u05DC\u05DB\u05DC\u05D5\u05DC"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\u05E7\u05DC\u05D8",email:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05D0\u05D9\u05DE\u05D9\u05D9\u05DC",url:"\u05DB\u05EA\u05D5\u05D1\u05EA \u05E8\u05E9\u05EA",emoji:"\u05D0\u05D9\u05DE\u05D5\u05D2'\u05D9",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u05EA\u05D0\u05E8\u05D9\u05DA \u05D5\u05D6\u05DE\u05DF ISO",date:"\u05EA\u05D0\u05E8\u05D9\u05DA ISO",time:"\u05D6\u05DE\u05DF ISO",duration:"\u05DE\u05E9\u05DA \u05D6\u05DE\u05DF ISO",ipv4:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv4",ipv6:"\u05DB\u05EA\u05D5\u05D1\u05EA IPv6",cidrv4:"\u05D8\u05D5\u05D5\u05D7 IPv4",cidrv6:"\u05D8\u05D5\u05D5\u05D7 IPv6",base64:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64",base64url:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05D1\u05D1\u05E1\u05D9\u05E1 64 \u05DC\u05DB\u05EA\u05D5\u05D1\u05D5\u05EA \u05E8\u05E9\u05EA",json_string:"\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA JSON",e164:"\u05DE\u05E1\u05E4\u05E8 E.164",jwt:"JWT",template_literal:"\u05E7\u05DC\u05D8"};return o=>{switch(o.code){case"invalid_type":return`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${o.expected}, \u05D4\u05EA\u05E7\u05D1\u05DC ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA ${Nt(o.values[0])}`:`\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05E6\u05E8\u05D9\u05DA \u05D0\u05D7\u05EA \u05DE\u05D4\u05D0\u05E4\u05E9\u05E8\u05D5\u05D9\u05D5\u05EA ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${o.maximum.toString()} ${a.unit??"elements"}`:`\u05D2\u05D3\u05D5\u05DC \u05DE\u05D3\u05D9: ${o.origin??"value"} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${o.minimum.toString()} ${a.unit}`:`\u05E7\u05D8\u05DF \u05DE\u05D3\u05D9: ${o.origin} \u05E6\u05E8\u05D9\u05DA \u05DC\u05D4\u05D9\u05D5\u05EA ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D7\u05D9\u05DC \u05D1"${i.prefix}"`:i.format==="ends_with"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05E1\u05EA\u05D9\u05D9\u05DD \u05D1 "${i.suffix}"`:i.format==="includes"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05DB\u05DC\u05D5\u05DC "${i.includes}"`:i.format==="regex"?`\u05DE\u05D7\u05E8\u05D5\u05D6\u05EA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05E0\u05D4: \u05D7\u05D9\u05D9\u05D1\u05EA \u05DC\u05D4\u05EA\u05D0\u05D9\u05DD \u05DC\u05EA\u05D1\u05E0\u05D9\u05EA ${i.pattern}`:`${n[i.format]??o.format} \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF`}case"not_multiple_of":return`\u05DE\u05E1\u05E4\u05E8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF: \u05D7\u05D9\u05D9\u05D1 \u05DC\u05D4\u05D9\u05D5\u05EA \u05DE\u05DB\u05E4\u05DC\u05D4 \u05E9\u05DC ${o.divisor}`;case"unrecognized_keys":return`\u05DE\u05E4\u05EA\u05D7${o.keys.length>1?"\u05D5\u05EA":""} \u05DC\u05D0 \u05DE\u05D6\u05D5\u05D4${o.keys.length>1?"\u05D9\u05DD":"\u05D4"}: ${Le(o.keys,", ")}`;case"invalid_key":return`\u05DE\u05E4\u05EA\u05D7 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;case"invalid_union":return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF";case"invalid_element":return`\u05E2\u05E8\u05DA \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF \u05D1${o.origin}`;default:return"\u05E7\u05DC\u05D8 \u05DC\u05D0 \u05EA\u05E7\u05D9\u05DF"}}}});function xTt(){return{localeError:ufn()}}var ufn,OTt=v(()=>{An();ufn=()=>{let t={string:{unit:"karakter",verb:"legyen"},file:{unit:"byte",verb:"legyen"},array:{unit:"elem",verb:"legyen"},set:{unit:"elem",verb:"legyen"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"sz\xE1m";case"object":{if(Array.isArray(o))return"t\xF6mb";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"bemenet",email:"email c\xEDm",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO id\u0151b\xE9lyeg",date:"ISO d\xE1tum",time:"ISO id\u0151",duration:"ISO id\u0151intervallum",ipv4:"IPv4 c\xEDm",ipv6:"IPv6 c\xEDm",cidrv4:"IPv4 tartom\xE1ny",cidrv6:"IPv6 tartom\xE1ny",base64:"base64-k\xF3dolt string",base64url:"base64url-k\xF3dolt string",json_string:"JSON string",e164:"E.164 sz\xE1m",jwt:"JWT",template_literal:"bemenet"};return o=>{switch(o.code){case"invalid_type":return`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${o.expected}, a kapott \xE9rt\xE9k ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\xC9rv\xE9nytelen bemenet: a v\xE1rt \xE9rt\xE9k ${Nt(o.values[0])}`:`\xC9rv\xE9nytelen opci\xF3: valamelyik \xE9rt\xE9k v\xE1rt ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`T\xFAl nagy: ${o.origin??"\xE9rt\xE9k"} m\xE9rete t\xFAl nagy ${i}${o.maximum.toString()} ${a.unit??"elem"}`:`T\xFAl nagy: a bemeneti \xE9rt\xE9k ${o.origin??"\xE9rt\xE9k"} t\xFAl nagy: ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} m\xE9rete t\xFAl kicsi ${i}${o.minimum.toString()} ${a.unit}`:`T\xFAl kicsi: a bemeneti \xE9rt\xE9k ${o.origin} t\xFAl kicsi ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\xC9rv\xE9nytelen string: "${i.prefix}" \xE9rt\xE9kkel kell kezd\u0151dnie`:i.format==="ends_with"?`\xC9rv\xE9nytelen string: "${i.suffix}" \xE9rt\xE9kkel kell v\xE9gz\u0151dnie`:i.format==="includes"?`\xC9rv\xE9nytelen string: "${i.includes}" \xE9rt\xE9ket kell tartalmaznia`:i.format==="regex"?`\xC9rv\xE9nytelen string: ${i.pattern} mint\xE1nak kell megfelelnie`:`\xC9rv\xE9nytelen ${n[i.format]??o.format}`}case"not_multiple_of":return`\xC9rv\xE9nytelen sz\xE1m: ${o.divisor} t\xF6bbsz\xF6r\xF6s\xE9nek kell lennie`;case"unrecognized_keys":return`Ismeretlen kulcs${o.keys.length>1?"s":""}: ${Le(o.keys,", ")}`;case"invalid_key":return`\xC9rv\xE9nytelen kulcs ${o.origin}`;case"invalid_union":return"\xC9rv\xE9nytelen bemenet";case"invalid_element":return`\xC9rv\xE9nytelen \xE9rt\xE9k: ${o.origin}`;default:return"\xC9rv\xE9nytelen bemenet"}}}});function TTt(){return{localeError:lfn()}}var lfn,ETt=v(()=>{An();lfn=()=>{let t={string:{unit:"karakter",verb:"memiliki"},file:{unit:"byte",verb:"memiliki"},array:{unit:"item",verb:"memiliki"},set:{unit:"item",verb:"memiliki"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"input",email:"alamat email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tanggal dan waktu format ISO",date:"tanggal format ISO",time:"jam format ISO",duration:"durasi format ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"rentang alamat IPv4",cidrv6:"rentang alamat IPv6",base64:"string dengan enkode base64",base64url:"string dengan enkode base64url",json_string:"string JSON",e164:"angka E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak valid: diharapkan ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak valid: diharapkan ${Nt(o.values[0])}`:`Pilihan tidak valid: diharapkan salah satu dari ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`Terlalu besar: diharapkan ${o.origin??"value"} memiliki ${i}${o.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: diharapkan ${o.origin??"value"} menjadi ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`Terlalu kecil: diharapkan ${o.origin} memiliki ${i}${o.minimum.toString()} ${a.unit}`:`Terlalu kecil: diharapkan ${o.origin} menjadi ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`String tidak valid: harus dimulai dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak valid: harus berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak valid: harus menyertakan "${i.includes}"`:i.format==="regex"?`String tidak valid: harus sesuai pola ${i.pattern}`:`${n[i.format]??o.format} tidak valid`}case"not_multiple_of":return`Angka tidak valid: harus kelipatan dari ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali ${o.keys.length>1?"s":""}: ${Le(o.keys,", ")}`;case"invalid_key":return`Kunci tidak valid di ${o.origin}`;case"invalid_union":return"Input tidak valid";case"invalid_element":return`Nilai tidak valid di ${o.origin}`;default:return"Input tidak valid"}}}});function PTt(){return{localeError:cfn()}}var cfn,MTt=v(()=>{An();cfn=()=>{let t={string:{unit:"caratteri",verb:"avere"},file:{unit:"byte",verb:"avere"},array:{unit:"elementi",verb:"avere"},set:{unit:"elementi",verb:"avere"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"numero";case"object":{if(Array.isArray(o))return"vettore";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"input",email:"indirizzo email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e ora ISO",date:"data ISO",time:"ora ISO",duration:"durata ISO",ipv4:"indirizzo IPv4",ipv6:"indirizzo IPv6",cidrv4:"intervallo IPv4",cidrv6:"intervallo IPv6",base64:"stringa codificata in base64",base64url:"URL codificata in base64",json_string:"stringa JSON",e164:"numero E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input non valido: atteso ${o.expected}, ricevuto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input non valido: atteso ${Nt(o.values[0])}`:`Opzione non valida: atteso uno tra ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`Troppo grande: ${o.origin??"valore"} deve avere ${i}${o.maximum.toString()} ${a.unit??"elementi"}`:`Troppo grande: ${o.origin??"valore"} deve essere ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`Troppo piccolo: ${o.origin} deve avere ${i}${o.minimum.toString()} ${a.unit}`:`Troppo piccolo: ${o.origin} deve essere ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Stringa non valida: deve iniziare con "${i.prefix}"`:i.format==="ends_with"?`Stringa non valida: deve terminare con "${i.suffix}"`:i.format==="includes"?`Stringa non valida: deve includere "${i.includes}"`:i.format==="regex"?`Stringa non valida: deve corrispondere al pattern ${i.pattern}`:`Invalid ${n[i.format]??o.format}`}case"not_multiple_of":return`Numero non valido: deve essere un multiplo di ${o.divisor}`;case"unrecognized_keys":return`Chiav${o.keys.length>1?"i":"e"} non riconosciut${o.keys.length>1?"e":"a"}: ${Le(o.keys,", ")}`;case"invalid_key":return`Chiave non valida in ${o.origin}`;case"invalid_union":return"Input non valido";case"invalid_element":return`Valore non valido in ${o.origin}`;default:return"Input non valido"}}}});function RTt(){return{localeError:dfn()}}var dfn,ATt=v(()=>{An();dfn=()=>{let t={string:{unit:"\u6587\u5B57",verb:"\u3067\u3042\u308B"},file:{unit:"\u30D0\u30A4\u30C8",verb:"\u3067\u3042\u308B"},array:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"},set:{unit:"\u8981\u7D20",verb:"\u3067\u3042\u308B"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"\u6570\u5024";case"object":{if(Array.isArray(o))return"\u914D\u5217";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\u5165\u529B\u5024",email:"\u30E1\u30FC\u30EB\u30A2\u30C9\u30EC\u30B9",url:"URL",emoji:"\u7D75\u6587\u5B57",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u6642",date:"ISO\u65E5\u4ED8",time:"ISO\u6642\u523B",duration:"ISO\u671F\u9593",ipv4:"IPv4\u30A2\u30C9\u30EC\u30B9",ipv6:"IPv6\u30A2\u30C9\u30EC\u30B9",cidrv4:"IPv4\u7BC4\u56F2",cidrv6:"IPv6\u7BC4\u56F2",base64:"base64\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",base64url:"base64url\u30A8\u30F3\u30B3\u30FC\u30C9\u6587\u5B57\u5217",json_string:"JSON\u6587\u5B57\u5217",e164:"E.164\u756A\u53F7",jwt:"JWT",template_literal:"\u5165\u529B\u5024"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u52B9\u306A\u5165\u529B: ${o.expected}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F\u304C\u3001${r(o.input)}\u304C\u5165\u529B\u3055\u308C\u307E\u3057\u305F`;case"invalid_value":return o.values.length===1?`\u7121\u52B9\u306A\u5165\u529B: ${Nt(o.values[0])}\u304C\u671F\u5F85\u3055\u308C\u307E\u3057\u305F`:`\u7121\u52B9\u306A\u9078\u629E: ${Le(o.values,"\u3001")}\u306E\u3044\u305A\u308C\u304B\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"too_big":{let i=o.inclusive?"\u4EE5\u4E0B\u3067\u3042\u308B":"\u3088\u308A\u5C0F\u3055\u3044",a=e(o.origin);return a?`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${a.unit??"\u8981\u7D20"}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5927\u304D\u3059\u304E\u308B\u5024: ${o.origin??"\u5024"}\u306F${o.maximum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"too_small":{let i=o.inclusive?"\u4EE5\u4E0A\u3067\u3042\u308B":"\u3088\u308A\u5927\u304D\u3044",a=e(o.origin);return a?`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${a.unit}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u5C0F\u3055\u3059\u304E\u308B\u5024: ${o.origin}\u306F${o.minimum.toString()}${i}\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.prefix}"\u3067\u59CB\u307E\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="ends_with"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.suffix}"\u3067\u7D42\u308F\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="includes"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: "${i.includes}"\u3092\u542B\u3080\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:i.format==="regex"?`\u7121\u52B9\u306A\u6587\u5B57\u5217: \u30D1\u30BF\u30FC\u30F3${i.pattern}\u306B\u4E00\u81F4\u3059\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`:`\u7121\u52B9\u306A${n[i.format]??o.format}`}case"not_multiple_of":return`\u7121\u52B9\u306A\u6570\u5024: ${o.divisor}\u306E\u500D\u6570\u3067\u3042\u308B\u5FC5\u8981\u304C\u3042\u308A\u307E\u3059`;case"unrecognized_keys":return`\u8A8D\u8B58\u3055\u308C\u3066\u3044\u306A\u3044\u30AD\u30FC${o.keys.length>1?"\u7FA4":""}: ${Le(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u30AD\u30FC`;case"invalid_union":return"\u7121\u52B9\u306A\u5165\u529B";case"invalid_element":return`${o.origin}\u5185\u306E\u7121\u52B9\u306A\u5024`;default:return"\u7121\u52B9\u306A\u5165\u529B"}}}});function ITt(){return{localeError:ffn()}}var ffn,NTt=v(()=>{An();ffn=()=>{let t={string:{unit:"\u178F\u17BD\u17A2\u1780\u17D2\u179F\u179A",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},file:{unit:"\u1794\u17C3",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},array:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"},set:{unit:"\u1792\u17B6\u178F\u17BB",verb:"\u1782\u17BD\u179A\u1798\u17B6\u1793"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"\u1798\u17B7\u1793\u1798\u17C2\u1793\u1787\u17B6\u179B\u17C1\u1781 (NaN)":"\u179B\u17C1\u1781";case"object":{if(Array.isArray(o))return"\u17A2\u17B6\u179A\u17C1 (Array)";if(o===null)return"\u1782\u17D2\u1798\u17B6\u1793\u178F\u1798\u17D2\u179B\u17C3 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B",email:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793\u17A2\u17CA\u17B8\u1798\u17C2\u179B",url:"URL",emoji:"\u179F\u1789\u17D2\u1789\u17B6\u17A2\u17B6\u179A\u1798\u17D2\u1798\u178E\u17CD",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 \u1793\u17B7\u1784\u1798\u17C9\u17C4\u1784 ISO",date:"\u1780\u17B6\u179B\u1794\u179A\u17B7\u1785\u17D2\u1786\u17C1\u1791 ISO",time:"\u1798\u17C9\u17C4\u1784 ISO",duration:"\u179A\u1799\u17C8\u1796\u17C1\u179B ISO",ipv4:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",ipv6:"\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",cidrv4:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv4",cidrv6:"\u178A\u17C2\u1793\u17A2\u17B6\u179F\u1799\u178A\u17D2\u178B\u17B6\u1793 IPv6",base64:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64",base64url:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u17A2\u17CA\u17B7\u1780\u17BC\u178A base64url",json_string:"\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A JSON",e164:"\u179B\u17C1\u1781 E.164",jwt:"JWT",template_literal:"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B"};return o=>{switch(o.code){case"invalid_type":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.expected} \u1794\u17C9\u17BB\u1793\u17D2\u178F\u17C2\u1791\u1791\u17BD\u179B\u1794\u17B6\u1793 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1794\u1789\u17D2\u1785\u17BC\u179B\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${Nt(o.values[0])}`:`\u1787\u1798\u17D2\u179A\u17BE\u179F\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1787\u17B6\u1798\u17BD\u1799\u1780\u17D2\u1793\u17BB\u1784\u1785\u17C6\u178E\u17C4\u1798 ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${o.maximum.toString()} ${a.unit??"\u1792\u17B6\u178F\u17BB"}`:`\u1792\u17C6\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin??"\u178F\u1798\u17D2\u179B\u17C3"} ${i} ${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${i} ${o.minimum.toString()} ${a.unit}`:`\u178F\u17BC\u1785\u1796\u17C1\u1780\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1780\u17B6\u179A ${o.origin} ${i} ${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1785\u17B6\u1794\u17CB\u1795\u17D2\u178F\u17BE\u1798\u178A\u17C4\u1799 "${i.prefix}"`:i.format==="ends_with"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1794\u1789\u17D2\u1785\u1794\u17CB\u178A\u17C4\u1799 "${i.suffix}"`:i.format==="includes"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u1798\u17B6\u1793 "${i.includes}"`:i.format==="regex"?`\u1781\u17D2\u179F\u17C2\u17A2\u1780\u17D2\u179F\u179A\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1795\u17D2\u1782\u17BC\u1795\u17D2\u1782\u1784\u1793\u17B9\u1784\u1791\u1798\u17D2\u179A\u1784\u17CB\u178A\u17C2\u179B\u1794\u17B6\u1793\u1780\u17C6\u178E\u178F\u17CB ${i.pattern}`:`\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 ${n[i.format]??o.format}`}case"not_multiple_of":return`\u179B\u17C1\u1781\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u17D6 \u178F\u17D2\u179A\u17BC\u179C\u178F\u17C2\u1787\u17B6\u1796\u17A0\u17BB\u1782\u17BB\u178E\u1793\u17C3 ${o.divisor}`;case"unrecognized_keys":return`\u179A\u1780\u1783\u17BE\u1789\u179F\u17C4\u1798\u17B7\u1793\u179F\u17D2\u1782\u17B6\u179B\u17CB\u17D6 ${Le(o.keys,", ")}`;case"invalid_key":return`\u179F\u17C4\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;case"invalid_union":return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C";case"invalid_element":return`\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C\u1793\u17C5\u1780\u17D2\u1793\u17BB\u1784 ${o.origin}`;default:return"\u1791\u17B7\u1793\u17D2\u1793\u1793\u17D0\u1799\u1798\u17B7\u1793\u178F\u17D2\u179A\u17B9\u1798\u178F\u17D2\u179A\u17BC\u179C"}}}});function jTt(){return{localeError:pfn()}}var pfn,DTt=v(()=>{An();pfn=()=>{let t={string:{unit:"\uBB38\uC790",verb:"to have"},file:{unit:"\uBC14\uC774\uD2B8",verb:"to have"},array:{unit:"\uAC1C",verb:"to have"},set:{unit:"\uAC1C",verb:"to have"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\uC785\uB825",email:"\uC774\uBA54\uC77C \uC8FC\uC18C",url:"URL",emoji:"\uC774\uBAA8\uC9C0",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \uB0A0\uC9DC\uC2DC\uAC04",date:"ISO \uB0A0\uC9DC",time:"ISO \uC2DC\uAC04",duration:"ISO \uAE30\uAC04",ipv4:"IPv4 \uC8FC\uC18C",ipv6:"IPv6 \uC8FC\uC18C",cidrv4:"IPv4 \uBC94\uC704",cidrv6:"IPv6 \uBC94\uC704",base64:"base64 \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",base64url:"base64url \uC778\uCF54\uB529 \uBB38\uC790\uC5F4",json_string:"JSON \uBB38\uC790\uC5F4",e164:"E.164 \uBC88\uD638",jwt:"JWT",template_literal:"\uC785\uB825"};return o=>{switch(o.code){case"invalid_type":return`\uC798\uBABB\uB41C \uC785\uB825: \uC608\uC0C1 \uD0C0\uC785\uC740 ${o.expected}, \uBC1B\uC740 \uD0C0\uC785\uC740 ${r(o.input)}\uC785\uB2C8\uB2E4`;case"invalid_value":return o.values.length===1?`\uC798\uBABB\uB41C \uC785\uB825: \uAC12\uC740 ${Nt(o.values[0])} \uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C \uC635\uC158: ${Le(o.values,"\uB610\uB294 ")} \uC911 \uD558\uB098\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"too_big":{let i=o.inclusive?"\uC774\uD558":"\uBBF8\uB9CC",a=i==="\uBBF8\uB9CC"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(o.origin),u=s?.unit??"\uC694\uC18C";return s?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()}${u} ${i}${a}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uD07D\uB2C8\uB2E4: ${o.maximum.toString()} ${i}${a}`}case"too_small":{let i=o.inclusive?"\uC774\uC0C1":"\uCD08\uACFC",a=i==="\uC774\uC0C1"?"\uC774\uC5B4\uC57C \uD569\uB2C8\uB2E4":"\uC5EC\uC57C \uD569\uB2C8\uB2E4",s=e(o.origin),u=s?.unit??"\uC694\uC18C";return s?`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()}${u} ${i}${a}`:`${o.origin??"\uAC12"}\uC774 \uB108\uBB34 \uC791\uC2B5\uB2C8\uB2E4: ${o.minimum.toString()} ${i}${a}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.prefix}"(\uC73C)\uB85C \uC2DC\uC791\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="ends_with"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.suffix}"(\uC73C)\uB85C \uB05D\uB098\uC57C \uD569\uB2C8\uB2E4`:i.format==="includes"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: "${i.includes}"\uC744(\uB97C) \uD3EC\uD568\uD574\uC57C \uD569\uB2C8\uB2E4`:i.format==="regex"?`\uC798\uBABB\uB41C \uBB38\uC790\uC5F4: \uC815\uADDC\uC2DD ${i.pattern} \uD328\uD134\uACFC \uC77C\uCE58\uD574\uC57C \uD569\uB2C8\uB2E4`:`\uC798\uBABB\uB41C ${n[i.format]??o.format}`}case"not_multiple_of":return`\uC798\uBABB\uB41C \uC22B\uC790: ${o.divisor}\uC758 \uBC30\uC218\uC5EC\uC57C \uD569\uB2C8\uB2E4`;case"unrecognized_keys":return`\uC778\uC2DD\uD560 \uC218 \uC5C6\uB294 \uD0A4: ${Le(o.keys,", ")}`;case"invalid_key":return`\uC798\uBABB\uB41C \uD0A4: ${o.origin}`;case"invalid_union":return"\uC798\uBABB\uB41C \uC785\uB825";case"invalid_element":return`\uC798\uBABB\uB41C \uAC12: ${o.origin}`;default:return"\uC798\uBABB\uB41C \uC785\uB825"}}}});function $Tt(){return{localeError:mfn()}}var mfn,LTt=v(()=>{An();mfn=()=>{let t={string:{unit:"\u0437\u043D\u0430\u0446\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},file:{unit:"\u0431\u0430\u0458\u0442\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},array:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"},set:{unit:"\u0441\u0442\u0430\u0432\u043A\u0438",verb:"\u0434\u0430 \u0438\u043C\u0430\u0430\u0442"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"\u0431\u0440\u043E\u0458";case"object":{if(Array.isArray(o))return"\u043D\u0438\u0437\u0430";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\u0432\u043D\u0435\u0441",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u043D\u0430 \u0435-\u043F\u043E\u0448\u0442\u0430",url:"URL",emoji:"\u0435\u043C\u043E\u045F\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0443\u043C \u0438 \u0432\u0440\u0435\u043C\u0435",date:"ISO \u0434\u0430\u0442\u0443\u043C",time:"ISO \u0432\u0440\u0435\u043C\u0435",duration:"ISO \u0432\u0440\u0435\u043C\u0435\u0442\u0440\u0430\u0435\u045A\u0435",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441\u0430",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441\u0430",cidrv4:"IPv4 \u043E\u043F\u0441\u0435\u0433",cidrv6:"IPv6 \u043E\u043F\u0441\u0435\u0433",base64:"base64-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",base64url:"base64url-\u0435\u043D\u043A\u043E\u0434\u0438\u0440\u0430\u043D\u0430 \u043D\u0438\u0437\u0430",json_string:"JSON \u043D\u0438\u0437\u0430",e164:"E.164 \u0431\u0440\u043E\u0458",jwt:"JWT",template_literal:"\u0432\u043D\u0435\u0441"};return o=>{switch(o.code){case"invalid_type":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.expected}, \u043F\u0440\u0438\u043C\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Invalid input: expected ${Nt(o.values[0])}`:`\u0413\u0440\u0435\u0448\u0430\u043D\u0430 \u043E\u043F\u0446\u0438\u0458\u0430: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 \u0435\u0434\u043D\u0430 ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0438\u043C\u0430 ${i}${o.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0438"}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u0433\u043E\u043B\u0435\u043C: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin??"\u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442\u0430"} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0438\u043C\u0430 ${i}${o.minimum.toString()} ${a.unit}`:`\u041F\u0440\u0435\u043C\u043D\u043E\u0433\u0443 \u043C\u0430\u043B: \u0441\u0435 \u043E\u0447\u0435\u043A\u0443\u0432\u0430 ${o.origin} \u0434\u0430 \u0431\u0438\u0434\u0435 ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u043F\u043E\u0447\u043D\u0443\u0432\u0430 \u0441\u043E "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0437\u0430\u0432\u0440\u0448\u0443\u0432\u0430 \u0441\u043E "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0432\u043A\u043B\u0443\u0447\u0443\u0432\u0430 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0430\u0436\u0435\u0447\u043A\u0430 \u043D\u0438\u0437\u0430: \u043C\u043E\u0440\u0430 \u0434\u0430 \u043E\u0434\u0433\u043E\u0430\u0440\u0430 \u043D\u0430 \u043F\u0430\u0442\u0435\u0440\u043D\u043E\u0442 ${i.pattern}`:`Invalid ${n[i.format]??o.format}`}case"not_multiple_of":return`\u0413\u0440\u0435\u0448\u0435\u043D \u0431\u0440\u043E\u0458: \u043C\u043E\u0440\u0430 \u0434\u0430 \u0431\u0438\u0434\u0435 \u0434\u0435\u043B\u0438\u0432 \u0441\u043E ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D\u0438 \u043A\u043B\u0443\u0447\u0435\u0432\u0438":"\u041D\u0435\u043F\u0440\u0435\u043F\u043E\u0437\u043D\u0430\u0435\u043D \u043A\u043B\u0443\u0447"}: ${Le(o.keys,", ")}`;case"invalid_key":return`\u0413\u0440\u0435\u0448\u0435\u043D \u043A\u043B\u0443\u0447 \u0432\u043E ${o.origin}`;case"invalid_union":return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441";case"invalid_element":return`\u0413\u0440\u0435\u0448\u043D\u0430 \u0432\u0440\u0435\u0434\u043D\u043E\u0441\u0442 \u0432\u043E ${o.origin}`;default:return"\u0413\u0440\u0435\u0448\u0435\u043D \u0432\u043D\u0435\u0441"}}}});function FTt(){return{localeError:hfn()}}var hfn,kTt=v(()=>{An();hfn=()=>{let t={string:{unit:"aksara",verb:"mempunyai"},file:{unit:"bait",verb:"mempunyai"},array:{unit:"elemen",verb:"mempunyai"},set:{unit:"elemen",verb:"mempunyai"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"nombor";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"input",email:"alamat e-mel",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"tarikh masa ISO",date:"tarikh ISO",time:"masa ISO",duration:"tempoh ISO",ipv4:"alamat IPv4",ipv6:"alamat IPv6",cidrv4:"julat IPv4",cidrv6:"julat IPv6",base64:"string dikodkan base64",base64url:"string dikodkan base64url",json_string:"string JSON",e164:"nombor E.164",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Input tidak sah: dijangka ${o.expected}, diterima ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Input tidak sah: dijangka ${Nt(o.values[0])}`:`Pilihan tidak sah: dijangka salah satu daripada ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`Terlalu besar: dijangka ${o.origin??"nilai"} ${a.verb} ${i}${o.maximum.toString()} ${a.unit??"elemen"}`:`Terlalu besar: dijangka ${o.origin??"nilai"} adalah ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`Terlalu kecil: dijangka ${o.origin} ${a.verb} ${i}${o.minimum.toString()} ${a.unit}`:`Terlalu kecil: dijangka ${o.origin} adalah ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`String tidak sah: mesti bermula dengan "${i.prefix}"`:i.format==="ends_with"?`String tidak sah: mesti berakhir dengan "${i.suffix}"`:i.format==="includes"?`String tidak sah: mesti mengandungi "${i.includes}"`:i.format==="regex"?`String tidak sah: mesti sepadan dengan corak ${i.pattern}`:`${n[i.format]??o.format} tidak sah`}case"not_multiple_of":return`Nombor tidak sah: perlu gandaan ${o.divisor}`;case"unrecognized_keys":return`Kunci tidak dikenali: ${Le(o.keys,", ")}`;case"invalid_key":return`Kunci tidak sah dalam ${o.origin}`;case"invalid_union":return"Input tidak sah";case"invalid_element":return`Nilai tidak sah dalam ${o.origin}`;default:return"Input tidak sah"}}}});function qTt(){return{localeError:gfn()}}var gfn,BTt=v(()=>{An();gfn=()=>{let t={string:{unit:"tekens"},file:{unit:"bytes"},array:{unit:"elementen"},set:{unit:"elementen"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"getal";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"invoer",email:"emailadres",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum en tijd",date:"ISO datum",time:"ISO tijd",duration:"ISO duur",ipv4:"IPv4-adres",ipv6:"IPv6-adres",cidrv4:"IPv4-bereik",cidrv6:"IPv6-bereik",base64:"base64-gecodeerde tekst",base64url:"base64 URL-gecodeerde tekst",json_string:"JSON string",e164:"E.164-nummer",jwt:"JWT",template_literal:"invoer"};return o=>{switch(o.code){case"invalid_type":return`Ongeldige invoer: verwacht ${o.expected}, ontving ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ongeldige invoer: verwacht ${Nt(o.values[0])}`:`Ongeldige optie: verwacht \xE9\xE9n van ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`Te lang: verwacht dat ${o.origin??"waarde"} ${i}${o.maximum.toString()} ${a.unit??"elementen"} bevat`:`Te lang: verwacht dat ${o.origin??"waarde"} ${i}${o.maximum.toString()} is`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`Te kort: verwacht dat ${o.origin} ${i}${o.minimum.toString()} ${a.unit} bevat`:`Te kort: verwacht dat ${o.origin} ${i}${o.minimum.toString()} is`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Ongeldige tekst: moet met "${i.prefix}" beginnen`:i.format==="ends_with"?`Ongeldige tekst: moet op "${i.suffix}" eindigen`:i.format==="includes"?`Ongeldige tekst: moet "${i.includes}" bevatten`:i.format==="regex"?`Ongeldige tekst: moet overeenkomen met patroon ${i.pattern}`:`Ongeldig: ${n[i.format]??o.format}`}case"not_multiple_of":return`Ongeldig getal: moet een veelvoud van ${o.divisor} zijn`;case"unrecognized_keys":return`Onbekende key${o.keys.length>1?"s":""}: ${Le(o.keys,", ")}`;case"invalid_key":return`Ongeldige key in ${o.origin}`;case"invalid_union":return"Ongeldige invoer";case"invalid_element":return`Ongeldige waarde in ${o.origin}`;default:return"Ongeldige invoer"}}}});function UTt(){return{localeError:yfn()}}var yfn,zTt=v(()=>{An();yfn=()=>{let t={string:{unit:"tegn",verb:"\xE5 ha"},file:{unit:"bytes",verb:"\xE5 ha"},array:{unit:"elementer",verb:"\xE5 inneholde"},set:{unit:"elementer",verb:"\xE5 inneholde"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"tall";case"object":{if(Array.isArray(o))return"liste";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"input",email:"e-postadresse",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO dato- og klokkeslett",date:"ISO-dato",time:"ISO-klokkeslett",duration:"ISO-varighet",ipv4:"IPv4-omr\xE5de",ipv6:"IPv6-omr\xE5de",cidrv4:"IPv4-spekter",cidrv6:"IPv6-spekter",base64:"base64-enkodet streng",base64url:"base64url-enkodet streng",json_string:"JSON-streng",e164:"E.164-nummer",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`Ugyldig input: forventet ${o.expected}, fikk ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ugyldig verdi: forventet ${Nt(o.values[0])}`:`Ugyldig valg: forventet en av ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${i}${o.maximum.toString()} ${a.unit??"elementer"}`:`For stor(t): forventet ${o.origin??"value"} til \xE5 ha ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`For lite(n): forventet ${o.origin} til \xE5 ha ${i}${o.minimum.toString()} ${a.unit}`:`For lite(n): forventet ${o.origin} til \xE5 ha ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Ugyldig streng: m\xE5 starte med "${i.prefix}"`:i.format==="ends_with"?`Ugyldig streng: m\xE5 ende med "${i.suffix}"`:i.format==="includes"?`Ugyldig streng: m\xE5 inneholde "${i.includes}"`:i.format==="regex"?`Ugyldig streng: m\xE5 matche m\xF8nsteret ${i.pattern}`:`Ugyldig ${n[i.format]??o.format}`}case"not_multiple_of":return`Ugyldig tall: m\xE5 v\xE6re et multiplum av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ukjente n\xF8kler":"Ukjent n\xF8kkel"}: ${Le(o.keys,", ")}`;case"invalid_key":return`Ugyldig n\xF8kkel i ${o.origin}`;case"invalid_union":return"Ugyldig input";case"invalid_element":return`Ugyldig verdi i ${o.origin}`;default:return"Ugyldig input"}}}});function HTt(){return{localeError:bfn()}}var bfn,VTt=v(()=>{An();bfn=()=>{let t={string:{unit:"harf",verb:"olmal\u0131d\u0131r"},file:{unit:"bayt",verb:"olmal\u0131d\u0131r"},array:{unit:"unsur",verb:"olmal\u0131d\u0131r"},set:{unit:"unsur",verb:"olmal\u0131d\u0131r"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"numara";case"object":{if(Array.isArray(o))return"saf";if(o===null)return"gayb";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"giren",email:"epostag\xE2h",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO heng\xE2m\u0131",date:"ISO tarihi",time:"ISO zaman\u0131",duration:"ISO m\xFCddeti",ipv4:"IPv4 ni\u015F\xE2n\u0131",ipv6:"IPv6 ni\u015F\xE2n\u0131",cidrv4:"IPv4 menzili",cidrv6:"IPv6 menzili",base64:"base64-\u015Fifreli metin",base64url:"base64url-\u015Fifreli metin",json_string:"JSON metin",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"giren"};return o=>{switch(o.code){case"invalid_type":return`F\xE2sit giren: umulan ${o.expected}, al\u0131nan ${r(o.input)}`;case"invalid_value":return o.values.length===1?`F\xE2sit giren: umulan ${Nt(o.values[0])}`:`F\xE2sit tercih: m\xFBteberler ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${i}${o.maximum.toString()} ${a.unit??"elements"} sahip olmal\u0131yd\u0131.`:`Fazla b\xFCy\xFCk: ${o.origin??"value"}, ${i}${o.maximum.toString()} olmal\u0131yd\u0131.`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${i}${o.minimum.toString()} ${a.unit} sahip olmal\u0131yd\u0131.`:`Fazla k\xFC\xE7\xFCk: ${o.origin}, ${i}${o.minimum.toString()} olmal\u0131yd\u0131.`}case"invalid_format":{let i=o;return i.format==="starts_with"?`F\xE2sit metin: "${i.prefix}" ile ba\u015Flamal\u0131.`:i.format==="ends_with"?`F\xE2sit metin: "${i.suffix}" ile bitmeli.`:i.format==="includes"?`F\xE2sit metin: "${i.includes}" ihtiv\xE2 etmeli.`:i.format==="regex"?`F\xE2sit metin: ${i.pattern} nak\u015F\u0131na uymal\u0131.`:`F\xE2sit ${n[i.format]??o.format}`}case"not_multiple_of":return`F\xE2sit say\u0131: ${o.divisor} kat\u0131 olmal\u0131yd\u0131.`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar ${o.keys.length>1?"s":""}: ${Le(o.keys,", ")}`;case"invalid_key":return`${o.origin} i\xE7in tan\u0131nmayan anahtar var.`;case"invalid_union":return"Giren tan\u0131namad\u0131.";case"invalid_element":return`${o.origin} i\xE7in tan\u0131nmayan k\u0131ymet var.`;default:return"K\u0131ymet tan\u0131namad\u0131."}}}});function JTt(){return{localeError:_fn()}}var _fn,KTt=v(()=>{An();_fn=()=>{let t={string:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},file:{unit:"\u0628\u0627\u06CC\u067C\u0633",verb:"\u0648\u0644\u0631\u064A"},array:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"},set:{unit:"\u062A\u0648\u06A9\u064A",verb:"\u0648\u0644\u0631\u064A"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"\u0639\u062F\u062F";case"object":{if(Array.isArray(o))return"\u0627\u0631\u06D0";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\u0648\u0631\u0648\u062F\u064A",email:"\u0628\u0631\u06CC\u069A\u0646\u0627\u0644\u06CC\u06A9",url:"\u06CC\u0648 \u0622\u0631 \u0627\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u064A",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0646\u06CC\u067C\u0647 \u0627\u0648 \u0648\u062E\u062A",date:"\u0646\u06D0\u067C\u0647",time:"\u0648\u062E\u062A",duration:"\u0645\u0648\u062F\u0647",ipv4:"\u062F IPv4 \u067E\u062A\u0647",ipv6:"\u062F IPv6 \u067E\u062A\u0647",cidrv4:"\u062F IPv4 \u0633\u0627\u062D\u0647",cidrv6:"\u062F IPv6 \u0633\u0627\u062D\u0647",base64:"base64-encoded \u0645\u062A\u0646",base64url:"base64url-encoded \u0645\u062A\u0646",json_string:"JSON \u0645\u062A\u0646",e164:"\u062F E.164 \u0634\u0645\u06D0\u0631\u0647",jwt:"JWT",template_literal:"\u0648\u0631\u0648\u062F\u064A"};return o=>{switch(o.code){case"invalid_type":return`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${o.expected} \u0648\u0627\u06CC, \u0645\u06AB\u0631 ${r(o.input)} \u062A\u0631\u0644\u0627\u0633\u0647 \u0634\u0648`;case"invalid_value":return o.values.length===1?`\u0646\u0627\u0633\u0645 \u0648\u0631\u0648\u062F\u064A: \u0628\u0627\u06CC\u062F ${Nt(o.values[0])} \u0648\u0627\u06CC`:`\u0646\u0627\u0633\u0645 \u0627\u0646\u062A\u062E\u0627\u0628: \u0628\u0627\u06CC\u062F \u06CC\u0648 \u0644\u0647 ${Le(o.values,"|")} \u0685\u062E\u0647 \u0648\u0627\u06CC`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${o.maximum.toString()} ${a.unit??"\u0639\u0646\u0635\u0631\u0648\u0646\u0647"} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u0644\u0648\u06CC: ${o.origin??"\u0627\u0631\u0632\u069A\u062A"} \u0628\u0627\u06CC\u062F ${i}${o.maximum.toString()} \u0648\u064A`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${i}${o.minimum.toString()} ${a.unit} \u0648\u0644\u0631\u064A`:`\u0689\u06CC\u0631 \u06A9\u0648\u0686\u0646\u06CC: ${o.origin} \u0628\u0627\u06CC\u062F ${i}${o.minimum.toString()} \u0648\u064A`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.prefix}" \u0633\u0631\u0647 \u067E\u06CC\u0644 \u0634\u064A`:i.format==="ends_with"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F "${i.suffix}" \u0633\u0631\u0647 \u067E\u0627\u06CC \u062A\u0647 \u0648\u0631\u0633\u064A\u0696\u064A`:i.format==="includes"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F "${i.includes}" \u0648\u0644\u0631\u064A`:i.format==="regex"?`\u0646\u0627\u0633\u0645 \u0645\u062A\u0646: \u0628\u0627\u06CC\u062F \u062F ${i.pattern} \u0633\u0631\u0647 \u0645\u0637\u0627\u0628\u0642\u062A \u0648\u0644\u0631\u064A`:`${n[i.format]??o.format} \u0646\u0627\u0633\u0645 \u062F\u06CC`}case"not_multiple_of":return`\u0646\u0627\u0633\u0645 \u0639\u062F\u062F: \u0628\u0627\u06CC\u062F \u062F ${o.divisor} \u0645\u0636\u0631\u0628 \u0648\u064A`;case"unrecognized_keys":return`\u0646\u0627\u0633\u0645 ${o.keys.length>1?"\u06A9\u0644\u06CC\u0689\u0648\u0646\u0647":"\u06A9\u0644\u06CC\u0689"}: ${Le(o.keys,", ")}`;case"invalid_key":return`\u0646\u0627\u0633\u0645 \u06A9\u0644\u06CC\u0689 \u067E\u0647 ${o.origin} \u06A9\u06D0`;case"invalid_union":return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A";case"invalid_element":return`\u0646\u0627\u0633\u0645 \u0639\u0646\u0635\u0631 \u067E\u0647 ${o.origin} \u06A9\u06D0`;default:return"\u0646\u0627\u0633\u0645\u0647 \u0648\u0631\u0648\u062F\u064A"}}}});function WTt(){return{localeError:vfn()}}var vfn,GTt=v(()=>{An();vfn=()=>{let t={string:{unit:"znak\xF3w",verb:"mie\u0107"},file:{unit:"bajt\xF3w",verb:"mie\u0107"},array:{unit:"element\xF3w",verb:"mie\u0107"},set:{unit:"element\xF3w",verb:"mie\u0107"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"liczba";case"object":{if(Array.isArray(o))return"tablica";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"wyra\u017Cenie",email:"adres email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data i godzina w formacie ISO",date:"data w formacie ISO",time:"godzina w formacie ISO",duration:"czas trwania ISO",ipv4:"adres IPv4",ipv6:"adres IPv6",cidrv4:"zakres IPv4",cidrv6:"zakres IPv6",base64:"ci\u0105g znak\xF3w zakodowany w formacie base64",base64url:"ci\u0105g znak\xF3w zakodowany w formacie base64url",json_string:"ci\u0105g znak\xF3w w formacie JSON",e164:"liczba E.164",jwt:"JWT",template_literal:"wej\u015Bcie"};return o=>{switch(o.code){case"invalid_type":return`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${o.expected}, otrzymano ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Nieprawid\u0142owe dane wej\u015Bciowe: oczekiwano ${Nt(o.values[0])}`:`Nieprawid\u0142owa opcja: oczekiwano jednej z warto\u015Bci ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`Za du\u017Ca warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${o.maximum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt du\u017C(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`Za ma\u0142a warto\u015B\u0107: oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie mie\u0107 ${i}${o.minimum.toString()} ${a.unit??"element\xF3w"}`:`Zbyt ma\u0142(y/a/e): oczekiwano, \u017Ce ${o.origin??"warto\u015B\u0107"} b\u0119dzie wynosi\u0107 ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zaczyna\u0107 si\u0119 od "${i.prefix}"`:i.format==="ends_with"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi ko\u0144czy\u0107 si\u0119 na "${i.suffix}"`:i.format==="includes"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi zawiera\u0107 "${i.includes}"`:i.format==="regex"?`Nieprawid\u0142owy ci\u0105g znak\xF3w: musi odpowiada\u0107 wzorcowi ${i.pattern}`:`Nieprawid\u0142ow(y/a/e) ${n[i.format]??o.format}`}case"not_multiple_of":return`Nieprawid\u0142owa liczba: musi by\u0107 wielokrotno\u015Bci\u0105 ${o.divisor}`;case"unrecognized_keys":return`Nierozpoznane klucze${o.keys.length>1?"s":""}: ${Le(o.keys,", ")}`;case"invalid_key":return`Nieprawid\u0142owy klucz w ${o.origin}`;case"invalid_union":return"Nieprawid\u0142owe dane wej\u015Bciowe";case"invalid_element":return`Nieprawid\u0142owa warto\u015B\u0107 w ${o.origin}`;default:return"Nieprawid\u0142owe dane wej\u015Bciowe"}}}});function ZTt(){return{localeError:wfn()}}var wfn,XTt=v(()=>{An();wfn=()=>{let t={string:{unit:"caracteres",verb:"ter"},file:{unit:"bytes",verb:"ter"},array:{unit:"itens",verb:"ter"},set:{unit:"itens",verb:"ter"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"n\xFAmero";case"object":{if(Array.isArray(o))return"array";if(o===null)return"nulo";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"padr\xE3o",email:"endere\xE7o de e-mail",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"data e hora ISO",date:"data ISO",time:"hora ISO",duration:"dura\xE7\xE3o ISO",ipv4:"endere\xE7o IPv4",ipv6:"endere\xE7o IPv6",cidrv4:"faixa de IPv4",cidrv6:"faixa de IPv6",base64:"texto codificado em base64",base64url:"URL codificada em base64",json_string:"texto JSON",e164:"n\xFAmero E.164",jwt:"JWT",template_literal:"entrada"};return o=>{switch(o.code){case"invalid_type":return`Tipo inv\xE1lido: esperado ${o.expected}, recebido ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Entrada inv\xE1lida: esperado ${Nt(o.values[0])}`:`Op\xE7\xE3o inv\xE1lida: esperada uma das ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`Muito grande: esperado que ${o.origin??"valor"} tivesse ${i}${o.maximum.toString()} ${a.unit??"elementos"}`:`Muito grande: esperado que ${o.origin??"valor"} fosse ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`Muito pequeno: esperado que ${o.origin} tivesse ${i}${o.minimum.toString()} ${a.unit}`:`Muito pequeno: esperado que ${o.origin} fosse ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Texto inv\xE1lido: deve come\xE7ar com "${i.prefix}"`:i.format==="ends_with"?`Texto inv\xE1lido: deve terminar com "${i.suffix}"`:i.format==="includes"?`Texto inv\xE1lido: deve incluir "${i.includes}"`:i.format==="regex"?`Texto inv\xE1lido: deve corresponder ao padr\xE3o ${i.pattern}`:`${n[i.format]??o.format} inv\xE1lido`}case"not_multiple_of":return`N\xFAmero inv\xE1lido: deve ser m\xFAltiplo de ${o.divisor}`;case"unrecognized_keys":return`Chave${o.keys.length>1?"s":""} desconhecida${o.keys.length>1?"s":""}: ${Le(o.keys,", ")}`;case"invalid_key":return`Chave inv\xE1lida em ${o.origin}`;case"invalid_union":return"Entrada inv\xE1lida";case"invalid_element":return`Valor inv\xE1lido em ${o.origin}`;default:return"Campo inv\xE1lido"}}}});function YTt(t,e,r,n){let o=Math.abs(t),i=o%10,a=o%100;return a>=11&&a<=19?n:i===1?e:i>=2&&i<=4?r:n}function QTt(){return{localeError:Sfn()}}var Sfn,eEt=v(()=>{An();Sfn=()=>{let t={string:{unit:{one:"\u0441\u0438\u043C\u0432\u043E\u043B",few:"\u0441\u0438\u043C\u0432\u043E\u043B\u0430",many:"\u0441\u0438\u043C\u0432\u043E\u043B\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},file:{unit:{one:"\u0431\u0430\u0439\u0442",few:"\u0431\u0430\u0439\u0442\u0430",many:"\u0431\u0430\u0439\u0442"},verb:"\u0438\u043C\u0435\u0442\u044C"},array:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"},set:{unit:{one:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442",few:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u0430",many:"\u044D\u043B\u0435\u043C\u0435\u043D\u0442\u043E\u0432"},verb:"\u0438\u043C\u0435\u0442\u044C"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\u0432\u0432\u043E\u0434",email:"email \u0430\u0434\u0440\u0435\u0441",url:"URL",emoji:"\u044D\u043C\u043E\u0434\u0437\u0438",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0434\u0430\u0442\u0430 \u0438 \u0432\u0440\u0435\u043C\u044F",date:"ISO \u0434\u0430\u0442\u0430",time:"ISO \u0432\u0440\u0435\u043C\u044F",duration:"ISO \u0434\u043B\u0438\u0442\u0435\u043B\u044C\u043D\u043E\u0441\u0442\u044C",ipv4:"IPv4 \u0430\u0434\u0440\u0435\u0441",ipv6:"IPv6 \u0430\u0434\u0440\u0435\u0441",cidrv4:"IPv4 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",cidrv6:"IPv6 \u0434\u0438\u0430\u043F\u0430\u0437\u043E\u043D",base64:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64",base64url:"\u0441\u0442\u0440\u043E\u043A\u0430 \u0432 \u0444\u043E\u0440\u043C\u0430\u0442\u0435 base64url",json_string:"JSON \u0441\u0442\u0440\u043E\u043A\u0430",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0432\u043E\u0434"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${o.expected}, \u043F\u043E\u043B\u0443\u0447\u0435\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0432\u043E\u0434: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C ${Nt(o.values[0])}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u0432\u0430\u0440\u0438\u0430\u043D\u0442: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C \u043E\u0434\u043D\u043E \u0438\u0437 ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);if(a){let s=Number(o.maximum),u=YTt(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${o.maximum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u0431\u043E\u043B\u044C\u0448\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435"} \u0431\u0443\u0434\u0435\u0442 ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);if(a){let s=Number(o.minimum),u=YTt(s,a.unit.one,a.unit.few,a.unit.many);return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 \u0438\u043C\u0435\u0442\u044C ${i}${o.minimum.toString()} ${u}`}return`\u0421\u043B\u0438\u0448\u043A\u043E\u043C \u043C\u0430\u043B\u0435\u043D\u044C\u043A\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435: \u043E\u0436\u0438\u0434\u0430\u043B\u043E\u0441\u044C, \u0447\u0442\u043E ${o.origin} \u0431\u0443\u0434\u0435\u0442 ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u043D\u0430\u0447\u0438\u043D\u0430\u0442\u044C\u0441\u044F \u0441 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0437\u0430\u043A\u0430\u043D\u0447\u0438\u0432\u0430\u0442\u044C\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u0434\u0435\u0440\u0436\u0430\u0442\u044C "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u0432\u0435\u0440\u043D\u0430\u044F \u0441\u0442\u0440\u043E\u043A\u0430: \u0434\u043E\u043B\u0436\u043D\u0430 \u0441\u043E\u043E\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u043E\u0432\u0430\u0442\u044C \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 ${n[i.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0447\u0438\u0441\u043B\u043E: \u0434\u043E\u043B\u0436\u043D\u043E \u0431\u044B\u0442\u044C \u043A\u0440\u0430\u0442\u043D\u044B\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u0430\u0441\u043F\u043E\u0437\u043D\u0430\u043D\u043D${o.keys.length>1?"\u044B\u0435":"\u044B\u0439"} \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0438":""}: ${Le(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0439 \u043A\u043B\u044E\u0447 \u0432 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435";case"invalid_element":return`\u041D\u0435\u0432\u0435\u0440\u043D\u043E\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u0438\u0435 \u0432 ${o.origin}`;default:return"\u041D\u0435\u0432\u0435\u0440\u043D\u044B\u0435 \u0432\u0445\u043E\u0434\u043D\u044B\u0435 \u0434\u0430\u043D\u043D\u044B\u0435"}}}});function tEt(){return{localeError:Cfn()}}var Cfn,rEt=v(()=>{An();Cfn=()=>{let t={string:{unit:"znakov",verb:"imeti"},file:{unit:"bajtov",verb:"imeti"},array:{unit:"elementov",verb:"imeti"},set:{unit:"elementov",verb:"imeti"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"\u0161tevilo";case"object":{if(Array.isArray(o))return"tabela";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"vnos",email:"e-po\u0161tni naslov",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO datum in \u010Das",date:"ISO datum",time:"ISO \u010Das",duration:"ISO trajanje",ipv4:"IPv4 naslov",ipv6:"IPv6 naslov",cidrv4:"obseg IPv4",cidrv6:"obseg IPv6",base64:"base64 kodiran niz",base64url:"base64url kodiran niz",json_string:"JSON niz",e164:"E.164 \u0161tevilka",jwt:"JWT",template_literal:"vnos"};return o=>{switch(o.code){case"invalid_type":return`Neveljaven vnos: pri\u010Dakovano ${o.expected}, prejeto ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Neveljaven vnos: pri\u010Dakovano ${Nt(o.values[0])}`:`Neveljavna mo\u017Enost: pri\u010Dakovano eno izmed ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} imelo ${i}${o.maximum.toString()} ${a.unit??"elementov"}`:`Preveliko: pri\u010Dakovano, da bo ${o.origin??"vrednost"} ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`Premajhno: pri\u010Dakovano, da bo ${o.origin} imelo ${i}${o.minimum.toString()} ${a.unit}`:`Premajhno: pri\u010Dakovano, da bo ${o.origin} ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Neveljaven niz: mora se za\u010Deti z "${i.prefix}"`:i.format==="ends_with"?`Neveljaven niz: mora se kon\u010Dati z "${i.suffix}"`:i.format==="includes"?`Neveljaven niz: mora vsebovati "${i.includes}"`:i.format==="regex"?`Neveljaven niz: mora ustrezati vzorcu ${i.pattern}`:`Neveljaven ${n[i.format]??o.format}`}case"not_multiple_of":return`Neveljavno \u0161tevilo: mora biti ve\u010Dkratnik ${o.divisor}`;case"unrecognized_keys":return`Neprepoznan${o.keys.length>1?"i klju\u010Di":" klju\u010D"}: ${Le(o.keys,", ")}`;case"invalid_key":return`Neveljaven klju\u010D v ${o.origin}`;case"invalid_union":return"Neveljaven vnos";case"invalid_element":return`Neveljavna vrednost v ${o.origin}`;default:return"Neveljaven vnos"}}}});function nEt(){return{localeError:xfn()}}var xfn,oEt=v(()=>{An();xfn=()=>{let t={string:{unit:"tecken",verb:"att ha"},file:{unit:"bytes",verb:"att ha"},array:{unit:"objekt",verb:"att inneh\xE5lla"},set:{unit:"objekt",verb:"att inneh\xE5lla"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"antal";case"object":{if(Array.isArray(o))return"lista";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"regulj\xE4rt uttryck",email:"e-postadress",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO-datum och tid",date:"ISO-datum",time:"ISO-tid",duration:"ISO-varaktighet",ipv4:"IPv4-intervall",ipv6:"IPv6-intervall",cidrv4:"IPv4-spektrum",cidrv6:"IPv6-spektrum",base64:"base64-kodad str\xE4ng",base64url:"base64url-kodad str\xE4ng",json_string:"JSON-str\xE4ng",e164:"E.164-nummer",jwt:"JWT",template_literal:"mall-literal"};return o=>{switch(o.code){case"invalid_type":return`Ogiltig inmatning: f\xF6rv\xE4ntat ${o.expected}, fick ${r(o.input)}`;case"invalid_value":return o.values.length===1?`Ogiltig inmatning: f\xF6rv\xE4ntat ${Nt(o.values[0])}`:`Ogiltigt val: f\xF6rv\xE4ntade en av ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`F\xF6r stor(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${i}${o.maximum.toString()} ${a.unit??"element"}`:`F\xF6r stor(t): f\xF6rv\xE4ntat ${o.origin??"v\xE4rdet"} att ha ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${i}${o.minimum.toString()} ${a.unit}`:`F\xF6r lite(t): f\xF6rv\xE4ntade ${o.origin??"v\xE4rdet"} att ha ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Ogiltig str\xE4ng: m\xE5ste b\xF6rja med "${i.prefix}"`:i.format==="ends_with"?`Ogiltig str\xE4ng: m\xE5ste sluta med "${i.suffix}"`:i.format==="includes"?`Ogiltig str\xE4ng: m\xE5ste inneh\xE5lla "${i.includes}"`:i.format==="regex"?`Ogiltig str\xE4ng: m\xE5ste matcha m\xF6nstret "${i.pattern}"`:`Ogiltig(t) ${n[i.format]??o.format}`}case"not_multiple_of":return`Ogiltigt tal: m\xE5ste vara en multipel av ${o.divisor}`;case"unrecognized_keys":return`${o.keys.length>1?"Ok\xE4nda nycklar":"Ok\xE4nd nyckel"}: ${Le(o.keys,", ")}`;case"invalid_key":return`Ogiltig nyckel i ${o.origin??"v\xE4rdet"}`;case"invalid_union":return"Ogiltig input";case"invalid_element":return`Ogiltigt v\xE4rde i ${o.origin??"v\xE4rdet"}`;default:return"Ogiltig input"}}}});function iEt(){return{localeError:Ofn()}}var Ofn,aEt=v(()=>{An();Ofn=()=>{let t={string:{unit:"\u0B8E\u0BB4\u0BC1\u0BA4\u0BCD\u0BA4\u0BC1\u0B95\u0BCD\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},file:{unit:"\u0BAA\u0BC8\u0B9F\u0BCD\u0B9F\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},array:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"},set:{unit:"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD",verb:"\u0B95\u0BCA\u0BA3\u0BCD\u0B9F\u0BBF\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"\u0B8E\u0BA3\u0BCD \u0B85\u0BB2\u0BCD\u0BB2\u0BBE\u0BA4\u0BA4\u0BC1":"\u0B8E\u0BA3\u0BCD";case"object":{if(Array.isArray(o))return"\u0B85\u0BA3\u0BBF";if(o===null)return"\u0BB5\u0BC6\u0BB1\u0BC1\u0BAE\u0BC8";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1",email:"\u0BAE\u0BBF\u0BA9\u0BCD\u0BA9\u0B9E\u0BCD\u0B9A\u0BB2\u0BCD \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u0BA4\u0BC7\u0BA4\u0BBF \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",date:"ISO \u0BA4\u0BC7\u0BA4\u0BBF",time:"ISO \u0BA8\u0BC7\u0BB0\u0BAE\u0BCD",duration:"ISO \u0B95\u0BBE\u0BB2 \u0B85\u0BB3\u0BB5\u0BC1",ipv4:"IPv4 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",ipv6:"IPv6 \u0BAE\u0BC1\u0B95\u0BB5\u0BB0\u0BBF",cidrv4:"IPv4 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",cidrv6:"IPv6 \u0BB5\u0BB0\u0BAE\u0BCD\u0BAA\u0BC1",base64:"base64-encoded \u0B9A\u0BB0\u0BAE\u0BCD",base64url:"base64url-encoded \u0B9A\u0BB0\u0BAE\u0BCD",json_string:"JSON \u0B9A\u0BB0\u0BAE\u0BCD",e164:"E.164 \u0B8E\u0BA3\u0BCD",jwt:"JWT",template_literal:"input"};return o=>{switch(o.code){case"invalid_type":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.expected}, \u0BAA\u0BC6\u0BB1\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Nt(o.values[0])}`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0BB0\u0BC1\u0BAA\u0BCD\u0BAA\u0BAE\u0BCD: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${Le(o.values,"|")} \u0B87\u0BB2\u0BCD \u0B92\u0BA9\u0BCD\u0BB1\u0BC1`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${o.maximum.toString()} ${a.unit??"\u0B89\u0BB1\u0BC1\u0BAA\u0BCD\u0BAA\u0BC1\u0B95\u0BB3\u0BCD"} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95 \u0BAA\u0BC6\u0BB0\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin??"\u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1"} ${i}${o.maximum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${i}${o.minimum.toString()} ${a.unit} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BAE\u0BBF\u0B95\u0B9A\u0BCD \u0B9A\u0BBF\u0BB1\u0BBF\u0BAF\u0BA4\u0BC1: \u0B8E\u0BA4\u0BBF\u0BB0\u0BCD\u0BAA\u0BBE\u0BB0\u0BCD\u0B95\u0BCD\u0B95\u0BAA\u0BCD\u0BAA\u0B9F\u0BCD\u0B9F\u0BA4\u0BC1 ${o.origin} ${i}${o.minimum.toString()} \u0B86\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.prefix}" \u0B87\u0BB2\u0BCD \u0BA4\u0BCA\u0B9F\u0B99\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="ends_with"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.suffix}" \u0B87\u0BB2\u0BCD \u0BAE\u0BC1\u0B9F\u0BBF\u0BB5\u0B9F\u0BC8\u0BAF \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="includes"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: "${i.includes}" \u0B90 \u0B89\u0BB3\u0BCD\u0BB3\u0B9F\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:i.format==="regex"?`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B9A\u0BB0\u0BAE\u0BCD: ${i.pattern} \u0BAE\u0BC1\u0BB1\u0BC8\u0BAA\u0BBE\u0B9F\u0BCD\u0B9F\u0BC1\u0B9F\u0BA9\u0BCD \u0BAA\u0BCA\u0BB0\u0BC1\u0BA8\u0BCD\u0BA4 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`:`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 ${n[i.format]??o.format}`}case"not_multiple_of":return`\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B8E\u0BA3\u0BCD: ${o.divisor} \u0B87\u0BA9\u0BCD \u0BAA\u0BB2\u0BAE\u0BBE\u0B95 \u0B87\u0BB0\u0BC1\u0B95\u0BCD\u0B95 \u0BB5\u0BC7\u0BA3\u0BCD\u0B9F\u0BC1\u0BAE\u0BCD`;case"unrecognized_keys":return`\u0B85\u0B9F\u0BC8\u0BAF\u0BBE\u0BB3\u0BAE\u0BCD \u0BA4\u0BC6\u0BB0\u0BBF\u0BAF\u0BBE\u0BA4 \u0BB5\u0BBF\u0B9A\u0BC8${o.keys.length>1?"\u0B95\u0BB3\u0BCD":""}: ${Le(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BB5\u0BBF\u0B9A\u0BC8`;case"invalid_union":return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1";case"invalid_element":return`${o.origin} \u0B87\u0BB2\u0BCD \u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0BAE\u0BA4\u0BBF\u0BAA\u0BCD\u0BAA\u0BC1`;default:return"\u0BA4\u0BB5\u0BB1\u0BBE\u0BA9 \u0B89\u0BB3\u0BCD\u0BB3\u0BC0\u0B9F\u0BC1"}}}});function sEt(){return{localeError:Tfn()}}var Tfn,uEt=v(()=>{An();Tfn=()=>{let t={string:{unit:"\u0E15\u0E31\u0E27\u0E2D\u0E31\u0E01\u0E29\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},file:{unit:"\u0E44\u0E1A\u0E15\u0E4C",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},array:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"},set:{unit:"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23",verb:"\u0E04\u0E27\u0E23\u0E21\u0E35"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"\u0E44\u0E21\u0E48\u0E43\u0E0A\u0E48\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02 (NaN)":"\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02";case"object":{if(Array.isArray(o))return"\u0E2D\u0E32\u0E23\u0E4C\u0E40\u0E23\u0E22\u0E4C (Array)";if(o===null)return"\u0E44\u0E21\u0E48\u0E21\u0E35\u0E04\u0E48\u0E32 (null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19",email:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48\u0E2D\u0E35\u0E40\u0E21\u0E25",url:"URL",emoji:"\u0E2D\u0E34\u0E42\u0E21\u0E08\u0E34",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",date:"\u0E27\u0E31\u0E19\u0E17\u0E35\u0E48\u0E41\u0E1A\u0E1A ISO",time:"\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",duration:"\u0E0A\u0E48\u0E27\u0E07\u0E40\u0E27\u0E25\u0E32\u0E41\u0E1A\u0E1A ISO",ipv4:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv4",ipv6:"\u0E17\u0E35\u0E48\u0E2D\u0E22\u0E39\u0E48 IPv6",cidrv4:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv4",cidrv6:"\u0E0A\u0E48\u0E27\u0E07 IP \u0E41\u0E1A\u0E1A IPv6",base64:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64",base64url:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A Base64 \u0E2A\u0E33\u0E2B\u0E23\u0E31\u0E1A URL",json_string:"\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E41\u0E1A\u0E1A JSON",e164:"\u0E40\u0E1A\u0E2D\u0E23\u0E4C\u0E42\u0E17\u0E23\u0E28\u0E31\u0E1E\u0E17\u0E4C\u0E23\u0E30\u0E2B\u0E27\u0E48\u0E32\u0E07\u0E1B\u0E23\u0E30\u0E40\u0E17\u0E28 (E.164)",jwt:"\u0E42\u0E17\u0E40\u0E04\u0E19 JWT",template_literal:"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E17\u0E35\u0E48\u0E1B\u0E49\u0E2D\u0E19"};return o=>{switch(o.code){case"invalid_type":return`\u0E1B\u0E23\u0E30\u0E40\u0E20\u0E17\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${o.expected} \u0E41\u0E15\u0E48\u0E44\u0E14\u0E49\u0E23\u0E31\u0E1A ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0E04\u0E48\u0E32\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19 ${Nt(o.values[0])}`:`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E37\u0E2D\u0E01\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E04\u0E27\u0E23\u0E40\u0E1B\u0E47\u0E19\u0E2B\u0E19\u0E36\u0E48\u0E07\u0E43\u0E19 ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"\u0E44\u0E21\u0E48\u0E40\u0E01\u0E34\u0E19":"\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32",a=e(o.origin);return a?`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${o.maximum.toString()} ${a.unit??"\u0E23\u0E32\u0E22\u0E01\u0E32\u0E23"}`:`\u0E40\u0E01\u0E34\u0E19\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin??"\u0E04\u0E48\u0E32"} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?"\u0E2D\u0E22\u0E48\u0E32\u0E07\u0E19\u0E49\u0E2D\u0E22":"\u0E21\u0E32\u0E01\u0E01\u0E27\u0E48\u0E32",a=e(o.origin);return a?`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${o.minimum.toString()} ${a.unit}`:`\u0E19\u0E49\u0E2D\u0E22\u0E01\u0E27\u0E48\u0E32\u0E01\u0E33\u0E2B\u0E19\u0E14: ${o.origin} \u0E04\u0E27\u0E23\u0E21\u0E35${i} ${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E02\u0E36\u0E49\u0E19\u0E15\u0E49\u0E19\u0E14\u0E49\u0E27\u0E22 "${i.prefix}"`:i.format==="ends_with"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E25\u0E07\u0E17\u0E49\u0E32\u0E22\u0E14\u0E49\u0E27\u0E22 "${i.suffix}"`:i.format==="includes"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21\u0E15\u0E49\u0E2D\u0E07\u0E21\u0E35 "${i.includes}" \u0E2D\u0E22\u0E39\u0E48\u0E43\u0E19\u0E02\u0E49\u0E2D\u0E04\u0E27\u0E32\u0E21`:i.format==="regex"?`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14 ${i.pattern}`:`\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: ${n[i.format]??o.format}`}case"not_multiple_of":return`\u0E15\u0E31\u0E27\u0E40\u0E25\u0E02\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E15\u0E49\u0E2D\u0E07\u0E40\u0E1B\u0E47\u0E19\u0E08\u0E33\u0E19\u0E27\u0E19\u0E17\u0E35\u0E48\u0E2B\u0E32\u0E23\u0E14\u0E49\u0E27\u0E22 ${o.divisor} \u0E44\u0E14\u0E49\u0E25\u0E07\u0E15\u0E31\u0E27`;case"unrecognized_keys":return`\u0E1E\u0E1A\u0E04\u0E35\u0E22\u0E4C\u0E17\u0E35\u0E48\u0E44\u0E21\u0E48\u0E23\u0E39\u0E49\u0E08\u0E31\u0E01: ${Le(o.keys,", ")}`;case"invalid_key":return`\u0E04\u0E35\u0E22\u0E4C\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;case"invalid_union":return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07: \u0E44\u0E21\u0E48\u0E15\u0E23\u0E07\u0E01\u0E31\u0E1A\u0E23\u0E39\u0E1B\u0E41\u0E1A\u0E1A\u0E22\u0E39\u0E40\u0E19\u0E35\u0E22\u0E19\u0E17\u0E35\u0E48\u0E01\u0E33\u0E2B\u0E19\u0E14\u0E44\u0E27\u0E49";case"invalid_element":return`\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07\u0E43\u0E19 ${o.origin}`;default:return"\u0E02\u0E49\u0E2D\u0E21\u0E39\u0E25\u0E44\u0E21\u0E48\u0E16\u0E39\u0E01\u0E15\u0E49\u0E2D\u0E07"}}}});function lEt(){return{localeError:Pfn()}}var Efn,Pfn,cEt=v(()=>{An();Efn=t=>{let e=typeof t;switch(e){case"number":return Number.isNaN(t)?"NaN":"number";case"object":{if(Array.isArray(t))return"array";if(t===null)return"null";if(Object.getPrototypeOf(t)!==Object.prototype&&t.constructor)return t.constructor.name}}return e},Pfn=()=>{let t={string:{unit:"karakter",verb:"olmal\u0131"},file:{unit:"bayt",verb:"olmal\u0131"},array:{unit:"\xF6\u011Fe",verb:"olmal\u0131"},set:{unit:"\xF6\u011Fe",verb:"olmal\u0131"}};function e(n){return t[n]??null}let r={regex:"girdi",email:"e-posta adresi",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO tarih ve saat",date:"ISO tarih",time:"ISO saat",duration:"ISO s\xFCre",ipv4:"IPv4 adresi",ipv6:"IPv6 adresi",cidrv4:"IPv4 aral\u0131\u011F\u0131",cidrv6:"IPv6 aral\u0131\u011F\u0131",base64:"base64 ile \u015Fifrelenmi\u015F metin",base64url:"base64url ile \u015Fifrelenmi\u015F metin",json_string:"JSON dizesi",e164:"E.164 say\u0131s\u0131",jwt:"JWT",template_literal:"\u015Eablon dizesi"};return n=>{switch(n.code){case"invalid_type":return`Ge\xE7ersiz de\u011Fer: beklenen ${n.expected}, al\u0131nan ${Efn(n.input)}`;case"invalid_value":return n.values.length===1?`Ge\xE7ersiz de\u011Fer: beklenen ${Nt(n.values[0])}`:`Ge\xE7ersiz se\xE7enek: a\u015Fa\u011F\u0131dakilerden biri olmal\u0131: ${Le(n.values,"|")}`;case"too_big":{let o=n.inclusive?"<=":"<",i=e(n.origin);return i?`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()} ${i.unit??"\xF6\u011Fe"}`:`\xC7ok b\xFCy\xFCk: beklenen ${n.origin??"de\u011Fer"} ${o}${n.maximum.toString()}`}case"too_small":{let o=n.inclusive?">=":">",i=e(n.origin);return i?`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()} ${i.unit}`:`\xC7ok k\xFC\xE7\xFCk: beklenen ${n.origin} ${o}${n.minimum.toString()}`}case"invalid_format":{let o=n;return o.format==="starts_with"?`Ge\xE7ersiz metin: "${o.prefix}" ile ba\u015Flamal\u0131`:o.format==="ends_with"?`Ge\xE7ersiz metin: "${o.suffix}" ile bitmeli`:o.format==="includes"?`Ge\xE7ersiz metin: "${o.includes}" i\xE7ermeli`:o.format==="regex"?`Ge\xE7ersiz metin: ${o.pattern} desenine uymal\u0131`:`Ge\xE7ersiz ${r[o.format]??n.format}`}case"not_multiple_of":return`Ge\xE7ersiz say\u0131: ${n.divisor} ile tam b\xF6l\xFCnebilmeli`;case"unrecognized_keys":return`Tan\u0131nmayan anahtar${n.keys.length>1?"lar":""}: ${Le(n.keys,", ")}`;case"invalid_key":return`${n.origin} i\xE7inde ge\xE7ersiz anahtar`;case"invalid_union":return"Ge\xE7ersiz de\u011Fer";case"invalid_element":return`${n.origin} i\xE7inde ge\xE7ersiz de\u011Fer`;default:return"Ge\xE7ersiz de\u011Fer"}}}});function dEt(){return{localeError:Mfn()}}var Mfn,fEt=v(()=>{An();Mfn=()=>{let t={string:{unit:"\u0441\u0438\u043C\u0432\u043E\u043B\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},file:{unit:"\u0431\u0430\u0439\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},array:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"},set:{unit:"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432",verb:"\u043C\u0430\u0442\u0438\u043C\u0435"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"\u0447\u0438\u0441\u043B\u043E";case"object":{if(Array.isArray(o))return"\u043C\u0430\u0441\u0438\u0432";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456",email:"\u0430\u0434\u0440\u0435\u0441\u0430 \u0435\u043B\u0435\u043A\u0442\u0440\u043E\u043D\u043D\u043E\u0457 \u043F\u043E\u0448\u0442\u0438",url:"URL",emoji:"\u0435\u043C\u043E\u0434\u0437\u0456",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"\u0434\u0430\u0442\u0430 \u0442\u0430 \u0447\u0430\u0441 ISO",date:"\u0434\u0430\u0442\u0430 ISO",time:"\u0447\u0430\u0441 ISO",duration:"\u0442\u0440\u0438\u0432\u0430\u043B\u0456\u0441\u0442\u044C ISO",ipv4:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv4",ipv6:"\u0430\u0434\u0440\u0435\u0441\u0430 IPv6",cidrv4:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv4",cidrv6:"\u0434\u0456\u0430\u043F\u0430\u0437\u043E\u043D IPv6",base64:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64",base64url:"\u0440\u044F\u0434\u043E\u043A \u0443 \u043A\u043E\u0434\u0443\u0432\u0430\u043D\u043D\u0456 base64url",json_string:"\u0440\u044F\u0434\u043E\u043A JSON",e164:"\u043D\u043E\u043C\u0435\u0440 E.164",jwt:"JWT",template_literal:"\u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"};return o=>{switch(o.code){case"invalid_type":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${o.expected}, \u043E\u0442\u0440\u0438\u043C\u0430\u043D\u043E ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F ${Nt(o.values[0])}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0430 \u043E\u043F\u0446\u0456\u044F: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F \u043E\u0434\u043D\u0435 \u0437 ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} ${a.verb} ${i}${o.maximum.toString()} ${a.unit??"\u0435\u043B\u0435\u043C\u0435\u043D\u0442\u0456\u0432"}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u0432\u0435\u043B\u0438\u043A\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin??"\u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F"} \u0431\u0443\u0434\u0435 ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} ${a.verb} ${i}${o.minimum.toString()} ${a.unit}`:`\u0417\u0430\u043D\u0430\u0434\u0442\u043E \u043C\u0430\u043B\u0435: \u043E\u0447\u0456\u043A\u0443\u0454\u0442\u044C\u0441\u044F, \u0449\u043E ${o.origin} \u0431\u0443\u0434\u0435 ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043F\u043E\u0447\u0438\u043D\u0430\u0442\u0438\u0441\u044F \u0437 "${i.prefix}"`:i.format==="ends_with"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0437\u0430\u043A\u0456\u043D\u0447\u0443\u0432\u0430\u0442\u0438\u0441\u044F \u043D\u0430 "${i.suffix}"`:i.format==="includes"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u043C\u0456\u0441\u0442\u0438\u0442\u0438 "${i.includes}"`:i.format==="regex"?`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u0440\u044F\u0434\u043E\u043A: \u043F\u043E\u0432\u0438\u043D\u0435\u043D \u0432\u0456\u0434\u043F\u043E\u0432\u0456\u0434\u0430\u0442\u0438 \u0448\u0430\u0431\u043B\u043E\u043D\u0443 ${i.pattern}`:`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 ${n[i.format]??o.format}`}case"not_multiple_of":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0447\u0438\u0441\u043B\u043E: \u043F\u043E\u0432\u0438\u043D\u043D\u043E \u0431\u0443\u0442\u0438 \u043A\u0440\u0430\u0442\u043D\u0438\u043C ${o.divisor}`;case"unrecognized_keys":return`\u041D\u0435\u0440\u043E\u0437\u043F\u0456\u0437\u043D\u0430\u043D\u0438\u0439 \u043A\u043B\u044E\u0447${o.keys.length>1?"\u0456":""}: ${Le(o.keys,", ")}`;case"invalid_key":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0438\u0439 \u043A\u043B\u044E\u0447 \u0443 ${o.origin}`;case"invalid_union":return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456";case"invalid_element":return`\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0435 \u0437\u043D\u0430\u0447\u0435\u043D\u043D\u044F \u0443 ${o.origin}`;default:return"\u041D\u0435\u043F\u0440\u0430\u0432\u0438\u043B\u044C\u043D\u0456 \u0432\u0445\u0456\u0434\u043D\u0456 \u0434\u0430\u043D\u0456"}}}});function pEt(){return{localeError:Rfn()}}var Rfn,mEt=v(()=>{An();Rfn=()=>{let t={string:{unit:"\u062D\u0631\u0648\u0641",verb:"\u06C1\u0648\u0646\u0627"},file:{unit:"\u0628\u0627\u0626\u0679\u0633",verb:"\u06C1\u0648\u0646\u0627"},array:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"},set:{unit:"\u0622\u0626\u0679\u0645\u0632",verb:"\u06C1\u0648\u0646\u0627"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"\u0646\u0645\u0628\u0631";case"object":{if(Array.isArray(o))return"\u0622\u0631\u06D2";if(o===null)return"\u0646\u0644";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\u0627\u0646 \u067E\u0679",email:"\u0627\u06CC \u0645\u06CC\u0644 \u0627\u06CC\u0688\u0631\u06CC\u0633",url:"\u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644",emoji:"\u0627\u06CC\u0645\u0648\u062C\u06CC",uuid:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",uuidv4:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 4",uuidv6:"\u06CC\u0648 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC \u0648\u06CC 6",nanoid:"\u0646\u06CC\u0646\u0648 \u0622\u0626\u06CC \u0688\u06CC",guid:"\u062C\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",cuid2:"\u0633\u06CC \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC 2",ulid:"\u06CC\u0648 \u0627\u06CC\u0644 \u0622\u0626\u06CC \u0688\u06CC",xid:"\u0627\u06CC\u06A9\u0633 \u0622\u0626\u06CC \u0688\u06CC",ksuid:"\u06A9\u06D2 \u0627\u06CC\u0633 \u06CC\u0648 \u0622\u0626\u06CC \u0688\u06CC",datetime:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0688\u06CC\u0679 \u0679\u0627\u0626\u0645",date:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u062A\u0627\u0631\u06CC\u062E",time:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0648\u0642\u062A",duration:"\u0622\u0626\u06CC \u0627\u06CC\u0633 \u0627\u0648 \u0645\u062F\u062A",ipv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0627\u06CC\u0688\u0631\u06CC\u0633",ipv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0627\u06CC\u0688\u0631\u06CC\u0633",cidrv4:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 4 \u0631\u06CC\u0646\u062C",cidrv6:"\u0622\u0626\u06CC \u067E\u06CC \u0648\u06CC 6 \u0631\u06CC\u0646\u062C",base64:"\u0628\u06CC\u0633 64 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",base64url:"\u0628\u06CC\u0633 64 \u06CC\u0648 \u0622\u0631 \u0627\u06CC\u0644 \u0627\u0646 \u06A9\u0648\u0688\u0688 \u0633\u0679\u0631\u0646\u06AF",json_string:"\u062C\u06D2 \u0627\u06CC\u0633 \u0627\u0648 \u0627\u06CC\u0646 \u0633\u0679\u0631\u0646\u06AF",e164:"\u0627\u06CC 164 \u0646\u0645\u0628\u0631",jwt:"\u062C\u06D2 \u0688\u0628\u0644\u06CC\u0648 \u0679\u06CC",template_literal:"\u0627\u0646 \u067E\u0679"};return o=>{switch(o.code){case"invalid_type":return`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${o.expected} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627\u060C ${r(o.input)} \u0645\u0648\u0635\u0648\u0644 \u06C1\u0648\u0627`;case"invalid_value":return o.values.length===1?`\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679: ${Nt(o.values[0])} \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`:`\u063A\u0644\u0637 \u0622\u067E\u0634\u0646: ${Le(o.values,"|")} \u0645\u06CC\u06BA \u0633\u06D2 \u0627\u06CC\u06A9 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u06D2 ${i}${o.maximum.toString()} ${a.unit??"\u0639\u0646\u0627\u0635\u0631"} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0628\u0691\u0627: ${o.origin??"\u0648\u06CC\u0644\u06CC\u0648"} \u06A9\u0627 ${i}${o.maximum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u06D2 ${i}${o.minimum.toString()} ${a.unit} \u06C1\u0648\u0646\u06D2 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u06D2`:`\u0628\u06C1\u062A \u0686\u06BE\u0648\u0679\u0627: ${o.origin} \u06A9\u0627 ${i}${o.minimum.toString()} \u06C1\u0648\u0646\u0627 \u0645\u062A\u0648\u0642\u0639 \u062A\u06BE\u0627`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.prefix}" \u0633\u06D2 \u0634\u0631\u0648\u0639 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="ends_with"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.suffix}" \u067E\u0631 \u062E\u062A\u0645 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="includes"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: "${i.includes}" \u0634\u0627\u0645\u0644 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:i.format==="regex"?`\u063A\u0644\u0637 \u0633\u0679\u0631\u0646\u06AF: \u067E\u06CC\u0679\u0631\u0646 ${i.pattern} \u0633\u06D2 \u0645\u06CC\u0686 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`:`\u063A\u0644\u0637 ${n[i.format]??o.format}`}case"not_multiple_of":return`\u063A\u0644\u0637 \u0646\u0645\u0628\u0631: ${o.divisor} \u06A9\u0627 \u0645\u0636\u0627\u0639\u0641 \u06C1\u0648\u0646\u0627 \u0686\u0627\u06C1\u06CC\u06D2`;case"unrecognized_keys":return`\u063A\u06CC\u0631 \u062A\u0633\u0644\u06CC\u0645 \u0634\u062F\u06C1 \u06A9\u06CC${o.keys.length>1?"\u0632":""}: ${Le(o.keys,"\u060C ")}`;case"invalid_key":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u06A9\u06CC`;case"invalid_union":return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679";case"invalid_element":return`${o.origin} \u0645\u06CC\u06BA \u063A\u0644\u0637 \u0648\u06CC\u0644\u06CC\u0648`;default:return"\u063A\u0644\u0637 \u0627\u0646 \u067E\u0679"}}}});function hEt(){return{localeError:Afn()}}var Afn,gEt=v(()=>{An();Afn=()=>{let t={string:{unit:"k\xFD t\u1EF1",verb:"c\xF3"},file:{unit:"byte",verb:"c\xF3"},array:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"},set:{unit:"ph\u1EA7n t\u1EED",verb:"c\xF3"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"s\u1ED1";case"object":{if(Array.isArray(o))return"m\u1EA3ng";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\u0111\u1EA7u v\xE0o",email:"\u0111\u1ECBa ch\u1EC9 email",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ng\xE0y gi\u1EDD ISO",date:"ng\xE0y ISO",time:"gi\u1EDD ISO",duration:"kho\u1EA3ng th\u1EDDi gian ISO",ipv4:"\u0111\u1ECBa ch\u1EC9 IPv4",ipv6:"\u0111\u1ECBa ch\u1EC9 IPv6",cidrv4:"d\u1EA3i IPv4",cidrv6:"d\u1EA3i IPv6",base64:"chu\u1ED7i m\xE3 h\xF3a base64",base64url:"chu\u1ED7i m\xE3 h\xF3a base64url",json_string:"chu\u1ED7i JSON",e164:"s\u1ED1 E.164",jwt:"JWT",template_literal:"\u0111\u1EA7u v\xE0o"};return o=>{switch(o.code){case"invalid_type":return`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${o.expected}, nh\u1EADn \u0111\u01B0\u1EE3c ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i ${Nt(o.values[0])}`:`T\xF9y ch\u1ECDn kh\xF4ng h\u1EE3p l\u1EC7: mong \u0111\u1EE3i m\u1ED9t trong c\xE1c gi\xE1 tr\u1ECB ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${a.verb} ${i}${o.maximum.toString()} ${a.unit??"ph\u1EA7n t\u1EED"}`:`Qu\xE1 l\u1EDBn: mong \u0111\u1EE3i ${o.origin??"gi\xE1 tr\u1ECB"} ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${a.verb} ${i}${o.minimum.toString()} ${a.unit}`:`Qu\xE1 nh\u1ECF: mong \u0111\u1EE3i ${o.origin} ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i b\u1EAFt \u0111\u1EA7u b\u1EB1ng "${i.prefix}"`:i.format==="ends_with"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i k\u1EBFt th\xFAc b\u1EB1ng "${i.suffix}"`:i.format==="includes"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i bao g\u1ED3m "${i.includes}"`:i.format==="regex"?`Chu\u1ED7i kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i kh\u1EDBp v\u1EDBi m\u1EABu ${i.pattern}`:`${n[i.format]??o.format} kh\xF4ng h\u1EE3p l\u1EC7`}case"not_multiple_of":return`S\u1ED1 kh\xF4ng h\u1EE3p l\u1EC7: ph\u1EA3i l\xE0 b\u1ED9i s\u1ED1 c\u1EE7a ${o.divisor}`;case"unrecognized_keys":return`Kh\xF3a kh\xF4ng \u0111\u01B0\u1EE3c nh\u1EADn d\u1EA1ng: ${Le(o.keys,", ")}`;case"invalid_key":return`Kh\xF3a kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;case"invalid_union":return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7";case"invalid_element":return`Gi\xE1 tr\u1ECB kh\xF4ng h\u1EE3p l\u1EC7 trong ${o.origin}`;default:return"\u0110\u1EA7u v\xE0o kh\xF4ng h\u1EE3p l\u1EC7"}}}});function yEt(){return{localeError:Ifn()}}var Ifn,bEt=v(()=>{An();Ifn=()=>{let t={string:{unit:"\u5B57\u7B26",verb:"\u5305\u542B"},file:{unit:"\u5B57\u8282",verb:"\u5305\u542B"},array:{unit:"\u9879",verb:"\u5305\u542B"},set:{unit:"\u9879",verb:"\u5305\u542B"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"\u975E\u6570\u5B57(NaN)":"\u6570\u5B57";case"object":{if(Array.isArray(o))return"\u6570\u7EC4";if(o===null)return"\u7A7A\u503C(null)";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\u8F93\u5165",email:"\u7535\u5B50\u90AE\u4EF6",url:"URL",emoji:"\u8868\u60C5\u7B26\u53F7",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO\u65E5\u671F\u65F6\u95F4",date:"ISO\u65E5\u671F",time:"ISO\u65F6\u95F4",duration:"ISO\u65F6\u957F",ipv4:"IPv4\u5730\u5740",ipv6:"IPv6\u5730\u5740",cidrv4:"IPv4\u7F51\u6BB5",cidrv6:"IPv6\u7F51\u6BB5",base64:"base64\u7F16\u7801\u5B57\u7B26\u4E32",base64url:"base64url\u7F16\u7801\u5B57\u7B26\u4E32",json_string:"JSON\u5B57\u7B26\u4E32",e164:"E.164\u53F7\u7801",jwt:"JWT",template_literal:"\u8F93\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${o.expected}\uFF0C\u5B9E\u9645\u63A5\u6536 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u65E0\u6548\u8F93\u5165\uFF1A\u671F\u671B ${Nt(o.values[0])}`:`\u65E0\u6548\u9009\u9879\uFF1A\u671F\u671B\u4EE5\u4E0B\u4E4B\u4E00 ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${i}${o.maximum.toString()} ${a.unit??"\u4E2A\u5143\u7D20"}`:`\u6570\u503C\u8FC7\u5927\uFF1A\u671F\u671B ${o.origin??"\u503C"} ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${i}${o.minimum.toString()} ${a.unit}`:`\u6570\u503C\u8FC7\u5C0F\uFF1A\u671F\u671B ${o.origin} ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.prefix}" \u5F00\u5934`:i.format==="ends_with"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u4EE5 "${i.suffix}" \u7ED3\u5C3E`:i.format==="includes"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u65E0\u6548\u5B57\u7B26\u4E32\uFF1A\u5FC5\u987B\u6EE1\u8DB3\u6B63\u5219\u8868\u8FBE\u5F0F ${i.pattern}`:`\u65E0\u6548${n[i.format]??o.format}`}case"not_multiple_of":return`\u65E0\u6548\u6570\u5B57\uFF1A\u5FC5\u987B\u662F ${o.divisor} \u7684\u500D\u6570`;case"unrecognized_keys":return`\u51FA\u73B0\u672A\u77E5\u7684\u952E(key): ${Le(o.keys,", ")}`;case"invalid_key":return`${o.origin} \u4E2D\u7684\u952E(key)\u65E0\u6548`;case"invalid_union":return"\u65E0\u6548\u8F93\u5165";case"invalid_element":return`${o.origin} \u4E2D\u5305\u542B\u65E0\u6548\u503C(value)`;default:return"\u65E0\u6548\u8F93\u5165"}}}});function _Et(){return{localeError:Nfn()}}var Nfn,vEt=v(()=>{An();Nfn=()=>{let t={string:{unit:"\u5B57\u5143",verb:"\u64C1\u6709"},file:{unit:"\u4F4D\u5143\u7D44",verb:"\u64C1\u6709"},array:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"},set:{unit:"\u9805\u76EE",verb:"\u64C1\u6709"}};function e(o){return t[o]??null}let r=o=>{let i=typeof o;switch(i){case"number":return Number.isNaN(o)?"NaN":"number";case"object":{if(Array.isArray(o))return"array";if(o===null)return"null";if(Object.getPrototypeOf(o)!==Object.prototype&&o.constructor)return o.constructor.name}}return i},n={regex:"\u8F38\u5165",email:"\u90F5\u4EF6\u5730\u5740",url:"URL",emoji:"emoji",uuid:"UUID",uuidv4:"UUIDv4",uuidv6:"UUIDv6",nanoid:"nanoid",guid:"GUID",cuid:"cuid",cuid2:"cuid2",ulid:"ULID",xid:"XID",ksuid:"KSUID",datetime:"ISO \u65E5\u671F\u6642\u9593",date:"ISO \u65E5\u671F",time:"ISO \u6642\u9593",duration:"ISO \u671F\u9593",ipv4:"IPv4 \u4F4D\u5740",ipv6:"IPv6 \u4F4D\u5740",cidrv4:"IPv4 \u7BC4\u570D",cidrv6:"IPv6 \u7BC4\u570D",base64:"base64 \u7DE8\u78BC\u5B57\u4E32",base64url:"base64url \u7DE8\u78BC\u5B57\u4E32",json_string:"JSON \u5B57\u4E32",e164:"E.164 \u6578\u503C",jwt:"JWT",template_literal:"\u8F38\u5165"};return o=>{switch(o.code){case"invalid_type":return`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${o.expected}\uFF0C\u4F46\u6536\u5230 ${r(o.input)}`;case"invalid_value":return o.values.length===1?`\u7121\u6548\u7684\u8F38\u5165\u503C\uFF1A\u9810\u671F\u70BA ${Nt(o.values[0])}`:`\u7121\u6548\u7684\u9078\u9805\uFF1A\u9810\u671F\u70BA\u4EE5\u4E0B\u5176\u4E2D\u4E4B\u4E00 ${Le(o.values,"|")}`;case"too_big":{let i=o.inclusive?"<=":"<",a=e(o.origin);return a?`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${i}${o.maximum.toString()} ${a.unit??"\u500B\u5143\u7D20"}`:`\u6578\u503C\u904E\u5927\uFF1A\u9810\u671F ${o.origin??"\u503C"} \u61C9\u70BA ${i}${o.maximum.toString()}`}case"too_small":{let i=o.inclusive?">=":">",a=e(o.origin);return a?`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${i}${o.minimum.toString()} ${a.unit}`:`\u6578\u503C\u904E\u5C0F\uFF1A\u9810\u671F ${o.origin} \u61C9\u70BA ${i}${o.minimum.toString()}`}case"invalid_format":{let i=o;return i.format==="starts_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.prefix}" \u958B\u982D`:i.format==="ends_with"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u4EE5 "${i.suffix}" \u7D50\u5C3E`:i.format==="includes"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u5305\u542B "${i.includes}"`:i.format==="regex"?`\u7121\u6548\u7684\u5B57\u4E32\uFF1A\u5FC5\u9808\u7B26\u5408\u683C\u5F0F ${i.pattern}`:`\u7121\u6548\u7684 ${n[i.format]??o.format}`}case"not_multiple_of":return`\u7121\u6548\u7684\u6578\u5B57\uFF1A\u5FC5\u9808\u70BA ${o.divisor} \u7684\u500D\u6578`;case"unrecognized_keys":return`\u7121\u6CD5\u8B58\u5225\u7684\u9375\u503C${o.keys.length>1?"\u5011":""}\uFF1A${Le(o.keys,"\u3001")}`;case"invalid_key":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u9375\u503C`;case"invalid_union":return"\u7121\u6548\u7684\u8F38\u5165\u503C";case"invalid_element":return`${o.origin} \u4E2D\u6709\u7121\u6548\u7684\u503C`;default:return"\u7121\u6548\u7684\u8F38\u5165\u503C"}}}});var uQ={};Jn(uQ,{ar:()=>XOt,az:()=>QOt,be:()=>rTt,ca:()=>oTt,cs:()=>aTt,de:()=>uTt,en:()=>hme,eo:()=>cTt,es:()=>fTt,fa:()=>mTt,fi:()=>gTt,fr:()=>bTt,frCA:()=>vTt,he:()=>STt,hu:()=>xTt,id:()=>TTt,it:()=>PTt,ja:()=>RTt,kh:()=>ITt,ko:()=>jTt,mk:()=>$Tt,ms:()=>FTt,nl:()=>qTt,no:()=>UTt,ota:()=>HTt,pl:()=>WTt,ps:()=>JTt,pt:()=>ZTt,ru:()=>QTt,sl:()=>tEt,sv:()=>nEt,ta:()=>iEt,th:()=>sEt,tr:()=>lEt,ua:()=>dEt,ur:()=>pEt,vi:()=>hEt,zhCN:()=>yEt,zhTW:()=>_Et});var YUe=v(()=>{YOt();eTt();nTt();iTt();sTt();lTt();XUe();dTt();pTt();hTt();yTt();_Tt();wTt();CTt();OTt();ETt();MTt();ATt();NTt();DTt();LTt();kTt();BTt();zTt();VTt();KTt();GTt();XTt();eEt();rEt();oEt();aEt();uEt();cEt();fEt();mEt();gEt();bEt();vEt()});function gme(){return new f6}var QUe,eze,f6,vl,tze=v(()=>{QUe=Symbol("ZodOutput"),eze=Symbol("ZodInput"),f6=class{constructor(){this._map=new Map,this._idmap=new Map}add(e,...r){let n=r[0];if(this._map.set(e,n),n&&typeof n=="object"&&"id"in n){if(this._idmap.has(n.id))throw new Error(`ID ${n.id} already exists in the registry`);this._idmap.set(n.id,e)}return this}clear(){return this._map=new Map,this._idmap=new Map,this}remove(e){let r=this._map.get(e);return r&&typeof r=="object"&&"id"in r&&this._idmap.delete(r.id),this._map.delete(e),this}get(e){let r=e._zod.parent;if(r){let n={...this.get(r)??{}};return delete n.id,{...n,...this._map.get(e)}}return this._map.get(e)}has(e){return this._map.has(e)}};vl=gme()});function rze(t,e){return new t({type:"string",...ct(e)})}function nze(t,e){return new t({type:"string",coerce:!0,...ct(e)})}function yme(t,e){return new t({type:"string",format:"email",check:"string_format",abort:!1,...ct(e)})}function lQ(t,e){return new t({type:"string",format:"guid",check:"string_format",abort:!1,...ct(e)})}function bme(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,...ct(e)})}function _me(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v4",...ct(e)})}function vme(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v6",...ct(e)})}function wme(t,e){return new t({type:"string",format:"uuid",check:"string_format",abort:!1,version:"v7",...ct(e)})}function Sme(t,e){return new t({type:"string",format:"url",check:"string_format",abort:!1,...ct(e)})}function Cme(t,e){return new t({type:"string",format:"emoji",check:"string_format",abort:!1,...ct(e)})}function xme(t,e){return new t({type:"string",format:"nanoid",check:"string_format",abort:!1,...ct(e)})}function Ome(t,e){return new t({type:"string",format:"cuid",check:"string_format",abort:!1,...ct(e)})}function Tme(t,e){return new t({type:"string",format:"cuid2",check:"string_format",abort:!1,...ct(e)})}function Eme(t,e){return new t({type:"string",format:"ulid",check:"string_format",abort:!1,...ct(e)})}function Pme(t,e){return new t({type:"string",format:"xid",check:"string_format",abort:!1,...ct(e)})}function Mme(t,e){return new t({type:"string",format:"ksuid",check:"string_format",abort:!1,...ct(e)})}function Rme(t,e){return new t({type:"string",format:"ipv4",check:"string_format",abort:!1,...ct(e)})}function Ame(t,e){return new t({type:"string",format:"ipv6",check:"string_format",abort:!1,...ct(e)})}function Ime(t,e){return new t({type:"string",format:"cidrv4",check:"string_format",abort:!1,...ct(e)})}function Nme(t,e){return new t({type:"string",format:"cidrv6",check:"string_format",abort:!1,...ct(e)})}function jme(t,e){return new t({type:"string",format:"base64",check:"string_format",abort:!1,...ct(e)})}function Dme(t,e){return new t({type:"string",format:"base64url",check:"string_format",abort:!1,...ct(e)})}function $me(t,e){return new t({type:"string",format:"e164",check:"string_format",abort:!1,...ct(e)})}function Lme(t,e){return new t({type:"string",format:"jwt",check:"string_format",abort:!1,...ct(e)})}function ize(t,e){return new t({type:"string",format:"datetime",check:"string_format",offset:!1,local:!1,precision:null,...ct(e)})}function aze(t,e){return new t({type:"string",format:"date",check:"string_format",...ct(e)})}function sze(t,e){return new t({type:"string",format:"time",check:"string_format",precision:null,...ct(e)})}function uze(t,e){return new t({type:"string",format:"duration",check:"string_format",...ct(e)})}function lze(t,e){return new t({type:"number",checks:[],...ct(e)})}function cze(t,e){return new t({type:"number",coerce:!0,checks:[],...ct(e)})}function dze(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"safeint",...ct(e)})}function fze(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float32",...ct(e)})}function pze(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"float64",...ct(e)})}function mze(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"int32",...ct(e)})}function hze(t,e){return new t({type:"number",check:"number_format",abort:!1,format:"uint32",...ct(e)})}function gze(t,e){return new t({type:"boolean",...ct(e)})}function yze(t,e){return new t({type:"boolean",coerce:!0,...ct(e)})}function bze(t,e){return new t({type:"bigint",...ct(e)})}function _ze(t,e){return new t({type:"bigint",coerce:!0,...ct(e)})}function vze(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"int64",...ct(e)})}function wze(t,e){return new t({type:"bigint",check:"bigint_format",abort:!1,format:"uint64",...ct(e)})}function Sze(t,e){return new t({type:"symbol",...ct(e)})}function Cze(t,e){return new t({type:"undefined",...ct(e)})}function xze(t,e){return new t({type:"null",...ct(e)})}function Oze(t){return new t({type:"any"})}function Z$(t){return new t({type:"unknown"})}function cQ(t,e){return new t({type:"never",...ct(e)})}function Tze(t,e){return new t({type:"void",...ct(e)})}function Eze(t,e){return new t({type:"date",...ct(e)})}function Pze(t,e){return new t({type:"date",coerce:!0,...ct(e)})}function Mze(t,e){return new t({type:"nan",...ct(e)})}function cN(t,e){return new sme({check:"less_than",...ct(e),value:t,inclusive:!1})}function qw(t,e){return new sme({check:"less_than",...ct(e),value:t,inclusive:!0})}function dN(t,e){return new ume({check:"greater_than",...ct(e),value:t,inclusive:!1})}function e_(t,e){return new ume({check:"greater_than",...ct(e),value:t,inclusive:!0})}function Rze(t){return dN(0,t)}function Aze(t){return cN(0,t)}function Ize(t){return qw(0,t)}function Nze(t){return e_(0,t)}function dz(t,e){return new MBe({check:"multiple_of",...ct(e),value:t})}function p6(t,e){return new IBe({check:"max_size",...ct(e),maximum:t})}function fz(t,e){return new NBe({check:"min_size",...ct(e),minimum:t})}function dQ(t,e){return new jBe({check:"size_equals",...ct(e),size:t})}function m6(t,e){return new DBe({check:"max_length",...ct(e),maximum:t})}function X$(t,e){return new $Be({check:"min_length",...ct(e),minimum:t})}function h6(t,e){return new LBe({check:"length_equals",...ct(e),length:t})}function fQ(t,e){return new FBe({check:"string_format",format:"regex",...ct(e),pattern:t})}function pQ(t){return new kBe({check:"string_format",format:"lowercase",...ct(t)})}function mQ(t){return new qBe({check:"string_format",format:"uppercase",...ct(t)})}function hQ(t,e){return new BBe({check:"string_format",format:"includes",...ct(e),includes:t})}function gQ(t,e){return new UBe({check:"string_format",format:"starts_with",...ct(e),prefix:t})}function yQ(t,e){return new zBe({check:"string_format",format:"ends_with",...ct(e),suffix:t})}function jze(t,e,r){return new HBe({check:"property",property:t,schema:e,...ct(r)})}function bQ(t,e){return new VBe({check:"mime_type",mime:t,...ct(e)})}function fN(t){return new JBe({check:"overwrite",tx:t})}function _Q(t){return fN(e=>e.normalize(t))}function vQ(){return fN(t=>t.trim())}function wQ(){return fN(t=>t.toLowerCase())}function SQ(){return fN(t=>t.toUpperCase())}function CQ(t,e,r){return new t({type:"array",element:e,...ct(r)})}function jfn(t,e,r){return new t({type:"union",options:e,...ct(r)})}function Dfn(t,e,r,n){return new t({type:"union",options:r,discriminator:e,...ct(n)})}function $fn(t,e,r){return new t({type:"intersection",left:e,right:r})}function Dze(t,e,r,n){let o=r instanceof Yn,i=o?n:r,a=o?r:null;return new t({type:"tuple",items:e,rest:a,...ct(i)})}function Lfn(t,e,r,n){return new t({type:"record",keyType:e,valueType:r,...ct(n)})}function Ffn(t,e,r,n){return new t({type:"map",keyType:e,valueType:r,...ct(n)})}function kfn(t,e,r){return new t({type:"set",valueType:e,...ct(r)})}function qfn(t,e,r){let n=Array.isArray(e)?Object.fromEntries(e.map(o=>[o,o])):e;return new t({type:"enum",entries:n,...ct(r)})}function Bfn(t,e,r){return new t({type:"enum",entries:e,...ct(r)})}function Ufn(t,e,r){return new t({type:"literal",values:Array.isArray(e)?e:[e],...ct(r)})}function $ze(t,e){return new t({type:"file",...ct(e)})}function zfn(t,e){return new t({type:"transform",transform:e})}function Hfn(t,e){return new t({type:"optional",innerType:e})}function Vfn(t,e){return new t({type:"nullable",innerType:e})}function Jfn(t,e,r){return new t({type:"default",innerType:e,get defaultValue(){return typeof r=="function"?r():r}})}function Kfn(t,e,r){return new t({type:"nonoptional",innerType:e,...ct(r)})}function Wfn(t,e){return new t({type:"success",innerType:e})}function Gfn(t,e,r){return new t({type:"catch",innerType:e,catchValue:typeof r=="function"?r:()=>r})}function Zfn(t,e,r){return new t({type:"pipe",in:e,out:r})}function Xfn(t,e){return new t({type:"readonly",innerType:e})}function Yfn(t,e,r){return new t({type:"template_literal",parts:e,...ct(r)})}function Qfn(t,e){return new t({type:"lazy",getter:e})}function epn(t,e){return new t({type:"promise",innerType:e})}function Lze(t,e,r){let n=ct(r);return n.abort??(n.abort=!0),new t({type:"custom",check:"custom",fn:e,...n})}function Fze(t,e,r){return new t({type:"custom",check:"custom",fn:e,...ct(r)})}function kze(t,e){let r=ct(e),n=r.truthy??["true","1","yes","on","y","enabled"],o=r.falsy??["false","0","no","off","n","disabled"];r.case!=="sensitive"&&(n=n.map(m=>typeof m=="string"?m.toLowerCase():m),o=o.map(m=>typeof m=="string"?m.toLowerCase():m));let i=new Set(n),a=new Set(o),s=t.Pipe??aQ,u=t.Boolean??rQ,l=t.String??lz,c=t.Transform??iQ,d=new c({type:"transform",transform:(m,h)=>{let g=m;return r.case!=="sensitive"&&(g=g.toLowerCase()),i.has(g)?!0:a.has(g)?!1:(h.issues.push({code:"invalid_value",expected:"stringbool",values:[...i,...a],input:h.value,inst:d}),{})},error:r.error}),f=new s({type:"pipe",in:new l({type:"string",error:r.error}),out:d,error:r.error});return new s({type:"pipe",in:f,out:new u({type:"boolean",error:r.error}),error:r.error})}function qze(t,e,r,n={}){let o=ct(n),i={...ct(n),check:"string_format",type:"string",format:e,fn:typeof r=="function"?r:s=>r.test(s),...o};return r instanceof RegExp&&(i.pattern=r),new t(i)}var oze,Bze=v(()=>{lme();sQ();An();oze={Any:null,Minute:-1,Second:0,Millisecond:3,Microsecond:6}});function Uze(t){return new Fme({type:"function",input:Array.isArray(t?.input)?Dze(cz,t?.input):t?.input??CQ(oQ,Z$(G$)),output:t?.output??Z$(G$)})}var Fme,wEt=v(()=>{Bze();ome();sQ();sQ();Fme=class{constructor(e){this._def=e,this.def=e}implement(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=(...n)=>{let o=this._def.input?pO(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw new Error("Invalid arguments schema: not an array or tuple schema.");let i=e(...o);return this._def.output?pO(this._def.output,i,void 0,{callee:r}):i};return r}implementAsync(e){if(typeof e!="function")throw new Error("implement() must be called with a function");let r=async(...n)=>{let o=this._def.input?await az(this._def.input,n,void 0,{callee:r}):n;if(!Array.isArray(o))throw new Error("Invalid arguments schema: not an array or tuple schema.");let i=await e(...o);return this._def.output?az(this._def.output,i,void 0,{callee:r}):i};return r}input(...e){let r=this.constructor;return Array.isArray(e[0])?new r({type:"function",input:new cz({type:"tuple",items:e[0],rest:e[1]}),output:this._def.output}):new r({type:"function",input:e[0],output:this._def.output})}output(e){let r=this.constructor;return new r({type:"function",input:this._def.input,output:e})}}});function Y$(t,e){if(t instanceof f6){let n=new xQ(e),o={};for(let s of t._idmap.entries()){let[u,l]=s;n.process(l)}let i={},a={registry:t,uri:e?.uri,defs:o};for(let s of t._idmap.entries()){let[u,l]=s;i[u]=n.emit(l,{...e,external:a})}if(Object.keys(o).length>0){let s=n.target==="draft-2020-12"?"$defs":"definitions";i.__shared={[s]:o}}return{schemas:i}}let r=new xQ(e);return r.process(t),r.emit(t,e)}function ym(t,e){let r=e??{seen:new Set};if(r.seen.has(t))return!1;r.seen.add(t);let o=t._zod.def;switch(o.type){case"string":case"number":case"bigint":case"boolean":case"date":case"symbol":case"undefined":case"null":case"any":case"unknown":case"never":case"void":case"literal":case"enum":case"nan":case"file":case"template_literal":return!1;case"array":return ym(o.element,r);case"object":{for(let i in o.shape)if(ym(o.shape[i],r))return!0;return!1}case"union":{for(let i of o.options)if(ym(i,r))return!0;return!1}case"intersection":return ym(o.left,r)||ym(o.right,r);case"tuple":{for(let i of o.items)if(ym(i,r))return!0;return!!(o.rest&&ym(o.rest,r))}case"record":return ym(o.keyType,r)||ym(o.valueType,r);case"map":return ym(o.keyType,r)||ym(o.valueType,r);case"set":return ym(o.valueType,r);case"promise":case"optional":case"nonoptional":case"nullable":case"readonly":return ym(o.innerType,r);case"lazy":return ym(o.getter(),r);case"default":return ym(o.innerType,r);case"prefault":return ym(o.innerType,r);case"custom":return!1;case"transform":return!0;case"pipe":return ym(o.in,r)||ym(o.out,r);case"success":return!1;case"catch":return!1;default:}throw new Error(`Unknown schema type: ${o.type}`)}var xQ,SEt=v(()=>{tze();An();xQ=class{constructor(e){this.counter=0,this.metadataRegistry=e?.metadata??vl,this.target=e?.target??"draft-2020-12",this.unrepresentable=e?.unrepresentable??"throw",this.override=e?.override??(()=>{}),this.io=e?.io??"output",this.seen=new Map}process(e,r={path:[],schemaPath:[]}){var n;let o=e._zod.def,i={guid:"uuid",url:"uri",datetime:"date-time",json_string:"json-string",regex:""},a=this.seen.get(e);if(a)return a.count++,r.schemaPath.includes(e)&&(a.cycle=r.path),a.schema;let s={schema:{},count:1,cycle:void 0,path:r.path};this.seen.set(e,s);let u=e._zod.toJSONSchema?.();if(u)s.schema=u;else{let d={...r,schemaPath:[...r.schemaPath,e],path:r.path},f=e._zod.parent;if(f)s.ref=f,this.process(f,d),this.seen.get(f).isParent=!0;else{let p=s.schema;switch(o.type){case"string":{let m=p;m.type="string";let{minimum:h,maximum:g,format:y,patterns:b,contentEncoding:_}=e._zod.bag;if(typeof h=="number"&&(m.minLength=h),typeof g=="number"&&(m.maxLength=g),y&&(m.format=i[y]??y,m.format===""&&delete m.format),_&&(m.contentEncoding=_),b&&b.size>0){let w=[...b];w.length===1?m.pattern=w[0].source:w.length>1&&(s.schema.allOf=[...w.map(x=>({...this.target==="draft-7"?{type:"string"}:{},pattern:x.source}))])}break}case"number":{let m=p,{minimum:h,maximum:g,format:y,multipleOf:b,exclusiveMaximum:_,exclusiveMinimum:w}=e._zod.bag;typeof y=="string"&&y.includes("int")?m.type="integer":m.type="number",typeof w=="number"&&(m.exclusiveMinimum=w),typeof h=="number"&&(m.minimum=h,typeof w=="number"&&(w>=h?delete m.minimum:delete m.exclusiveMinimum)),typeof _=="number"&&(m.exclusiveMaximum=_),typeof g=="number"&&(m.maximum=g,typeof _=="number"&&(_<=g?delete m.maximum:delete m.exclusiveMaximum)),typeof b=="number"&&(m.multipleOf=b);break}case"boolean":{let m=p;m.type="boolean";break}case"bigint":{if(this.unrepresentable==="throw")throw new Error("BigInt cannot be represented in JSON Schema");break}case"symbol":{if(this.unrepresentable==="throw")throw new Error("Symbols cannot be represented in JSON Schema");break}case"null":{p.type="null";break}case"any":break;case"unknown":break;case"undefined":{if(this.unrepresentable==="throw")throw new Error("Undefined cannot be represented in JSON Schema");break}case"void":{if(this.unrepresentable==="throw")throw new Error("Void cannot be represented in JSON Schema");break}case"never":{p.not={};break}case"date":{if(this.unrepresentable==="throw")throw new Error("Date cannot be represented in JSON Schema");break}case"array":{let m=p,{minimum:h,maximum:g}=e._zod.bag;typeof h=="number"&&(m.minItems=h),typeof g=="number"&&(m.maxItems=g),m.type="array",m.items=this.process(o.element,{...d,path:[...d.path,"items"]});break}case"object":{let m=p;m.type="object",m.properties={};let h=o.shape;for(let b in h)m.properties[b]=this.process(h[b],{...d,path:[...d.path,"properties",b]});let g=new Set(Object.keys(h)),y=new Set([...g].filter(b=>{let _=o.shape[b]._zod;return this.io==="input"?_.optin===void 0:_.optout===void 0}));y.size>0&&(m.required=Array.from(y)),o.catchall?._zod.def.type==="never"?m.additionalProperties=!1:o.catchall?o.catchall&&(m.additionalProperties=this.process(o.catchall,{...d,path:[...d.path,"additionalProperties"]})):this.io==="output"&&(m.additionalProperties=!1);break}case"union":{let m=p;m.anyOf=o.options.map((h,g)=>this.process(h,{...d,path:[...d.path,"anyOf",g]}));break}case"intersection":{let m=p,h=this.process(o.left,{...d,path:[...d.path,"allOf",0]}),g=this.process(o.right,{...d,path:[...d.path,"allOf",1]}),y=_=>"allOf"in _&&Object.keys(_).length===1,b=[...y(h)?h.allOf:[h],...y(g)?g.allOf:[g]];m.allOf=b;break}case"tuple":{let m=p;m.type="array";let h=o.items.map((b,_)=>this.process(b,{...d,path:[...d.path,"prefixItems",_]}));if(this.target==="draft-2020-12"?m.prefixItems=h:m.items=h,o.rest){let b=this.process(o.rest,{...d,path:[...d.path,"items"]});this.target==="draft-2020-12"?m.items=b:m.additionalItems=b}o.rest&&(m.items=this.process(o.rest,{...d,path:[...d.path,"items"]}));let{minimum:g,maximum:y}=e._zod.bag;typeof g=="number"&&(m.minItems=g),typeof y=="number"&&(m.maxItems=y);break}case"record":{let m=p;m.type="object",m.propertyNames=this.process(o.keyType,{...d,path:[...d.path,"propertyNames"]}),m.additionalProperties=this.process(o.valueType,{...d,path:[...d.path,"additionalProperties"]});break}case"map":{if(this.unrepresentable==="throw")throw new Error("Map cannot be represented in JSON Schema");break}case"set":{if(this.unrepresentable==="throw")throw new Error("Set cannot be represented in JSON Schema");break}case"enum":{let m=p,h=JY(o.entries);h.every(g=>typeof g=="number")&&(m.type="number"),h.every(g=>typeof g=="string")&&(m.type="string"),m.enum=h;break}case"literal":{let m=p,h=[];for(let g of o.values)if(g===void 0){if(this.unrepresentable==="throw")throw new Error("Literal `undefined` cannot be represented in JSON Schema")}else if(typeof g=="bigint"){if(this.unrepresentable==="throw")throw new Error("BigInt literals cannot be represented in JSON Schema");h.push(Number(g))}else h.push(g);if(h.length!==0)if(h.length===1){let g=h[0];m.type=g===null?"null":typeof g,m.const=g}else h.every(g=>typeof g=="number")&&(m.type="number"),h.every(g=>typeof g=="string")&&(m.type="string"),h.every(g=>typeof g=="boolean")&&(m.type="string"),h.every(g=>g===null)&&(m.type="null"),m.enum=h;break}case"file":{let m=p,h={type:"string",format:"binary",contentEncoding:"binary"},{minimum:g,maximum:y,mime:b}=e._zod.bag;g!==void 0&&(h.minLength=g),y!==void 0&&(h.maxLength=y),b?b.length===1?(h.contentMediaType=b[0],Object.assign(m,h)):m.anyOf=b.map(_=>({...h,contentMediaType:_})):Object.assign(m,h);break}case"transform":{if(this.unrepresentable==="throw")throw new Error("Transforms cannot be represented in JSON Schema");break}case"nullable":{let m=this.process(o.innerType,d);p.anyOf=[m,{type:"null"}];break}case"nonoptional":{this.process(o.innerType,d),s.ref=o.innerType;break}case"success":{let m=p;m.type="boolean";break}case"default":{this.process(o.innerType,d),s.ref=o.innerType,p.default=JSON.parse(JSON.stringify(o.defaultValue));break}case"prefault":{this.process(o.innerType,d),s.ref=o.innerType,this.io==="input"&&(p._prefault=JSON.parse(JSON.stringify(o.defaultValue)));break}case"catch":{this.process(o.innerType,d),s.ref=o.innerType;let m;try{m=o.catchValue(void 0)}catch{throw new Error("Dynamic catch values are not supported in JSON Schema")}p.default=m;break}case"nan":{if(this.unrepresentable==="throw")throw new Error("NaN cannot be represented in JSON Schema");break}case"template_literal":{let m=p,h=e._zod.pattern;if(!h)throw new Error("Pattern not found in template literal");m.type="string",m.pattern=h.source;break}case"pipe":{let m=this.io==="input"?o.in._zod.def.type==="transform"?o.out:o.in:o.out;this.process(m,d),s.ref=m;break}case"readonly":{this.process(o.innerType,d),s.ref=o.innerType,p.readOnly=!0;break}case"promise":{this.process(o.innerType,d),s.ref=o.innerType;break}case"optional":{this.process(o.innerType,d),s.ref=o.innerType;break}case"lazy":{let m=e._zod.innerType;this.process(m,d),s.ref=m;break}case"custom":{if(this.unrepresentable==="throw")throw new Error("Custom types cannot be represented in JSON Schema");break}default:}}}let l=this.metadataRegistry.get(e);return l&&Object.assign(s.schema,l),this.io==="input"&&ym(e)&&(delete s.schema.examples,delete s.schema.default),this.io==="input"&&s.schema._prefault&&((n=s.schema).default??(n.default=s.schema._prefault)),delete s.schema._prefault,this.seen.get(e).schema}emit(e,r){let n={cycles:r?.cycles??"ref",reused:r?.reused??"inline",external:r?.external??void 0},o=this.seen.get(e);if(!o)throw new Error("Unprocessed schema. This is a bug in Zod.");let i=c=>{let d=this.target==="draft-2020-12"?"$defs":"definitions";if(n.external){let h=n.external.registry.get(c[0])?.id,g=n.external.uri??(b=>b);if(h)return{ref:g(h)};let y=c[1].defId??c[1].schema.id??`schema${this.counter++}`;return c[1].defId=y,{defId:y,ref:`${g("__shared")}#/${d}/${y}`}}if(c[1]===o)return{ref:"#"};let p=`#/${d}/`,m=c[1].schema.id??`__schema${this.counter++}`;return{defId:m,ref:p+m}},a=c=>{if(c[1].schema.$ref)return;let d=c[1],{ref:f,defId:p}=i(c);d.def={...d.schema},p&&(d.defId=p);let m=d.schema;for(let h in m)delete m[h];m.$ref=f};if(n.cycles==="throw")for(let c of this.seen.entries()){let d=c[1];if(d.cycle)throw new Error(`Cycle detected: #/${d.cycle?.join("/")}/ + +Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let c of this.seen.entries()){let d=c[1];if(e===c[0]){a(c);continue}if(n.external){let p=n.external.registry.get(c[0])?.id;if(e!==c[0]&&p){a(c);continue}}if(this.metadataRegistry.get(c[0])?.id){a(c);continue}if(d.cycle){a(c);continue}if(d.count>1&&n.reused==="ref"){a(c);continue}}let s=(c,d)=>{let f=this.seen.get(c),p=f.def??f.schema,m={...p};if(f.ref===null)return;let h=f.ref;if(f.ref=null,h){s(h,d);let g=this.seen.get(h).schema;g.$ref&&d.target==="draft-7"?(p.allOf=p.allOf??[],p.allOf.push(g)):(Object.assign(p,g),Object.assign(p,m))}f.isParent||this.override({zodSchema:c,jsonSchema:p,path:f.path??[]})};for(let c of[...this.seen.entries()].reverse())s(c[0],{target:this.target});let u={};if(this.target==="draft-2020-12"?u.$schema="https://json-schema.org/draft/2020-12/schema":this.target==="draft-7"?u.$schema="http://json-schema.org/draft-07/schema#":console.warn(`Invalid target: ${this.target}`),n.external?.uri){let c=n.external.registry.get(e)?.id;if(!c)throw new Error("Schema is missing an `id` property");u.$id=n.external.uri(c)}Object.assign(u,o.def);let l=n.external?.defs??{};for(let c of this.seen.entries()){let d=c[1];d.def&&d.defId&&(l[d.defId]=d.def)}n.external||Object.keys(l).length>0&&(this.target==="draft-2020-12"?u.$defs=l:u.definitions=l);try{return JSON.parse(JSON.stringify(u))}catch{throw new Error("Error converting schema to JSON.")}}}});var CEt={};var xEt=v(()=>{});var pN={};Jn(pN,{$ZodAny:()=>EUe,$ZodArray:()=>oQ,$ZodAsyncError:()=>fO,$ZodBase64:()=>yUe,$ZodBase64URL:()=>bUe,$ZodBigInt:()=>pme,$ZodBigIntFormat:()=>CUe,$ZodBoolean:()=>rQ,$ZodCIDRv4:()=>mUe,$ZodCIDRv6:()=>hUe,$ZodCUID:()=>nUe,$ZodCUID2:()=>oUe,$ZodCatch:()=>HUe,$ZodCheck:()=>Zl,$ZodCheckBigIntFormat:()=>ABe,$ZodCheckEndsWith:()=>zBe,$ZodCheckGreaterThan:()=>ume,$ZodCheckIncludes:()=>BBe,$ZodCheckLengthEquals:()=>LBe,$ZodCheckLessThan:()=>sme,$ZodCheckLowerCase:()=>kBe,$ZodCheckMaxLength:()=>DBe,$ZodCheckMaxSize:()=>IBe,$ZodCheckMimeType:()=>VBe,$ZodCheckMinLength:()=>$Be,$ZodCheckMinSize:()=>NBe,$ZodCheckMultipleOf:()=>MBe,$ZodCheckNumberFormat:()=>RBe,$ZodCheckOverwrite:()=>JBe,$ZodCheckProperty:()=>HBe,$ZodCheckRegex:()=>FBe,$ZodCheckSizeEquals:()=>jBe,$ZodCheckStartsWith:()=>UBe,$ZodCheckStringFormat:()=>c6,$ZodCheckUpperCase:()=>qBe,$ZodCustom:()=>ZUe,$ZodCustomStringFormat:()=>wUe,$ZodDate:()=>MUe,$ZodDefault:()=>qUe,$ZodDiscriminatedUnion:()=>AUe,$ZodE164:()=>_Ue,$ZodEmail:()=>QBe,$ZodEmoji:()=>tUe,$ZodEnum:()=>$Ue,$ZodError:()=>YY,$ZodFile:()=>FUe,$ZodFunction:()=>Fme,$ZodGUID:()=>XBe,$ZodIPv4:()=>fUe,$ZodIPv6:()=>pUe,$ZodISODate:()=>lUe,$ZodISODateTime:()=>uUe,$ZodISODuration:()=>dUe,$ZodISOTime:()=>cUe,$ZodIntersection:()=>IUe,$ZodJWT:()=>vUe,$ZodKSUID:()=>sUe,$ZodLazy:()=>GUe,$ZodLiteral:()=>LUe,$ZodMap:()=>jUe,$ZodNaN:()=>VUe,$ZodNanoID:()=>rUe,$ZodNever:()=>nQ,$ZodNonOptional:()=>UUe,$ZodNull:()=>TUe,$ZodNullable:()=>kUe,$ZodNumber:()=>fme,$ZodNumberFormat:()=>SUe,$ZodObject:()=>RUe,$ZodOptional:()=>d6,$ZodPipe:()=>aQ,$ZodPrefault:()=>BUe,$ZodPromise:()=>WUe,$ZodReadonly:()=>JUe,$ZodRealError:()=>l6,$ZodRecord:()=>NUe,$ZodRegistry:()=>f6,$ZodSet:()=>DUe,$ZodString:()=>lz,$ZodStringFormat:()=>vu,$ZodSuccess:()=>zUe,$ZodSymbol:()=>xUe,$ZodTemplateLiteral:()=>KUe,$ZodTransform:()=>iQ,$ZodTuple:()=>cz,$ZodType:()=>Yn,$ZodULID:()=>iUe,$ZodURL:()=>eUe,$ZodUUID:()=>YBe,$ZodUndefined:()=>OUe,$ZodUnion:()=>mme,$ZodUnknown:()=>G$,$ZodVoid:()=>PUe,$ZodXID:()=>aUe,$brand:()=>Lqe,$constructor:()=>ve,$input:()=>eze,$output:()=>QUe,Doc:()=>tQ,JSONSchema:()=>CEt,JSONSchemaGenerator:()=>xQ,NEVER:()=>$qe,TimePrecision:()=>oze,_any:()=>Oze,_array:()=>CQ,_base64:()=>jme,_base64url:()=>Dme,_bigint:()=>bze,_boolean:()=>gze,_catch:()=>Gfn,_cidrv4:()=>Ime,_cidrv6:()=>Nme,_coercedBigint:()=>_ze,_coercedBoolean:()=>yze,_coercedDate:()=>Pze,_coercedNumber:()=>cze,_coercedString:()=>nze,_cuid:()=>Ome,_cuid2:()=>Tme,_custom:()=>Lze,_date:()=>Eze,_default:()=>Jfn,_discriminatedUnion:()=>Dfn,_e164:()=>$me,_email:()=>yme,_emoji:()=>Cme,_endsWith:()=>yQ,_enum:()=>qfn,_file:()=>$ze,_float32:()=>fze,_float64:()=>pze,_gt:()=>dN,_gte:()=>e_,_guid:()=>lQ,_includes:()=>hQ,_int:()=>dze,_int32:()=>mze,_int64:()=>vze,_intersection:()=>$fn,_ipv4:()=>Rme,_ipv6:()=>Ame,_isoDate:()=>aze,_isoDateTime:()=>ize,_isoDuration:()=>uze,_isoTime:()=>sze,_jwt:()=>Lme,_ksuid:()=>Mme,_lazy:()=>Qfn,_length:()=>h6,_literal:()=>Ufn,_lowercase:()=>pQ,_lt:()=>cN,_lte:()=>qw,_map:()=>Ffn,_max:()=>qw,_maxLength:()=>m6,_maxSize:()=>p6,_mime:()=>bQ,_min:()=>e_,_minLength:()=>X$,_minSize:()=>fz,_multipleOf:()=>dz,_nan:()=>Mze,_nanoid:()=>xme,_nativeEnum:()=>Bfn,_negative:()=>Aze,_never:()=>cQ,_nonnegative:()=>Nze,_nonoptional:()=>Kfn,_nonpositive:()=>Ize,_normalize:()=>_Q,_null:()=>xze,_nullable:()=>Vfn,_number:()=>lze,_optional:()=>Hfn,_overwrite:()=>fN,_parse:()=>eme,_parseAsync:()=>tme,_pipe:()=>Zfn,_positive:()=>Rze,_promise:()=>epn,_property:()=>jze,_readonly:()=>Xfn,_record:()=>Lfn,_refine:()=>Fze,_regex:()=>fQ,_safeParse:()=>rme,_safeParseAsync:()=>nme,_set:()=>kfn,_size:()=>dQ,_startsWith:()=>gQ,_string:()=>rze,_stringFormat:()=>qze,_stringbool:()=>kze,_success:()=>Wfn,_symbol:()=>Sze,_templateLiteral:()=>Yfn,_toLowerCase:()=>wQ,_toUpperCase:()=>SQ,_transform:()=>zfn,_trim:()=>vQ,_tuple:()=>Dze,_uint32:()=>hze,_uint64:()=>wze,_ulid:()=>Eme,_undefined:()=>Cze,_union:()=>jfn,_unknown:()=>Z$,_uppercase:()=>mQ,_url:()=>Sme,_uuid:()=>bme,_uuidv4:()=>_me,_uuidv6:()=>vme,_uuidv7:()=>wme,_void:()=>Tze,_xid:()=>Pme,clone:()=>zc,config:()=>cd,flattenError:()=>QY,formatError:()=>eQ,function:()=>Uze,globalConfig:()=>HY,globalRegistry:()=>vl,isValidBase64:()=>gUe,isValidBase64URL:()=>WOt,isValidJWT:()=>GOt,locales:()=>uQ,parse:()=>pO,parseAsync:()=>az,prettifyError:()=>Zqe,regexes:()=>uz,registry:()=>gme,safeParse:()=>Yqe,safeParseAsync:()=>Qqe,toDotPath:()=>ROt,toJSONSchema:()=>Y$,treeifyError:()=>Gqe,util:()=>xt,version:()=>WBe});var ey=v(()=>{a6();ome();Xqe();sQ();lme();GBe();An();ame();YUe();tze();KBe();wEt();Bze();SEt();xEt()});function el(t){if(typeof t!="object"||t===null)return!1;let e=t;if(!("_zod"in e))return!1;let r=e._zod;return typeof r=="object"&&r!==null&&"def"in r}function Xl(t){if(typeof t!="object"||t===null)return!1;let e=t;if(!("_def"in e)||"_zod"in e)return!1;let r=e._def;return typeof r=="object"&&r!=null&&"typeName"in r}function OEt(t){return el(t)&&console.warn("[WARNING] Attempting to use Zod 4 schema in a context where Zod 3 schema is expected. This may cause unexpected behavior."),Xl(t)}function Ga(t){return!t||typeof t!="object"||Array.isArray(t)?!1:!!(el(t)||Xl(t))}function zze(t){return typeof t=="object"&&t!==null&&"_def"in t&&typeof t._def=="object"&&t._def!==null&&"typeName"in t._def&&t._def.typeName==="ZodLiteral"}function Hze(t){return el(t)?typeof t=="object"&&t!==null&&"_zod"in t&&typeof t._zod=="object"&&t._zod!==null&&"def"in t._zod&&typeof t._zod.def=="object"&&t._zod.def!==null&&"type"in t._zod.def&&t._zod.def.type==="literal":!1}function TEt(t){return!!(zze(t)||Hze(t))}async function eL(t,e){if(el(t))try{return{success:!0,data:await az(t,e)}}catch(r){return{success:!1,error:r}}if(Xl(t))return await t.safeParseAsync(e);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}async function tL(t,e){if(el(t))return await az(t,e);if(Xl(t))return await t.parseAsync(e);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function EEt(t,e){if(el(t))try{return{success:!0,data:pO(t,e)}}catch(r){return{success:!1,error:r}}if(Xl(t))return t.safeParse(e);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function PEt(t,e){if(el(t))return pO(t,e);if(Xl(t))return t.parse(e);throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function rL(t){if(el(t))return vl.get(t)?.description;if(Xl(t)||"description"in t&&typeof t.description=="string")return t.description}function MEt(t){if(!Ga(t))return!1;if(Xl(t)){let e=t._def;if(e.typeName==="ZodObject"){let r=t;return!r.shape||Object.keys(r.shape).length===0}if(e.typeName==="ZodRecord")return!0}if(el(t)){let e=t._zod.def;if(e.type==="object"){let r=t;return!r.shape||Object.keys(r.shape).length===0}if(e.type==="record")return!0}return typeof t=="object"&&t!==null&&!("shape"in t)}function y6(t){return Ga(t)?Xl(t)?t._def.typeName==="ZodString":el(t)?t._zod.def.type==="string":!1:!1}function Bme(t){return typeof t=="object"&&t!==null&&"_def"in t&&typeof t._def=="object"&&t._def!==null&&"typeName"in t._def&&t._def.typeName==="ZodObject"}function Bw(t){return el(t)?typeof t=="object"&&t!==null&&"_zod"in t&&typeof t._zod=="object"&&t._zod!==null&&"def"in t._zod&&typeof t._zod.def=="object"&&t._zod.def!==null&&"type"in t._zod.def&&t._zod.def.type==="object":!1}function OQ(t){return el(t)?typeof t=="object"&&t!==null&&"_zod"in t&&typeof t._zod=="object"&&t._zod!==null&&"def"in t._zod&&typeof t._zod.def=="object"&&t._zod.def!==null&&"type"in t._zod.def&&t._zod.def.type==="array":!1}function REt(t){return!!(Bme(t)||Bw(t))}function kme(t){if(Xl(t))return t.shape;if(el(t))return t._zod.def.shape;throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function AEt(t,e){if(Xl(t))return t.extend(e);if(el(t))return xt.extend(t,e);throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function IEt(t){if(Xl(t))return t.partial();if(el(t))return xt.partial(d6,t,void 0);throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function g6(t,e=!1){if(Xl(t))return t.strict();if(Bw(t)){let r=t._zod.def.shape;if(e)for(let[i,a]of Object.entries(t._zod.def.shape)){if(Bw(a)){let u=g6(a,e);r[i]=u}else if(OQ(a)){let u=a._zod.def.element;Bw(u)&&(u=g6(u,e)),r[i]=zc(a,{...a._zod.def,element:u})}else r[i]=a;let s=vl.get(a);s&&vl.add(r[i],s)}let n=zc(t,{...t._zod.def,shape:r,catchall:cQ(nQ)}),o=vl.get(t);return o&&vl.add(n,o),n}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function qme(t,e=!1){if(Bme(t))return t.passthrough();if(Bw(t)){let r=t._zod.def.shape;if(e)for(let[i,a]of Object.entries(t._zod.def.shape)){if(Bw(a)){let u=qme(a,e);r[i]=u}else if(OQ(a)){let u=a._zod.def.element;Bw(u)&&(u=qme(u,e)),r[i]=zc(a,{...a._zod.def,element:u})}else r[i]=a;let s=vl.get(a);s&&vl.add(r[i],s)}let n=zc(t,{...t._zod.def,shape:r,catchall:Z$(G$)}),o=vl.get(t);return o&&vl.add(n,o),n}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}function NEt(t){if(Xl(t))try{let e=t.parse(void 0);return()=>e}catch{return}if(el(t))try{let e=pO(t,void 0);return()=>e}catch{return}}function tpn(t){return Xl(t)&&"typeName"in t._def&&t._def.typeName==="ZodEffects"}function rpn(t){return el(t)&&t._zod.def.type==="pipe"}function Q$(t,e=!1){if(Xl(t))return tpn(t)?Q$(t._def.schema,e):t;if(el(t)){let r=t;if(rpn(t)&&(r=Q$(t._zod.def.in,e)),e){if(Bw(r)){let o=r._zod.def.shape;for(let[i,a]of Object.entries(r._zod.def.shape))o[i]=Q$(a,e);r=zc(r,{...r._zod.def,shape:o})}else if(OQ(r)){let o=Q$(r._zod.def.element,e);r=zc(r,{...r._zod.def,element:o})}}let n=vl.get(t);return n&&vl.add(r,n),r}throw new Error("Schema must be an instance of z3.ZodType or z4.$ZodType")}function jEt(t,e){if(Xl(t)){let r=kme(t),n={};for(let[o,i]of Object.entries(r))e(o,i)?n[o]=i.optional():n[o]=i;return t.extend(n)}if(el(t)){let r=kme(t),n={...t._zod.def.shape};for(let[a,s]of Object.entries(r))e(a,s)&&(n[a]=new d6({type:"optional",innerType:s}));let o=zc(t,{...t._zod.def,shape:n}),i=vl.get(t);return i&&vl.add(o,i),o}throw new Error("Schema must be an instance of z3.ZodObject or z4.$ZodObject")}var mN=v(()=>{ey()});function Vze(t){return t.replace(/[^a-zA-Z-_0-9]/g,"_")}function opn(t){let e="";for(let[r,n]of Object.entries(t))e+=` classDef ${r} ${n}; +`;return e}function DEt(t,e,r){let{firstNode:n,lastNode:o,nodeColors:i,withStyles:a=!0,curveStyle:s="linear",wrapLabelNWords:u=9}=r??{},l=a?`%%{init: {'flowchart': {'curve': '${s}'}}}%% +graph TD; +`:`graph TD; +`;if(a){let p="default",m={[p]:"{0}({1})"};n!==void 0&&(m[n]="{0}([{1}]):::first"),o!==void 0&&(m[o]="{0}([{1}]):::last");for(let[h,g]of Object.entries(t)){let y=g.name.split(":").pop()??"",_=npn.some(x=>y.startsWith(x)&&y.endsWith(x))?`

${y}

`:y;Object.keys(g.metadata??{}).length&&(_+=`
${Object.entries(g.metadata??{}).map(([x,O])=>`${x} = ${O}`).join(` +`)}`);let w=(m[h]??m[p]).replace("{0}",Vze(h)).replace("{1}",_);l+=` ${w} +`}}let c={};for(let p of e){let m=p.source.split(":"),h=p.target.split(":"),g=m.filter((y,b)=>y===h[b]).join(":");c[g]||(c[g]=[]),c[g].push(p)}let d=new Set;function f(p,m){let h=p.length===1&&p[0].source===p[0].target;if(m&&!h){let g=m.split(":").pop();if(d.has(g))throw new Error(`Found duplicate subgraph '${g}' -- this likely means that you're reusing a subgraph node with the same name. Please adjust your graph to have subgraph nodes with unique names.`);d.add(g),l+=` subgraph ${g} +`}for(let g of p){let{source:y,target:b,data:_,conditional:w}=g,x="";if(_!==void 0){let O=_,E=O.split(" ");E.length>u&&(O=Array.from({length:Math.ceil(E.length/u)},(T,R)=>E.slice(R*u,(R+1)*u).join(" ")).join(" 
 ")),x=w?` -.  ${O}  .-> `:` --  ${O}  --> `}else x=w?" -.-> ":" --> ";l+=` ${Vze(y)}${x}${Vze(b)}; +`}for(let g in c)g.startsWith(`${m}:`)&&g!==m&&f(c[g],g);m&&!h&&(l+=` end +`)}f(c[""]??[],"");for(let p in c)!p.includes(":")&&p!==""&&f(c[p],p);return a&&(l+=opn(i??{})),l}async function $Et(t,e){let r=e?.backgroundColor??"white",n=e?.imageType??"png",o=btoa(t);r!==void 0&&(/^#(?:[0-9a-fA-F]{3}){1,2}$/.test(r)||(r=`!${r}`));let i=`https://mermaid.ink/img/${o}?bgColor=${r}&type=${n}`,a=await fetch(i);if(!a.ok)throw new Error(["Failed to render the graph using the Mermaid.INK API.",`Status code: ${a.status}`,`Status text: ${a.statusText}`].join(` +`));return await a.blob()}var npn,LEt=v(()=>{npn=["*","_","`"]});var kEt,FEt,qEt,Ume=v(()=>{kEt=Symbol("Let zodToJsonSchema decide on which parser to use"),FEt={name:void 0,$refStrategy:"root",basePath:["#"],effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",removeAdditionalStrategy:"passthrough",allowedAdditionalProperties:!0,rejectedAdditionalProperties:!1,definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,definitions:{},errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref",openAiAnyTypeName:"OpenAiAnyType"},qEt=t=>typeof t=="string"?{...FEt,name:t}:{...FEt,...t}});var BEt,Jze=v(()=>{Ume();BEt=t=>{let e=qEt(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,flags:{hasReferencedOpenAiAnyType:!1},currentPath:r,propertyPath:void 0,seen:new Map(Object.entries(e.definitions).map(([n,o])=>[o._def,{def:o._def,path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}}});var zme,Hme=v(()=>{zme=(t,e)=>{let r=0;for(;r{Hme()});function Kze(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function $i(t,e,r,n,o){t[e]=r,Kze(t,e,n,o)}var nL=v(()=>{});var vi,Wze,rr,mO,TQ=v(()=>{(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function r(o){throw new Error}t.assertNever=r,t.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},t.getValidEnumValues=o=>{let i=t.objectKeys(o).filter(s=>typeof o[o[s]]!="number"),a={};for(let s of i)a[s]=o[s];return t.objectValues(a)},t.objectValues=o=>t.objectKeys(o).map(function(i){return o[i]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},t.find=(o,i)=>{for(let a of o)if(i(a))return a},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function n(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}t.joinValues=n,t.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(vi||(vi={}));(function(t){t.mergeShapes=(e,r)=>({...e,...r})})(Wze||(Wze={}));rr=vi.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),mO=t=>{switch(typeof t){case"undefined":return rr.undefined;case"string":return rr.string;case"number":return Number.isNaN(t)?rr.nan:rr.number;case"boolean":return rr.boolean;case"function":return rr.function;case"bigint":return rr.bigint;case"symbol":return rr.symbol;case"object":return Array.isArray(t)?rr.array:t===null?rr.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?rr.promise:typeof Map<"u"&&t instanceof Map?rr.map:typeof Set<"u"&&t instanceof Set?rr.set:typeof Date<"u"&&t instanceof Date?rr.date:rr.object;default:return rr.unknown}}});var Xe,ipn,t_,Vme=v(()=>{TQ();Xe=vi.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"]),ipn=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),t_=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(i){return i.message},n={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)n._errors.push(r(a));else{let s=n,u=0;for(;ur.message){let r={},n=[];for(let o of this.issues)if(o.path.length>0){let i=o.path[0];r[i]=r[i]||[],r[i].push(e(o))}else n.push(e(o));return{formErrors:n,fieldErrors:r}}get formErrors(){return this.flatten()}};t_.create=t=>new t_(t)});var apn,hN,Gze=v(()=>{Vme();TQ();apn=(t,e)=>{let r;switch(t.code){case Xe.invalid_type:t.received===rr.undefined?r="Required":r=`Expected ${t.expected}, received ${t.received}`;break;case Xe.invalid_literal:r=`Invalid literal value, expected ${JSON.stringify(t.expected,vi.jsonStringifyReplacer)}`;break;case Xe.unrecognized_keys:r=`Unrecognized key(s) in object: ${vi.joinValues(t.keys,", ")}`;break;case Xe.invalid_union:r="Invalid input";break;case Xe.invalid_union_discriminator:r=`Invalid discriminator value. Expected ${vi.joinValues(t.options)}`;break;case Xe.invalid_enum_value:r=`Invalid enum value. Expected ${vi.joinValues(t.options)}, received '${t.received}'`;break;case Xe.invalid_arguments:r="Invalid function arguments";break;case Xe.invalid_return_type:r="Invalid function return type";break;case Xe.invalid_date:r="Invalid date";break;case Xe.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}"`:vi.assertNever(t.validation):t.validation!=="regex"?r=`Invalid ${t.validation}`:r="Invalid";break;case Xe.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 Xe.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 Xe.custom:r="Invalid input";break;case Xe.invalid_intersection_types:r="Intersection results could not be merged";break;case Xe.not_multiple_of:r=`Number must be a multiple of ${t.multipleOf}`;break;case Xe.not_finite:r="Number must be finite";break;default:r=e.defaultError,vi.assertNever(t)}return{message:r}},hN=apn});function spn(t){UEt=t}function b6(){return UEt}var UEt,Jme=v(()=>{Gze();UEt=hN});function qt(t,e){let r=b6(),n=EQ({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,r,r===hN?void 0:hN].filter(o=>!!o)});t.common.issues.push(n)}var EQ,upn,Xh,fn,pz,ty,Kme,Wme,oL,_6,Zze=v(()=>{Jme();Gze();EQ=t=>{let{data:e,path:r,errorMaps:n,issueData:o}=t,i=[...r,...o.path||[]],a={...o,path:i};if(o.message!==void 0)return{...o,path:i,message:o.message};let s="",u=n.filter(l=>!!l).slice().reverse();for(let l of u)s=l(a,{data:e,defaultError:s}).message;return{...o,path:i,message:s}},upn=[];Xh=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 o of r){if(o.status==="aborted")return fn;o.status==="dirty"&&e.dirty(),n.push(o.value)}return{status:e.value,value:n}}static async mergeObjectAsync(e,r){let n=[];for(let o of r){let i=await o.key,a=await o.value;n.push({key:i,value:a})}return t.mergeObjectSync(e,n)}static mergeObjectSync(e,r){let n={};for(let o of r){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return fn;i.status==="dirty"&&e.dirty(),a.status==="dirty"&&e.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(n[i.value]=a.value)}return{status:e.value,value:n}}},fn=Object.freeze({status:"aborted"}),pz=t=>({status:"dirty",value:t}),ty=t=>({status:"valid",value:t}),Kme=t=>t.status==="aborted",Wme=t=>t.status==="dirty",oL=t=>t.status==="valid",_6=t=>typeof Promise<"u"&&t instanceof Promise});var zEt=v(()=>{});var Pr,HEt=v(()=>{(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(Pr||(Pr={}))});function $o(t){if(!t)return{};let{errorMap:e,invalid_type_error:r,required_error:n,description:o}=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:o}:{errorMap:(a,s)=>{let{message:u}=t;return a.code==="invalid_enum_value"?{message:u??s.defaultError}:typeof s.data>"u"?{message:u??n??s.defaultError}:a.code!=="invalid_type"?{message:s.defaultError}:{message:u??r??s.defaultError}},description:o}}function WEt(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 Opn(t){return new RegExp(`^${WEt(t)}$`)}function GEt(t){let e=`${KEt}T${WEt(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 Tpn(t,e){return!!((e==="v4"||!e)&&bpn.test(t)||(e==="v6"||!e)&&vpn.test(t))}function Epn(t,e){if(!mpn.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,"="),o=JSON.parse(atob(n));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function Ppn(t,e){return!!((e==="v4"||!e)&&_pn.test(t)||(e==="v6"||!e)&&wpn.test(t))}function Mpn(t,e){let r=(t.toString().split(".")[1]||"").length,n=(e.toString().split(".")[1]||"").length,o=r>n?r:n,i=Number.parseInt(t.toFixed(o).replace(".","")),a=Number.parseInt(e.toFixed(o).replace(".",""));return i%a/10**o}function v6(t){if(t instanceof r_){let e={};for(let r in t.shape){let n=t.shape[r];e[r]=zw.create(v6(n))}return new r_({...t._def,shape:()=>e})}else return t instanceof bN?new bN({...t._def,type:v6(t.element)}):t instanceof zw?zw.create(v6(t.unwrap())):t instanceof gO?gO.create(v6(t.unwrap())):t instanceof hO?hO.create(t.items.map(e=>v6(e))):t}function Yze(t,e){let r=mO(t),n=mO(e);if(t===e)return{valid:!0,data:t};if(r===rr.object&&n===rr.object){let o=vi.objectKeys(e),i=vi.objectKeys(t).filter(s=>o.indexOf(s)!==-1),a={...t,...e};for(let s of i){let u=Yze(t[s],e[s]);if(!u.valid)return{valid:!1};a[s]=u.data}return{valid:!0,data:a}}else if(r===rr.array&&n===rr.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let i=0;i{let i=t(n);if(i instanceof Promise)return i.then(a=>{if(!a){let s=JEt(e,n),u=s.fatal??r??!0;o.addIssue({code:"custom",...s,fatal:u})}});if(!i){let a=JEt(e,n),s=a.fatal??r??!0;o.addIssue({code:"custom",...a,fatal:s})}}):aL.create()}var Hw,VEt,Qo,lpn,cpn,dpn,fpn,ppn,mpn,hpn,gpn,ypn,Xze,bpn,_pn,vpn,wpn,Spn,Cpn,KEt,xpn,iL,mz,hz,gz,yz,w6,bz,_z,aL,yN,J0,S6,bN,r_,vz,gN,Gme,wz,hO,Zme,C6,x6,Xme,Sz,Cz,xz,Oz,sL,Vw,zw,gO,Tz,Ez,O6,Rpn,PQ,MQ,Pz,Apn,Me,Ipn,YEt,QEt,Npn,jpn,ePt,Dpn,$pn,Lpn,Fpn,kpn,qpn,Bpn,Upn,zpn,Hpn,Vpn,Jpn,Kpn,Wpn,Gpn,Zpn,Xpn,Ypn,Qpn,emn,tmn,rmn,nmn,omn,imn,amn,smn,umn,lmn,cmn,dmn,fmn,pmn,mmn,tPt=v(()=>{Vme();Jme();HEt();Zze();TQ();Hw=class{constructor(e,r,n,o){this._cachedPath=[],this.parent=e,this.data=r,this._path=n,this._key=o}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}},VEt=(t,e)=>{if(oL(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 t_(t.common.issues);return this._error=r,this._error}}};Qo=class{get description(){return this._def.description}_getType(e){return mO(e.data)}_getOrReturnCtx(e,r){return r||{common:e.parent.common,data:e.data,parsedType:mO(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new Xh,ctx:{common:e.parent.common,data:e.data,parsedType:mO(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let r=this._parse(e);if(_6(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:mO(e)},o=this._parseSync({data:e,path:n.path,parent:n});return VEt(n,o)}"~validate"(e){let r={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:mO(e)};if(!this["~standard"].async)try{let n=this._parseSync({data:e,path:[],parent:r});return oL(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=>oL(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:mO(e)},o=this._parse({data:e,path:n.path,parent:n}),i=await(_6(o)?o:Promise.resolve(o));return VEt(n,i)}refine(e,r){let n=o=>typeof r=="string"||typeof r>"u"?{message:r}:typeof r=="function"?r(o):r;return this._refinement((o,i)=>{let a=e(o),s=()=>i.addIssue({code:Xe.custom,...n(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(u=>u?!0:(s(),!1)):a?!0:(s(),!1)})}refinement(e,r){return this._refinement((n,o)=>e(n)?!0:(o.addIssue(typeof r=="function"?r(n,o):r),!1))}_refinement(e){return new Vw({schema:this,typeName:Me.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 zw.create(this,this._def)}nullable(){return gO.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return bN.create(this)}promise(){return sL.create(this,this._def)}or(e){return vz.create([this,e],this._def)}and(e){return wz.create(this,e,this._def)}transform(e){return new Vw({...$o(this._def),schema:this,typeName:Me.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let r=typeof e=="function"?e:()=>e;return new Tz({...$o(this._def),innerType:this,defaultValue:r,typeName:Me.ZodDefault})}brand(){return new PQ({typeName:Me.ZodBranded,type:this,...$o(this._def)})}catch(e){let r=typeof e=="function"?e:()=>e;return new Ez({...$o(this._def),innerType:this,catchValue:r,typeName:Me.ZodCatch})}describe(e){let r=this.constructor;return new r({...this._def,description:e})}pipe(e){return MQ.create(this,e)}readonly(){return Pz.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},lpn=/^c[^\s-]{8,}$/i,cpn=/^[0-9a-z]+$/,dpn=/^[0-9A-HJKMNP-TV-Z]{26}$/i,fpn=/^[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,ppn=/^[a-z0-9_-]{21}$/i,mpn=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,hpn=/^[-+]?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)?)??$/,gpn=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ypn="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",bpn=/^(?:(?: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])$/,_pn=/^(?:(?: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])$/,vpn=/^(([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]))$/,wpn=/^(([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])$/,Spn=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,Cpn=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,KEt="((\\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])))",xpn=new RegExp(`^${KEt}$`);iL=class t extends Qo{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==rr.string){let i=this._getOrReturnCtx(e);return qt(i,{code:Xe.invalid_type,expected:rr.string,received:i.parsedType}),fn}let n=new Xh,o;for(let i of this._def.checks)if(i.kind==="min")e.data.lengthi.value&&(o=this._getOrReturnCtx(e,o),qt(o,{code:Xe.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),n.dirty());else if(i.kind==="length"){let a=e.data.length>i.value,s=e.data.lengthe.test(o),{validation:r,code:Xe.invalid_string,...Pr.errToObj(n)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...Pr.errToObj(e)})}url(e){return this._addCheck({kind:"url",...Pr.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...Pr.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...Pr.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...Pr.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...Pr.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...Pr.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...Pr.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...Pr.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...Pr.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...Pr.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...Pr.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...Pr.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,...Pr.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,...Pr.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...Pr.errToObj(e)})}regex(e,r){return this._addCheck({kind:"regex",regex:e,...Pr.errToObj(r)})}includes(e,r){return this._addCheck({kind:"includes",value:e,position:r?.position,...Pr.errToObj(r?.message)})}startsWith(e,r){return this._addCheck({kind:"startsWith",value:e,...Pr.errToObj(r)})}endsWith(e,r){return this._addCheck({kind:"endsWith",value:e,...Pr.errToObj(r)})}min(e,r){return this._addCheck({kind:"min",value:e,...Pr.errToObj(r)})}max(e,r){return this._addCheck({kind:"max",value:e,...Pr.errToObj(r)})}length(e,r){return this._addCheck({kind:"length",value:e,...Pr.errToObj(r)})}nonempty(e){return this.min(1,Pr.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.valuenew iL({checks:[],typeName:Me.ZodString,coerce:t?.coerce??!1,...$o(t)});mz=class t extends Qo{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)!==rr.number){let i=this._getOrReturnCtx(e);return qt(i,{code:Xe.invalid_type,expected:rr.number,received:i.parsedType}),fn}let n,o=new Xh;for(let i of this._def.checks)i.kind==="int"?vi.isInteger(e.data)||(n=this._getOrReturnCtx(e,n),qt(n,{code:Xe.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),qt(n,{code:Xe.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?Mpn(e.data,i.value)!==0&&(n=this._getOrReturnCtx(e,n),qt(n,{code:Xe.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(e.data)||(n=this._getOrReturnCtx(e,n),qt(n,{code:Xe.not_finite,message:i.message}),o.dirty()):vi.assertNever(i);return{status:o.value,value:e.data}}gte(e,r){return this.setLimit("min",e,!0,Pr.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Pr.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Pr.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Pr.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Pr.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:Pr.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Pr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Pr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Pr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Pr.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Pr.toString(r)})}finite(e){return this._addCheck({kind:"finite",message:Pr.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Pr.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Pr.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.valuee.kind==="int"||e.kind==="multipleOf"&&vi.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.valuenew mz({checks:[],typeName:Me.ZodNumber,coerce:t?.coerce||!1,...$o(t)});hz=class t extends Qo{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)!==rr.bigint)return this._getInvalidInput(e);let n,o=new Xh;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?e.datai.value:e.data>=i.value)&&(n=this._getOrReturnCtx(e,n),qt(n,{code:Xe.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?e.data%i.value!==BigInt(0)&&(n=this._getOrReturnCtx(e,n),qt(n,{code:Xe.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):vi.assertNever(i);return{status:o.value,value:e.data}}_getInvalidInput(e){let r=this._getOrReturnCtx(e);return qt(r,{code:Xe.invalid_type,expected:rr.bigint,received:r.parsedType}),fn}gte(e,r){return this.setLimit("min",e,!0,Pr.toString(r))}gt(e,r){return this.setLimit("min",e,!1,Pr.toString(r))}lte(e,r){return this.setLimit("max",e,!0,Pr.toString(r))}lt(e,r){return this.setLimit("max",e,!1,Pr.toString(r))}setLimit(e,r,n,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:r,inclusive:n,message:Pr.toString(o)}]})}_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:Pr.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Pr.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Pr.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Pr.toString(e)})}multipleOf(e,r){return this._addCheck({kind:"multipleOf",value:e,message:Pr.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.valuenew hz({checks:[],typeName:Me.ZodBigInt,coerce:t?.coerce??!1,...$o(t)});gz=class extends Qo{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==rr.boolean){let n=this._getOrReturnCtx(e);return qt(n,{code:Xe.invalid_type,expected:rr.boolean,received:n.parsedType}),fn}return ty(e.data)}};gz.create=t=>new gz({typeName:Me.ZodBoolean,coerce:t?.coerce||!1,...$o(t)});yz=class t extends Qo{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==rr.date){let i=this._getOrReturnCtx(e);return qt(i,{code:Xe.invalid_type,expected:rr.date,received:i.parsedType}),fn}if(Number.isNaN(e.data.getTime())){let i=this._getOrReturnCtx(e);return qt(i,{code:Xe.invalid_date}),fn}let n=new Xh,o;for(let i of this._def.checks)i.kind==="min"?e.data.getTime()i.value&&(o=this._getOrReturnCtx(e,o),qt(o,{code:Xe.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),n.dirty()):vi.assertNever(i);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:Pr.toString(r)})}max(e,r){return this._addCheck({kind:"max",value:e.getTime(),message:Pr.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.valuenew yz({checks:[],coerce:t?.coerce||!1,typeName:Me.ZodDate,...$o(t)});w6=class extends Qo{_parse(e){if(this._getType(e)!==rr.symbol){let n=this._getOrReturnCtx(e);return qt(n,{code:Xe.invalid_type,expected:rr.symbol,received:n.parsedType}),fn}return ty(e.data)}};w6.create=t=>new w6({typeName:Me.ZodSymbol,...$o(t)});bz=class extends Qo{_parse(e){if(this._getType(e)!==rr.undefined){let n=this._getOrReturnCtx(e);return qt(n,{code:Xe.invalid_type,expected:rr.undefined,received:n.parsedType}),fn}return ty(e.data)}};bz.create=t=>new bz({typeName:Me.ZodUndefined,...$o(t)});_z=class extends Qo{_parse(e){if(this._getType(e)!==rr.null){let n=this._getOrReturnCtx(e);return qt(n,{code:Xe.invalid_type,expected:rr.null,received:n.parsedType}),fn}return ty(e.data)}};_z.create=t=>new _z({typeName:Me.ZodNull,...$o(t)});aL=class extends Qo{constructor(){super(...arguments),this._any=!0}_parse(e){return ty(e.data)}};aL.create=t=>new aL({typeName:Me.ZodAny,...$o(t)});yN=class extends Qo{constructor(){super(...arguments),this._unknown=!0}_parse(e){return ty(e.data)}};yN.create=t=>new yN({typeName:Me.ZodUnknown,...$o(t)});J0=class extends Qo{_parse(e){let r=this._getOrReturnCtx(e);return qt(r,{code:Xe.invalid_type,expected:rr.never,received:r.parsedType}),fn}};J0.create=t=>new J0({typeName:Me.ZodNever,...$o(t)});S6=class extends Qo{_parse(e){if(this._getType(e)!==rr.undefined){let n=this._getOrReturnCtx(e);return qt(n,{code:Xe.invalid_type,expected:rr.void,received:n.parsedType}),fn}return ty(e.data)}};S6.create=t=>new S6({typeName:Me.ZodVoid,...$o(t)});bN=class t extends Qo{_parse(e){let{ctx:r,status:n}=this._processInputParams(e),o=this._def;if(r.parsedType!==rr.array)return qt(r,{code:Xe.invalid_type,expected:rr.array,received:r.parsedType}),fn;if(o.exactLength!==null){let a=r.data.length>o.exactLength.value,s=r.data.lengtho.maxLength.value&&(qt(r,{code:Xe.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),n.dirty()),r.common.async)return Promise.all([...r.data].map((a,s)=>o.type._parseAsync(new Hw(r,a,r.path,s)))).then(a=>Xh.mergeArray(n,a));let i=[...r.data].map((a,s)=>o.type._parseSync(new Hw(r,a,r.path,s)));return Xh.mergeArray(n,i)}get element(){return this._def.type}min(e,r){return new t({...this._def,minLength:{value:e,message:Pr.toString(r)}})}max(e,r){return new t({...this._def,maxLength:{value:e,message:Pr.toString(r)}})}length(e,r){return new t({...this._def,exactLength:{value:e,message:Pr.toString(r)}})}nonempty(e){return this.min(1,e)}};bN.create=(t,e)=>new bN({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Me.ZodArray,...$o(e)});r_=class t extends Qo{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=vi.objectKeys(e);return this._cached={shape:e,keys:r},this._cached}_parse(e){if(this._getType(e)!==rr.object){let l=this._getOrReturnCtx(e);return qt(l,{code:Xe.invalid_type,expected:rr.object,received:l.parsedType}),fn}let{status:n,ctx:o}=this._processInputParams(e),{shape:i,keys:a}=this._getCached(),s=[];if(!(this._def.catchall instanceof J0&&this._def.unknownKeys==="strip"))for(let l in o.data)a.includes(l)||s.push(l);let u=[];for(let l of a){let c=i[l],d=o.data[l];u.push({key:{status:"valid",value:l},value:c._parse(new Hw(o,d,o.path,l)),alwaysSet:l in o.data})}if(this._def.catchall instanceof J0){let l=this._def.unknownKeys;if(l==="passthrough")for(let c of s)u.push({key:{status:"valid",value:c},value:{status:"valid",value:o.data[c]}});else if(l==="strict")s.length>0&&(qt(o,{code:Xe.unrecognized_keys,keys:s}),n.dirty());else if(l!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let l=this._def.catchall;for(let c of s){let d=o.data[c];u.push({key:{status:"valid",value:c},value:l._parse(new Hw(o,d,o.path,c)),alwaysSet:c in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let l=[];for(let c of u){let d=await c.key,f=await c.value;l.push({key:d,value:f,alwaysSet:c.alwaysSet})}return l}).then(l=>Xh.mergeObjectSync(n,l)):Xh.mergeObjectSync(n,u)}get shape(){return this._def.shape()}strict(e){return Pr.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(r,n)=>{let o=this._def.errorMap?.(r,n).message??n.defaultError;return r.code==="unrecognized_keys"?{message:Pr.errToObj(e).message??o}:{message:o}}}:{}})}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:Me.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 vi.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 vi.objectKeys(this.shape))e[n]||(r[n]=this.shape[n]);return new t({...this._def,shape:()=>r})}deepPartial(){return v6(this)}partial(e){let r={};for(let n of vi.objectKeys(this.shape)){let o=this.shape[n];e&&!e[n]?r[n]=o:r[n]=o.optional()}return new t({...this._def,shape:()=>r})}required(e){let r={};for(let n of vi.objectKeys(this.shape))if(e&&!e[n])r[n]=this.shape[n];else{let i=this.shape[n];for(;i instanceof zw;)i=i._def.innerType;r[n]=i}return new t({...this._def,shape:()=>r})}keyof(){return ZEt(vi.objectKeys(this.shape))}};r_.create=(t,e)=>new r_({shape:()=>t,unknownKeys:"strip",catchall:J0.create(),typeName:Me.ZodObject,...$o(e)});r_.strictCreate=(t,e)=>new r_({shape:()=>t,unknownKeys:"strict",catchall:J0.create(),typeName:Me.ZodObject,...$o(e)});r_.lazycreate=(t,e)=>new r_({shape:t,unknownKeys:"strip",catchall:J0.create(),typeName:Me.ZodObject,...$o(e)});vz=class extends Qo{_parse(e){let{ctx:r}=this._processInputParams(e),n=this._def.options;function o(i){for(let s of i)if(s.result.status==="valid")return s.result;for(let s of i)if(s.result.status==="dirty")return r.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(s=>new t_(s.ctx.common.issues));return qt(r,{code:Xe.invalid_union,unionErrors:a}),fn}if(r.common.async)return Promise.all(n.map(async i=>{let a={...r,common:{...r.common,issues:[]},parent:null};return{result:await i._parseAsync({data:r.data,path:r.path,parent:a}),ctx:a}})).then(o);{let i,a=[];for(let u of n){let l={...r,common:{...r.common,issues:[]},parent:null},c=u._parseSync({data:r.data,path:r.path,parent:l});if(c.status==="valid")return c;c.status==="dirty"&&!i&&(i={result:c,ctx:l}),l.common.issues.length&&a.push(l.common.issues)}if(i)return r.common.issues.push(...i.ctx.common.issues),i.result;let s=a.map(u=>new t_(u));return qt(r,{code:Xe.invalid_union,unionErrors:s}),fn}}get options(){return this._def.options}};vz.create=(t,e)=>new vz({options:t,typeName:Me.ZodUnion,...$o(e)});gN=t=>t instanceof Sz?gN(t.schema):t instanceof Vw?gN(t.innerType()):t instanceof Cz?[t.value]:t instanceof xz?t.options:t instanceof Oz?vi.objectValues(t.enum):t instanceof Tz?gN(t._def.innerType):t instanceof bz?[void 0]:t instanceof _z?[null]:t instanceof zw?[void 0,...gN(t.unwrap())]:t instanceof gO?[null,...gN(t.unwrap())]:t instanceof PQ||t instanceof Pz?gN(t.unwrap()):t instanceof Ez?gN(t._def.innerType):[],Gme=class t extends Qo{_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==rr.object)return qt(r,{code:Xe.invalid_type,expected:rr.object,received:r.parsedType}),fn;let n=this.discriminator,o=r.data[n],i=this.optionsMap.get(o);return i?r.common.async?i._parseAsync({data:r.data,path:r.path,parent:r}):i._parseSync({data:r.data,path:r.path,parent:r}):(qt(r,{code:Xe.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[n]}),fn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,r,n){let o=new Map;for(let i of r){let a=gN(i.shape[e]);if(!a.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let s of a){if(o.has(s))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(s)}`);o.set(s,i)}}return new t({typeName:Me.ZodDiscriminatedUnion,discriminator:e,options:r,optionsMap:o,...$o(n)})}};wz=class extends Qo{_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=(i,a)=>{if(Kme(i)||Kme(a))return fn;let s=Yze(i.value,a.value);return s.valid?((Wme(i)||Wme(a))&&r.dirty(),{status:r.value,value:s.data}):(qt(n,{code:Xe.invalid_intersection_types}),fn)};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(([i,a])=>o(i,a)):o(this._def.left._parseSync({data:n.data,path:n.path,parent:n}),this._def.right._parseSync({data:n.data,path:n.path,parent:n}))}};wz.create=(t,e,r)=>new wz({left:t,right:e,typeName:Me.ZodIntersection,...$o(r)});hO=class t extends Qo{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==rr.array)return qt(n,{code:Xe.invalid_type,expected:rr.array,received:n.parsedType}),fn;if(n.data.lengththis._def.items.length&&(qt(n,{code:Xe.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),r.dirty());let i=[...n.data].map((a,s)=>{let u=this._def.items[s]||this._def.rest;return u?u._parse(new Hw(n,a,n.path,s)):null}).filter(a=>!!a);return n.common.async?Promise.all(i).then(a=>Xh.mergeArray(r,a)):Xh.mergeArray(r,i)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};hO.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new hO({items:t,typeName:Me.ZodTuple,rest:null,...$o(e)})};Zme=class t extends Qo{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!==rr.object)return qt(n,{code:Xe.invalid_type,expected:rr.object,received:n.parsedType}),fn;let o=[],i=this._def.keyType,a=this._def.valueType;for(let s in n.data)o.push({key:i._parse(new Hw(n,s,n.path,s)),value:a._parse(new Hw(n,n.data[s],n.path,s)),alwaysSet:s in n.data});return n.common.async?Xh.mergeObjectAsync(r,o):Xh.mergeObjectSync(r,o)}get element(){return this._def.valueType}static create(e,r,n){return r instanceof Qo?new t({keyType:e,valueType:r,typeName:Me.ZodRecord,...$o(n)}):new t({keyType:iL.create(),valueType:e,typeName:Me.ZodRecord,...$o(r)})}},C6=class extends Qo{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!==rr.map)return qt(n,{code:Xe.invalid_type,expected:rr.map,received:n.parsedType}),fn;let o=this._def.keyType,i=this._def.valueType,a=[...n.data.entries()].map(([s,u],l)=>({key:o._parse(new Hw(n,s,n.path,[l,"key"])),value:i._parse(new Hw(n,u,n.path,[l,"value"]))}));if(n.common.async){let s=new Map;return Promise.resolve().then(async()=>{for(let u of a){let l=await u.key,c=await u.value;if(l.status==="aborted"||c.status==="aborted")return fn;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),s.set(l.value,c.value)}return{status:r.value,value:s}})}else{let s=new Map;for(let u of a){let l=u.key,c=u.value;if(l.status==="aborted"||c.status==="aborted")return fn;(l.status==="dirty"||c.status==="dirty")&&r.dirty(),s.set(l.value,c.value)}return{status:r.value,value:s}}}};C6.create=(t,e,r)=>new C6({valueType:e,keyType:t,typeName:Me.ZodMap,...$o(r)});x6=class t extends Qo{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.parsedType!==rr.set)return qt(n,{code:Xe.invalid_type,expected:rr.set,received:n.parsedType}),fn;let o=this._def;o.minSize!==null&&n.data.sizeo.maxSize.value&&(qt(n,{code:Xe.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),r.dirty());let i=this._def.valueType;function a(u){let l=new Set;for(let c of u){if(c.status==="aborted")return fn;c.status==="dirty"&&r.dirty(),l.add(c.value)}return{status:r.value,value:l}}let s=[...n.data.values()].map((u,l)=>i._parse(new Hw(n,u,n.path,l)));return n.common.async?Promise.all(s).then(u=>a(u)):a(s)}min(e,r){return new t({...this._def,minSize:{value:e,message:Pr.toString(r)}})}max(e,r){return new t({...this._def,maxSize:{value:e,message:Pr.toString(r)}})}size(e,r){return this.min(e,r).max(e,r)}nonempty(e){return this.min(1,e)}};x6.create=(t,e)=>new x6({valueType:t,minSize:null,maxSize:null,typeName:Me.ZodSet,...$o(e)});Xme=class t extends Qo{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==rr.function)return qt(r,{code:Xe.invalid_type,expected:rr.function,received:r.parsedType}),fn;function n(s,u){return EQ({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,b6(),hN].filter(l=>!!l),issueData:{code:Xe.invalid_arguments,argumentsError:u}})}function o(s,u){return EQ({data:s,path:r.path,errorMaps:[r.common.contextualErrorMap,r.schemaErrorMap,b6(),hN].filter(l=>!!l),issueData:{code:Xe.invalid_return_type,returnTypeError:u}})}let i={errorMap:r.common.contextualErrorMap},a=r.data;if(this._def.returns instanceof sL){let s=this;return ty(async function(...u){let l=new t_([]),c=await s._def.args.parseAsync(u,i).catch(p=>{throw l.addIssue(n(u,p)),l}),d=await Reflect.apply(a,this,c);return await s._def.returns._def.type.parseAsync(d,i).catch(p=>{throw l.addIssue(o(d,p)),l})})}else{let s=this;return ty(function(...u){let l=s._def.args.safeParse(u,i);if(!l.success)throw new t_([n(u,l.error)]);let c=Reflect.apply(a,this,l.data),d=s._def.returns.safeParse(c,i);if(!d.success)throw new t_([o(c,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:hO.create(e).rest(yN.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||hO.create([]).rest(yN.create()),returns:r||yN.create(),typeName:Me.ZodFunction,...$o(n)})}},Sz=class extends Qo{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})}};Sz.create=(t,e)=>new Sz({getter:t,typeName:Me.ZodLazy,...$o(e)});Cz=class extends Qo{_parse(e){if(e.data!==this._def.value){let r=this._getOrReturnCtx(e);return qt(r,{received:r.data,code:Xe.invalid_literal,expected:this._def.value}),fn}return{status:"valid",value:e.data}}get value(){return this._def.value}};Cz.create=(t,e)=>new Cz({value:t,typeName:Me.ZodLiteral,...$o(e)});xz=class t extends Qo{_parse(e){if(typeof e.data!="string"){let r=this._getOrReturnCtx(e),n=this._def.values;return qt(r,{expected:vi.joinValues(n),received:r.parsedType,code:Xe.invalid_type}),fn}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 qt(r,{received:r.data,code:Xe.invalid_enum_value,options:n}),fn}return ty(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})}};xz.create=ZEt;Oz=class extends Qo{_parse(e){let r=vi.getValidEnumValues(this._def.values),n=this._getOrReturnCtx(e);if(n.parsedType!==rr.string&&n.parsedType!==rr.number){let o=vi.objectValues(r);return qt(n,{expected:vi.joinValues(o),received:n.parsedType,code:Xe.invalid_type}),fn}if(this._cache||(this._cache=new Set(vi.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=vi.objectValues(r);return qt(n,{received:n.data,code:Xe.invalid_enum_value,options:o}),fn}return ty(e.data)}get enum(){return this._def.values}};Oz.create=(t,e)=>new Oz({values:t,typeName:Me.ZodNativeEnum,...$o(e)});sL=class extends Qo{unwrap(){return this._def.type}_parse(e){let{ctx:r}=this._processInputParams(e);if(r.parsedType!==rr.promise&&r.common.async===!1)return qt(r,{code:Xe.invalid_type,expected:rr.promise,received:r.parsedType}),fn;let n=r.parsedType===rr.promise?r.data:Promise.resolve(r.data);return ty(n.then(o=>this._def.type.parseAsync(o,{path:r.path,errorMap:r.common.contextualErrorMap})))}};sL.create=(t,e)=>new sL({type:t,typeName:Me.ZodPromise,...$o(e)});Vw=class extends Qo{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Me.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:r,ctx:n}=this._processInputParams(e),o=this._def.effect||null,i={addIssue:a=>{qt(n,a),a.fatal?r.abort():r.dirty()},get path(){return n.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(n.data,i);if(n.common.async)return Promise.resolve(a).then(async s=>{if(r.value==="aborted")return fn;let u=await this._def.schema._parseAsync({data:s,path:n.path,parent:n});return u.status==="aborted"?fn:u.status==="dirty"?pz(u.value):r.value==="dirty"?pz(u.value):u});{if(r.value==="aborted")return fn;let s=this._def.schema._parseSync({data:a,path:n.path,parent:n});return s.status==="aborted"?fn:s.status==="dirty"?pz(s.value):r.value==="dirty"?pz(s.value):s}}if(o.type==="refinement"){let a=s=>{let u=o.refinement(s,i);if(n.common.async)return Promise.resolve(u);if(u instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return s};if(n.common.async===!1){let s=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});return s.status==="aborted"?fn:(s.status==="dirty"&&r.dirty(),a(s.value),{status:r.value,value:s.value})}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(s=>s.status==="aborted"?fn:(s.status==="dirty"&&r.dirty(),a(s.value).then(()=>({status:r.value,value:s.value}))))}if(o.type==="transform")if(n.common.async===!1){let a=this._def.schema._parseSync({data:n.data,path:n.path,parent:n});if(!oL(a))return fn;let s=o.transform(a.value,i);if(s instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:r.value,value:s}}else return this._def.schema._parseAsync({data:n.data,path:n.path,parent:n}).then(a=>oL(a)?Promise.resolve(o.transform(a.value,i)).then(s=>({status:r.value,value:s})):fn);vi.assertNever(o)}};Vw.create=(t,e,r)=>new Vw({schema:t,typeName:Me.ZodEffects,effect:e,...$o(r)});Vw.createWithPreprocess=(t,e,r)=>new Vw({schema:e,effect:{type:"preprocess",transform:t},typeName:Me.ZodEffects,...$o(r)});zw=class extends Qo{_parse(e){return this._getType(e)===rr.undefined?ty(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};zw.create=(t,e)=>new zw({innerType:t,typeName:Me.ZodOptional,...$o(e)});gO=class extends Qo{_parse(e){return this._getType(e)===rr.null?ty(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};gO.create=(t,e)=>new gO({innerType:t,typeName:Me.ZodNullable,...$o(e)});Tz=class extends Qo{_parse(e){let{ctx:r}=this._processInputParams(e),n=r.data;return r.parsedType===rr.undefined&&(n=this._def.defaultValue()),this._def.innerType._parse({data:n,path:r.path,parent:r})}removeDefault(){return this._def.innerType}};Tz.create=(t,e)=>new Tz({innerType:t,typeName:Me.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...$o(e)});Ez=class extends Qo{_parse(e){let{ctx:r}=this._processInputParams(e),n={...r,common:{...r.common,issues:[]}},o=this._def.innerType._parse({data:n.data,path:n.path,parent:{...n}});return _6(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new t_(n.common.issues)},input:n.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new t_(n.common.issues)},input:n.data})}}removeCatch(){return this._def.innerType}};Ez.create=(t,e)=>new Ez({innerType:t,typeName:Me.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...$o(e)});O6=class extends Qo{_parse(e){if(this._getType(e)!==rr.nan){let n=this._getOrReturnCtx(e);return qt(n,{code:Xe.invalid_type,expected:rr.nan,received:n.parsedType}),fn}return{status:"valid",value:e.data}}};O6.create=t=>new O6({typeName:Me.ZodNaN,...$o(t)});Rpn=Symbol("zod_brand"),PQ=class extends Qo{_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}},MQ=class t extends Qo{_parse(e){let{status:r,ctx:n}=this._processInputParams(e);if(n.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:n.data,path:n.path,parent:n});return i.status==="aborted"?fn:i.status==="dirty"?(r.dirty(),pz(i.value)):this._def.out._parseAsync({data:i.value,path:n.path,parent:n})})();{let o=this._def.in._parseSync({data:n.data,path:n.path,parent:n});return o.status==="aborted"?fn:o.status==="dirty"?(r.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:n.path,parent:n})}}static create(e,r){return new t({in:e,out:r,typeName:Me.ZodPipeline})}},Pz=class extends Qo{_parse(e){let r=this._def.innerType._parse(e),n=o=>(oL(o)&&(o.value=Object.freeze(o.value)),o);return _6(r)?r.then(o=>n(o)):n(r)}unwrap(){return this._def.innerType}};Pz.create=(t,e)=>new Pz({innerType:t,typeName:Me.ZodReadonly,...$o(e)});Apn={object:r_.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"})(Me||(Me={}));Ipn=(t,e={message:`Input not instance of ${t.name}`})=>XEt(r=>r instanceof t,e),YEt=iL.create,QEt=mz.create,Npn=O6.create,jpn=hz.create,ePt=gz.create,Dpn=yz.create,$pn=w6.create,Lpn=bz.create,Fpn=_z.create,kpn=aL.create,qpn=yN.create,Bpn=J0.create,Upn=S6.create,zpn=bN.create,Hpn=r_.create,Vpn=r_.strictCreate,Jpn=vz.create,Kpn=Gme.create,Wpn=wz.create,Gpn=hO.create,Zpn=Zme.create,Xpn=C6.create,Ypn=x6.create,Qpn=Xme.create,emn=Sz.create,tmn=Cz.create,rmn=xz.create,nmn=Oz.create,omn=sL.create,imn=Vw.create,amn=zw.create,smn=gO.create,umn=Vw.createWithPreprocess,lmn=MQ.create,cmn=()=>YEt().optional(),dmn=()=>QEt().optional(),fmn=()=>ePt().optional(),pmn={string:t=>iL.create({...t,coerce:!0}),number:t=>mz.create({...t,coerce:!0}),boolean:t=>gz.create({...t,coerce:!0}),bigint:t=>hz.create({...t,coerce:!0}),date:t=>yz.create({...t,coerce:!0})},mmn=fn});var mt={};Jn(mt,{BRAND:()=>Rpn,DIRTY:()=>pz,EMPTY_PATH:()=>upn,INVALID:()=>fn,NEVER:()=>mmn,OK:()=>ty,ParseStatus:()=>Xh,Schema:()=>Qo,ZodAny:()=>aL,ZodArray:()=>bN,ZodBigInt:()=>hz,ZodBoolean:()=>gz,ZodBranded:()=>PQ,ZodCatch:()=>Ez,ZodDate:()=>yz,ZodDefault:()=>Tz,ZodDiscriminatedUnion:()=>Gme,ZodEffects:()=>Vw,ZodEnum:()=>xz,ZodError:()=>t_,ZodFirstPartyTypeKind:()=>Me,ZodFunction:()=>Xme,ZodIntersection:()=>wz,ZodIssueCode:()=>Xe,ZodLazy:()=>Sz,ZodLiteral:()=>Cz,ZodMap:()=>C6,ZodNaN:()=>O6,ZodNativeEnum:()=>Oz,ZodNever:()=>J0,ZodNull:()=>_z,ZodNullable:()=>gO,ZodNumber:()=>mz,ZodObject:()=>r_,ZodOptional:()=>zw,ZodParsedType:()=>rr,ZodPipeline:()=>MQ,ZodPromise:()=>sL,ZodReadonly:()=>Pz,ZodRecord:()=>Zme,ZodSchema:()=>Qo,ZodSet:()=>x6,ZodString:()=>iL,ZodSymbol:()=>w6,ZodTransformer:()=>Vw,ZodTuple:()=>hO,ZodType:()=>Qo,ZodUndefined:()=>bz,ZodUnion:()=>vz,ZodUnknown:()=>yN,ZodVoid:()=>S6,addIssueToContext:()=>qt,any:()=>kpn,array:()=>zpn,bigint:()=>jpn,boolean:()=>ePt,coerce:()=>pmn,custom:()=>XEt,date:()=>Dpn,datetimeRegex:()=>GEt,defaultErrorMap:()=>hN,discriminatedUnion:()=>Kpn,effect:()=>imn,enum:()=>rmn,function:()=>Qpn,getErrorMap:()=>b6,getParsedType:()=>mO,instanceof:()=>Ipn,intersection:()=>Wpn,isAborted:()=>Kme,isAsync:()=>_6,isDirty:()=>Wme,isValid:()=>oL,late:()=>Apn,lazy:()=>emn,literal:()=>tmn,makeIssue:()=>EQ,map:()=>Xpn,nan:()=>Npn,nativeEnum:()=>nmn,never:()=>Bpn,null:()=>Fpn,nullable:()=>smn,number:()=>QEt,object:()=>Hpn,objectUtil:()=>Wze,oboolean:()=>fmn,onumber:()=>dmn,optional:()=>amn,ostring:()=>cmn,pipeline:()=>lmn,preprocess:()=>umn,promise:()=>omn,quotelessJson:()=>ipn,record:()=>Zpn,set:()=>Ypn,setErrorMap:()=>spn,strictObject:()=>Vpn,string:()=>YEt,symbol:()=>$pn,transformer:()=>imn,tuple:()=>Gpn,undefined:()=>Lpn,union:()=>Jpn,unknown:()=>qpn,util:()=>vi,void:()=>Upn});var RQ=v(()=>{Jme();Zze();zEt();TQ();tPt();Vme()});var yO=v(()=>{RQ();RQ()});function rPt(t,e){let r={type:"array"};return t.type?._def&&t.type?._def?.typeName!==Me.ZodAny&&(r.items=Sn(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&$i(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&$i(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&($i(r,"minItems",t.exactLength.value,t.exactLength.message,e),$i(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}var Qze=v(()=>{nL();dd();yO()});function nPt(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?$i(r,"minimum",n.value,n.message,e):$i(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),$i(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?$i(r,"maximum",n.value,n.message,e):$i(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),$i(r,"maximum",n.value,n.message,e));break;case"multipleOf":$i(r,"multipleOf",n.value,n.message,e);break}return r}var e4e=v(()=>{nL()});function oPt(){return{type:"boolean"}}var t4e=v(()=>{});function Yme(t,e){return Sn(t.type._def,e)}var Qme=v(()=>{dd()});var iPt,r4e=v(()=>{dd();iPt=(t,e)=>Sn(t.innerType._def,e)});function n4e(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map(o=>n4e(t,e,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return hmn(t,e)}}var hmn,o4e=v(()=>{nL();hmn=(t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let n of t.checks)switch(n.kind){case"min":$i(r,"minimum",n.value,n.message,e);break;case"max":$i(r,"maximum",n.value,n.message,e);break}return r}});function aPt(t,e){return{...Sn(t.innerType._def,e),default:t.defaultValue()}}var i4e=v(()=>{dd()});function sPt(t,e){return e.effectStrategy==="input"?Sn(t.schema._def,e):wl(e)}var a4e=v(()=>{Uw();dd()});function uPt(t){return{type:"string",enum:Array.from(t.values)}}var s4e=v(()=>{});function lPt(t,e){let r=[Sn(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),Sn(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(i=>{if(gmn(i))o.push(...i.allOf),i.unevaluatedProperties===void 0&&(n=void 0);else{let a=i;if("additionalProperties"in i&&i.additionalProperties===!1){let{additionalProperties:s,...u}=i;a=u}else n=void 0;o.push(a)}}),o.length?{allOf:o,...n}:void 0}var gmn,u4e=v(()=>{dd();gmn=t=>"type"in t&&t.type==="string"?!1:"allOf"in t});function cPt(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}var l4e=v(()=>{});function ehe(t,e){let r={type:"string"};if(t.checks)for(let n of t.checks)switch(n.kind){case"min":$i(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e);break;case"max":$i(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"email":switch(e.emailStrategy){case"format:email":W0(r,"email",n.message,e);break;case"format:idn-email":W0(r,"idn-email",n.message,e);break;case"pattern:zod":rb(r,K0.email,n.message,e);break}break;case"url":W0(r,"uri",n.message,e);break;case"uuid":W0(r,"uuid",n.message,e);break;case"regex":rb(r,n.regex,n.message,e);break;case"cuid":rb(r,K0.cuid,n.message,e);break;case"cuid2":rb(r,K0.cuid2,n.message,e);break;case"startsWith":rb(r,RegExp(`^${d4e(n.value,e)}`),n.message,e);break;case"endsWith":rb(r,RegExp(`${d4e(n.value,e)}$`),n.message,e);break;case"datetime":W0(r,"date-time",n.message,e);break;case"date":W0(r,"date",n.message,e);break;case"time":W0(r,"time",n.message,e);break;case"duration":W0(r,"duration",n.message,e);break;case"length":$i(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,n.value):n.value,n.message,e),$i(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,n.value):n.value,n.message,e);break;case"includes":rb(r,RegExp(d4e(n.value,e)),n.message,e);break;case"ip":n.version!=="v6"&&W0(r,"ipv4",n.message,e),n.version!=="v4"&&W0(r,"ipv6",n.message,e);break;case"base64url":rb(r,K0.base64url,n.message,e);break;case"jwt":rb(r,K0.jwt,n.message,e);break;case"cidr":n.version!=="v6"&&rb(r,K0.ipv4Cidr,n.message,e),n.version!=="v4"&&rb(r,K0.ipv6Cidr,n.message,e);break;case"emoji":rb(r,K0.emoji(),n.message,e);break;case"ulid":rb(r,K0.ulid,n.message,e);break;case"base64":switch(e.base64Strategy){case"format:binary":W0(r,"binary",n.message,e);break;case"contentEncoding:base64":$i(r,"contentEncoding","base64",n.message,e);break;case"pattern:zod":rb(r,K0.base64,n.message,e);break}break;case"nanoid":rb(r,K0.nanoid,n.message,e);break;case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}function d4e(t,e){return e.patternStrategy==="escape"?bmn(t):t}function bmn(t){let e="";for(let r=0;ro.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&n.errorMessages&&{errorMessage:{format:r}}})):$i(t,"format",e,r,n)}function rb(t,e,r,n){t.pattern||t.allOf?.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:dPt(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):$i(t,"pattern",dPt(e,n),r,n)}function dPt(t,e){if(!e.applyRegexFlags||!t.flags)return t.source;let r={i:t.flags.includes("i"),m:t.flags.includes("m"),s:t.flags.includes("s")},n=r.i?t.source.toLowerCase():t.source,o="",i=!1,a=!1,s=!1;for(let u=0;u{nL();K0={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(c4e===void 0&&(c4e=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),c4e),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv4Cidr:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,ipv6Cidr:/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,base64url:/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/,jwt:/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/};ymn=new Set("ABCDEFGHIJKLMNOPQRSTUVXYZabcdefghijklmnopqrstuvxyz0123456789")});function rhe(t,e){if(e.target==="openAi"&&console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."),e.target==="openApi3"&&t.keyType?._def.typeName===Me.ZodEnum)return{type:"object",required:t.keyType._def.values,properties:t.keyType._def.values.reduce((n,o)=>({...n,[o]:Sn(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??wl(e)}),{}),additionalProperties:e.rejectedAdditionalProperties};let r={type:"object",additionalProperties:Sn(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??e.allowedAdditionalProperties};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===Me.ZodString&&t.keyType._def.checks?.length){let{type:n,...o}=ehe(t.keyType._def,e);return{...r,propertyNames:o}}else{if(t.keyType?._def.typeName===Me.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};if(t.keyType?._def.typeName===Me.ZodBranded&&t.keyType._def.type._def.typeName===Me.ZodString&&t.keyType._def.type._def.checks?.length){let{type:n,...o}=Yme(t.keyType._def,e);return{...r,propertyNames:o}}}return r}var nhe=v(()=>{Uw();Qme();the();dd();yO()});function fPt(t,e){if(e.mapStrategy==="record")return rhe(t,e);let r=Sn(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||wl(e),n=Sn(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||wl(e);return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}var f4e=v(()=>{Uw();nhe();dd()});function pPt(t){let e=t.values,n=Object.keys(t.values).filter(i=>typeof e[e[i]]!="number").map(i=>e[i]),o=Array.from(new Set(n.map(i=>typeof i)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:n}}var p4e=v(()=>{});function mPt(t){return t.target==="openAi"?void 0:{not:wl({...t,currentPath:[...t.currentPath,"not"]})}}var m4e=v(()=>{Uw()});function hPt(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var h4e=v(()=>{});function yPt(t,e){if(e.target==="openApi3")return gPt(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in AQ&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,i)=>{let a=AQ[i._def.typeName];return a&&!o.includes(a)?[...o,a]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((o,i)=>{let a=typeof i._def.value;switch(a){case"string":case"number":case"boolean":return[...o,a];case"bigint":return[...o,"integer"];case"object":return i._def.value===null?[...o,"null"]:o;case"symbol":case"undefined":case"function":default:return o}},[]);if(n.length===r.length){let o=n.filter((i,a,s)=>s.indexOf(i)===a);return{type:o.length>1?o:o[0],enum:r.reduce((i,a)=>i.includes(a._def.value)?i:[...i,a._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(i=>!n.includes(i))],[])};return gPt(t,e)}var AQ,gPt,ohe=v(()=>{dd();AQ={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};gPt=(t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>Sn(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0}});function bPt(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"?{type:AQ[t.innerType._def.typeName],nullable:!0}:{type:[AQ[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=Sn(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=Sn(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}var g4e=v(()=>{ohe();dd()});function _Pt(t,e){let r={type:"number"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",Kze(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?$i(r,"minimum",n.value,n.message,e):$i(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),$i(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?$i(r,"maximum",n.value,n.message,e):$i(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),$i(r,"maximum",n.value,n.message,e));break;case"multipleOf":$i(r,"multipleOf",n.value,n.message,e);break}return r}var y4e=v(()=>{nL()});function vPt(t,e){let r=e.target==="openAi",n={type:"object",properties:{}},o=[],i=t.shape();for(let s in i){let u=i[s];if(u===void 0||u._def===void 0)continue;let l=vmn(u);l&&r&&(u._def.typeName==="ZodOptional"&&(u=u._def.innerType),u.isNullable()||(u=u.nullable()),l=!1);let c=Sn(u._def,{...e,currentPath:[...e.currentPath,"properties",s],propertyPath:[...e.currentPath,"properties",s]});c!==void 0&&(n.properties[s]=c,l||o.push(s))}o.length&&(n.required=o);let a=_mn(t,e);return a!==void 0&&(n.additionalProperties=a),n}function _mn(t,e){if(t.catchall._def.typeName!=="ZodNever")return Sn(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]});switch(t.unknownKeys){case"passthrough":return e.allowedAdditionalProperties;case"strict":return e.rejectedAdditionalProperties;case"strip":return e.removeAdditionalStrategy==="strict"?e.allowedAdditionalProperties:e.rejectedAdditionalProperties}}function vmn(t){try{return t.isOptional()}catch{return!0}}var b4e=v(()=>{dd()});var wPt,_4e=v(()=>{Uw();dd();wPt=(t,e)=>{if(e.currentPath.toString()===e.propertyPath?.toString())return Sn(t.innerType._def,e);let r=Sn(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:wl(e)},r]}:wl(e)}});var SPt,v4e=v(()=>{dd();SPt=(t,e)=>{if(e.pipeStrategy==="input")return Sn(t.in._def,e);if(e.pipeStrategy==="output")return Sn(t.out._def,e);let r=Sn(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=Sn(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}}});function CPt(t,e){return Sn(t.type._def,e)}var w4e=v(()=>{dd()});function xPt(t,e){let n={type:"array",uniqueItems:!0,items:Sn(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&$i(n,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&$i(n,"maxItems",t.maxSize.value,t.maxSize.message,e),n}var S4e=v(()=>{nL();dd()});function OPt(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>Sn(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:Sn(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>Sn(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}var C4e=v(()=>{dd()});function TPt(t){return{not:wl(t)}}var x4e=v(()=>{Uw()});function EPt(t){return wl(t)}var O4e=v(()=>{Uw()});var PPt,T4e=v(()=>{dd();PPt=(t,e)=>Sn(t.innerType._def,e)});var MPt,E4e=v(()=>{Uw();Qze();e4e();t4e();Qme();r4e();o4e();i4e();a4e();s4e();u4e();l4e();the();nhe();f4e();p4e();m4e();h4e();ohe();g4e();y4e();b4e();_4e();v4e();w4e();S4e();C4e();x4e();O4e();T4e();yO();MPt=(t,e,r)=>{switch(e){case Me.ZodString:return ehe(t,r);case Me.ZodNumber:return _Pt(t,r);case Me.ZodObject:return vPt(t,r);case Me.ZodBigInt:return nPt(t,r);case Me.ZodBoolean:return oPt();case Me.ZodDate:return n4e(t,r);case Me.ZodUndefined:return TPt(r);case Me.ZodNull:return hPt(r);case Me.ZodArray:return rPt(t,r);case Me.ZodUnion:case Me.ZodDiscriminatedUnion:return yPt(t,r);case Me.ZodIntersection:return lPt(t,r);case Me.ZodTuple:return OPt(t,r);case Me.ZodRecord:return rhe(t,r);case Me.ZodLiteral:return cPt(t,r);case Me.ZodEnum:return uPt(t);case Me.ZodNativeEnum:return pPt(t);case Me.ZodNullable:return bPt(t,r);case Me.ZodOptional:return wPt(t,r);case Me.ZodMap:return fPt(t,r);case Me.ZodSet:return xPt(t,r);case Me.ZodLazy:return()=>t.getter()._def;case Me.ZodPromise:return CPt(t,r);case Me.ZodNaN:case Me.ZodNever:return mPt(r);case Me.ZodEffects:return sPt(t,r);case Me.ZodAny:return wl(r);case Me.ZodUnknown:return EPt(r);case Me.ZodDefault:return aPt(t,r);case Me.ZodBranded:return Yme(t,r);case Me.ZodReadonly:return PPt(t,r);case Me.ZodCatch:return iPt(t,r);case Me.ZodPipeline:return SPt(t,r);case Me.ZodFunction:case Me.ZodVoid:case Me.ZodSymbol:return;default:return(n=>{})(e)}}});function Sn(t,e,r=!1){let n=e.seen.get(t);if(e.override){let s=e.override?.(t,e,n,r);if(s!==kEt)return s}if(n&&!r){let s=wmn(n,e);if(s!==void 0)return s}let o={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,o);let i=MPt(t,t.typeName,e),a=typeof i=="function"?Sn(i(),e):i;if(a&&Smn(t,e,a),e.postProcess){let s=e.postProcess(a,t,e);return o.jsonSchema=a,s}return o.jsonSchema=a,a}var wmn,Smn,dd=v(()=>{Ume();Hme();Uw();E4e();wmn=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"relative":return{$ref:zme(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[n]===r)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),wl(e)):e.$refStrategy==="seen"?wl(e):void 0}},Smn=(t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r)});var RPt,P4e=v(()=>{Jze();Uw();dd();RPt=(t,e)=>{let r=BEt(e),n=typeof e=="object"&&e.definitions?Object.entries(e.definitions).reduce((u,[l,c])=>({...u,[l]:Sn(c._def,{...r,currentPath:[...r.basePath,r.definitionPath,l]},!0)??wl(r)}),{}):void 0,o=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,i=Sn(t._def,o===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,o]},!1)??wl(r),a=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;a!==void 0&&(i.title=a),r.flags.hasReferencedOpenAiAnyType&&(n||(n={}),n[r.openAiAnyTypeName]||(n[r.openAiAnyTypeName]={type:["string","number","integer","boolean","array","null"],items:{$ref:r.$refStrategy==="relative"?"1":[...r.basePath,r.definitionPath,r.openAiAnyTypeName].join("/")}}));let s=o===void 0?n?{...i,[r.definitionPath]:n}:i:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,o].join("/"),[r.definitionPath]:{...n,[o]:i}};return r.target==="jsonSchema7"?s.$schema="http://json-schema.org/draft-07/schema#":(r.target==="jsonSchema2019-09"||r.target==="openAi")&&(s.$schema="https://json-schema.org/draft/2019-09/schema#"),r.target==="openAi"&&("anyOf"in s||"oneOf"in s||"allOf"in s||"type"in s&&Array.isArray(s.type))&&console.warn("Warning: OpenAI may not support schemas with unions as roots! Try wrapping it in an object property."),s}});var APt=v(()=>{Ume();Jze();nL();Hme();Uw();Qze();e4e();t4e();Qme();r4e();o4e();i4e();a4e();s4e();u4e();l4e();the();nhe();f4e();p4e();m4e();h4e();ohe();g4e();y4e();b4e();_4e();v4e();w4e();S4e();C4e();x4e();O4e();T4e();E4e();dd();P4e()});function bO(t,e){let r=typeof t;if(r!==typeof e)return!1;if(Array.isArray(t)){if(!Array.isArray(e))return!1;let n=t.length;if(n!==e.length)return!1;for(let o=0;o{});function Cv(t){return encodeURI(Cmn(t))}function Cmn(t){return t.replace(/~/g,"~0").replace(/\//g,"~1")}var ihe=v(()=>{});function G0(t,e=Object.create(null),r=Emn,n=""){if(t&&typeof t=="object"&&!Array.isArray(t)){let i=t.$id||t.id;if(i){let a=new URL(i,r.href);a.hash.length>1?e[a.href]=t:(a.hash="",n===""?r=a:G0(t,e,r))}}else if(t!==!0&&t!==!1)return e;let o=r.href+(n?"#"+n:"");if(e[o]!==void 0)throw new Error(`Duplicate schema URI "${o}".`);if(e[o]=t,t===!0||t===!1)return e;if(t.__absolute_uri__===void 0&&Object.defineProperty(t,"__absolute_uri__",{enumerable:!1,value:o}),t.$ref&&t.__absolute_ref__===void 0){let i=new URL(t.$ref,r.href);i.hash=i.hash,Object.defineProperty(t,"__absolute_ref__",{enumerable:!1,value:i.href})}if(t.$recursiveRef&&t.__absolute_recursive_ref__===void 0){let i=new URL(t.$recursiveRef,r.href);i.hash=i.hash,Object.defineProperty(t,"__absolute_recursive_ref__",{enumerable:!1,value:i.href})}if(t.$anchor){let i=new URL("#"+t.$anchor,r.href);e[i.href]=t}for(let i in t){if(Tmn[i])continue;let a=`${n}/${Cv(i)}`,s=t[i];if(Array.isArray(s)){if(xmn[i]){let u=s.length;for(let l=0;l{ihe();xmn={prefixItems:!0,items:!0,allOf:!0,anyOf:!0,oneOf:!0},Omn={$defs:!0,definitions:!0,properties:!0,patternProperties:!0,dependentSchemas:!0},Tmn={id:!0,$id:!0,$ref:!0,$schema:!0,$anchor:!0,$vocabulary:!0,$comment:!0,default:!0,enum:!0,const:!0,required:!0,type:!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},Emn=typeof self<"u"&&self.location&&self.location.origin!=="null"?new URL(self.location.origin+self.location.pathname+location.search):new URL("https://github.com/cfworker")});function n_(t){return t.test.bind(t)}function Wmn(t){return t%4===0&&(t%100!==0||t%400===0)}function IPt(t){let e=t.match(Pmn);if(!e)return!1;let r=+e[1],n=+e[2],o=+e[3];return n>=1&&n<=12&&o>=1&&o<=(n==2&&Wmn(r)?29:Mmn[n])}function NPt(t,e){let r=e.match(Rmn);if(!r)return!1;let n=+r[1],o=+r[2],i=+r[3],a=!!r[5];return(n<=23&&o<=59&&i<=59||n==23&&o==59&&i==60)&&(!t||a)}function Zmn(t){let e=t.split(Gmn);return e.length==2&&IPt(e[0])&&NPt(!0,e[1])}function Qmn(t){return Xmn.test(t)&&Ymn.test(t)}function thn(t){if(ehn.test(t))return!1;try{return new RegExp(t,"u"),!0}catch{return!1}}var Pmn,Mmn,Rmn,Amn,Imn,Nmn,jmn,Dmn,$mn,Lmn,Fmn,kmn,qmn,Bmn,Umn,zmn,Hmn,Vmn,Jmn,Kmn,R4e,Gmn,Xmn,Ymn,ehn,A4e=v(()=>{Pmn=/^(\d\d\d\d)-(\d\d)-(\d\d)$/,Mmn=[0,31,28,31,30,31,30,31,31,30,31,30,31],Rmn=/^(\d\d):(\d\d):(\d\d)(\.\d+)?(z|[+-]\d\d(?::?\d\d)?)?$/i,Amn=/^(?=.{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,Imn=/^(?:[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,Nmn=/^(?:(?:[^\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,jmn=/^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!10(?:\.\d{1,3}){3})(?!127(?:\.\d{1,3}){3})(?!169\.254(?:\.\d{1,3}){2})(?!192\.168(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)(?:\.(?:[a-z\u{00a1}-\u{ffff}0-9]+-?)*[a-z\u{00a1}-\u{ffff}0-9]+)*(?:\.(?:[a-z\u{00a1}-\u{ffff}]{2,})))(?::\d{2,5})?(?:\/[^\s]*)?$/iu,Dmn=/^(?:urn:uuid:)?[0-9a-f]{8}-(?:[0-9a-f]{4}-){3}[0-9a-f]{12}$/i,$mn=/^(?:\/(?:[^~/]|~0|~1)*)*$/,Lmn=/^#(?:\/(?:[a-z0-9_\-.!$&'()*+,;:=@]|%[0-9a-f]{2}|~0|~1)*)*$/i,Fmn=/^(?:0|[1-9][0-9]*)(?:#|(?:\/(?:[^~/]|~0|~1)*)*)$/,kmn=/^\d\d\d\d-[0-1]\d-[0-3]\d$/,qmn=/^(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:z|[+-]\d\d(?::?\d\d)?)?$/i,Bmn=/^\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,Umn=/^(?:(?:[a-z][a-z0-9+-.]*:)?\/?\/)?(?:[^\\\s#][^\s#]*)?(?:#[^\\\s]*)?$/i,zmn=t=>{if(t[0]==='"')return!1;let[e,r,...n]=t.split("@");return!e||!r||n.length!==0||e.length>64||r.length>253||e[0]==="."||e.endsWith(".")||e.includes("..")||!/^[a-z0-9.-]+$/i.test(r)||!/^[a-z0-9.!#$%&'*+/=?^_`{|}~-]+$/i.test(e)?!1:r.split(".").every(o=>/^[a-z0-9]([a-z0-9-]{0,61}[a-z0-9])?$/i.test(o))},Hmn=/^(?:(?:25[0-5]|2[0-4]\d|[01]?\d\d?)\.){3}(?:25[0-5]|2[0-4]\d|[01]?\d\d?)$/,Vmn=/^((([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}))|:)))$/i,Jmn=t=>t.length>1&&t.length<80&&(/^P\d+([.,]\d+)?W$/.test(t)||/^P[\dYMDTHS]*(\d[.,]\d+)?[YMDHS]$/.test(t)&&/^P([.,\d]+Y)?([.,\d]+M)?([.,\d]+D)?(T([.,\d]+H)?([.,\d]+M)?([.,\d]+S)?)?$/.test(t));Kmn={date:IPt,time:NPt.bind(void 0,!1),"date-time":Zmn,duration:Jmn,uri:Qmn,"uri-reference":n_(Imn),"uri-template":n_(Nmn),url:n_(jmn),email:zmn,hostname:n_(Amn),ipv4:n_(Hmn),ipv6:n_(Vmn),regex:thn,uuid:n_(Dmn),"json-pointer":n_($mn),"json-pointer-uri-fragment":n_(Lmn),"relative-json-pointer":n_(Fmn)},R4e={...Kmn,date:n_(kmn),time:n_(qmn),"date-time":n_(Bmn),"uri-reference":n_(Umn)};Gmn=/t|\s/i;Xmn=/\/|:/,Ymn=/^(?:[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;ehn=/[^\\]\\Z/});var jPt,DPt=v(()=>{(function(t){t[t.Flag=1]="Flag",t[t.Basic=2]="Basic",t[t.Detailed=4]="Detailed"})(jPt||(jPt={}))});function $Pt(t){let e=0,r=t.length,n=0,o;for(;n=55296&&o<=56319&&n{});function Nu(t,e,r="2019-09",n=G0(e),o=!0,i=null,a="#",s="#",u=Object.create(null)){if(e===!0)return{valid:!0,errors:[]};if(e===!1)return{valid:!1,errors:[{instanceLocation:a,keyword:"false",keywordLocation:a,error:"False boolean schema."}]};let l=typeof t,c;switch(l){case"boolean":case"number":case"string":c=l;break;case"object":t===null?c="null":Array.isArray(t)?c="array":c="object";break;default:throw new Error(`Instances of "${l}" type are not supported.`)}let{$ref:d,$recursiveRef:f,$recursiveAnchor:p,type:m,const:h,enum:g,required:y,not:b,anyOf:_,allOf:w,oneOf:x,if:O,then:E,else:T,format:R,properties:I,patternProperties:j,additionalProperties:F,unevaluatedProperties:B,minProperties:U,maxProperties:J,propertyNames:G,dependentRequired:oe,dependentSchemas:ne,dependencies:z,prefixItems:ee,items:ie,additionalItems:Z,unevaluatedItems:$,contains:q,minContains:Y,maxContains:D,minItems:A,maxItems:V,uniqueItems:K,minimum:se,maximum:be,exclusiveMinimum:xe,exclusiveMaximum:Pe,multipleOf:pt,minLength:Ht,maxLength:Ze,pattern:Yr,__absolute_ref__:Vt,__absolute_recursive_ref__:gt}=e,Ie=[];if(p===!0&&i===null&&(i=e),f==="#"){let Ct=i===null?n[gt]:i,Fe=`${s}/$recursiveRef`,At=Nu(t,i===null?e:i,r,n,o,Ct,a,Fe,u);At.valid||Ie.push({instanceLocation:a,keyword:"$recursiveRef",keywordLocation:Fe,error:"A subschema had errors."},...At.errors)}if(d!==void 0){let Fe=n[Vt||d];if(Fe===void 0){let ze=`Unresolved $ref "${d}".`;throw Vt&&Vt!==d&&(ze+=` Absolute URI "${Vt}".`),ze+=` +Known schemas: +- ${Object.keys(n).join(` +- `)}`,new Error(ze)}let At=`${s}/$ref`,ke=Nu(t,Fe,r,n,o,i,a,At,u);if(ke.valid||Ie.push({instanceLocation:a,keyword:"$ref",keywordLocation:At,error:"A subschema had errors."},...ke.errors),r==="4"||r==="7")return{valid:Ie.length===0,errors:Ie}}if(Array.isArray(m)){let Ct=m.length,Fe=!1;for(let At=0;AtbO(t,Ct))||Ie.push({instanceLocation:a,keyword:"enum",keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`}):g.some(Ct=>t===Ct)||Ie.push({instanceLocation:a,keyword:"enum",keywordLocation:`${s}/enum`,error:`Instance does not match any of ${JSON.stringify(g)}.`})),b!==void 0){let Ct=`${s}/not`;Nu(t,b,r,n,o,i,a,Ct).valid&&Ie.push({instanceLocation:a,keyword:"not",keywordLocation:Ct,error:'Instance matched "not" schema.'})}let _n=[];if(_!==void 0){let Ct=`${s}/anyOf`,Fe=Ie.length,At=!1;for(let ke=0;ke<_.length;ke++){let ze=_[ke],$e=Object.create(u),Pt=Nu(t,ze,r,n,o,p===!0?i:null,a,`${Ct}/${ke}`,$e);Ie.push(...Pt.errors),At=At||Pt.valid,Pt.valid&&_n.push($e)}At?Ie.length=Fe:Ie.splice(Fe,0,{instanceLocation:a,keyword:"anyOf",keywordLocation:Ct,error:"Instance does not match any subschemas."})}if(w!==void 0){let Ct=`${s}/allOf`,Fe=Ie.length,At=!0;for(let ke=0;ke{let $e=Object.create(u),Pt=Nu(t,ke,r,n,o,p===!0?i:null,a,`${Ct}/${ze}`,$e);return Ie.push(...Pt.errors),Pt.valid&&_n.push($e),Pt.valid}).length;At===1?Ie.length=Fe:Ie.splice(Fe,0,{instanceLocation:a,keyword:"oneOf",keywordLocation:Ct,error:`Instance does not match exactly one subschema (${At} matches).`})}if((c==="object"||c==="array")&&Object.assign(u,..._n),O!==void 0){let Ct=`${s}/if`;if(Nu(t,O,r,n,o,i,a,Ct,u).valid){if(E!==void 0){let At=Nu(t,E,r,n,o,i,a,`${s}/then`,u);At.valid||Ie.push({instanceLocation:a,keyword:"if",keywordLocation:Ct,error:'Instance does not match "then" schema.'},...At.errors)}}else if(T!==void 0){let At=Nu(t,T,r,n,o,i,a,`${s}/else`,u);At.valid||Ie.push({instanceLocation:a,keyword:"if",keywordLocation:Ct,error:'Instance does not match "else" schema.'},...At.errors)}}if(c==="object"){if(y!==void 0)for(let ke of y)ke in t||Ie.push({instanceLocation:a,keyword:"required",keywordLocation:`${s}/required`,error:`Instance does not have required property "${ke}".`});let Ct=Object.keys(t);if(U!==void 0&&Ct.lengthJ&&Ie.push({instanceLocation:a,keyword:"maxProperties",keywordLocation:`${s}/maxProperties`,error:`Instance does not have at least ${J} properties.`}),G!==void 0){let ke=`${s}/propertyNames`;for(let ze in t){let $e=`${a}/${Cv(ze)}`,Pt=Nu(ze,G,r,n,o,i,$e,ke);Pt.valid||Ie.push({instanceLocation:a,keyword:"propertyNames",keywordLocation:ke,error:`Property name "${ze}" does not match schema.`},...Pt.errors)}}if(oe!==void 0){let ke=`${s}/dependantRequired`;for(let ze in oe)if(ze in t){let $e=oe[ze];for(let Pt of $e)Pt in t||Ie.push({instanceLocation:a,keyword:"dependentRequired",keywordLocation:ke,error:`Instance has "${ze}" but does not have "${Pt}".`})}}if(ne!==void 0)for(let ke in ne){let ze=`${s}/dependentSchemas`;if(ke in t){let $e=Nu(t,ne[ke],r,n,o,i,a,`${ze}/${Cv(ke)}`,u);$e.valid||Ie.push({instanceLocation:a,keyword:"dependentSchemas",keywordLocation:ze,error:`Instance has "${ke}" but does not match dependant schema.`},...$e.errors)}}if(z!==void 0){let ke=`${s}/dependencies`;for(let ze in z)if(ze in t){let $e=z[ze];if(Array.isArray($e))for(let Pt of $e)Pt in t||Ie.push({instanceLocation:a,keyword:"dependencies",keywordLocation:ke,error:`Instance has "${ze}" but does not have "${Pt}".`});else{let Pt=Nu(t,$e,r,n,o,i,a,`${ke}/${Cv(ze)}`);Pt.valid||Ie.push({instanceLocation:a,keyword:"dependencies",keywordLocation:ke,error:`Instance has "${ze}" but does not match dependant schema.`},...Pt.errors)}}}let Fe=Object.create(null),At=!1;if(I!==void 0){let ke=`${s}/properties`;for(let ze in I){if(!(ze in t))continue;let $e=`${a}/${Cv(ze)}`,Pt=Nu(t[ze],I[ze],r,n,o,i,$e,`${ke}/${Cv(ze)}`);if(Pt.valid)u[ze]=Fe[ze]=!0;else if(At=o,Ie.push({instanceLocation:a,keyword:"properties",keywordLocation:ke,error:`Property "${ze}" does not match schema.`},...Pt.errors),At)break}}if(!At&&j!==void 0){let ke=`${s}/patternProperties`;for(let ze in j){let $e=new RegExp(ze,"u"),Pt=j[ze];for(let To in t){if(!$e.test(To))continue;let Wl=`${a}/${Cv(To)}`,vn=Nu(t[To],Pt,r,n,o,i,Wl,`${ke}/${Cv(ze)}`);vn.valid?u[To]=Fe[To]=!0:(At=o,Ie.push({instanceLocation:a,keyword:"patternProperties",keywordLocation:ke,error:`Property "${To}" matches pattern "${ze}" but does not match associated schema.`},...vn.errors))}}}if(!At&&F!==void 0){let ke=`${s}/additionalProperties`;for(let ze in t){if(Fe[ze])continue;let $e=`${a}/${Cv(ze)}`,Pt=Nu(t[ze],F,r,n,o,i,$e,ke);Pt.valid?u[ze]=!0:(At=o,Ie.push({instanceLocation:a,keyword:"additionalProperties",keywordLocation:ke,error:`Property "${ze}" does not match additional properties schema.`},...Pt.errors))}}else if(!At&&B!==void 0){let ke=`${s}/unevaluatedProperties`;for(let ze in t)if(!u[ze]){let $e=`${a}/${Cv(ze)}`,Pt=Nu(t[ze],B,r,n,o,i,$e,ke);Pt.valid?u[ze]=!0:Ie.push({instanceLocation:a,keyword:"unevaluatedProperties",keywordLocation:ke,error:`Property "${ze}" does not match unevaluated properties schema.`},...Pt.errors)}}}else if(c==="array"){V!==void 0&&t.length>V&&Ie.push({instanceLocation:a,keyword:"maxItems",keywordLocation:`${s}/maxItems`,error:`Array has too many items (${t.length} > ${V}).`}),A!==void 0&&t.length=(Y||0)&&(Ie.length=ze),Y===void 0&&D===void 0&&$e===0?Ie.splice(ze,0,{instanceLocation:a,keyword:"contains",keywordLocation:ke,error:"Array does not contain item matching schema."}):Y!==void 0&&$eD&&Ie.push({instanceLocation:a,keyword:"maxContains",keywordLocation:`${s}/maxContains`,error:`Array may contain at most ${D} items matching schema. ${$e} items were found.`})}if(!At&&$!==void 0){let ke=`${s}/unevaluatedItems`;for(Fe;Fe=be||t>be)&&Ie.push({instanceLocation:a,keyword:"maximum",keywordLocation:`${s}/maximum`,error:`${t} is greater than ${Pe?"or equal to ":""} ${be}.`})):(se!==void 0&&tbe&&Ie.push({instanceLocation:a,keyword:"maximum",keywordLocation:`${s}/maximum`,error:`${t} is greater than ${be}.`}),xe!==void 0&&t<=xe&&Ie.push({instanceLocation:a,keyword:"exclusiveMinimum",keywordLocation:`${s}/exclusiveMinimum`,error:`${t} is less than ${xe}.`}),Pe!==void 0&&t>=Pe&&Ie.push({instanceLocation:a,keyword:"exclusiveMaximum",keywordLocation:`${s}/exclusiveMaximum`,error:`${t} is greater than or equal to ${Pe}.`})),pt!==void 0){let Ct=t%pt;Math.abs(0-Ct)>=11920929e-14&&Math.abs(pt-Ct)>=11920929e-14&&Ie.push({instanceLocation:a,keyword:"multipleOf",keywordLocation:`${s}/multipleOf`,error:`${t} is not a multiple of ${pt}.`})}}else if(c==="string"){let Ct=Ht===void 0&&Ze===void 0?0:$Pt(t);Ht!==void 0&&CtZe&&Ie.push({instanceLocation:a,keyword:"maxLength",keywordLocation:`${s}/maxLength`,error:`String is too long (${Ct} > ${Ze}).`}),Yr!==void 0&&!new RegExp(Yr,"u").test(t)&&Ie.push({instanceLocation:a,keyword:"pattern",keywordLocation:`${s}/pattern`,error:"String does not match pattern."}),R!==void 0&&R4e[R]&&!R4e[R](t)&&Ie.push({instanceLocation:a,keyword:"format",keywordLocation:`${s}/format`,error:`String does not match format "${R}".`})}return{valid:Ie.length===0,errors:Ie}}var N4e=v(()=>{M4e();ahe();A4e();ihe();I4e()});var she,LPt=v(()=>{ahe();N4e();she=class{constructor(e,r="2019-09",n=!0){M(this,"schema");M(this,"draft");M(this,"shortCircuit");M(this,"lookup");this.schema=e,this.draft=r,this.shortCircuit=n,this.lookup=G0(e)}validate(e){return Nu(e,this.schema,this.draft,this.lookup,this.shortCircuit)}addSchema(e,r){r&&(e={...e,$id:r}),G0(e,this.lookup)}}});var uhe=v(()=>{M4e();ahe();A4e();ihe();DPt();I4e();N4e();LPt()});function Hi(t){if(el(t)){let e=Q$(t,!0);if(Bw(e)){let r=g6(e,!0);return Y$(r)}else return Y$(t)}return Xl(t)?RPt(t):t}function T6(t){if(!t||typeof t!="object"||Object.keys(t).length===0||Array.isArray(t))return!1;if("type"in t)return typeof t.type=="string"?t.type==="string":Array.isArray(t.type)?t.type.every(e=>e==="string"):!1;if("enum"in t)return Array.isArray(t.enum)&&t.enum.length>0&&t.enum.every(e=>typeof e=="string");if("const"in t)return typeof t.const=="string";if("allOf"in t&&Array.isArray(t.allOf))return t.allOf.some(e=>T6(e));if("anyOf"in t&&Array.isArray(t.anyOf)||"oneOf"in t&&Array.isArray(t.oneOf)){let e="anyOf"in t?t.anyOf:t.oneOf;return e.length>0&&e.every(r=>T6(r))}if("not"in t)return!1;if("$ref"in t&&typeof t.$ref=="string"){let e=t.$ref,r=G0(t);return r[e]?T6(r[e]):!1}return!1}var rhn,o_=v(()=>{Do();mN();P4e();APt();ey();uhe();rhn={};Tt(rhn,{Validator:()=>she,deepCompareStrict:()=>bO,toJsonSchema:()=>Hi,validatesOnlyStrings:()=>T6})});function ohn(t,e){if(t!==void 0&&!e6(t))return t;if(zY(e))try{let r=e.getName();return r=r.startsWith("Runnable")?r.slice(8):r,r}catch{return e.getName()}else return e.name??"UnknownSchema"}function ihn(t){return zY(t.data)?{type:"runnable",data:{id:t.data.lc_id,name:t.data.getName()}}:{type:"schema",data:{...Hi(t.data.schema),title:t.data.name}}}function FPt(t,e=[]){let r=new Set(t.edges.filter(o=>!e.includes(o.source)).map(o=>o.target)),n=[];for(let o of Object.values(t.nodes))!e.includes(o.id)&&!r.has(o.id)&&n.push(o);return n.length===1?n[0]:void 0}function kPt(t,e=[]){let r=new Set(t.edges.filter(o=>!e.includes(o.target)).map(o=>o.source)),n=[];for(let o of Object.values(t.nodes))!e.includes(o.id)&&!r.has(o.id)&&n.push(o);return n.length===1?n[0]:void 0}var nhn,lhe,BPt=v(()=>{Do();Dqe();LEt();o_();SY();nhn={};Tt(nhn,{Graph:()=>lhe});lhe=class qPt{constructor(e){M(this,"nodes",{});M(this,"edges",[]);this.nodes=e?.nodes??this.nodes,this.edges=e?.edges??this.edges}toJSON(){let e={};return Object.values(this.nodes).forEach((r,n)=>{e[r.id]=e6(r.id)?n:r.id}),{nodes:Object.values(this.nodes).map(r=>({id:e[r.id],...ihn(r)})),edges:this.edges.map(r=>{let n={source:e[r.source],target:e[r.target]};return typeof r.data<"u"&&(n.data=r.data),typeof r.conditional<"u"&&(n.conditional=r.conditional),n})}}addNode(e,r,n){if(r!==void 0&&this.nodes[r]!==void 0)throw new Error(`Node with id ${r} already exists`);let o=r??Zb(),i={id:o,data:e,name:ohn(r,e),metadata:n};return this.nodes[o]=i,i}removeNode(e){delete this.nodes[e.id],this.edges=this.edges.filter(r=>r.source!==e.id&&r.target!==e.id)}addEdge(e,r,n,o){if(this.nodes[e.id]===void 0)throw new Error(`Source node ${e.id} not in graph`);if(this.nodes[r.id]===void 0)throw new Error(`Target node ${r.id} not in graph`);let i={source:e.id,target:r.id,data:n,conditional:o};return this.edges.push(i),i}firstNode(){return FPt(this)}lastNode(){return kPt(this)}extend(e,r=""){let n=r;Object.values(e.nodes).map(l=>l.id).every(e6)&&(n="");let i=l=>n?`${n}:${l}`:l;Object.entries(e.nodes).forEach(([l,c])=>{this.nodes[i(l)]={...c,id:i(l)}});let a=e.edges.map(l=>({...l,source:i(l.source),target:i(l.target)}));this.edges=[...this.edges,...a];let s=e.firstNode(),u=e.lastNode();return[s?{id:i(s.id),data:s.data}:void 0,u?{id:i(u.id),data:u.data}:void 0]}trimFirstNode(){let e=this.firstNode();e&&FPt(this,[e.id])&&this.removeNode(e)}trimLastNode(){let e=this.lastNode();e&&kPt(this,[e.id])&&this.removeNode(e)}reid(){let e=Object.fromEntries(Object.values(this.nodes).map(o=>[o.id,o.name])),r=new Map;Object.values(e).forEach(o=>{r.set(o,(r.get(o)||0)+1)});let n=o=>{let i=e[o];return e6(o)&&r.get(i)===1?i:o};return new qPt({nodes:Object.fromEntries(Object.entries(this.nodes).map(([o,i])=>[n(o),{...i,id:n(o)}])),edges:this.edges.map(o=>({...o,source:n(o.source),target:n(o.target)}))})}drawMermaid(e){let{withStyles:r,curveStyle:n,nodeColors:o={default:"fill:#f2f0ff,line-height:1.2",first:"fill-opacity:0",last:"fill:#bfb6fc"},wrapLabelNWords:i}=e??{},a=this.reid(),s=a.firstNode(),u=a.lastNode();return DEt(a.nodes,a.edges,{firstNode:s?.id,lastNode:u?.id,withStyles:r,curveStyle:n,nodeColors:o,wrapLabelNWords:i})}async drawMermaidPng(e){let r=this.drawMermaid(e);return $Et(r,{backgroundColor:e?.backgroundColor})}}});function UPt(t){let e=new TextEncoder,r=new ReadableStream({async start(n){for await(let o of t)n.enqueue(e.encode(`event: data +data: ${JSON.stringify(o)} + +`));n.enqueue(e.encode(`event: end + +`)),n.close()}});return Qy.fromReadableStream(r)}var zPt=v(()=>{cO()});function j4e(t){return typeof t=="object"&&t!==null&&typeof t[Symbol.iterator]=="function"&&typeof t.next=="function"}function che(t){return typeof t=="object"&&t!==null&&typeof t[Symbol.asyncIterator]=="function"}function*D4e(t,e){for(;;){let{value:r,done:n}=rh.runWithConfig(Yy(t),e.next.bind(e),!0);if(n)break;yield r}}async function*dhe(t,e){let r=e[Symbol.asyncIterator]();for(;;){let{value:n,done:o}=await rh.runWithConfig(Yy(t),r.next.bind(e),!0);if(o)break;yield n}}var HPt,VPt=v(()=>{QU();ez();uO();HPt=t=>t!=null&&typeof t=="object"&&"next"in t&&typeof t.next=="function"});function fd(t,e){return t&&!Array.isArray(t)&&!(t instanceof Date)&&typeof t=="object"?t:{[e]:t}}function shn(t){if(Npe(t))throw new Error("RunnableLambda requires a function that is not wrapped in traceable higher-order function. This shouldn't happen.")}function xv(t){if(typeof t=="function")return new i_({func:t});if(Lo.isRunnable(t))return t;if(!Array.isArray(t)&&typeof t=="object"){let e={};for(let[r,n]of Object.entries(t))e[r]=xv(n);return new uL({steps:e})}else throw new Error(`Expected a Runnable, function or object. +Instead got an unsupported type.`)}function uhn(t,e){let r=e.name??t.getName(),n=e.description??rL(e.schema);return y6(e.schema)?new fhe({name:r,description:n,schema:mt.object({input:mt.string()}).transform(o=>o.input),bound:t}):new fhe({name:r,description:n,schema:e.schema,bound:t})}var $4e,Lo,Jw,KPt,phe,Sl,uL,ahn,i_,YPt,L4e,NQ,F4e,fhe,Yh=v(()=>{F$();Afe();QU();ez();uO();kY();cO();vOt();OOt();nz();EOt();Dqe();mN();BPt();zPt();VPt();yO();$4e=L(ipe(),1);SY();yqe();Lo=class extends Wh{constructor(){super(...arguments);M(this,"lc_runnable",!0);M(this,"name")}getName(e){let r=this.name??this.constructor.lc_name()??this.constructor.name;return e?`${r}${e}`:r}withRetry(e){return new phe({bound:this,kwargs:{},config:{},maxAttemptNumber:e?.stopAfterAttempt,...e})}withConfig(e){return new Jw({bound:this,config:e,kwargs:{}})}withFallbacks(e){let r=Array.isArray(e)?e:e.fallbacks;return new L4e({runnable:this,fallbacks:r})}_getOptionsList(e,r=0){if(Array.isArray(e)&&e.length!==r)throw new Error(`Passed "options" must be an array with the same length as the inputs, but got ${e.length} options for ${r} inputs`);if(Array.isArray(e))return e.map(Jo);if(r>1&&!Array.isArray(e)&&e.runId){console.warn("Provided runId will be used only for the first element of the batch.");let n=Object.fromEntries(Object.entries(e).filter(([o])=>o!=="runId"));return Array.from({length:r},(o,i)=>Jo(i===0?e:n))}return Array.from({length:r},()=>Jo(e))}async batch(e,r,n){let o=this._getOptionsList(r??{},e.length),i=o[0]?.maxConcurrency??n?.maxConcurrency,a=new kw({maxConcurrency:i,onFailedAttempt:u=>{throw u}}),s=e.map((u,l)=>a.call(async()=>{try{return await this.invoke(u,o[l])}catch(c){if(n?.returnExceptions)return c;throw c}}));return Promise.all(s)}async*_streamIterator(e,r){yield this.invoke(e,r)}async stream(e,r){let n=Jo(r),o=new J$({generator:this._streamIterator(e,n),config:n});return await o.setup,Qy.fromAsyncGenerator(o)}_separateRunnableConfigFromCallOptions(e){let r;e===void 0?r=Jo(e):r=Jo({callbacks:e.callbacks,tags:e.tags,metadata:e.metadata,runName:e.runName,configurable:e.configurable,recursionLimit:e.recursionLimit,maxConcurrency:e.maxConcurrency,runId:e.runId,timeout:e.timeout,signal:e.signal});let n={...e};return delete n.callbacks,delete n.tags,delete n.metadata,delete n.runName,delete n.configurable,delete n.recursionLimit,delete n.maxConcurrency,delete n.runId,delete n.timeout,delete n.signal,[r,n]}async _callWithConfig(e,r,n){let o=Jo(n),a=await(await Qg(o))?.handleChainStart(this.toJSON(),fd(r,"input"),o.runId,o?.runType,void 0,void 0,o?.runName??this.getName());delete o.runId;let s;try{let u=e.call(this,r,o,a);s=await lO(u,n?.signal)}catch(u){throw await a?.handleChainError(u),u}return await a?.handleChainEnd(fd(s,"output")),s}async _batchWithConfig(e,r,n,o){let i=this._getOptionsList(n??{},r.length),a=await Promise.all(i.map(Qg)),s=await Promise.all(a.map(async(l,c)=>{let d=await l?.handleChainStart(this.toJSON(),fd(r[c],"input"),i[c].runId,i[c].runType,void 0,void 0,i[c].runName??this.getName());return delete i[c].runId,d})),u;try{let l=e.call(this,r,i,s,o);u=await lO(l,i?.[0]?.signal)}catch(l){throw await Promise.all(s.map(c=>c?.handleChainError(l))),l}return await Promise.all(s.map(l=>l?.handleChainEnd(fd(u,"output")))),u}_concatOutputChunks(e,r){return eb(e,r)}async*_transformStreamWithConfig(e,r,n){let o,i=!0,a,s=!0,u=Jo(n),l=await Qg(u),c=this;async function*d(){for await(let p of e){if(i)if(o===void 0)o=p;else try{o=c._concatOutputChunks(o,p)}catch{o=void 0,i=!1}yield p}}let f;try{let p=await Mqe(r.bind(this),d(),async()=>l?.handleChainStart(this.toJSON(),{input:""},u.runId,u.runType,void 0,void 0,u.runName??this.getName()),n?.signal,u);delete u.runId,f=p.setup;let m=f?.handlers.find(COt),h=p.output;m!==void 0&&f!==void 0&&(h=m.tapOutputIterable(f.runId,h));let g=f?.handlers.find(Nqe);g!==void 0&&f!==void 0&&(h=g.tapOutputIterable(f.runId,h));for await(let y of h)if(yield y,s)if(a===void 0)a=y;else try{a=this._concatOutputChunks(a,y)}catch{a=void 0,s=!1}}catch(p){throw await f?.handleChainError(p,void 0,void 0,void 0,{inputs:fd(o,"input")}),p}await f?.handleChainEnd(a??{},void 0,void 0,void 0,{inputs:fd(o,"input")})}getGraph(e){let r=new lhe,n=r.addNode({name:`${this.getName()}Input`,schema:mt.any()}),o=r.addNode(this),i=r.addNode({name:`${this.getName()}Output`,schema:mt.any()});return r.addEdge(n,o),r.addEdge(o,i),r}pipe(e){return new Sl({first:this,last:xv(e)})}pick(e){return this.pipe(new F4e(e))}assign(e){return this.pipe(new NQ(new uL({steps:e})))}async*transform(e,r){let n;for await(let o of e)n===void 0?n=o:n=this._concatOutputChunks(n,o);yield*this._streamIterator(n,Jo(r))}async*streamLog(e,r,n){let o=new Zpe({...n,autoClose:!1,_schemaFormat:"original"}),i=Jo(r);yield*this._streamLog(e,o,i)}async*_streamLog(e,r,n){let{callbacks:o}=n;if(o===void 0)n.callbacks=[r];else if(Array.isArray(o))n.callbacks=o.concat([r]);else{let u=o.copy();u.addHandler(r,!0),n.callbacks=u}let i=this.stream(e,n);async function a(){try{let u=await i;for await(let l of u){let c=new dO({ops:[{op:"add",path:"/streamed_output/-",value:l}]});await r.writer.write(c)}}finally{await r.writer.close()}}let s=a();try{for await(let u of r)yield u}finally{await s}}streamEvents(e,r,n){let o;if(r.version==="v1")o=this._streamEventsV1(e,r,n);else if(r.version==="v2")o=this._streamEventsV2(e,r,n);else throw new Error('Only versions "v1" and "v2" of the schema are currently supported.');return r.encoding==="text/event-stream"?UPt(o):Qy.fromAsyncGenerator(o)}async*_streamEventsV2(e,r,n){let o=new xOt({...n,autoClose:!1}),i=Jo(r),a=i.runId??Zb();i.runId=a;let s=i.callbacks;if(s===void 0)i.callbacks=[o];else if(Array.isArray(s))i.callbacks=s.concat(o);else{let m=s.copy();m.addHandler(o,!0),i.callbacks=m}let u=new AbortController,l=this;async function c(){let m,h=null;try{r?.signal?"any"in AbortSignal?m=AbortSignal.any([u.signal,r.signal]):(m=r.signal,h=()=>{u.abort()},r.signal.addEventListener("abort",h,{once:!0})):m=u.signal;let g=await l.stream(e,{...i,signal:m}),y=o.tapOutputIterable(a,g);for await(let b of y)if(u.signal.aborted)break}finally{await o.finish(),m&&h&&m.removeEventListener("abort",h)}}let d=c(),f=!1,p;try{for await(let m of o){if(!f){m.data.input=e,f=!0,p=m.run_id,yield m;continue}m.run_id===p&&m.event.endsWith("_end")&&m.data?.input&&delete m.data.input,yield m}}finally{u.abort(),await d}}async*_streamEventsV1(e,r,n){let o,i=!1,a=Jo(r),s=a.tags??[],u=a.metadata??{},l=a.runName??this.getName(),c=new Zpe({...n,autoClose:!1,_schemaFormat:"streaming_events"}),d=new POt({...n}),f=this._streamLog(e,c,a);for await(let m of f){if(o?o=o.concat(m):o=Gpe.fromRunLogPatch(m),o.state===void 0)throw new Error('Internal error: "streamEvents" state is missing. Please open a bug report.');if(!i){i=!0;let b={...o.state},_={run_id:b.id,event:`on_${b.type}_start`,name:l,tags:s,metadata:u,data:{input:e}};d.includeEvent(_,b.type)&&(yield _)}let h=m.ops.filter(b=>b.path.startsWith("/logs/")).map(b=>b.path.split("/")[2]),g=[...new Set(h)];for(let b of g){let _,w={},x=o.state.logs[b];if(x.end_time===void 0?x.streamed_output.length>0?_="stream":_="start":_="end",_==="start")x.inputs!==void 0&&(w.input=x.inputs);else if(_==="end")x.inputs!==void 0&&(w.input=x.inputs),w.output=x.final_output;else if(_==="stream"){let O=x.streamed_output.length;if(O!==1)throw new Error(`Expected exactly one chunk of streamed output, got ${O} instead. Encountered in: "${x.name}"`);w={chunk:x.streamed_output[0]},x.streamed_output=[]}yield{event:`on_${x.type}_${_}`,name:x.name,run_id:x.id,tags:x.tags,metadata:x.metadata,data:w}}let{state:y}=o;if(y.streamed_output.length>0){let b=y.streamed_output.length;if(b!==1)throw new Error(`Expected exactly one chunk of streamed output, got ${b} instead. Encountered in: "${y.name}"`);let _={chunk:y.streamed_output[0]};y.streamed_output=[];let w={event:`on_${y.type}_stream`,run_id:y.id,tags:s,metadata:u,name:l,data:_};d.includeEvent(w,y.type)&&(yield w)}}let p=o?.state;if(p!==void 0){let m={event:`on_${p.type}_end`,name:l,run_id:p.id,tags:s,metadata:u,data:{output:p.final_output}};d.includeEvent(m,p.type)&&(yield m)}}static isRunnable(e){return zY(e)}withListeners({onStart:e,onEnd:r,onError:n}){return new Jw({bound:this,config:{},configFactories:[o=>({callbacks:[new jqe({config:o,onStart:e,onEnd:r,onError:n})]})]})}asTool(e){return uhn(this,e)}},Jw=class JPt extends Lo{constructor(r){super(r);M(this,"lc_namespace",["langchain_core","runnables"]);M(this,"lc_serializable",!0);M(this,"bound");M(this,"config");M(this,"kwargs");M(this,"configFactories");this.bound=r.bound,this.kwargs=r.kwargs,this.config=r.config,this.configFactories=r.configFactories}static lc_name(){return"RunnableBinding"}getName(r){return this.bound.getName(r)}async _mergeConfig(...r){let n=tz(this.config,...r);return tz(n,...this.configFactories?await Promise.all(this.configFactories.map(async o=>await o(n))):[])}withConfig(r){return new this.constructor({bound:this.bound,kwargs:this.kwargs,config:{...this.config,...r}})}withRetry(r){return new phe({bound:this.bound,kwargs:this.kwargs,config:this.config,maxAttemptNumber:r?.stopAfterAttempt,...r})}async invoke(r,n){return this.bound.invoke(r,await this._mergeConfig(n,this.kwargs))}async batch(r,n,o){let i=Array.isArray(n)?await Promise.all(n.map(async a=>this._mergeConfig(Jo(a),this.kwargs))):await this._mergeConfig(Jo(n),this.kwargs);return this.bound.batch(r,i,o)}_concatOutputChunks(r,n){return this.bound._concatOutputChunks(r,n)}async*_streamIterator(r,n){yield*this.bound._streamIterator(r,await this._mergeConfig(Jo(n),this.kwargs))}async stream(r,n){return this.bound.stream(r,await this._mergeConfig(Jo(n),this.kwargs))}async*transform(r,n){yield*this.bound.transform(r,await this._mergeConfig(Jo(n),this.kwargs))}streamEvents(r,n,o){let i=this,a=async function*(){yield*i.bound.streamEvents(r,{...await i._mergeConfig(Jo(n),i.kwargs),version:n.version},o)};return Qy.fromAsyncGenerator(a())}static isRunnableBinding(r){return r.bound&&Lo.isRunnable(r.bound)}withListeners({onStart:r,onEnd:n,onError:o}){return new JPt({bound:this.bound,kwargs:this.kwargs,config:this.config,configFactories:[i=>({callbacks:[new jqe({config:i,onStart:r,onEnd:n,onError:o})]})]})}},KPt=class WPt extends Lo{constructor(r){super(r);M(this,"lc_serializable",!0);M(this,"lc_namespace",["langchain_core","runnables"]);M(this,"bound");this.bound=r.bound}static lc_name(){return"RunnableEach"}async invoke(r,n){return this._callWithConfig(this._invoke.bind(this),r,n)}async _invoke(r,n,o){return this.bound.batch(r,Bs(n,{callbacks:o?.getChild()}))}withListeners({onStart:r,onEnd:n,onError:o}){return new WPt({bound:this.bound.withListeners({onStart:r,onEnd:n,onError:o})})}},phe=class extends Jw{constructor(e){super(e);M(this,"lc_namespace",["langchain_core","runnables"]);M(this,"maxAttemptNumber",3);M(this,"onFailedAttempt",()=>{});this.maxAttemptNumber=e.maxAttemptNumber??this.maxAttemptNumber,this.onFailedAttempt=e.onFailedAttempt??this.onFailedAttempt}static lc_name(){return"RunnableRetry"}_patchConfigForRetry(e,r,n){let o=e>1?`retry:attempt:${e}`:void 0;return Bs(r,{callbacks:n?.getChild(o)})}async _invoke(e,r,n){return(0,$4e.default)(o=>super.invoke(e,this._patchConfigForRetry(o,r,n)),{onFailedAttempt:o=>this.onFailedAttempt(o,e),retries:Math.max(this.maxAttemptNumber-1,0),randomize:!0})}async invoke(e,r){return this._callWithConfig(this._invoke.bind(this),e,r)}async _batch(e,r,n,o){let i={};try{await(0,$4e.default)(async a=>{let s=e.map((f,p)=>p).filter(f=>i[f.toString()]===void 0||i[f.toString()]instanceof Error),u=s.map(f=>e[f]),l=s.map(f=>this._patchConfigForRetry(a,r?.[f],n?.[f])),c=await super.batch(u,l,{...o,returnExceptions:!0}),d;for(let f=0;fthis.onFailedAttempt(a,a.input),retries:Math.max(this.maxAttemptNumber-1,0),randomize:!0})}catch(a){if(o?.returnExceptions!==!0)throw a}return Object.keys(i).sort((a,s)=>parseInt(a,10)-parseInt(s,10)).map(a=>i[parseInt(a,10)])}async batch(e,r,n){return this._batchWithConfig(this._batch.bind(this),e,r,n)}},Sl=class IQ extends Lo{constructor(r){super(r);M(this,"first");M(this,"middle",[]);M(this,"last");M(this,"omitSequenceTags",!1);M(this,"lc_serializable",!0);M(this,"lc_namespace",["langchain_core","runnables"]);this.first=r.first,this.middle=r.middle??this.middle,this.last=r.last,this.name=r.name,this.omitSequenceTags=r.omitSequenceTags??this.omitSequenceTags}static lc_name(){return"RunnableSequence"}get steps(){return[this.first,...this.middle,this.last]}async invoke(r,n){let o=Jo(n),a=await(await Qg(o))?.handleChainStart(this.toJSON(),fd(r,"input"),o.runId,void 0,void 0,void 0,o?.runName);delete o.runId;let s=r,u;try{let l=[this.first,...this.middle];for(let c=0;c{let d=await l?.handleChainStart(this.toJSON(),fd(r[c],"input"),i[c].runId,void 0,void 0,void 0,i[c].runName);return delete i[c].runId,d})),u=r;try{for(let l=0;l{let m=f?.getChild(this.omitSequenceTags?void 0:`seq:step:${l+1}`);return Bs(i[p],{callbacks:m})}),o);u=await lO(d,i[0]?.signal)}}catch(l){throw await Promise.all(s.map(c=>c?.handleChainError(l))),l}return await Promise.all(s.map(l=>l?.handleChainEnd(fd(u,"output")))),u}_concatOutputChunks(r,n){return this.last._concatOutputChunks(r,n)}async*_streamIterator(r,n){let o=await Qg(n),{runId:i,...a}=n??{},s=await o?.handleChainStart(this.toJSON(),fd(r,"input"),i,void 0,void 0,void 0,a?.runName),u=[this.first,...this.middle,this.last],l=!0,c;async function*d(){yield r}try{let f=u[0].transform(d(),Bs(a,{callbacks:s?.getChild(this.omitSequenceTags?void 0:"seq:step:1")}));for(let p=1;p{let s=i.getGraph(r);a!==0&&s.trimFirstNode(),a!==this.steps.length-1&&s.trimLastNode(),n.extend(s);let u=s.firstNode();if(!u)throw new Error(`Runnable ${i} has no first node`);o&&n.addEdge(o,u),o=s.lastNode()}),n}pipe(r){return IQ.isRunnableSequence(r)?new IQ({first:this.first,middle:this.middle.concat([this.last,r.first,...r.middle]),last:r.last,name:this.name??r.name}):new IQ({first:this.first,middle:[...this.middle,this.last],last:xv(r),name:this.name})}static isRunnableSequence(r){return Array.isArray(r.middle)&&Lo.isRunnable(r)}static from([r,...n],o){let i={};return typeof o=="string"?i.name=o:o!==void 0&&(i=o),new IQ({...i,first:xv(r),middle:n.slice(0,-1).map(xv),last:xv(n[n.length-1])})}},uL=class GPt extends Lo{constructor(r){super(r);M(this,"lc_namespace",["langchain_core","runnables"]);M(this,"lc_serializable",!0);M(this,"steps");this.steps={};for(let[n,o]of Object.entries(r.steps))this.steps[n]=xv(o)}static lc_name(){return"RunnableMap"}getStepsKeys(){return Object.keys(this.steps)}static from(r){return new GPt({steps:r})}async invoke(r,n){let o=Jo(n),a=await(await Qg(o))?.handleChainStart(this.toJSON(),{input:r},o.runId,void 0,void 0,void 0,o?.runName);delete o.runId;let s={};try{let u=Object.entries(this.steps).map(async([l,c])=>{s[l]=await c.invoke(r,Bs(o,{callbacks:a?.getChild(`map:key:${l}`)}))});await lO(Promise.all(u),n?.signal)}catch(u){throw await a?.handleChainError(u),u}return await a?.handleChainEnd(s),s}async*_transform(r,n,o){let i={...this.steps},a=kpe(r,Object.keys(i).length),s=new Map(Object.entries(i).map(([u,l],c)=>{let d=l.transform(a[c],Bs(o,{callbacks:n?.getChild(`map:key:${u}`)}));return[u,d.next().then(f=>({key:u,gen:d,result:f}))]}));for(;s.size;){let u=Promise.race(s.values()),{key:l,result:c,gen:d}=await lO(u,o?.signal);s.delete(l),c.done||(yield{[l]:c.value},s.set(l,d.next().then(f=>({key:l,gen:d,result:f}))))}}transform(r,n){return this._transformStreamWithConfig(r,this._transform.bind(this),n)}async stream(r,n){async function*o(){yield r}let i=Jo(n),a=new J$({generator:this.transform(o(),i),config:i});return await a.setup,Qy.fromAsyncGenerator(a)}},ahn=class ZPt extends Lo{constructor(r){super(r);M(this,"lc_serializable",!1);M(this,"lc_namespace",["langchain_core","runnables"]);M(this,"func");if(!Npe(r.func))throw new Error("RunnableTraceable requires a function that is wrapped in traceable higher-order function");this.func=r.func}async invoke(r,n){let[o]=this._getOptionsList(n??{},1),i=await Qg(o),a=this.func(Bs(o,{callbacks:i}),r);return lO(a,o?.signal)}async*_streamIterator(r,n){let[o]=this._getOptionsList(n??{},1),i=await this.invoke(r,n);if(che(i)){for await(let a of i)o?.signal?.throwIfAborted(),yield a;return}if(HPt(i)){for(;;){o?.signal?.throwIfAborted();let a=i.next();if(a.done)break;yield a.value}return}yield i}static from(r){return new ZPt({func:r})}};i_=class XPt extends Lo{constructor(r){if(Npe(r.func))return ahn.from(r.func);super(r);M(this,"lc_namespace",["langchain_core","runnables"]);M(this,"func");shn(r.func),this.func=r.func}static lc_name(){return"RunnableLambda"}static from(r){return new XPt({func:r})}async _invoke(r,n,o){return new Promise((i,a)=>{let s=Bs(n,{callbacks:o?.getChild(),recursionLimit:(n?.recursionLimit??Fpe)-1});rh.runWithConfig(Yy(s),async()=>{try{let u=await this.func(r,{...s});if(u&&Lo.isRunnable(u)){if(n?.recursionLimit===0)throw new Error("Recursion limit reached.");u=await u.invoke(r,{...s,recursionLimit:(s.recursionLimit??Fpe)-1})}else if(che(u)){let l;for await(let c of dhe(s,u))if(n?.signal?.throwIfAborted(),l===void 0)l=c;else try{l=this._concatOutputChunks(l,c)}catch{l=c}u=l}else if(j4e(u)){let l;for(let c of D4e(s,u))if(n?.signal?.throwIfAborted(),l===void 0)l=c;else try{l=this._concatOutputChunks(l,c)}catch{l=c}u=l}i(u)}catch(u){a(u)}})})}async invoke(r,n){return this._callWithConfig(this._invoke.bind(this),r,n)}async*_transform(r,n,o){let i;for await(let u of r)if(i===void 0)i=u;else try{i=this._concatOutputChunks(i,u)}catch{i=u}let a=Bs(o,{callbacks:n?.getChild(),recursionLimit:(o?.recursionLimit??Fpe)-1}),s=await new Promise((u,l)=>{rh.runWithConfig(Yy(a),async()=>{try{let c=await this.func(i,{...a,config:a});u(c)}catch(c){l(c)}})});if(s&&Lo.isRunnable(s)){if(o?.recursionLimit===0)throw new Error("Recursion limit reached.");let u=await s.stream(i,a);for await(let l of u)yield l}else if(che(s))for await(let u of dhe(a,s))o?.signal?.throwIfAborted(),yield u;else if(j4e(s))for(let u of D4e(a,s))o?.signal?.throwIfAborted(),yield u;else yield s}transform(r,n){return this._transformStreamWithConfig(r,this._transform.bind(this),n)}async stream(r,n){async function*o(){yield r}let i=Jo(n),a=new J$({generator:this.transform(o(),i),config:i});return await a.setup,Qy.fromAsyncGenerator(a)}},YPt=class extends uL{},L4e=class extends Lo{constructor(e){super(e);M(this,"lc_namespace",["langchain_core","runnables"]);M(this,"lc_serializable",!0);M(this,"runnable");M(this,"fallbacks");this.runnable=e.runnable,this.fallbacks=e.fallbacks}static lc_name(){return"RunnableWithFallbacks"}*runnables(){yield this.runnable;for(let e of this.fallbacks)yield e}async invoke(e,r){let n=Jo(r),o=await Qg(n),{runId:i,...a}=n,s=await o?.handleChainStart(this.toJSON(),fd(e,"input"),i,void 0,void 0,void 0,a?.runName),u=Bs(a,{callbacks:s?.getChild()});return await rh.runWithConfig(u,async()=>{let c;for(let d of this.runnables()){n?.signal?.throwIfAborted();try{let f=await d.invoke(e,u);return await s?.handleChainEnd(fd(f,"output")),f}catch(f){c===void 0&&(c=f)}}throw c===void 0?new Error("No error stored at end of fallback."):(await s?.handleChainError(c),c)})}async*_streamIterator(e,r){let n=Jo(r),o=await Qg(n),{runId:i,...a}=n,s=await o?.handleChainStart(this.toJSON(),fd(e,"input"),i,void 0,void 0,void 0,a?.runName),u,l;for(let d of this.runnables()){n?.signal?.throwIfAborted();let f=Bs(a,{callbacks:s?.getChild()});try{let p=await d.stream(e,f);l=dhe(f,p);break}catch(p){u===void 0&&(u=p)}}if(l===void 0){let d=u??new Error("No error stored at end of fallback.");throw await s?.handleChainError(d),d}let c;try{for await(let d of l){yield d;try{c=c===void 0?c:this._concatOutputChunks(c,d)}catch{c=void 0}}}catch(d){throw await s?.handleChainError(d),d}await s?.handleChainEnd(fd(c,"output"))}async batch(e,r,n){if(n?.returnExceptions)throw new Error("Not implemented.");let o=this._getOptionsList(r??{},e.length),i=await Promise.all(o.map(u=>Qg(u))),a=await Promise.all(i.map(async(u,l)=>{let c=await u?.handleChainStart(this.toJSON(),fd(e[l],"input"),o[l].runId,void 0,void 0,void 0,o[l].runName);return delete o[l].runId,c})),s;for(let u of this.runnables()){o[0].signal?.throwIfAborted();try{let l=await u.batch(e,a.map((c,d)=>Bs(o[d],{callbacks:c?.getChild()})),n);return await Promise.all(a.map((c,d)=>c?.handleChainEnd(fd(l[d],"output")))),l}catch(l){s===void 0&&(s=l)}}throw s?(await Promise.all(a.map(u=>u?.handleChainError(s))),s):new Error("No error stored at end of fallbacks.")}};NQ=class extends Lo{constructor(e){e instanceof uL&&(e={mapper:e});super(e);M(this,"lc_namespace",["langchain_core","runnables"]);M(this,"lc_serializable",!0);M(this,"mapper");this.mapper=e.mapper}static lc_name(){return"RunnableAssign"}async invoke(e,r){let n=await this.mapper.invoke(e,r);return{...e,...n}}async*_transform(e,r,n){let o=this.mapper.getStepsKeys(),[i,a]=kpe(e),s=this.mapper.transform(a,Bs(n,{callbacks:r?.getChild()})),u=s.next();for await(let l of i){if(typeof l!="object"||Array.isArray(l))throw new Error(`RunnableAssign can only be used with objects as input, got ${typeof l}`);let c=Object.fromEntries(Object.entries(l).filter(([d])=>!o.includes(d)));Object.keys(c).length>0&&(yield c)}yield(await u).value;for await(let l of s)yield l}transform(e,r){return this._transformStreamWithConfig(e,this._transform.bind(this),r)}async stream(e,r){async function*n(){yield e}let o=Jo(r),i=new J$({generator:this.transform(n(),o),config:o});return await i.setup,Qy.fromAsyncGenerator(i)}},F4e=class extends Lo{constructor(e){(typeof e=="string"||Array.isArray(e))&&(e={keys:e});super(e);M(this,"lc_namespace",["langchain_core","runnables"]);M(this,"lc_serializable",!0);M(this,"keys");this.keys=e.keys}static lc_name(){return"RunnablePick"}async _pick(e){if(typeof this.keys=="string")return e[this.keys];{let r=this.keys.map(n=>[n,e[n]]).filter(n=>n[1]!==void 0);return r.length===0?void 0:Object.fromEntries(r)}}async invoke(e,r){return this._callWithConfig(this._pick.bind(this),e,r)}async*_transform(e){for await(let r of e){let n=await this._pick(r);n!==void 0&&(yield n)}}transform(e,r){return this._transformStreamWithConfig(e,this._transform.bind(this),r)}async stream(e,r){async function*n(){yield e}let o=Jo(r),i=new J$({generator:this.transform(n(),o),config:o});return await i.setup,Qy.fromAsyncGenerator(i)}},fhe=class extends Jw{constructor(e){let r=Sl.from([i_.from(async n=>{let o;if(k$(n))try{o=await tL(this.schema,n.args)}catch{throw new G3("Received tool input did not match expected schema",JSON.stringify(n.args))}else o=n;return o}).withConfig({runName:`${e.name}:parse_input`}),e.bound]).withConfig({runName:e.name});super({bound:r,config:e.config??{}});M(this,"name");M(this,"description");M(this,"schema");this.name=e.name,this.description=e.description,this.schema=e.schema}static lc_name(){return"RunnableToolLike"}}});var wu,mhe=v(()=>{uO();cO();Yh();wu=class extends Lo{constructor(e){super(e);M(this,"lc_namespace",["langchain_core","runnables"]);M(this,"lc_serializable",!0);M(this,"func");e&&(this.func=e.func)}static lc_name(){return"RunnablePassthrough"}async invoke(e,r){let n=Jo(r);return this.func&&await this.func(e,n),this._callWithConfig(o=>Promise.resolve(o),e,n)}async*transform(e,r){let n=Jo(r),o,i=!0;for await(let a of this._transformStreamWithConfig(e,s=>s,n))if(yield a,i)if(o===void 0)o=a;else try{o=eb(o,a)}catch{o=void 0,i=!1}this.func&&o!==void 0&&await this.func(o,n)}static assign(e){return new NQ(new uL({steps:e}))}}});var QPt,eMt=v(()=>{uO();Yh();QPt=class extends Lo{constructor(e){super(e);M(this,"lc_namespace",["langchain_core","runnables"]);M(this,"lc_serializable",!0);M(this,"runnables");this.runnables=e.runnables}static lc_name(){return"RouterRunnable"}async invoke(e,r){let{key:n,input:o}=e,i=this.runnables[n];if(i===void 0)throw new Error(`No runnable associated with key "${n}".`);return i.invoke(o,Jo(r))}async batch(e,r,n){let o=e.map(f=>f.key),i=e.map(f=>f.input);if(o.find(f=>this.runnables[f]===void 0)!==void 0)throw new Error("One or more keys do not have a corresponding runnable.");let s=o.map(f=>this.runnables[f]),u=this._getOptionsList(r??{},e.length),l=u[0]?.maxConcurrency??n?.maxConcurrency,c=l&&l>0?l:e.length,d=[];for(let f=0;fs[g].invoke(h,u[g])),m=await Promise.all(p);d.push(m)}return d.flat()}async stream(e,r){let{key:n,input:o}=e,i=this.runnables[n];if(i===void 0)throw new Error(`No runnable associated with key "${n}".`);return i.stream(o,r)}}});var tMt,rMt=v(()=>{uO();cO();Yh();tMt=class extends Lo{constructor(e){super(e);M(this,"lc_namespace",["langchain_core","runnables"]);M(this,"lc_serializable",!0);M(this,"default");M(this,"branches");this.branches=e.branches,this.default=e.default}static lc_name(){return"RunnableBranch"}static from(e){if(e.length<1)throw new Error("RunnableBranch requires at least one branch");let n=e.slice(0,-1).map(([i,a])=>[xv(i),xv(a)]),o=xv(e[e.length-1]);return new this({branches:n,default:o})}async _invoke(e,r,n){let o;for(let i=0;inMt(r,t))}function nMt(t,e={}){let{includeNames:r,excludeNames:n,includeTypes:o,excludeTypes:i,includeIds:a,excludeIds:s}=e,u=[];for(let l of t)if(!(n&&l.name&&n.includes(l.name))){{if(i&&hhe(l,i))continue;if(s&&l.id&&s.includes(l.id))continue}o||a||r?(r&&l.name&&r.some(c=>c===l.name)||o&&hhe(l,o)||a&&l.id&&a.some(c=>c===l.id))&&u.push(l):u.push(l)}return u}function uMt(t){return Array.isArray(t)?oMt(t):i_.from(oMt)}function oMt(t){if(!t.length)return[];let e=[];for(let r of t){let n=r,o=e.pop();if(!o)e.push(n);else if(n.getType()==="tool"||n.getType()!==o.getType())e.push(o,n);else{let i=VU(o),a=VU(n),s=i.concat(a);typeof i.content=="string"&&typeof a.content=="string"&&(s.content=`${i.content} +${a.content}`),e.push(chn(s))}}return e}function lMt(t,e){if(Array.isArray(t)){let r=t;if(!e)throw new Error("Options parameter is required when providing messages.");return iMt(r,e)}else{let r=t;return i_.from(n=>iMt(n,r)).withConfig({runName:"trim_messages"})}}async function iMt(t,e){let{maxTokens:r,tokenCounter:n,strategy:o="last",allowPartial:i=!1,endOn:a,startOn:s,includeSystem:u=!1,textSplitter:l}=e;if(s&&o==="first")throw new Error("`startOn` should only be specified if `strategy` is 'last'.");if(u&&o==="first")throw new Error("`includeSystem` should only be specified if `strategy` is 'last'.");let c;"getNumTokens"in n?c=async f=>(await Promise.all(f.map(m=>n.getNumTokens(m.content)))).reduce((m,h)=>m+h,0):c=async f=>n(f);let d=q4e;if(l&&("splitText"in l?d=l.splitText:d=async f=>l(f)),o==="first")return cMt(t,{maxTokens:r,tokenCounter:c,textSplitter:d,partialStrategy:i?"first":void 0,endOn:a});if(o==="last")return lhn(t,{maxTokens:r,tokenCounter:c,textSplitter:d,allowPartial:i,includeSystem:u,startOn:s,endOn:a});throw new Error(`Unrecognized strategy: '${o}'. Must be one of 'first' or 'last'.`)}async function cMt(t,e){let{maxTokens:r,tokenCounter:n,textSplitter:o,partialStrategy:i,endOn:a}=e,s=[...t],u=0;for(let l=0;l0?s.slice(0,-l):s;if(await n(c)<=r){u=s.length-l;break}}if(ub!=="type"&&!b.startsWith("lc_"))),g=k4e(c.getType(),{...h,content:m}),y=[...s.slice(0,u),g];if(await n(y)<=r)s=y,u+=1,l=!0;else break}l&&i==="last"&&(c.content=[...f].reverse())}if(!l){let c=s[u],d;if(Array.isArray(c.content)&&c.content.some(f=>typeof f=="string"||f.type==="text")?d=c.content.find(p=>p.type==="text"&&p.text)?.text:typeof c.content=="string"&&(d=c.content),d){let f=await o(d),p=f.length;i==="last"&&f.reverse();for(let m=0;m0&&!hhe(s[u-1],l);)u-=1}return s.slice(0,u)}async function lhn(t,e){let{allowPartial:r=!1,includeSystem:n=!1,endOn:o,startOn:i,...a}=e,s=t.map(c=>{let d=Object.fromEntries(Object.entries(c).filter(([f])=>f!=="type"&&!f.startsWith("lc_")));return k4e(c.getType(),d,Y3(c))});if(o){let c=Array.isArray(o)?o:[o];for(;s.length>0&&!hhe(s[s.length-1],c);)s=s.slice(0,-1)}let u=n&&s[0]?.getType()==="system",l=u?s.slice(0,1).concat(s.slice(1).reverse()):s.reverse();return l=await cMt(l,{...a,partialStrategy:r?"last":void 0,endOn:i}),u?[l[0],...l.slice(1).reverse()]:l.reverse()}function k4e(t,e,r){let n,o;switch(t){case"human":r?n=new vv(e):o=new au(e);break;case"ai":if(r){let i={...e};"tool_calls"in i&&(i={...i,tool_call_chunks:i.tool_calls?.map(a=>({...a,type:"tool_call_chunk",index:void 0,args:JSON.stringify(a.args)}))}),n=new Nr(i)}else o=new li(e);break;case"system":r?n=new Ky(e):o=new th(e);break;case"developer":r?n=new Ky({...e,additional_kwargs:{...e.additional_kwargs,__openai_role__:"developer"}}):o=new th({...e,additional_kwargs:{...e.additional_kwargs,__openai_role__:"developer"}});break;case"tool":if("tool_call_id"in e)r?n=new Iw(e):o=new Gb(e);else throw new Error("Can not convert ToolMessage to ToolMessageChunk if 'tool_call_id' field is not defined.");break;case"function":if(r)n=new _v(e);else{if(!e.name)throw new Error("FunctionMessage must have a 'name' field");o=new zU(e)}break;case"generic":if("role"in e)r?n=new bv(e):o=new ud(e);else throw new Error("Can not convert ChatMessage to ChatMessageChunk if 'role' field is not defined.");break;default:throw new Error(`Unrecognized message type ${t}`)}if(r&&n)return n;if(o)return o;throw new Error(`Unrecognized message type ${t}`)}function chn(t){let e=t.getType(),r,n=Object.fromEntries(Object.entries(t).filter(([o])=>!["type","tool_call_chunks"].includes(o)&&!o.startsWith("lc_")));if(e in aMt&&(r=k4e(e,n)),!r)throw new Error(`Unrecognized message chunk class ${e}. Supported classes are ${Object.keys(aMt)}`);return r}function q4e(t){let e=t.split(` +`);return Promise.resolve([...e.slice(0,-1).map(r=>`${r} +`),e[e.length-1]])}var hhe,aMt,dMt=v(()=>{Gg();Q3();z0();_Y();Ufe();U$();vY();zfe();iO();Yh();hhe=(t,e)=>{let r=[...new Set(e?.map(o=>{if(typeof o=="string")return o;let i=new o({});if(!("getType"in i)||typeof i.getType!="function")throw new Error("Invalid type provided.");return i.getType()}))],n=t.getType();return r.some(o=>o===n)};aMt={human:{message:au,messageChunk:vv},ai:{message:li,messageChunk:Nr},system:{message:th,messageChunk:Ky},developer:{message:th,messageChunk:Ky},tool:{message:Gb,messageChunk:Iw},function:{message:zU,messageChunk:_v},generic:{message:ud,messageChunk:bv},remove:{message:HU,messageChunk:HU}}});var fMt,pMt=v(()=>{fMt=["tool_call","tool_call_chunk","invalid_tool_call","server_tool_call","server_tool_call_chunk","server_tool_call_result"]});var mMt,hMt=v(()=>{mMt=["image","video","audio","text-plain","file"]});var gMt,yMt=v(()=>{pMt();hMt();gMt=["text","reasoning",...fMt,...mMt]});var dhn,js=v(()=>{Do();mY();BFe();Gg();JFe();Q3();z0();_Y();Ufe();U$();vY();zfe();iO();dMt();yMt();dhn={};Tt(dhn,{AIMessage:()=>li,AIMessageChunk:()=>Nr,BaseMessage:()=>Uc,BaseMessageChunk:()=>Wb,ChatMessage:()=>ud,ChatMessageChunk:()=>bv,FunctionMessage:()=>zU,FunctionMessageChunk:()=>_v,HumanMessage:()=>au,HumanMessageChunk:()=>vv,KNOWN_BLOCK_TYPES:()=>gMt,RemoveMessage:()=>HU,SystemMessage:()=>th,SystemMessageChunk:()=>Ky,ToolMessage:()=>Gb,ToolMessageChunk:()=>Iw,_isMessageFieldWithRole:()=>kfe,_mergeDicts:()=>_l,_mergeLists:()=>UU,_mergeObj:()=>Ffe,_mergeStatus:()=>Lfe,coerceMessageLikeToMessage:()=>Nw,convertToChunk:()=>VU,convertToOpenAIImageBlock:()=>Nfe,convertToProviderContentBlock:()=>oO,defaultTextSplitter:()=>q4e,defaultToolCallParser:()=>gY,filterMessages:()=>sMt,getBufferString:()=>Xu,iife:()=>sSt,isAIMessage:()=>qs,isAIMessageChunk:()=>bY,isBase64ContentBlock:()=>X3,isBaseMessage:()=>eh,isBaseMessageChunk:()=>Y3,isChatMessage:()=>Qwt,isChatMessageChunk:()=>eSt,isDataContentBlock:()=>Qm,isDirectToolOutput:()=>hY,isFunctionMessage:()=>tSt,isFunctionMessageChunk:()=>rSt,isHumanMessage:()=>nSt,isHumanMessageChunk:()=>oSt,isIDContentBlock:()=>Ife,isMessage:()=>$fe,isOpenAIToolCallArray:()=>qwt,isPlainTextContentBlock:()=>Mwt,isSystemMessage:()=>iSt,isSystemMessageChunk:()=>aSt,isToolMessage:()=>yY,isToolMessageChunk:()=>zFe,isURLContentBlock:()=>Z3,mapChatMessagesToStoredMessages:()=>lSt,mapStoredMessageToChatMessage:()=>wY,mapStoredMessagesToChatMessages:()=>uSt,mergeContent:()=>Kb,mergeMessageRuns:()=>uMt,mergeResponseMetadata:()=>qfe,mergeUsageMetadata:()=>Bfe,parseBase64DataUrl:()=>Wg,parseMimeType:()=>pY,trimMessages:()=>lMt})});var bMt,_Mt=v(()=>{Gg();z0();U$();Yh();js();mhe();bMt=class extends Jw{constructor(e){let r=i_.from((a,s)=>this._enterHistory(a,s??{})).withConfig({runName:"loadHistory"}),n=e.historyMessagesKey??e.inputMessagesKey;n&&(r=wu.assign({[n]:r}).withConfig({runName:"insertHistory"}));let o=r.pipe(e.runnable.withListeners({onEnd:(a,s)=>this._exitHistory(a,s??{})})).withConfig({runName:"RunnableWithMessageHistory"}),i=e.config??{};super({...e,config:i,bound:o});M(this,"runnable");M(this,"inputMessagesKey");M(this,"outputMessagesKey");M(this,"historyMessagesKey");M(this,"getMessageHistory");this.runnable=e.runnable,this.getMessageHistory=e.getMessageHistory,this.inputMessagesKey=e.inputMessagesKey,this.outputMessagesKey=e.outputMessagesKey,this.historyMessagesKey=e.historyMessagesKey}_getInputMessages(e){let r;if(typeof e=="object"&&!Array.isArray(e)&&!eh(e)){let n;this.inputMessagesKey?n=this.inputMessagesKey:Object.keys(e).length===1?n=Object.keys(e)[0]:n="input",Array.isArray(e[n])&&Array.isArray(e[n][0])?r=e[n][0]:r=e[n]}else r=e;if(typeof r=="string")return[new au(r)];if(Array.isArray(r))return r;if(eh(r))return[r];throw new Error(`Expected a string, BaseMessage, or array of BaseMessages. +Got ${JSON.stringify(r,null,2)}`)}_getOutputMessages(e){let r;if(!Array.isArray(e)&&!eh(e)&&typeof e!="string"){let n;this.outputMessagesKey!==void 0?n=this.outputMessagesKey:Object.keys(e).length===1?n=Object.keys(e)[0]:n="output",e.generations!==void 0?r=e.generations[0][0].message:r=e[n]}else r=e;if(typeof r=="string")return[new li(r)];if(Array.isArray(r))return r;if(eh(r))return[r];throw new Error(`Expected a string, BaseMessage, or array of BaseMessages. Received: ${JSON.stringify(r,null,2)}`)}async _enterHistory(e,r){let o=await(r?.configurable?.messageHistory).getMessages();return this.historyMessagesKey===void 0?o.concat(this._getInputMessages(e)):o}async _exitHistory(e,r){let n=r.configurable?.messageHistory,o;Array.isArray(e.inputs)&&Array.isArray(e.inputs[0])?o=e.inputs[0]:o=e.inputs;let i=this._getInputMessages(o);if(this.historyMessagesKey===void 0){let u=await n.getMessages();i=i.slice(u.length)}let a=e.outputs;if(!a)throw new Error(`Output values from 'Run' undefined. Run: ${JSON.stringify(e,null,2)}`);let s=this._getOutputMessages(a);await n.addMessages([...i,...s])}async _mergeConfig(...e){let r=await super._mergeConfig(...e);if(!r.configurable||!r.configurable.sessionId){let o={[this.inputMessagesKey??"input"]:"foo"},i={configurable:{sessionId:"123"}};throw new Error(`sessionId is required. Pass it in as part of the config argument to .invoke() or .stream() +eg. chain.invoke(${JSON.stringify(o)}, ${JSON.stringify(i)})`)}let{sessionId:n}=r.configurable;return r.configurable.messageHistory=await this.getMessageHistory(n),r}}});var fhn,Ov=v(()=>{Do();uO();Yh();mhe();eMt();rMt();_Mt();fhn={};Tt(fhn,{RouterRunnable:()=>QPt,Runnable:()=>Lo,RunnableAssign:()=>NQ,RunnableBinding:()=>Jw,RunnableBranch:()=>tMt,RunnableEach:()=>KPt,RunnableLambda:()=>i_,RunnableMap:()=>uL,RunnableParallel:()=>YPt,RunnablePassthrough:()=>wu,RunnablePick:()=>F4e,RunnableRetry:()=>phe,RunnableSequence:()=>Sl,RunnableToolLike:()=>fhe,RunnableWithFallbacks:()=>L4e,RunnableWithMessageHistory:()=>bMt,_coerceToRunnable:()=>xv,ensureConfig:()=>Jo,getCallbackManagerForConfig:()=>Qg,mergeConfigs:()=>tz,patchConfig:()=>Bs,pickRunnableConfigKeys:()=>Yy})});var Mz,_N,nh,E6=v(()=>{dY();Yh();Ov();Mz=class extends Lo{parseResultWithPrompt(t,e,r){return this.parseResult(t,r)}_baseMessageToString(t){return typeof t.content=="string"?t.content:this._baseMessageContentToString(t.content)}_baseMessageContentToString(t){return JSON.stringify(t)}async invoke(t,e){return typeof t=="string"?this._callWithConfig(async(r,n)=>this.parseResult([{text:r}],n?.callbacks),t,{...e,runType:"parser"}):this._callWithConfig(async(r,n)=>this.parseResult([{message:r,text:this._baseMessageToString(r)}],n?.callbacks),t,{...e,runType:"parser"})}},_N=class extends Mz{parseResult(t,e){return this.parse(t[0].text,e)}async parseWithPrompt(t,e,r){return this.parse(t,r)}_type(){throw new Error("_type not implemented")}},nh=class extends Error{constructor(e,r,n,o=!1){super(e);M(this,"llmOutput");M(this,"observation");M(this,"sendToLLM");if(this.llmOutput=r,this.observation=n,this.sendToLLM=o,o&&(n===void 0||r===void 0))throw new Error("Arguments 'observation' & 'llmOutput' are required if 'sendToLlm' is true");L$(this,"OUTPUT_PARSING_FAILURE")}}});var vN,lL,cL=v(()=>{Gg();iO();gm();E6();uhe();vN=class extends _N{async*_transform(t){for await(let e of t)typeof e=="string"?yield this.parseResult([{text:e}]):yield this.parseResult([{message:e,text:this._baseMessageToString(e)}])}async*transform(t,e){yield*this._transformStreamWithConfig(t,this._transform.bind(this),{...e,runType:"parser"})}},lL=class extends vN{constructor(e){super(e);M(this,"diff",!1);this.diff=e?.diff??this.diff}async*_transform(e){let r,n;for await(let o of e){if(typeof o!="string"&&typeof o.content!="string")throw new Error("Cannot handle non-string output.");let i;if(Y3(o)){if(typeof o.content!="string")throw new Error("Cannot handle non-string message output.");i=new Oi({message:o,text:o.content})}else if(eh(o)){if(typeof o.content!="string")throw new Error("Cannot handle non-string message output.");i=new Oi({message:VU(o),text:o.content})}else i=new Fw({text:o});n===void 0?n=i:n=n.concat(i);let a=await this.parsePartialResult([n]);a!=null&&!bO(a,r)&&(this.diff?yield this._diff(r,a):yield a,r=a)}}getFormatInstructions(){return""}}});var vMt,wMt=v(()=>{cL();vMt=class extends vN{constructor(){super(...arguments);M(this,"lc_namespace",["langchain_core","output_parsers","bytes"]);M(this,"lc_serializable",!0);M(this,"textEncoder",new TextEncoder)}static lc_name(){return"BytesOutputParser"}parse(e){return Promise.resolve(this.textEncoder.encode(e))}getFormatInstructions(){return""}}});var P6,SMt,CMt,xMt,OMt,TMt=v(()=>{E6();cL();P6=class extends vN{constructor(){super(...arguments);M(this,"re")}async*_transform(e){let r="";for await(let n of e)if(typeof n=="string"?r+=n:r+=n.content,this.re){let o=[...r.matchAll(this.re)];if(o.length>1){let i=0;for(let a of o.slice(0,-1))yield[a[1]],i+=(a.index??0)+a[0].length;r=r.slice(i)}}else{let o=await this.parse(r);if(o.length>1){for(let i of o.slice(0,-1))yield[i];r=o[o.length-1]}}for(let n of await this.parse(r))yield[n]}},SMt=class extends P6{constructor(){super(...arguments);M(this,"lc_namespace",["langchain_core","output_parsers","list"]);M(this,"lc_serializable",!0)}static lc_name(){return"CommaSeparatedListOutputParser"}async parse(e){try{return e.trim().split(",").map(r=>r.trim())}catch{throw new nh(`Could not parse output: ${e}`,e)}}getFormatInstructions(){return"Your response should be a list of comma separated values, eg: `foo, bar, baz`"}},CMt=class extends P6{constructor({length:e,separator:r}){super(...arguments);M(this,"lc_namespace",["langchain_core","output_parsers","list"]);M(this,"length");M(this,"separator");this.length=e,this.separator=r||","}async parse(e){try{let r=e.trim().split(this.separator).map(n=>n.trim());if(this.length!==void 0&&r.length!==this.length)throw new nh(`Incorrect number of items. Expected ${this.length}, got ${r.length}.`);return r}catch(r){throw Object.getPrototypeOf(r)===nh.prototype?r:new nh(`Could not parse output: ${e}`)}}getFormatInstructions(){return`Your response should be a list of ${this.length===void 0?"":`${this.length} `}items separated by "${this.separator}" (eg: \`foo${this.separator} bar${this.separator} baz\`)`}},xMt=class extends P6{constructor(){super(...arguments);M(this,"lc_namespace",["langchain_core","output_parsers","list"]);M(this,"lc_serializable",!0);M(this,"re",/\d+\.\s([^\n]+)/g)}static lc_name(){return"NumberedListOutputParser"}getFormatInstructions(){return`Your response should be a numbered list with each item on a new line. For example: + +1. foo + +2. bar + +3. baz`}async parse(e){return[...e.matchAll(this.re)??[]].map(r=>r[1])}},OMt=class extends P6{constructor(){super(...arguments);M(this,"lc_namespace",["langchain_core","output_parsers","list"]);M(this,"lc_serializable",!0);M(this,"re",/^\s*[-*]\s([^\n]+)$/gm)}static lc_name(){return"NumberedListOutputParser"}getFormatInstructions(){return`Your response should be a numbered list with each item on a new line. For example: + +1. foo + +2. bar + +3. baz`}async parse(e){return[...e.matchAll(this.re)??[]].map(r=>r[1])}}});var ghe,EMt=v(()=>{cL();ghe=class extends vN{constructor(){super(...arguments);M(this,"lc_namespace",["langchain_core","output_parsers","string"]);M(this,"lc_serializable",!0)}static lc_name(){return"StrOutputParser"}parse(e){return Promise.resolve(e)}getFormatInstructions(){return""}_textContentToString(e){return e.text}_imageUrlContentToString(e){throw new Error('Cannot coerce a multimodal "image_url" message part into a string.')}_messageContentToString(e){switch(e.type){case"text":case"text_delta":if("text"in e)return this._textContentToString(e);break;case"image_url":if("image_url"in e)return this._imageUrlContentToString(e);break;default:throw new Error(`Cannot coerce "${e.type}" message part into a string.`)}throw new Error(`Invalid content type: ${e.type}`)}_baseMessageContentToString(e){return e.reduce((r,n)=>r+this._messageContentToString(n),"")}}});var Kw,B4e,PMt,MMt=v(()=>{mN();o_();E6();yO();Kw=class extends _N{constructor(e){super(e);M(this,"lc_namespace",["langchain","output_parsers","structured"]);this.schema=e}static lc_name(){return"StructuredOutputParser"}toJSON(){return this.toJSONNotImplemented()}static fromZodSchema(e){return new this(e)}static fromNamesAndDescriptions(e){let r=mt.object(Object.fromEntries(Object.entries(e).map(([n,o])=>[n,mt.string().describe(o)])));return new this(r)}getFormatInstructions(){return`You must format your output as a JSON value that adheres to a given "JSON Schema" instance. + +"JSON Schema" is a declarative language that allows you to annotate and validate JSON documents. + +For example, the example "JSON Schema" instance {{"properties": {{"foo": {{"description": "a list of test words", "type": "array", "items": {{"type": "string"}}}}}}, "required": ["foo"]}} +would match an object with one required property, "foo". The "type" property specifies "foo" must be an "array", and the "description" property semantically describes it as "a list of test words". The items within "foo" must be strings. +Thus, the object {{"foo": ["bar", "baz"]}} is a well-formatted instance of this example "JSON Schema". The object {{"properties": {{"foo": ["bar", "baz"]}}}} is not well-formatted. + +Your output will be parsed and type-checked according to the provided schema instance, so make sure all fields in your output match the schema exactly and there are no trailing commas! + +Here is the JSON Schema instance your output must adhere to. Include the enclosing markdown codeblock: +\`\`\`json +${JSON.stringify(Hi(this.schema))} +\`\`\` +`}async parse(e){try{let r=e.trim(),o=(r.match(/^```(?:json)?\s*([\s\S]*?)```/)?.[1]||r.match(/```json\s*([\s\S]*?)```/)?.[1]||r).replace(/"([^"\\]*(\\.[^"\\]*)*)"/g,(i,a)=>`"${a.replace(/\n/g,"\\n")}"`).replace(/\n/g,"");return await tL(this.schema,JSON.parse(o))}catch(r){throw new nh(`Failed to parse. Text: "${e}". Error: ${r}`,e)}}},B4e=class extends Kw{static lc_name(){return"JsonMarkdownStructuredOutputParser"}getFormatInstructions(t){let e=t?.interpolationDepth??1;if(e<1)throw new Error("f string interpolation depth must be at least 1");return`Return a markdown code snippet with a JSON object formatted to look like: +\`\`\`json +${this._schemaToInstruction(Hi(this.schema)).replaceAll("{","{".repeat(e)).replaceAll("}","}".repeat(e))} +\`\`\``}_schemaToInstruction(t,e=2){let r=t;if("type"in r){let n=!1,o;if(Array.isArray(r.type)){let s=r.type.findIndex(u=>u==="null");s!==-1&&(n=!0,r.type.splice(s,1)),o=r.type.join(" | ")}else o=r.type;if(r.type==="object"&&r.properties){let s=r.description?` // ${r.description}`:"";return`{ +${Object.entries(r.properties).map(([l,c])=>{let d=r.required?.includes(l)?"":" (optional)";return`${" ".repeat(e)}"${l}": ${this._schemaToInstruction(c,e+2)}${d}`}).join(` +`)} +${" ".repeat(e-2)}}${s}`}if(r.type==="array"&&r.items){let s=r.description?` // ${r.description}`:"";return`array[ +${" ".repeat(e)}${this._schemaToInstruction(r.items,e+2)} +${" ".repeat(e-2)}] ${s}`}let i=n?" (nullable)":"",a=r.description?` // ${r.description}`:"";return`${o}${a}${i}`}if("anyOf"in r)return r.anyOf.map(n=>this._schemaToInstruction(n,e)).join(` +${" ".repeat(e-2)}`);throw new Error("unsupported schema type")}static fromZodSchema(t){return new this(t)}static fromNamesAndDescriptions(t){let e=mt.object(Object.fromEntries(Object.entries(t).map(([r,n])=>[r,mt.string().describe(n)])));return new this(e)}},PMt=class extends _N{constructor({inputSchema:e}){super(...arguments);M(this,"structuredInputParser");this.structuredInputParser=new B4e(e)}async parse(e){let r;try{r=await this.structuredInputParser.parse(e)}catch(n){throw new nh(`Failed to parse. Text: "${e}". Error: ${n}`,e)}return this.outputProcessor(r)}getFormatInstructions(){return this.structuredInputParser.getFormatInstructions()}}});var phn,U4e=v(()=>{Do();BY();UY();Aqe();phn={};Tt(phn,{applyPatch:()=>K$,compare:()=>i6})});var Tv,z4e=v(()=>{cY();UY();cL();U4e();Tv=class extends lL{constructor(){super(...arguments);M(this,"lc_namespace",["langchain_core","output_parsers"]);M(this,"lc_serializable",!0)}static lc_name(){return"JsonOutputParser"}_concatOutputChunks(e,r){return this.diff?super._concatOutputChunks(e,r):r}_diff(e,r){if(r)return e?i6(e,r):[{op:"replace",path:"",value:r}]}async parsePartialResult(e){return lY(e[0].text)}async parse(e){return lY(e,JSON.parse)}getFormatInstructions(){return""}}});var mhn,RMt,AMt=v(()=>{mhn=function(){let t={};t.parser=function(D,A){return new r(D,A)},t.SAXParser=r,t.SAXStream=l,t.createStream=u,t.MAX_BUFFER_LENGTH=65536;let e=["comment","sgmlDecl","textNode","tagName","doctype","procInstName","procInstBody","entity","attribName","attribValue","cdata","script"];t.EVENTS=["text","processinginstruction","sgmldeclaration","doctype","comment","opentagstart","attribute","opentag","closetag","opencdata","cdata","closecdata","error","end","ready","script","opennamespace","closenamespace"];function r(D,A){if(!(this instanceof r))return new r(D,A);var V=this;o(V),V.q=V.c="",V.bufferCheckPosition=t.MAX_BUFFER_LENGTH,V.opt=A||{},V.opt.lowercase=V.opt.lowercase||V.opt.lowercasetags,V.looseCase=V.opt.lowercase?"toLowerCase":"toUpperCase",V.tags=[],V.closed=V.closedRoot=V.sawRoot=!1,V.tag=V.error=null,V.strict=!!D,V.noscript=!!(D||V.opt.noscript),V.state=T.BEGIN,V.strictEntities=V.opt.strictEntities,V.ENTITIES=V.strictEntities?Object.create(t.XML_ENTITIES):Object.create(t.ENTITIES),V.attribList=[],V.opt.xmlns&&(V.ns=Object.create(m)),V.trackPosition=V.opt.position!==!1,V.trackPosition&&(V.position=V.line=V.column=0),I(V,"onready")}Object.create||(Object.create=function(D){function A(){}A.prototype=D;var V=new A;return V}),Object.keys||(Object.keys=function(D){var A=[];for(var V in D)D.hasOwnProperty(V)&&A.push(V);return A});function n(D){for(var A=Math.max(t.MAX_BUFFER_LENGTH,10),V=0,K=0,se=e.length;KA)switch(e[K]){case"textNode":F(D);break;case"cdata":j(D,"oncdata",D.cdata),D.cdata="";break;case"script":j(D,"onscript",D.script),D.script="";break;default:U(D,"Max buffer length exceeded: "+e[K])}V=Math.max(V,be)}var xe=t.MAX_BUFFER_LENGTH-V;D.bufferCheckPosition=xe+D.position}function o(D){for(var A=0,V=e.length;A"||_(D)}function O(D,A){return D.test(A)}function E(D,A){return!O(D,A)}var T=0;t.STATE={BEGIN:T++,BEGIN_WHITESPACE:T++,TEXT:T++,TEXT_ENTITY:T++,OPEN_WAKA:T++,SGML_DECL:T++,SGML_DECL_QUOTED:T++,DOCTYPE:T++,DOCTYPE_QUOTED:T++,DOCTYPE_DTD:T++,DOCTYPE_DTD_QUOTED:T++,COMMENT_STARTING:T++,COMMENT:T++,COMMENT_ENDING:T++,COMMENT_ENDED:T++,CDATA:T++,CDATA_ENDING:T++,CDATA_ENDING_2:T++,PROC_INST:T++,PROC_INST_BODY:T++,PROC_INST_ENDING:T++,OPEN_TAG:T++,OPEN_TAG_SLASH:T++,ATTRIB:T++,ATTRIB_NAME:T++,ATTRIB_NAME_SAW_WHITE:T++,ATTRIB_VALUE:T++,ATTRIB_VALUE_QUOTED:T++,ATTRIB_VALUE_CLOSED:T++,ATTRIB_VALUE_UNQUOTED:T++,ATTRIB_VALUE_ENTITY_Q:T++,ATTRIB_VALUE_ENTITY_U:T++,CLOSE_TAG:T++,CLOSE_TAG_SAW_WHITE:T++,SCRIPT:T++,SCRIPT_ENDING:T++},t.XML_ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'"},t.ENTITIES={amp:"&",gt:">",lt:"<",quot:'"',apos:"'",AElig:198,Aacute:193,Acirc:194,Agrave:192,Aring:197,Atilde:195,Auml:196,Ccedil:199,ETH:208,Eacute:201,Ecirc:202,Egrave:200,Euml:203,Iacute:205,Icirc:206,Igrave:204,Iuml:207,Ntilde:209,Oacute:211,Ocirc:212,Ograve:210,Oslash:216,Otilde:213,Ouml:214,THORN:222,Uacute:218,Ucirc:219,Ugrave:217,Uuml:220,Yacute:221,aacute:225,acirc:226,aelig:230,agrave:224,aring:229,atilde:227,auml:228,ccedil:231,eacute:233,ecirc:234,egrave:232,eth:240,euml:235,iacute:237,icirc:238,igrave:236,iuml:239,ntilde:241,oacute:243,ocirc:244,ograve:242,oslash:248,otilde:245,ouml:246,szlig:223,thorn:254,uacute:250,ucirc:251,ugrave:249,uuml:252,yacute:253,yuml:255,copy:169,reg:174,nbsp:160,iexcl:161,cent:162,pound:163,curren:164,yen:165,brvbar:166,sect:167,uml:168,ordf:170,laquo:171,not:172,shy:173,macr:175,deg:176,plusmn:177,sup1:185,sup2:178,sup3:179,acute:180,micro:181,para:182,middot:183,cedil:184,ordm:186,raquo:187,frac14:188,frac12:189,frac34:190,iquest:191,times:215,divide:247,OElig:338,oelig:339,Scaron:352,scaron:353,Yuml:376,fnof:402,circ:710,tilde:732,Alpha:913,Beta:914,Gamma:915,Delta:916,Epsilon:917,Zeta:918,Eta:919,Theta:920,Iota:921,Kappa:922,Lambda:923,Mu:924,Nu:925,Xi:926,Omicron:927,Pi:928,Rho:929,Sigma:931,Tau:932,Upsilon:933,Phi:934,Chi:935,Psi:936,Omega:937,alpha:945,beta:946,gamma:947,delta:948,epsilon:949,zeta:950,eta:951,theta:952,iota:953,kappa:954,lambda:955,mu:956,nu:957,xi:958,omicron:959,pi:960,rho:961,sigmaf:962,sigma:963,tau:964,upsilon:965,phi:966,chi:967,psi:968,omega:969,thetasym:977,upsih:978,piv:982,ensp:8194,emsp:8195,thinsp:8201,zwnj:8204,zwj:8205,lrm:8206,rlm:8207,ndash:8211,mdash:8212,lsquo:8216,rsquo:8217,sbquo:8218,ldquo:8220,rdquo:8221,bdquo:8222,dagger:8224,Dagger:8225,bull:8226,hellip:8230,permil:8240,prime:8242,Prime:8243,lsaquo:8249,rsaquo:8250,oline:8254,frasl:8260,euro:8364,image:8465,weierp:8472,real:8476,trade:8482,alefsym:8501,larr:8592,uarr:8593,rarr:8594,darr:8595,harr:8596,crarr:8629,lArr:8656,uArr:8657,rArr:8658,dArr:8659,hArr:8660,forall:8704,part:8706,exist:8707,empty:8709,nabla:8711,isin:8712,notin:8713,ni:8715,prod:8719,sum:8721,minus:8722,lowast:8727,radic:8730,prop:8733,infin:8734,ang:8736,and:8743,or:8744,cap:8745,cup:8746,int:8747,there4:8756,sim:8764,cong:8773,asymp:8776,ne:8800,equiv:8801,le:8804,ge:8805,sub:8834,sup:8835,nsub:8836,sube:8838,supe:8839,oplus:8853,otimes:8855,perp:8869,sdot:8901,lceil:8968,rceil:8969,lfloor:8970,rfloor:8971,lang:9001,rang:9002,loz:9674,spades:9824,clubs:9827,hearts:9829,diams:9830},Object.keys(t.ENTITIES).forEach(function(D){var A=t.ENTITIES[D],V=typeof A=="number"?String.fromCharCode(A):A;t.ENTITIES[D]=V});for(var R in t.STATE)t.STATE[t.STATE[R]]=R;T=t.STATE;function I(D,A,V){D[A]&&D[A](V)}function j(D,A,V){D.textNode&&F(D),I(D,A,V)}function F(D){D.textNode=B(D.opt,D.textNode),D.textNode&&I(D,"ontext",D.textNode),D.textNode=""}function B(D,A){return D.trim&&(A=A.trim()),D.normalize&&(A=A.replace(/\s+/g," ")),A}function U(D,A){return F(D),D.trackPosition&&(A+=` +Line: `+D.line+` +Column: `+D.column+` +Char: `+D.c),A=new Error(A),D.error=A,I(D,"onerror",A),D}function J(D){return D.sawRoot&&!D.closedRoot&&G(D,"Unclosed root tag"),D.state!==T.BEGIN&&D.state!==T.BEGIN_WHITESPACE&&D.state!==T.TEXT&&U(D,"Unexpected end"),F(D),D.c="",D.closed=!0,I(D,"onend"),r.call(D,D.strict,D.opt),D}function G(D,A){if(typeof D!="object"||!(D instanceof r))throw new Error("bad call to strictFail");D.strict&&U(D,A)}function oe(D){D.strict||(D.tagName=D.tagName[D.looseCase]());var A=D.tags[D.tags.length-1]||D,V=D.tag={name:D.tagName,attributes:{}};D.opt.xmlns&&(V.ns=A.ns),D.attribList.length=0,j(D,"onopentagstart",V)}function ne(D,A){var V=D.indexOf(":"),K=V<0?["",D]:D.split(":"),se=K[0],be=K[1];return A&&D==="xmlns"&&(se="xmlns",be=""),{prefix:se,local:be}}function z(D){if(D.strict||(D.attribName=D.attribName[D.looseCase]()),D.attribList.indexOf(D.attribName)!==-1||D.tag.attributes.hasOwnProperty(D.attribName)){D.attribName=D.attribValue="";return}if(D.opt.xmlns){var A=ne(D.attribName,!0),V=A.prefix,K=A.local;if(V==="xmlns")if(K==="xml"&&D.attribValue!==f)G(D,"xml: prefix must be bound to "+f+` +Actual: `+D.attribValue);else if(K==="xmlns"&&D.attribValue!==p)G(D,"xmlns: prefix must be bound to "+p+` +Actual: `+D.attribValue);else{var se=D.tag,be=D.tags[D.tags.length-1]||D;se.ns===be.ns&&(se.ns=Object.create(be.ns)),se.ns[K]=D.attribValue}D.attribList.push([D.attribName,D.attribValue])}else D.tag.attributes[D.attribName]=D.attribValue,j(D,"onattribute",{name:D.attribName,value:D.attribValue});D.attribName=D.attribValue=""}function ee(D,A){if(D.opt.xmlns){var V=D.tag,K=ne(D.tagName);V.prefix=K.prefix,V.local=K.local,V.uri=V.ns[K.prefix]||"",V.prefix&&!V.uri&&(G(D,"Unbound namespace prefix: "+JSON.stringify(D.tagName)),V.uri=K.prefix);var se=D.tags[D.tags.length-1]||D;V.ns&&se.ns!==V.ns&&Object.keys(V.ns).forEach(function(_n){j(D,"onopennamespace",{prefix:_n,uri:V.ns[_n]})});for(var be=0,xe=D.attribList.length;be",D.tagName="",D.state=T.SCRIPT;return}j(D,"onscript",D.script),D.script=""}var A=D.tags.length,V=D.tagName;D.strict||(V=V[D.looseCase]());for(var K=V;A--;){var se=D.tags[A];if(se.name!==K)G(D,"Unexpected close tag");else break}if(A<0){G(D,"Unmatched closing tag: "+D.tagName),D.textNode+="",D.state=T.TEXT;return}D.tagName=V;for(var be=D.tags.length;be-- >A;){var xe=D.tag=D.tags.pop();D.tagName=D.tag.name,j(D,"onclosetag",D.tagName);var Pe={};for(var pt in xe.ns)Pe[pt]=xe.ns[pt];var Ht=D.tags[D.tags.length-1]||D;D.opt.xmlns&&xe.ns!==Ht.ns&&Object.keys(xe.ns).forEach(function(Ze){var Yr=xe.ns[Ze];j(D,"onclosenamespace",{prefix:Ze,uri:Yr})})}A===0&&(D.closedRoot=!0),D.tagName=D.attribValue=D.attribName="",D.attribList.length=0,D.state=T.TEXT}function Z(D){var A=D.entity,V=A.toLowerCase(),K,se="";return D.ENTITIES[A]?D.ENTITIES[A]:D.ENTITIES[V]?D.ENTITIES[V]:(A=V,A.charAt(0)==="#"&&(A.charAt(1)==="x"?(A=A.slice(2),K=parseInt(A,16),se=K.toString(16)):(A=A.slice(1),K=parseInt(A,10),se=K.toString(10))),A=A.replace(/^0+/,""),isNaN(K)||se.toLowerCase()!==A?(G(D,"Invalid character entity"),"&"+D.entity+";"):String.fromCodePoint(K))}function $(D,A){A==="<"?(D.state=T.OPEN_WAKA,D.startTagPosition=D.position):_(A)||(G(D,"Non-whitespace before first tag."),D.textNode=A,D.state=T.TEXT)}function q(D,A){var V="";return A"?(j(A,"onsgmldeclaration",A.sgmlDecl),A.sgmlDecl="",A.state=T.TEXT):(w(K)&&(A.state=T.SGML_DECL_QUOTED),A.sgmlDecl+=K);continue;case T.SGML_DECL_QUOTED:K===A.q&&(A.state=T.SGML_DECL,A.q=""),A.sgmlDecl+=K;continue;case T.DOCTYPE:K===">"?(A.state=T.TEXT,j(A,"ondoctype",A.doctype),A.doctype=!0):(A.doctype+=K,K==="["?A.state=T.DOCTYPE_DTD:w(K)&&(A.state=T.DOCTYPE_QUOTED,A.q=K));continue;case T.DOCTYPE_QUOTED:A.doctype+=K,K===A.q&&(A.q="",A.state=T.DOCTYPE);continue;case T.DOCTYPE_DTD:A.doctype+=K,K==="]"?A.state=T.DOCTYPE:w(K)&&(A.state=T.DOCTYPE_DTD_QUOTED,A.q=K);continue;case T.DOCTYPE_DTD_QUOTED:A.doctype+=K,K===A.q&&(A.state=T.DOCTYPE_DTD,A.q="");continue;case T.COMMENT:K==="-"?A.state=T.COMMENT_ENDING:A.comment+=K;continue;case T.COMMENT_ENDING:K==="-"?(A.state=T.COMMENT_ENDED,A.comment=B(A.opt,A.comment),A.comment&&j(A,"oncomment",A.comment),A.comment=""):(A.comment+="-"+K,A.state=T.COMMENT);continue;case T.COMMENT_ENDED:K!==">"?(G(A,"Malformed comment"),A.comment+="--"+K,A.state=T.COMMENT):A.state=T.TEXT;continue;case T.CDATA:K==="]"?A.state=T.CDATA_ENDING:A.cdata+=K;continue;case T.CDATA_ENDING:K==="]"?A.state=T.CDATA_ENDING_2:(A.cdata+="]"+K,A.state=T.CDATA);continue;case T.CDATA_ENDING_2:K===">"?(A.cdata&&j(A,"oncdata",A.cdata),j(A,"onclosecdata"),A.cdata="",A.state=T.TEXT):K==="]"?A.cdata+="]":(A.cdata+="]]"+K,A.state=T.CDATA);continue;case T.PROC_INST:K==="?"?A.state=T.PROC_INST_ENDING:_(K)?A.state=T.PROC_INST_BODY:A.procInstName+=K;continue;case T.PROC_INST_BODY:if(!A.procInstBody&&_(K))continue;K==="?"?A.state=T.PROC_INST_ENDING:A.procInstBody+=K;continue;case T.PROC_INST_ENDING:K===">"?(j(A,"onprocessinginstruction",{name:A.procInstName,body:A.procInstBody}),A.procInstName=A.procInstBody="",A.state=T.TEXT):(A.procInstBody+="?"+K,A.state=T.PROC_INST_BODY);continue;case T.OPEN_TAG:O(g,K)?A.tagName+=K:(oe(A),K===">"?ee(A):K==="/"?A.state=T.OPEN_TAG_SLASH:(_(K)||G(A,"Invalid character in tag name"),A.state=T.ATTRIB));continue;case T.OPEN_TAG_SLASH:K===">"?(ee(A,!0),ie(A)):(G(A,"Forward-slash in opening tag not followed by >"),A.state=T.ATTRIB);continue;case T.ATTRIB:if(_(K))continue;K===">"?ee(A):K==="/"?A.state=T.OPEN_TAG_SLASH:O(h,K)?(A.attribName=K,A.attribValue="",A.state=T.ATTRIB_NAME):G(A,"Invalid attribute name");continue;case T.ATTRIB_NAME:K==="="?A.state=T.ATTRIB_VALUE:K===">"?(G(A,"Attribute without value"),A.attribValue=A.attribName,z(A),ee(A)):_(K)?A.state=T.ATTRIB_NAME_SAW_WHITE:O(g,K)?A.attribName+=K:G(A,"Invalid attribute name");continue;case T.ATTRIB_NAME_SAW_WHITE:if(K==="=")A.state=T.ATTRIB_VALUE;else{if(_(K))continue;G(A,"Attribute without value"),A.tag.attributes[A.attribName]="",A.attribValue="",j(A,"onattribute",{name:A.attribName,value:""}),A.attribName="",K===">"?ee(A):O(h,K)?(A.attribName=K,A.state=T.ATTRIB_NAME):(G(A,"Invalid attribute name"),A.state=T.ATTRIB)}continue;case T.ATTRIB_VALUE:if(_(K))continue;w(K)?(A.q=K,A.state=T.ATTRIB_VALUE_QUOTED):(G(A,"Unquoted attribute value"),A.state=T.ATTRIB_VALUE_UNQUOTED,A.attribValue=K);continue;case T.ATTRIB_VALUE_QUOTED:if(K!==A.q){K==="&"?A.state=T.ATTRIB_VALUE_ENTITY_Q:A.attribValue+=K;continue}z(A),A.q="",A.state=T.ATTRIB_VALUE_CLOSED;continue;case T.ATTRIB_VALUE_CLOSED:_(K)?A.state=T.ATTRIB:K===">"?ee(A):K==="/"?A.state=T.OPEN_TAG_SLASH:O(h,K)?(G(A,"No whitespace between attributes"),A.attribName=K,A.attribValue="",A.state=T.ATTRIB_NAME):G(A,"Invalid attribute name");continue;case T.ATTRIB_VALUE_UNQUOTED:if(!x(K)){K==="&"?A.state=T.ATTRIB_VALUE_ENTITY_U:A.attribValue+=K;continue}z(A),K===">"?ee(A):A.state=T.ATTRIB;continue;case T.CLOSE_TAG:if(A.tagName)K===">"?ie(A):O(g,K)?A.tagName+=K:A.script?(A.script+=""?ie(A):G(A,"Invalid characters in closing tag");continue;case T.TEXT_ENTITY:case T.ATTRIB_VALUE_ENTITY_Q:case T.ATTRIB_VALUE_ENTITY_U:var xe,Pe;switch(A.state){case T.TEXT_ENTITY:xe=T.TEXT,Pe="textNode";break;case T.ATTRIB_VALUE_ENTITY_Q:xe=T.ATTRIB_VALUE_QUOTED,Pe="attribValue";break;case T.ATTRIB_VALUE_ENTITY_U:xe=T.ATTRIB_VALUE_UNQUOTED,Pe="attribValue";break}if(K===";")if(A.opt.unparsedEntities){var pt=Z(A);A.entity="",A.state=xe,A.write(pt)}else A[Pe]+=Z(A),A.entity="",A.state=xe;else O(A.entity.length?b:y,K)?A.entity+=K:(G(A,"Invalid character in entity name"),A[Pe]+="&"+A.entity+K,A.entity="",A.state=xe);continue;default:throw new Error(A,"Unknown state: "+A.state)}return A.position>=A.bufferCheckPosition&&n(A),A}return String.fromCodePoint||function(){var D=String.fromCharCode,A=Math.floor,V=function(){var K=16384,se=[],be,xe,Pe=-1,pt=arguments.length;if(!pt)return"";for(var Ht="";++Pe1114111||A(Ze)!==Ze)throw RangeError("Invalid code point: "+Ze);Ze<=65535?se.push(Ze):(Ze-=65536,be=(Ze>>10)+55296,xe=Ze%1024+56320,se.push(be,xe)),(Pe+1===pt||se.length>K)&&(Ht+=D.apply(null,se),se.length=0)}return Ht};Object.defineProperty?Object.defineProperty(String,"fromCodePoint",{value:V,configurable:!0,writable:!0}):String.fromCodePoint=V}(),t},RMt=mhn()});function bhe(t){let e=hhn(t),r=RMt.parser(!0),n={},o=[];r.onopentag=s=>{let u={name:s.name,attributes:s.attributes,children:[],text:"",isSelfClosing:s.isSelfClosing};o.length>0?o[o.length-1].children.push(u):n=u,s.isSelfClosing||o.push(u)},r.onclosetag=()=>{if(o.length>0){let s=o.pop();o.length===0&&s&&(n=s)}},r.ontext=s=>{if(o.length>0){let u=o[o.length-1];u.text+=s}},r.onattribute=s=>{if(o.length>0){let u=o[o.length-1];u.attributes[s.name]=s.value}};let i=/```(xml)?(.*)```/s.exec(e),a=i?i[2]:e;return r.write(a).close(),n&&n.name==="?xml"&&(n=n.children[0]),NMt(n)}var yhe,IMt,hhn,NMt,jMt=v(()=>{UY();cL();U4e();AMt();yhe=`The output should be formatted as a XML file. +1. Output should conform to the tags below. +2. If tags are not given, make them on your own. +3. Remember to always open and close all the tags. + +As an example, for the tags ["foo", "bar", "baz"]: +1. String " + + + +" is a well-formatted instance of the schema. +2. String " + + " is a badly-formatted instance. +3. String " + + +" is a badly-formatted instance. + +Here are the output tags: +\`\`\` +{tags} +\`\`\``,IMt=class extends lL{constructor(e){super(e);M(this,"tags");M(this,"lc_namespace",["langchain_core","output_parsers"]);M(this,"lc_serializable",!0);this.tags=e?.tags}static lc_name(){return"XMLOutputParser"}_diff(e,r){if(r)return e?i6(e,r):[{op:"replace",path:"",value:r}]}async parsePartialResult(e){return bhe(e[0].text)}async parse(e){return bhe(e)}getFormatInstructions(){return!!(this.tags&&this.tags.length>0)?yhe.replace("{tags}",this.tags?.join(", ")??""):yhe}},hhn=t=>t.split(` +`).map(e=>e.replace(/^\s+/,"")).join(` +`).trim(),NMt=t=>{if(Object.keys(t).length===0)return{};let e={};return t.children.length>0?(e[t.name]=t.children.map(NMt),e):(e[t.name]=t.text??void 0,e)}});var ghn,_O=v(()=>{Do();cY();E6();cL();wMt();TMt();EMt();MMt();z4e();jMt();ghn={};Tt(ghn,{AsymmetricStructuredOutputParser:()=>PMt,BaseCumulativeTransformOutputParser:()=>lL,BaseLLMOutputParser:()=>Mz,BaseOutputParser:()=>_N,BaseTransformOutputParser:()=>vN,BytesOutputParser:()=>vMt,CommaSeparatedListOutputParser:()=>SMt,CustomListOutputParser:()=>CMt,JsonMarkdownStructuredOutputParser:()=>B4e,JsonOutputParser:()=>Tv,ListOutputParser:()=>P6,MarkdownListOutputParser:()=>OMt,NumberedListOutputParser:()=>xMt,OutputParserException:()=>nh,StringOutputParser:()=>ghe,StructuredOutputParser:()=>Kw,XMLOutputParser:()=>IMt,XML_FORMAT_INSTRUCTIONS:()=>yhe,parseJsonMarkdown:()=>lY,parsePartialJson:()=>qU,parseXMLMarkdown:()=>bhe})});var Ww,M6=v(()=>{Yh();Ww=class extends Lo{constructor(e){super(e);M(this,"lc_serializable",!0);M(this,"lc_namespace",["langchain_core","prompts",this._getPromptType()]);M(this,"inputVariables");M(this,"outputParser");M(this,"partialVariables");M(this,"metadata");M(this,"tags");let{inputVariables:r}=e;if(r.includes("stop"))throw new Error("Cannot have an input variable named 'stop', as it is used internally, please rename.");Object.assign(this,e)}get lc_attributes(){return{partialVariables:void 0}}async mergePartialAndUserVariables(e){let r=this.partialVariables??{},n={};for(let[i,a]of Object.entries(r))typeof a=="string"?n[i]=a:n[i]=await a();return{...n,...e}}async invoke(e,r){let n={...this.metadata,...r?.metadata},o=[...this.tags??[],...r?.tags??[]];return this._callWithConfig(i=>this.formatPromptValue(i),e,{...r,tags:o,metadata:n,runType:"prompt"})}}});var yhn,_he,jQ,DQ,H4e,$Q=v(()=>{Do();F$();U$();iO();yhn={};Tt(yhn,{BasePromptValue:()=>_he,ChatPromptValue:()=>DQ,ImagePromptValue:()=>H4e,StringPromptValue:()=>jQ});_he=class extends Wh{},jQ=class extends _he{constructor(e){super({value:e});M(this,"lc_namespace",["langchain_core","prompt_values"]);M(this,"lc_serializable",!0);M(this,"value");this.value=e}static lc_name(){return"StringPromptValue"}toString(){return this.value}toChatMessages(){return[new au(this.value)]}},DQ=class extends _he{constructor(e){Array.isArray(e)&&(e={messages:e});super(e);M(this,"lc_namespace",["langchain_core","prompt_values"]);M(this,"lc_serializable",!0);M(this,"messages");this.messages=e.messages}static lc_name(){return"ChatPromptValue"}toString(){return Xu(this.messages)}toChatMessages(){return this.messages}},H4e=class extends _he{constructor(e){"imageUrl"in e||(e={imageUrl:e});super(e);M(this,"lc_namespace",["langchain_core","prompt_values"]);M(this,"lc_serializable",!0);M(this,"imageUrl");M(this,"value");this.imageUrl=e.imageUrl}static lc_name(){return"ImagePromptValue"}toString(){return this.imageUrl.url}toChatMessages(){return[new au({content:[{type:"image_url",image_url:{detail:this.imageUrl.detail,url:this.imageUrl.url}}]})]}}});var wN,LQ=v(()=>{$Q();M6();wN=class extends Ww{async formatPromptValue(t){let e=await this.format(t);return new jQ(e)}}});function J4e(t){return typeof t=="function"}function _hn(t){return A6(t)?"array":typeof t}function V4e(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function DMt(t,e){return t!=null&&typeof t=="object"&&e in t}function vhn(t,e){return t!=null&&typeof t!="object"&&t.hasOwnProperty&&t.hasOwnProperty(e)}function Shn(t,e){return whn.call(t,e)}function xhn(t){return!Shn(Chn,t)}function Thn(t){return String(t).replace(/[&<>"'`=\/]/g,function(r){return Ohn[r]})}function Ahn(t,e){if(!t)return[];var r=!1,n=[],o=[],i=[],a=!1,s=!1,u="",l=0;function c(){if(a&&!s)for(;i.length;)delete o[i.pop()];else i=[];a=!1,s=!1}var d,f,p;function m(T){if(typeof T=="string"&&(T=T.split(Phn,2)),!A6(T)||T.length!==2)throw new Error("Invalid tags: "+T);d=new RegExp(V4e(T[0])+"\\s*"),f=new RegExp("\\s*"+V4e(T[1])),p=new RegExp("\\s*"+V4e("}"+T[1]))}m(e||Gw.tags);for(var h=new kQ(t),g,y,b,_,w,x;!h.eos();){if(g=h.pos,b=h.scanUntil(d),b)for(var O=0,E=b.length;O"?w=[y,b,g,h.pos,u,l,r]:w=[y,b,g,h.pos],l++,o.push(w),y==="#"||y==="^")n.push(w);else if(y==="/"){if(x=n.pop(),!x)throw new Error('Unopened section "'+b+'" at '+g);if(x[1]!==b)throw new Error('Unclosed section "'+x[1]+'" at '+g)}else y==="name"||y==="{"||y==="&"?s=!0:y==="="&&m(b)}if(c(),x=n.pop(),x)throw new Error('Unclosed section "'+x[1]+'" at '+h.pos);return Nhn(Ihn(o))}function Ihn(t){for(var e=[],r,n,o=0,i=t.length;o0?n[n.length-1][4]:e;break;default:r.push(o)}return e}function kQ(t){this.string=t,this.tail=t,this.pos=0}function R6(t,e){this.view=t,this.cache={".":this.view},this.parent=e}function nb(){this.templateCache={_cache:{},set:function(e,r){this._cache[e]=r},get:function(e){return this._cache[e]},clear:function(){this._cache={}}}}var bhn,A6,whn,Chn,Ohn,Ehn,Phn,$Mt,Mhn,Rhn,Gw,FQ,vhe,LMt=v(()=>{bhn=Object.prototype.toString,A6=Array.isArray||function(e){return bhn.call(e)==="[object Array]"};whn=RegExp.prototype.test;Chn=/\S/;Ohn={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/","`":"`","=":"="};Ehn=/\s*/,Phn=/\s+/,$Mt=/\s*=/,Mhn=/\s*\}/,Rhn=/#|\^|\/|>|\{|&|=|!/;kQ.prototype.eos=function(){return this.tail===""};kQ.prototype.scan=function(e){var r=this.tail.match(e);if(!r||r.index!==0)return"";var n=r[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n};kQ.prototype.scanUntil=function(e){var r=this.tail.search(e),n;switch(r){case-1:n=this.tail,this.tail="";break;case 0:n="";break;default:n=this.tail.substring(0,r),this.tail=this.tail.substring(r)}return this.pos+=n.length,n};R6.prototype.push=function(e){return new R6(e,this)};R6.prototype.lookup=function(e){var r=this.cache,n;if(r.hasOwnProperty(e))n=r[e];else{for(var o=this,i,a,s,u=!1;o;){if(e.indexOf(".")>0)for(i=o.view,a=e.split("."),s=0;i!=null&&s"?l=this.renderPartial(s,r,n,i):u==="&"?l=this.unescapedValue(s,r):u==="name"?l=this.escapedValue(s,r,i):u==="text"&&(l=this.rawValue(s)),l!==void 0&&(a+=l);return a};nb.prototype.renderSection=function(e,r,n,o,i){var a=this,s="",u=r.lookup(e[1]);function l(f){return a.render(f,r,n,i)}if(u){if(A6(u))for(var c=0,d=u.length;c0||!n)&&(i[a]=o+i[a]);return i.join(` +`)};nb.prototype.renderPartial=function(e,r,n,o){if(n){var i=this.getConfigTags(o),a=J4e(n)?n(e[1]):n[e[1]];if(a!=null){var s=e[6],u=e[5],l=e[4],c=a;u==0&&l&&(c=this.indentPartial(a,l,s));var d=this.parse(c,i);return this.renderTokens(d,r,n,c,o)}}};nb.prototype.unescapedValue=function(e,r){var n=r.lookup(e[1]);if(n!=null)return n};nb.prototype.escapedValue=function(e,r,n){var o=this.getConfigEscape(n)||Gw.escape,i=r.lookup(e[1]);if(i!=null)return typeof i=="number"&&o===Gw.escape?String(i):o(i)};nb.prototype.rawValue=function(e){return e[1]};nb.prototype.getConfigTags=function(e){return A6(e)?e:e&&typeof e=="object"?e.tags:void 0};nb.prototype.getConfigEscape=function(e){if(e&&typeof e=="object"&&!A6(e))return e.escape};Gw={name:"mustache.js",version:"4.2.0",tags:["{{","}}"],clearCache:void 0,escape:void 0,parse:void 0,render:void 0,Scanner:void 0,Context:void 0,Writer:void 0,set templateCache(t){FQ.templateCache=t},get templateCache(){return FQ.templateCache}},FQ=new nb;Gw.clearCache=function(){return FQ.clearCache()};Gw.parse=function(e,r){return FQ.parse(e,r)};Gw.render=function(e,r,n,o){if(typeof e!="string")throw new TypeError('Invalid template! Template should be a "string" but "'+_hn(e)+'" was given as the first argument for mustache#render(template, view, partials)');return FQ.render(e,r,n,o)};Gw.escape=Thn;Gw.Scanner=kQ;Gw.Context=R6;Gw.Writer=nb;vhe=Gw});function FMt(){vhe.escape=t=>t}var Rz,kMt,I6,K4e,W4e,qQ,G4e,ry,Az,SN,Iz=v(()=>{dY();LMt();Rz=t=>{let e=t.split(""),r=[],n=(i,a)=>{for(let s=a;s{let r=[];for(let n of t)if(n[0]==="name"){let o=n[1].includes(".")?n[1].split(".")[0]:n[1];r.push({type:"variable",name:o})}else if(["#","&","^",">"].includes(n[0])){if(r.push({type:"variable",name:n[1]}),n[0]==="#"&&n.length>4&&Array.isArray(n[4])){let o=[...e,n[1]],i=kMt(n[4],o);r.push(...i)}}else r.push({type:"literal",text:n[1]});return r},I6=t=>{FMt();let e=vhe.parse(t);return kMt(e)},K4e=(t,e)=>Rz(t).reduce((r,n)=>{if(n.type==="variable"){if(n.name in e){let o=typeof e[n.name]=="string"?e[n.name]:JSON.stringify(e[n.name]);return r+o}throw new Error(`(f-string) Missing value for input ${n.name}`)}return r+n.text},""),W4e=(t,e)=>(FMt(),vhe.render(t,e)),qQ={"f-string":K4e,mustache:W4e},G4e={"f-string":Rz,mustache:I6},ry=(t,e,r)=>{try{return qQ[e](t,r)}catch(n){throw L$(n,"INVALID_PROMPT_INPUT")}},Az=(t,e)=>G4e[e](t),SN=(t,e,r)=>{if(!(e in qQ)){let n=Object.keys(qQ);throw new Error(`Invalid template format. Got \`${e}\`; + should be one of ${n}`)}try{let n=r.reduce((o,i)=>(o[i]="foo",o),{});Array.isArray(t)?t.forEach(o=>{if(o.type==="text"&&"text"in o&&typeof o.text=="string")ry(o.text,e,n);else if(o.type==="image_url"){if(typeof o.image_url=="string")ry(o.image_url,e,n);else if(typeof o.image_url=="object"&&o.image_url!==null&&"url"in o.image_url&&typeof o.image_url.url=="string"){let i=o.image_url.url;ry(i,e,n)}}else throw new Error(`Invalid message template received. ${JSON.stringify(o,null,2)}`)}):ry(t,e,n)}catch(n){throw new Error(`Invalid prompt schema: ${n.message}`)}}});var su,whe=v(()=>{LQ();Iz();su=class BQ extends wN{constructor(r){super(r);M(this,"template");M(this,"templateFormat","f-string");M(this,"validateTemplate",!0);M(this,"additionalContentFields");if(r.templateFormat==="mustache"&&r.validateTemplate===void 0&&(this.validateTemplate=!1),Object.assign(this,r),this.validateTemplate){if(this.templateFormat==="mustache")throw new Error("Mustache templates cannot be validated.");let n=this.inputVariables;this.partialVariables&&(n=n.concat(Object.keys(this.partialVariables))),SN(this.template,this.templateFormat,n)}}static lc_name(){return"PromptTemplate"}_getPromptType(){return"prompt"}async format(r){let n=await this.mergePartialAndUserVariables(r);return ry(this.template,this.templateFormat,n)}static fromExamples(r,n,o,i=` + +`,a=""){let s=[a,...r,n].join(i);return new BQ({inputVariables:o,template:s})}static fromTemplate(r,n){let{templateFormat:o="f-string",...i}=n??{},a=new Set;return Az(r,o).forEach(s=>{s.type==="variable"&&a.add(s.name)}),new BQ({inputVariables:[...a],templateFormat:o,template:r,...i})}async partial(r){let n=this.inputVariables.filter(a=>!(a in r)),o={...this.partialVariables??{},...r},i={...this,inputVariables:n,partialVariables:o};return new BQ(i)}serialize(){if(this.outputParser!==void 0)throw new Error("Cannot serialize a prompt template with an output parser");return{_type:this._getPromptType(),input_variables:this.inputVariables,template:this.template,template_format:this.templateFormat}}static async deserialize(r){if(!r.template)throw new Error("Prompt template must have a template");return new BQ({inputVariables:r.input_variables,template:r.template,templateFormat:r.template_format})}}});var N6,Z4e=v(()=>{$Q();M6();Iz();N6=class qMt extends Ww{constructor(r){super(r);M(this,"lc_namespace",["langchain_core","prompts","image"]);M(this,"template");M(this,"templateFormat","f-string");M(this,"validateTemplate",!0);M(this,"additionalContentFields");if(this.template=r.template,this.templateFormat=r.templateFormat??this.templateFormat,this.validateTemplate=r.validateTemplate??this.validateTemplate,this.additionalContentFields=r.additionalContentFields,this.validateTemplate){let n=this.inputVariables;this.partialVariables&&(n=n.concat(Object.keys(this.partialVariables))),SN([{type:"image_url",image_url:this.template}],this.templateFormat,n)}}static lc_name(){return"ImagePromptTemplate"}_getPromptType(){return"prompt"}async partial(r){let n=this.inputVariables.filter(a=>!(a in r)),o={...this.partialVariables??{},...r},i={...this,inputVariables:n,partialVariables:o};return new qMt(i)}async format(r){let n={};for(let[s,u]of Object.entries(this.template))typeof u=="string"?n[s]=ry(u,this.templateFormat,r):n[s]=u;let o=r.url||n.url,i=r.detail||n.detail;if(!o)throw new Error("Must provide either an image URL.");if(typeof o!="string")throw new Error("url must be a string.");let a={url:o};return i&&(a.detail=i),a}async formatPromptValue(r){let n=await this.format(r);return new H4e(n)}}});function X4e(t,e){let r=[];for(let n of Object.values(t))if(typeof n=="string")Az(n,e).forEach(o=>{o.type==="variable"&&r.push(o.name)});else if(Array.isArray(n))for(let o of n)typeof o=="string"?Az(o,e).forEach(i=>{i.type==="variable"&&r.push(i.name)}):typeof o=="object"&&r.push(...X4e(o,e));else typeof n=="object"&&n!==null&&r.push(...X4e(n,e));return Array.from(new Set(r))}function Y4e(t,e,r){let n={};for(let[o,i]of Object.entries(t))if(typeof i=="string")n[o]=ry(i,r,e);else if(Array.isArray(i)){let a=[];for(let s of i)typeof s=="string"?a.push(ry(s,r,e)):typeof s=="object"&&a.push(Y4e(s,e,r));n[o]=a}else typeof i=="object"&&i!==null?n[o]=Y4e(i,e,r):n[o]=i;return n}var UQ,Q4e=v(()=>{Yh();Iz();UQ=class extends Lo{constructor(e){let r=e.templateFormat??"f-string",n=X4e(e.template,r);super({inputVariables:n,...e});M(this,"lc_namespace",["langchain_core","prompts","dict"]);M(this,"lc_serializable",!0);M(this,"template");M(this,"templateFormat");M(this,"inputVariables");this.template=e.template,this.templateFormat=r,this.inputVariables=n}static lc_name(){return"DictPromptTemplate"}async format(e){return Y4e(this.template,e,this.templateFormat)}async invoke(e){return await this._callWithConfig(this.format.bind(this),e,{runType:"prompt"})}}});function jhn(t){return t===null||typeof t!="object"||Array.isArray(t)?!1:Object.keys(t).length===1&&"text"in t&&typeof t.text=="string"}function Dhn(t){return t===null||typeof t!="object"||Array.isArray(t)?!1:"image_url"in t&&(typeof t.image_url=="string"||typeof t.image_url=="object"&&t.image_url!==null&&"url"in t.image_url&&typeof t.image_url.url=="string")}function $hn(t){return typeof t.formatMessages=="function"}function Lhn(t,e){if($hn(t)||eh(t))return t;if(Array.isArray(t)&&t[0]==="placeholder"){let o=t[1];if(e?.templateFormat==="mustache"&&typeof o=="string"&&o.slice(0,2)==="{{"&&o.slice(-2)==="}}"){let i=o.slice(2,-2);return new vO({variableName:i,optional:!0})}else if(typeof o=="string"&&o[0]==="{"&&o[o.length-1]==="}"){let i=o.slice(1,-1);return new vO({variableName:i,optional:!0})}throw new Error(`Invalid placeholder template for format ${e?.templateFormat??'"f-string"'}: "${t[1]}". Expected a variable name surrounded by ${e?.templateFormat==="mustache"?"double":"single"} curly braces.`)}let r=Nw(t),n;if(typeof r.content=="string"?n=r.content:n=r.content.map(o=>"text"in o?{...o,text:o.text}:"image_url"in o?{...o,image_url:o.image_url}:o),r._getType()==="human")return a_.fromTemplate(n,e);if(r._getType()==="ai")return Che.fromTemplate(n,e);if(r._getType()==="system")return Zw.fromTemplate(n,e);if(ud.isInstance(r))return t2e.fromTemplate(r.content,r.role,e);throw new Error(`Could not coerce message prompt template from input. Received message type: "${r._getType()}".`)}function Fhn(t){return t.constructor.lc_name()==="MessagesPlaceholder"}var zQ,vO,e2e,HQ,t2e,r2e,a_,Che,Zw,pd,VQ=v(()=>{Gg();z0();_Y();U$();vY();dY();iO();Yh();js();$Q();M6();LQ();Iz();whe();Z4e();Q4e();zQ=class extends Lo{constructor(){super(...arguments);M(this,"lc_namespace",["langchain_core","prompts","chat"]);M(this,"lc_serializable",!0)}async invoke(e,r){return this._callWithConfig(n=>this.formatMessages(n),e,{...r,runType:"prompt"})}},vO=class extends zQ{constructor(e){typeof e=="string"&&(e={variableName:e});super(e);M(this,"variableName");M(this,"optional");this.variableName=e.variableName,this.optional=e.optional??!1}static lc_name(){return"MessagesPlaceholder"}get inputVariables(){return[this.variableName]}async formatMessages(e){let r=e[this.variableName];if(this.optional&&!r)return[];if(!r){let o=new Error(`Field "${this.variableName}" in prompt uses a MessagesPlaceholder, which expects an array of BaseMessages as an input value. Received: undefined`);throw o.name="InputFormatError",o}let n;try{Array.isArray(r)?n=r.map(Nw):n=[Nw(r)]}catch(o){let i=typeof r=="string"?r:JSON.stringify(r,null,2),a=new Error([`Field "${this.variableName}" in prompt uses a MessagesPlaceholder, which expects an array of BaseMessages or coerceable values as input.`,`Received value: ${i}`,`Additional message: ${o.message}`].join(` + +`));throw a.name="InputFormatError",a.lc_error_code=o.lc_error_code,a}return n}},e2e=class extends zQ{constructor(e){"prompt"in e||(e={prompt:e});super(e);M(this,"prompt");this.prompt=e.prompt}get inputVariables(){return this.prompt.inputVariables}async formatMessages(e){return[await this.format(e)]}},HQ=class extends Ww{constructor(t){super(t)}async format(t){return(await this.formatPromptValue(t)).toString()}async formatPromptValue(t){let e=await this.formatMessages(t);return new DQ(e)}},t2e=class extends e2e{constructor(e,r){"prompt"in e||(e={prompt:e,role:r});super(e);M(this,"role");this.role=e.role}static lc_name(){return"ChatMessagePromptTemplate"}async format(e){return new ud(await this.prompt.format(e),this.role)}static fromTemplate(e,r,n){return new this(su.fromTemplate(e,{templateFormat:n?.templateFormat}),r)}};r2e=class extends zQ{constructor(e,r){"prompt"in e||(e={prompt:e});super(e);M(this,"lc_namespace",["langchain_core","prompts","chat"]);M(this,"lc_serializable",!0);M(this,"inputVariables",[]);M(this,"additionalOptions",{});M(this,"prompt");M(this,"messageClass");M(this,"chatMessageClass");if(this.prompt=e.prompt,Array.isArray(this.prompt)){let n=[];this.prompt.forEach(o=>{"inputVariables"in o&&(n=n.concat(o.inputVariables))}),this.inputVariables=n}else this.inputVariables=this.prompt.inputVariables;this.additionalOptions=r??this.additionalOptions}static _messageClass(){throw new Error("Can not invoke _messageClass from inside _StringImageMessagePromptTemplate")}createMessage(e){let r=this.constructor;if(r._messageClass()){let n=r._messageClass();return new n({content:e})}else if(r.chatMessageClass){let n=r.chatMessageClass();return new n({content:e,role:this.getRoleFromMessageClass(n.lc_name())})}else throw new Error("No message class defined")}getRoleFromMessageClass(e){switch(e){case"HumanMessage":return"human";case"AIMessage":return"ai";case"SystemMessage":return"system";case"ChatMessage":return"chat";default:throw new Error("Invalid message class name")}}static fromTemplate(e,r){if(typeof e=="string")return new this(su.fromTemplate(e,r));let n=[];for(let o of e)if(typeof o=="string")n.push(su.fromTemplate(o,r));else if(o!==null)if(jhn(o)){let i="";typeof o.text=="string"&&(i=o.text??"");let a={...r,additionalContentFields:o};n.push(su.fromTemplate(i,a))}else if(Dhn(o)){let i=o.image_url??"",a,s=[];if(typeof i=="string"){let u;r?.templateFormat==="mustache"?u=I6(i):u=Rz(i);let l=u.flatMap(c=>c.type==="variable"?[c.name]:[]);if((l?.length??0)>0){if(l.length>1)throw new Error(`Only one format variable allowed per image template. +Got: ${l} +From: ${i}`);s=[l[0]]}else s=[];i={url:i},a=new N6({template:i,inputVariables:s,templateFormat:r?.templateFormat,additionalContentFields:o})}else if(typeof i=="object"){if("url"in i){let u;r?.templateFormat==="mustache"?u=I6(i.url):u=Rz(i.url),s=u.flatMap(l=>l.type==="variable"?[l.name]:[])}else s=[];a=new N6({template:i,inputVariables:s,templateFormat:r?.templateFormat,additionalContentFields:o})}else throw new Error("Invalid image template");n.push(a)}else typeof o=="object"&&n.push(new UQ({template:o,templateFormat:r?.templateFormat}));return new this({prompt:n,additionalOptions:r})}async format(e){if(this.prompt instanceof wN){let r=await this.prompt.format(e);return this.createMessage(r)}else{let r=[];for(let n of this.prompt){let o={};if(!("inputVariables"in n))throw new Error(`Prompt ${n} does not have inputVariables defined.`);for(let i of n.inputVariables)o||(o={[i]:e[i]}),o={...o,[i]:e[i]};if(n instanceof wN){let i=await n.format(o),a;"additionalContentFields"in n&&(a=n.additionalContentFields),i!==""&&r.push({...a,type:"text",text:i})}else if(n instanceof N6){let i=await n.format(o),a;"additionalContentFields"in n&&(a=n.additionalContentFields),r.push({...a,type:"image_url",image_url:i})}else if(n instanceof UQ){let i=await n.format(o),a;"additionalContentFields"in n&&(a=n.additionalContentFields),r.push({...a,...i})}}return this.createMessage(r)}}async formatMessages(e){return[await this.format(e)]}},a_=class extends r2e{static _messageClass(){return au}static lc_name(){return"HumanMessagePromptTemplate"}},Che=class extends r2e{static _messageClass(){return li}static lc_name(){return"AIMessagePromptTemplate"}},Zw=class extends r2e{static _messageClass(){return th}static lc_name(){return"SystemMessagePromptTemplate"}};pd=class She extends HQ{constructor(r){super(r);M(this,"promptMessages");M(this,"validateTemplate",!0);M(this,"templateFormat","f-string");if(r.templateFormat==="mustache"&&r.validateTemplate===void 0&&(this.validateTemplate=!1),Object.assign(this,r),this.validateTemplate){let n=new Set;for(let u of this.promptMessages)if(!(u instanceof Uc))for(let l of u.inputVariables)n.add(l);let o=this.inputVariables,i=new Set(this.partialVariables?o.concat(Object.keys(this.partialVariables)):o),a=new Set([...i].filter(u=>!n.has(u)));if(a.size>0)throw new Error(`Input variables \`${[...a]}\` are not used in any of the prompt messages.`);let s=new Set([...n].filter(u=>!i.has(u)));if(s.size>0)throw new Error(`Input variables \`${[...s]}\` are used in prompt messages but not in the prompt template.`)}}static lc_name(){return"ChatPromptTemplate"}get lc_aliases(){return{promptMessages:"messages"}}_getPromptType(){return"chat"}async _parseImagePrompts(r,n){if(typeof r.content=="string")return r;let o=await Promise.all(r.content.map(async i=>{if(i.type!=="image_url")return i;let a="";typeof i.image_url=="string"?a=i.image_url:typeof i.image_url=="object"&&i.image_url!==null&&"url"in i.image_url&&typeof i.image_url.url=="string"&&(a=i.image_url.url);let u=await su.fromTemplate(a,{templateFormat:this.templateFormat}).format(n);return typeof i.image_url=="object"&&i.image_url!==null&&"url"in i.image_url?i.image_url.url=u:i.image_url=u,i}));return r.content=o,r}async formatMessages(r){let n=await this.mergePartialAndUserVariables(r),o=[];for(let i of this.promptMessages)if(i instanceof Uc)o.push(await this._parseImagePrompts(i,n));else{let a;this.templateFormat==="mustache"?a={...n}:a=i.inputVariables.reduce((u,l)=>{if(!(l in n)&&!(Fhn(i)&&i.optional))throw L$(new Error(`Missing value for input variable \`${l.toString()}\``),"INVALID_PROMPT_INPUT");return u[l]=n[l],u},{});let s=await i.formatMessages(a);o=o.concat(s)}return o}async partial(r){let n=this.inputVariables.filter(a=>!(a in r)),o={...this.partialVariables??{},...r},i={...this,inputVariables:n,partialVariables:o};return new She(i)}static fromTemplate(r,n){let o=su.fromTemplate(r,n),i=new a_({prompt:o});return this.fromMessages([i])}static fromMessages(r,n){let o=r.reduce((s,u)=>s.concat(u instanceof She?u.promptMessages:[Lhn(u,n)]),[]),i=r.reduce((s,u)=>u instanceof She?Object.assign(s,u.partialVariables):s,Object.create(null)),a=new Set;for(let s of o)if(!(s instanceof Uc))for(let u of s.inputVariables)u in i||a.add(u);return new this({...n,inputVariables:[...a],promptMessages:o,partialVariables:i,templateFormat:n?.templateFormat})}}});var BMt,UMt,HMt=v(()=>{LQ();Iz();whe();VQ();BMt=class n2e extends wN{constructor(r){super(r);M(this,"lc_serializable",!1);M(this,"examples");M(this,"exampleSelector");M(this,"examplePrompt");M(this,"suffix","");M(this,"exampleSeparator",` + +`);M(this,"prefix","");M(this,"templateFormat","f-string");M(this,"validateTemplate",!0);if(Object.assign(this,r),this.examples!==void 0&&this.exampleSelector!==void 0)throw new Error("Only one of 'examples' and 'example_selector' should be provided");if(this.examples===void 0&&this.exampleSelector===void 0)throw new Error("One of 'examples' and 'example_selector' should be provided");if(this.validateTemplate){let n=this.inputVariables;this.partialVariables&&(n=n.concat(Object.keys(this.partialVariables))),SN(this.prefix+this.suffix,this.templateFormat,n)}}_getPromptType(){return"few_shot"}static lc_name(){return"FewShotPromptTemplate"}async getExamples(r){if(this.examples!==void 0)return this.examples;if(this.exampleSelector!==void 0)return this.exampleSelector.selectExamples(r);throw new Error("One of 'examples' and 'example_selector' should be provided")}async partial(r){let n=this.inputVariables.filter(a=>!(a in r)),o={...this.partialVariables??{},...r},i={...this,inputVariables:n,partialVariables:o};return new n2e(i)}async format(r){let n=await this.mergePartialAndUserVariables(r),o=await this.getExamples(n),i=await Promise.all(o.map(s=>this.examplePrompt.format(s))),a=[this.prefix,...i,this.suffix].join(this.exampleSeparator);return ry(a,this.templateFormat,n)}serialize(){if(this.exampleSelector||!this.examples)throw new Error("Serializing an example selector is not currently supported");if(this.outputParser!==void 0)throw new Error("Serializing an output parser is not currently supported");return{_type:this._getPromptType(),input_variables:this.inputVariables,example_prompt:this.examplePrompt.serialize(),example_separator:this.exampleSeparator,suffix:this.suffix,prefix:this.prefix,template_format:this.templateFormat,examples:this.examples}}static async deserialize(r){let{example_prompt:n}=r;if(!n)throw new Error("Missing example prompt");let o=await su.deserialize(n),i;if(Array.isArray(r.examples))i=r.examples;else throw new Error("Invalid examples format. Only list or string are supported.");return new n2e({inputVariables:r.input_variables,examplePrompt:o,examples:i,exampleSeparator:r.example_separator,prefix:r.prefix,suffix:r.suffix,templateFormat:r.template_format})}},UMt=class zMt extends HQ{constructor(r){super(r);M(this,"lc_serializable",!0);M(this,"examples");M(this,"exampleSelector");M(this,"examplePrompt");M(this,"suffix","");M(this,"exampleSeparator",` + +`);M(this,"prefix","");M(this,"templateFormat","f-string");M(this,"validateTemplate",!0);if(this.examples=r.examples,this.examplePrompt=r.examplePrompt,this.exampleSeparator=r.exampleSeparator??` + +`,this.exampleSelector=r.exampleSelector,this.prefix=r.prefix??"",this.suffix=r.suffix??"",this.templateFormat=r.templateFormat??"f-string",this.validateTemplate=r.validateTemplate??!0,this.examples!==void 0&&this.exampleSelector!==void 0)throw new Error("Only one of 'examples' and 'example_selector' should be provided");if(this.examples===void 0&&this.exampleSelector===void 0)throw new Error("One of 'examples' and 'example_selector' should be provided");if(this.validateTemplate){let n=this.inputVariables;this.partialVariables&&(n=n.concat(Object.keys(this.partialVariables))),SN(this.prefix+this.suffix,this.templateFormat,n)}}_getPromptType(){return"few_shot_chat"}static lc_name(){return"FewShotChatMessagePromptTemplate"}async getExamples(r){if(this.examples!==void 0)return this.examples;if(this.exampleSelector!==void 0)return this.exampleSelector.selectExamples(r);throw new Error("One of 'examples' and 'example_selector' should be provided")}async formatMessages(r){let n=await this.mergePartialAndUserVariables(r),o=await this.getExamples(n);o=o.map(a=>{let s={};return this.examplePrompt.inputVariables.forEach(u=>{s[u]=a[u]}),s});let i=[];for(let a of o){let s=await this.examplePrompt.formatMessages(a);i.push(...s)}return i}async format(r){let n=await this.mergePartialAndUserVariables(r),o=await this.getExamples(n),a=(await Promise.all(o.map(u=>this.examplePrompt.formatMessages(u)))).flat().map(u=>u.content),s=[this.prefix,...a,this.suffix].join(this.exampleSeparator);return ry(s,this.templateFormat,n)}async partial(r){let n=this.inputVariables.filter(a=>!(a in r)),o={...this.partialVariables??{},...r},i={...this,inputVariables:n,partialVariables:o};return new zMt(i)}}});var VMt,JMt=v(()=>{M6();VQ();VMt=class xhe extends Ww{constructor(r){super({...r,inputVariables:[]});M(this,"pipelinePrompts");M(this,"finalPrompt");this.pipelinePrompts=r.pipelinePrompts,this.finalPrompt=r.finalPrompt,this.inputVariables=this.computeInputValues()}static lc_name(){return"PipelinePromptTemplate"}computeInputValues(){let r=this.pipelinePrompts.map(o=>o.name),n=this.pipelinePrompts.map(o=>o.prompt.inputVariables.filter(i=>!r.includes(i))).flat();return[...new Set(n)]}static extractRequiredInputValues(r,n){return n.reduce((o,i)=>(o[i]=r[i],o),{})}async formatPipelinePrompts(r){let n=await this.mergePartialAndUserVariables(r);for(let{name:o,prompt:i}of this.pipelinePrompts){let a=xhe.extractRequiredInputValues(n,i.inputVariables);i instanceof pd?n[o]=await i.formatMessages(a):n[o]=await i.format(a)}return xhe.extractRequiredInputValues(n,this.finalPrompt.inputVariables)}async formatPromptValue(r){return this.finalPrompt.formatPromptValue(await this.formatPipelinePrompts(r))}async format(r){return this.finalPrompt.format(await this.formatPipelinePrompts(r))}async partial(r){let n={...this};return n.inputVariables=this.inputVariables.filter(o=>!(o in r)),n.partialVariables={...this.partialVariables??{},...r},new xhe(n)}serialize(){throw new Error("Not implemented.")}_getPromptType(){return"pipeline"}}});function KMt(t){return typeof t=="object"&&t!=null&&"withStructuredOutput"in t&&typeof t.withStructuredOutput=="function"}function khn(t){return typeof t=="object"&&t!=null&&"lc_id"in t&&Array.isArray(t.lc_id)&&t.lc_id.join("/")==="langchain_core/runnables/RunnableBinding"}var WMt,ZMt=v(()=>{Yh();VQ();WMt=class GMt extends pd{constructor(r){super(r);M(this,"schema");M(this,"method");M(this,"lc_namespace",["langchain_core","prompts","structured"]);this.schema=r.schema,this.method=r.method}get lc_aliases(){return{...super.lc_aliases,schema:"schema_"}}pipe(r){if(KMt(r))return super.pipe(r.withStructuredOutput(this.schema));if(khn(r)&&KMt(r.bound))return super.pipe(new Jw({bound:r.bound.withStructuredOutput(this.schema,...this.method?[{method:this.method}]:[]),kwargs:r.kwargs??{},config:r.config,configFactories:r.configFactories}));throw new Error('Structured prompts need to be piped to a language model that supports the "withStructuredOutput()" method.')}static fromMessagesAndSchema(r,n,o){return GMt.fromMessages(r,{schema:n,method:o})}}});var qhn,Ev=v(()=>{Do();M6();LQ();Iz();whe();Z4e();Q4e();VQ();HMt();JMt();ZMt();qhn={};Tt(qhn,{AIMessagePromptTemplate:()=>Che,BaseChatPromptTemplate:()=>HQ,BaseMessagePromptTemplate:()=>zQ,BaseMessageStringPromptTemplate:()=>e2e,BasePromptTemplate:()=>Ww,BaseStringPromptTemplate:()=>wN,ChatMessagePromptTemplate:()=>t2e,ChatPromptTemplate:()=>pd,DEFAULT_FORMATTER_MAPPING:()=>qQ,DEFAULT_PARSER_MAPPING:()=>G4e,DictPromptTemplate:()=>UQ,FewShotChatMessagePromptTemplate:()=>UMt,FewShotPromptTemplate:()=>BMt,HumanMessagePromptTemplate:()=>a_,ImagePromptTemplate:()=>N6,MessagesPlaceholder:()=>vO,PipelinePromptTemplate:()=>VMt,PromptTemplate:()=>su,StructuredPrompt:()=>WMt,SystemMessagePromptTemplate:()=>Zw,checkValidTemplate:()=>SN,interpolateFString:()=>K4e,interpolateMustache:()=>W4e,parseFString:()=>Rz,parseMustache:()=>I6,parseTemplate:()=>Az,renderTemplate:()=>ry})});var Bhn,j6,Ohe=v(()=>{Bhn=Object.defineProperty,j6=(t,e)=>{for(var r in e)Bhn(t,r,{get:e[r],enumerable:!0})}});var Uhn,JQ,o2e=v(()=>{Ohe();Uhn={};j6(Uhn,{formatDocumentsAsString:()=>JQ});JQ=t=>t.map(e=>e.pageContent).join(` + +`)});function oh(t,e){let r=`atom${++zhn}`,n={toString(){return(Cl.env?Cl.env.MODE:void 0)!=="production"&&this.debugLabel?r+":"+this.debugLabel:r}};return typeof t=="function"?n.read=t:(n.init=t,n.read=Hhn,n.write=Vhn),e&&(n.write=e),n}function Hhn(t){return t(this)}function Vhn(t,e,r){return e(this,typeof r=="function"?r(t(this)):r)}var Cl,zhn,XMt,i2e,a2e,Ehe,u2e,Jhn,Khn,l2e,YMt,The,tRt,QMt,D6,s2e,Whn,Ghn,eRt,dL,rRt,$6,KQ,nRt,c2e=v(()=>{Cl={},zhn=0;XMt=(t,e)=>t.unstable_is?t.unstable_is(e):e===t,i2e=t=>"init"in t,a2e=t=>!!t.write,Ehe=new WeakMap,u2e=t=>{var e;return l2e(t)&&!((e=Ehe.get(t))!=null&&e[1])},Jhn=(t,e)=>{let r=Ehe.get(t);if(r)r[1]=!0,r[0].forEach(n=>n(e));else if((Cl.env?Cl.env.MODE:void 0)!=="production")throw new Error("[Bug] cancelable promise not found")},Khn=t=>{if(Ehe.has(t))return;let e=[new Set,!1];Ehe.set(t,e);let r=()=>{e[1]=!0};t.then(r,r),t.onCancel=n=>{e[0].add(n)}},l2e=t=>typeof t?.then=="function",YMt=t=>"v"in t||"e"in t,The=t=>{if("e"in t)throw t.e;if((Cl.env?Cl.env.MODE:void 0)!=="production"&&!("v"in t))throw new Error("[Bug] atom state is not initialized");return t.v},tRt=(t,e,r)=>{r.p.has(t)||(r.p.add(t),e.then(()=>{r.p.delete(t)},()=>{r.p.delete(t)}))},QMt=(t,e,r,n,o)=>{var i;if((Cl.env?Cl.env.MODE:void 0)!=="production"&&n===e)throw new Error("[Bug] atom cannot depend on itself");r.d.set(n,o.n),u2e(r.v)&&tRt(e,r.v,o),(i=o.m)==null||i.t.add(e),t&&Whn(t,n,e)},D6=()=>[new Map,new Map,new Set],s2e=(t,e,r)=>{t[0].has(e)||t[0].set(e,new Set),t[1].set(e,r)},Whn=(t,e,r)=>{let n=t[0].get(e);n&&n.add(r)},Ghn=(t,e)=>t[0].get(e),eRt=(t,e)=>{t[2].add(e)},dL=t=>{let e,r=!1,n=o=>{try{o()}catch(i){r||(e=i,r=!0)}};for(;t[1].size||t[2].size;){t[0].clear();let o=new Set(t[1].values());t[1].clear();let i=new Set(t[2]);t[2].clear(),o.forEach(a=>{var s;return(s=a.m)==null?void 0:s.l.forEach(n)}),i.forEach(n)}if(r)throw e},rRt=(...[t,e,r,n])=>{let o;(Cl.env?Cl.env.MODE:void 0)!=="production"&&(o=new Set);let i=(_,w,x)=>{let O="v"in w,E=w.v,T=u2e(w.v)?w.v:null;if(l2e(x)){Khn(x);for(let R of w.d.keys())tRt(_,x,t(R));w.v=x,delete w.e}else w.v=x,delete w.e;(!O||!Object.is(E,w.v))&&(++w.n,T&&Jhn(T,x))},a=(_,w,x)=>{var O;let E=t(w);if(YMt(E)&&(E.m&&!x?.has(w)||Array.from(E.d).every(([B,U])=>a(_,B,x).n===U)))return E;E.d.clear();let T=!0,R=B=>{if(XMt(w,B)){let J=t(B);if(!YMt(J))if(i2e(B))i(B,J,B.init);else throw new Error("no atom init");return The(J)}let U=a(_,B,x);try{return The(U)}finally{if(T)QMt(_,w,E,B,U);else{let J=D6();QMt(J,w,E,B,U),p(J,w,E),dL(J)}}},I,j,F={get signal(){return I||(I=new AbortController),I.signal},get setSelf(){return(Cl.env?Cl.env.MODE:void 0)!=="production"&&!a2e(w)&&console.warn("setSelf function cannot be used with read-only atom"),!j&&a2e(w)&&(j=(...B)=>{if((Cl.env?Cl.env.MODE:void 0)!=="production"&&T&&console.warn("setSelf function cannot be called in sync"),!T)return f(w,...B)}),j}};try{let B=e(w,R,F);if(i(w,E,B),l2e(B)){(O=B.onCancel)==null||O.call(B,()=>I?.abort());let U=()=>{if(E.m){let J=D6();p(J,w,E),dL(J)}};B.then(U,U)}return E}catch(B){return delete E.v,E.e=B,++E.n,E}finally{T=!1}},s=_=>The(a(void 0,_)),u=(_,w,x)=>{var O,E;let T=new Map;for(let R of((O=x.m)==null?void 0:O.t)||[])T.set(R,t(R));for(let R of x.p)T.set(R,t(R));return(E=Ghn(_,w))==null||E.forEach(R=>{T.set(R,t(R))}),T};function l(_,w,x){let O=[],E=new Set,T=new Set,R=[[w,x]];for(;R.length>0;){let[I,j]=R[R.length-1];if(T.has(I)){R.pop();continue}if(E.has(I)){O.push([I,j,j.n]),T.add(I),R.pop();continue}E.add(I);for(let[F,B]of u(_,I,j))I!==F&&!E.has(F)&&R.push([F,B])}return[O,T]}let c=(_,w,x)=>{let[O,E]=l(_,w,x),T=new Set([w]);for(let R=O.length-1;R>=0;--R){let[I,j,F]=O[R],B=!1;for(let U of j.d.keys())if(U!==I&&T.has(U)){B=!0;break}B&&(a(_,I,E),p(_,I,j),F!==j.n&&(s2e(_,I,j),T.add(I))),E.delete(I)}},d=(_,w,...x)=>{let O=!0,E=R=>The(a(_,R)),T=(R,...I)=>{let j=t(R);try{if(XMt(w,R)){if(!i2e(R))throw new Error("atom not writable");let F=j.n,B=I[0];i(R,j,B),p(_,R,j),F!==j.n&&(s2e(_,R,j),c(_,R,j));return}else return d(_,R,...I)}finally{O||dL(_)}};try{return r(w,E,T,...x)}finally{O=!1}},f=(_,...w)=>{let x=D6();try{return d(x,_,...w)}finally{dL(x)}},p=(_,w,x)=>{if(x.m&&!u2e(x.v)){for(let O of x.d.keys())x.m.d.has(O)||(m(_,O,t(O)).t.add(w),x.m.d.add(O));for(let O of x.m.d||[])if(!x.d.has(O)){x.m.d.delete(O);let E=h(_,O,t(O));E?.t.delete(w)}}},m=(_,w,x)=>{if(!x.m){a(_,w);for(let O of x.d.keys())m(_,O,t(O)).t.add(w);if(x.m={l:new Set,d:new Set(x.d.keys()),t:new Set},(Cl.env?Cl.env.MODE:void 0)!=="production"&&o.add(w),a2e(w)){let O=x.m,E,T=(R,I)=>{let j=!0;E=(...F)=>{try{return d(R,w,...F)}finally{j||dL(R)}};try{return I()}finally{j=!1}};eRt(_,()=>{let R=T(_,()=>n(w,(...I)=>E(...I)));R&&(O.u=I=>T(I,R))})}}return x.m},h=(_,w,x)=>{if(x.m&&!x.m.l.size&&!Array.from(x.m.t).some(O=>{var E;return(E=t(O).m)==null?void 0:E.d.has(w)})){let O=x.m.u;O&&eRt(_,()=>O(_)),delete x.m,(Cl.env?Cl.env.MODE:void 0)!=="production"&&o.delete(w);for(let E of x.d.keys()){let T=h(_,E,t(E));T?.t.delete(w)}return}return x.m},b={get:s,set:f,sub:(_,w)=>{let x=D6(),O=t(_),T=m(x,_,O).l;return T.add(w),dL(x),()=>{T.delete(w);let R=D6();h(R,_,O),dL(R)}},unstable_derive:_=>rRt(..._(t,e,r,n))};return(Cl.env?Cl.env.MODE:void 0)!=="production"&&Object.assign(b,{dev4_get_internal_weak_map:()=>({get:w=>{let x=t(w);if(x.n!==0)return x}}),dev4_get_mounted_atoms:()=>o,dev4_restore_atoms:w=>{let x=D6();for(let[O,E]of w)if(i2e(O)){let T=t(O),R=T.n;i(O,T,E),p(x,O,T),R!==T.n&&(s2e(x,O,T),c(x,O,T))}dL(x)}}),b},$6=()=>{let t=new WeakMap;return rRt(r=>{if((Cl.env?Cl.env.MODE:void 0)!=="production"&&!r)throw new Error("Atom is undefined or null");let n=t.get(r);return n||(n={d:new Map,p:new Set,n:0},t.set(r,n)),n},(r,...n)=>r.read(...n),(r,...n)=>r.write(...n),(r,...n)=>{var o;return(o=r.onMount)==null?void 0:o.call(r,...n)})},nRt=()=>(KQ||(KQ=$6(),(Cl.env?Cl.env.MODE:void 0)!=="production"&&(globalThis.__JOTAI_DEFAULT_STORE__||(globalThis.__JOTAI_DEFAULT_STORE__=KQ),globalThis.__JOTAI_DEFAULT_STORE__!==KQ&&console.warn("Detected multiple Jotai instances. It may cause unexpected behavior with the default store. https://github.com/pmndrs/jotai/discussions/2044"))),KQ)});var mRt=S(Ti=>{"use strict";var WQ=Symbol.for("react.element"),Zhn=Symbol.for("react.portal"),Xhn=Symbol.for("react.fragment"),Yhn=Symbol.for("react.strict_mode"),Qhn=Symbol.for("react.profiler"),egn=Symbol.for("react.provider"),tgn=Symbol.for("react.context"),rgn=Symbol.for("react.forward_ref"),ngn=Symbol.for("react.suspense"),ogn=Symbol.for("react.memo"),ign=Symbol.for("react.lazy"),oRt=Symbol.iterator;function agn(t){return t===null||typeof t!="object"?null:(t=oRt&&t[oRt]||t["@@iterator"],typeof t=="function"?t:null)}var sRt={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},uRt=Object.assign,lRt={};function L6(t,e,r){this.props=t,this.context=e,this.refs=lRt,this.updater=r||sRt}L6.prototype.isReactComponent={};L6.prototype.setState=function(t,e){if(typeof t!="object"&&typeof t!="function"&&t!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,t,e,"setState")};L6.prototype.forceUpdate=function(t){this.updater.enqueueForceUpdate(this,t,"forceUpdate")};function cRt(){}cRt.prototype=L6.prototype;function f2e(t,e,r){this.props=t,this.context=e,this.refs=lRt,this.updater=r||sRt}var p2e=f2e.prototype=new cRt;p2e.constructor=f2e;uRt(p2e,L6.prototype);p2e.isPureReactComponent=!0;var iRt=Array.isArray,dRt=Object.prototype.hasOwnProperty,m2e={current:null},fRt={key:!0,ref:!0,__self:!0,__source:!0};function pRt(t,e,r){var n,o={},i=null,a=null;if(e!=null)for(n in e.ref!==void 0&&(a=e.ref),e.key!==void 0&&(i=""+e.key),e)dRt.call(e,n)&&!fRt.hasOwnProperty(n)&&(o[n]=e[n]);var s=arguments.length-2;if(s===1)o.children=r;else if(1{"use strict";hRt.exports=mRt()});function Xw(t,e){let r=yRt(e),[[n,o,i],a]=(0,ny.useReducer)(l=>{let c=r.get(t);return Object.is(l[0],c)&&l[1]===r&&l[2]===t?l:[c,r,t]},void 0,()=>[r.get(t),r,t]),s=n;(o!==r||i!==t)&&(a(),s=r.get(t));let u=e?.delay;if((0,ny.useEffect)(()=>{let l=r.sub(t,()=>{if(typeof u=="number"){let c=r.get(t);y2e(c)&&bRt(gRt(c)),setTimeout(a,u);return}a()});return a(),l},[r,t,u]),(0,ny.useDebugValue)(s),y2e(s)){let l=gRt(s);return fgn(l)}return s}function pgn(t,e){let r=yRt(e);return(0,ny.useCallback)((...o)=>{if((Ahe.env?Ahe.env.MODE:void 0)!=="production"&&!("write"in t))throw new Error("not writable atom");return r.set(t,...o)},[r,t])}function Nz(t,e){return[Xw(t,e),pgn(t,e)]}var ny,Ahe,dgn,yRt,y2e,bRt,fgn,g2e,gRt,_Rt=v(()=>{"use client";ny=L(X(),1);c2e();Ahe={},dgn=(0,ny.createContext)(void 0),yRt=t=>{let e=(0,ny.useContext)(dgn);return t?.store||e||nRt()},y2e=t=>typeof t?.then=="function",bRt=t=>{t.status="pending",t.then(e=>{t.status="fulfilled",t.value=e},e=>{t.status="rejected",t.reason=e})},fgn=ny.default.use||(t=>{if(t.status==="pending")throw t;if(t.status==="fulfilled")return t.value;throw t.status==="rejected"?t.reason:(bRt(t),t)}),g2e=new WeakMap,gRt=t=>{let e=g2e.get(t);return e||(e=new Promise((r,n)=>{let o=t,i=u=>l=>{o===u&&r(l)},a=u=>l=>{o===u&&n(l)},s=u=>{"onCancel"in u&&typeof u.onCancel=="function"&&u.onCancel(l=>{if((Ahe.env?Ahe.env.MODE:void 0)!=="production"&&l===u)throw new Error("[Bug] p is not updated even after cancelation");y2e(l)?(g2e.set(l,e),o=l,l.then(i(l),a(l)),s(l)):r(l)})};t.then(i(t),a(t)),s(t)}),g2e.set(t,e)),e}});var CN=v(()=>{c2e();_Rt()});var GQ={};Jn(GQ,{getModelKeyFromModel:()=>Qn,getSettings:()=>ce,getSystemPrompt:()=>jz,getSystemPromptWithMemory:()=>ON,resetSettings:()=>b2e,sanitizeQaExclusions:()=>wRt,sanitizeSettings:()=>_2e,setSettings:()=>xN,settingsAtom:()=>fL,settingsStore:()=>Kn,subscribeToSettingsChange:()=>Yl,updateSetting:()=>ot,useSettingsValue:()=>Wn});function xN(t){let e=mgn({...ce(),...t});Kn.set(fL,e)}function wRt(t){let r=(typeof t=="string"?t:v2e).split(",").map(o=>decodeURIComponent(o.trim())).filter(o=>o.length>0),n=new Map;return r.forEach(o=>{let i=o.replace(/\/+$/,""),a=i.length>0?i:o;if(a===wO){n.set(wO,wO);return}if(!n.has(a)){let s=i.length>0&&o.endsWith("/")?`${i}/`:o;n.set(a,s)}}),n.set(wO,wO),Array.from(n.values()).map(o=>encodeURIComponent(o)).join(",")}function ot(t,e){let r=ce();xN({...r,[t]:e})}function ce(){return Kn.get(fL)}function b2e(){let t={...Ds,activeModels:SO.map(e=>({...e,enabled:!0})),activeEmbeddingModels:Dz.map(e=>({...e,enabled:!0}))};xN(t)}function Yl(t){let e=ce();return Kn.sub(fL,()=>{let r=ce();t(e,r),e=r})}function Wn(){return Xw(fL,{store:Kn})}function _2e(t){let e=t||Ds;e.userId||(e.userId=gv()),e.activeEmbeddingModels?e.activeEmbeddingModels=e.activeEmbeddingModels.map(p=>({...p,provider:p.provider==="azure_openai"?"azure openai":p.provider})):e.activeEmbeddingModels=Dz.map(p=>({...p,enabled:!0}));let r={...e},n=Number(e.temperature);r.temperature=isNaN(n)?Ds.temperature:n;let o=Number(e.maxTokens);r.maxTokens=isNaN(o)?Ds.maxTokens:o;let i=Number(e.contextTurns);r.contextTurns=isNaN(i)?Ds.contextTurns:i;let a=Number(e.embeddingRequestsPerMin);r.embeddingRequestsPerMin=isNaN(a)?Ds.embeddingRequestsPerMin:a;let s=Number(e.embeddingBatchSize);r.embeddingBatchSize=isNaN(s)?Ds.embeddingBatchSize:s;let u=Number(e.lexicalSearchRamLimit);isNaN(u)?r.lexicalSearchRamLimit=Ds.lexicalSearchRamLimit:r.lexicalSearchRamLimit=Math.min(1e3,Math.max(20,u)),typeof r.includeActiveNoteAsContext!="boolean"&&(r.includeActiveNoteAsContext=Ds.includeActiveNoteAsContext),typeof r.generateAIChatTitleOnSave!="boolean"&&(r.generateAIChatTitleOnSave=Ds.generateAIChatTitleOnSave),typeof r.passMarkdownImages!="boolean"&&(r.passMarkdownImages=Ds.passMarkdownImages),typeof r.enableInlineCitations!="boolean"&&(r.enableInlineCitations=Ds.enableInlineCitations),typeof r.enableCustomPromptTemplating!="boolean"&&(r.enableCustomPromptTemplating=Ds.enableCustomPromptTemplating);let l=Number(e.autonomousAgentMaxIterations);isNaN(l)||l<4||l>8?r.autonomousAgentMaxIterations=Ds.autonomousAgentMaxIterations:r.autonomousAgentMaxIterations=l,Array.isArray(r.autonomousAgentEnabledToolIds)||(r.autonomousAgentEnabledToolIds=Ds.autonomousAgentEnabledToolIds),(!r.memoryFolderName||typeof r.memoryFolderName!="string")&&(r.memoryFolderName=Ds.memoryFolderName),typeof r.enableRecentConversations!="boolean"&&(r.enableRecentConversations=Ds.enableRecentConversations),typeof r.enableSavedMemory!="boolean"&&(r.enableSavedMemory=Ds.enableSavedMemory);let c=Number(e.maxRecentConversations);isNaN(c)||c<10||c>50?r.maxRecentConversations=Ds.maxRecentConversations:r.maxRecentConversations=c,typeof r.autosaveChat!="boolean"&&(r.autosaveChat=Ds.autosaveChat),typeof r.quickCommandIncludeNoteContext!="boolean"&&(r.quickCommandIncludeNoteContext=Ds.quickCommandIncludeNoteContext),e.quickCommandModelKey!==void 0&&typeof e.quickCommandModelKey!="string"&&(r.quickCommandModelKey=Ds.quickCommandModelKey),typeof r.autoIncludeTextSelection!="boolean"&&(r.autoIncludeTextSelection=Ds.autoIncludeTextSelection),Object.values(ZQ).includes(r.defaultSendShortcut)||(r.defaultSendShortcut=Ds.defaultSendShortcut);let d=(e.defaultSaveFolder||"").trim();r.defaultSaveFolder=d.length>0?d:Ds.defaultSaveFolder;let f=(e.customPromptsFolder||"").trim();return r.customPromptsFolder=f.length>0?f:Ds.customPromptsFolder,r.qaExclusions=wRt(e.qaExclusions),r}function jz(){let t=ce().userSystemPrompt,e=SRt;return t?`${e} + +${t} +`:e}async function ON(t){let e=jz();if(!t)return H("No UserMemoryManager provided to getSystemPromptWithMemory"),e;let r=await t.getUserMemoryPrompt();return r?`${r} +${e}`:e}function mgn(t){return t.activeModels=vRt(t.activeModels,SO),t.activeEmbeddingModels=vRt(t.activeEmbeddingModels,Dz),t}function Qn(t){return`${t.name}|${t.provider}`}function vRt(t,e){let r=new Map;return e.filter(n=>n.core).forEach(n=>{r.set(Qn(n),{...n})}),t.forEach(n=>{let o=Qn(n),i=r.get(o);if(i){let a=e.find(s=>s.name===n.name&&s.provider===n.provider);a?r.set(o,{...a,...n,isBuiltIn:!0,believerExclusive:a.believerExclusive}):r.set(o,{...n,isBuiltIn:i.isBuiltIn})}else r.set(o,n)}),Array.from(r.values())}var Kn,fL,jt=v(()=>{CN();kU();Zr();Bt();Kn=$6(),fL=oh(Ds)});function Mo(t,e=!1){try{if(t instanceof Error){let n=t?.cause instanceof Error?t.cause.message:t?.cause?String(t.cause):"",o=e&&t.stack?t.stack:"",i=[t.message];return n&&i.push(`more message: ${n}`),o&&i.push(o),i.join(` +`)}return JSON.stringify(t)??String(t)}catch{return String(t)}}var w2e=v(()=>{});var S2e,bm,$z=v(()=>{w2e();yr();jt();S2e=class t{constructor(){this.maxLines=500;this.maxLineChars=8e3;this.buffer=[];this.initialized=!1;this.flushing=!1}static getInstance(){return t.instance||(t.instance=new t),t.instance}getLogPath(){return"copilot/copilot-log.md"}async ensureInitialized(){this.initialized||(this.initialized=!0)}hasVault(){try{return typeof app<"u"&&!!app.vault?.adapter}catch{return!1}}sanitizeForSingleLine(e){if(e instanceof Error){let r=Mo(e,!0);return this.escapeAngleBrackets(this.collapseToSingleLine(r))}if(typeof e=="string")return this.escapeAngleBrackets(this.collapseToSingleLine(e));try{let r=JSON.stringify(e);return this.escapeAngleBrackets(this.collapseToSingleLine(r??String(e)))}catch{return this.escapeAngleBrackets(this.collapseToSingleLine(String(e)))}}collapseToSingleLine(e){let r=e.replace(/[\r\n]+/g,"\\n").replace(/\t/g," ");return r.length<=this.maxLineChars?r:r.slice(0,this.maxLineChars)+` \u2026 [truncated ${r.length-this.maxLineChars} chars]`}async append(e,...r){await this.ensureInitialized();let n=new Date().toISOString(),o=r.map(a=>this.sanitizeForSingleLine(a)),i=`${n} ${e} ${o.join(" ")}`.trim();this.buffer.push(i),this.buffer.length>this.maxLines&&this.buffer.splice(0,this.buffer.length-this.maxLines)}escapeAngleBrackets(e){return e.replace(//g,">")}async appendMarkdownBlock(e){if(await this.ensureInitialized(),!(!Array.isArray(e)||e.length===0))for(let r of e){let n=typeof r=="string"?r:String(r??"");this.buffer.push(n),this.buffer.length>this.maxLines&&this.buffer.splice(0,this.buffer.length-this.maxLines)}}async flush(){if(this.hasVault()&&!this.flushing){this.flushing=!0;try{let e=this.getLogPath();if(await app.vault.adapter.exists(e)){let r=this.buffer.join(` +`)+(this.buffer.length?` +`:"");await app.vault.adapter.write(e,r)}}catch{}finally{this.flushing=!1}}}async clear(){if(this.buffer=[],!!this.hasVault())try{let e=this.getLogPath();await app.vault.adapter.exists(e)&&await app.vault.adapter.remove(e)}catch{}}sanitizeSettingsForLog(){let e=ce();return this.removeKeysRecursive(e)}removeKeysRecursive(e){if(e==null)return e;if(Array.isArray(e))return e.map(r=>this.removeKeysRecursive(r));if(typeof e=="object"&&e.constructor===Object){let r={},n=e;for(let[o,i]of Object.entries(n))/apiKey$/i.test(o)||/licenseKey$/i.test(o)||/_api_key$/i.test(o)||/_license_key$/i.test(o)||/orgId$/i.test(o)||/instanceName$/i.test(o)||/deploymentName$/i.test(o)||/apiVersion$/i.test(o)||(r[o]=this.removeKeysRecursive(i));return r}return e}async openLogFile(){if(!this.hasVault())return;let e=this.getLogPath(),r=[...this.buffer];try{let o=this.sanitizeSettingsForLog(),a=["","## Settings","```json",...JSON.stringify(o,null,2).split(` +`),"```"];r.push(...a)}catch{}try{let o=r.join(` +`)+(r.length?` +`:""),i=e.includes("/")?e.split("/").slice(0,-1).join("/"):"";i&&await Qh(i),await app.vault.adapter.exists(e)?await app.vault.adapter.write(e,o):await app.vault.create(e,o)}catch{}let n=app.vault.getAbstractFileByPath(e);try{n&&await app.workspace.getLeaf(!0).openFile(n)}catch{}}},bm=S2e.getInstance()});function H(...t){ce().debug&&console.log(...t),bm.append("INFO",...t)}function ue(...t){ce().debug&&console.error(...t),bm.append("ERROR",...t)}function it(...t){ce().debug&&console.warn(...t),bm.append("WARN",...t)}function Ihe(t){bm.appendMarkdownBlock(t)}function CRt(t,e){if(ce().debug)try{if(typeof console.table=="function"){Array.isArray(e)&&e.length>0?console.table(t,e):console.table(t);return}}catch{}H("Table:",JSON.stringify(t))}var Bt=v(()=>{jt();$z()});var xRt=S((C2e,F6)=>{(function(t,e){typeof C2e=="object"&&typeof F6<"u"?F6.exports=e():typeof define=="function"&&define.amd?define(e):t.moment=e()})(C2e,function(){"use strict";var t;function e(){return t.apply(null,arguments)}function r(C){t=C}function n(C){return C instanceof Array||Object.prototype.toString.call(C)==="[object Array]"}function o(C){return C!=null&&Object.prototype.toString.call(C)==="[object Object]"}function i(C,P){return Object.prototype.hasOwnProperty.call(C,P)}function a(C){if(Object.getOwnPropertyNames)return Object.getOwnPropertyNames(C).length===0;var P;for(P in C)if(i(C,P))return!1;return!0}function s(C){return C===void 0}function u(C){return typeof C=="number"||Object.prototype.toString.call(C)==="[object Number]"}function l(C){return C instanceof Date||Object.prototype.toString.call(C)==="[object Date]"}function c(C,P){var N=[],k,W=C.length;for(k=0;k>>0,k;for(k=0;k0)for(N=0;N=0;return(le?N?"+":"":"-")+Math.pow(10,Math.max(0,W)).toString().substr(1)+k}var z=/(\[[^\[]*\])|(\\)?([Hh]mm(ss)?|Mo|MM?M?M?|Do|DDDo|DD?D?D?|ddd?d?|do?|w[o|w]?|W[o|W]?|Qo?|N{1,5}|YYYYYY|YYYYY|YYYY|YY|y{2,4}|yo?|gg(ggg?)?|GG(GGG?)?|e|E|a|A|hh?|HH?|kk?|mm?|ss?|S{1,9}|x|X|zz?|ZZ?|.)/g,ee=/(\[[^\[]*\])|(\\)?(LTS|LT|LL?L?L?|l{1,4})/g,ie={},Z={};function $(C,P,N,k){var W=k;typeof k=="string"&&(W=function(){return this[k]()}),C&&(Z[C]=W),P&&(Z[P[0]]=function(){return ne(W.apply(this,arguments),P[1],P[2])}),N&&(Z[N]=function(){return this.localeData().ordinal(W.apply(this,arguments),C)})}function q(C){return C.match(/\[[\s\S]/)?C.replace(/^\[|\]$/g,""):C.replace(/\\/g,"")}function Y(C){var P=C.match(z),N,k;for(N=0,k=P.length;N=0&&ee.test(C);)C=C.replace(ee,k),ee.lastIndex=0,N-=1;return C}var V={LTS:"h:mm:ss A",LT:"h:mm A",L:"MM/DD/YYYY",LL:"MMMM D, YYYY",LLL:"MMMM D, YYYY h:mm A",LLLL:"dddd, MMMM D, YYYY h:mm A"};function K(C){var P=this._longDateFormat[C],N=this._longDateFormat[C.toUpperCase()];return P||!N?P:(this._longDateFormat[C]=N.match(z).map(function(k){return k==="MMMM"||k==="MM"||k==="DD"||k==="dddd"?k.slice(1):k}).join(""),this._longDateFormat[C])}var se="Invalid date";function be(){return this._invalidDate}var xe="%d",Pe=/\d{1,2}/;function pt(C){return this._ordinal.replace("%d",C)}var Ht={future:"in %s",past:"%s ago",s:"a few seconds",ss:"%d seconds",m:"a minute",mm:"%d minutes",h:"an hour",hh:"%d hours",d:"a day",dd:"%d days",w:"a week",ww:"%d weeks",M:"a month",MM:"%d months",y:"a year",yy:"%d years"};function Ze(C,P,N,k){var W=this._relativeTime[N];return j(W)?W(C,P,N,k):W.replace(/%d/i,C)}function Yr(C,P){var N=this._relativeTime[C>0?"future":"past"];return j(N)?N(P):N.replace(/%s/i,P)}var Vt={};function gt(C,P){var N=C.toLowerCase();Vt[N]=Vt[N+"s"]=Vt[P]=C}function Ie(C){return typeof C=="string"?Vt[C]||Vt[C.toLowerCase()]:void 0}function _n(C){var P={},N,k;for(k in C)i(C,k)&&(N=Ie(k),N&&(P[N]=C[k]));return P}var Ct={};function Fe(C,P){Ct[C]=P}function At(C){var P=[],N;for(N in C)i(C,N)&&P.push({unit:N,priority:Ct[N]});return P.sort(function(k,W){return k.priority-W.priority}),P}function ke(C){return C%4===0&&C%100!==0||C%400===0}function ze(C){return C<0?Math.ceil(C)||0:Math.floor(C)}function $e(C){var P=+C,N=0;return P!==0&&isFinite(P)&&(N=ze(P)),N}function Pt(C,P){return function(N){return N!=null?(Wl(this,C,N),e.updateOffset(this,P),this):To(this,C)}}function To(C,P){return C.isValid()?C._d["get"+(C._isUTC?"UTC":"")+P]():NaN}function Wl(C,P,N){C.isValid()&&!isNaN(N)&&(P==="FullYear"&&ke(C.year())&&C.month()===1&&C.date()===29?(N=$e(N),C._d["set"+(C._isUTC?"UTC":"")+P](N,C.month(),gfe(N,C.month()))):C._d["set"+(C._isUTC?"UTC":"")+P](N))}function vn(C){return C=Ie(C),j(this[C])?this[C]():this}function si(C,P){if(typeof C=="object"){C=_n(C);var N=At(C),k,W=N.length;for(k=0;k68?1900:2e3)};var Ovt=Pt("FullYear",!0);function Irn(){return ke(this.year())}function Nrn(C,P,N,k,W,le,Ae){var Gr;return C<100&&C>=0?(Gr=new Date(C+400,P,N,k,W,le,Ae),isFinite(Gr.getFullYear())&&Gr.setFullYear(C)):Gr=new Date(C,P,N,k,W,le,Ae),Gr}function rY(C){var P,N;return C<100&&C>=0?(N=Array.prototype.slice.call(arguments),N[0]=C+400,P=new Date(Date.UTC.apply(null,N)),isFinite(P.getUTCFullYear())&&P.setUTCFullYear(C)):P=new Date(Date.UTC.apply(null,arguments)),P}function yfe(C,P,N){var k=7+P-N,W=(7+rY(C,0,k).getUTCDay()-P)%7;return-W+k-1}function Tvt(C,P,N,k,W){var le=(7+N-k)%7,Ae=yfe(C,k,W),Gr=1+7*(P-1)+le+Ae,Yo,iu;return Gr<=0?(Yo=C-1,iu=tY(Yo)+Gr):Gr>tY(C)?(Yo=C+1,iu=Gr-tY(C)):(Yo=C,iu=Gr),{year:Yo,dayOfYear:iu}}function nY(C,P,N){var k=yfe(C.year(),P,N),W=Math.floor((C.dayOfYear()-k-1)/7)+1,le,Ae;return W<1?(Ae=C.year()-1,le=W+ZI(Ae,P,N)):W>ZI(C.year(),P,N)?(le=W-ZI(C.year(),P,N),Ae=C.year()+1):(Ae=C.year(),le=W),{week:le,year:Ae}}function ZI(C,P,N){var k=yfe(C,P,N),W=yfe(C+1,P,N);return(tY(C)-k+W)/7}$("w",["ww",2],"wo","week"),$("W",["WW",2],"Wo","isoWeek"),gt("week","w"),gt("isoWeek","W"),Fe("week",5),Fe("isoWeek",5),wt("w",We),wt("ww",We,Ue),wt("W",We),wt("WW",We,Ue),q0(["w","ww","W","WW"],function(C,P,N,k){P[k.substr(0,1)]=$e(C)});function jrn(C){return nY(C,this._week.dow,this._week.doy).week}var Drn={dow:0,doy:6};function $rn(){return this._week.dow}function Lrn(){return this._week.doy}function Frn(C){var P=this.localeData().week(this);return C==null?P:this.add((C-P)*7,"d")}function krn(C){var P=nY(this,1,4).week;return C==null?P:this.add((C-P)*7,"d")}$("d",0,"do","day"),$("dd",0,0,function(C){return this.localeData().weekdaysMin(this,C)}),$("ddd",0,0,function(C){return this.localeData().weekdaysShort(this,C)}),$("dddd",0,0,function(C){return this.localeData().weekdays(this,C)}),$("e",0,0,"weekday"),$("E",0,0,"isoWeekday"),gt("day","d"),gt("weekday","e"),gt("isoWeekday","E"),Fe("day",11),Fe("weekday",11),Fe("isoWeekday",11),wt("d",We),wt("e",We),wt("E",We),wt("dd",function(C,P){return P.weekdaysMinRegex(C)}),wt("ddd",function(C,P){return P.weekdaysShortRegex(C)}),wt("dddd",function(C,P){return P.weekdaysRegex(C)}),q0(["dd","ddd","dddd"],function(C,P,N,k){var W=N._locale.weekdaysParse(C,k,N._strict);W!=null?P.d=W:m(N).invalidWeekday=C}),q0(["d","e","E"],function(C,P,N,k){P[k]=$e(C)});function qrn(C,P){return typeof C!="string"?C:isNaN(C)?(C=P.weekdaysParse(C),typeof C=="number"?C:null):parseInt(C,10)}function Brn(C,P){return typeof C=="string"?P.weekdaysParse(C)%7||7:isNaN(C)?null:C}function yFe(C,P){return C.slice(P,7).concat(C.slice(0,P))}var Urn="Sunday_Monday_Tuesday_Wednesday_Thursday_Friday_Saturday".split("_"),Evt="Sun_Mon_Tue_Wed_Thu_Fri_Sat".split("_"),zrn="Su_Mo_Tu_We_Th_Fr_Sa".split("_"),Hrn=pm,Vrn=pm,Jrn=pm;function Krn(C,P){var N=n(this._weekdays)?this._weekdays:this._weekdays[C&&C!==!0&&this._weekdays.isFormat.test(P)?"format":"standalone"];return C===!0?yFe(N,this._week.dow):C?N[C.day()]:N}function Wrn(C){return C===!0?yFe(this._weekdaysShort,this._week.dow):C?this._weekdaysShort[C.day()]:this._weekdaysShort}function Grn(C){return C===!0?yFe(this._weekdaysMin,this._week.dow):C?this._weekdaysMin[C.day()]:this._weekdaysMin}function Zrn(C,P,N){var k,W,le,Ae=C.toLocaleLowerCase();if(!this._weekdaysParse)for(this._weekdaysParse=[],this._shortWeekdaysParse=[],this._minWeekdaysParse=[],k=0;k<7;++k)le=f([2e3,1]).day(k),this._minWeekdaysParse[k]=this.weekdaysMin(le,"").toLocaleLowerCase(),this._shortWeekdaysParse[k]=this.weekdaysShort(le,"").toLocaleLowerCase(),this._weekdaysParse[k]=this.weekdays(le,"").toLocaleLowerCase();return N?P==="dddd"?(W=Bc.call(this._weekdaysParse,Ae),W!==-1?W:null):P==="ddd"?(W=Bc.call(this._shortWeekdaysParse,Ae),W!==-1?W:null):(W=Bc.call(this._minWeekdaysParse,Ae),W!==-1?W:null):P==="dddd"?(W=Bc.call(this._weekdaysParse,Ae),W!==-1||(W=Bc.call(this._shortWeekdaysParse,Ae),W!==-1)?W:(W=Bc.call(this._minWeekdaysParse,Ae),W!==-1?W:null)):P==="ddd"?(W=Bc.call(this._shortWeekdaysParse,Ae),W!==-1||(W=Bc.call(this._weekdaysParse,Ae),W!==-1)?W:(W=Bc.call(this._minWeekdaysParse,Ae),W!==-1?W:null)):(W=Bc.call(this._minWeekdaysParse,Ae),W!==-1||(W=Bc.call(this._weekdaysParse,Ae),W!==-1)?W:(W=Bc.call(this._shortWeekdaysParse,Ae),W!==-1?W:null))}function Xrn(C,P,N){var k,W,le;if(this._weekdaysParseExact)return Zrn.call(this,C,P,N);for(this._weekdaysParse||(this._weekdaysParse=[],this._minWeekdaysParse=[],this._shortWeekdaysParse=[],this._fullWeekdaysParse=[]),k=0;k<7;k++){if(W=f([2e3,1]).day(k),N&&!this._fullWeekdaysParse[k]&&(this._fullWeekdaysParse[k]=new RegExp("^"+this.weekdays(W,"").replace(".","\\.?")+"$","i"),this._shortWeekdaysParse[k]=new RegExp("^"+this.weekdaysShort(W,"").replace(".","\\.?")+"$","i"),this._minWeekdaysParse[k]=new RegExp("^"+this.weekdaysMin(W,"").replace(".","\\.?")+"$","i")),this._weekdaysParse[k]||(le="^"+this.weekdays(W,"")+"|^"+this.weekdaysShort(W,"")+"|^"+this.weekdaysMin(W,""),this._weekdaysParse[k]=new RegExp(le.replace(".",""),"i")),N&&P==="dddd"&&this._fullWeekdaysParse[k].test(C))return k;if(N&&P==="ddd"&&this._shortWeekdaysParse[k].test(C))return k;if(N&&P==="dd"&&this._minWeekdaysParse[k].test(C))return k;if(!N&&this._weekdaysParse[k].test(C))return k}}function Yrn(C){if(!this.isValid())return C!=null?this:NaN;var P=this._isUTC?this._d.getUTCDay():this._d.getDay();return C!=null?(C=qrn(C,this.localeData()),this.add(C-P,"d")):P}function Qrn(C){if(!this.isValid())return C!=null?this:NaN;var P=(this.day()+7-this.localeData()._week.dow)%7;return C==null?P:this.add(C-P,"d")}function enn(C){if(!this.isValid())return C!=null?this:NaN;if(C!=null){var P=Brn(C,this.localeData());return this.day(this.day()%7?P:P-7)}else return this.day()||7}function tnn(C){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||bFe.call(this),C?this._weekdaysStrictRegex:this._weekdaysRegex):(i(this,"_weekdaysRegex")||(this._weekdaysRegex=Hrn),this._weekdaysStrictRegex&&C?this._weekdaysStrictRegex:this._weekdaysRegex)}function rnn(C){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||bFe.call(this),C?this._weekdaysShortStrictRegex:this._weekdaysShortRegex):(i(this,"_weekdaysShortRegex")||(this._weekdaysShortRegex=Vrn),this._weekdaysShortStrictRegex&&C?this._weekdaysShortStrictRegex:this._weekdaysShortRegex)}function nnn(C){return this._weekdaysParseExact?(i(this,"_weekdaysRegex")||bFe.call(this),C?this._weekdaysMinStrictRegex:this._weekdaysMinRegex):(i(this,"_weekdaysMinRegex")||(this._weekdaysMinRegex=Jrn),this._weekdaysMinStrictRegex&&C?this._weekdaysMinStrictRegex:this._weekdaysMinRegex)}function bFe(){function C(Jy,tN){return tN.length-Jy.length}var P=[],N=[],k=[],W=[],le,Ae,Gr,Yo,iu;for(le=0;le<7;le++)Ae=f([2e3,1]).day(le),Gr=mm(this.weekdaysMin(Ae,"")),Yo=mm(this.weekdaysShort(Ae,"")),iu=mm(this.weekdays(Ae,"")),P.push(Gr),N.push(Yo),k.push(iu),W.push(Gr),W.push(Yo),W.push(iu);P.sort(C),N.sort(C),k.sort(C),W.sort(C),this._weekdaysRegex=new RegExp("^("+W.join("|")+")","i"),this._weekdaysShortRegex=this._weekdaysRegex,this._weekdaysMinRegex=this._weekdaysRegex,this._weekdaysStrictRegex=new RegExp("^("+k.join("|")+")","i"),this._weekdaysShortStrictRegex=new RegExp("^("+N.join("|")+")","i"),this._weekdaysMinStrictRegex=new RegExp("^("+P.join("|")+")","i")}function _Fe(){return this.hours()%12||12}function onn(){return this.hours()||24}$("H",["HH",2],0,"hour"),$("h",["hh",2],0,_Fe),$("k",["kk",2],0,onn),$("hmm",0,0,function(){return""+_Fe.apply(this)+ne(this.minutes(),2)}),$("hmmss",0,0,function(){return""+_Fe.apply(this)+ne(this.minutes(),2)+ne(this.seconds(),2)}),$("Hmm",0,0,function(){return""+this.hours()+ne(this.minutes(),2)}),$("Hmmss",0,0,function(){return""+this.hours()+ne(this.minutes(),2)+ne(this.seconds(),2)});function Pvt(C,P){$(C,0,0,function(){return this.localeData().meridiem(this.hours(),this.minutes(),P)})}Pvt("a",!0),Pvt("A",!1),gt("hour","h"),Fe("hour",13);function Mvt(C,P){return P._meridiemParse}wt("a",Mvt),wt("A",Mvt),wt("H",We),wt("h",We),wt("k",We),wt("HH",We,Ue),wt("hh",We,Ue),wt("kk",We,Ue),wt("hmm",It),wt("hmmss",Sr),wt("Hmm",It),wt("Hmmss",Sr),_i(["H","HH"],hm),_i(["k","kk"],function(C,P,N){var k=$e(C);P[hm]=k===24?0:k}),_i(["a","A"],function(C,P,N){N._isPm=N._locale.isPM(C),N._meridiem=C}),_i(["h","hh"],function(C,P,N){P[hm]=$e(C),m(N).bigHour=!0}),_i("hmm",function(C,P,N){var k=C.length-2;P[hm]=$e(C.substr(0,k)),P[B0]=$e(C.substr(k)),m(N).bigHour=!0}),_i("hmmss",function(C,P,N){var k=C.length-4,W=C.length-2;P[hm]=$e(C.substr(0,k)),P[B0]=$e(C.substr(k,2)),P[GI]=$e(C.substr(W)),m(N).bigHour=!0}),_i("Hmm",function(C,P,N){var k=C.length-2;P[hm]=$e(C.substr(0,k)),P[B0]=$e(C.substr(k))}),_i("Hmmss",function(C,P,N){var k=C.length-4,W=C.length-2;P[hm]=$e(C.substr(0,k)),P[B0]=$e(C.substr(k,2)),P[GI]=$e(C.substr(W))});function inn(C){return(C+"").toLowerCase().charAt(0)==="p"}var ann=/[ap]\.?m?\.?/i,snn=Pt("Hours",!0);function unn(C,P,N){return C>11?N?"pm":"PM":N?"am":"AM"}var Rvt={calendar:G,longDateFormat:V,invalidDate:se,ordinal:xe,dayOfMonthOrdinalParse:Pe,relativeTime:Ht,months:Srn,monthsShort:vvt,week:Drn,weekdays:Urn,weekdaysMin:zrn,weekdaysShort:Evt,meridiemParse:ann},bl={},oY={},iY;function lnn(C,P){var N,k=Math.min(C.length,P.length);for(N=0;N0;){if(W=bfe(le.slice(0,N).join("-")),W)return W;if(k&&k.length>=N&&lnn(le,k)>=N-1)break;N--}P++}return iY}function dnn(C){return C.match("^[^/\\\\]*$")!=null}function bfe(C){var P=null,N;if(bl[C]===void 0&&typeof F6<"u"&&F6&&F6.exports&&dnn(C))try{P=iY._abbr,N=require,N("./locale/"+C),j$(P)}catch{bl[C]=null}return bl[C]}function j$(C,P){var N;return C&&(s(P)?N=XI(C):N=vFe(C,P),N?iY=N:typeof console<"u"&&console.warn&&console.warn("Locale "+C+" not found. Did you forget to load it?")),iY._abbr}function vFe(C,P){if(P!==null){var N,k=Rvt;if(P.abbr=C,bl[C]!=null)I("defineLocaleOverride","use moment.updateLocale(localeName, config) to change an existing locale. moment.defineLocale(localeName, config) should only be used for creating a new locale See http://momentjs.com/guides/#/warnings/define-locale/ for more info."),k=bl[C]._config;else if(P.parentLocale!=null)if(bl[P.parentLocale]!=null)k=bl[P.parentLocale]._config;else if(N=bfe(P.parentLocale),N!=null)k=N._config;else return oY[P.parentLocale]||(oY[P.parentLocale]=[]),oY[P.parentLocale].push({name:C,config:P}),null;return bl[C]=new U(B(k,P)),oY[C]&&oY[C].forEach(function(W){vFe(W.name,W.config)}),j$(C),bl[C]}else return delete bl[C],null}function fnn(C,P){if(P!=null){var N,k,W=Rvt;bl[C]!=null&&bl[C].parentLocale!=null?bl[C].set(B(bl[C]._config,P)):(k=bfe(C),k!=null&&(W=k._config),P=B(W,P),k==null&&(P.abbr=C),N=new U(P),N.parentLocale=bl[C],bl[C]=N),j$(C)}else bl[C]!=null&&(bl[C].parentLocale!=null?(bl[C]=bl[C].parentLocale,C===j$()&&j$(C)):bl[C]!=null&&delete bl[C]);return bl[C]}function XI(C){var P;if(C&&C._locale&&C._locale._abbr&&(C=C._locale._abbr),!C)return iY;if(!n(C)){if(P=bfe(C),P)return P;C=[C]}return cnn(C)}function pnn(){return J(bl)}function wFe(C){var P,N=C._a;return N&&m(C).overflow===-2&&(P=N[WI]<0||N[WI]>11?WI:N[nO]<1||N[nO]>gfe(N[Kg],N[WI])?nO:N[hm]<0||N[hm]>24||N[hm]===24&&(N[B0]!==0||N[GI]!==0||N[$U]!==0)?hm:N[B0]<0||N[B0]>59?B0:N[GI]<0||N[GI]>59?GI:N[$U]<0||N[$U]>999?$U:-1,m(C)._overflowDayOfYear&&(PnO)&&(P=nO),m(C)._overflowWeeks&&P===-1&&(P=_rn),m(C)._overflowWeekday&&P===-1&&(P=vrn),m(C).overflow=P),C}var mnn=/^\s*((?:[+-]\d{6}|\d{4})-(?:\d\d-\d\d|W\d\d-\d|W\d\d|\d\d\d|\d\d))(?:(T| )(\d\d(?::\d\d(?::\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,hnn=/^\s*((?:[+-]\d{6}|\d{4})(?:\d\d\d\d|W\d\d\d|W\d\d|\d\d\d|\d\d|))(?:(T| )(\d\d(?:\d\d(?:\d\d(?:[.,]\d+)?)?)?)([+-]\d\d(?::?\d\d)?|\s*Z)?)?$/,gnn=/Z|[+-]\d\d(?::?\d\d)?/,_fe=[["YYYYYY-MM-DD",/[+-]\d{6}-\d\d-\d\d/],["YYYY-MM-DD",/\d{4}-\d\d-\d\d/],["GGGG-[W]WW-E",/\d{4}-W\d\d-\d/],["GGGG-[W]WW",/\d{4}-W\d\d/,!1],["YYYY-DDD",/\d{4}-\d{3}/],["YYYY-MM",/\d{4}-\d\d/,!1],["YYYYYYMMDD",/[+-]\d{10}/],["YYYYMMDD",/\d{8}/],["GGGG[W]WWE",/\d{4}W\d{3}/],["GGGG[W]WW",/\d{4}W\d{2}/,!1],["YYYYDDD",/\d{7}/],["YYYYMM",/\d{6}/,!1],["YYYY",/\d{4}/,!1]],SFe=[["HH:mm:ss.SSSS",/\d\d:\d\d:\d\d\.\d+/],["HH:mm:ss,SSSS",/\d\d:\d\d:\d\d,\d+/],["HH:mm:ss",/\d\d:\d\d:\d\d/],["HH:mm",/\d\d:\d\d/],["HHmmss.SSSS",/\d\d\d\d\d\d\.\d+/],["HHmmss,SSSS",/\d\d\d\d\d\d,\d+/],["HHmmss",/\d\d\d\d\d\d/],["HHmm",/\d\d\d\d/],["HH",/\d\d/]],ynn=/^\/?Date\((-?\d+)/i,bnn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),?\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|([+-]\d{4}))$/,_nn={UT:0,GMT:0,EDT:-4*60,EST:-5*60,CDT:-5*60,CST:-6*60,MDT:-6*60,MST:-7*60,PDT:-7*60,PST:-8*60};function Ivt(C){var P,N,k=C._i,W=mnn.exec(k)||hnn.exec(k),le,Ae,Gr,Yo,iu=_fe.length,Jy=SFe.length;if(W){for(m(C).iso=!0,P=0,N=iu;PtY(Ae)||C._dayOfYear===0)&&(m(C)._overflowDayOfYear=!0),N=rY(Ae,0,C._dayOfYear),C._a[WI]=N.getUTCMonth(),C._a[nO]=N.getUTCDate()),P=0;P<3&&C._a[P]==null;++P)C._a[P]=k[P]=W[P];for(;P<7;P++)C._a[P]=k[P]=C._a[P]==null?P===2?1:0:C._a[P];C._a[hm]===24&&C._a[B0]===0&&C._a[GI]===0&&C._a[$U]===0&&(C._nextDay=!0,C._a[hm]=0),C._d=(C._useUTC?rY:Nrn).apply(null,k),le=C._useUTC?C._d.getUTCDay():C._d.getDay(),C._tzm!=null&&C._d.setUTCMinutes(C._d.getUTCMinutes()-C._tzm),C._nextDay&&(C._a[hm]=24),C._w&&typeof C._w.d<"u"&&C._w.d!==le&&(m(C).weekdayMismatch=!0)}}function Enn(C){var P,N,k,W,le,Ae,Gr,Yo,iu;P=C._w,P.GG!=null||P.W!=null||P.E!=null?(le=1,Ae=4,N=H3(P.GG,C._a[Kg],nY(Zu(),1,4).year),k=H3(P.W,1),W=H3(P.E,1),(W<1||W>7)&&(Yo=!0)):(le=C._locale._week.dow,Ae=C._locale._week.doy,iu=nY(Zu(),le,Ae),N=H3(P.gg,C._a[Kg],iu.year),k=H3(P.w,iu.week),P.d!=null?(W=P.d,(W<0||W>6)&&(Yo=!0)):P.e!=null?(W=P.e+le,(P.e<0||P.e>6)&&(Yo=!0)):W=le),k<1||k>ZI(N,le,Ae)?m(C)._overflowWeeks=!0:Yo!=null?m(C)._overflowWeekday=!0:(Gr=Tvt(N,k,W,le,Ae),C._a[Kg]=Gr.year,C._dayOfYear=Gr.dayOfYear)}e.ISO_8601=function(){},e.RFC_2822=function(){};function xFe(C){if(C._f===e.ISO_8601){Ivt(C);return}if(C._f===e.RFC_2822){Nvt(C);return}C._a=[],m(C).empty=!0;var P=""+C._i,N,k,W,le,Ae,Gr=P.length,Yo=0,iu,Jy;for(W=A(C._f,C._locale).match(z)||[],Jy=W.length,N=0;N0&&m(C).unusedInput.push(Ae),P=P.slice(P.indexOf(k)+k.length),Yo+=k.length),Z[le]?(k?m(C).empty=!1:m(C).unusedTokens.push(le),eY(le,k,C)):C._strict&&!k&&m(C).unusedTokens.push(le);m(C).charsLeftOver=Gr-Yo,P.length>0&&m(C).unusedInput.push(P),C._a[hm]<=12&&m(C).bigHour===!0&&C._a[hm]>0&&(m(C).bigHour=void 0),m(C).parsedDateParts=C._a.slice(0),m(C).meridiem=C._meridiem,C._a[hm]=Pnn(C._locale,C._a[hm],C._meridiem),iu=m(C).era,iu!==null&&(C._a[Kg]=C._locale.erasConvertYear(iu,C._a[Kg])),CFe(C),wFe(C)}function Pnn(C,P,N){var k;return N==null?P:C.meridiemHour!=null?C.meridiemHour(P,N):(C.isPM!=null&&(k=C.isPM(N),k&&P<12&&(P+=12),!k&&P===12&&(P=0)),P)}function Mnn(C){var P,N,k,W,le,Ae,Gr=!1,Yo=C._f.length;if(Yo===0){m(C).invalidFormat=!0,C._d=new Date(NaN);return}for(W=0;Wthis?this:C:y()});function $vt(C,P){var N,k;if(P.length===1&&n(P[0])&&(P=P[0]),!P.length)return Zu();for(N=P[0],k=1;kthis.clone().month(0).utcOffset()||this.utcOffset()>this.clone().month(5).utcOffset()}function Znn(){if(!s(this._isDSTShifted))return this._isDSTShifted;var C={},P;return w(C,this),C=jvt(C),C._a?(P=C._isUTC?f(C._a):Zu(C._a),this._isDSTShifted=this.isValid()&&Bnn(C._a,P.toArray())>0):this._isDSTShifted=!1,this._isDSTShifted}function Xnn(){return this.isValid()?!this._isUTC:!1}function Ynn(){return this.isValid()?this._isUTC:!1}function Fvt(){return this.isValid()?this._isUTC&&this._offset===0:!1}var Qnn=/^(-|\+)?(?:(\d*)[. ])?(\d+):(\d+)(?::(\d+)(\.\d*)?)?$/,eon=/^(-|\+)?P(?:([-+]?[0-9,.]*)Y)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)W)?(?:([-+]?[0-9,.]*)D)?(?:T(?:([-+]?[0-9,.]*)H)?(?:([-+]?[0-9,.]*)M)?(?:([-+]?[0-9,.]*)S)?)?$/;function U0(C,P){var N=C,k=null,W,le,Ae;return wfe(C)?N={ms:C._milliseconds,d:C._days,M:C._months}:u(C)||!isNaN(+C)?(N={},P?N[P]=+C:N.milliseconds=+C):(k=Qnn.exec(C))?(W=k[1]==="-"?-1:1,N={y:0,d:$e(k[nO])*W,h:$e(k[hm])*W,m:$e(k[B0])*W,s:$e(k[GI])*W,ms:$e(OFe(k[$U]*1e3))*W}):(k=eon.exec(C))?(W=k[1]==="-"?-1:1,N={y:LU(k[2],W),M:LU(k[3],W),w:LU(k[4],W),d:LU(k[5],W),h:LU(k[6],W),m:LU(k[7],W),s:LU(k[8],W)}):N==null?N={}:typeof N=="object"&&("from"in N||"to"in N)&&(Ae=ton(Zu(N.from),Zu(N.to)),N={},N.ms=Ae.milliseconds,N.M=Ae.months),le=new vfe(N),wfe(C)&&i(C,"_locale")&&(le._locale=C._locale),wfe(C)&&i(C,"_isValid")&&(le._isValid=C._isValid),le}U0.fn=vfe.prototype,U0.invalid=qnn;function LU(C,P){var N=C&&parseFloat(C.replace(",","."));return(isNaN(N)?0:N)*P}function kvt(C,P){var N={};return N.months=P.month()-C.month()+(P.year()-C.year())*12,C.clone().add(N.months,"M").isAfter(P)&&--N.months,N.milliseconds=+P-+C.clone().add(N.months,"M"),N}function ton(C,P){var N;return C.isValid()&&P.isValid()?(P=EFe(P,C),C.isBefore(P)?N=kvt(C,P):(N=kvt(P,C),N.milliseconds=-N.milliseconds,N.months=-N.months),N):{milliseconds:0,months:0}}function qvt(C,P){return function(N,k){var W,le;return k!==null&&!isNaN(+k)&&(I(P,"moment()."+P+"(period, number) is deprecated. Please use moment()."+P+"(number, period). See http://momentjs.com/guides/#/warnings/add-inverted-param/ for more info."),le=N,N=k,k=le),W=U0(N,k),Bvt(this,W,C),this}}function Bvt(C,P,N,k){var W=P._milliseconds,le=OFe(P._days),Ae=OFe(P._months);C.isValid()&&(k=k??!0,Ae&&Svt(C,To(C,"Month")+Ae*N),le&&Wl(C,"Date",To(C,"Date")+le*N),W&&C._d.setTime(C._d.valueOf()+W*N),k&&e.updateOffset(C,le||Ae))}var ron=qvt(1,"add"),non=qvt(-1,"subtract");function Uvt(C){return typeof C=="string"||C instanceof String}function oon(C){return O(C)||l(C)||Uvt(C)||u(C)||aon(C)||ion(C)||C===null||C===void 0}function ion(C){var P=o(C)&&!a(C),N=!1,k=["years","year","y","months","month","M","days","day","d","dates","date","D","hours","hour","h","minutes","minute","m","seconds","second","s","milliseconds","millisecond","ms"],W,le,Ae=k.length;for(W=0;WN.valueOf():N.valueOf()9999?D(N,P?"YYYYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYYYY-MM-DD[T]HH:mm:ss.SSSZ"):j(Date.prototype.toISOString)?P?this.toDate().toISOString():new Date(this.valueOf()+this.utcOffset()*60*1e3).toISOString().replace("Z",D(N,"Z")):D(N,P?"YYYY-MM-DD[T]HH:mm:ss.SSS[Z]":"YYYY-MM-DD[T]HH:mm:ss.SSSZ")}function von(){if(!this.isValid())return"moment.invalid(/* "+this._i+" */)";var C="moment",P="",N,k,W,le;return this.isLocal()||(C=this.utcOffset()===0?"moment.utc":"moment.parseZone",P="Z"),N="["+C+'("]',k=0<=this.year()&&this.year()<=9999?"YYYY":"YYYYYY",W="-MM-DD[T]HH:mm:ss.SSS",le=P+'[")]',this.format(N+k+W+le)}function won(C){C||(C=this.isUtc()?e.defaultFormatUtc:e.defaultFormat);var P=D(this,C);return this.localeData().postformat(P)}function Son(C,P){return this.isValid()&&(O(C)&&C.isValid()||Zu(C).isValid())?U0({to:this,from:C}).locale(this.locale()).humanize(!P):this.localeData().invalidDate()}function Con(C){return this.from(Zu(),C)}function xon(C,P){return this.isValid()&&(O(C)&&C.isValid()||Zu(C).isValid())?U0({from:this,to:C}).locale(this.locale()).humanize(!P):this.localeData().invalidDate()}function Oon(C){return this.to(Zu(),C)}function zvt(C){var P;return C===void 0?this._locale._abbr:(P=XI(C),P!=null&&(this._locale=P),this)}var Hvt=T("moment().lang() is deprecated. Instead, use moment().localeData() to get the language configuration. Use moment().locale() to change languages.",function(C){return C===void 0?this.localeData():this.locale(C)});function Vvt(){return this._locale}var Cfe=1e3,V3=60*Cfe,xfe=60*V3,Jvt=(365*400+97)*24*xfe;function J3(C,P){return(C%P+P)%P}function Kvt(C,P,N){return C<100&&C>=0?new Date(C+400,P,N)-Jvt:new Date(C,P,N).valueOf()}function Wvt(C,P,N){return C<100&&C>=0?Date.UTC(C+400,P,N)-Jvt:Date.UTC(C,P,N)}function Ton(C){var P,N;if(C=Ie(C),C===void 0||C==="millisecond"||!this.isValid())return this;switch(N=this._isUTC?Wvt:Kvt,C){case"year":P=N(this.year(),0,1);break;case"quarter":P=N(this.year(),this.month()-this.month()%3,1);break;case"month":P=N(this.year(),this.month(),1);break;case"week":P=N(this.year(),this.month(),this.date()-this.weekday());break;case"isoWeek":P=N(this.year(),this.month(),this.date()-(this.isoWeekday()-1));break;case"day":case"date":P=N(this.year(),this.month(),this.date());break;case"hour":P=this._d.valueOf(),P-=J3(P+(this._isUTC?0:this.utcOffset()*V3),xfe);break;case"minute":P=this._d.valueOf(),P-=J3(P,V3);break;case"second":P=this._d.valueOf(),P-=J3(P,Cfe);break}return this._d.setTime(P),e.updateOffset(this,!0),this}function Eon(C){var P,N;if(C=Ie(C),C===void 0||C==="millisecond"||!this.isValid())return this;switch(N=this._isUTC?Wvt:Kvt,C){case"year":P=N(this.year()+1,0,1)-1;break;case"quarter":P=N(this.year(),this.month()-this.month()%3+3,1)-1;break;case"month":P=N(this.year(),this.month()+1,1)-1;break;case"week":P=N(this.year(),this.month(),this.date()-this.weekday()+7)-1;break;case"isoWeek":P=N(this.year(),this.month(),this.date()-(this.isoWeekday()-1)+7)-1;break;case"day":case"date":P=N(this.year(),this.month(),this.date()+1)-1;break;case"hour":P=this._d.valueOf(),P+=xfe-J3(P+(this._isUTC?0:this.utcOffset()*V3),xfe)-1;break;case"minute":P=this._d.valueOf(),P+=V3-J3(P,V3)-1;break;case"second":P=this._d.valueOf(),P+=Cfe-J3(P,Cfe)-1;break}return this._d.setTime(P),e.updateOffset(this,!0),this}function Pon(){return this._d.valueOf()-(this._offset||0)*6e4}function Mon(){return Math.floor(this.valueOf()/1e3)}function Ron(){return new Date(this.valueOf())}function Aon(){var C=this;return[C.year(),C.month(),C.date(),C.hour(),C.minute(),C.second(),C.millisecond()]}function Ion(){var C=this;return{years:C.year(),months:C.month(),date:C.date(),hours:C.hours(),minutes:C.minutes(),seconds:C.seconds(),milliseconds:C.milliseconds()}}function Non(){return this.isValid()?this.toISOString():null}function jon(){return g(this)}function Don(){return d({},m(this))}function $on(){return m(this).overflow}function Lon(){return{input:this._i,format:this._f,locale:this._locale,isUTC:this._isUTC,strict:this._strict}}$("N",0,0,"eraAbbr"),$("NN",0,0,"eraAbbr"),$("NNN",0,0,"eraAbbr"),$("NNNN",0,0,"eraName"),$("NNNNN",0,0,"eraNarrow"),$("y",["y",1],"yo","eraYear"),$("y",["yy",2],0,"eraYear"),$("y",["yyy",3],0,"eraYear"),$("y",["yyyy",4],0,"eraYear"),wt("N",MFe),wt("NN",MFe),wt("NNN",MFe),wt("NNNN",Won),wt("NNNNN",Gon),_i(["N","NN","NNN","NNNN","NNNNN"],function(C,P,N,k){var W=N._locale.erasParse(C,k,N._strict);W?m(N).era=W:m(N).invalidEra=C}),wt("y",Gu),wt("yy",Gu),wt("yyy",Gu),wt("yyyy",Gu),wt("yo",Zon),_i(["y","yy","yyy","yyyy"],Kg),_i(["yo"],function(C,P,N,k){var W;N._locale._eraYearOrdinalRegex&&(W=C.match(N._locale._eraYearOrdinalRegex)),N._locale.eraYearOrdinalParse?P[Kg]=N._locale.eraYearOrdinalParse(C,W):P[Kg]=parseInt(C,10)});function Fon(C,P){var N,k,W,le=this._eras||XI("en")._eras;for(N=0,k=le.length;N=0)return le[k]}function qon(C,P){var N=C.since<=C.until?1:-1;return P===void 0?e(C.since).year():e(C.since).year()+(P-C.offset)*N}function Bon(){var C,P,N,k=this.localeData().eras();for(C=0,P=k.length;Cle&&(P=le),nin.call(this,C,P,N,k,W))}function nin(C,P,N,k,W){var le=Tvt(C,P,N,k,W),Ae=rY(le.year,0,le.dayOfYear);return this.year(Ae.getUTCFullYear()),this.month(Ae.getUTCMonth()),this.date(Ae.getUTCDate()),this}$("Q",0,"Qo","quarter"),gt("quarter","Q"),Fe("quarter",7),wt("Q",Vb),_i("Q",function(C,P){P[WI]=($e(C)-1)*3});function oin(C){return C==null?Math.ceil((this.month()+1)/3):this.month((C-1)*3+this.month()%3)}$("D",["DD",2],"Do","date"),gt("date","D"),Fe("date",9),wt("D",We),wt("DD",We,Ue),wt("Do",function(C,P){return C?P._dayOfMonthOrdinalParse||P._ordinalParse:P._dayOfMonthOrdinalParseLenient}),_i(["D","DD"],nO),_i("Do",function(C,P){P[nO]=$e(C.match(We)[0])});var Zvt=Pt("Date",!0);$("DDD",["DDDD",3],"DDDo","dayOfYear"),gt("dayOfYear","DDD"),Fe("dayOfYear",4),wt("DDD",Eo),wt("DDDD",Rn),_i(["DDD","DDDD"],function(C,P,N){N._dayOfYear=$e(C)});function iin(C){var P=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return C==null?P:this.add(C-P,"d")}$("m",["mm",2],0,"minute"),gt("minute","m"),Fe("minute",14),wt("m",We),wt("mm",We,Ue),_i(["m","mm"],B0);var ain=Pt("Minutes",!1);$("s",["ss",2],0,"second"),gt("second","s"),Fe("second",15),wt("s",We),wt("ss",We,Ue),_i(["s","ss"],GI);var sin=Pt("Seconds",!1);$("S",0,0,function(){return~~(this.millisecond()/100)}),$(0,["SS",2],0,function(){return~~(this.millisecond()/10)}),$(0,["SSS",3],0,"millisecond"),$(0,["SSSS",4],0,function(){return this.millisecond()*10}),$(0,["SSSSS",5],0,function(){return this.millisecond()*100}),$(0,["SSSSSS",6],0,function(){return this.millisecond()*1e3}),$(0,["SSSSSSS",7],0,function(){return this.millisecond()*1e4}),$(0,["SSSSSSSS",8],0,function(){return this.millisecond()*1e5}),$(0,["SSSSSSSSS",9],0,function(){return this.millisecond()*1e6}),gt("millisecond","ms"),Fe("millisecond",16),wt("S",Eo,Vb),wt("SS",Eo,Ue),wt("SSS",Eo,Rn);var D$,Xvt;for(D$="SSSS";D$.length<=9;D$+="S")wt(D$,Gu);function uin(C,P){P[$U]=$e(("0."+C)*1e3)}for(D$="S";D$.length<=9;D$+="S")_i(D$,uin);Xvt=Pt("Milliseconds",!1),$("z",0,0,"zoneAbbr"),$("zz",0,0,"zoneName");function lin(){return this._isUTC?"UTC":""}function cin(){return this._isUTC?"Coordinated Universal Time":""}var tt=x.prototype;tt.add=ron,tt.calendar=lon,tt.clone=con,tt.diff=yon,tt.endOf=Eon,tt.format=won,tt.from=Son,tt.fromNow=Con,tt.to=xon,tt.toNow=Oon,tt.get=vn,tt.invalidAt=$on,tt.isAfter=don,tt.isBefore=fon,tt.isBetween=pon,tt.isSame=mon,tt.isSameOrAfter=hon,tt.isSameOrBefore=gon,tt.isValid=jon,tt.lang=Hvt,tt.locale=zvt,tt.localeData=Vvt,tt.max=jnn,tt.min=Nnn,tt.parsingFlags=Don,tt.set=si,tt.startOf=Ton,tt.subtract=non,tt.toArray=Aon,tt.toObject=Ion,tt.toDate=Ron,tt.toISOString=_on,tt.inspect=von,typeof Symbol<"u"&&Symbol.for!=null&&(tt[Symbol.for("nodejs.util.inspect.custom")]=function(){return"Moment<"+this.format()+">"}),tt.toJSON=Non,tt.toString=bon,tt.unix=Mon,tt.valueOf=Pon,tt.creationData=Lon,tt.eraName=Bon,tt.eraNarrow=Uon,tt.eraAbbr=zon,tt.eraYear=Hon,tt.year=Ovt,tt.isLeapYear=Irn,tt.weekYear=Xon,tt.isoWeekYear=Yon,tt.quarter=tt.quarters=oin,tt.month=Cvt,tt.daysInMonth=Mrn,tt.week=tt.weeks=Frn,tt.isoWeek=tt.isoWeeks=krn,tt.weeksInYear=tin,tt.weeksInWeekYear=rin,tt.isoWeeksInYear=Qon,tt.isoWeeksInISOWeekYear=ein,tt.date=Zvt,tt.day=tt.days=Yrn,tt.weekday=Qrn,tt.isoWeekday=enn,tt.dayOfYear=iin,tt.hour=tt.hours=snn,tt.minute=tt.minutes=ain,tt.second=tt.seconds=sin,tt.millisecond=tt.milliseconds=Xvt,tt.utcOffset=znn,tt.utc=Vnn,tt.local=Jnn,tt.parseZone=Knn,tt.hasAlignedHourOffset=Wnn,tt.isDST=Gnn,tt.isLocal=Xnn,tt.isUtcOffset=Ynn,tt.isUtc=Fvt,tt.isUTC=Fvt,tt.zoneAbbr=lin,tt.zoneName=cin,tt.dates=T("dates accessor is deprecated. Use date instead.",Zvt),tt.months=T("months accessor is deprecated. Use month instead",Cvt),tt.years=T("years accessor is deprecated. Use year instead",Ovt),tt.zone=T("moment().zone is deprecated, use moment().utcOffset instead. http://momentjs.com/guides/#/warnings/zone/",Hnn),tt.isDSTShifted=T("isDSTShifted is deprecated. See http://momentjs.com/guides/#/warnings/dst-shifted/ for more information",Znn);function din(C){return Zu(C*1e3)}function fin(){return Zu.apply(null,arguments).parseZone()}function Yvt(C){return C}var ts=U.prototype;ts.calendar=oe,ts.longDateFormat=K,ts.invalidDate=be,ts.ordinal=pt,ts.preparse=Yvt,ts.postformat=Yvt,ts.relativeTime=Ze,ts.pastFuture=Yr,ts.set=F,ts.eras=Fon,ts.erasParse=kon,ts.erasConvertYear=qon,ts.erasAbbrRegex=Jon,ts.erasNameRegex=Von,ts.erasNarrowRegex=Kon,ts.months=Orn,ts.monthsShort=Trn,ts.monthsParse=Prn,ts.monthsRegex=Arn,ts.monthsShortRegex=Rrn,ts.week=jrn,ts.firstDayOfYear=Lrn,ts.firstDayOfWeek=$rn,ts.weekdays=Krn,ts.weekdaysMin=Grn,ts.weekdaysShort=Wrn,ts.weekdaysParse=Xrn,ts.weekdaysRegex=tnn,ts.weekdaysShortRegex=rnn,ts.weekdaysMinRegex=nnn,ts.isPM=inn,ts.meridiem=unn;function Tfe(C,P,N,k){var W=XI(),le=f().set(k,P);return W[N](le,C)}function Qvt(C,P,N){if(u(C)&&(P=C,C=void 0),C=C||"",P!=null)return Tfe(C,P,N,"month");var k,W=[];for(k=0;k<12;k++)W[k]=Tfe(C,k,N,"month");return W}function AFe(C,P,N,k){typeof C=="boolean"?(u(P)&&(N=P,P=void 0),P=P||""):(P=C,N=P,C=!1,u(P)&&(N=P,P=void 0),P=P||"");var W=XI(),le=C?W._week.dow:0,Ae,Gr=[];if(N!=null)return Tfe(P,(N+le)%7,k,"day");for(Ae=0;Ae<7;Ae++)Gr[Ae]=Tfe(P,(Ae+le)%7,k,"day");return Gr}function pin(C,P){return Qvt(C,P,"months")}function min(C,P){return Qvt(C,P,"monthsShort")}function hin(C,P,N){return AFe(C,P,N,"weekdays")}function gin(C,P,N){return AFe(C,P,N,"weekdaysShort")}function yin(C,P,N){return AFe(C,P,N,"weekdaysMin")}j$("en",{eras:[{since:"0001-01-01",until:1/0,offset:1,name:"Anno Domini",narrow:"AD",abbr:"AD"},{since:"0000-12-31",until:-1/0,offset:1,name:"Before Christ",narrow:"BC",abbr:"BC"}],dayOfMonthOrdinalParse:/\d{1,2}(th|st|nd|rd)/,ordinal:function(C){var P=C%10,N=$e(C%100/10)===1?"th":P===1?"st":P===2?"nd":P===3?"rd":"th";return C+N}}),e.lang=T("moment.lang is deprecated. Use moment.locale instead.",j$),e.langData=T("moment.langData is deprecated. Use moment.localeData instead.",XI);var YI=Math.abs;function bin(){var C=this._data;return this._milliseconds=YI(this._milliseconds),this._days=YI(this._days),this._months=YI(this._months),C.milliseconds=YI(C.milliseconds),C.seconds=YI(C.seconds),C.minutes=YI(C.minutes),C.hours=YI(C.hours),C.months=YI(C.months),C.years=YI(C.years),this}function ewt(C,P,N,k){var W=U0(P,N);return C._milliseconds+=k*W._milliseconds,C._days+=k*W._days,C._months+=k*W._months,C._bubble()}function _in(C,P){return ewt(this,C,P,1)}function vin(C,P){return ewt(this,C,P,-1)}function twt(C){return C<0?Math.floor(C):Math.ceil(C)}function win(){var C=this._milliseconds,P=this._days,N=this._months,k=this._data,W,le,Ae,Gr,Yo;return C>=0&&P>=0&&N>=0||C<=0&&P<=0&&N<=0||(C+=twt(IFe(N)+P)*864e5,P=0,N=0),k.milliseconds=C%1e3,W=ze(C/1e3),k.seconds=W%60,le=ze(W/60),k.minutes=le%60,Ae=ze(le/60),k.hours=Ae%24,P+=ze(Ae/24),Yo=ze(rwt(P)),N+=Yo,P-=twt(IFe(Yo)),Gr=ze(N/12),N%=12,k.days=P,k.months=N,k.years=Gr,this}function rwt(C){return C*4800/146097}function IFe(C){return C*146097/4800}function Sin(C){if(!this.isValid())return NaN;var P,N,k=this._milliseconds;if(C=Ie(C),C==="month"||C==="quarter"||C==="year")switch(P=this._days+k/864e5,N=this._months+rwt(P),C){case"month":return N;case"quarter":return N/3;case"year":return N/12}else switch(P=this._days+Math.round(IFe(this._months)),C){case"week":return P/7+k/6048e5;case"day":return P+k/864e5;case"hour":return P*24+k/36e5;case"minute":return P*1440+k/6e4;case"second":return P*86400+k/1e3;case"millisecond":return Math.floor(P*864e5)+k;default:throw new Error("Unknown unit "+C)}}function Cin(){return this.isValid()?this._milliseconds+this._days*864e5+this._months%12*2592e6+$e(this._months/12)*31536e6:NaN}function QI(C){return function(){return this.as(C)}}var xin=QI("ms"),Oin=QI("s"),Tin=QI("m"),Ein=QI("h"),Pin=QI("d"),Min=QI("w"),Rin=QI("M"),Ain=QI("Q"),Iin=QI("y");function Nin(){return U0(this)}function jin(C){return C=Ie(C),this.isValid()?this[C+"s"]():NaN}function FU(C){return function(){return this.isValid()?this._data[C]:NaN}}var Din=FU("milliseconds"),$in=FU("seconds"),Lin=FU("minutes"),Fin=FU("hours"),kin=FU("days"),qin=FU("months"),Bin=FU("years");function Uin(){return ze(this.days()/7)}var eN=Math.round,K3={ss:44,s:45,m:45,h:22,d:26,w:null,M:11};function zin(C,P,N,k,W){return W.relativeTime(P||1,!!N,C,k)}function Hin(C,P,N,k){var W=U0(C).abs(),le=eN(W.as("s")),Ae=eN(W.as("m")),Gr=eN(W.as("h")),Yo=eN(W.as("d")),iu=eN(W.as("M")),Jy=eN(W.as("w")),tN=eN(W.as("y")),$$=le<=N.ss&&["s",le]||le0,$$[4]=k,zin.apply(null,$$)}function Vin(C){return C===void 0?eN:typeof C=="function"?(eN=C,!0):!1}function Jin(C,P){return K3[C]===void 0?!1:P===void 0?K3[C]:(K3[C]=P,C==="s"&&(K3.ss=P-1),!0)}function Kin(C,P){if(!this.isValid())return this.localeData().invalidDate();var N=!1,k=K3,W,le;return typeof C=="object"&&(P=C,C=!1),typeof C=="boolean"&&(N=C),typeof P=="object"&&(k=Object.assign({},K3,P),P.s!=null&&P.ss==null&&(k.ss=P.s-1)),W=this.localeData(),le=Hin(this,!N,k,W),N&&(le=W.pastFuture(+this,le)),W.postformat(le)}var NFe=Math.abs;function W3(C){return(C>0)-(C<0)||+C}function Efe(){if(!this.isValid())return this.localeData().invalidDate();var C=NFe(this._milliseconds)/1e3,P=NFe(this._days),N=NFe(this._months),k,W,le,Ae,Gr=this.asSeconds(),Yo,iu,Jy,tN;return Gr?(k=ze(C/60),W=ze(k/60),C%=60,k%=60,le=ze(N/12),N%=12,Ae=C?C.toFixed(3).replace(/\.?0+$/,""):"",Yo=Gr<0?"-":"",iu=W3(this._months)!==W3(Gr)?"-":"",Jy=W3(this._days)!==W3(Gr)?"-":"",tN=W3(this._milliseconds)!==W3(Gr)?"-":"",Yo+"P"+(le?iu+le+"Y":"")+(N?iu+N+"M":"")+(P?Jy+P+"D":"")+(W||k||C?"T":"")+(W?tN+W+"H":"")+(k?tN+k+"M":"")+(C?tN+Ae+"S":"")):"P0D"}var zi=vfe.prototype;zi.isValid=knn,zi.abs=bin,zi.add=_in,zi.subtract=vin,zi.as=Sin,zi.asMilliseconds=xin,zi.asSeconds=Oin,zi.asMinutes=Tin,zi.asHours=Ein,zi.asDays=Pin,zi.asWeeks=Min,zi.asMonths=Rin,zi.asQuarters=Ain,zi.asYears=Iin,zi.valueOf=Cin,zi._bubble=win,zi.clone=Nin,zi.get=jin,zi.milliseconds=Din,zi.seconds=$in,zi.minutes=Lin,zi.hours=Fin,zi.days=kin,zi.weeks=Uin,zi.months=qin,zi.years=Bin,zi.humanize=Kin,zi.toISOString=Efe,zi.toString=Efe,zi.toJSON=Efe,zi.locale=zvt,zi.localeData=Vvt,zi.toIsoString=T("toIsoString() is deprecated. Please use toISOString() instead (notice the capitals)",Efe),zi.lang=Hvt,$("X",0,0,"unix"),$("x",0,0,"valueOf"),wt("x",Jh),wt("X",Ym),_i("X",function(C,P,N){N._d=new Date(parseFloat(C)*1e3)}),_i("x",function(C,P,N){N._d=new Date($e(C))});return e.version="2.29.4",r(Zu),e.fn=tt,e.min=Dnn,e.max=$nn,e.now=Lnn,e.utc=f,e.unix=din,e.months=pin,e.isDate=l,e.locale=j$,e.invalid=y,e.duration=U0,e.isMoment=O,e.weekdays=hin,e.parseZone=fin,e.localeData=XI,e.isDuration=wfe,e.monthsShort=min,e.weekdaysMin=yin,e.defineLocale=vFe,e.updateLocale=fnn,e.locales=pnn,e.weekdaysShort=gin,e.normalizeUnits=Ie,e.relativeTimeRounding=Vin,e.relativeTimeThreshold=Jin,e.calendarFormat=uon,e.prototype=tt,e.HTML5_FMT={DATETIME_LOCAL:"YYYY-MM-DDTHH:mm",DATETIME_LOCAL_SECONDS:"YYYY-MM-DDTHH:mm:ss",DATETIME_LOCAL_MS:"YYYY-MM-DDTHH:mm:ss.SSS",DATE:"YYYY-MM-DD",TIME:"HH:mm",TIME_SECONDS:"HH:mm:ss",TIME_MS:"HH:mm:ss.SSS",WEEK:"GGGG-[W]WW",MONTH:"YYYY-MM"},e})});var ORt={};Jn(ORt,{CustomError:()=>Ro,MissingApiKeyError:()=>YQ,MissingModelKeyError:()=>k6,MissingPlusLicenseError:()=>Lz,TimeoutError:()=>XQ});var Ro,XQ,YQ,Lz,k6,Yw=v(()=>{Ro=class t extends Error{constructor(e,r){super(e),this.code=r,Object.setPrototypeOf(this,t.prototype)}},XQ=class t extends Error{constructor(e,r){super(`${e} timed out after ${r}ms`),this.name="TimeoutError",Object.setPrototypeOf(this,t.prototype)}},YQ=class t extends Error{constructor(e="API key is not configured."){super(e),this.name="MissingApiKeyError",Object.setPrototypeOf(this,t.prototype)}},Lz=class t extends Error{constructor(e="Copilot Plus license key is not configured."){super(e),this.name="MissingPlusLicenseError",Object.setPrototypeOf(this,t.prototype)}},k6=class t extends Error{constructor(e="No model key found. Please select a model in settings."){super(e),this.name="MissingModelKeyError",Object.setPrototypeOf(this,t.prototype)}}});function ERt(t){let e=t?.detail||{};return{status:e.status,message:e.message||t?.message,reason:e.reason}}function hgn(t){let e=ERt(t);return e.reason==="Invalid license key"||t?.message==="Invalid license key"||t?.message?.includes("status 403")||e.status===403}function PRt(t){let e=ERt(t);return hgn(t)?x2e.INVALID_LICENSE_KEY_USER:e.message||(e.reason?`Error: ${e.reason}`:x2e.UNKNOWN_ERROR)}function q6(t){return t.replace(/^#/,"").trim()}function CO(t,e=!0){let r=app.metadataCache.getFileCache(t),n=r?.frontmatter?.tags,o=new Set;if(!e){let i=r?.tags?.map(a=>a.tag);i&&i.forEach(a=>o.add(q6(a)))}return n&&(Array.isArray(n)?n.forEach(i=>{typeof i=="string"&&o.add(q6(i))}):typeof n=="string"&&o.add(q6(n))),Array.from(o)}function Nhe(t,e,r){if(e.length===0)return[];e=e.map(i=>q6(i));let n=r&&r.length>0?r:QQ(t,"/"),o=[];for(let i of n){let a=CO(i);e.some(s=>a.includes(s))&&o.push(i)}return o}async function Qh(t){let e=(0,oy.normalizePath)(t).replace(/^\/+/,"").replace(/\/+$/,"");if(!e)return;let r=e.split("/").filter(Boolean),n="";for(let o of r){n=n?`${n}/${o}`:o;let i=app.vault.getAbstractFileByPath(n);if(i){if(i instanceof oy.TFile)throw new Error(`Path conflict: "${n}" exists as a file, expected folder.`);continue}await app.vault.adapter.mkdir(n)}}async function B6(t,e){return t.extension!="md"&&t.extension!="canvas"?null:await e.cachedRead(t)}function jhe(t){return t.basename}function xO(t){return t?bgn.includes(t.extension):!1}function ib(t){return t==="copilot_plus"||t==="project"}function U6(t,e){return t?t.extension==="md"||t.extension==="canvas"?!0:ib(e):!1}function RRt(t,e){return!t||!e?!1:t.includes(O2e)&&e.includes(O2e)||t==="small"&&e==="cohereai"||t==="cohereai"&&e==="small"?!0:t===e}function z6(t){let e=[],{history:r}=t;for(let n=0;n{let o=e.getAbstractFileByPath(n);if(o instanceof oy.TFile)r.set(o.path,o);else{let a=e.getMarkdownFiles().filter(s=>s.basename===n);a.length>0&&(_gn(n,e)?r.set(a[0].path,a[0]):console.warn(`Found multiple files with title "${n}". Expected a full path for duplicate titles.`))}}),Array.from(r.values())}function mL(t,e){let r=/\[\[(.*?)\]\]/g,n=t.match(r);if(!n)return[];let o=n.map(i=>i.slice(2,-2));return ARt(o,e)}function IRt(t,e){let r=/\{\[\[(.*?)\]\]\}/g,n=t.match(r);if(!n)return[];let o=n.map(i=>i.slice(3,-3));return ARt(o,e)}function _gn(t,e){return e.getMarkdownFiles().filter(n=>n.basename===t).length===1}function NRt(t){return t=t.trim(),t.startsWith("[[")&&t.endsWith("]]")?`${t.slice(2,-2).trim()}.md`:t}function jRt(t){let e=new Set;return t.forEach(r=>{r.metadata?.title&&e.add(r.metadata?.title)}),Array.from(e)}function T2e(t){if(!t||typeof t!="string")return{isValid:!1,error:"URL is required"};let e=t.trim();if(!e)return{isValid:!1,error:"URL cannot be empty"};let r=wgn(e);return r?/^[a-zA-Z0-9_-]{11}$/.test(r)?{isValid:!0,videoId:r}:{isValid:!1,error:"Invalid YouTube video ID"}:{isValid:!1,error:"Invalid YouTube URL format"}}function wgn(t){try{let e=[/(?:youtube\.com\/watch\?v=|youtu\.be\/|youtube\.com\/embed\/|youtube\.com\/v\/)([a-zA-Z0-9_-]{11})/,/youtube\.com\/shorts\/([a-zA-Z0-9_-]{11})/];for(let r of e){let n=t.match(r);if(n&&n[1])return n[1]}return null}catch{return null}}function DRt(t){return`https://www.youtube.com/watch?v=${t}`}function $Rt(t){return T2e(t).isValid}function LRt(t){let e=t.matchAll(new RegExp(vgn,"g"));return Array.from(e,r=>r[0])}async function Ql(t,e={}){let r=new Headers(e.headers),n=Object.fromEntries(r.entries());delete n["content-length"],H("safeFetch request");let o=e.method?.toUpperCase()||"POST",a=await(0,oy.requestUrl)({url:t,contentType:"application/json",headers:n,method:o,...["POST","PUT","PATCH"].includes(o)&&{body:e.body?.toString()},throw:!1});if(a.status>=400){let s;try{s=typeof a.json=="string"?JSON.parse(a.json):a.json}catch{try{s=typeof a.text=="string"?JSON.parse(a.text):a.text}catch{s=null}}let u=new Error(x2e.REQUEST_FAILED(a.status));if(u.json=s,s?.detail?.reason==="Invalid license key"||s?.reason==="Invalid license key")u.message="Invalid license key";else if(s?.detail?.message||s?.message){let l=s?.detail?.message||s?.message,c=s?.detail?.reason||s?.reason;u.message=c?`${l}: ${c}`:l}else s?.detail?u.message=JSON.stringify(s.detail):s&&(u.message+=". "+JSON.stringify(s));throw u}return{ok:a.status>=200&&a.status<300,status:a.status,statusText:a.status.toString(),headers:new Headers(a.headers),url:t,type:"basic",redirected:!1,bytes:()=>Promise.resolve(new Uint8Array(0)),body:Sgn(a.text),bodyUsed:!0,json:()=>a.json,text:async()=>a.text,arrayBuffer:async()=>{if(a.arrayBuffer)return a.arrayBuffer;let s=a.text.replace(/^data:.*;base64,/,""),u=atob(s),l=new Uint8Array(u.length);for(let c=0;c{throw new Error("not implemented")},formData:()=>{throw new Error("not implemented")},clone:()=>{throw new Error("not implemented")}}}function Sgn(t){return new ReadableStream({start(e){let n=new TextEncoder().encode(t);e.enqueue(n),e.close()}})}function eee(t,e){let r={...t};return e.forEach(n=>{delete r[n]}),r}function Qw(t,e){let[r,n]=t.split("|"),o=e.find(i=>i.name===r&&i.provider===n);if(!o)throw new Error(`No model configuration found for: ${t}`);return o}function hL(t){let e=TN[t];return{...e,label:e.label||t}}function ab(t,e){let r=TN[t]?.label||t;return r+(e?.believerExclusive&&r==="Copilot Plus"?"(Believer)":"")}function Dhe(t){let e=t;return e=qz(e),e=e.replace(/```xml\s*[\s\S]*?[\s\S]*?<\/writeToFile>[\s\S]*?```/g,""),e=e.replace(/[\s\S]*?<\/writeToFile>/g,""),e=e.replace(/[\s\S]*?/g,""),e=e.replace(/\n{3,}/g,` + +`),e=e.trim(),e}async function Fz(t,e=!1){let r=app.workspace.getMostRecentLeaf();if(!r){new oy.Notice("No active leaf found.");return}if(r.view instanceof oy.MarkdownView||(r=app.workspace.getLeaf(!1),await r.setViewState({type:"markdown",state:r.view.getState()})),!(r.view instanceof oy.MarkdownView)){new oy.Notice("Failed to open a markdown view.");return}let n=r.view.editor,o=n.getCursor("from"),i=n.getCursor("to"),a=Dhe(t);e?n.replaceRange(a,o,i):n.replaceRange(a,i),new oy.Notice("Message inserted into the active note.")}function $he(t,e){let r;return(...n)=>{clearTimeout(r),r=setTimeout(()=>t(...n),e)}}function Lhe(t,e){let r=t.split(".").map(Number),n=e.split(".").map(Number);for(let o=0;o<3;o++){if(r[o]>n[o])return!0;if(r[o]!t.includes(e)).map(([e])=>e)}function V6(t,e){if(t.provider==="amazon-bedrock")return t.apiKey||e.amazonBedrockApiKey?{hasApiKey:!0}:{hasApiKey:!1,errorNotice:"Amazon Bedrock API key is missing. Please add a key in Settings > API Keys or update the model configuration."};let r=!!E2e().find(i=>i===t.provider),n=EN[t.provider],o=!t.apiKey&&!e[n];return r&&o?{hasApiKey:!1,errorNotice:`Please configure API Key for ${t.name} in settings first. +Path: Settings > copilot plugin > Basic Tab > Set Keys`}:{hasApiKey:!0}}function Fhe(t){return typeof t=="string"?t:Array.isArray(t)?t.filter(e=>e.type==="text").map(e=>e.text).join(""):String(t||"")}function qz(t){let r=Fhe(t).replace(/[\s\S]*?<\/think>/g,"");return r=r.replace(/[\s\S]*$/g,""),r.trim()}function J6(t){return Fhe(t).replace(/[\s\S]*?<\/errorChunk>/g,"").trim()}function kRt(){return crypto.randomUUID()}async function ih(t){let e=console.warn;try{return console.warn=function(...r){if(!(r[0]?.includes&&(r[0].includes("Failed to calculate number of tokens")||r[0].includes("Unknown model"))))return e.apply(console,r)},await t()}finally{console.warn=e}}async function khe(t,e,r="Operation"){let{TimeoutError:n}=await Promise.resolve().then(()=>(Yw(),ORt)),o=new AbortController,i=setTimeout(()=>{o.abort()},e);try{return await Promise.race([t(o.signal),new Promise((a,s)=>{o.signal.addEventListener("abort",()=>{s(new n(r,e))})})])}finally{clearTimeout(i)}}function P2e(){let t=app.workspace.getActiveViewOfType(oy.MarkdownView);return t?t.getState().source===!0:!0}function ree(t){return new TextEncoder().encode(t).length}function M2e(t,e){if(e<=0)return"";let r=new TextEncoder;if(r.encode(t).length<=e)return t;let o=0,i=t.length,a="";for(;o<=i;){let s=Math.floor((o+i)/2),u=t.substring(0,s);r.encode(u).length<=e?(a=u,o=s+1):i=s-1}return a}async function qRt(t,e=!0){let r=null;app.workspace.iterateAllLeaves(n=>{if(n.view.getViewType()==="markdown"||n.view.getViewType()==="pdf"||n.view.getViewType()==="canvas"){let o=n.view.file;o&&o.path===t.path&&(r=n)}}),r&&e?app.workspace.setActiveLeaf(r,{focus:!0}):r||await app.workspace.getLeaf("tab").openFile(t)}var TRt,oy,x2e,QQ,ggn,ygn,MRt,eg,bgn,vgn,yr=v(()=>{Hc();Zr();Bt();TRt=L(xRt()),oy=require("obsidian");w2e();x2e={INVALID_LICENSE_KEY_USER:"Invalid Copilot Plus license key. Please check your license key in settings.",UNKNOWN_ERROR:"An unknown error occurred",REQUEST_FAILED:t=>`Request failed, status ${t}`};QQ=(t,e)=>{let r=t.getMarkdownFiles();if(e==="/")return r;let n=e.toLowerCase().replace(/^\/|\/$/g,"");return r.filter(o=>{let a=o.path.toLowerCase().split("/"),s=n.split("/"),u=0;for(let l of s){for(;u=a.length)return!1}return!0})};ggn=t=>t.last?.modelName||t.last?.model,ygn=t=>t.last?.retriever!==void 0,MRt=t=>ggn(t)||ygn(t),eg=(t,e="local")=>{let r=(0,TRt.default)(t);return e==="utc"&&r.utc(),{fileName:r.format("YYYYMMDD_HHmmss"),display:r.format("YYYY/MM/DD HH:mm:ss"),epoch:r.valueOf()}};bgn=["md","pdf","canvas"];vgn=/(?:https?:\/\/)?(?:www\.)?(?:youtube\.com\/(?:watch\?v=|shorts\/)|youtu\.be\/)([^\s&]+)/});var K6,R2e,nee,Hc=v(()=>{_O();Ev();Ov();o2e();yr();K6=class K6{static createNewLLMChain(e){let{llm:r,memory:n,prompt:o,abortController:i}=e,a=r.withConfig({signal:i?.signal}),s=Sl.from([{input:u=>u.input,memory:()=>n.loadMemoryVariables({})},{input:u=>u.input,history:u=>u.memory.history},o,a]);return K6.instances.set("llm_chain",s),console.log("New LLM chain created."),s}static getLLMChainFromMap(e){let r=K6.instances.get("llm_chain");return r||(r=K6.createNewLLMChain(e)),r}static createConversationalRetrievalChain(e,r,n){let{llm:o,retriever:i,systemMessage:a}=e,u=su.fromTemplate(`Given the following conversation and a follow up question, + summarize the conversation as context and keep the follow up question unchanged, in its original language. + If the follow up question is unrelated to its preceding messages, return this follow up question directly. + If it is related, then combine the summary and the follow up question to construct a standalone question. + Make sure to keep any [[]] wrapped note titles in the question unchanged. + + Chat History: + {chat_history} + Follow Up Input: {question} + Standalone question:`),c=su.fromTemplate(`{system_message} + +Answer the question with as detailed as possible based only on the following context: +{context} + +Question: {question} +`),d=g=>g.map(b=>`Human: ${b[0]} +Assistant: ${b[1]}`).join(` +`),f=Sl.from([{question:g=>(n&&console.log("Input Question: ",g.question),g.question),chat_history:g=>{let y=d(g.chat_history);return n&&console.log("Formatted Chat History: ",y),y}},u,o,new ghe,g=>{let y=qz(g),b=J6(y);return n&&console.log("Standalone Question: ",b),b}]),p=async g=>(r(g),JQ(g)),m=Sl.from([{context:i.pipe(p),question:new wu,system_message:()=>a},c,o]);return f.pipe(m)}};K6.instances=new Map;R2e=K6,nee=R2e});var oee=v(()=>{});var A2e,Bz,Cc,Zs,TO,wO,xgn,Ogn,Tgn,v2e,SRt,URt,iee,s_,aee,Uz,see,I2e,uee,N2e,zz,j2e,D2e,W6,EO,PN,iy,OO,gL,SO,pL,Dz,O2e,TN,EN,zRt,ZQ,Gn,qhe,G6,Ds,eS,Zr=v(()=>{kU();Hc();oee();A2e="https://api.brevilabs.com/v1",Bz="https://models.brevilabs.com/v1",Cc="copilot-chat-view",Zs="user",TO="ai",wO="copilot",xgn=`${wO}/copilot-conversations`,Ogn=`${wO}/copilot-custom-prompts`,Tgn=`${wO}/memory`,v2e=wO,SRt=`You are Obsidian Copilot, a helpful assistant that integrates AI to Obsidian note-taking. + 1. Never mention that you do not have access to something. Always rely on the user provided context. + 2. Always answer to the best of your knowledge. If you are unsure about something, say so and ask the user to provide more context. + 3. If the user mentions "note", it most likely means an Obsidian note in the vault, not the generic meaning of a note. + 4. If the user mentions "@vault", it means the user wants you to search the Obsidian vault for information relevant to the query. The search results will be provided to you in the context along with the user query, read it carefully and answer the question based on the information provided. If there's no relevant information in the vault, just say so. + 5. If the user mentions any other tool with the @ symbol, check the context for their results. If nothing is found, just ignore the @ symbol in the query. + 6. Always use $'s instead of \\[ etc. for LaTeX equations. + 7. When showing note titles, use [[title]] format and do not wrap them in \` \`. + 8. When showing **Obsidian internal** image links, use ![[link]] format and do not wrap them in \` \`. + 9. When showing **web** image links, use ![link](url) format and do not wrap them in \` \`. + 10. When generating a table, format as github markdown tables, however, for table headings, immediately add ' |' after the table heading. + 11. Always respond in the language of the user's query. + 12. Do NOT mention the additional context provided such as getCurrentTime and getTimeRangeMs if it's irrelevant to the user message. + 13. If the user mentions "tags", it most likely means tags in Obsidian note properties. + 14. YouTube URLs: If the user provides YouTube URLs in their message, transcriptions will be automatically fetched and provided to you. You don't need to do anything special - just use the transcription content if available. + 15. For markdown lists, always use '- ' (hyphen followed by exactly one space) for bullet points, with no leading spaces before the hyphen. Never use '*' (asterisk) for bullets.`,URt=`Return the new note content or canvas JSON in tags. + + # Steps to find the the target notes + 1. Extract the target note information from user message and find out the note path from the context below. + 2. If target note is not specified, use the as the target note. + 3. If still failed to find the target note or the note path, ask the user to specify the target note. + + # Examples + + Input: Add a new section to note A + Output: + + path/to/file.md + The FULL CONTENT of the note A with added section goes here + + + Input: Create a new canvas with "Hello, world!" + Output: + + path/to/file.canvas + + { + "nodes": [ + { + "id": "1", + "type": "text", + "text": "Hello, world!", + "x": 0, + "y": 0, + "width": 200, + "height": 50 + } + ], + "edges": [] + } + + + + Input: Create a canvas with a file node and a group + Output: + + path/to/file.canvas + + { + "nodes": [ + {"id": "1", "type": "file", "file": "note.md", "subpath": "#heading", "x": 100, "y": 100, "width": 300, "height": 200, "color": "2"}, + {"id": "2", "type": "group", "label": "My Group", "x": 50, "y": 50, "width": 400, "height": 300, "color": "1"}, + {"id": "3", "type": "link", "url": "https://example.com", "x": 500, "y": 100, "width": 200, "height": 100, "color": "#FF5733"} + ], + "edges": [ + {"id": "e1-2", "fromNode": "1", "toNode": "3", "fromSide": "right", "toSide": "left", "fromEnd": "arrow", "toEnd": "none", "color": "3", "label": "references"} + ] + } + + + + # Canvas JSON Format (JSON Canvas spec 1.0) + Required node fields: id, type, x, y, width, height + Node types: "text" (needs text), "file" (needs file), "link" (needs url), "group" (optional label) + Optional node fields: color (hex #FF0000 or preset "1"-"6"), subpath (file nodes, starts with #) + Required edge fields: id, fromNode, toNode + Optional edge fields: fromSide/toSide ("top"/"right"/"bottom"/"left"), fromEnd/toEnd ("none"/"arrow"), color, label + All IDs must be unique. Edge nodes must reference existing node IDs. + Position nodes with reasonable spacing and logical visual flow. + `,iee="note_context",s_="selected_text",aee="variable",Uz="variable_note",see="embedded_pdf",I2e="embedded_note",uee="dataview_block",N2e="retrieved_document",zz=6e3,j2e=.4,D2e=448e3,W6=3e4,EO={DEFAULT:"",READING_FILES:"Reading files",SEARCHING_WEB:"Searching the web",READING_FILE_TREE:"Reading file tree"},PN={SETTINGS:"settings",EXPIRED_MODAL:"expired_modal",CHAT_MODE_SELECT:"chat_mode_select",MODE_SELECT_TOOLTIP:"mode_select_tooltip"},iy={MAX_TOKENS:6e3,TEMPERATURE:.1,REASONING_EFFORT:"low",VERBOSITY:"medium"},OO=(g=>(g.OPENROUTERAI="openrouterai",g.OPENAI="openai",g.OPENAI_FORMAT="3rd party (openai-format)",g.ANTHROPIC="anthropic",g.GOOGLE="google",g.XAI="xai",g.AMAZON_BEDROCK="amazon-bedrock",g.AZURE_OPENAI="azure openai",g.GROQ="groq",g.OLLAMA="ollama",g.LM_STUDIO="lm-studio",g.COPILOT_PLUS="copilot-plus",g.MISTRAL="mistralai",g.DEEPSEEK="deepseek",g.COHEREAI="cohereai",g.SILICONFLOW="siliconflow",g))(OO||{}),gL={reasoning:"This model supports general reasoning tasks.",vision:"This model supports image inputs.",websearch:"This model can access the internet."},SO=[{name:"copilot-plus-flash",provider:"copilot-plus",enabled:!0,isBuiltIn:!0,core:!0,plusExclusive:!0,projectEnabled:!1,capabilities:["vision"]},{name:"google/gemini-2.5-flash-lite",provider:"openrouterai",enabled:!0,isBuiltIn:!0,core:!0,projectEnabled:!0,capabilities:["vision"]},{name:"google/gemini-2.5-flash",provider:"openrouterai",enabled:!0,isBuiltIn:!0,core:!0,projectEnabled:!0,capabilities:["vision"]},{name:"google/gemini-2.5-pro",provider:"openrouterai",enabled:!0,isBuiltIn:!0,core:!0,projectEnabled:!0,capabilities:["vision"]},{name:"openai/gpt-4.1",provider:"openrouterai",enabled:!0,isBuiltIn:!0,core:!1,projectEnabled:!0,capabilities:["vision"]},{name:"openai/gpt-4.1-mini",provider:"openrouterai",enabled:!0,isBuiltIn:!0,core:!1,projectEnabled:!0,capabilities:["vision"]},{name:"grok-4-fast",provider:"xai",enabled:!0,isBuiltIn:!0,core:!1,projectEnabled:!0,capabilities:["vision"]},{name:"x-ai/grok-4-fast",provider:"openrouterai",enabled:!0,isBuiltIn:!0,core:!1,projectEnabled:!0,capabilities:["vision"]},{name:"gpt-5",provider:"openai",enabled:!0,isBuiltIn:!0,core:!0,capabilities:["vision"]},{name:"gpt-5-mini",provider:"openai",enabled:!0,isBuiltIn:!0,core:!0,capabilities:["vision"]},{name:"gpt-4.1",provider:"openai",enabled:!0,isBuiltIn:!0,core:!0,projectEnabled:!0,capabilities:["vision"]},{name:"gpt-4.1-mini",provider:"openai",enabled:!0,isBuiltIn:!0,core:!0,projectEnabled:!0,capabilities:["vision"]},{name:"claude-sonnet-4-20250514",provider:"anthropic",enabled:!0,isBuiltIn:!0,capabilities:["vision","reasoning"]},{name:"gemini-2.5-flash",provider:"google",enabled:!0,isBuiltIn:!0,projectEnabled:!0,capabilities:["vision"]},{name:"gemini-2.5-flash-lite",provider:"google",enabled:!0,isBuiltIn:!0,projectEnabled:!0,capabilities:["vision"]},{name:"gemini-2.5-pro",provider:"google",enabled:!0,isBuiltIn:!0,projectEnabled:!0,capabilities:["vision"]},{name:"azure-openai",provider:"azure openai",enabled:!0,isBuiltIn:!0},{name:"deepseek-chat",provider:"deepseek",enabled:!0,isBuiltIn:!0},{name:"deepseek-reasoner",provider:"deepseek",enabled:!0,isBuiltIn:!0,capabilities:["reasoning"]},{name:"deepseek-ai/DeepSeek-V3",provider:"siliconflow",enabled:!1,isBuiltIn:!1,baseUrl:"https://api.siliconflow.com/v1"},{name:"deepseek-ai/DeepSeek-R1",provider:"siliconflow",enabled:!1,isBuiltIn:!1,baseUrl:"https://api.siliconflow.com/v1",capabilities:["reasoning"]}],pL=(c=>(c.OPENAI="openai",c.COHEREAI="cohereai",c.GOOGLE="google",c.AZURE_OPENAI="azure openai",c.OLLAMA="ollama",c.LM_STUDIO="lm-studio",c.OPENAI_FORMAT="3rd party (openai-format)",c.COPILOT_PLUS="copilot-plus",c.COPILOT_PLUS_JINA="copilot-plus-jina",c.SILICONFLOW="siliconflow",c))(pL||{}),Dz=[{name:"copilot-plus-small",provider:"copilot-plus",enabled:!0,isBuiltIn:!0,isEmbeddingModel:!0,core:!0,plusExclusive:!0},{name:"copilot-plus-large",provider:"copilot-plus-jina",enabled:!0,isBuiltIn:!0,isEmbeddingModel:!0,core:!0,plusExclusive:!0,believerExclusive:!0,dimensions:1024},{name:"copilot-plus-multilingual",provider:"copilot-plus-jina",enabled:!0,isBuiltIn:!0,isEmbeddingModel:!0,core:!0,plusExclusive:!0,dimensions:512},{name:"text-embedding-3-small",provider:"openai",enabled:!0,isBuiltIn:!0,isEmbeddingModel:!0,core:!0},{name:"text-embedding-3-large",provider:"openai",enabled:!0,isBuiltIn:!0,isEmbeddingModel:!0},{name:"embed-multilingual-light-v3.0",provider:"cohereai",enabled:!0,isBuiltIn:!0,isEmbeddingModel:!0},{name:"text-embedding-004",provider:"google",enabled:!0,isBuiltIn:!0,isEmbeddingModel:!0},{name:"gemini-embedding-001",provider:"google",enabled:!0,isBuiltIn:!0,isEmbeddingModel:!0,core:!0},{name:"azure-openai",provider:"azure openai",enabled:!0,isBuiltIn:!0,isEmbeddingModel:!0},{name:"Qwen/Qwen3-Embedding-0.6B",provider:"siliconflow",enabled:!0,isBuiltIn:!0,isEmbeddingModel:!0,core:!0,baseUrl:"https://api.siliconflow.com/v1"}],O2e="nomic-embed-text",TN={openrouterai:{label:"OpenRouter",host:"https://openrouter.ai/api/v1/",keyManagementURL:"https://openrouter.ai/keys",listModelURL:"https://openrouter.ai/api/v1/models",testModel:"openai/gpt-4.1-mini"},google:{label:"Gemini",host:"https://generativelanguage.googleapis.com",keyManagementURL:"https://makersuite.google.com/app/apikey",listModelURL:"https://generativelanguage.googleapis.com/v1beta/models",testModel:"gemini-2.5-flash"},anthropic:{label:"Anthropic",host:"https://api.anthropic.com/",keyManagementURL:"https://console.anthropic.com/settings/keys",listModelURL:"https://api.anthropic.com/v1/models",testModel:"claude-sonnet-4-20250514"},openai:{label:"OpenAI",host:"https://api.openai.com",keyManagementURL:"https://platform.openai.com/api-keys",listModelURL:"https://api.openai.com/v1/models",testModel:"gpt-4.1"},xai:{label:"XAI",host:"https://api.x.ai/v1",keyManagementURL:"https://console.x.ai",listModelURL:"https://api.x.ai/v1/models",testModel:"grok-4-fast"},"azure openai":{label:"Azure OpenAI",host:"",keyManagementURL:"",listModelURL:"",testModel:"azure-openai"},groq:{label:"Groq",host:"https://api.groq.com/openai",keyManagementURL:"https://console.groq.com/keys",listModelURL:"https://api.groq.com/openai/v1/models",testModel:"llama3-8b-8192"},cohereai:{label:"Cohere",host:"https://api.cohere.com",keyManagementURL:"https://dashboard.cohere.ai/api-keys",listModelURL:"https://api.cohere.com/v1/models",testModel:"command-r"},siliconflow:{label:"SiliconFlow",host:"https://api.siliconflow.com/v1",keyManagementURL:"https://cloud.siliconflow.com/me/account/ak",listModelURL:"https://api.siliconflow.com/v1/models",testModel:"deepseek-ai/DeepSeek-V3"},ollama:{label:"Ollama",host:"http://localhost:11434/v1/",keyManagementURL:"",listModelURL:""},"lm-studio":{label:"LM Studio",host:"http://localhost:1234/v1",keyManagementURL:"",listModelURL:""},"3rd party (openai-format)":{label:"OpenAI Format",host:"https://api.example.com/v1",keyManagementURL:"",listModelURL:""},mistralai:{label:"Mistral",host:"https://api.mistral.ai/v1",keyManagementURL:"https://console.mistral.ai/api-keys",listModelURL:"https://api.mistral.ai/v1/models",testModel:"mistral-tiny-latest"},deepseek:{label:"DeepSeek",host:"https://api.deepseek.com/",keyManagementURL:"https://platform.deepseek.com/api-keys",listModelURL:"https://api.deepseek.com/models",testModel:"deepseek-chat"},"amazon-bedrock":{label:"Amazon Bedrock",host:"https://bedrock-runtime.{region}.amazonaws.com",keyManagementURL:"https://console.aws.amazon.com/iam/home#/security_credentials",listModelURL:""},"copilot-plus":{label:"Copilot Plus",host:Bz,keyManagementURL:"",listModelURL:""},"copilot-plus-jina":{label:"Copilot Plus",host:Bz,keyManagementURL:"",listModelURL:""}},EN={anthropic:"anthropicApiKey",openai:"openAIApiKey","azure openai":"azureOpenAIApiKey",google:"googleApiKey",groq:"groqApiKey",openrouterai:"openRouterAiApiKey",cohereai:"cohereApiKey",xai:"xaiApiKey","copilot-plus":"plusLicenseKey",mistralai:"mistralApiKey",deepseek:"deepseekApiKey","amazon-bedrock":"amazonBedrockApiKey",siliconflow:"siliconflowApiKey"},zRt=["NEVER","ON STARTUP","ON MODE SWITCH"],ZQ=(r=>(r.ENTER="enter",r.SHIFT_ENTER="shift+enter",r))(ZQ||{}),Gn={TRIGGER_QUICK_COMMAND:"trigger-quick-command",CLEAR_LOCAL_COPILOT_INDEX:"clear-local-copilot-index",CLEAR_COPILOT_CACHE:"clear-copilot-cache",COUNT_WORD_AND_TOKENS_SELECTION:"count-word-and-tokens-selection",COUNT_TOTAL_VAULT_TOKENS:"count-total-vault-tokens",DEBUG_WORD_COMPLETION:"debug-word-completion",FORCE_REINDEX_VAULT_TO_COPILOT_INDEX:"force-reindex-vault-to-copilot-index",GARBAGE_COLLECT_COPILOT_INDEX:"garbage-collect-copilot-index",INDEX_VAULT_TO_COPILOT_INDEX:"index-vault-to-copilot-index",INSPECT_COPILOT_INDEX_BY_NOTE_PATHS:"copilot-inspect-index-by-note-paths",LIST_INDEXED_FILES:"copilot-list-indexed-files",LOAD_COPILOT_CHAT_CONVERSATION:"load-copilot-chat-conversation",NEW_CHAT:"new-chat",OPEN_COPILOT_CHAT_WINDOW:"chat-open-window",REMOVE_FILES_FROM_COPILOT_INDEX:"remove-files-from-copilot-index",SEARCH_ORAMA_DB:"copilot-search-orama-db",TOGGLE_COPILOT_CHAT_WINDOW:"chat-toggle-window",ADD_SELECTION_TO_CHAT_CONTEXT:"add-selection-to-chat-context",ADD_CUSTOM_COMMAND:"add-custom-command",APPLY_CUSTOM_COMMAND:"apply-custom-command",OPEN_LOG_FILE:"open-log-file",CLEAR_LOG_FILE:"clear-log-file",DOWNLOAD_YOUTUBE_SCRIPT:"download-youtube-script"},qhe={[Gn.TRIGGER_QUICK_COMMAND]:"Trigger quick command",[Gn.CLEAR_LOCAL_COPILOT_INDEX]:"Clear local Copilot index",[Gn.CLEAR_COPILOT_CACHE]:"Clear Copilot cache",[Gn.COUNT_TOTAL_VAULT_TOKENS]:"Count total tokens in your vault",[Gn.COUNT_WORD_AND_TOKENS_SELECTION]:"Count words and tokens in selection",[Gn.DEBUG_WORD_COMPLETION]:"Word completion: Debug",[Gn.FORCE_REINDEX_VAULT_TO_COPILOT_INDEX]:"Force reindex vault",[Gn.GARBAGE_COLLECT_COPILOT_INDEX]:"Garbage collect Copilot index (remove files that no longer exist in vault)",[Gn.INDEX_VAULT_TO_COPILOT_INDEX]:"Index (refresh) vault",[Gn.INSPECT_COPILOT_INDEX_BY_NOTE_PATHS]:"Inspect Copilot index by note paths (debug)",[Gn.LIST_INDEXED_FILES]:"List all indexed files (debug)",[Gn.LOAD_COPILOT_CHAT_CONVERSATION]:"Load Copilot chat conversation",[Gn.NEW_CHAT]:"New Copilot Chat",[Gn.OPEN_COPILOT_CHAT_WINDOW]:"Open Copilot Chat Window",[Gn.REMOVE_FILES_FROM_COPILOT_INDEX]:"Remove files from Copilot index (debug)",[Gn.SEARCH_ORAMA_DB]:"Search semantic index (debug)",[Gn.TOGGLE_COPILOT_CHAT_WINDOW]:"Toggle Copilot Chat Window",[Gn.ADD_SELECTION_TO_CHAT_CONTEXT]:"Add selection to chat context",[Gn.ADD_CUSTOM_COMMAND]:"Add new custom command",[Gn.APPLY_CUSTOM_COMMAND]:"Apply custom command",[Gn.OPEN_LOG_FILE]:"Create log file",[Gn.CLEAR_LOG_FILE]:"Clear log file",[Gn.DOWNLOAD_YOUTUBE_SCRIPT]:"Download YouTube Script (plus)"},G6={NON_MARKDOWN_FILES_RESTRICTED:"Non-markdown files are only available in Copilot Plus mode. Please upgrade to access this file type.",URL_PROCESSING_RESTRICTED:"URL processing is only available in Copilot Plus mode. URLs will not be processed for context.",UNSUPPORTED_FILE_TYPE:t=>`${t.toUpperCase()} files are not supported in the current mode.`},Ds={userId:gv(),isPlusUser:!1,plusLicenseKey:"",openAIApiKey:"",openAIOrgId:"",huggingfaceApiKey:"",cohereApiKey:"",anthropicApiKey:"",azureOpenAIApiKey:"",azureOpenAIApiInstanceName:"",azureOpenAIApiDeploymentName:"",azureOpenAIApiVersion:"",azureOpenAIApiEmbeddingDeploymentName:"",googleApiKey:"",openRouterAiApiKey:"",xaiApiKey:"",mistralApiKey:"",deepseekApiKey:"",amazonBedrockApiKey:"",amazonBedrockRegion:"",siliconflowApiKey:"",defaultChainType:"llm_chain",defaultModelKey:"google/gemini-2.5-flash|openrouterai",embeddingModelKey:"text-embedding-3-small|openai",temperature:iy.TEMPERATURE,maxTokens:iy.MAX_TOKENS,contextTurns:15,userSystemPrompt:"",openAIProxyBaseUrl:"",openAIEmbeddingProxyBaseUrl:"",stream:!0,defaultSaveFolder:xgn,defaultConversationTag:"copilot-conversation",autosaveChat:!0,generateAIChatTitleOnSave:!0,includeActiveNoteAsContext:!0,defaultOpenArea:"view",defaultSendShortcut:"enter",customPromptsFolder:Ogn,indexVaultToVectorStore:"ON MODE SWITCH",qaExclusions:v2e,qaInclusions:"",chatNoteContextPath:"",chatNoteContextTags:[],enableIndexSync:!0,debug:!1,enableEncryption:!1,maxSourceChunks:15,enableInlineCitations:!0,groqApiKey:"",activeModels:SO,activeEmbeddingModels:Dz,embeddingRequestsPerMin:60,embeddingBatchSize:16,disableIndexOnMobile:!0,showSuggestedPrompts:!0,showRelevantNotes:!0,numPartitions:1,lexicalSearchRamLimit:100,promptUsageTimestamps:{},promptSortStrategy:"timestamp",defaultConversationNoteName:"{$topic}@{$date}_{$time}",inlineEditCommands:[],projectList:[],lastDismissedVersion:null,passMarkdownImages:!0,enableAutonomousAgent:!0,enableCustomPromptTemplating:!0,enableSemanticSearchV3:!1,enableLexicalBoosts:!0,suggestedDefaultCommands:!1,autonomousAgentMaxIterations:4,autonomousAgentEnabledToolIds:["localSearch","readNote","webSearch","pomodoro","youtubeTranscription","writeToFile","replaceInFile","updateMemory"],reasoningEffort:iy.REASONING_EFFORT,verbosity:iy.VERBOSITY,memoryFolderName:Tgn,enableRecentConversations:!0,maxRecentConversations:30,enableSavedMemory:!0,quickCommandModelKey:void 0,quickCommandIncludeNoteContext:!0,autoIncludeTextSelection:!1},eS={CHAT_IS_VISIBLE:"chat-is-visible",ACTIVE_LEAF_CHANGE:"active-leaf-change",ABORT_STREAM:"abort-stream"}});var L2e=S(Bhe=>{"use strict";Bhe.byteLength=Pgn;Bhe.toByteArray=Rgn;Bhe.fromByteArray=Ngn;var PO=[],tS=[],Egn=typeof Uint8Array<"u"?Uint8Array:Array,$2e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";for(Hz=0,HRt=$2e.length;Hz0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");r===-1&&(r=e);var n=r===e?0:4-r%4;return[r,n]}function Pgn(t){var e=VRt(t),r=e[0],n=e[1];return(r+n)*3/4-n}function Mgn(t,e,r){return(e+r)*3/4-r}function Rgn(t){var e,r=VRt(t),n=r[0],o=r[1],i=new Egn(Mgn(t,n,o)),a=0,s=o>0?n-4:n,u;for(u=0;u>16&255,i[a++]=e>>8&255,i[a++]=e&255;return o===2&&(e=tS[t.charCodeAt(u)]<<2|tS[t.charCodeAt(u+1)]>>4,i[a++]=e&255),o===1&&(e=tS[t.charCodeAt(u)]<<10|tS[t.charCodeAt(u+1)]<<4|tS[t.charCodeAt(u+2)]>>2,i[a++]=e>>8&255,i[a++]=e&255),i}function Agn(t){return PO[t>>18&63]+PO[t>>12&63]+PO[t>>6&63]+PO[t&63]}function Ign(t,e,r){for(var n,o=[],i=e;is?s:a+i));return n===1?(e=t[r-1],o.push(PO[e>>2]+PO[e<<4&63]+"==")):n===2&&(e=(t[r-2]<<8)+t[r-1],o.push(PO[e>>10]+PO[e>>4&63]+PO[e<<2&63]+"=")),o.join("")}});var JRt=S(F2e=>{F2e.read=function(t,e,r,n,o){var i,a,s=o*8-n-1,u=(1<>1,c=-7,d=r?o-1:0,f=r?-1:1,p=t[e+d];for(d+=f,i=p&(1<<-c)-1,p>>=-c,c+=s;c>0;i=i*256+t[e+d],d+=f,c-=8);for(a=i&(1<<-c)-1,i>>=-c,c+=n;c>0;a=a*256+t[e+d],d+=f,c-=8);if(i===0)i=1-l;else{if(i===u)return a?NaN:(p?-1:1)*(1/0);a=a+Math.pow(2,n),i=i-l}return(p?-1:1)*a*Math.pow(2,i-n)};F2e.write=function(t,e,r,n,o,i){var a,s,u,l=i*8-o-1,c=(1<>1,f=o===23?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,m=n?1:-1,h=e<0||e===0&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,a=c):(a=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-a))<1&&(a--,u*=2),a+d>=1?e+=f/u:e+=f*Math.pow(2,1-d),e*u>=2&&(a++,u/=2),a+d>=c?(s=0,a=c):a+d>=1?(s=(e*u-1)*Math.pow(2,o),a=a+d):(s=e*Math.pow(2,d-1)*Math.pow(2,o),a=0));o>=8;t[r+p]=s&255,p+=m,s/=256,o-=8);for(a=a<0;t[r+p]=a&255,p+=m,a/=256,l-=8);t[r+p-m]|=h*128}});var rS=S(Q6=>{"use strict";var k2e=L2e(),X6=JRt(),KRt=typeof Symbol=="function"&&typeof Symbol.for=="function"?Symbol.for("nodejs.util.inspect.custom"):null;Q6.Buffer=De;Q6.SlowBuffer=kgn;Q6.INSPECT_MAX_BYTES=50;var Uhe=2147483647;Q6.kMaxLength=Uhe;De.TYPED_ARRAY_SUPPORT=jgn();!De.TYPED_ARRAY_SUPPORT&&typeof console<"u"&&typeof console.error=="function"&&console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support.");function jgn(){try{let t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),t.foo()===42}catch{return!1}}Object.defineProperty(De.prototype,"parent",{enumerable:!0,get:function(){if(De.isBuffer(this))return this.buffer}});Object.defineProperty(De.prototype,"offset",{enumerable:!0,get:function(){if(De.isBuffer(this))return this.byteOffset}});function MN(t){if(t>Uhe)throw new RangeError('The value "'+t+'" is invalid for option "size"');let e=new Uint8Array(t);return Object.setPrototypeOf(e,De.prototype),e}function De(t,e,r){if(typeof t=="number"){if(typeof e=="string")throw new TypeError('The "string" argument must be of type string. Received type number');return z2e(t)}return XRt(t,e,r)}De.poolSize=8192;function XRt(t,e,r){if(typeof t=="string")return $gn(t,e);if(ArrayBuffer.isView(t))return Lgn(t);if(t==null)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(MO(t,ArrayBuffer)||t&&MO(t.buffer,ArrayBuffer)||typeof SharedArrayBuffer<"u"&&(MO(t,SharedArrayBuffer)||t&&MO(t.buffer,SharedArrayBuffer)))return B2e(t,e,r);if(typeof t=="number")throw new TypeError('The "value" argument must not be of type number. Received type number');let n=t.valueOf&&t.valueOf();if(n!=null&&n!==t)return De.from(n,e,r);let o=Fgn(t);if(o)return o;if(typeof Symbol<"u"&&Symbol.toPrimitive!=null&&typeof t[Symbol.toPrimitive]=="function")return De.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}De.from=function(t,e,r){return XRt(t,e,r)};Object.setPrototypeOf(De.prototype,Uint8Array.prototype);Object.setPrototypeOf(De,Uint8Array);function YRt(t){if(typeof t!="number")throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function Dgn(t,e,r){return YRt(t),t<=0?MN(t):e!==void 0?typeof r=="string"?MN(t).fill(e,r):MN(t).fill(e):MN(t)}De.alloc=function(t,e,r){return Dgn(t,e,r)};function z2e(t){return YRt(t),MN(t<0?0:H2e(t)|0)}De.allocUnsafe=function(t){return z2e(t)};De.allocUnsafeSlow=function(t){return z2e(t)};function $gn(t,e){if((typeof e!="string"||e==="")&&(e="utf8"),!De.isEncoding(e))throw new TypeError("Unknown encoding: "+e);let r=QRt(t,e)|0,n=MN(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}function q2e(t){let e=t.length<0?0:H2e(t.length)|0,r=MN(e);for(let n=0;n=Uhe)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+Uhe.toString(16)+" bytes");return t|0}function kgn(t){return+t!=t&&(t=0),De.alloc(+t)}De.isBuffer=function(e){return e!=null&&e._isBuffer===!0&&e!==De.prototype};De.compare=function(e,r){if(MO(e,Uint8Array)&&(e=De.from(e,e.offset,e.byteLength)),MO(r,Uint8Array)&&(r=De.from(r,r.offset,r.byteLength)),!De.isBuffer(e)||!De.isBuffer(r))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===r)return 0;let n=e.length,o=r.length;for(let i=0,a=Math.min(n,o);io.length?(De.isBuffer(a)||(a=De.from(a)),a.copy(o,i)):Uint8Array.prototype.set.call(o,a,i);else if(De.isBuffer(a))a.copy(o,i);else throw new TypeError('"list" argument must be an Array of Buffers');i+=a.length}return o};function QRt(t,e){if(De.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||MO(t,ArrayBuffer))return t.byteLength;if(typeof t!="string")throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);let r=t.length,n=arguments.length>2&&arguments[2]===!0;if(!n&&r===0)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return U2e(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return r*2;case"hex":return r>>>1;case"base64":return uAt(t).length;default:if(o)return n?-1:U2e(t).length;e=(""+e).toLowerCase(),o=!0}}De.byteLength=QRt;function qgn(t,e,r){let n=!1;if((e===void 0||e<0)&&(e=0),e>this.length||((r===void 0||r>this.length)&&(r=this.length),r<=0)||(r>>>=0,e>>>=0,r<=e))return"";for(t||(t="utf8");;)switch(t){case"hex":return Zgn(this,e,r);case"utf8":case"utf-8":return tAt(this,e,r);case"ascii":return Wgn(this,e,r);case"latin1":case"binary":return Ggn(this,e,r);case"base64":return Jgn(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Xgn(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}De.prototype._isBuffer=!0;function Vz(t,e,r){let n=t[e];t[e]=t[r],t[r]=n}De.prototype.swap16=function(){let e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let r=0;rr&&(e+=" ... "),""};KRt&&(De.prototype[KRt]=De.prototype.inspect);De.prototype.compare=function(e,r,n,o,i){if(MO(e,Uint8Array)&&(e=De.from(e,e.offset,e.byteLength)),!De.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(r===void 0&&(r=0),n===void 0&&(n=e?e.length:0),o===void 0&&(o=0),i===void 0&&(i=this.length),r<0||n>e.length||o<0||i>this.length)throw new RangeError("out of range index");if(o>=i&&r>=n)return 0;if(o>=i)return-1;if(r>=n)return 1;if(r>>>=0,n>>>=0,o>>>=0,i>>>=0,this===e)return 0;let a=i-o,s=n-r,u=Math.min(a,s),l=this.slice(o,i),c=e.slice(r,n);for(let d=0;d2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,J2e(r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0)if(o)r=0;else return-1;if(typeof e=="string"&&(e=De.from(e,n)),De.isBuffer(e))return e.length===0?-1:WRt(t,e,r,n,o);if(typeof e=="number")return e=e&255,typeof Uint8Array.prototype.indexOf=="function"?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):WRt(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function WRt(t,e,r,n,o){let i=1,a=t.length,s=e.length;if(n!==void 0&&(n=String(n).toLowerCase(),n==="ucs2"||n==="ucs-2"||n==="utf16le"||n==="utf-16le")){if(t.length<2||e.length<2)return-1;i=2,a/=2,s/=2,r/=2}function u(c,d){return i===1?c[d]:c.readUInt16BE(d*i)}let l;if(o){let c=-1;for(l=r;la&&(r=a-s),l=r;l>=0;l--){let c=!0;for(let d=0;do&&(n=o)):n=o;let i=e.length;n>i/2&&(n=i/2);let a;for(a=0;a>>0,isFinite(n)?(n=n>>>0,o===void 0&&(o="utf8")):(o=n,n=void 0);else throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");let i=this.length-r;if((n===void 0||n>i)&&(n=i),e.length>0&&(n<0||r<0)||r>this.length)throw new RangeError("Attempt to write outside buffer bounds");o||(o="utf8");let a=!1;for(;;)switch(o){case"hex":return Bgn(this,e,r,n);case"utf8":case"utf-8":return Ugn(this,e,r,n);case"ascii":case"latin1":case"binary":return zgn(this,e,r,n);case"base64":return Hgn(this,e,r,n);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return Vgn(this,e,r,n);default:if(a)throw new TypeError("Unknown encoding: "+o);o=(""+o).toLowerCase(),a=!0}};De.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};function Jgn(t,e,r){return e===0&&r===t.length?k2e.fromByteArray(t):k2e.fromByteArray(t.slice(e,r))}function tAt(t,e,r){r=Math.min(t.length,r);let n=[],o=e;for(;o239?4:i>223?3:i>191?2:1;if(o+s<=r){let u,l,c,d;switch(s){case 1:i<128&&(a=i);break;case 2:u=t[o+1],(u&192)===128&&(d=(i&31)<<6|u&63,d>127&&(a=d));break;case 3:u=t[o+1],l=t[o+2],(u&192)===128&&(l&192)===128&&(d=(i&15)<<12|(u&63)<<6|l&63,d>2047&&(d<55296||d>57343)&&(a=d));break;case 4:u=t[o+1],l=t[o+2],c=t[o+3],(u&192)===128&&(l&192)===128&&(c&192)===128&&(d=(i&15)<<18|(u&63)<<12|(l&63)<<6|c&63,d>65535&&d<1114112&&(a=d))}}a===null?(a=65533,s=1):a>65535&&(a-=65536,n.push(a>>>10&1023|55296),a=56320|a&1023),n.push(a),o+=s}return Kgn(n)}var GRt=4096;function Kgn(t){let e=t.length;if(e<=GRt)return String.fromCharCode.apply(String,t);let r="",n=0;for(;nn)&&(r=n);let o="";for(let i=e;in&&(e=n),r<0?(r+=n,r<0&&(r=0)):r>n&&(r=n),rr)throw new RangeError("Trying to access beyond buffer length")}De.prototype.readUintLE=De.prototype.readUIntLE=function(e,r,n){e=e>>>0,r=r>>>0,n||ah(e,r,this.length);let o=this[e],i=1,a=0;for(;++a>>0,r=r>>>0,n||ah(e,r,this.length);let o=this[e+--r],i=1;for(;r>0&&(i*=256);)o+=this[e+--r]*i;return o};De.prototype.readUint8=De.prototype.readUInt8=function(e,r){return e=e>>>0,r||ah(e,1,this.length),this[e]};De.prototype.readUint16LE=De.prototype.readUInt16LE=function(e,r){return e=e>>>0,r||ah(e,2,this.length),this[e]|this[e+1]<<8};De.prototype.readUint16BE=De.prototype.readUInt16BE=function(e,r){return e=e>>>0,r||ah(e,2,this.length),this[e]<<8|this[e+1]};De.prototype.readUint32LE=De.prototype.readUInt32LE=function(e,r){return e=e>>>0,r||ah(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+this[e+3]*16777216};De.prototype.readUint32BE=De.prototype.readUInt32BE=function(e,r){return e=e>>>0,r||ah(e,4,this.length),this[e]*16777216+(this[e+1]<<16|this[e+2]<<8|this[e+3])};De.prototype.readBigUInt64LE=yL(function(e){e=e>>>0,Y6(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&lee(e,this.length-8);let o=r+this[++e]*2**8+this[++e]*2**16+this[++e]*2**24,i=this[++e]+this[++e]*2**8+this[++e]*2**16+n*2**24;return BigInt(o)+(BigInt(i)<>>0,Y6(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&lee(e,this.length-8);let o=r*2**24+this[++e]*2**16+this[++e]*2**8+this[++e],i=this[++e]*2**24+this[++e]*2**16+this[++e]*2**8+n;return(BigInt(o)<>>0,r=r>>>0,n||ah(e,r,this.length);let o=this[e],i=1,a=0;for(;++a=i&&(o-=Math.pow(2,8*r)),o};De.prototype.readIntBE=function(e,r,n){e=e>>>0,r=r>>>0,n||ah(e,r,this.length);let o=r,i=1,a=this[e+--o];for(;o>0&&(i*=256);)a+=this[e+--o]*i;return i*=128,a>=i&&(a-=Math.pow(2,8*r)),a};De.prototype.readInt8=function(e,r){return e=e>>>0,r||ah(e,1,this.length),this[e]&128?(255-this[e]+1)*-1:this[e]};De.prototype.readInt16LE=function(e,r){e=e>>>0,r||ah(e,2,this.length);let n=this[e]|this[e+1]<<8;return n&32768?n|4294901760:n};De.prototype.readInt16BE=function(e,r){e=e>>>0,r||ah(e,2,this.length);let n=this[e+1]|this[e]<<8;return n&32768?n|4294901760:n};De.prototype.readInt32LE=function(e,r){return e=e>>>0,r||ah(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24};De.prototype.readInt32BE=function(e,r){return e=e>>>0,r||ah(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]};De.prototype.readBigInt64LE=yL(function(e){e=e>>>0,Y6(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&lee(e,this.length-8);let o=this[e+4]+this[e+5]*2**8+this[e+6]*2**16+(n<<24);return(BigInt(o)<>>0,Y6(e,"offset");let r=this[e],n=this[e+7];(r===void 0||n===void 0)&&lee(e,this.length-8);let o=(r<<24)+this[++e]*2**16+this[++e]*2**8+this[++e];return(BigInt(o)<>>0,r||ah(e,4,this.length),X6.read(this,e,!0,23,4)};De.prototype.readFloatBE=function(e,r){return e=e>>>0,r||ah(e,4,this.length),X6.read(this,e,!1,23,4)};De.prototype.readDoubleLE=function(e,r){return e=e>>>0,r||ah(e,8,this.length),X6.read(this,e,!0,52,8)};De.prototype.readDoubleBE=function(e,r){return e=e>>>0,r||ah(e,8,this.length),X6.read(this,e,!1,52,8)};function u_(t,e,r,n,o,i){if(!De.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||et.length)throw new RangeError("Index out of range")}De.prototype.writeUintLE=De.prototype.writeUIntLE=function(e,r,n,o){if(e=+e,r=r>>>0,n=n>>>0,!o){let s=Math.pow(2,8*n)-1;u_(this,e,r,n,s,0)}let i=1,a=0;for(this[r]=e&255;++a>>0,n=n>>>0,!o){let s=Math.pow(2,8*n)-1;u_(this,e,r,n,s,0)}let i=n-1,a=1;for(this[r+i]=e&255;--i>=0&&(a*=256);)this[r+i]=e/a&255;return r+n};De.prototype.writeUint8=De.prototype.writeUInt8=function(e,r,n){return e=+e,r=r>>>0,n||u_(this,e,r,1,255,0),this[r]=e&255,r+1};De.prototype.writeUint16LE=De.prototype.writeUInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||u_(this,e,r,2,65535,0),this[r]=e&255,this[r+1]=e>>>8,r+2};De.prototype.writeUint16BE=De.prototype.writeUInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||u_(this,e,r,2,65535,0),this[r]=e>>>8,this[r+1]=e&255,r+2};De.prototype.writeUint32LE=De.prototype.writeUInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||u_(this,e,r,4,4294967295,0),this[r+3]=e>>>24,this[r+2]=e>>>16,this[r+1]=e>>>8,this[r]=e&255,r+4};De.prototype.writeUint32BE=De.prototype.writeUInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||u_(this,e,r,4,4294967295,0),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};function rAt(t,e,r,n,o){sAt(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r++]=i,i=i>>8,t[r++]=i,i=i>>8,t[r++]=i,i=i>>8,t[r++]=i;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,a=a>>8,t[r++]=a,r}function nAt(t,e,r,n,o){sAt(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r+7]=i,i=i>>8,t[r+6]=i,i=i>>8,t[r+5]=i,i=i>>8,t[r+4]=i;let a=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=a,a=a>>8,t[r+2]=a,a=a>>8,t[r+1]=a,a=a>>8,t[r]=a,r+8}De.prototype.writeBigUInt64LE=yL(function(e,r=0){return rAt(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});De.prototype.writeBigUInt64BE=yL(function(e,r=0){return nAt(this,e,r,BigInt(0),BigInt("0xffffffffffffffff"))});De.prototype.writeIntLE=function(e,r,n,o){if(e=+e,r=r>>>0,!o){let u=Math.pow(2,8*n-1);u_(this,e,r,n,u-1,-u)}let i=0,a=1,s=0;for(this[r]=e&255;++i>0)-s&255;return r+n};De.prototype.writeIntBE=function(e,r,n,o){if(e=+e,r=r>>>0,!o){let u=Math.pow(2,8*n-1);u_(this,e,r,n,u-1,-u)}let i=n-1,a=1,s=0;for(this[r+i]=e&255;--i>=0&&(a*=256);)e<0&&s===0&&this[r+i+1]!==0&&(s=1),this[r+i]=(e/a>>0)-s&255;return r+n};De.prototype.writeInt8=function(e,r,n){return e=+e,r=r>>>0,n||u_(this,e,r,1,127,-128),e<0&&(e=255+e+1),this[r]=e&255,r+1};De.prototype.writeInt16LE=function(e,r,n){return e=+e,r=r>>>0,n||u_(this,e,r,2,32767,-32768),this[r]=e&255,this[r+1]=e>>>8,r+2};De.prototype.writeInt16BE=function(e,r,n){return e=+e,r=r>>>0,n||u_(this,e,r,2,32767,-32768),this[r]=e>>>8,this[r+1]=e&255,r+2};De.prototype.writeInt32LE=function(e,r,n){return e=+e,r=r>>>0,n||u_(this,e,r,4,2147483647,-2147483648),this[r]=e&255,this[r+1]=e>>>8,this[r+2]=e>>>16,this[r+3]=e>>>24,r+4};De.prototype.writeInt32BE=function(e,r,n){return e=+e,r=r>>>0,n||u_(this,e,r,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[r]=e>>>24,this[r+1]=e>>>16,this[r+2]=e>>>8,this[r+3]=e&255,r+4};De.prototype.writeBigInt64LE=yL(function(e,r=0){return rAt(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});De.prototype.writeBigInt64BE=yL(function(e,r=0){return nAt(this,e,r,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))});function oAt(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function iAt(t,e,r,n,o){return e=+e,r=r>>>0,o||oAt(t,e,r,4,34028234663852886e22,-34028234663852886e22),X6.write(t,e,r,n,23,4),r+4}De.prototype.writeFloatLE=function(e,r,n){return iAt(this,e,r,!0,n)};De.prototype.writeFloatBE=function(e,r,n){return iAt(this,e,r,!1,n)};function aAt(t,e,r,n,o){return e=+e,r=r>>>0,o||oAt(t,e,r,8,17976931348623157e292,-17976931348623157e292),X6.write(t,e,r,n,52,8),r+8}De.prototype.writeDoubleLE=function(e,r,n){return aAt(this,e,r,!0,n)};De.prototype.writeDoubleBE=function(e,r,n){return aAt(this,e,r,!1,n)};De.prototype.copy=function(e,r,n,o){if(!De.isBuffer(e))throw new TypeError("argument should be a Buffer");if(n||(n=0),!o&&o!==0&&(o=this.length),r>=e.length&&(r=e.length),r||(r=0),o>0&&o=this.length)throw new RangeError("Index out of range");if(o<0)throw new RangeError("sourceEnd out of bounds");o>this.length&&(o=this.length),e.length-r>>0,n=n===void 0?this.length:n>>>0,e||(e=0);let i;if(typeof e=="number")for(i=r;i2**32?o=ZRt(String(r)):typeof r=="bigint"&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=ZRt(o)),o+="n"),n+=` It must be ${e}. Received ${o}`,n},RangeError);function ZRt(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function Ygn(t,e,r){Y6(e,"offset"),(t[e]===void 0||t[e+r]===void 0)&&lee(e,t.length-(r+1))}function sAt(t,e,r,n,o,i){if(t>r||t3?e===0||e===BigInt(0)?s=`>= 0${a} and < 2${a} ** ${(i+1)*8}${a}`:s=`>= -(2${a} ** ${(i+1)*8-1}${a}) and < 2 ** ${(i+1)*8-1}${a}`:s=`>= ${e}${a} and <= ${r}${a}`,new Z6.ERR_OUT_OF_RANGE("value",s,t)}Ygn(n,o,i)}function Y6(t,e){if(typeof t!="number")throw new Z6.ERR_INVALID_ARG_TYPE(e,"number",t)}function lee(t,e,r){throw Math.floor(t)!==t?(Y6(t,r),new Z6.ERR_OUT_OF_RANGE(r||"offset","an integer",t)):e<0?new Z6.ERR_BUFFER_OUT_OF_BOUNDS:new Z6.ERR_OUT_OF_RANGE(r||"offset",`>= ${r?1:0} and <= ${e}`,t)}var Qgn=/[^+/0-9A-Za-z-_]/g;function eyn(t){if(t=t.split("=")[0],t=t.trim().replace(Qgn,""),t.length<2)return"";for(;t.length%4!==0;)t=t+"=";return t}function U2e(t,e){e=e||1/0;let r,n=t.length,o=null,i=[];for(let a=0;a55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}else if(a+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=(o-55296<<10|r-56320)+65536}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,r&63|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,r&63|128)}else if(r<1114112){if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,r&63|128)}else throw new Error("Invalid code point")}return i}function tyn(t){let e=[];for(let r=0;r>8,o=r%256,i.push(o),i.push(n);return i}function uAt(t){return k2e.toByteArray(eyn(t))}function zhe(t,e,r,n){let o;for(o=0;o=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function MO(t,e){return t instanceof e||t!=null&&t.constructor!=null&&t.constructor.name!=null&&t.constructor.name===e.name}function J2e(t){return t!==t}var nyn=function(){let t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){let n=r*16;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function yL(t){return typeof BigInt>"u"?oyn:t}function oyn(){throw new Error("BigInt not supported")}});function cee(){return cAt.Platform.isDesktop&&Hhe||(Hhe=require("electron")?.remote?.safeStorage),Hhe}async function X2e(){return await crypto.subtle.importKey("raw",iyn,Vhe.name,!1,["encrypt","decrypt"])}async function dAt(t){if(!t.enableEncryption)return t;let e={...t},r=Object.keys(t).filter(n=>n.toLowerCase().includes("apikey")||n==="plusLicenseKey");for(let n of r){let o=t[n];e[n]=await K2e(o)}return Array.isArray(t.activeModels)&&(e.activeModels=await Promise.all(t.activeModels.map(async n=>({...n,apiKey:await K2e(n.apiKey||"")})))),Array.isArray(t.activeEmbeddingModels)&&(e.activeEmbeddingModels=await Promise.all(t.activeEmbeddingModels.map(async n=>({...n,apiKey:await K2e(n.apiKey||"")})))),e}async function K2e(t){if(!t||t.startsWith(Y2e))return t;fAt(t)&&(t=t.replace(Jhe,""));try{if(cee()?.isEncryptionAvailable()){let o=cee().encryptString(t);return G2e+o.toString("base64")}let e=await X2e(),r=new TextEncoder().encode(t),n=await crypto.subtle.encrypt(Vhe,e,r);return Z2e+syn(n)}catch(e){return console.error("Encryption failed:",e),t}}async function wi(t){if(!t||ayn(t))return t;if(fAt(t))return t.replace(Jhe,"");if(t.startsWith(G2e)){let r=t.replace(G2e,""),n=W2e.Buffer.from(r,"base64");return cee().decryptString(n)}if(t.startsWith(Z2e)){let r=t.replace(Z2e,""),n=await X2e(),o=lAt(r),i=await crypto.subtle.decrypt(Vhe,n,o);return new TextDecoder().decode(i)}let e=t.replace(Y2e,"");try{if(cee()?.isEncryptionAvailable())try{let i=W2e.Buffer.from(e,"base64");return cee().decryptString(i)}catch{}let r=await X2e(),n=lAt(e),o=await crypto.subtle.decrypt(Vhe,r,n);return new TextDecoder().decode(o)}catch(r){return console.error("Decryption failed:",r),"Copilot failed to decrypt API keys!"}}function ayn(t){return!t.startsWith(Y2e)&&!t.startsWith(Jhe)}function fAt(t){return t.startsWith(Jhe)}function syn(t){let e=new Uint8Array(t),r="";for(let n=0;n{W2e=L(rS()),cAt=require("obsidian"),Hhe=null;G2e="enc_desk_",Z2e="enc_web_",Y2e="enc_",Jhe="dec_",iyn=new TextEncoder().encode("obsidian-copilot-v1"),Vhe={name:"AES-GCM",iv:new Uint8Array(12)}});var hAt={};Jn(hAt,{addSelectedTextContext:()=>dyn,clearSelectedTextContexts:()=>oHe,getChainType:()=>RO,getCurrentProject:()=>tl,getModelKey:()=>Pv,getProjectContextLoadState:()=>fyn,getSelectedTextContexts:()=>vL,isProjectLoading:()=>lyn,isProjectMode:()=>Wz,projectContextLoadAtom:()=>RN,removeSelectedTextContext:()=>nHe,setChainType:()=>bL,setCurrentProject:()=>_L,setModelKey:()=>eHe,setProjectContextLoadState:()=>aHe,setProjectLoading:()=>X0,setSelectedTextContexts:()=>Gz,subscribeToChainTypeChange:()=>rHe,subscribeToModelKeyChange:()=>tHe,subscribeToProjectChange:()=>Kz,subscribeToProjectContextLoadChange:()=>pyn,subscribeToProjectLoadingChange:()=>cyn,updateProjectContextLoadState:()=>Y0,useChainType:()=>l_,useCurrentProject:()=>uyn,useModelKey:()=>Z0,useProjectContextLoad:()=>mee,useProjectLoading:()=>pee,useSelectedTextContexts:()=>iHe});function eHe(t){Kn.set(Khe,t)}function Pv(){return Kn.get(Khe)}function tHe(t){return Kn.sub(Khe,t)}function Z0(){return Nz(Khe,{store:Kn})}function RO(){return Kn.get(Whe)}function bL(t){Kn.set(Whe,t)}function rHe(t){return Kn.sub(Whe,t)}function l_(){return Nz(Whe,{store:Kn})}function _L(t){Kn.set(dee,t)}function tl(){return Kn.get(dee)}function Kz(t){return Kn.sub(dee,()=>{t(Kn.get(dee))})}function uyn(){return Nz(dee,{store:Kn})}function X0(t){Kn.set(fee,t)}function lyn(){return Kn.get(fee)}function cyn(t){return Kn.sub(fee,()=>{t(Kn.get(fee))})}function pee(){return Nz(fee,{store:Kn})}function Wz(){return RO()==="project"}function Gz(t){Kn.set(Q2e,t)}function vL(){return Kn.get(Q2e)}function dyn(t){let e=vL();Gz([...e,t])}function nHe(t){let e=vL();Gz(e.filter(r=>r.id!==t))}function oHe(){Gz([])}function iHe(){return Nz(Q2e,{store:Kn})}function fyn(){return Kn.get(RN)}function aHe(t){Kn.set(RN,t)}function Y0(t,e){Kn.set(RN,r=>({...r,[t]:e(r[t])}))}function pyn(t){return Kn.sub(RN,()=>{t(Kn.get(RN))})}function mee(){return Nz(RN,{store:Kn})}var pAt,Khe,mAt,Whe,dee,fee,RN,Q2e,Us=v(()=>{Hc();jt();CN();pAt=oh(null),Khe=oh(t=>{let e=t(pAt);return e!==null?e:t(fL).defaultModelKey},(t,e,r)=>{e(pAt,r)}),mAt=oh(null),Whe=oh(t=>{let e=t(mAt);return e!==null?e:t(fL).defaultChainType},(t,e,r)=>{e(mAt,r)}),dee=oh(null),fee=oh(!1),RN=oh({success:[],failed:[],processingFiles:[],total:[]}),Q2e=oh([])});var OAt=S(ju=>{"use strict";function cHe(t,e){var r=t.length;t.push(e);e:for(;0>>1,o=t[n];if(0>>1;nGhe(s,r))uGhe(l,s)?(t[n]=l,t[u]=r,n=u):(t[n]=s,t[a]=r,n=a);else if(uGhe(l,r))t[n]=l,t[u]=r,n=u;else break e}}return e}function Ghe(t,e){var r=t.sortIndex-e.sortIndex;return r!==0?r:t.id-e.id}typeof performance=="object"&&typeof performance.now=="function"?(gAt=performance,ju.unstable_now=function(){return gAt.now()}):(sHe=Date,yAt=sHe.now(),ju.unstable_now=function(){return sHe.now()-yAt});var gAt,sHe,yAt,AO=[],wL=[],myn=1,nS=null,ay=3,Yhe=!1,Zz=!1,gee=!1,vAt=typeof setTimeout=="function"?setTimeout:null,wAt=typeof clearTimeout=="function"?clearTimeout:null,bAt=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function dHe(t){for(var e=Q0(wL);e!==null;){if(e.callback===null)Xhe(wL);else if(e.startTime<=t)Xhe(wL),e.sortIndex=e.expirationTime,cHe(AO,e);else break;e=Q0(wL)}}function fHe(t){if(gee=!1,dHe(t),!Zz)if(Q0(AO)!==null)Zz=!0,mHe(pHe);else{var e=Q0(wL);e!==null&&hHe(fHe,e.startTime-t)}}function pHe(t,e){Zz=!1,gee&&(gee=!1,wAt(yee),yee=-1),Yhe=!0;var r=ay;try{for(dHe(e),nS=Q0(AO);nS!==null&&(!(nS.expirationTime>e)||t&&!xAt());){var n=nS.callback;if(typeof n=="function"){nS.callback=null,ay=nS.priorityLevel;var o=n(nS.expirationTime<=e);e=ju.unstable_now(),typeof o=="function"?nS.callback=o:nS===Q0(AO)&&Xhe(AO),dHe(e)}else Xhe(AO);nS=Q0(AO)}if(nS!==null)var i=!0;else{var a=Q0(wL);a!==null&&hHe(fHe,a.startTime-e),i=!1}return i}finally{nS=null,ay=r,Yhe=!1}}var Qhe=!1,Zhe=null,yee=-1,SAt=5,CAt=-1;function xAt(){return!(ju.unstable_now()-CAtt||125n?(t.sortIndex=r,cHe(wL,t),Q0(AO)===null&&t===Q0(wL)&&(gee?(wAt(yee),yee=-1):gee=!0,hHe(fHe,r-n))):(t.sortIndex=o,cHe(AO,t),Zz||Yhe||(Zz=!0,mHe(pHe))),t};ju.unstable_shouldYield=xAt;ju.unstable_wrapCallback=function(t){var e=ay;return function(){var r=ay;ay=e;try{return t.apply(this,arguments)}finally{ay=r}}}});var EAt=S((HIi,TAt)=>{"use strict";TAt.exports=OAt()});var N1t=S(jv=>{"use strict";var jIt=X(),Iv=EAt();function et(t){for(var e="https://reactjs.org/docs/error-decoder.html?invariant="+t,r=1;r"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),FHe=Object.prototype.hasOwnProperty,hyn=/^[:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD][:A-Z_a-z\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u02FF\u0370-\u037D\u037F-\u1FFF\u200C-\u200D\u2070-\u218F\u2C00-\u2FEF\u3001-\uD7FF\uF900-\uFDCF\uFDF0-\uFFFD\-.0-9\u00B7\u0300-\u036F\u203F-\u2040]*$/,PAt={},MAt={};function gyn(t){return FHe.call(MAt,t)?!0:FHe.call(PAt,t)?!1:hyn.test(t)?MAt[t]=!0:(PAt[t]=!0,!1)}function yyn(t,e,r,n){if(r!==null&&r.type===0)return!1;switch(typeof e){case"function":case"symbol":return!0;case"boolean":return n?!1:r!==null?!r.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function byn(t,e,r,n){if(e===null||typeof e>"u"||yyn(t,e,r,n))return!0;if(n)return!1;if(r!==null)switch(r.type){case 3:return!e;case 4:return e===!1;case 5:return isNaN(e);case 6:return isNaN(e)||1>e}return!1}function lb(t,e,r,n,o,i,a){this.acceptsBooleans=e===2||e===3||e===4,this.attributeName=n,this.attributeNamespace=o,this.mustUseProperty=r,this.propertyName=t,this.type=e,this.sanitizeURL=i,this.removeEmptyString=a}var ng={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){ng[t]=new lb(t,0,!1,t,null,!1,!1)});[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var e=t[0];ng[e]=new lb(e,1,!1,t[1],null,!1,!1)});["contentEditable","draggable","spellCheck","value"].forEach(function(t){ng[t]=new lb(t,2,!1,t.toLowerCase(),null,!1,!1)});["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){ng[t]=new lb(t,2,!1,t,null,!1,!1)});"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){ng[t]=new lb(t,3,!1,t.toLowerCase(),null,!1,!1)});["checked","multiple","muted","selected"].forEach(function(t){ng[t]=new lb(t,3,!0,t,null,!1,!1)});["capture","download"].forEach(function(t){ng[t]=new lb(t,4,!1,t,null,!1,!1)});["cols","rows","size","span"].forEach(function(t){ng[t]=new lb(t,6,!1,t,null,!1,!1)});["rowSpan","start"].forEach(function(t){ng[t]=new lb(t,5,!1,t.toLowerCase(),null,!1,!1)});var RVe=/[\-:]([a-z])/g;function AVe(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var e=t.replace(RVe,AVe);ng[e]=new lb(e,1,!1,t,null,!1,!1)});"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var e=t.replace(RVe,AVe);ng[e]=new lb(e,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)});["xml:base","xml:lang","xml:space"].forEach(function(t){var e=t.replace(RVe,AVe);ng[e]=new lb(e,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)});["tabIndex","crossOrigin"].forEach(function(t){ng[t]=new lb(t,1,!1,t.toLowerCase(),null,!1,!1)});ng.xlinkHref=new lb("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1);["src","href","action","formAction"].forEach(function(t){ng[t]=new lb(t,1,!1,t.toLowerCase(),null,!0,!0)});function IVe(t,e,r,n){var o=ng.hasOwnProperty(e)?ng[e]:null;(o!==null?o.type!==0:n||!(2s||o[a]!==i[s]){var u=` +`+o[a].replace(" at new "," at ");return t.displayName&&u.includes("")&&(u=u.replace("",t.displayName)),u}while(1<=a&&0<=s);break}}}finally{yHe=!1,Error.prepareStackTrace=r}return(t=t?t.displayName||t.name:"")?Tee(t):""}function _yn(t){switch(t.tag){case 5:return Tee(t.type);case 16:return Tee("Lazy");case 13:return Tee("Suspense");case 19:return Tee("SuspenseList");case 0:case 2:case 15:return t=bHe(t.type,!1),t;case 11:return t=bHe(t.type.render,!1),t;case 1:return t=bHe(t.type,!0),t;default:return""}}function UHe(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case n5:return"Fragment";case r5:return"Portal";case kHe:return"Profiler";case NVe:return"StrictMode";case qHe:return"Suspense";case BHe:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case LIt:return(t.displayName||"Context")+".Consumer";case $It:return(t._context.displayName||"Context")+".Provider";case jVe:var e=t.render;return t=t.displayName,t||(t=e.displayName||e.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case DVe:return e=t.displayName||null,e!==null?e:UHe(t.type)||"Memo";case CL:e=t._payload,t=t._init;try{return UHe(t(e))}catch{}}return null}function vyn(t){var e=t.type;switch(t.tag){case 24:return"Cache";case 9:return(e.displayName||"Context")+".Consumer";case 10:return(e._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=e.render,t=t.displayName||t.name||"",e.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return e;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return UHe(e);case 8:return e===NVe?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e}return null}function LL(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function kIt(t){var e=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(e==="checkbox"||e==="radio")}function wyn(t){var e=kIt(t)?"checked":"value",r=Object.getOwnPropertyDescriptor(t.constructor.prototype,e),n=""+t[e];if(!t.hasOwnProperty(e)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var o=r.get,i=r.set;return Object.defineProperty(t,e,{configurable:!0,get:function(){return o.call(this)},set:function(a){n=""+a,i.call(this,a)}}),Object.defineProperty(t,e,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(a){n=""+a},stopTracking:function(){t._valueTracker=null,delete t[e]}}}}function tge(t){t._valueTracker||(t._valueTracker=wyn(t))}function qIt(t){if(!t)return!1;var e=t._valueTracker;if(!e)return!0;var r=e.getValue(),n="";return t&&(n=kIt(t)?t.checked?"true":"false":t.value),t=n,t!==r?(e.setValue(t),!0):!1}function Mge(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function zHe(t,e){var r=e.checked;return rc({},e,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:r??t._wrapperState.initialChecked})}function AAt(t,e){var r=e.defaultValue==null?"":e.defaultValue,n=e.checked!=null?e.checked:e.defaultChecked;r=LL(e.value!=null?e.value:r),t._wrapperState={initialChecked:n,initialValue:r,controlled:e.type==="checkbox"||e.type==="radio"?e.checked!=null:e.value!=null}}function BIt(t,e){e=e.checked,e!=null&&IVe(t,"checked",e,!1)}function HHe(t,e){BIt(t,e);var r=LL(e.value),n=e.type;if(r!=null)n==="number"?(r===0&&t.value===""||t.value!=r)&&(t.value=""+r):t.value!==""+r&&(t.value=""+r);else if(n==="submit"||n==="reset"){t.removeAttribute("value");return}e.hasOwnProperty("value")?VHe(t,e.type,r):e.hasOwnProperty("defaultValue")&&VHe(t,e.type,LL(e.defaultValue)),e.checked==null&&e.defaultChecked!=null&&(t.defaultChecked=!!e.defaultChecked)}function IAt(t,e,r){if(e.hasOwnProperty("value")||e.hasOwnProperty("defaultValue")){var n=e.type;if(!(n!=="submit"&&n!=="reset"||e.value!==void 0&&e.value!==null))return;e=""+t._wrapperState.initialValue,r||e===t.value||(t.value=e),t.defaultValue=e}r=t.name,r!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,r!==""&&(t.name=r)}function VHe(t,e,r){(e!=="number"||Mge(t.ownerDocument)!==t)&&(r==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+r&&(t.defaultValue=""+r))}var Eee=Array.isArray;function m5(t,e,r,n){if(t=t.options,e){e={};for(var o=0;o"+e.valueOf().toString()+"",e=rge.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;e.firstChild;)t.appendChild(e.firstChild)}});function qee(t,e){if(e){var r=t.firstChild;if(r&&r===t.lastChild&&r.nodeType===3){r.nodeValue=e;return}}t.textContent=e}var Ree={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Syn=["Webkit","ms","Moz","O"];Object.keys(Ree).forEach(function(t){Syn.forEach(function(e){e=e+t.charAt(0).toUpperCase()+t.substring(1),Ree[e]=Ree[t]})});function VIt(t,e,r){return e==null||typeof e=="boolean"||e===""?"":r||typeof e!="number"||e===0||Ree.hasOwnProperty(t)&&Ree[t]?(""+e).trim():e+"px"}function JIt(t,e){t=t.style;for(var r in e)if(e.hasOwnProperty(r)){var n=r.indexOf("--")===0,o=VIt(r,e[r],n);r==="float"&&(r="cssFloat"),n?t.setProperty(r,o):t[r]=o}}var Cyn=rc({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function WHe(t,e){if(e){if(Cyn[t]&&(e.children!=null||e.dangerouslySetInnerHTML!=null))throw Error(et(137,t));if(e.dangerouslySetInnerHTML!=null){if(e.children!=null)throw Error(et(60));if(typeof e.dangerouslySetInnerHTML!="object"||!("__html"in e.dangerouslySetInnerHTML))throw Error(et(61))}if(e.style!=null&&typeof e.style!="object")throw Error(et(62))}}function GHe(t,e){if(t.indexOf("-")===-1)return typeof e.is=="string";switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var ZHe=null;function $Ve(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var XHe=null,h5=null,g5=null;function DAt(t){if(t=ote(t)){if(typeof XHe!="function")throw Error(et(280));var e=t.stateNode;e&&(e=nye(e),XHe(t.stateNode,t.type,e))}}function KIt(t){h5?g5?g5.push(t):g5=[t]:h5=t}function WIt(){if(h5){var t=h5,e=g5;if(g5=h5=null,DAt(t),e)for(t=0;t>>=0,t===0?32:31-(jyn(t)/Dyn|0)|0}var nge=64,oge=4194304;function Pee(t){switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function Nge(t,e){var r=t.pendingLanes;if(r===0)return 0;var n=0,o=t.suspendedLanes,i=t.pingedLanes,a=r&268435455;if(a!==0){var s=a&~o;s!==0?n=Pee(s):(i&=a,i!==0&&(n=Pee(i)))}else a=r&~o,a!==0?n=Pee(a):i!==0&&(n=Pee(i));if(n===0)return 0;if(e!==0&&e!==n&&(e&o)===0&&(o=n&-n,i=e&-e,o>=i||o===16&&(i&4194240)!==0))return e;if((n&4)!==0&&(n|=r&16),e=t.entangledLanes,e!==0)for(t=t.entanglements,e&=n;0r;r++)e.push(t);return e}function rte(t,e,r){t.pendingLanes|=e,e!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,e=31-oC(e),t[e]=r}function kyn(t,e){var r=t.pendingLanes&~e;t.pendingLanes=e,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=e,t.mutableReadLanes&=e,t.entangledLanes&=e,e=t.entanglements;var n=t.eventTimes;for(t=t.expirationTimes;0=Iee),HAt=" ",VAt=!1;function mNt(t,e){switch(t){case"keyup":return pbn.indexOf(e.keyCode)!==-1;case"keydown":return e.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function hNt(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var o5=!1;function hbn(t,e){switch(t){case"compositionend":return hNt(e);case"keypress":return e.which!==32?null:(VAt=!0,HAt);case"textInput":return t=e.data,t===HAt&&VAt?null:t;default:return null}}function gbn(t,e){if(o5)return t==="compositionend"||!HVe&&mNt(t,e)?(t=fNt(),vge=BVe=EL=null,o5=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(e.ctrlKey||e.altKey||e.metaKey)||e.ctrlKey&&e.altKey){if(e.char&&1=e)return{node:r,offset:e-t};t=n}e:{for(;r;){if(r.nextSibling){r=r.nextSibling;break e}r=r.parentNode}r=void 0}r=WAt(r)}}function _Nt(t,e){return t&&e?t===e?!0:t&&t.nodeType===3?!1:e&&e.nodeType===3?_Nt(t,e.parentNode):"contains"in t?t.contains(e):t.compareDocumentPosition?!!(t.compareDocumentPosition(e)&16):!1:!1}function vNt(){for(var t=window,e=Mge();e instanceof t.HTMLIFrameElement;){try{var r=typeof e.contentWindow.location.href=="string"}catch{r=!1}if(r)t=e.contentWindow;else break;e=Mge(t.document)}return e}function VVe(t){var e=t&&t.nodeName&&t.nodeName.toLowerCase();return e&&(e==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||e==="textarea"||t.contentEditable==="true")}function Obn(t){var e=vNt(),r=t.focusedElem,n=t.selectionRange;if(e!==r&&r&&r.ownerDocument&&_Nt(r.ownerDocument.documentElement,r)){if(n!==null&&VVe(r)){if(e=n.start,t=n.end,t===void 0&&(t=e),"selectionStart"in r)r.selectionStart=e,r.selectionEnd=Math.min(t,r.value.length);else if(t=(e=r.ownerDocument||document)&&e.defaultView||window,t.getSelection){t=t.getSelection();var o=r.textContent.length,i=Math.min(n.start,o);n=n.end===void 0?i:Math.min(n.end,o),!t.extend&&i>n&&(o=n,n=i,i=o),o=GAt(r,i);var a=GAt(r,n);o&&a&&(t.rangeCount!==1||t.anchorNode!==o.node||t.anchorOffset!==o.offset||t.focusNode!==a.node||t.focusOffset!==a.offset)&&(e=e.createRange(),e.setStart(o.node,o.offset),t.removeAllRanges(),i>n?(t.addRange(e),t.extend(a.node,a.offset)):(e.setEnd(a.node,a.offset),t.addRange(e)))}}for(e=[],t=r;t=t.parentNode;)t.nodeType===1&&e.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof r.focus=="function"&&r.focus(),r=0;r=document.documentMode,i5=null,nVe=null,jee=null,oVe=!1;function ZAt(t,e,r){var n=r.window===r?r.document:r.nodeType===9?r:r.ownerDocument;oVe||i5==null||i5!==Mge(n)||(n=i5,"selectionStart"in n&&VVe(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),jee&&Jee(jee,n)||(jee=n,n=$ge(nVe,"onSelect"),0u5||(t.current=cVe[u5],cVe[u5]=null,u5--)}function Du(t,e){u5++,cVe[u5]=t.current,t.current=e}var FL={},cy=qL(FL),f_=qL(!1),o4=FL;function w5(t,e){var r=t.type.contextTypes;if(!r)return FL;var n=t.stateNode;if(n&&n.__reactInternalMemoizedUnmaskedChildContext===e)return n.__reactInternalMemoizedMaskedChildContext;var o={},i;for(i in r)o[i]=e[i];return n&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=e,t.__reactInternalMemoizedMaskedChildContext=o),o}function p_(t){return t=t.childContextTypes,t!=null}function Fge(){nl(f_),nl(cy)}function iIt(t,e,r){if(cy.current!==FL)throw Error(et(168));Du(cy,e),Du(f_,r)}function MNt(t,e,r){var n=t.stateNode;if(e=e.childContextTypes,typeof n.getChildContext!="function")return r;n=n.getChildContext();for(var o in n)if(!(o in e))throw Error(et(108,vyn(t)||"Unknown",o));return rc({},r,n)}function kge(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||FL,o4=cy.current,Du(cy,t),Du(f_,f_.current),!0}function aIt(t,e,r){var n=t.stateNode;if(!n)throw Error(et(169));r?(t=MNt(t,e,o4),n.__reactInternalMemoizedMergedChildContext=t,nl(f_),nl(cy),Du(cy,t)):nl(f_),Du(f_,r)}var IN=null,oye=!1,MHe=!1;function RNt(t){IN===null?IN=[t]:IN.push(t)}function Dbn(t){oye=!0,RNt(t)}function BL(){if(!MHe&&IN!==null){MHe=!0;var t=0,e=Xs;try{var r=IN;for(Xs=1;t>=a,o-=a,NN=1<<32-oC(e)+o|r<T?(R=E,E=null):R=E.sibling;var I=f(y,E,_[T],w);if(I===null){E===null&&(E=R);break}t&&E&&I.alternate===null&&e(y,E),b=i(I,b,T),O===null?x=I:O.sibling=I,O=I,E=R}if(T===_.length)return r(y,E),xl&&Xz(y,T),x;if(E===null){for(;T<_.length;T++)E=d(y,_[T],w),E!==null&&(b=i(E,b,T),O===null?x=E:O.sibling=E,O=E);return xl&&Xz(y,T),x}for(E=n(y,E);T<_.length;T++)R=p(E,y,T,_[T],w),R!==null&&(t&&R.alternate!==null&&E.delete(R.key===null?T:R.key),b=i(R,b,T),O===null?x=R:O.sibling=R,O=R);return t&&E.forEach(function(j){return e(y,j)}),xl&&Xz(y,T),x}function h(y,b,_,w){var x=bee(_);if(typeof x!="function")throw Error(et(150));if(_=x.call(_),_==null)throw Error(et(151));for(var O=x=null,E=b,T=b=0,R=null,I=_.next();E!==null&&!I.done;T++,I=_.next()){E.index>T?(R=E,E=null):R=E.sibling;var j=f(y,E,I.value,w);if(j===null){E===null&&(E=R);break}t&&E&&j.alternate===null&&e(y,E),b=i(j,b,T),O===null?x=j:O.sibling=j,O=j,E=R}if(I.done)return r(y,E),xl&&Xz(y,T),x;if(E===null){for(;!I.done;T++,I=_.next())I=d(y,I.value,w),I!==null&&(b=i(I,b,T),O===null?x=I:O.sibling=I,O=I);return xl&&Xz(y,T),x}for(E=n(y,E);!I.done;T++,I=_.next())I=p(E,y,T,I.value,w),I!==null&&(t&&I.alternate!==null&&E.delete(I.key===null?T:I.key),b=i(I,b,T),O===null?x=I:O.sibling=I,O=I);return t&&E.forEach(function(F){return e(y,F)}),xl&&Xz(y,T),x}function g(y,b,_,w){if(typeof _=="object"&&_!==null&&_.type===n5&&_.key===null&&(_=_.props.children),typeof _=="object"&&_!==null){switch(_.$$typeof){case ege:e:{for(var x=_.key,O=b;O!==null;){if(O.key===x){if(x=_.type,x===n5){if(O.tag===7){r(y,O.sibling),b=o(O,_.props.children),b.return=y,y=b;break e}}else if(O.elementType===x||typeof x=="object"&&x!==null&&x.$$typeof===CL&&pIt(x)===O.type){r(y,O.sibling),b=o(O,_.props),b.ref=See(y,O,_),b.return=y,y=b;break e}r(y,O);break}else e(y,O);O=O.sibling}_.type===n5?(b=n4(_.props.children,y.mode,w,_.key),b.return=y,y=b):(w=Pge(_.type,_.key,_.props,null,y.mode,w),w.ref=See(y,b,_),w.return=y,y=w)}return a(y);case r5:e:{for(O=_.key;b!==null;){if(b.key===O)if(b.tag===4&&b.stateNode.containerInfo===_.containerInfo&&b.stateNode.implementation===_.implementation){r(y,b.sibling),b=o(b,_.children||[]),b.return=y,y=b;break e}else{r(y,b);break}else e(y,b);b=b.sibling}b=LHe(_,y.mode,w),b.return=y,y=b}return a(y);case CL:return O=_._init,g(y,b,O(_._payload),w)}if(Eee(_))return m(y,b,_,w);if(bee(_))return h(y,b,_,w);hge(y,_)}return typeof _=="string"&&_!==""||typeof _=="number"?(_=""+_,b!==null&&b.tag===6?(r(y,b.sibling),b=o(b,_),b.return=y,y=b):(r(y,b),b=$He(_,y.mode,w),b.return=y,y=b),a(y)):r(y,b)}return g}var C5=FNt(!0),kNt=FNt(!1),ite={},$O=qL(ite),Zee=qL(ite),Xee=qL(ite);function t4(t){if(t===ite)throw Error(et(174));return t}function eJe(t,e){switch(Du(Xee,e),Du(Zee,t),Du($O,ite),t=e.nodeType,t){case 9:case 11:e=(e=e.documentElement)?e.namespaceURI:KHe(null,"");break;default:t=t===8?e.parentNode:e,e=t.namespaceURI||null,t=t.tagName,e=KHe(e,t)}nl($O),Du($O,e)}function x5(){nl($O),nl(Zee),nl(Xee)}function qNt(t){t4(Xee.current);var e=t4($O.current),r=KHe(e,t.type);e!==r&&(Du(Zee,t),Du($O,r))}function tJe(t){Zee.current===t&&(nl($O),nl(Zee))}var ec=qL(0);function Vge(t){for(var e=t;e!==null;){if(e.tag===13){var r=e.memoizedState;if(r!==null&&(r=r.dehydrated,r===null||r.data==="$?"||r.data==="$!"))return e}else if(e.tag===19&&e.memoizedProps.revealOrder!==void 0){if((e.flags&128)!==0)return e}else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break;for(;e.sibling===null;){if(e.return===null||e.return===t)return null;e=e.return}e.sibling.return=e.return,e=e.sibling}return null}var RHe=[];function rJe(){for(var t=0;tr?r:4,t(!0);var n=AHe.transition;AHe.transition={};try{t(!1),e()}finally{Xs=r,AHe.transition=n}}function r1t(){return lS().memoizedState}function kbn(t,e,r){var n=DL(t);if(r={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null},n1t(t))o1t(e,r);else if(r=jNt(t,e,r,n),r!==null){var o=ub();iC(r,t,n,o),i1t(r,e,n)}}function qbn(t,e,r){var n=DL(t),o={lane:n,action:r,hasEagerState:!1,eagerState:null,next:null};if(n1t(t))o1t(e,o);else{var i=t.alternate;if(t.lanes===0&&(i===null||i.lanes===0)&&(i=e.lastRenderedReducer,i!==null))try{var a=e.lastRenderedState,s=i(a,r);if(o.hasEagerState=!0,o.eagerState=s,aC(s,a)){var u=e.interleaved;u===null?(o.next=o,YVe(e)):(o.next=u.next,u.next=o),e.interleaved=o;return}}catch{}finally{}r=jNt(t,e,o,n),r!==null&&(o=ub(),iC(r,t,n,o),i1t(r,e,n))}}function n1t(t){var e=t.alternate;return t===tc||e!==null&&e===tc}function o1t(t,e){Dee=Jge=!0;var r=t.pending;r===null?e.next=e:(e.next=r.next,r.next=e),t.pending=e}function i1t(t,e,r){if((r&4194240)!==0){var n=e.lanes;n&=t.pendingLanes,r|=n,e.lanes=r,FVe(t,r)}}var Kge={readContext:uS,useCallback:sy,useContext:sy,useEffect:sy,useImperativeHandle:sy,useInsertionEffect:sy,useLayoutEffect:sy,useMemo:sy,useReducer:sy,useRef:sy,useState:sy,useDebugValue:sy,useDeferredValue:sy,useTransition:sy,useMutableSource:sy,useSyncExternalStore:sy,useId:sy,unstable_isNewReconciler:!1},Bbn={readContext:uS,useCallback:function(t,e){return NO().memoizedState=[t,e===void 0?null:e],t},useContext:uS,useEffect:hIt,useImperativeHandle:function(t,e,r){return r=r!=null?r.concat([t]):null,xge(4194308,4,XNt.bind(null,e,t),r)},useLayoutEffect:function(t,e){return xge(4194308,4,t,e)},useInsertionEffect:function(t,e){return xge(4,2,t,e)},useMemo:function(t,e){var r=NO();return e=e===void 0?null:e,t=t(),r.memoizedState=[t,e],t},useReducer:function(t,e,r){var n=NO();return e=r!==void 0?r(e):e,n.memoizedState=n.baseState=e,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:e},n.queue=t,t=t.dispatch=kbn.bind(null,tc,t),[n.memoizedState,t]},useRef:function(t){var e=NO();return t={current:t},e.memoizedState=t},useState:mIt,useDebugValue:sJe,useDeferredValue:function(t){return NO().memoizedState=t},useTransition:function(){var t=mIt(!1),e=t[0];return t=Fbn.bind(null,t[1]),NO().memoizedState=t,[e,t]},useMutableSource:function(){},useSyncExternalStore:function(t,e,r){var n=tc,o=NO();if(xl){if(r===void 0)throw Error(et(407));r=r()}else{if(r=e(),uh===null)throw Error(et(349));(a4&30)!==0||zNt(n,e,r)}o.memoizedState=r;var i={value:r,getSnapshot:e};return o.queue=i,hIt(VNt.bind(null,n,i,t),[t]),n.flags|=2048,ete(9,HNt.bind(null,n,i,r,e),void 0,null),r},useId:function(){var t=NO(),e=uh.identifierPrefix;if(xl){var r=jN,n=NN;r=(n&~(1<<32-oC(n)-1)).toString(32)+r,e=":"+e+"R"+r,r=Yee++,0<\/script>",t=t.removeChild(t.firstChild)):typeof n.is=="string"?t=a.createElement(r,{is:n.is}):(t=a.createElement(r),r==="select"&&(a=t,n.multiple?a.multiple=!0:n.size&&(a.size=n.size))):t=a.createElementNS(t,r),t[jO]=e,t[Gee]=n,m1t(t,e,!1,!1),e.stateNode=t;e:{switch(a=GHe(r,n),r){case"dialog":rl("cancel",t),rl("close",t),o=n;break;case"iframe":case"object":case"embed":rl("load",t),o=n;break;case"video":case"audio":for(o=0;oT5&&(e.flags|=128,n=!0,Cee(i,!1),e.lanes=4194304)}else{if(!n)if(t=Vge(a),t!==null){if(e.flags|=128,n=!0,r=t.updateQueue,r!==null&&(e.updateQueue=r,e.flags|=4),Cee(i,!0),i.tail===null&&i.tailMode==="hidden"&&!a.alternate&&!xl)return uy(e),null}else 2*Vc()-i.renderingStartTime>T5&&r!==1073741824&&(e.flags|=128,n=!0,Cee(i,!1),e.lanes=4194304);i.isBackwards?(a.sibling=e.child,e.child=a):(r=i.last,r!==null?r.sibling=a:e.child=a,i.last=a)}return i.tail!==null?(e=i.tail,i.rendering=e,i.tail=e.sibling,i.renderingStartTime=Vc(),e.sibling=null,r=ec.current,Du(ec,n?r&1|2:r&1),e):(uy(e),null);case 22:case 23:return pJe(),n=e.memoizedState!==null,t!==null&&t.memoizedState!==null!==n&&(e.flags|=8192),n&&(e.mode&1)!==0?(Mv&1073741824)!==0&&(uy(e),e.subtreeFlags&6&&(e.flags|=8192)):uy(e),null;case 24:return null;case 25:return null}throw Error(et(156,e.tag))}function Gbn(t,e){switch(KVe(e),e.tag){case 1:return p_(e.type)&&Fge(),t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 3:return x5(),nl(f_),nl(cy),rJe(),t=e.flags,(t&65536)!==0&&(t&128)===0?(e.flags=t&-65537|128,e):null;case 5:return tJe(e),null;case 13:if(nl(ec),t=e.memoizedState,t!==null&&t.dehydrated!==null){if(e.alternate===null)throw Error(et(340));S5()}return t=e.flags,t&65536?(e.flags=t&-65537|128,e):null;case 19:return nl(ec),null;case 4:return x5(),null;case 10:return XVe(e.type._context),null;case 22:case 23:return pJe(),null;case 24:return null;default:return null}}var yge=!1,ly=!1,Zbn=typeof WeakSet=="function"?WeakSet:Set,hr=null;function f5(t,e){var r=t.ref;if(r!==null)if(typeof r=="function")try{r(null)}catch(n){xc(t,e,n)}else r.current=null}function SVe(t,e,r){try{r()}catch(n){xc(t,e,n)}}var xIt=!1;function Xbn(t,e){if(iVe=jge,t=vNt(),VVe(t)){if("selectionStart"in t)var r={start:t.selectionStart,end:t.selectionEnd};else e:{r=(r=t.ownerDocument)&&r.defaultView||window;var n=r.getSelection&&r.getSelection();if(n&&n.rangeCount!==0){r=n.anchorNode;var o=n.anchorOffset,i=n.focusNode;n=n.focusOffset;try{r.nodeType,i.nodeType}catch{r=null;break e}var a=0,s=-1,u=-1,l=0,c=0,d=t,f=null;t:for(;;){for(var p;d!==r||o!==0&&d.nodeType!==3||(s=a+o),d!==i||n!==0&&d.nodeType!==3||(u=a+n),d.nodeType===3&&(a+=d.nodeValue.length),(p=d.firstChild)!==null;)f=d,d=p;for(;;){if(d===t)break t;if(f===r&&++l===o&&(s=a),f===i&&++c===n&&(u=a),(p=d.nextSibling)!==null)break;d=f,f=d.parentNode}d=p}r=s===-1||u===-1?null:{start:s,end:u}}else r=null}r=r||{start:0,end:0}}else r=null;for(aVe={focusedElem:t,selectionRange:r},jge=!1,hr=e;hr!==null;)if(e=hr,t=e.child,(e.subtreeFlags&1028)!==0&&t!==null)t.return=e,hr=t;else for(;hr!==null;){e=hr;try{var m=e.alternate;if((e.flags&1024)!==0)switch(e.tag){case 0:case 11:case 15:break;case 1:if(m!==null){var h=m.memoizedProps,g=m.memoizedState,y=e.stateNode,b=y.getSnapshotBeforeUpdate(e.elementType===e.type?h:tC(e.type,h),g);y.__reactInternalSnapshotBeforeUpdate=b}break;case 3:var _=e.stateNode.containerInfo;_.nodeType===1?_.textContent="":_.nodeType===9&&_.documentElement&&_.removeChild(_.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(et(163))}}catch(w){xc(e,e.return,w)}if(t=e.sibling,t!==null){t.return=e.return,hr=t;break}hr=e.return}return m=xIt,xIt=!1,m}function $ee(t,e,r){var n=e.updateQueue;if(n=n!==null?n.lastEffect:null,n!==null){var o=n=n.next;do{if((o.tag&t)===t){var i=o.destroy;o.destroy=void 0,i!==void 0&&SVe(e,r,i)}o=o.next}while(o!==n)}}function sye(t,e){if(e=e.updateQueue,e=e!==null?e.lastEffect:null,e!==null){var r=e=e.next;do{if((r.tag&t)===t){var n=r.create;r.destroy=n()}r=r.next}while(r!==e)}}function CVe(t){var e=t.ref;if(e!==null){var r=t.stateNode;switch(t.tag){case 5:t=r;break;default:t=r}typeof e=="function"?e(t):e.current=t}}function y1t(t){var e=t.alternate;e!==null&&(t.alternate=null,y1t(e)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(e=t.stateNode,e!==null&&(delete e[jO],delete e[Gee],delete e[lVe],delete e[Nbn],delete e[jbn])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function b1t(t){return t.tag===5||t.tag===3||t.tag===4}function OIt(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||b1t(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function xVe(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.nodeType===8?r.parentNode.insertBefore(t,e):r.insertBefore(t,e):(r.nodeType===8?(e=r.parentNode,e.insertBefore(t,r)):(e=r,e.appendChild(t)),r=r._reactRootContainer,r!=null||e.onclick!==null||(e.onclick=Lge));else if(n!==4&&(t=t.child,t!==null))for(xVe(t,e,r),t=t.sibling;t!==null;)xVe(t,e,r),t=t.sibling}function OVe(t,e,r){var n=t.tag;if(n===5||n===6)t=t.stateNode,e?r.insertBefore(t,e):r.appendChild(t);else if(n!==4&&(t=t.child,t!==null))for(OVe(t,e,r),t=t.sibling;t!==null;)OVe(t,e,r),t=t.sibling}var tg=null,rC=!1;function SL(t,e,r){for(r=r.child;r!==null;)_1t(t,e,r),r=r.sibling}function _1t(t,e,r){if(DO&&typeof DO.onCommitFiberUnmount=="function")try{DO.onCommitFiberUnmount(Qge,r)}catch{}switch(r.tag){case 5:ly||f5(r,e);case 6:var n=tg,o=rC;tg=null,SL(t,e,r),tg=n,rC=o,tg!==null&&(rC?(t=tg,r=r.stateNode,t.nodeType===8?t.parentNode.removeChild(r):t.removeChild(r)):tg.removeChild(r.stateNode));break;case 18:tg!==null&&(rC?(t=tg,r=r.stateNode,t.nodeType===8?PHe(t.parentNode,r):t.nodeType===1&&PHe(t,r),Hee(t)):PHe(tg,r.stateNode));break;case 4:n=tg,o=rC,tg=r.stateNode.containerInfo,rC=!0,SL(t,e,r),tg=n,rC=o;break;case 0:case 11:case 14:case 15:if(!ly&&(n=r.updateQueue,n!==null&&(n=n.lastEffect,n!==null))){o=n=n.next;do{var i=o,a=i.destroy;i=i.tag,a!==void 0&&((i&2)!==0||(i&4)!==0)&&SVe(r,e,a),o=o.next}while(o!==n)}SL(t,e,r);break;case 1:if(!ly&&(f5(r,e),n=r.stateNode,typeof n.componentWillUnmount=="function"))try{n.props=r.memoizedProps,n.state=r.memoizedState,n.componentWillUnmount()}catch(s){xc(r,e,s)}SL(t,e,r);break;case 21:SL(t,e,r);break;case 22:r.mode&1?(ly=(n=ly)||r.memoizedState!==null,SL(t,e,r),ly=n):SL(t,e,r);break;default:SL(t,e,r)}}function TIt(t){var e=t.updateQueue;if(e!==null){t.updateQueue=null;var r=t.stateNode;r===null&&(r=t.stateNode=new Zbn),e.forEach(function(n){var o=a_n.bind(null,t,n);r.has(n)||(r.add(n),n.then(o,o))})}}function eC(t,e){var r=e.deletions;if(r!==null)for(var n=0;no&&(o=a),n&=~i}if(n=o,n=Vc()-n,n=(120>n?120:480>n?480:1080>n?1080:1920>n?1920:3e3>n?3e3:4320>n?4320:1960*Qbn(n/1960))-n,10t?16:t,PL===null)var n=!1;else{if(t=PL,PL=null,Zge=0,(Za&6)!==0)throw Error(et(331));var o=Za;for(Za|=4,hr=t.current;hr!==null;){var i=hr,a=i.child;if((hr.flags&16)!==0){var s=i.deletions;if(s!==null){for(var u=0;uVc()-dJe?r4(t,0):cJe|=r),m_(t,e)}function E1t(t,e){e===0&&((t.mode&1)===0?e=1:(e=oge,oge<<=1,(oge&130023424)===0&&(oge=4194304)));var r=ub();t=FN(t,e),t!==null&&(rte(t,e,r),m_(t,r))}function i_n(t){var e=t.memoizedState,r=0;e!==null&&(r=e.retryLane),E1t(t,r)}function a_n(t,e){var r=0;switch(t.tag){case 13:var n=t.stateNode,o=t.memoizedState;o!==null&&(r=o.retryLane);break;case 19:n=t.stateNode;break;default:throw Error(et(314))}n!==null&&n.delete(e),E1t(t,r)}var P1t;P1t=function(t,e,r){if(t!==null)if(t.memoizedProps!==e.pendingProps||f_.current)d_=!0;else{if((t.lanes&r)===0&&(e.flags&128)===0)return d_=!1,Kbn(t,e,r);d_=(t.flags&131072)!==0}else d_=!1,xl&&(e.flags&1048576)!==0&&ANt(e,Bge,e.index);switch(e.lanes=0,e.tag){case 2:var n=e.type;Oge(t,e),t=e.pendingProps;var o=w5(e,cy.current);b5(e,r),o=oJe(null,e,n,t,o,r);var i=iJe();return e.flags|=1,typeof o=="object"&&o!==null&&typeof o.render=="function"&&o.$$typeof===void 0?(e.tag=1,e.memoizedState=null,e.updateQueue=null,p_(n)?(i=!0,kge(e)):i=!1,e.memoizedState=o.state!==null&&o.state!==void 0?o.state:null,QVe(e),o.updater=iye,e.stateNode=o,o._reactInternals=e,hVe(e,n,t,r),e=bVe(null,e,n,!0,i,r)):(e.tag=0,xl&&i&&JVe(e),sb(null,e,o,r),e=e.child),e;case 16:n=e.elementType;e:{switch(Oge(t,e),t=e.pendingProps,o=n._init,n=o(n._payload),e.type=n,o=e.tag=u_n(n),t=tC(n,t),o){case 0:e=yVe(null,e,n,t,r);break e;case 1:e=wIt(null,e,n,t,r);break e;case 11:e=_It(null,e,n,t,r);break e;case 14:e=vIt(null,e,n,tC(n.type,t),r);break e}throw Error(et(306,n,""))}return e;case 0:return n=e.type,o=e.pendingProps,o=e.elementType===n?o:tC(n,o),yVe(t,e,n,o,r);case 1:return n=e.type,o=e.pendingProps,o=e.elementType===n?o:tC(n,o),wIt(t,e,n,o,r);case 3:e:{if(d1t(e),t===null)throw Error(et(387));n=e.pendingProps,i=e.memoizedState,o=i.element,DNt(t,e),Hge(e,n,null,r);var a=e.memoizedState;if(n=a.element,i.isDehydrated)if(i={element:n,isDehydrated:!1,cache:a.cache,pendingSuspenseBoundaries:a.pendingSuspenseBoundaries,transitions:a.transitions},e.updateQueue.baseState=i,e.memoizedState=i,e.flags&256){o=O5(Error(et(423)),e),e=SIt(t,e,n,r,o);break e}else if(n!==o){o=O5(Error(et(424)),e),e=SIt(t,e,n,r,o);break e}else for(Rv=IL(e.stateNode.containerInfo.firstChild),Av=e,xl=!0,nC=null,r=kNt(e,null,n,r),e.child=r;r;)r.flags=r.flags&-3|4096,r=r.sibling;else{if(S5(),n===o){e=kN(t,e,r);break e}sb(t,e,n,r)}e=e.child}return e;case 5:return qNt(e),t===null&&fVe(e),n=e.type,o=e.pendingProps,i=t!==null?t.memoizedProps:null,a=o.children,sVe(n,o)?a=null:i!==null&&sVe(n,i)&&(e.flags|=32),c1t(t,e),sb(t,e,a,r),e.child;case 6:return t===null&&fVe(e),null;case 13:return f1t(t,e,r);case 4:return eJe(e,e.stateNode.containerInfo),n=e.pendingProps,t===null?e.child=C5(e,null,n,r):sb(t,e,n,r),e.child;case 11:return n=e.type,o=e.pendingProps,o=e.elementType===n?o:tC(n,o),_It(t,e,n,o,r);case 7:return sb(t,e,e.pendingProps,r),e.child;case 8:return sb(t,e,e.pendingProps.children,r),e.child;case 12:return sb(t,e,e.pendingProps.children,r),e.child;case 10:e:{if(n=e.type._context,o=e.pendingProps,i=e.memoizedProps,a=o.value,Du(Uge,n._currentValue),n._currentValue=a,i!==null)if(aC(i.value,a)){if(i.children===o.children&&!f_.current){e=kN(t,e,r);break e}}else for(i=e.child,i!==null&&(i.return=e);i!==null;){var s=i.dependencies;if(s!==null){a=i.child;for(var u=s.firstContext;u!==null;){if(u.context===n){if(i.tag===1){u=DN(-1,r&-r),u.tag=2;var l=i.updateQueue;if(l!==null){l=l.shared;var c=l.pending;c===null?u.next=u:(u.next=c.next,c.next=u),l.pending=u}}i.lanes|=r,u=i.alternate,u!==null&&(u.lanes|=r),pVe(i.return,r,e),s.lanes|=r;break}u=u.next}}else if(i.tag===10)a=i.type===e.type?null:i.child;else if(i.tag===18){if(a=i.return,a===null)throw Error(et(341));a.lanes|=r,s=a.alternate,s!==null&&(s.lanes|=r),pVe(a,r,e),a=i.sibling}else a=i.child;if(a!==null)a.return=i;else for(a=i;a!==null;){if(a===e){a=null;break}if(i=a.sibling,i!==null){i.return=a.return,a=i;break}a=a.return}i=a}sb(t,e,o.children,r),e=e.child}return e;case 9:return o=e.type,n=e.pendingProps.children,b5(e,r),o=uS(o),n=n(o),e.flags|=1,sb(t,e,n,r),e.child;case 14:return n=e.type,o=tC(n,e.pendingProps),o=tC(n.type,o),vIt(t,e,n,o,r);case 15:return u1t(t,e,e.type,e.pendingProps,r);case 17:return n=e.type,o=e.pendingProps,o=e.elementType===n?o:tC(n,o),Oge(t,e),e.tag=1,p_(n)?(t=!0,kge(e)):t=!1,b5(e,r),LNt(e,n,o),hVe(e,n,o,r),bVe(null,e,n,!0,t,r);case 19:return p1t(t,e,r);case 22:return l1t(t,e,r)}throw Error(et(156,e.tag))};function M1t(t,e){return tNt(t,e)}function s_n(t,e,r,n){this.tag=t,this.key=r,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=e,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function aS(t,e,r,n){return new s_n(t,e,r,n)}function hJe(t){return t=t.prototype,!(!t||!t.isReactComponent)}function u_n(t){if(typeof t=="function")return hJe(t)?1:0;if(t!=null){if(t=t.$$typeof,t===jVe)return 11;if(t===DVe)return 14}return 2}function $L(t,e){var r=t.alternate;return r===null?(r=aS(t.tag,e,t.key,t.mode),r.elementType=t.elementType,r.type=t.type,r.stateNode=t.stateNode,r.alternate=t,t.alternate=r):(r.pendingProps=e,r.type=t.type,r.flags=0,r.subtreeFlags=0,r.deletions=null),r.flags=t.flags&14680064,r.childLanes=t.childLanes,r.lanes=t.lanes,r.child=t.child,r.memoizedProps=t.memoizedProps,r.memoizedState=t.memoizedState,r.updateQueue=t.updateQueue,e=t.dependencies,r.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext},r.sibling=t.sibling,r.index=t.index,r.ref=t.ref,r}function Pge(t,e,r,n,o,i){var a=2;if(n=t,typeof t=="function")hJe(t)&&(a=1);else if(typeof t=="string")a=5;else e:switch(t){case n5:return n4(r.children,o,i,e);case NVe:a=8,o|=8;break;case kHe:return t=aS(12,r,e,o|2),t.elementType=kHe,t.lanes=i,t;case qHe:return t=aS(13,r,e,o),t.elementType=qHe,t.lanes=i,t;case BHe:return t=aS(19,r,e,o),t.elementType=BHe,t.lanes=i,t;case FIt:return lye(r,o,i,e);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case $It:a=10;break e;case LIt:a=9;break e;case jVe:a=11;break e;case DVe:a=14;break e;case CL:a=16,n=null;break e}throw Error(et(130,t==null?t:typeof t,""))}return e=aS(a,r,e,o),e.elementType=t,e.type=n,e.lanes=i,e}function n4(t,e,r,n){return t=aS(7,t,n,e),t.lanes=r,t}function lye(t,e,r,n){return t=aS(22,t,n,e),t.elementType=FIt,t.lanes=r,t.stateNode={isHidden:!1},t}function $He(t,e,r){return t=aS(6,t,null,e),t.lanes=r,t}function LHe(t,e,r){return e=aS(4,t.children!==null?t.children:[],t.key,e),e.lanes=r,e.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},e}function l_n(t,e,r,n,o){this.tag=e,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=vHe(0),this.expirationTimes=vHe(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vHe(0),this.identifierPrefix=n,this.onRecoverableError=o,this.mutableSourceEagerHydrationData=null}function gJe(t,e,r,n,o,i,a,s,u){return t=new l_n(t,e,r,s,u),e===1?(e=1,i===!0&&(e|=8)):e=0,i=aS(3,null,null,e),t.current=i,i.stateNode=t,i.memoizedState={element:n,isDehydrated:r,cache:null,transitions:null,pendingSuspenseBoundaries:null},QVe(i),t}function c_n(t,e,r){var n=3{"use strict";function j1t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(j1t)}catch(t){console.error(t)}}j1t(),D1t.exports=N1t()});var Sm=S(vJe=>{"use strict";var $1t=$u();vJe.createRoot=$1t.createRoot,vJe.hydrateRoot=$1t.hydrateRoot;var KIi});function L1t(t,e){if(typeof t=="function")return t(e);t!=null&&(t.current=e)}function F1t(...t){return e=>{let r=!1,n=t.map(o=>{let i=L1t(o,e);return!r&&typeof i=="function"&&(r=!0),i});if(r)return()=>{for(let o=0;o{h_n=L(X(),1)});var B1t=S(mye=>{"use strict";var g_n=X(),y_n=Symbol.for("react.element"),b_n=Symbol.for("react.fragment"),__n=Object.prototype.hasOwnProperty,v_n=g_n.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,w_n={key:!0,ref:!0,__self:!0,__source:!0};function q1t(t,e,r){var n,o={},i=null,a=null;r!==void 0&&(i=""+r),e.key!==void 0&&(i=""+e.key),e.ref!==void 0&&(a=e.ref);for(n in e)__n.call(e,n)&&!w_n.hasOwnProperty(n)&&(o[n]=e[n]);if(t&&t.defaultProps)for(n in e=t.defaultProps,e)o[n]===void 0&&(o[n]=e[n]);return{$$typeof:y_n,type:t,key:i,ref:a,props:o,_owner:v_n.current}}mye.Fragment=b_n;mye.jsx=q1t;mye.jsxs=q1t});var ht=S((XIi,U1t)=>{"use strict";U1t.exports=B1t()});function Vi(t){let e=S_n(t),r=Cm.forwardRef((n,o)=>{let{children:i,...a}=n,s=Cm.Children.toArray(i),u=s.find(C_n);if(u){let l=u.props.children,c=s.map(d=>d===u?Cm.Children.count(l)>1?Cm.Children.only(null):Cm.isValidElement(l)?l.props.children:null:d);return(0,M5.jsx)(e,{...a,ref:o,children:Cm.isValidElement(l)?Cm.cloneElement(l,void 0,c):null})}return(0,M5.jsx)(e,{...a,ref:o,children:i})});return r.displayName=`${t}.Slot`,r}function S_n(t){let e=Cm.forwardRef((r,n)=>{let{children:o,...i}=r;if(Cm.isValidElement(o)){let a=O_n(o),s=x_n(i,o.props);return o.type!==Cm.Fragment&&(s.ref=n?F1t(n,a):a),Cm.cloneElement(o,s)}return Cm.Children.count(o)>1?Cm.Children.only(null):null});return e.displayName=`${t}.SlotClone`,e}function V1t(t){let e=({children:r})=>(0,M5.jsx)(M5.Fragment,{children:r});return e.displayName=`${t}.Slottable`,e.__radixId=H1t,e}function C_n(t){return Cm.isValidElement(t)&&typeof t.type=="function"&&"__radixId"in t.type&&t.type.__radixId===H1t}function x_n(t,e){let r={...e};for(let n in e){let o=t[n],i=e[n];/^on[A-Z]/.test(n)?o&&i?r[n]=(...s)=>{let u=i(...s);return o(...s),u}:o&&(r[n]=o):n==="style"?r[n]={...o,...i}:n==="className"&&(r[n]=[o,i].filter(Boolean).join(" "))}return{...t,...r}}function O_n(t){let e=Object.getOwnPropertyDescriptor(t.props,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning;return r?t.ref:(e=Object.getOwnPropertyDescriptor(t,"ref")?.get,r=e&&"isReactWarning"in e&&e.isReactWarning,r?t.props.ref:t.props.ref||t.ref)}var Cm,M5,z1t,H1t,lh=v(()=>{Cm=L(X(),1);k1t();M5=L(ht(),1);z1t=Vi("Slot");H1t=Symbol("radix.slottable")});function J1t(t){var e,r,n="";if(typeof t=="string"||typeof t=="number")n+=t;else if(typeof t=="object")if(Array.isArray(t)){var o=t.length;for(e=0;e{});var K1t,W1t,R5,gye=v(()=>{wJe();K1t=t=>typeof t=="boolean"?`${t}`:t===0?"0":t,W1t=hye,R5=(t,e)=>r=>{var n;if(e?.variants==null)return W1t(t,r?.class,r?.className);let{variants:o,defaultVariants:i}=e,a=Object.keys(o).map(l=>{let c=r?.[l],d=i?.[l];if(c===null)return null;let f=K1t(c)||K1t(d);return o[l][f]}),s=r&&Object.entries(r).reduce((l,c)=>{let[d,f]=c;return f===void 0||(l[d]=f),l},{}),u=e==null||(n=e.compoundVariants)===null||n===void 0?void 0:n.reduce((l,c)=>{let{class:d,className:f,...p}=c;return Object.entries(p).every(m=>{let[h,g]=m;return Array.isArray(g)?g.includes({...i,...s}[h]):{...i,...s}[h]===g})?[...l,d,f]:l},[]);return W1t(t,a,u,r?.class,r?.className)}});function L_n(){let t=0,e,r,n="";for(;td(c),t());return r=j_n(l),n=r.cache.get,o=r.cache.set,i=s,s(u)}function s(u){let l=n(u);if(l)return l;let c=$_n(u,r);return o(u,c),c}return function(){return i(L_n.apply(null,arguments))}}var xJe,T_n,Q1t,G1t,E_n,P_n,CJe,Z1t,M_n,R_n,A_n,ejt,I_n,N_n,j_n,D_n,$_n,tjt,ol,rjt,F_n,k_n,q_n,B_n,U_n,z_n,H_n,BN,UL,A5,SJe,ate,V_n,Ko,zL,J_n,K_n,W_n,G_n,Z_n,X_n,ste,I5,Y_n,njt,Q_n,evn,Y1t,tvn,ute,rvn,nvn,ojt,ijt=v(()=>{xJe="-",T_n=t=>{let e=P_n(t),{conflictingClassGroups:r,conflictingClassGroupModifiers:n}=t;return{getClassGroupId:a=>{let s=a.split(xJe);return s[0]===""&&s.length!==1&&s.shift(),Q1t(s,e)||E_n(a)},getConflictingClassGroupIds:(a,s)=>{let u=r[a]||[];return s&&n[a]?[...u,...n[a]]:u}}},Q1t=(t,e)=>{if(t.length===0)return e.classGroupId;let r=t[0],n=e.nextPart.get(r),o=n?Q1t(t.slice(1),n):void 0;if(o)return o;if(e.validators.length===0)return;let i=t.join(xJe);return e.validators.find(({validator:a})=>a(i))?.classGroupId},G1t=/^\[(.+)\]$/,E_n=t=>{if(G1t.test(t)){let e=G1t.exec(t)[1],r=e?.substring(0,e.indexOf(":"));if(r)return"arbitrary.."+r}},P_n=t=>{let{theme:e,prefix:r}=t,n={nextPart:new Map,validators:[]};return R_n(Object.entries(t.classGroups),r).forEach(([i,a])=>{CJe(a,n,i,e)}),n},CJe=(t,e,r,n)=>{t.forEach(o=>{if(typeof o=="string"){let i=o===""?e:Z1t(e,o);i.classGroupId=r;return}if(typeof o=="function"){if(M_n(o)){CJe(o(n),e,r,n);return}e.validators.push({validator:o,classGroupId:r});return}Object.entries(o).forEach(([i,a])=>{CJe(a,Z1t(e,i),r,n)})})},Z1t=(t,e)=>{let r=t;return e.split(xJe).forEach(n=>{r.nextPart.has(n)||r.nextPart.set(n,{nextPart:new Map,validators:[]}),r=r.nextPart.get(n)}),r},M_n=t=>t.isThemeGetter,R_n=(t,e)=>e?t.map(([r,n])=>{let o=n.map(i=>typeof i=="string"?e+i:typeof i=="object"?Object.fromEntries(Object.entries(i).map(([a,s])=>[e+a,s])):i);return[r,o]}):t,A_n=t=>{if(t<1)return{get:()=>{},set:()=>{}};let e=0,r=new Map,n=new Map,o=(i,a)=>{r.set(i,a),e++,e>t&&(e=0,n=r,r=new Map)};return{get(i){let a=r.get(i);if(a!==void 0)return a;if((a=n.get(i))!==void 0)return o(i,a),a},set(i,a){r.has(i)?r.set(i,a):o(i,a)}}},ejt="!",I_n=t=>{let{separator:e,experimentalParseClassName:r}=t,n=e.length===1,o=e[0],i=e.length,a=s=>{let u=[],l=0,c=0,d;for(let g=0;gc?d-c:void 0;return{modifiers:u,hasImportantModifier:p,baseClassName:m,maybePostfixModifierPosition:h}};return r?s=>r({className:s,parseClassName:a}):a},N_n=t=>{if(t.length<=1)return t;let e=[],r=[];return t.forEach(n=>{n[0]==="["?(e.push(...r.sort(),n),r=[]):r.push(n)}),e.push(...r.sort()),e},j_n=t=>({cache:A_n(t.cacheSize),parseClassName:I_n(t),...T_n(t)}),D_n=/\s+/,$_n=(t,e)=>{let{parseClassName:r,getClassGroupId:n,getConflictingClassGroupIds:o}=e,i=[],a=t.trim().split(D_n),s="";for(let u=a.length-1;u>=0;u-=1){let l=a[u],{modifiers:c,hasImportantModifier:d,baseClassName:f,maybePostfixModifierPosition:p}=r(l),m=!!p,h=n(m?f.substring(0,p):f);if(!h){if(!m){s=l+(s.length>0?" "+s:s);continue}if(h=n(f),!h){s=l+(s.length>0?" "+s:s);continue}m=!1}let g=N_n(c).join(":"),y=d?g+ejt:g,b=y+h;if(i.includes(b))continue;i.push(b);let _=o(h,m);for(let w=0;w<_.length;++w){let x=_[w];i.push(y+x)}s=l+(s.length>0?" "+s:s)}return s};tjt=t=>{if(typeof t=="string")return t;let e,r="";for(let n=0;n{let e=r=>r[t]||[];return e.isThemeGetter=!0,e},rjt=/^\[(?:([a-z-]+):)?(.+)\]$/i,F_n=/^\d+\/\d+$/,k_n=new Set(["px","full","screen"]),q_n=/^(\d+(\.\d+)?)?(xs|sm|md|lg|xl)$/,B_n=/\d+(%|px|r?em|[sdl]?v([hwib]|min|max)|pt|pc|in|cm|mm|cap|ch|ex|r?lh|cq(w|h|i|b|min|max))|\b(calc|min|max|clamp)\(.+\)|^0$/,U_n=/^(rgba?|hsla?|hwb|(ok)?(lab|lch))\(.+\)$/,z_n=/^(inset_)?-?((\d+)?\.?(\d+)[a-z]+|0)_-?((\d+)?\.?(\d+)[a-z]+|0)/,H_n=/^(url|image|image-set|cross-fade|element|(repeating-)?(linear|radial|conic)-gradient)\(.+\)$/,BN=t=>A5(t)||k_n.has(t)||F_n.test(t),UL=t=>I5(t,"length",Y_n),A5=t=>!!t&&!Number.isNaN(Number(t)),SJe=t=>I5(t,"number",A5),ate=t=>!!t&&Number.isInteger(Number(t)),V_n=t=>t.endsWith("%")&&A5(t.slice(0,-1)),Ko=t=>rjt.test(t),zL=t=>q_n.test(t),J_n=new Set(["length","size","percentage"]),K_n=t=>I5(t,J_n,njt),W_n=t=>I5(t,"position",njt),G_n=new Set(["image","url"]),Z_n=t=>I5(t,G_n,evn),X_n=t=>I5(t,"",Q_n),ste=()=>!0,I5=(t,e,r)=>{let n=rjt.exec(t);return n?n[1]?typeof e=="string"?n[1]===e:e.has(n[1]):r(n[2]):!1},Y_n=t=>B_n.test(t)&&!U_n.test(t),njt=()=>!1,Q_n=t=>z_n.test(t),evn=t=>H_n.test(t),Y1t=()=>{let t=ol("colors"),e=ol("spacing"),r=ol("blur"),n=ol("brightness"),o=ol("borderColor"),i=ol("borderRadius"),a=ol("borderSpacing"),s=ol("borderWidth"),u=ol("contrast"),l=ol("grayscale"),c=ol("hueRotate"),d=ol("invert"),f=ol("gap"),p=ol("gradientColorStops"),m=ol("gradientColorStopPositions"),h=ol("inset"),g=ol("margin"),y=ol("opacity"),b=ol("padding"),_=ol("saturate"),w=ol("scale"),x=ol("sepia"),O=ol("skew"),E=ol("space"),T=ol("translate"),R=()=>["auto","contain","none"],I=()=>["auto","hidden","clip","visible","scroll"],j=()=>["auto",Ko,e],F=()=>[Ko,e],B=()=>["",BN,UL],U=()=>["auto",A5,Ko],J=()=>["bottom","center","left","left-bottom","left-top","right","right-bottom","right-top","top"],G=()=>["solid","dashed","dotted","double","none"],oe=()=>["normal","multiply","screen","overlay","darken","lighten","color-dodge","color-burn","hard-light","soft-light","difference","exclusion","hue","saturation","color","luminosity"],ne=()=>["start","end","center","between","around","evenly","stretch"],z=()=>["","0",Ko],ee=()=>["auto","avoid","all","avoid-page","page","left","right","column"],ie=()=>[A5,Ko];return{cacheSize:500,separator:":",theme:{colors:[ste],spacing:[BN,UL],blur:["none","",zL,Ko],brightness:ie(),borderColor:[t],borderRadius:["none","","full",zL,Ko],borderSpacing:F(),borderWidth:B(),contrast:ie(),grayscale:z(),hueRotate:ie(),invert:z(),gap:F(),gradientColorStops:[t],gradientColorStopPositions:[V_n,UL],inset:j(),margin:j(),opacity:ie(),padding:F(),saturate:ie(),scale:ie(),sepia:z(),skew:ie(),space:F(),translate:F()},classGroups:{aspect:[{aspect:["auto","square","video",Ko]}],container:["container"],columns:[{columns:[zL]}],"break-after":[{"break-after":ee()}],"break-before":[{"break-before":ee()}],"break-inside":[{"break-inside":["auto","avoid","avoid-page","avoid-column"]}],"box-decoration":[{"box-decoration":["slice","clone"]}],box:[{box:["border","content"]}],display:["block","inline-block","inline","flex","inline-flex","table","inline-table","table-caption","table-cell","table-column","table-column-group","table-footer-group","table-header-group","table-row-group","table-row","flow-root","grid","inline-grid","contents","list-item","hidden"],float:[{float:["right","left","none","start","end"]}],clear:[{clear:["left","right","both","none","start","end"]}],isolation:["isolate","isolation-auto"],"object-fit":[{object:["contain","cover","fill","none","scale-down"]}],"object-position":[{object:[...J(),Ko]}],overflow:[{overflow:I()}],"overflow-x":[{"overflow-x":I()}],"overflow-y":[{"overflow-y":I()}],overscroll:[{overscroll:R()}],"overscroll-x":[{"overscroll-x":R()}],"overscroll-y":[{"overscroll-y":R()}],position:["static","fixed","absolute","relative","sticky"],inset:[{inset:[h]}],"inset-x":[{"inset-x":[h]}],"inset-y":[{"inset-y":[h]}],start:[{start:[h]}],end:[{end:[h]}],top:[{top:[h]}],right:[{right:[h]}],bottom:[{bottom:[h]}],left:[{left:[h]}],visibility:["visible","invisible","collapse"],z:[{z:["auto",ate,Ko]}],basis:[{basis:j()}],"flex-direction":[{flex:["row","row-reverse","col","col-reverse"]}],"flex-wrap":[{flex:["wrap","wrap-reverse","nowrap"]}],flex:[{flex:["1","auto","initial","none",Ko]}],grow:[{grow:z()}],shrink:[{shrink:z()}],order:[{order:["first","last","none",ate,Ko]}],"grid-cols":[{"grid-cols":[ste]}],"col-start-end":[{col:["auto",{span:["full",ate,Ko]},Ko]}],"col-start":[{"col-start":U()}],"col-end":[{"col-end":U()}],"grid-rows":[{"grid-rows":[ste]}],"row-start-end":[{row:["auto",{span:[ate,Ko]},Ko]}],"row-start":[{"row-start":U()}],"row-end":[{"row-end":U()}],"grid-flow":[{"grid-flow":["row","col","dense","row-dense","col-dense"]}],"auto-cols":[{"auto-cols":["auto","min","max","fr",Ko]}],"auto-rows":[{"auto-rows":["auto","min","max","fr",Ko]}],gap:[{gap:[f]}],"gap-x":[{"gap-x":[f]}],"gap-y":[{"gap-y":[f]}],"justify-content":[{justify:["normal",...ne()]}],"justify-items":[{"justify-items":["start","end","center","stretch"]}],"justify-self":[{"justify-self":["auto","start","end","center","stretch"]}],"align-content":[{content:["normal",...ne(),"baseline"]}],"align-items":[{items:["start","end","center","baseline","stretch"]}],"align-self":[{self:["auto","start","end","center","stretch","baseline"]}],"place-content":[{"place-content":[...ne(),"baseline"]}],"place-items":[{"place-items":["start","end","center","baseline","stretch"]}],"place-self":[{"place-self":["auto","start","end","center","stretch"]}],p:[{p:[b]}],px:[{px:[b]}],py:[{py:[b]}],ps:[{ps:[b]}],pe:[{pe:[b]}],pt:[{pt:[b]}],pr:[{pr:[b]}],pb:[{pb:[b]}],pl:[{pl:[b]}],m:[{m:[g]}],mx:[{mx:[g]}],my:[{my:[g]}],ms:[{ms:[g]}],me:[{me:[g]}],mt:[{mt:[g]}],mr:[{mr:[g]}],mb:[{mb:[g]}],ml:[{ml:[g]}],"space-x":[{"space-x":[E]}],"space-x-reverse":["space-x-reverse"],"space-y":[{"space-y":[E]}],"space-y-reverse":["space-y-reverse"],w:[{w:["auto","min","max","fit","svw","lvw","dvw",Ko,e]}],"min-w":[{"min-w":[Ko,e,"min","max","fit"]}],"max-w":[{"max-w":[Ko,e,"none","full","min","max","fit","prose",{screen:[zL]},zL]}],h:[{h:[Ko,e,"auto","min","max","fit","svh","lvh","dvh"]}],"min-h":[{"min-h":[Ko,e,"min","max","fit","svh","lvh","dvh"]}],"max-h":[{"max-h":[Ko,e,"min","max","fit","svh","lvh","dvh"]}],size:[{size:[Ko,e,"auto","min","max","fit"]}],"font-size":[{text:["base",zL,UL]}],"font-smoothing":["antialiased","subpixel-antialiased"],"font-style":["italic","not-italic"],"font-weight":[{font:["thin","extralight","light","normal","medium","semibold","bold","extrabold","black",SJe]}],"font-family":[{font:[ste]}],"fvn-normal":["normal-nums"],"fvn-ordinal":["ordinal"],"fvn-slashed-zero":["slashed-zero"],"fvn-figure":["lining-nums","oldstyle-nums"],"fvn-spacing":["proportional-nums","tabular-nums"],"fvn-fraction":["diagonal-fractions","stacked-fractions"],tracking:[{tracking:["tighter","tight","normal","wide","wider","widest",Ko]}],"line-clamp":[{"line-clamp":["none",A5,SJe]}],leading:[{leading:["none","tight","snug","normal","relaxed","loose",BN,Ko]}],"list-image":[{"list-image":["none",Ko]}],"list-style-type":[{list:["none","disc","decimal",Ko]}],"list-style-position":[{list:["inside","outside"]}],"placeholder-color":[{placeholder:[t]}],"placeholder-opacity":[{"placeholder-opacity":[y]}],"text-alignment":[{text:["left","center","right","justify","start","end"]}],"text-color":[{text:[t]}],"text-opacity":[{"text-opacity":[y]}],"text-decoration":["underline","overline","line-through","no-underline"],"text-decoration-style":[{decoration:[...G(),"wavy"]}],"text-decoration-thickness":[{decoration:["auto","from-font",BN,UL]}],"underline-offset":[{"underline-offset":["auto",BN,Ko]}],"text-decoration-color":[{decoration:[t]}],"text-transform":["uppercase","lowercase","capitalize","normal-case"],"text-overflow":["truncate","text-ellipsis","text-clip"],"text-wrap":[{text:["wrap","nowrap","balance","pretty"]}],indent:[{indent:F()}],"vertical-align":[{align:["baseline","top","middle","bottom","text-top","text-bottom","sub","super",Ko]}],whitespace:[{whitespace:["normal","nowrap","pre","pre-line","pre-wrap","break-spaces"]}],break:[{break:["normal","words","all","keep"]}],hyphens:[{hyphens:["none","manual","auto"]}],content:[{content:["none",Ko]}],"bg-attachment":[{bg:["fixed","local","scroll"]}],"bg-clip":[{"bg-clip":["border","padding","content","text"]}],"bg-opacity":[{"bg-opacity":[y]}],"bg-origin":[{"bg-origin":["border","padding","content"]}],"bg-position":[{bg:[...J(),W_n]}],"bg-repeat":[{bg:["no-repeat",{repeat:["","x","y","round","space"]}]}],"bg-size":[{bg:["auto","cover","contain",K_n]}],"bg-image":[{bg:["none",{"gradient-to":["t","tr","r","br","b","bl","l","tl"]},Z_n]}],"bg-color":[{bg:[t]}],"gradient-from-pos":[{from:[m]}],"gradient-via-pos":[{via:[m]}],"gradient-to-pos":[{to:[m]}],"gradient-from":[{from:[p]}],"gradient-via":[{via:[p]}],"gradient-to":[{to:[p]}],rounded:[{rounded:[i]}],"rounded-s":[{"rounded-s":[i]}],"rounded-e":[{"rounded-e":[i]}],"rounded-t":[{"rounded-t":[i]}],"rounded-r":[{"rounded-r":[i]}],"rounded-b":[{"rounded-b":[i]}],"rounded-l":[{"rounded-l":[i]}],"rounded-ss":[{"rounded-ss":[i]}],"rounded-se":[{"rounded-se":[i]}],"rounded-ee":[{"rounded-ee":[i]}],"rounded-es":[{"rounded-es":[i]}],"rounded-tl":[{"rounded-tl":[i]}],"rounded-tr":[{"rounded-tr":[i]}],"rounded-br":[{"rounded-br":[i]}],"rounded-bl":[{"rounded-bl":[i]}],"border-w":[{border:[s]}],"border-w-x":[{"border-x":[s]}],"border-w-y":[{"border-y":[s]}],"border-w-s":[{"border-s":[s]}],"border-w-e":[{"border-e":[s]}],"border-w-t":[{"border-t":[s]}],"border-w-r":[{"border-r":[s]}],"border-w-b":[{"border-b":[s]}],"border-w-l":[{"border-l":[s]}],"border-opacity":[{"border-opacity":[y]}],"border-style":[{border:[...G(),"hidden"]}],"divide-x":[{"divide-x":[s]}],"divide-x-reverse":["divide-x-reverse"],"divide-y":[{"divide-y":[s]}],"divide-y-reverse":["divide-y-reverse"],"divide-opacity":[{"divide-opacity":[y]}],"divide-style":[{divide:G()}],"border-color":[{border:[o]}],"border-color-x":[{"border-x":[o]}],"border-color-y":[{"border-y":[o]}],"border-color-s":[{"border-s":[o]}],"border-color-e":[{"border-e":[o]}],"border-color-t":[{"border-t":[o]}],"border-color-r":[{"border-r":[o]}],"border-color-b":[{"border-b":[o]}],"border-color-l":[{"border-l":[o]}],"divide-color":[{divide:[o]}],"outline-style":[{outline:["",...G()]}],"outline-offset":[{"outline-offset":[BN,Ko]}],"outline-w":[{outline:[BN,UL]}],"outline-color":[{outline:[t]}],"ring-w":[{ring:B()}],"ring-w-inset":["ring-inset"],"ring-color":[{ring:[t]}],"ring-opacity":[{"ring-opacity":[y]}],"ring-offset-w":[{"ring-offset":[BN,UL]}],"ring-offset-color":[{"ring-offset":[t]}],shadow:[{shadow:["","inner","none",zL,X_n]}],"shadow-color":[{shadow:[ste]}],opacity:[{opacity:[y]}],"mix-blend":[{"mix-blend":[...oe(),"plus-lighter","plus-darker"]}],"bg-blend":[{"bg-blend":oe()}],filter:[{filter:["","none"]}],blur:[{blur:[r]}],brightness:[{brightness:[n]}],contrast:[{contrast:[u]}],"drop-shadow":[{"drop-shadow":["","none",zL,Ko]}],grayscale:[{grayscale:[l]}],"hue-rotate":[{"hue-rotate":[c]}],invert:[{invert:[d]}],saturate:[{saturate:[_]}],sepia:[{sepia:[x]}],"backdrop-filter":[{"backdrop-filter":["","none"]}],"backdrop-blur":[{"backdrop-blur":[r]}],"backdrop-brightness":[{"backdrop-brightness":[n]}],"backdrop-contrast":[{"backdrop-contrast":[u]}],"backdrop-grayscale":[{"backdrop-grayscale":[l]}],"backdrop-hue-rotate":[{"backdrop-hue-rotate":[c]}],"backdrop-invert":[{"backdrop-invert":[d]}],"backdrop-opacity":[{"backdrop-opacity":[y]}],"backdrop-saturate":[{"backdrop-saturate":[_]}],"backdrop-sepia":[{"backdrop-sepia":[x]}],"border-collapse":[{border:["collapse","separate"]}],"border-spacing":[{"border-spacing":[a]}],"border-spacing-x":[{"border-spacing-x":[a]}],"border-spacing-y":[{"border-spacing-y":[a]}],"table-layout":[{table:["auto","fixed"]}],caption:[{caption:["top","bottom"]}],transition:[{transition:["none","all","","colors","opacity","shadow","transform",Ko]}],duration:[{duration:ie()}],ease:[{ease:["linear","in","out","in-out",Ko]}],delay:[{delay:ie()}],animate:[{animate:["none","spin","ping","pulse","bounce",Ko]}],transform:[{transform:["","gpu","none"]}],scale:[{scale:[w]}],"scale-x":[{"scale-x":[w]}],"scale-y":[{"scale-y":[w]}],rotate:[{rotate:[ate,Ko]}],"translate-x":[{"translate-x":[T]}],"translate-y":[{"translate-y":[T]}],"skew-x":[{"skew-x":[O]}],"skew-y":[{"skew-y":[O]}],"transform-origin":[{origin:["center","top","top-right","right","bottom-right","bottom","bottom-left","left","top-left",Ko]}],accent:[{accent:["auto",t]}],appearance:[{appearance:["none","auto"]}],cursor:[{cursor:["auto","default","pointer","wait","text","move","help","not-allowed","none","context-menu","progress","cell","crosshair","vertical-text","alias","copy","no-drop","grab","grabbing","all-scroll","col-resize","row-resize","n-resize","e-resize","s-resize","w-resize","ne-resize","nw-resize","se-resize","sw-resize","ew-resize","ns-resize","nesw-resize","nwse-resize","zoom-in","zoom-out",Ko]}],"caret-color":[{caret:[t]}],"pointer-events":[{"pointer-events":["none","auto"]}],resize:[{resize:["none","y","x",""]}],"scroll-behavior":[{scroll:["auto","smooth"]}],"scroll-m":[{"scroll-m":F()}],"scroll-mx":[{"scroll-mx":F()}],"scroll-my":[{"scroll-my":F()}],"scroll-ms":[{"scroll-ms":F()}],"scroll-me":[{"scroll-me":F()}],"scroll-mt":[{"scroll-mt":F()}],"scroll-mr":[{"scroll-mr":F()}],"scroll-mb":[{"scroll-mb":F()}],"scroll-ml":[{"scroll-ml":F()}],"scroll-p":[{"scroll-p":F()}],"scroll-px":[{"scroll-px":F()}],"scroll-py":[{"scroll-py":F()}],"scroll-ps":[{"scroll-ps":F()}],"scroll-pe":[{"scroll-pe":F()}],"scroll-pt":[{"scroll-pt":F()}],"scroll-pr":[{"scroll-pr":F()}],"scroll-pb":[{"scroll-pb":F()}],"scroll-pl":[{"scroll-pl":F()}],"snap-align":[{snap:["start","end","center","align-none"]}],"snap-stop":[{snap:["normal","always"]}],"snap-type":[{snap:["none","x","y","both"]}],"snap-strictness":[{snap:["mandatory","proximity"]}],touch:[{touch:["auto","none","manipulation"]}],"touch-x":[{"touch-pan":["x","left","right"]}],"touch-y":[{"touch-pan":["y","up","down"]}],"touch-pz":["touch-pinch-zoom"],select:[{select:["none","text","all","auto"]}],"will-change":[{"will-change":["auto","scroll","contents","transform",Ko]}],fill:[{fill:[t,"none"]}],"stroke-w":[{stroke:[BN,UL,SJe]}],stroke:[{stroke:[t,"none"]}],sr:["sr-only","not-sr-only"],"forced-color-adjust":[{"forced-color-adjust":["auto","none"]}]},conflictingClassGroups:{overflow:["overflow-x","overflow-y"],overscroll:["overscroll-x","overscroll-y"],inset:["inset-x","inset-y","start","end","top","right","bottom","left"],"inset-x":["right","left"],"inset-y":["top","bottom"],flex:["basis","grow","shrink"],gap:["gap-x","gap-y"],p:["px","py","ps","pe","pt","pr","pb","pl"],px:["pr","pl"],py:["pt","pb"],m:["mx","my","ms","me","mt","mr","mb","ml"],mx:["mr","ml"],my:["mt","mb"],size:["w","h"],"font-size":["leading"],"fvn-normal":["fvn-ordinal","fvn-slashed-zero","fvn-figure","fvn-spacing","fvn-fraction"],"fvn-ordinal":["fvn-normal"],"fvn-slashed-zero":["fvn-normal"],"fvn-figure":["fvn-normal"],"fvn-spacing":["fvn-normal"],"fvn-fraction":["fvn-normal"],"line-clamp":["display","overflow"],rounded:["rounded-s","rounded-e","rounded-t","rounded-r","rounded-b","rounded-l","rounded-ss","rounded-se","rounded-ee","rounded-es","rounded-tl","rounded-tr","rounded-br","rounded-bl"],"rounded-s":["rounded-ss","rounded-es"],"rounded-e":["rounded-se","rounded-ee"],"rounded-t":["rounded-tl","rounded-tr"],"rounded-r":["rounded-tr","rounded-br"],"rounded-b":["rounded-br","rounded-bl"],"rounded-l":["rounded-tl","rounded-bl"],"border-spacing":["border-spacing-x","border-spacing-y"],"border-w":["border-w-s","border-w-e","border-w-t","border-w-r","border-w-b","border-w-l"],"border-w-x":["border-w-r","border-w-l"],"border-w-y":["border-w-t","border-w-b"],"border-color":["border-color-s","border-color-e","border-color-t","border-color-r","border-color-b","border-color-l"],"border-color-x":["border-color-r","border-color-l"],"border-color-y":["border-color-t","border-color-b"],"scroll-m":["scroll-mx","scroll-my","scroll-ms","scroll-me","scroll-mt","scroll-mr","scroll-mb","scroll-ml"],"scroll-mx":["scroll-mr","scroll-ml"],"scroll-my":["scroll-mt","scroll-mb"],"scroll-p":["scroll-px","scroll-py","scroll-ps","scroll-pe","scroll-pt","scroll-pr","scroll-pb","scroll-pl"],"scroll-px":["scroll-pr","scroll-pl"],"scroll-py":["scroll-pt","scroll-pb"],touch:["touch-x","touch-y","touch-pz"],"touch-x":["touch"],"touch-y":["touch"],"touch-pz":["touch"]},conflictingClassGroupModifiers:{"font-size":["leading"]}}},tvn=(t,{cacheSize:e,prefix:r,separator:n,experimentalParseClassName:o,extend:i={},override:a={}})=>{ute(t,"cacheSize",e),ute(t,"prefix",r),ute(t,"separator",n),ute(t,"experimentalParseClassName",o);for(let s in a)rvn(t[s],a[s]);for(let s in i)nvn(t[s],i[s]);return t},ute=(t,e,r)=>{r!==void 0&&(t[e]=r)},rvn=(t,e)=>{if(e)for(let r in e)ute(t,r,e[r])},nvn=(t,e)=>{if(e)for(let r in e){let n=e[r];n!==void 0&&(t[r]=(t[r]||[]).concat(n))}},ojt=(t,...e)=>typeof t=="function"?X1t(Y1t,t,...e):X1t(()=>tvn(Y1t(),t),...e)});function Oe(...t){return ovn(hye(t))}var ovn,Zn=v(()=>{wJe();ijt();ovn=ojt({prefix:"tw-",extend:{classGroups:{"text-color":["text-muted","text-success","text-warning","text-error","text-accent"],"font-size":["text-smallest","text-smaller","text-small","text-ui-smaller","text-ui-small","text-ui-medium","text-ui-larger"]}}})});var yye,ivn,we,Fo=v(()=>{yye=L(X());lh();gye();Zn();ivn=R5("tw-inline-flex tw-items-center tw-justify-center tw-gap-1 tw-whitespace-nowrap tw-rounded-md tw-text-sm tw-font-medium tw-transition-colors focus-visible:tw-outline-none focus-visible:tw-ring-1 focus-visible:tw-ring-ring disabled:tw-pointer-events-none disabled:tw-opacity-50 [&_svg]:tw-shrink-0",{variants:{variant:{default:"mod-cta tw-bg-interactive-accent tw-text-on-accent tw-shadow hover:tw-bg-interactive-accent-hover",destructive:"clickable-icon tw-bg-modifier-error tw-text-on-accent hover:tw-bg-modifier-error hover:tw-text-on-accent",secondary:"tw-bg-secondary tw-text-normal tw-shadow-sm hover:tw-bg-interactive-hover",ghost:"clickable-icon tw-bg-transparent hover:tw-bg-interactive-accent hover:tw-text-on-accent",link:"tw-text-accent tw-underline-offset-4 hover:tw-underline",success:"clickable-icon tw-bg-modifier-success tw-text-on-accent hover:tw-bg-modifier-success hover:tw-text-on-accent",ghost2:"clickable-icon tw-bg-transparent tw-text-faint tw-outline-none hover:tw-bg-transparent hover:tw-bg-opacity-100 hover:tw-text-normal focus-visible:tw-text-normal focus-visible:tw-outline-none focus-visible:tw-ring-0"},size:{default:"tw-h-9 tw-px-4 tw-py-2",sm:"tw-h-6 tw-rounded-md tw-px-3 tw-text-xs",lg:"tw-h-10 tw-rounded-md tw-px-8",icon:"tw-size-7",fit:"tw-gap-1 tw-px-1 tw-text-xs"}},defaultVariants:{variant:"default",size:"default"}}),we=yye.forwardRef(({className:t,variant:e,size:r,asChild:n=!1,...o},i)=>yye.createElement(n?z1t:"button",{className:Oe(ivn({variant:e,size:r,className:t})),ref:i,...o}));we.displayName="Button"});var ajt,bye,OJe=v(()=>{ajt=t=>t.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),bye=(...t)=>t.filter((e,r,n)=>!!e&&e.trim()!==""&&n.indexOf(e)===r).join(" ").trim()});var sjt,ujt=v(()=>{sjt={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"}});var lte,ljt,cjt=v(()=>{lte=L(X());ujt();OJe();ljt=(0,lte.forwardRef)(({color:t="currentColor",size:e=24,strokeWidth:r=2,absoluteStrokeWidth:n,className:o="",children:i,iconNode:a,...s},u)=>(0,lte.createElement)("svg",{ref:u,...sjt,width:e,height:e,stroke:t,strokeWidth:n?Number(r)*24/Number(e):r,className:bye("lucide",o),...s},[...a.map(([l,c])=>(0,lte.createElement)(l,c)),...Array.isArray(i)?i:[i]]))});var _ye,Te,Xt=v(()=>{_ye=L(X());OJe();cjt();Te=(t,e)=>{let r=(0,_ye.forwardRef)(({className:n,...o},i)=>(0,_ye.createElement)(ljt,{ref:i,iconNode:e,className:bye(`lucide-${ajt(t)}`,n),...o}));return r.displayName=`${t}`,r}});var N5,djt=v(()=>{Xt();N5=Te("ArrowBigUp",[["path",{d:"M9 18v-6H5l7-7 7 7h-4v6H9z",key:"1x06kx"}]])});var cte,fjt=v(()=>{Xt();cte=Te("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]])});var dte,pjt=v(()=>{Xt();dte=Te("ArrowUpRight",[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]])});var fte,mjt=v(()=>{Xt();fte=Te("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]])});var j5,hjt=v(()=>{Xt();j5=Te("Brain",[["path",{d:"M12 5a3 3 0 1 0-5.997.125 4 4 0 0 0-2.526 5.77 4 4 0 0 0 .556 6.588A4 4 0 1 0 12 18Z",key:"l5xja"}],["path",{d:"M12 5a3 3 0 1 1 5.997.125 4 4 0 0 1 2.526 5.77 4 4 0 0 1-.556 6.588A4 4 0 1 1 12 18Z",key:"ep3f8r"}],["path",{d:"M15 13a4.5 4.5 0 0 1-3-4 4.5 4.5 0 0 1-3 4",key:"1p4c4q"}],["path",{d:"M17.599 6.5a3 3 0 0 0 .399-1.375",key:"tmeiqw"}],["path",{d:"M6.003 5.125A3 3 0 0 0 6.401 6.5",key:"105sqy"}],["path",{d:"M3.477 10.896a4 4 0 0 1 .585-.396",key:"ql3yin"}],["path",{d:"M19.938 10.5a4 4 0 0 1 .585.396",key:"1qfode"}],["path",{d:"M6 18a4 4 0 0 1-1.967-.516",key:"2e4loj"}],["path",{d:"M19.967 17.484A4 4 0 0 1 18 18",key:"159ez6"}]])});var Lu,gjt=v(()=>{Xt();Lu=Te("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])});var Ys,yjt=v(()=>{Xt();Ys=Te("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]])});var og,bjt=v(()=>{Xt();og=Te("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]])});var sC,_jt=v(()=>{Xt();sC=Te("ChevronUp",[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]])});var LO,vjt=v(()=>{Xt();LO=Te("CircleAlert",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]])});var HL,wjt=v(()=>{Xt();HL=Te("CircleCheckBig",[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]])});var pte,Sjt=v(()=>{Xt();pte=Te("CircleDashed",[["path",{d:"M10.1 2.182a10 10 0 0 1 3.8 0",key:"5ilxe3"}],["path",{d:"M13.9 21.818a10 10 0 0 1-3.8 0",key:"11zvb9"}],["path",{d:"M17.609 3.721a10 10 0 0 1 2.69 2.7",key:"1iw5b2"}],["path",{d:"M2.182 13.9a10 10 0 0 1 0-3.8",key:"c0bmvh"}],["path",{d:"M20.279 17.609a10 10 0 0 1-2.7 2.69",key:"1ruxm7"}],["path",{d:"M21.818 10.1a10 10 0 0 1 0 3.8",key:"qkgqxc"}],["path",{d:"M3.721 6.391a10 10 0 0 1 2.7-2.69",key:"1mcia2"}],["path",{d:"M6.391 20.279a10 10 0 0 1-2.69-2.7",key:"1fvljs"}]])});var VL,Cjt=v(()=>{Xt();VL=Te("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]])});var Dv,xjt=v(()=>{Xt();Dv=Te("CirclePlus",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]])});var JL,Ojt=v(()=>{Xt();JL=Te("CircleStop",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["rect",{x:"9",y:"9",width:"6",height:"6",rx:"1",key:"1ssd4o"}]])});var KL,Tjt=v(()=>{Xt();KL=Te("CircleX",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]])});var mte,Ejt=v(()=>{Xt();mte=Te("Circle",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]])});var hte,Pjt=v(()=>{Xt();hte=Te("Cog",[["path",{d:"M12 20a8 8 0 1 0 0-16 8 8 0 0 0 0 16Z",key:"sobvz5"}],["path",{d:"M12 14a2 2 0 1 0 0-4 2 2 0 0 0 0 4Z",key:"11i496"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 22v-2",key:"1osdcq"}],["path",{d:"m17 20.66-1-1.73",key:"eq3orb"}],["path",{d:"M11 10.27 7 3.34",key:"16pf9h"}],["path",{d:"m20.66 17-1.73-1",key:"sg0v6f"}],["path",{d:"m3.34 7 1.73 1",key:"1ulond"}],["path",{d:"M14 12h8",key:"4f43i9"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"m20.66 7-1.73 1",key:"1ow05n"}],["path",{d:"m3.34 17 1.73-1",key:"nuk764"}],["path",{d:"m17 3.34-1 1.73",key:"2wel8s"}],["path",{d:"m11 13.73-4 6.93",key:"794ttg"}]])});var gte,Mjt=v(()=>{Xt();gte=Te("Coins",[["circle",{cx:"8",cy:"8",r:"6",key:"3yglwk"}],["path",{d:"M18.09 10.37A6 6 0 1 1 10.34 18",key:"t5s6rm"}],["path",{d:"M7 6h1v4",key:"1obek4"}],["path",{d:"m16.71 13.88.7.71-2.82 2.82",key:"1rbuyh"}]])});var WL,Rjt=v(()=>{Xt();WL=Te("Command",[["path",{d:"M15 6v12a3 3 0 1 0 3-3H6a3 3 0 1 0 3 3V6a3 3 0 1 0-3 3h12a3 3 0 1 0-3-3",key:"11bfej"}]])});var h_,Ajt=v(()=>{Xt();h_=Te("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])});var uC,Ijt=v(()=>{Xt();uC=Te("CornerDownLeft",[["polyline",{points:"9 10 4 15 9 20",key:"r3jprv"}],["path",{d:"M20 4v7a4 4 0 0 1-4 4H4",key:"6o5b7l"}]])});var yte,Njt=v(()=>{Xt();yte=Te("Cpu",[["rect",{width:"16",height:"16",x:"4",y:"4",rx:"2",key:"14l7u7"}],["rect",{width:"6",height:"6",x:"9",y:"9",rx:"1",key:"5aljv4"}],["path",{d:"M15 2v2",key:"13l42r"}],["path",{d:"M15 20v2",key:"15mkzm"}],["path",{d:"M2 15h2",key:"1gxd5l"}],["path",{d:"M2 9h2",key:"1bbxkp"}],["path",{d:"M20 15h2",key:"19e6y8"}],["path",{d:"M20 9h2",key:"19tzq7"}],["path",{d:"M9 2v2",key:"165o2o"}],["path",{d:"M9 20v2",key:"i2bqo8"}]])});var UN,jjt=v(()=>{Xt();UN=Te("Database",[["ellipse",{cx:"12",cy:"5",rx:"9",ry:"3",key:"msslwz"}],["path",{d:"M3 5V19A9 3 0 0 0 21 19V5",key:"1wlel7"}],["path",{d:"M3 12A9 3 0 0 0 21 12",key:"mv7ke4"}]])});var bte,Djt=v(()=>{Xt();bte=Te("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]])});var FO,$jt=v(()=>{Xt();FO=Te("EllipsisVertical",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"12",cy:"5",r:"1",key:"gxeob9"}],["circle",{cx:"12",cy:"19",r:"1",key:"lyex9k"}]])});var GL,Ljt=v(()=>{Xt();GL=Te("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]])});var zN,Fjt=v(()=>{Xt();zN=Te("ExternalLink",[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]])});var _te,kjt=v(()=>{Xt();_te=Te("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])});var HN,qjt=v(()=>{Xt();HN=Te("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]])});var vte,Bjt=v(()=>{Xt();vte=Te("FileAudio",[["path",{d:"M17.5 22h.5a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"rslqgf"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 19a2 2 0 1 1 4 0v1a2 2 0 1 1-4 0v-4a6 6 0 0 1 12 0v4a2 2 0 1 1-4 0v-1a2 2 0 1 1 4 0",key:"9f7x3i"}]])});var VN,Ujt=v(()=>{Xt();VN=Te("FileClock",[["path",{d:"M16 22h2a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v3",key:"37hlfg"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"8",cy:"16",r:"6",key:"10v15b"}],["path",{d:"M9.5 17.5 8 16.25V14",key:"1o80t2"}]])});var wte,zjt=v(()=>{Xt();wte=Te("FileImage",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]])});var Ste,Hjt=v(()=>{Xt();Ste=Te("FileInput",[["path",{d:"M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4",key:"1pf5j1"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M2 15h10",key:"jfw4w8"}],["path",{d:"m9 18 3-3-3-3",key:"112psh"}]])});var Cte,Vjt=v(()=>{Xt();Cte=Te("FileOutput",[["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M4 7V4a2 2 0 0 1 2-2 2 2 0 0 0-2 2",key:"1vk7w2"}],["path",{d:"M4.063 20.999a2 2 0 0 0 2 1L18 22a2 2 0 0 0 2-2V7l-5-5H6",key:"1jink5"}],["path",{d:"m5 11-3 3",key:"1dgrs4"}],["path",{d:"m5 17-3-3h10",key:"1mvvaf"}]])});var Ol,Jjt=v(()=>{Xt();Ol=Te("FileText",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])});var xte,Kjt=v(()=>{Xt();xte=Te("FileVideo",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"m10 11 5 3-5 3v-6Z",key:"7ntvm4"}]])});var Ote,Wjt=v(()=>{Xt();Ote=Te("File",[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}]])});var ch,Gjt=v(()=>{Xt();ch=Te("Folder",[["path",{d:"M20 20a2 2 0 0 0 2-2V8a2 2 0 0 0-2-2h-7.9a2 2 0 0 1-1.69-.9L9.6 3.9A2 2 0 0 0 7.93 3H4a2 2 0 0 0-2 2v13a2 2 0 0 0 2 2Z",key:"1kt360"}]])});var lC,Zjt=v(()=>{Xt();lC=Te("Globe",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]])});var cC,Xjt=v(()=>{Xt();cC=Te("GripVertical",[["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}],["circle",{cx:"9",cy:"5",r:"1",key:"hp0tcf"}],["circle",{cx:"9",cy:"19",r:"1",key:"fkjjf6"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"15",cy:"5",r:"1",key:"19l28e"}],["circle",{cx:"15",cy:"19",r:"1",key:"f4zoj3"}]])});var Tte,Yjt=v(()=>{Xt();Tte=Te("Hash",[["line",{x1:"4",x2:"20",y1:"9",y2:"9",key:"4lhtct"}],["line",{x1:"4",x2:"20",y1:"15",y2:"15",key:"vyu0kd"}],["line",{x1:"10",x2:"8",y1:"3",y2:"21",key:"1ggp8o"}],["line",{x1:"16",x2:"14",y1:"3",y2:"21",key:"weycgp"}]])});var Ete,Qjt=v(()=>{Xt();Ete=Te("History",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]])});var Pte,eDt=v(()=>{Xt();Pte=Te("Image",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",ry:"2",key:"1m3agn"}],["circle",{cx:"9",cy:"9",r:"2",key:"af1f0g"}],["path",{d:"m21 15-3.086-3.086a2 2 0 0 0-2.828 0L6 21",key:"1xmnt7"}]])});var Mte,tDt=v(()=>{Xt();Mte=Te("Key",[["path",{d:"m15.5 7.5 2.3 2.3a1 1 0 0 0 1.4 0l2.1-2.1a1 1 0 0 0 0-1.4L19 4",key:"g0fldk"}],["path",{d:"m21 2-9.6 9.6",key:"1j0ho8"}],["circle",{cx:"7.5",cy:"15.5",r:"5.5",key:"yqb3hr"}]])});var d4,rDt=v(()=>{Xt();d4=Te("LibraryBig",[["rect",{width:"8",height:"18",x:"3",y:"3",rx:"1",key:"oynpb5"}],["path",{d:"M7 3v18",key:"bbkbws"}],["path",{d:"M20.4 18.9c.2.5-.1 1.1-.6 1.3l-1.9.7c-.5.2-1.1-.1-1.3-.6L11.1 5.1c-.2-.5.1-1.1.6-1.3l1.9-.7c.5-.2 1.1.1 1.3.6Z",key:"1qboyk"}]])});var JN,nDt=v(()=>{Xt();JN=Te("Lightbulb",[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]])});var Jc,oDt=v(()=>{Xt();Jc=Te("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]])});var Rte,iDt=v(()=>{Xt();Rte=Te("MessageCirclePlus",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}],["path",{d:"M8 12h8",key:"1wcyev"}],["path",{d:"M12 8v8",key:"napkw2"}]])});var D5,aDt=v(()=>{Xt();D5=Te("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]])});var $5,sDt=v(()=>{Xt();$5=Te("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]])});var cS,uDt=v(()=>{Xt();cS=Te("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]])});var cb,lDt=v(()=>{Xt();cb=Te("Pen",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}]])});var L5,cDt=v(()=>{Xt();L5=Te("PencilLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}],["path",{d:"m15 5 3 3",key:"1w25hb"}]])});var F5,dDt=v(()=>{Xt();F5=Te("Pencil",[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]])});var dC,fDt=v(()=>{Xt();dC=Te("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]])});var Ate,pDt=v(()=>{Xt();Ate=Te("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]])});var ZL,mDt=v(()=>{Xt();ZL=Te("RefreshCw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])});var Ite,hDt=v(()=>{Xt();Ite=Te("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]])});var Nte,gDt=v(()=>{Xt();Nte=Te("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]])});var f4,yDt=v(()=>{Xt();f4=Te("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]])});var dy,bDt=v(()=>{Xt();dy=Te("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]])});var KN,_Dt=v(()=>{Xt();KN=Te("SquareArrowOutUpRight",[["path",{d:"M21 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h6",key:"y09zxi"}],["path",{d:"m21 3-9 9",key:"mpx6sq"}],["path",{d:"M15 3h6v6",key:"1q9fwt"}]])});var g_,vDt=v(()=>{Xt();g_=Te("SquarePen",[["path",{d:"M12 3H5a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7",key:"1m0v6g"}],["path",{d:"M18.375 2.625a1 1 0 0 1 3 3l-9.013 9.014a2 2 0 0 1-.853.505l-2.873.84a.5.5 0 0 1-.62-.62l.84-2.873a2 2 0 0 1 .506-.852z",key:"ohrbg2"}]])});var XL,wDt=v(()=>{Xt();XL=Te("Tag",[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]])});var jte,SDt=v(()=>{Xt();jte=Te("TextCursorInput",[["path",{d:"M5 4h1a3 3 0 0 1 3 3 3 3 0 0 1 3-3h1",key:"18xjzo"}],["path",{d:"M13 20h-1a3 3 0 0 1-3-3 3 3 0 0 1-3 3H5",key:"fj48gi"}],["path",{d:"M5 16H4a2 2 0 0 1-2-2v-4a2 2 0 0 1 2-2h1",key:"1n9rhb"}],["path",{d:"M13 8h7a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-7",key:"13ksps"}],["path",{d:"M9 7v10",key:"1vc8ob"}]])});var fy,CDt=v(()=>{Xt();fy=Te("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]])});var ig,xDt=v(()=>{Xt();ig=Te("TriangleAlert",[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]])});var $v,ODt=v(()=>{Xt();$v=Te("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]])});var ci,TDt=v(()=>{Xt();ci=Te("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]])});var Dte,EDt=v(()=>{Xt();Dte=Te("ZapOff",[["path",{d:"M10.513 4.856 13.12 2.17a.5.5 0 0 1 .86.46l-1.377 4.317",key:"193nxd"}],["path",{d:"M15.656 10H20a1 1 0 0 1 .78 1.63l-1.72 1.773",key:"27a7lr"}],["path",{d:"M16.273 16.273 10.88 21.83a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14H4a1 1 0 0 1-.78-1.63l4.507-4.643",key:"1e0qe9"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]])});var $te,PDt=v(()=>{Xt();$te=Te("Zap",[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]])});var In=v(()=>{vjt();wjt();Cjt();xjt();Ojt();Tjt();$jt();Ljt();oDt();uDt();lDt();bDt();_Dt();vDt();xDt();djt();fjt();pjt();mjt();hjt();gjt();yjt();bjt();_jt();Sjt();Ejt();Pjt();Mjt();Rjt();Ajt();Ijt();Njt();jjt();Djt();Fjt();kjt();qjt();Bjt();Ujt();zjt();Hjt();Vjt();Jjt();Kjt();Wjt();Gjt();Zjt();Xjt();Yjt();Qjt();eDt();tDt();rDt();nDt();iDt();aDt();sDt();cDt();dDt();fDt();pDt();mDt();hDt();gDt();yDt();wDt();SDt();CDt();ODt();TDt();EDt();PDt();});function avn({onCancel:t}){let e=ce(),r=TJe(e.defaultModelKey)&&TJe(e.embeddingModelKey);return kO.default.createElement("div",{className:"tw-flex tw-flex-col tw-gap-4"},kO.default.createElement("div",{className:"tw-flex tw-flex-col tw-gap-2"},kO.default.createElement("div",null,"Your Copilot Plus license key is no longer valid. Please renew your subscription to continue using Copilot Plus."),r&&kO.default.createElement("div",{className:"tw-text-sm tw-text-warning"},"The Copilot Plus exclusive models will stop working. You can switch to the default models in the Settings.")),kO.default.createElement("div",{className:"tw-flex tw-w-full tw-justify-end tw-gap-2"},kO.default.createElement(we,{variant:"ghost",onClick:t},"Close"),kO.default.createElement(we,{variant:"default",onClick:()=>{p4(PN.EXPIRED_MODAL)}},"Renew Now ",kO.default.createElement(zN,{className:"tw-size-4"}))))}var kO,MDt,RDt,vye,ADt=v(()=>{kO=L(X()),MDt=require("obsidian"),RDt=L(Sm());Fo();Lv();Zr();In();jt();vye=class extends MDt.Modal{constructor(e){super(e),this.setTitle("Thanks for being a Copilot Plus user \u{1F44B}")}onOpen(){let{contentEl:e}=this;this.root=(0,RDt.createRoot)(e);let r=()=>{this.close()};this.root.render(kO.default.createElement(avn,{onCancel:r}))}onClose(){this.root.unmount()}}});var NDt=S(IDt=>{"use strict";Object.defineProperty(IDt,"__esModule",{value:!0})});var jDt=S(wye=>{"use strict";Object.defineProperty(wye,"__esModule",{value:!0});wye.V2ChatStreamRequestSafetyMode=void 0;wye.V2ChatStreamRequestSafetyMode={Contextual:"CONTEXTUAL",Strict:"STRICT",Off:"OFF"}});var DDt=S(Sye=>{"use strict";Object.defineProperty(Sye,"__esModule",{value:!0});Sye.V2ChatStreamRequestToolChoice=void 0;Sye.V2ChatStreamRequestToolChoice={Required:"REQUIRED",None:"NONE"}});var LDt=S($Dt=>{"use strict";Object.defineProperty($Dt,"__esModule",{value:!0})});var kDt=S(FDt=>{"use strict";Object.defineProperty(FDt,"__esModule",{value:!0})});var qDt=S(Cye=>{"use strict";Object.defineProperty(Cye,"__esModule",{value:!0});Cye.V2ChatRequestSafetyMode=void 0;Cye.V2ChatRequestSafetyMode={Contextual:"CONTEXTUAL",Strict:"STRICT",Off:"OFF"}});var BDt=S(xye=>{"use strict";Object.defineProperty(xye,"__esModule",{value:!0});xye.V2ChatRequestToolChoice=void 0;xye.V2ChatRequestToolChoice={Required:"REQUIRED",None:"NONE"}});var zDt=S(UDt=>{"use strict";Object.defineProperty(UDt,"__esModule",{value:!0})});var HDt=S(Oye=>{"use strict";Object.defineProperty(Oye,"__esModule",{value:!0});Oye.V2EmbedRequestTruncate=void 0;Oye.V2EmbedRequestTruncate={None:"NONE",Start:"START",End:"END"}});var JDt=S(VDt=>{"use strict";Object.defineProperty(VDt,"__esModule",{value:!0})});var WDt=S(KDt=>{"use strict";Object.defineProperty(KDt,"__esModule",{value:!0})});var EJe=S(ag=>{"use strict";var svn=ag&&ag.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),fC=ag&&ag.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&svn(e,t,r)};Object.defineProperty(ag,"__esModule",{value:!0});fC(NDt(),ag);fC(jDt(),ag);fC(DDt(),ag);fC(LDt(),ag);fC(kDt(),ag);fC(qDt(),ag);fC(BDt(),ag);fC(zDt(),ag);fC(HDt(),ag);fC(JDt(),ag);fC(WDt(),ag)});var PJe=S(GDt=>{"use strict";Object.defineProperty(GDt,"__esModule",{value:!0})});var ZDt=S(m4=>{"use strict";var uvn=m4&&m4.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),lvn=m4&&m4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&uvn(e,t,r)};Object.defineProperty(m4,"__esModule",{value:!0});lvn(PJe(),m4)});var YDt=S(YL=>{"use strict";var cvn=YL&&YL.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),XDt=YL&&YL.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&cvn(e,t,r)};Object.defineProperty(YL,"__esModule",{value:!0});XDt(EJe(),YL);XDt(ZDt(),YL)});var QDt=S(Tye=>{"use strict";Object.defineProperty(Tye,"__esModule",{value:!0});Tye.CreateEmbedJobRequestTruncate=void 0;Tye.CreateEmbedJobRequestTruncate={Start:"START",End:"END"}});var MJe=S(h4=>{"use strict";var dvn=h4&&h4.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),fvn=h4&&h4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&dvn(e,t,r)};Object.defineProperty(h4,"__esModule",{value:!0});fvn(QDt(),h4)});var RJe=S(e$t=>{"use strict";Object.defineProperty(e$t,"__esModule",{value:!0})});var t$t=S(g4=>{"use strict";var pvn=g4&&g4.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),mvn=g4&&g4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&pvn(e,t,r)};Object.defineProperty(g4,"__esModule",{value:!0});mvn(RJe(),g4)});var n$t=S(QL=>{"use strict";var hvn=QL&&QL.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),r$t=QL&&QL.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&hvn(e,t,r)};Object.defineProperty(QL,"__esModule",{value:!0});r$t(MJe(),QL);r$t(t$t(),QL)});var i$t=S(o$t=>{"use strict";Object.defineProperty(o$t,"__esModule",{value:!0})});var s$t=S(a$t=>{"use strict";Object.defineProperty(a$t,"__esModule",{value:!0})});var l$t=S(u$t=>{"use strict";Object.defineProperty(u$t,"__esModule",{value:!0})});var d$t=S(c$t=>{"use strict";Object.defineProperty(c$t,"__esModule",{value:!0})});var AJe=S(qO=>{"use strict";var gvn=qO&&qO.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Eye=qO&&qO.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gvn(e,t,r)};Object.defineProperty(qO,"__esModule",{value:!0});Eye(i$t(),qO);Eye(s$t(),qO);Eye(l$t(),qO);Eye(d$t(),qO)});var IJe=S(f$t=>{"use strict";Object.defineProperty(f$t,"__esModule",{value:!0})});var p$t=S(y4=>{"use strict";var yvn=y4&&y4.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),bvn=y4&&y4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yvn(e,t,r)};Object.defineProperty(y4,"__esModule",{value:!0});bvn(IJe(),y4)});var h$t=S(eF=>{"use strict";var _vn=eF&&eF.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),m$t=eF&&eF.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_vn(e,t,r)};Object.defineProperty(eF,"__esModule",{value:!0});m$t(AJe(),eF);m$t(p$t(),eF)});var g$t=S(Pye=>{"use strict";Object.defineProperty(Pye,"__esModule",{value:!0});Pye.BaseType=void 0;Pye.BaseType={BaseTypeUnspecified:"BASE_TYPE_UNSPECIFIED",BaseTypeGenerative:"BASE_TYPE_GENERATIVE",BaseTypeClassification:"BASE_TYPE_CLASSIFICATION",BaseTypeRerank:"BASE_TYPE_RERANK",BaseTypeChat:"BASE_TYPE_CHAT"}});var y$t=S(Mye=>{"use strict";Object.defineProperty(Mye,"__esModule",{value:!0});Mye.Strategy=void 0;Mye.Strategy={StrategyUnspecified:"STRATEGY_UNSPECIFIED",StrategyVanilla:"STRATEGY_VANILLA",StrategyTfew:"STRATEGY_TFEW"}});var _$t=S(b$t=>{"use strict";Object.defineProperty(b$t,"__esModule",{value:!0})});var v$t=S(Rye=>{"use strict";Object.defineProperty(Rye,"__esModule",{value:!0});Rye.LoraTargetModules=void 0;Rye.LoraTargetModules={LoraTargetModulesUnspecified:"LORA_TARGET_MODULES_UNSPECIFIED",LoraTargetModulesQv:"LORA_TARGET_MODULES_QV",LoraTargetModulesQkvo:"LORA_TARGET_MODULES_QKVO",LoraTargetModulesQkvoFfn:"LORA_TARGET_MODULES_QKVO_FFN"}});var S$t=S(w$t=>{"use strict";Object.defineProperty(w$t,"__esModule",{value:!0})});var x$t=S(C$t=>{"use strict";Object.defineProperty(C$t,"__esModule",{value:!0})});var T$t=S(O$t=>{"use strict";Object.defineProperty(O$t,"__esModule",{value:!0})});var E$t=S(Aye=>{"use strict";Object.defineProperty(Aye,"__esModule",{value:!0});Aye.Status=void 0;Aye.Status={StatusUnspecified:"STATUS_UNSPECIFIED",StatusFinetuning:"STATUS_FINETUNING",StatusDeployingApi:"STATUS_DEPLOYING_API",StatusReady:"STATUS_READY",StatusFailed:"STATUS_FAILED",StatusDeleted:"STATUS_DELETED",StatusTemporarilyOffline:"STATUS_TEMPORARILY_OFFLINE",StatusPaused:"STATUS_PAUSED",StatusQueued:"STATUS_QUEUED"}});var M$t=S(P$t=>{"use strict";Object.defineProperty(P$t,"__esModule",{value:!0})});var A$t=S(R$t=>{"use strict";Object.defineProperty(R$t,"__esModule",{value:!0})});var N$t=S(I$t=>{"use strict";Object.defineProperty(I$t,"__esModule",{value:!0})});var D$t=S(j$t=>{"use strict";Object.defineProperty(j$t,"__esModule",{value:!0})});var L$t=S($$t=>{"use strict";Object.defineProperty($$t,"__esModule",{value:!0})});var k$t=S(F$t=>{"use strict";Object.defineProperty(F$t,"__esModule",{value:!0})});var B$t=S(q$t=>{"use strict";Object.defineProperty(q$t,"__esModule",{value:!0})});var z$t=S(U$t=>{"use strict";Object.defineProperty(U$t,"__esModule",{value:!0})});var V$t=S(H$t=>{"use strict";Object.defineProperty(H$t,"__esModule",{value:!0})});var K$t=S(J$t=>{"use strict";Object.defineProperty(J$t,"__esModule",{value:!0})});var NJe=S(Tl=>{"use strict";var vvn=Tl&&Tl.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),dh=Tl&&Tl.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&vvn(e,t,r)};Object.defineProperty(Tl,"__esModule",{value:!0});dh(g$t(),Tl);dh(y$t(),Tl);dh(_$t(),Tl);dh(v$t(),Tl);dh(S$t(),Tl);dh(x$t(),Tl);dh(T$t(),Tl);dh(E$t(),Tl);dh(M$t(),Tl);dh(A$t(),Tl);dh(N$t(),Tl);dh(D$t(),Tl);dh(L$t(),Tl);dh(k$t(),Tl);dh(B$t(),Tl);dh(z$t(),Tl);dh(V$t(),Tl);dh(K$t(),Tl)});var W$t=S(b4=>{"use strict";var wvn=b4&&b4.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Svn=b4&&b4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&wvn(e,t,r)};Object.defineProperty(b4,"__esModule",{value:!0});Svn(NJe(),b4)});var Z$t=S(Fv=>{"use strict";var G$t=Fv&&Fv.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Cvn=Fv&&Fv.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),xvn=Fv&&Fv.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";Object.defineProperty(X$t,"__esModule",{value:!0})});var Y$t=S(_4=>{"use strict";var Tvn=_4&&_4.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Evn=_4&&_4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Tvn(e,t,r)};Object.defineProperty(_4,"__esModule",{value:!0});Evn(jJe(),_4)});var eLt=S(tF=>{"use strict";var Pvn=tF&&tF.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Q$t=tF&&tF.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Pvn(e,t,r)};Object.defineProperty(tF,"__esModule",{value:!0});Q$t(Z$t(),tF);Q$t(Y$t(),tF)});var DJe=S(tLt=>{"use strict";Object.defineProperty(tLt,"__esModule",{value:!0})});var rLt=S(v4=>{"use strict";var Mvn=v4&&v4.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Rvn=v4&&v4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Mvn(e,t,r)};Object.defineProperty(v4,"__esModule",{value:!0});Rvn(DJe(),v4)});var nLt=S(w4=>{"use strict";var Avn=w4&&w4.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Ivn=w4&&w4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Avn(e,t,r)};Object.defineProperty(w4,"__esModule",{value:!0});Ivn(rLt(),w4)});var $Je=S(oLt=>{"use strict";Object.defineProperty(oLt,"__esModule",{value:!0})});var iLt=S(S4=>{"use strict";var Nvn=S4&&S4.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),jvn=S4&&S4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Nvn(e,t,r)};Object.defineProperty(S4,"__esModule",{value:!0});jvn($Je(),S4)});var aLt=S(C4=>{"use strict";var Dvn=C4&&C4.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),$vn=C4&&C4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Dvn(e,t,r)};Object.defineProperty(C4,"__esModule",{value:!0});$vn(iLt(),C4)});var uLt=S($s=>{"use strict";var sLt=$s&&$s.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Lvn=$s&&$s.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),k5=$s&&$s.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";Object.defineProperty(Iye,"__esModule",{value:!0});Iye.ChatStreamRequestPromptTruncation=void 0;Iye.ChatStreamRequestPromptTruncation={Off:"OFF",Auto:"AUTO",AutoPreserveOrder:"AUTO_PRESERVE_ORDER"}});var cLt=S(Nye=>{"use strict";Object.defineProperty(Nye,"__esModule",{value:!0});Nye.ChatStreamRequestCitationQuality=void 0;Nye.ChatStreamRequestCitationQuality={Fast:"fast",Accurate:"accurate",Off:"off"}});var dLt=S(jye=>{"use strict";Object.defineProperty(jye,"__esModule",{value:!0});jye.ChatStreamRequestSafetyMode=void 0;jye.ChatStreamRequestSafetyMode={Contextual:"CONTEXTUAL",Strict:"STRICT",None:"NONE"}});var pLt=S(fLt=>{"use strict";Object.defineProperty(fLt,"__esModule",{value:!0})});var mLt=S(Dye=>{"use strict";Object.defineProperty(Dye,"__esModule",{value:!0});Dye.ChatRequestPromptTruncation=void 0;Dye.ChatRequestPromptTruncation={Off:"OFF",Auto:"AUTO",AutoPreserveOrder:"AUTO_PRESERVE_ORDER"}});var hLt=S($ye=>{"use strict";Object.defineProperty($ye,"__esModule",{value:!0});$ye.ChatRequestCitationQuality=void 0;$ye.ChatRequestCitationQuality={Fast:"fast",Accurate:"accurate",Off:"off"}});var gLt=S(Lye=>{"use strict";Object.defineProperty(Lye,"__esModule",{value:!0});Lye.ChatRequestSafetyMode=void 0;Lye.ChatRequestSafetyMode={Contextual:"CONTEXTUAL",Strict:"STRICT",None:"NONE"}});var bLt=S(yLt=>{"use strict";Object.defineProperty(yLt,"__esModule",{value:!0})});var _Lt=S(Fye=>{"use strict";Object.defineProperty(Fye,"__esModule",{value:!0});Fye.GenerateStreamRequestTruncate=void 0;Fye.GenerateStreamRequestTruncate={None:"NONE",Start:"START",End:"END"}});var vLt=S(kye=>{"use strict";Object.defineProperty(kye,"__esModule",{value:!0});kye.GenerateStreamRequestReturnLikelihoods=void 0;kye.GenerateStreamRequestReturnLikelihoods={Generation:"GENERATION",All:"ALL",None:"NONE"}});var SLt=S(wLt=>{"use strict";Object.defineProperty(wLt,"__esModule",{value:!0})});var CLt=S(qye=>{"use strict";Object.defineProperty(qye,"__esModule",{value:!0});qye.GenerateRequestTruncate=void 0;qye.GenerateRequestTruncate={None:"NONE",Start:"START",End:"END"}});var xLt=S(Bye=>{"use strict";Object.defineProperty(Bye,"__esModule",{value:!0});Bye.GenerateRequestReturnLikelihoods=void 0;Bye.GenerateRequestReturnLikelihoods={Generation:"GENERATION",All:"ALL",None:"NONE"}});var TLt=S(OLt=>{"use strict";Object.defineProperty(OLt,"__esModule",{value:!0})});var ELt=S(Uye=>{"use strict";Object.defineProperty(Uye,"__esModule",{value:!0});Uye.EmbedRequestTruncate=void 0;Uye.EmbedRequestTruncate={None:"NONE",Start:"START",End:"END"}});var MLt=S(PLt=>{"use strict";Object.defineProperty(PLt,"__esModule",{value:!0})});var ALt=S(RLt=>{"use strict";Object.defineProperty(RLt,"__esModule",{value:!0})});var NLt=S(ILt=>{"use strict";Object.defineProperty(ILt,"__esModule",{value:!0})});var DLt=S(jLt=>{"use strict";Object.defineProperty(jLt,"__esModule",{value:!0})});var LLt=S($Lt=>{"use strict";Object.defineProperty($Lt,"__esModule",{value:!0})});var FLt=S(zye=>{"use strict";Object.defineProperty(zye,"__esModule",{value:!0});zye.ClassifyRequestTruncate=void 0;zye.ClassifyRequestTruncate={None:"NONE",Start:"START",End:"END"}});var qLt=S(kLt=>{"use strict";Object.defineProperty(kLt,"__esModule",{value:!0})});var BLt=S(Hye=>{"use strict";Object.defineProperty(Hye,"__esModule",{value:!0});Hye.ClassifyResponseClassificationsItemClassificationType=void 0;Hye.ClassifyResponseClassificationsItemClassificationType={SingleLabel:"single-label",MultiLabel:"multi-label"}});var zLt=S(ULt=>{"use strict";Object.defineProperty(ULt,"__esModule",{value:!0})});var VLt=S(HLt=>{"use strict";Object.defineProperty(HLt,"__esModule",{value:!0})});var JLt=S(Vye=>{"use strict";Object.defineProperty(Vye,"__esModule",{value:!0});Vye.SummarizeRequestLength=void 0;Vye.SummarizeRequestLength={Short:"short",Medium:"medium",Long:"long"}});var KLt=S(Jye=>{"use strict";Object.defineProperty(Jye,"__esModule",{value:!0});Jye.SummarizeRequestFormat=void 0;Jye.SummarizeRequestFormat={Paragraph:"paragraph",Bullets:"bullets"}});var WLt=S(Kye=>{"use strict";Object.defineProperty(Kye,"__esModule",{value:!0});Kye.SummarizeRequestExtractiveness=void 0;Kye.SummarizeRequestExtractiveness={Low:"low",Medium:"medium",High:"high"}});var ZLt=S(GLt=>{"use strict";Object.defineProperty(GLt,"__esModule",{value:!0})});var YLt=S(XLt=>{"use strict";Object.defineProperty(XLt,"__esModule",{value:!0})});var eFt=S(QLt=>{"use strict";Object.defineProperty(QLt,"__esModule",{value:!0})});var rFt=S(tFt=>{"use strict";Object.defineProperty(tFt,"__esModule",{value:!0})});var oFt=S(nFt=>{"use strict";Object.defineProperty(nFt,"__esModule",{value:!0})});var aFt=S(iFt=>{"use strict";Object.defineProperty(iFt,"__esModule",{value:!0})});var uFt=S(sFt=>{"use strict";Object.defineProperty(sFt,"__esModule",{value:!0})});var cFt=S(lFt=>{"use strict";Object.defineProperty(lFt,"__esModule",{value:!0})});var fFt=S(dFt=>{"use strict";Object.defineProperty(dFt,"__esModule",{value:!0})});var mFt=S(pFt=>{"use strict";Object.defineProperty(pFt,"__esModule",{value:!0})});var gFt=S(hFt=>{"use strict";Object.defineProperty(hFt,"__esModule",{value:!0})});var bFt=S(yFt=>{"use strict";Object.defineProperty(yFt,"__esModule",{value:!0})});var vFt=S(_Ft=>{"use strict";Object.defineProperty(_Ft,"__esModule",{value:!0})});var SFt=S(wFt=>{"use strict";Object.defineProperty(wFt,"__esModule",{value:!0})});var xFt=S(CFt=>{"use strict";Object.defineProperty(CFt,"__esModule",{value:!0})});var TFt=S(OFt=>{"use strict";Object.defineProperty(OFt,"__esModule",{value:!0})});var EFt=S(Wye=>{"use strict";Object.defineProperty(Wye,"__esModule",{value:!0});Wye.ChatCitationType=void 0;Wye.ChatCitationType={TextContent:"TEXT_CONTENT",Plan:"PLAN"}});var MFt=S(PFt=>{"use strict";Object.defineProperty(PFt,"__esModule",{value:!0})});var AFt=S(RFt=>{"use strict";Object.defineProperty(RFt,"__esModule",{value:!0})});var NFt=S(IFt=>{"use strict";Object.defineProperty(IFt,"__esModule",{value:!0})});var DFt=S(jFt=>{"use strict";Object.defineProperty(jFt,"__esModule",{value:!0})});var $Ft=S(Gye=>{"use strict";Object.defineProperty(Gye,"__esModule",{value:!0});Gye.FinishReason=void 0;Gye.FinishReason={Complete:"COMPLETE",StopSequence:"STOP_SEQUENCE",Error:"ERROR",ErrorToxic:"ERROR_TOXIC",ErrorLimit:"ERROR_LIMIT",UserCancel:"USER_CANCEL",MaxTokens:"MAX_TOKENS"}});var FFt=S(LFt=>{"use strict";Object.defineProperty(LFt,"__esModule",{value:!0})});var qFt=S(kFt=>{"use strict";Object.defineProperty(kFt,"__esModule",{value:!0})});var UFt=S(BFt=>{"use strict";Object.defineProperty(BFt,"__esModule",{value:!0})});var HFt=S(zFt=>{"use strict";Object.defineProperty(zFt,"__esModule",{value:!0})});var JFt=S(VFt=>{"use strict";Object.defineProperty(VFt,"__esModule",{value:!0})});var WFt=S(KFt=>{"use strict";Object.defineProperty(KFt,"__esModule",{value:!0})});var ZFt=S(GFt=>{"use strict";Object.defineProperty(GFt,"__esModule",{value:!0})});var YFt=S(XFt=>{"use strict";Object.defineProperty(XFt,"__esModule",{value:!0})});var ekt=S(QFt=>{"use strict";Object.defineProperty(QFt,"__esModule",{value:!0})});var rkt=S(tkt=>{"use strict";Object.defineProperty(tkt,"__esModule",{value:!0})});var okt=S(nkt=>{"use strict";Object.defineProperty(nkt,"__esModule",{value:!0})});var ikt=S(Zye=>{"use strict";Object.defineProperty(Zye,"__esModule",{value:!0});Zye.ChatStreamEndEventFinishReason=void 0;Zye.ChatStreamEndEventFinishReason={Complete:"COMPLETE",ErrorLimit:"ERROR_LIMIT",MaxTokens:"MAX_TOKENS",Error:"ERROR",ErrorToxic:"ERROR_TOXIC"}});var skt=S(akt=>{"use strict";Object.defineProperty(akt,"__esModule",{value:!0})});var lkt=S(ukt=>{"use strict";Object.defineProperty(ukt,"__esModule",{value:!0})});var dkt=S(ckt=>{"use strict";Object.defineProperty(ckt,"__esModule",{value:!0})});var pkt=S(fkt=>{"use strict";Object.defineProperty(fkt,"__esModule",{value:!0})});var hkt=S(mkt=>{"use strict";Object.defineProperty(mkt,"__esModule",{value:!0})});var gkt=S(Xye=>{"use strict";Object.defineProperty(Xye,"__esModule",{value:!0});Xye.ImageUrlDetail=void 0;Xye.ImageUrlDetail={Auto:"auto",Low:"low",High:"high"}});var bkt=S(ykt=>{"use strict";Object.defineProperty(ykt,"__esModule",{value:!0})});var vkt=S(_kt=>{"use strict";Object.defineProperty(_kt,"__esModule",{value:!0})});var Skt=S(wkt=>{"use strict";Object.defineProperty(wkt,"__esModule",{value:!0})});var xkt=S(Ckt=>{"use strict";Object.defineProperty(Ckt,"__esModule",{value:!0})});var Tkt=S(Okt=>{"use strict";Object.defineProperty(Okt,"__esModule",{value:!0})});var Pkt=S(Ekt=>{"use strict";Object.defineProperty(Ekt,"__esModule",{value:!0})});var Rkt=S(Mkt=>{"use strict";Object.defineProperty(Mkt,"__esModule",{value:!0})});var Ikt=S(Akt=>{"use strict";Object.defineProperty(Akt,"__esModule",{value:!0})});var jkt=S(Nkt=>{"use strict";Object.defineProperty(Nkt,"__esModule",{value:!0})});var $kt=S(Dkt=>{"use strict";Object.defineProperty(Dkt,"__esModule",{value:!0})});var Fkt=S(Lkt=>{"use strict";Object.defineProperty(Lkt,"__esModule",{value:!0})});var kkt=S(Yye=>{"use strict";Object.defineProperty(Yye,"__esModule",{value:!0});Yye.CitationType=void 0;Yye.CitationType={TextContent:"TEXT_CONTENT",ThinkingContent:"THINKING_CONTENT",Plan:"PLAN"}});var Bkt=S(qkt=>{"use strict";Object.defineProperty(qkt,"__esModule",{value:!0})});var zkt=S(Ukt=>{"use strict";Object.defineProperty(Ukt,"__esModule",{value:!0})});var Vkt=S(Hkt=>{"use strict";Object.defineProperty(Hkt,"__esModule",{value:!0})});var Kkt=S(Jkt=>{"use strict";Object.defineProperty(Jkt,"__esModule",{value:!0})});var Gkt=S(Wkt=>{"use strict";Object.defineProperty(Wkt,"__esModule",{value:!0})});var Xkt=S(Zkt=>{"use strict";Object.defineProperty(Zkt,"__esModule",{value:!0})});var Qkt=S(Ykt=>{"use strict";Object.defineProperty(Ykt,"__esModule",{value:!0})});var tqt=S(eqt=>{"use strict";Object.defineProperty(eqt,"__esModule",{value:!0})});var nqt=S(rqt=>{"use strict";Object.defineProperty(rqt,"__esModule",{value:!0})});var iqt=S(oqt=>{"use strict";Object.defineProperty(oqt,"__esModule",{value:!0})});var sqt=S(aqt=>{"use strict";Object.defineProperty(aqt,"__esModule",{value:!0})});var lqt=S(uqt=>{"use strict";Object.defineProperty(uqt,"__esModule",{value:!0})});var dqt=S(cqt=>{"use strict";Object.defineProperty(cqt,"__esModule",{value:!0})});var pqt=S(fqt=>{"use strict";Object.defineProperty(fqt,"__esModule",{value:!0})});var hqt=S(mqt=>{"use strict";Object.defineProperty(mqt,"__esModule",{value:!0})});var yqt=S(gqt=>{"use strict";Object.defineProperty(gqt,"__esModule",{value:!0})});var bqt=S(Qye=>{"use strict";Object.defineProperty(Qye,"__esModule",{value:!0});Qye.CitationOptionsMode=void 0;Qye.CitationOptionsMode={Fast:"FAST",Accurate:"ACCURATE",Off:"OFF"}});var vqt=S(_qt=>{"use strict";Object.defineProperty(_qt,"__esModule",{value:!0})});var Sqt=S(wqt=>{"use strict";Object.defineProperty(wqt,"__esModule",{value:!0})});var xqt=S(Cqt=>{"use strict";Object.defineProperty(Cqt,"__esModule",{value:!0})});var Tqt=S(Oqt=>{"use strict";Object.defineProperty(Oqt,"__esModule",{value:!0})});var Eqt=S(ebe=>{"use strict";Object.defineProperty(ebe,"__esModule",{value:!0});ebe.ThinkingType=void 0;ebe.ThinkingType={Enabled:"enabled",Disabled:"disabled"}});var Mqt=S(Pqt=>{"use strict";Object.defineProperty(Pqt,"__esModule",{value:!0})});var Rqt=S(tbe=>{"use strict";Object.defineProperty(tbe,"__esModule",{value:!0});tbe.ChatFinishReason=void 0;tbe.ChatFinishReason={Complete:"COMPLETE",StopSequence:"STOP_SEQUENCE",MaxTokens:"MAX_TOKENS",ToolCall:"TOOL_CALL",Error:"ERROR"}});var Iqt=S(Aqt=>{"use strict";Object.defineProperty(Aqt,"__esModule",{value:!0})});var jqt=S(Nqt=>{"use strict";Object.defineProperty(Nqt,"__esModule",{value:!0})});var $qt=S(Dqt=>{"use strict";Object.defineProperty(Dqt,"__esModule",{value:!0})});var Fqt=S(Lqt=>{"use strict";Object.defineProperty(Lqt,"__esModule",{value:!0})});var qqt=S(kqt=>{"use strict";Object.defineProperty(kqt,"__esModule",{value:!0})});var Uqt=S(Bqt=>{"use strict";Object.defineProperty(Bqt,"__esModule",{value:!0})});var Hqt=S(zqt=>{"use strict";Object.defineProperty(zqt,"__esModule",{value:!0})});var Jqt=S(Vqt=>{"use strict";Object.defineProperty(Vqt,"__esModule",{value:!0})});var Wqt=S(Kqt=>{"use strict";Object.defineProperty(Kqt,"__esModule",{value:!0})});var Zqt=S(Gqt=>{"use strict";Object.defineProperty(Gqt,"__esModule",{value:!0})});var Xqt=S(rbe=>{"use strict";Object.defineProperty(rbe,"__esModule",{value:!0});rbe.ChatContentStartEventDeltaMessageContentType=void 0;rbe.ChatContentStartEventDeltaMessageContentType={Text:"text",Thinking:"thinking"}});var Qqt=S(Yqt=>{"use strict";Object.defineProperty(Yqt,"__esModule",{value:!0})});var tBt=S(eBt=>{"use strict";Object.defineProperty(eBt,"__esModule",{value:!0})});var nBt=S(rBt=>{"use strict";Object.defineProperty(rBt,"__esModule",{value:!0})});var iBt=S(oBt=>{"use strict";Object.defineProperty(oBt,"__esModule",{value:!0})});var sBt=S(aBt=>{"use strict";Object.defineProperty(aBt,"__esModule",{value:!0})});var lBt=S(uBt=>{"use strict";Object.defineProperty(uBt,"__esModule",{value:!0})});var dBt=S(cBt=>{"use strict";Object.defineProperty(cBt,"__esModule",{value:!0})});var pBt=S(fBt=>{"use strict";Object.defineProperty(fBt,"__esModule",{value:!0})});var hBt=S(mBt=>{"use strict";Object.defineProperty(mBt,"__esModule",{value:!0})});var yBt=S(gBt=>{"use strict";Object.defineProperty(gBt,"__esModule",{value:!0})});var _Bt=S(bBt=>{"use strict";Object.defineProperty(bBt,"__esModule",{value:!0})});var wBt=S(vBt=>{"use strict";Object.defineProperty(vBt,"__esModule",{value:!0})});var CBt=S(SBt=>{"use strict";Object.defineProperty(SBt,"__esModule",{value:!0})});var OBt=S(xBt=>{"use strict";Object.defineProperty(xBt,"__esModule",{value:!0})});var EBt=S(TBt=>{"use strict";Object.defineProperty(TBt,"__esModule",{value:!0})});var MBt=S(PBt=>{"use strict";Object.defineProperty(PBt,"__esModule",{value:!0})});var ABt=S(RBt=>{"use strict";Object.defineProperty(RBt,"__esModule",{value:!0})});var NBt=S(IBt=>{"use strict";Object.defineProperty(IBt,"__esModule",{value:!0})});var DBt=S(jBt=>{"use strict";Object.defineProperty(jBt,"__esModule",{value:!0})});var LBt=S($Bt=>{"use strict";Object.defineProperty($Bt,"__esModule",{value:!0})});var kBt=S(FBt=>{"use strict";Object.defineProperty(FBt,"__esModule",{value:!0})});var BBt=S(qBt=>{"use strict";Object.defineProperty(qBt,"__esModule",{value:!0})});var zBt=S(UBt=>{"use strict";Object.defineProperty(UBt,"__esModule",{value:!0})});var VBt=S(HBt=>{"use strict";Object.defineProperty(HBt,"__esModule",{value:!0})});var KBt=S(JBt=>{"use strict";Object.defineProperty(JBt,"__esModule",{value:!0})});var GBt=S(WBt=>{"use strict";Object.defineProperty(WBt,"__esModule",{value:!0})});var XBt=S(ZBt=>{"use strict";Object.defineProperty(ZBt,"__esModule",{value:!0})});var QBt=S(YBt=>{"use strict";Object.defineProperty(YBt,"__esModule",{value:!0})});var tUt=S(eUt=>{"use strict";Object.defineProperty(eUt,"__esModule",{value:!0})});var nUt=S(rUt=>{"use strict";Object.defineProperty(rUt,"__esModule",{value:!0})});var iUt=S(oUt=>{"use strict";Object.defineProperty(oUt,"__esModule",{value:!0})});var sUt=S(aUt=>{"use strict";Object.defineProperty(aUt,"__esModule",{value:!0})});var lUt=S(uUt=>{"use strict";Object.defineProperty(uUt,"__esModule",{value:!0})});var dUt=S(cUt=>{"use strict";Object.defineProperty(cUt,"__esModule",{value:!0})});var pUt=S(fUt=>{"use strict";Object.defineProperty(fUt,"__esModule",{value:!0})});var mUt=S(nbe=>{"use strict";Object.defineProperty(nbe,"__esModule",{value:!0});nbe.EmbedInputType=void 0;nbe.EmbedInputType={SearchDocument:"search_document",SearchQuery:"search_query",Classification:"classification",Clustering:"clustering",Image:"image"}});var hUt=S(obe=>{"use strict";Object.defineProperty(obe,"__esModule",{value:!0});obe.EmbeddingType=void 0;obe.EmbeddingType={Float:"float",Int8:"int8",Uint8:"uint8",Binary:"binary",Ubinary:"ubinary",Base64:"base64"}});var yUt=S(gUt=>{"use strict";Object.defineProperty(gUt,"__esModule",{value:!0})});var _Ut=S(bUt=>{"use strict";Object.defineProperty(bUt,"__esModule",{value:!0})});var wUt=S(vUt=>{"use strict";Object.defineProperty(vUt,"__esModule",{value:!0})});var CUt=S(SUt=>{"use strict";Object.defineProperty(SUt,"__esModule",{value:!0})});var OUt=S(xUt=>{"use strict";Object.defineProperty(xUt,"__esModule",{value:!0})});var EUt=S(TUt=>{"use strict";Object.defineProperty(TUt,"__esModule",{value:!0})});var MUt=S(PUt=>{"use strict";Object.defineProperty(PUt,"__esModule",{value:!0})});var AUt=S(RUt=>{"use strict";Object.defineProperty(RUt,"__esModule",{value:!0})});var NUt=S(IUt=>{"use strict";Object.defineProperty(IUt,"__esModule",{value:!0})});var jUt=S(ibe=>{"use strict";Object.defineProperty(ibe,"__esModule",{value:!0});ibe.EmbedJobStatus=void 0;ibe.EmbedJobStatus={Processing:"processing",Complete:"complete",Cancelling:"cancelling",Cancelled:"cancelled",Failed:"failed"}});var DUt=S(abe=>{"use strict";Object.defineProperty(abe,"__esModule",{value:!0});abe.EmbedJobTruncate=void 0;abe.EmbedJobTruncate={Start:"START",End:"END"}});var LUt=S($Ut=>{"use strict";Object.defineProperty($Ut,"__esModule",{value:!0})});var kUt=S(FUt=>{"use strict";Object.defineProperty(FUt,"__esModule",{value:!0})});var BUt=S(qUt=>{"use strict";Object.defineProperty(qUt,"__esModule",{value:!0})});var zUt=S(UUt=>{"use strict";Object.defineProperty(UUt,"__esModule",{value:!0})});var VUt=S(HUt=>{"use strict";Object.defineProperty(HUt,"__esModule",{value:!0})});var JUt=S(sbe=>{"use strict";Object.defineProperty(sbe,"__esModule",{value:!0});sbe.DatasetValidationStatus=void 0;sbe.DatasetValidationStatus={Unknown:"unknown",Queued:"queued",Processing:"processing",Failed:"failed",Validated:"validated",Skipped:"skipped"}});var KUt=S(ube=>{"use strict";Object.defineProperty(ube,"__esModule",{value:!0});ube.DatasetType=void 0;ube.DatasetType={EmbedInput:"embed-input",EmbedResult:"embed-result",ClusterResult:"cluster-result",ClusterOutliers:"cluster-outliers",RerankerFinetuneInput:"reranker-finetune-input",SingleLabelClassificationFinetuneInput:"single-label-classification-finetune-input",ChatFinetuneInput:"chat-finetune-input",MultiLabelClassificationFinetuneInput:"multi-label-classification-finetune-input"}});var GUt=S(WUt=>{"use strict";Object.defineProperty(WUt,"__esModule",{value:!0})});var XUt=S(ZUt=>{"use strict";Object.defineProperty(ZUt,"__esModule",{value:!0})});var QUt=S(YUt=>{"use strict";Object.defineProperty(YUt,"__esModule",{value:!0})});var tzt=S(ezt=>{"use strict";Object.defineProperty(ezt,"__esModule",{value:!0})});var nzt=S(rzt=>{"use strict";Object.defineProperty(rzt,"__esModule",{value:!0})});var izt=S(ozt=>{"use strict";Object.defineProperty(ozt,"__esModule",{value:!0})});var szt=S(azt=>{"use strict";Object.defineProperty(azt,"__esModule",{value:!0})});var lzt=S(uzt=>{"use strict";Object.defineProperty(uzt,"__esModule",{value:!0})});var dzt=S(czt=>{"use strict";Object.defineProperty(czt,"__esModule",{value:!0})});var pzt=S(fzt=>{"use strict";Object.defineProperty(fzt,"__esModule",{value:!0})});var mzt=S(lbe=>{"use strict";Object.defineProperty(lbe,"__esModule",{value:!0});lbe.ConnectorAuthStatus=void 0;lbe.ConnectorAuthStatus={Valid:"valid",Expired:"expired"}});var gzt=S(hzt=>{"use strict";Object.defineProperty(hzt,"__esModule",{value:!0})});var bzt=S(yzt=>{"use strict";Object.defineProperty(yzt,"__esModule",{value:!0})});var vzt=S(_zt=>{"use strict";Object.defineProperty(_zt,"__esModule",{value:!0})});var wzt=S(cbe=>{"use strict";Object.defineProperty(cbe,"__esModule",{value:!0});cbe.AuthTokenType=void 0;cbe.AuthTokenType={Bearer:"bearer",Basic:"basic",Noscheme:"noscheme"}});var Czt=S(Szt=>{"use strict";Object.defineProperty(Szt,"__esModule",{value:!0})});var Ozt=S(xzt=>{"use strict";Object.defineProperty(xzt,"__esModule",{value:!0})});var Ezt=S(Tzt=>{"use strict";Object.defineProperty(Tzt,"__esModule",{value:!0})});var Mzt=S(Pzt=>{"use strict";Object.defineProperty(Pzt,"__esModule",{value:!0})});var Azt=S(Rzt=>{"use strict";Object.defineProperty(Rzt,"__esModule",{value:!0})});var Nzt=S(Izt=>{"use strict";Object.defineProperty(Izt,"__esModule",{value:!0})});var jzt=S(dbe=>{"use strict";Object.defineProperty(dbe,"__esModule",{value:!0});dbe.CompatibleEndpoint=void 0;dbe.CompatibleEndpoint={Chat:"chat",Embed:"embed",Classify:"classify",Summarize:"summarize",Rerank:"rerank",Rate:"rate",Generate:"generate"}});var $zt=S(Dzt=>{"use strict";Object.defineProperty(Dzt,"__esModule",{value:!0})});var Fzt=S(Lzt=>{"use strict";Object.defineProperty(Lzt,"__esModule",{value:!0})});var kzt=S(de=>{"use strict";var Fvn=de&&de.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),he=de&&de.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Fvn(e,t,r)};Object.defineProperty(de,"__esModule",{value:!0});he(lLt(),de);he(cLt(),de);he(dLt(),de);he(pLt(),de);he(mLt(),de);he(hLt(),de);he(gLt(),de);he(bLt(),de);he(_Lt(),de);he(vLt(),de);he(SLt(),de);he(CLt(),de);he(xLt(),de);he(TLt(),de);he(ELt(),de);he(MLt(),de);he(ALt(),de);he(NLt(),de);he(DLt(),de);he(LLt(),de);he(FLt(),de);he(qLt(),de);he(BLt(),de);he(zLt(),de);he(VLt(),de);he(JLt(),de);he(KLt(),de);he(WLt(),de);he(ZLt(),de);he(YLt(),de);he(eFt(),de);he(rFt(),de);he(oFt(),de);he(aFt(),de);he(uFt(),de);he(cFt(),de);he(fFt(),de);he(mFt(),de);he(gFt(),de);he(bFt(),de);he(vFt(),de);he(SFt(),de);he(xFt(),de);he(TFt(),de);he(EFt(),de);he(MFt(),de);he(AFt(),de);he(NFt(),de);he(DFt(),de);he($Ft(),de);he(FFt(),de);he(qFt(),de);he(UFt(),de);he(HFt(),de);he(JFt(),de);he(WFt(),de);he(ZFt(),de);he(YFt(),de);he(ekt(),de);he(rkt(),de);he(okt(),de);he(ikt(),de);he(skt(),de);he(lkt(),de);he(dkt(),de);he(pkt(),de);he(hkt(),de);he(gkt(),de);he(bkt(),de);he(vkt(),de);he(Skt(),de);he(xkt(),de);he(Tkt(),de);he(Pkt(),de);he(Rkt(),de);he(Ikt(),de);he(jkt(),de);he($kt(),de);he(Fkt(),de);he(kkt(),de);he(Bkt(),de);he(zkt(),de);he(Vkt(),de);he(Kkt(),de);he(Gkt(),de);he(Xkt(),de);he(Qkt(),de);he(tqt(),de);he(nqt(),de);he(iqt(),de);he(sqt(),de);he(lqt(),de);he(dqt(),de);he(pqt(),de);he(hqt(),de);he(yqt(),de);he(bqt(),de);he(vqt(),de);he(Sqt(),de);he(xqt(),de);he(Tqt(),de);he(Eqt(),de);he(Mqt(),de);he(Rqt(),de);he(Iqt(),de);he(jqt(),de);he($qt(),de);he(Fqt(),de);he(qqt(),de);he(Uqt(),de);he(Hqt(),de);he(Jqt(),de);he(Wqt(),de);he(Zqt(),de);he(Xqt(),de);he(Qqt(),de);he(tBt(),de);he(nBt(),de);he(iBt(),de);he(sBt(),de);he(lBt(),de);he(dBt(),de);he(pBt(),de);he(hBt(),de);he(yBt(),de);he(_Bt(),de);he(wBt(),de);he(CBt(),de);he(OBt(),de);he(EBt(),de);he(MBt(),de);he(ABt(),de);he(NBt(),de);he(DBt(),de);he(LBt(),de);he(kBt(),de);he(BBt(),de);he(zBt(),de);he(VBt(),de);he(KBt(),de);he(GBt(),de);he(XBt(),de);he(QBt(),de);he(tUt(),de);he(nUt(),de);he(iUt(),de);he(sUt(),de);he(lUt(),de);he(dUt(),de);he(pUt(),de);he(mUt(),de);he(hUt(),de);he(yUt(),de);he(_Ut(),de);he(wUt(),de);he(CUt(),de);he(OUt(),de);he(EUt(),de);he(MUt(),de);he(AUt(),de);he(NUt(),de);he(jUt(),de);he(DUt(),de);he(LUt(),de);he(kUt(),de);he(BUt(),de);he(zUt(),de);he(VUt(),de);he(JUt(),de);he(KUt(),de);he(GUt(),de);he(XUt(),de);he(QUt(),de);he(tzt(),de);he(nzt(),de);he(izt(),de);he(szt(),de);he(lzt(),de);he(dzt(),de);he(pzt(),de);he(mzt(),de);he(gzt(),de);he(bzt(),de);he(vzt(),de);he(wzt(),de);he(Czt(),de);he(Ozt(),de);he(Ezt(),de);he(Mzt(),de);he(Azt(),de);he(Nzt(),de);he(jzt(),de);he($zt(),de);he(Fzt(),de)});var fbe=S(Lte=>{"use strict";Object.defineProperty(Lte,"__esModule",{value:!0});Lte.toJson=void 0;Lte.fromJson=qvn;var kvn=(t,e,r)=>JSON.stringify(t,e,r);Lte.toJson=kvn;function qvn(t,e){return JSON.parse(t,e)}});var qzt=S(pbe=>{"use strict";Object.defineProperty(pbe,"__esModule",{value:!0});pbe.CohereError=void 0;var Bvn=fbe(),LJe=class t extends Error{constructor({message:e,statusCode:r,body:n,rawResponse:o}){super(Uvn({message:e,statusCode:r,body:n})),Object.setPrototypeOf(this,t.prototype),this.statusCode=r,this.body=n,this.rawResponse=o}};pbe.CohereError=LJe;function Uvn({message:t,statusCode:e,body:r}){let n=[];return t!=null&&n.push(t),e!=null&&n.push(`Status code: ${e.toString()}`),r!=null&&n.push(`Body: ${(0,Bvn.toJson)(r,void 0,2)}`),n.join(` +`)}});var Bzt=S(mbe=>{"use strict";Object.defineProperty(mbe,"__esModule",{value:!0});mbe.CohereTimeoutError=void 0;var FJe=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};mbe.CohereTimeoutError=FJe});var Oc=S(q5=>{"use strict";Object.defineProperty(q5,"__esModule",{value:!0});q5.CohereTimeoutError=q5.CohereError=void 0;var zvn=qzt();Object.defineProperty(q5,"CohereError",{enumerable:!0,get:function(){return zvn.CohereError}});var Hvn=Bzt();Object.defineProperty(q5,"CohereTimeoutError",{enumerable:!0,get:function(){return Hvn.CohereTimeoutError}})});var Uzt=S(BO=>{"use strict";var Vvn=BO&&BO.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Jvn=BO&&BO.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Kvn=BO&&BO.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Gvn=UO&&UO.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Zvn=UO&&UO.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Xvn=UO&&UO.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Qvn=zO&&zO.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ewn=zO&&zO.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),twn=zO&&zO.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var nwn=HO&&HO.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),own=HO&&HO.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),iwn=HO&&HO.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var swn=VO&&VO.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),uwn=VO&&VO.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),lwn=VO&&VO.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var dwn=JO&&JO.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),fwn=JO&&JO.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pwn=JO&&JO.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var hwn=KO&&KO.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),gwn=KO&&KO.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ywn=KO&&KO.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var _wn=WO&&WO.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),vwn=WO&&WO.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),wwn=WO&&WO.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Cwn=GO&&GO.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),xwn=GO&&GO.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Own=GO&&GO.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Ewn=ZO&&ZO.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Pwn=ZO&&ZO.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Mwn=ZO&&ZO.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Awn=XO&&XO.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Iwn=XO&&XO.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Nwn=XO&&XO.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Dwn=YO&&YO.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),$wn=YO&&YO.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Lwn=YO&&YO.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var kwn=fh&&fh.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),dS=fh&&fh.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kwn(e,t,r)};Object.defineProperty(fh,"__esModule",{value:!0});dS(Uzt(),fh);dS(zzt(),fh);dS(Hzt(),fh);dS(Vzt(),fh);dS(Jzt(),fh);dS(Kzt(),fh);dS(Wzt(),fh);dS(Gzt(),fh);dS(Zzt(),fh);dS(Xzt(),fh);dS(Yzt(),fh);dS(Qzt(),fh)});var r4t=S(t4t=>{"use strict";Object.defineProperty(t4t,"__esModule",{value:!0})});var n4t=S(x4=>{"use strict";var qwn=x4&&x4.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Bwn=x4&&x4.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&qwn(e,t,r)};Object.defineProperty(x4,"__esModule",{value:!0});Bwn(r4t(),x4)});var GN=S(QO=>{"use strict";var Uwn=QO&&QO.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),hbe=QO&&QO.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Uwn(e,t,r)};Object.defineProperty(QO,"__esModule",{value:!0});hbe(uLt(),QO);hbe(kzt(),QO);hbe(e4t(),QO);hbe(n4t(),QO)});var QJe={};Jn(QJe,{__addDisposableResource:()=>x4t,__assign:()=>gbe,__asyncDelegator:()=>g4t,__asyncGenerator:()=>h4t,__asyncValues:()=>y4t,__await:()=>B5,__awaiter:()=>l4t,__classPrivateFieldGet:()=>w4t,__classPrivateFieldIn:()=>C4t,__classPrivateFieldSet:()=>S4t,__createBinding:()=>bbe,__decorate:()=>a4t,__disposeResources:()=>O4t,__esDecorate:()=>zwn,__exportStar:()=>d4t,__extends:()=>o4t,__generator:()=>c4t,__importDefault:()=>v4t,__importStar:()=>_4t,__makeTemplateObject:()=>b4t,__metadata:()=>u4t,__param:()=>s4t,__propKey:()=>Vwn,__read:()=>YJe,__rest:()=>i4t,__runInitializers:()=>Hwn,__setFunctionName:()=>Jwn,__spread:()=>f4t,__spreadArray:()=>m4t,__spreadArrays:()=>p4t,__values:()=>ybe,default:()=>Gwn});function o4t(t,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");XJe(t,e);function r(){this.constructor=t}t.prototype=e===null?Object.create(e):(r.prototype=e.prototype,new r)}function i4t(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);o=0;s--)(a=t[s])&&(i=(o<3?a(i):o>3?a(e,r,i):a(e,r))||i);return o>3&&i&&Object.defineProperty(e,r,i),i}function s4t(t,e){return function(r,n){e(r,n,t)}}function zwn(t,e,r,n,o,i){function a(y){if(y!==void 0&&typeof y!="function")throw new TypeError("Function expected");return y}for(var s=n.kind,u=s==="getter"?"get":s==="setter"?"set":"value",l=!e&&t?n.static?t:t.prototype:null,c=e||(l?Object.getOwnPropertyDescriptor(l,n.name):{}),d,f=!1,p=r.length-1;p>=0;p--){var m={};for(var h in n)m[h]=h==="access"?{}:n[h];for(var h in n.access)m.access[h]=n.access[h];m.addInitializer=function(y){if(f)throw new TypeError("Cannot add initializers after decoration has completed");i.push(a(y||null))};var g=(0,r[p])(s==="accessor"?{get:c.get,set:c.set}:c[u],m);if(s==="accessor"){if(g===void 0)continue;if(g===null||typeof g!="object")throw new TypeError("Object expected");(d=a(g.get))&&(c.get=d),(d=a(g.set))&&(c.set=d),(d=a(g.init))&&o.unshift(d)}else(d=a(g))&&(s==="field"?o.unshift(d):c[u]=d)}l&&Object.defineProperty(l,n.name,c),f=!0}function Hwn(t,e,r){for(var n=arguments.length>2,o=0;o0&&i[i.length-1])&&(l[0]===6||l[0]===2)){r=0;continue}if(l[0]===3&&(!i||l[1]>i[0]&&l[1]=t.length&&(t=void 0),{value:t&&t[n++],done:!t}}};throw new TypeError(e?"Object is not iterable.":"Symbol.iterator is not defined.")}function YJe(t,e){var r=typeof Symbol=="function"&&t[Symbol.iterator];if(!r)return t;var n=r.call(t),o,i=[],a;try{for(;(e===void 0||e-- >0)&&!(o=n.next()).done;)i.push(o.value)}catch(s){a={error:s}}finally{try{o&&!o.done&&(r=n.return)&&r.call(n)}finally{if(a)throw a.error}}return i}function f4t(){for(var t=[],e=0;e1||u(p,h)})},m&&(o[p]=m(o[p])))}function u(p,m){try{l(n[p](m))}catch(h){f(i[0][3],h)}}function l(p){p.value instanceof B5?Promise.resolve(p.value.v).then(c,d):f(i[0][2],p)}function c(p){u("next",p)}function d(p){u("throw",p)}function f(p,m){p(m),i.shift(),i.length&&u(i[0][0],i[0][1])}}function g4t(t){var e,r;return e={},n("next"),n("throw",function(o){throw o}),n("return"),e[Symbol.iterator]=function(){return this},e;function n(o,i){e[o]=t[o]?function(a){return(r=!r)?{value:B5(t[o](a)),done:!1}:i?i(a):a}:i}}function y4t(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof ybe=="function"?ybe(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(a){return new Promise(function(s,u){a=t[i](a),o(s,u,a.done,a.value)})}}function o(i,a,s,u){Promise.resolve(u).then(function(l){i({value:l,done:s})},a)}}function b4t(t,e){return Object.defineProperty?Object.defineProperty(t,"raw",{value:e}):t.raw=e,t}function _4t(t){if(t&&t.__esModule)return t;var e={};if(t!=null)for(var r in t)r!=="default"&&Object.prototype.hasOwnProperty.call(t,r)&&bbe(e,t,r);return Kwn(e,t),e}function v4t(t){return t&&t.__esModule?t:{default:t}}function w4t(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}function S4t(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r}function C4t(t,e){if(e===null||typeof e!="object"&&typeof e!="function")throw new TypeError("Cannot use 'in' operator on non-object");return typeof t=="function"?e===t:t.has(e)}function x4t(t,e,r){if(e!=null){if(typeof e!="object"&&typeof e!="function")throw new TypeError("Object expected.");var n,o;if(r){if(!Symbol.asyncDispose)throw new TypeError("Symbol.asyncDispose is not defined.");n=e[Symbol.asyncDispose]}if(n===void 0){if(!Symbol.dispose)throw new TypeError("Symbol.dispose is not defined.");n=e[Symbol.dispose],r&&(o=n)}if(typeof n!="function")throw new TypeError("Object not disposable.");o&&(n=function(){try{o.call(this)}catch(i){return Promise.reject(i)}}),t.stack.push({value:e,dispose:n,async:r})}else r&&t.stack.push({async:!0});return e}function O4t(t){function e(i){t.error=t.hasError?new Wwn(i,t.error,"An error was suppressed during disposal."):i,t.hasError=!0}var r,n=0;function o(){for(;r=t.stack.pop();)try{if(!r.async&&n===1)return n=0,t.stack.push(r),Promise.resolve().then(o);if(r.dispose){var i=r.dispose.call(r.value);if(r.async)return n|=2,Promise.resolve(i).then(o,function(a){return e(a),o()})}else n|=1}catch(a){e(a)}if(n===1)return t.hasError?Promise.reject(t.error):Promise.resolve();if(t.hasError)throw t.error}return o()}var XJe,gbe,bbe,Kwn,Wwn,Gwn,e3e=v(()=>{XJe=function(t,e){return XJe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var o in n)Object.prototype.hasOwnProperty.call(n,o)&&(r[o]=n[o])},XJe(t,e)};gbe=function(){return gbe=Object.assign||function(e){for(var r,n=1,o=arguments.length;n{"use strict";Object.defineProperty(fS,"__esModule",{value:!0});fS.MAX_HASHABLE_LENGTH=fS.INIT=fS.KEY=fS.DIGEST_LENGTH=fS.BLOCK_SIZE=void 0;fS.BLOCK_SIZE=64;fS.DIGEST_LENGTH=32;fS.KEY=new Uint32Array([1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298]);fS.INIT=[1779033703,3144134277,1013904242,2773480762,1359893119,2600822924,528734635,1541459225];fS.MAX_HASHABLE_LENGTH=Math.pow(2,53)-1});var T4t=S(_be=>{"use strict";Object.defineProperty(_be,"__esModule",{value:!0});_be.RawSha256=void 0;var pS=t3e(),Zwn=function(){function t(){this.state=Int32Array.from(pS.INIT),this.temp=new Int32Array(64),this.buffer=new Uint8Array(64),this.bufferLength=0,this.bytesHashed=0,this.finished=!1}return t.prototype.update=function(e){if(this.finished)throw new Error("Attempted to update an already finished hash.");var r=0,n=e.byteLength;if(this.bytesHashed+=n,this.bytesHashed*8>pS.MAX_HASHABLE_LENGTH)throw new Error("Cannot hash more than 2^53 - 1 bits");for(;n>0;)this.buffer[this.bufferLength++]=e[r++],n--,this.bufferLength===pS.BLOCK_SIZE&&(this.hashBuffer(),this.bufferLength=0)},t.prototype.digest=function(){if(!this.finished){var e=this.bytesHashed*8,r=new DataView(this.buffer.buffer,this.buffer.byteOffset,this.buffer.byteLength),n=this.bufferLength;if(r.setUint8(this.bufferLength++,128),n%pS.BLOCK_SIZE>=pS.BLOCK_SIZE-8){for(var o=this.bufferLength;o>>24&255,i[o*4+1]=this.state[o]>>>16&255,i[o*4+2]=this.state[o]>>>8&255,i[o*4+3]=this.state[o]>>>0&255;return i},t.prototype.hashBuffer=function(){for(var e=this,r=e.buffer,n=e.state,o=n[0],i=n[1],a=n[2],s=n[3],u=n[4],l=n[5],c=n[6],d=n[7],f=0;f>>17|p<<15)^(p>>>19|p<<13)^p>>>10;p=this.temp[f-15];var h=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3;this.temp[f]=(m+this.temp[f-7]|0)+(h+this.temp[f-16]|0)}var g=(((u>>>6|u<<26)^(u>>>11|u<<21)^(u>>>25|u<<7))+(u&l^~u&c)|0)+(d+(pS.KEY[f]+this.temp[f]|0)|0)|0,y=((o>>>2|o<<30)^(o>>>13|o<<19)^(o>>>22|o<<10))+(o&i^o&a^i&a)|0;d=c,c=l,l=u,u=s+g|0,s=a,a=i,i=o,o=g+y|0}n[0]+=o,n[1]+=i,n[2]+=a,n[3]+=s,n[4]+=u,n[5]+=l,n[6]+=c,n[7]+=d},t}();_be.RawSha256=Zwn});var M4t=S((NBi,P4t)=>{var vbe=Object.defineProperty,Xwn=Object.getOwnPropertyDescriptor,Ywn=Object.getOwnPropertyNames,Qwn=Object.prototype.hasOwnProperty,eSn=(t,e)=>vbe(t,"name",{value:e,configurable:!0}),tSn=(t,e)=>{for(var r in e)vbe(t,r,{get:e[r],enumerable:!0})},rSn=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ywn(e))!Qwn.call(t,o)&&o!==r&&vbe(t,o,{get:()=>e[o],enumerable:!(n=Xwn(e,o))||n.enumerable});return t},nSn=t=>rSn(vbe({},"__esModule",{value:!0}),t),E4t={};tSn(E4t,{isArrayBuffer:()=>oSn});P4t.exports=nSn(E4t);var oSn=eSn(t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]","isArrayBuffer")});var N4t=S((jBi,I4t)=>{var wbe=Object.defineProperty,iSn=Object.getOwnPropertyDescriptor,aSn=Object.getOwnPropertyNames,sSn=Object.prototype.hasOwnProperty,R4t=(t,e)=>wbe(t,"name",{value:e,configurable:!0}),uSn=(t,e)=>{for(var r in e)wbe(t,r,{get:e[r],enumerable:!0})},lSn=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of aSn(e))!sSn.call(t,o)&&o!==r&&wbe(t,o,{get:()=>e[o],enumerable:!(n=iSn(e,o))||n.enumerable});return t},cSn=t=>lSn(wbe({},"__esModule",{value:!0}),t),A4t={};uSn(A4t,{fromArrayBuffer:()=>fSn,fromString:()=>pSn});I4t.exports=cSn(A4t);var dSn=M4t(),r3e=rS(),fSn=R4t((t,e=0,r=t.byteLength-e)=>{if(!(0,dSn.isArrayBuffer)(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return r3e.Buffer.from(t,e,r)},"fromArrayBuffer"),pSn=R4t((t,e)=>{if(typeof t!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?r3e.Buffer.from(t,e):r3e.Buffer.from(t)},"fromString")});var F4t=S((DBi,L4t)=>{var Sbe=Object.defineProperty,mSn=Object.getOwnPropertyDescriptor,hSn=Object.getOwnPropertyNames,gSn=Object.prototype.hasOwnProperty,n3e=(t,e)=>Sbe(t,"name",{value:e,configurable:!0}),ySn=(t,e)=>{for(var r in e)Sbe(t,r,{get:e[r],enumerable:!0})},bSn=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of hSn(e))!gSn.call(t,o)&&o!==r&&Sbe(t,o,{get:()=>e[o],enumerable:!(n=mSn(e,o))||n.enumerable});return t},_Sn=t=>bSn(Sbe({},"__esModule",{value:!0}),t),j4t={};ySn(j4t,{fromUtf8:()=>$4t,toUint8Array:()=>vSn,toUtf8:()=>wSn});L4t.exports=_Sn(j4t);var D4t=N4t(),$4t=n3e(t=>{let e=(0,D4t.fromString)(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)},"fromUtf8"),vSn=n3e(t=>typeof t=="string"?$4t(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t),"toUint8Array"),wSn=n3e(t=>{if(typeof t=="string")return t;if(typeof t!="object"||typeof t.byteOffset!="number"||typeof t.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return(0,D4t.fromArrayBuffer)(t.buffer,t.byteOffset,t.byteLength).toString("utf8")},"toUtf8")});var k4t=S(Cbe=>{"use strict";Object.defineProperty(Cbe,"__esModule",{value:!0});Cbe.convertToBuffer=void 0;var SSn=F4t(),CSn=typeof Buffer<"u"&&Buffer.from?function(t){return Buffer.from(t,"utf8")}:SSn.fromUtf8;function xSn(t){return t instanceof Uint8Array?t:typeof t=="string"?CSn(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)}Cbe.convertToBuffer=xSn});var q4t=S(xbe=>{"use strict";Object.defineProperty(xbe,"__esModule",{value:!0});xbe.isEmptyData=void 0;function OSn(t){return typeof t=="string"?t.length===0:t.byteLength===0}xbe.isEmptyData=OSn});var B4t=S(Obe=>{"use strict";Object.defineProperty(Obe,"__esModule",{value:!0});Obe.numToUint8=void 0;function TSn(t){return new Uint8Array([(t&4278190080)>>24,(t&16711680)>>16,(t&65280)>>8,t&255])}Obe.numToUint8=TSn});var U4t=S(Tbe=>{"use strict";Object.defineProperty(Tbe,"__esModule",{value:!0});Tbe.uint32ArrayFrom=void 0;function ESn(t){if(!Uint32Array.from){for(var e=new Uint32Array(t.length),r=0;r{"use strict";Object.defineProperty(eT,"__esModule",{value:!0});eT.uint32ArrayFrom=eT.numToUint8=eT.isEmptyData=eT.convertToBuffer=void 0;var PSn=k4t();Object.defineProperty(eT,"convertToBuffer",{enumerable:!0,get:function(){return PSn.convertToBuffer}});var MSn=q4t();Object.defineProperty(eT,"isEmptyData",{enumerable:!0,get:function(){return MSn.isEmptyData}});var RSn=B4t();Object.defineProperty(eT,"numToUint8",{enumerable:!0,get:function(){return RSn.numToUint8}});var ASn=U4t();Object.defineProperty(eT,"uint32ArrayFrom",{enumerable:!0,get:function(){return ASn.uint32ArrayFrom}})});var H4t=S(Rbe=>{"use strict";Object.defineProperty(Rbe,"__esModule",{value:!0});Rbe.Sha256=void 0;var z4t=(e3e(),Pfe(QJe)),Mbe=t3e(),Pbe=T4t(),o3e=Ebe(),ISn=function(){function t(e){this.secret=e,this.hash=new Pbe.RawSha256,this.reset()}return t.prototype.update=function(e){if(!((0,o3e.isEmptyData)(e)||this.error))try{this.hash.update((0,o3e.convertToBuffer)(e))}catch(r){this.error=r}},t.prototype.digestSync=function(){if(this.error)throw this.error;return this.outer?(this.outer.finished||this.outer.update(this.hash.digest()),this.outer.digest()):this.hash.digest()},t.prototype.digest=function(){return z4t.__awaiter(this,void 0,void 0,function(){return z4t.__generator(this,function(e){return[2,this.digestSync()]})})},t.prototype.reset=function(){if(this.hash=new Pbe.RawSha256,this.secret){this.outer=new Pbe.RawSha256;var e=NSn(this.secret),r=new Uint8Array(Mbe.BLOCK_SIZE);r.set(e);for(var n=0;nMbe.BLOCK_SIZE){var r=new Pbe.RawSha256;r.update(e),e=r.digest()}var n=new Uint8Array(Mbe.BLOCK_SIZE);return n.set(e),n}});var a3e=S(i3e=>{"use strict";Object.defineProperty(i3e,"__esModule",{value:!0});var jSn=(e3e(),Pfe(QJe));jSn.__exportStar(H4t(),i3e)});var V4t=v(()=>{});var J4t=v(()=>{});var K4t=v(()=>{});var O4,Fte=v(()=>{O4=class t extends Error{constructor(e,r=!0){let n,o=!0;typeof r=="boolean"?(n=void 0,o=r):r!=null&&typeof r=="object"&&(n=r.logger,o=r.tryNextLink??!0),super(e),this.name="ProviderError",this.tryNextLink=o,Object.setPrototypeOf(this,t.prototype),n?.debug?.(`@smithy/property-provider ${o?"->":"(!)"} ${e}`)}static from(e,r=!0){return Object.assign(new this(e.message,r),e)}}});var xm,W4t=v(()=>{Fte();xm=class t extends O4{constructor(e,r=!0){super(e,r),this.name="CredentialsProviderError",Object.setPrototypeOf(this,t.prototype)}}});var G4t=v(()=>{Fte()});var Z4t=v(()=>{Fte()});var X4t=v(()=>{});var Y4t,Q4t=v(()=>{Y4t=(t,e,r)=>{let n,o,i,a=!1,s=async()=>{o||(o=t());try{n=await o,i=!0,a=!1}finally{o=void 0}return n};return e===void 0?async u=>((!i||u?.forceRefresh)&&(n=await s()),n):async u=>((!i||u?.forceRefresh)&&(n=await s()),a?n:r&&!r(n)?(a=!0,n):(e(n)&&await s(),n))}});var ZN=v(()=>{W4t();Fte();G4t();Z4t();X4t();Q4t()});function Abe(t){return Promise.all(Object.keys(t).reduce((e,r)=>{let n=t[r];return typeof n=="string"?e.push([r,n]):e.push(n().then(o=>[r,o])),e},[])).then(e=>e.reduce((r,[n,o])=>(r[n]=o,r),{}))}var s3e=v(()=>{});var e2t=v(()=>{});var t2t=v(()=>{e2t()});var r2t=v(()=>{});var n2t,o2t=v(()=>{(function(t){t.HEADER="header",t.QUERY="query"})(n2t||(n2t={}))});var u3e,i2t=v(()=>{(function(t){t.HEADER="header",t.QUERY="query"})(u3e||(u3e={}))});var a2t=v(()=>{});var s2t=v(()=>{});var u2t=v(()=>{});var l2t=v(()=>{});var c2t=v(()=>{o2t();i2t();a2t();s2t();u2t();l2t()});var d2t=v(()=>{});var f2t=v(()=>{});var p2t=v(()=>{});var m2t=v(()=>{});var h2t=v(()=>{});var g2t=v(()=>{});var y2t=v(()=>{});var b2t=v(()=>{h2t();g2t();y2t()});var _2t=v(()=>{});var v2t=v(()=>{});var U5,w2t=v(()=>{(function(t){t.HTTP="http",t.HTTPS="https"})(U5||(U5={}))});var S2t=v(()=>{});var C2t=v(()=>{});var x2t=v(()=>{});var O2t=v(()=>{});var T2t=v(()=>{});var E2t=v(()=>{S2t();C2t();x2t();O2t();T2t()});var P2t=v(()=>{});var z5,l3e=v(()=>{(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(z5||(z5={}))});var M2t=v(()=>{l3e()});var R2t=v(()=>{});var A2t=v(()=>{M2t();R2t();l3e()});var kv,I2t=v(()=>{(function(t){t[t.HEADER=0]="HEADER",t[t.TRAILER=1]="TRAILER"})(kv||(kv={}))});var N2t=v(()=>{});var j2t=v(()=>{});var D2t=v(()=>{});var $2t=v(()=>{});var L2t=v(()=>{});var F2t=v(()=>{j2t();D2t();$2t();L2t()});var k2t=v(()=>{});var H5,q2t=v(()=>{H5="__smithy_context"});var B2t=v(()=>{});var U2t,z2t=v(()=>{(function(t){t.PROFILE="profile",t.SSO_SESSION="sso-session",t.SERVICES="services"})(U2t||(U2t={}))});var H2t=v(()=>{});var V2t=v(()=>{});var J2t=v(()=>{});var K2t=v(()=>{});var W2t=v(()=>{});var G2t=v(()=>{});var Z2t=v(()=>{});var X2t=v(()=>{});var Y2t=v(()=>{});var Q2t,eHt=v(()=>{(function(t){t.HTTP_0_9="http/0.9",t.HTTP_1_0="http/1.0",t.TDS_8_0="tds/8.0"})(Q2t||(Q2t={}))});var tHt=v(()=>{});var rHt=v(()=>{});var nHt=v(()=>{});var oHt=v(()=>{});var iHt=v(()=>{});var aHt=v(()=>{});var hd=v(()=>{r2t();c2t();d2t();f2t();p2t();m2t();b2t();_2t();v2t();w2t();E2t();P2t();A2t();I2t();N2t();F2t();k2t();q2t();B2t();z2t();H2t();V2t();J2t();K2t();W2t();G2t();Z2t();X2t();Y2t();eHt();tHt();rHt();nHt();oHt();iHt();aHt()});var sHt=v(()=>{hd()});var uHt=v(()=>{});var lHt=v(()=>{});function DSn(t){return Object.keys(t).reduce((e,r)=>{let n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}var Ibe,cHt=v(()=>{Ibe=class t{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){let r=new t({...e,headers:{...e.headers}});return r.query&&(r.query=DSn(r.query)),r}static isInstance(e){if(!e)return!1;let r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return t.clone(this)}}});var dHt=v(()=>{});var fHt=v(()=>{});var pHt=v(()=>{});var mHt=v(()=>{t2t();sHt();uHt();lHt();cHt();dHt();fHt();pHt()});var $Sn,LSn,Nbe,c3e=v(()=>{mHt();$Sn=t=>e=>async r=>{if(!Ibe.isInstance(r.request))return e(r);let{request:n}=r,{handlerProtocol:o=""}=t.requestHandler.metadata||{};if(o.indexOf("h2")>=0&&!n.headers[":authority"])delete n.headers.host,n.headers[":authority"]=n.hostname+(n.port?":"+n.port:"");else if(!n.headers.host){let i=n.hostname;n.port!=null&&(i+=`:${n.port}`),n.headers.host=i}return e(r)},LSn={name:"hostHeaderMiddleware",step:"build",priority:"low",tags:["HOST"],override:!0},Nbe=t=>({applyToStack:e=>{e.add($Sn(t),LSn)}})});var FSn,kSn,jbe,hHt=v(()=>{FSn=()=>(t,e)=>async r=>{try{let n=await t(r),{clientName:o,commandName:i,logger:a,dynamoDbDocumentClientOptions:s={}}=e,{overrideInputFilterSensitiveLog:u,overrideOutputFilterSensitiveLog:l}=s,c=u??e.inputFilterSensitiveLog,d=l??e.outputFilterSensitiveLog,{$metadata:f,...p}=n.output;return a?.info?.({clientName:o,commandName:i,input:c(r.input),output:d(p),metadata:f}),n}catch(n){let{clientName:o,commandName:i,logger:a,dynamoDbDocumentClientOptions:s={}}=e,{overrideInputFilterSensitiveLog:u}=s,l=u??e.inputFilterSensitiveLog;throw a?.error?.({clientName:o,commandName:i,input:l(r.input),error:n,metadata:n.$metadata}),n}},kSn={name:"loggerMiddleware",tags:["LOGGER"],step:"initialize",override:!0},jbe=t=>({applyToStack:e=>{e.add(FSn(),kSn)}})});var d3e=v(()=>{hHt()});var gHt=v(()=>{});var yHt=v(()=>{gHt()});var bHt=v(()=>{hd()});var _Ht=v(()=>{});var vHt=v(()=>{});function qSn(t){return Object.keys(t).reduce((e,r)=>{let n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}var Dbe,wHt=v(()=>{Dbe=class t{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){let r=new t({...e,headers:{...e.headers}});return r.query&&(r.query=qSn(r.query)),r}static isInstance(e){if(!e)return!1;let r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return t.clone(this)}}});var SHt=v(()=>{});var CHt=v(()=>{});var xHt=v(()=>{});var OHt=v(()=>{yHt();bHt();_Ht();vHt();wHt();SHt();CHt();xHt()});var THt,BSn,USn,zSn,HSn,$be,f3e=v(()=>{OHt();THt="X-Amzn-Trace-Id",BSn="AWS_LAMBDA_FUNCTION_NAME",USn="_X_AMZN_TRACE_ID",zSn=t=>e=>async r=>{let{request:n}=r;if(!Dbe.isInstance(n)||t.runtime!=="node"||n.headers.hasOwnProperty(THt))return e(r);let o=process.env[BSn],i=process.env[USn],a=s=>typeof s=="string"&&s.length>0;return a(o)&&a(i)&&(n.headers[THt]=i),e({...r,request:n})},HSn={step:"build",tags:["RECURSION_DETECTION"],name:"recursionDetectionMiddleware",override:!0,priority:"low"},$be=t=>({applyToStack:e=>{e.add(zSn(t),HSn)}})});function Lbe(t){return{...t,customUserAgent:typeof t.customUserAgent=="string"?[[t.customUserAgent]]:t.customUserAgent}}var EHt=v(()=>{});var VSn,kte,p3e=v(()=>{VSn=new RegExp("^(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}$"),kte=t=>VSn.test(t)||t.startsWith("[")&&t.endsWith("]")});var JSn,qte,m3e=v(()=>{JSn=new RegExp("^(?!.*-$)(?!-)[a-zA-Z0-9-]{1,63}$"),qte=(t,e=!1)=>{if(!e)return JSn.test(t);let r=t.split(".");for(let n of r)if(!qte(n))return!1;return!0}});var XN,Fbe=v(()=>{XN={}});var YN,PHt=v(()=>{YN="endpoints"});function mS(t){return typeof t!="object"||t==null?t:"ref"in t?`$${mS(t.ref)}`:"fn"in t?`${t.fn}(${(t.argv||[]).map(mS).join(", ")})`:JSON.stringify(t,null,2)}var MHt=v(()=>{});var Bte=v(()=>{PHt();MHt()});var Fu,RHt=v(()=>{Fu=class extends Error{constructor(e){super(e),this.name="EndpointError"}}});var AHt=v(()=>{});var IHt=v(()=>{});var NHt=v(()=>{});var jHt=v(()=>{});var DHt=v(()=>{});var $Ht=v(()=>{});var hS=v(()=>{RHt();AHt();IHt();NHt();jHt();DHt();$Ht()});var LHt,FHt=v(()=>{LHt=(t,e)=>t===e});var kHt,qHt=v(()=>{hS();kHt=t=>{let e=t.split("."),r=[];for(let n of e){let o=n.indexOf("[");if(o!==-1){if(n.indexOf("]")!==n.length-1)throw new Fu(`Path: '${t}' does not end with ']'`);let i=n.slice(o+1,-1);if(Number.isNaN(parseInt(i)))throw new Fu(`Invalid array index: '${i}' in path: '${t}'`);o!==0&&r.push(n.slice(0,o)),r.push(i)}else r.push(n)}return r}});var kbe,BHt=v(()=>{hS();qHt();kbe=(t,e)=>kHt(e).reduce((r,n)=>{if(typeof r!="object")throw new Fu(`Index '${n}' in '${e}' not found in '${JSON.stringify(t)}'`);return Array.isArray(r)?r[parseInt(n)]:r[n]},t)});var UHt,zHt=v(()=>{UHt=t=>t!=null});var HHt,VHt=v(()=>{HHt=t=>!t});var h3e,JHt,KHt=v(()=>{hd();p3e();h3e={[U5.HTTP]:80,[U5.HTTPS]:443},JHt=t=>{let e=(()=>{try{if(t instanceof URL)return t;if(typeof t=="object"&&"hostname"in t){let{hostname:f,port:p,protocol:m="",path:h="",query:g={}}=t,y=new URL(`${m}//${f}${p?`:${p}`:""}${h}`);return y.search=Object.entries(g).map(([b,_])=>`${b}=${_}`).join("&"),y}return new URL(t)}catch{return null}})();if(!e)return console.error(`Unable to parse ${JSON.stringify(t)} as a whatwg URL.`),null;let r=e.href,{host:n,hostname:o,pathname:i,protocol:a,search:s}=e;if(s)return null;let u=a.slice(0,-1);if(!Object.values(U5).includes(u))return null;let l=kte(o),c=r.includes(`${n}:${h3e[u]}`)||typeof t=="string"&&t.includes(`${n}:${h3e[u]}`),d=`${n}${c?`:${h3e[u]}`:""}`;return{scheme:u,authority:d,path:i,normalizedPath:i.endsWith("/")?i:`${i}/`,isIp:l}}});var WHt,GHt=v(()=>{WHt=(t,e)=>t===e});var ZHt,XHt=v(()=>{ZHt=(t,e,r,n)=>e>=r||t.length{YHt=t=>encodeURIComponent(t).replace(/[!*'()]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)});var g3e=v(()=>{FHt();BHt();zHt();m3e();VHt();KHt();GHt();XHt();QHt()});var eVt,tVt=v(()=>{g3e();eVt={booleanEquals:LHt,getAttr:kbe,isSet:UHt,isValidHostLabel:qte,not:HHt,parseURL:JHt,stringEquals:WHt,substring:ZHt,uriEncode:YHt}});var qbe,y3e=v(()=>{g3e();qbe=(t,e)=>{let r=[],n={...e.endpointParams,...e.referenceRecord},o=0;for(;o{rVt=({ref:t},e)=>({...e.endpointParams,...e.referenceRecord})[t]});var rF,Ute=v(()=>{hS();b3e();y3e();nVt();rF=(t,e,r)=>{if(typeof t=="string")return qbe(t,r);if(t.fn)return Bbe(t,r);if(t.ref)return rVt(t,r);throw new Fu(`'${e}': ${String(t)} is not a string, function or reference.`)}});var Bbe,b3e=v(()=>{Fbe();tVt();Ute();Bbe=({fn:t,argv:e},r)=>{let n=e.map(i=>["boolean","number"].includes(typeof i)?i:rF(i,"arg",r)),o=t.split(".");return o[0]in XN&&o[1]!=null?XN[o[0]][o[1]](...n):eVt[t](...n)}});var oVt,iVt=v(()=>{Bte();hS();b3e();oVt=({assign:t,...e},r)=>{if(t&&t in r.referenceRecord)throw new Fu(`'${t}' is already defined in Reference Record.`);let n=Bbe(e,r);return r.logger?.debug?.(`${YN} evaluateCondition: ${mS(e)} = ${mS(n)}`),{result:n===""?!0:!!n,...t!=null&&{toAssign:{name:t,value:n}}}}});var V5,Ube=v(()=>{Bte();iVt();V5=(t=[],e)=>{let r={};for(let n of t){let{result:o,toAssign:i}=oVt(n,{...e,referenceRecord:{...e.referenceRecord,...r}});if(!o)return{result:o};i&&(r[i.name]=i.value,e.logger?.debug?.(`${YN} assign: ${i.name} := ${mS(i.value)}`))}return{result:!0,referenceRecord:r}}});var aVt,sVt=v(()=>{hS();Ute();aVt=(t,e)=>Object.entries(t).reduce((r,[n,o])=>({...r,[n]:o.map(i=>{let a=rF(i,"Header value entry",e);if(typeof a!="string")throw new Fu(`Header '${n}' value '${a}' is not a string`);return a})}),{})});var _3e,uVt=v(()=>{hS();y3e();v3e();_3e=(t,e)=>{if(Array.isArray(t))return t.map(r=>_3e(r,e));switch(typeof t){case"string":return qbe(t,e);case"object":if(t===null)throw new Fu(`Unexpected endpoint property: ${t}`);return zbe(t,e);case"boolean":return t;default:throw new Fu(`Unexpected endpoint property type: ${typeof t}`)}}});var zbe,v3e=v(()=>{uVt();zbe=(t,e)=>Object.entries(t).reduce((r,[n,o])=>({...r,[n]:_3e(o,e)}),{})});var lVt,cVt=v(()=>{hS();Ute();lVt=(t,e)=>{let r=rF(t,"Endpoint URL",e);if(typeof r=="string")try{return new URL(r)}catch(n){throw console.error(`Failed to construct URL with ${r}`,n),n}throw new Fu(`Endpoint URL must be a string, got ${typeof r}`)}});var dVt,fVt=v(()=>{Bte();Ube();sVt();v3e();cVt();dVt=(t,e)=>{let{conditions:r,endpoint:n}=t,{result:o,referenceRecord:i}=V5(r,e);if(!o)return;let a={...e,referenceRecord:{...e.referenceRecord,...i}},{url:s,properties:u,headers:l}=n;return e.logger?.debug?.(`${YN} Resolving endpoint from template: ${mS(n)}`),{...l!=null&&{headers:aVt(l,a)},...u!=null&&{properties:zbe(u,a)},url:lVt(s,a)}}});var pVt,mVt=v(()=>{hS();Ube();Ute();pVt=(t,e)=>{let{conditions:r,error:n}=t,{result:o,referenceRecord:i}=V5(r,e);if(o)throw new Fu(rF(n,"Error",{...e,referenceRecord:{...e.referenceRecord,...i}}))}});var hVt,gVt=v(()=>{Ube();w3e();hVt=(t,e)=>{let{conditions:r,rules:n}=t,{result:o,referenceRecord:i}=V5(r,e);if(o)return Hbe(n,{...e,referenceRecord:{...e.referenceRecord,...i}})}});var Hbe,w3e=v(()=>{hS();fVt();mVt();gVt();Hbe=(t,e)=>{for(let r of t)if(r.type==="endpoint"){let n=dVt(r,e);if(n)return n}else if(r.type==="error")pVt(r,e);else if(r.type==="tree"){let n=hVt(r,e);if(n)return n}else throw new Fu(`Unknown endpoint rule: ${r}`);throw new Fu("Rules evaluation failed")}});var yVt=v(()=>{Fbe();w3e()});var zte,bVt=v(()=>{Bte();hS();yVt();zte=(t,e)=>{let{endpointParams:r,logger:n}=e,{parameters:o,rules:i}=t;e.logger?.debug?.(`${YN} Initial EndpointParams: ${mS(r)}`);let a=Object.entries(o).filter(([,l])=>l.default!=null).map(([l,c])=>[l,c.default]);if(a.length>0)for(let[l,c]of a)r[l]=r[l]??c;let s=Object.entries(o).filter(([,l])=>l.required).map(([l])=>l);for(let l of s)if(r[l]==null)throw new Fu(`Missing required parameter: '${l}'`);let u=Hbe(i,{endpointParams:r,logger:n,referenceRecord:{}});if(e.endpointParams?.Endpoint)try{let l=new URL(e.endpointParams.Endpoint),{protocol:c,port:d}=l;u.url.protocol=c,u.url.port=d}catch{}return e.logger?.debug?.(`${YN} Resolved endpoint: ${mS(u)}`),u}});var nF=v(()=>{p3e();m3e();Fbe();bVt();hS()});var S3e=v(()=>{nF()});var C3e,_Vt=v(()=>{nF();S3e();C3e=(t,e=!1)=>{if(e){for(let r of t.split("."))if(!C3e(r))return!1;return!0}return!(!qte(t)||t.length<3||t.length>63||t!==t.toLowerCase()||kte(t))}});var vVt,KSn,wVt,SVt=v(()=>{vVt=":",KSn="/",wVt=t=>{let e=t.split(vVt);if(e.length<6)return null;let[r,n,o,i,a,...s]=e;if(r!=="arn"||n===""||o===""||s.join(vVt)==="")return null;let u=s.map(l=>l.split(KSn)).flat();return{partition:n,service:o,region:i,accountId:a,resourceId:u}}});var xVt,CVt=v(()=>{xVt={partitions:[{id:"aws",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-east-1",name:"aws",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$",regions:{"af-south-1":{description:"Africa (Cape Town)"},"ap-east-1":{description:"Asia Pacific (Hong Kong)"},"ap-northeast-1":{description:"Asia Pacific (Tokyo)"},"ap-northeast-2":{description:"Asia Pacific (Seoul)"},"ap-northeast-3":{description:"Asia Pacific (Osaka)"},"ap-south-1":{description:"Asia Pacific (Mumbai)"},"ap-south-2":{description:"Asia Pacific (Hyderabad)"},"ap-southeast-1":{description:"Asia Pacific (Singapore)"},"ap-southeast-2":{description:"Asia Pacific (Sydney)"},"ap-southeast-3":{description:"Asia Pacific (Jakarta)"},"ap-southeast-4":{description:"Asia Pacific (Melbourne)"},"ap-southeast-5":{description:"Asia Pacific (Malaysia)"},"aws-global":{description:"AWS Standard global region"},"ca-central-1":{description:"Canada (Central)"},"ca-west-1":{description:"Canada West (Calgary)"},"eu-central-1":{description:"Europe (Frankfurt)"},"eu-central-2":{description:"Europe (Zurich)"},"eu-north-1":{description:"Europe (Stockholm)"},"eu-south-1":{description:"Europe (Milan)"},"eu-south-2":{description:"Europe (Spain)"},"eu-west-1":{description:"Europe (Ireland)"},"eu-west-2":{description:"Europe (London)"},"eu-west-3":{description:"Europe (Paris)"},"il-central-1":{description:"Israel (Tel Aviv)"},"me-central-1":{description:"Middle East (UAE)"},"me-south-1":{description:"Middle East (Bahrain)"},"sa-east-1":{description:"South America (Sao Paulo)"},"us-east-1":{description:"US East (N. Virginia)"},"us-east-2":{description:"US East (Ohio)"},"us-west-1":{description:"US West (N. California)"},"us-west-2":{description:"US West (Oregon)"}}},{id:"aws-cn",outputs:{dnsSuffix:"amazonaws.com.cn",dualStackDnsSuffix:"api.amazonwebservices.com.cn",implicitGlobalRegion:"cn-northwest-1",name:"aws-cn",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^cn\\-\\w+\\-\\d+$",regions:{"aws-cn-global":{description:"AWS China global region"},"cn-north-1":{description:"China (Beijing)"},"cn-northwest-1":{description:"China (Ningxia)"}}},{id:"aws-us-gov",outputs:{dnsSuffix:"amazonaws.com",dualStackDnsSuffix:"api.aws",implicitGlobalRegion:"us-gov-west-1",name:"aws-us-gov",supportsDualStack:!0,supportsFIPS:!0},regionRegex:"^us\\-gov\\-\\w+\\-\\d+$",regions:{"aws-us-gov-global":{description:"AWS GovCloud (US) global region"},"us-gov-east-1":{description:"AWS GovCloud (US-East)"},"us-gov-west-1":{description:"AWS GovCloud (US-West)"}}},{id:"aws-iso",outputs:{dnsSuffix:"c2s.ic.gov",dualStackDnsSuffix:"c2s.ic.gov",implicitGlobalRegion:"us-iso-east-1",name:"aws-iso",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-iso\\-\\w+\\-\\d+$",regions:{"aws-iso-global":{description:"AWS ISO (US) global region"},"us-iso-east-1":{description:"US ISO East"},"us-iso-west-1":{description:"US ISO WEST"}}},{id:"aws-iso-b",outputs:{dnsSuffix:"sc2s.sgov.gov",dualStackDnsSuffix:"sc2s.sgov.gov",implicitGlobalRegion:"us-isob-east-1",name:"aws-iso-b",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isob\\-\\w+\\-\\d+$",regions:{"aws-iso-b-global":{description:"AWS ISOB (US) global region"},"us-isob-east-1":{description:"US ISOB East (Ohio)"}}},{id:"aws-iso-e",outputs:{dnsSuffix:"cloud.adc-e.uk",dualStackDnsSuffix:"cloud.adc-e.uk",implicitGlobalRegion:"eu-isoe-west-1",name:"aws-iso-e",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^eu\\-isoe\\-\\w+\\-\\d+$",regions:{"eu-isoe-west-1":{description:"EU ISOE West"}}},{id:"aws-iso-f",outputs:{dnsSuffix:"csp.hci.ic.gov",dualStackDnsSuffix:"csp.hci.ic.gov",implicitGlobalRegion:"us-isof-south-1",name:"aws-iso-f",supportsDualStack:!1,supportsFIPS:!0},regionRegex:"^us\\-isof\\-\\w+\\-\\d+$",regions:{}}],version:"1.1"}});var GSn,ZSn,OVt,TVt,x3e=v(()=>{CVt();GSn=xVt,ZSn="",OVt=t=>{let{partitions:e}=GSn;for(let n of e){let{regions:o,outputs:i}=n;for(let[a,s]of Object.entries(o))if(a===t)return{...i,...s}}for(let n of e){let{regionRegex:o,outputs:i}=n;if(new RegExp(o).test(t))return{...i}}let r=e.find(n=>n.id==="aws");if(!r)throw new Error("Provided region was not found in the partition array or regex, and default partition with id 'aws' doesn't exist.");return{...r.outputs}},TVt=()=>ZSn});var Hte,EVt=v(()=>{nF();_Vt();SVt();x3e();Hte={isVirtualHostableS3Bucket:C3e,parseArn:wVt,partition:OVt};XN.aws=Hte});var PVt=v(()=>{nF()});var MVt=v(()=>{nF()});var RVt=v(()=>{});var AVt=v(()=>{});var IVt=v(()=>{});var NVt=v(()=>{});var jVt=v(()=>{});var DVt=v(()=>{MVt();RVt();AVt();IVt();NVt();jVt()});var Vbe=v(()=>{EVt();x3e();S3e();PVt();DVt()});var $Vt=v(()=>{});var LVt=v(()=>{$Vt()});var FVt=v(()=>{hd()});var kVt=v(()=>{});var qVt=v(()=>{});function XSn(t){return Object.keys(t).reduce((e,r)=>{let n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}var Jbe,BVt=v(()=>{Jbe=class t{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){let r=new t({...e,headers:{...e.headers}});return r.query&&(r.query=XSn(r.query)),r}static isInstance(e){if(!e)return!1;let r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return t.clone(this)}}});var UVt=v(()=>{});var zVt=v(()=>{});var HVt=v(()=>{});var VVt=v(()=>{LVt();FVt();kVt();qVt();BVt();UVt();zVt();HVt()});var O3e,Kbe,T3e,Wbe,JVt,KVt,E3e,WVt=v(()=>{O3e="user-agent",Kbe="x-amz-user-agent",T3e=" ",Wbe="/",JVt=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w]/g,KVt=/[^\!\$\%\&\'\*\+\-\.\^\_\`\|\~\d\w\#]/g,E3e="-"});var YSn,P3e,QSn,Gbe,GVt=v(()=>{Vbe();VVt();WVt();YSn=t=>(e,r)=>async n=>{let{request:o}=n;if(!Jbe.isInstance(o))return e(n);let{headers:i}=o,a=r?.userAgent?.map(P3e)||[],s=(await t.defaultUserAgentProvider()).map(P3e),u=t?.customUserAgent?.map(P3e)||[],l=TVt(),c=(l?[l]:[]).concat([...s,...a,...u]).join(T3e),d=[...s.filter(f=>f.startsWith("aws-sdk-")),...u].join(T3e);return t.runtime!=="browser"?(d&&(i[Kbe]=i[Kbe]?`${i[O3e]} ${d}`:d),i[O3e]=c):i[Kbe]=c,e({...n,request:o})},P3e=t=>{let e=t[0].split(Wbe).map(a=>a.replace(JVt,E3e)).join(Wbe),r=t[1]?.replace(KVt,E3e),n=e.indexOf(Wbe),o=e.substring(0,n),i=e.substring(n+1);return o==="api"&&(i=i.toLowerCase()),[o,i,r].filter(a=>a&&a.length>0).reduce((a,s,u)=>{switch(u){case 0:return s;case 1:return`${a}/${s}`;default:return`${a}#${s}`}},"")},QSn={name:"getUserAgentMiddleware",step:"build",priority:"low",tags:["SET_USER_AGENT","USER_AGENT"],override:!0},Gbe=t=>({applyToStack:e=>{e.add(YSn(t),QSn)}})});var M3e=v(()=>{EHt();GVt()});var ZVt=v(()=>{});var XVt=v(()=>{});var Zbe,YVt=v(()=>{(function(t){t.ENV="env",t.CONFIG="shared config entry"})(Zbe||(Zbe={}))});var R3e=v(()=>{ZVt();XVt();YVt()});var Xbe,QVt=v(()=>{R3e();Xbe=!1});var Ybe,eJt=v(()=>{R3e();Ybe=!1});var tT,tJt=v(()=>{hd();tT=t=>t[H5]||(t[H5]={})});var py,rJt=v(()=>{py=t=>{if(typeof t=="function")return t;let e=Promise.resolve(t);return()=>e}});var pC=v(()=>{tJt();rJt()});var nJt=v(()=>{pC()});var oJt=v(()=>{});var iJt=v(()=>{pC();oJt()});var aJt=v(()=>{QVt();eJt();nJt();iJt()});var sJt=v(()=>{});var Qbe,A3e=v(()=>{Qbe=t=>typeof t=="string"&&(t.startsWith("fips-")||t.endsWith("-fips"))});var I3e,uJt=v(()=>{A3e();I3e=t=>Qbe(t)?["fips-aws-global","aws-fips"].includes(t)?"us-east-1":t.replace(/fips-(dkr-|prod-)?|-fips/,""):t});var e_e,lJt=v(()=>{uJt();A3e();e_e=t=>{let{region:e,useFipsEndpoint:r}=t;if(!e)throw new Error("Region is missing");return{...t,region:async()=>{if(typeof e=="string")return I3e(e);let n=await e();return I3e(n)},useFipsEndpoint:async()=>{let n=typeof e=="string"?e:await e();return Qbe(n)?!0:typeof r!="function"?Promise.resolve(!!r):r()}}}});var cJt=v(()=>{sJt();lJt()});var dJt=v(()=>{});var fJt=v(()=>{});var pJt=v(()=>{});var mJt=v(()=>{});var hJt=v(()=>{});var gJt=v(()=>{});var yJt=v(()=>{pJt();mJt();hJt();gJt()});var bJt=v(()=>{dJt();fJt();yJt()});var Vte=v(()=>{aJt();cJt();bJt()});function t0n(t){let e=new Map;for(let r of t)e.set(r.schemeId,r);return e}var N3e,t_e=v(()=>{hd();pC();N3e=(t,e)=>(r,n)=>async o=>{let i=t.httpAuthSchemeProvider(await e.httpAuthSchemeParametersProvider(t,n,o.input)),a=t0n(t.httpAuthSchemes),s=tT(n),u=[];for(let l of i){let c=a.get(l.schemeId);if(!c){u.push(`HttpAuthScheme \`${l.schemeId}\` was not enabled for this service.`);continue}let d=c.identityProvider(await e.identityProviderConfigProvider(t));if(!d){u.push(`HttpAuthScheme \`${l.schemeId}\` did not have an IdentityProvider configured.`);continue}let{identityProperties:f={},signingProperties:p={}}=l.propertiesExtractor?.(t,n)||{};l.identityProperties=Object.assign(l.identityProperties||{},f),l.signingProperties=Object.assign(l.signingProperties||{},p),s.selectedHttpAuthScheme={httpAuthOption:l,identity:await d(l.identityProperties),signer:c.signer};break}if(!s.selectedHttpAuthScheme)throw new Error(u.join(` +`));return r(o)}});var _Jt,r0n,n0n,o0n,i0n,a0n,vJt=v(()=>{_Jt=async t=>{let e=t?.Bucket||"";if(typeof t.Bucket=="string"&&(t.Bucket=e.replace(/#/g,encodeURIComponent("#")).replace(/\?/g,encodeURIComponent("?"))),a0n(e)){if(t.ForcePathStyle===!0)throw new Error("Path-style addressing cannot be used with ARN buckets")}else(!i0n(e)||e.indexOf(".")!==-1&&!String(t.Endpoint).startsWith("http:")||e.toLowerCase()!==e||e.length<3)&&(t.ForcePathStyle=!0);return t.DisableMultiRegionAccessPoints&&(t.disableMultiRegionAccessPoints=!0,t.DisableMRAP=!0),t},r0n=/^[a-z0-9][a-z0-9\.\-]{1,61}[a-z0-9]$/,n0n=/(\d+\.){3}\d+/,o0n=/\.\./,i0n=t=>r0n.test(t)&&!n0n.test(t)&&!o0n.test(t),a0n=t=>{let[e,r,n,,,o]=t.split(":"),i=e==="arn"&&t.split(":").length>=6,a=!!(i&&r&&n&&o);if(i&&!a)throw new Error(`Invalid ARN: ${t} was an invalid ARN.`);return a}});var wJt=v(()=>{vJt()});var SJt,CJt=v(()=>{SJt=(t,e,r)=>{let n=async()=>{let o=r[t]??r[e];return typeof o=="function"?o():o};return t==="credentialScope"||e==="CredentialScope"?async()=>{let o=typeof r.credentials=="function"?await r.credentials():r.credentials;return o?.credentialScope??o?.CredentialScope}:t==="accountId"||e==="AccountId"?async()=>{let o=typeof r.credentials=="function"?await r.credentials():r.credentials;return o?.accountId??o?.AccountId}:t==="endpoint"||e==="endpoint"?async()=>{let o=await n();if(o&&typeof o=="object"){if("url"in o)return o.url.href;if("hostname"in o){let{protocol:i,hostname:a,port:s,path:u}=o;return`${i}//${a}${s?":"+s:""}${u}`}}return o}:n}});var xJt,OJt=v(()=>{xJt=async t=>{}});function TJt(t){let e={};if(t=t.replace(/^\?/,""),t)for(let r of t.split("&")){let[n,o=null]=r.split("=");n=decodeURIComponent(n),o&&(o=decodeURIComponent(o)),n in e?Array.isArray(e[n])?e[n].push(o):e[n]=[e[n],o]:e[n]=o}return e}var EJt=v(()=>{});var oF,r_e=v(()=>{EJt();oF=t=>{if(typeof t=="string")return oF(new URL(t));let{hostname:e,pathname:r,port:n,protocol:o,search:i}=t,a;return i&&(a=TJt(i)),{hostname:e,port:n?parseInt(n):void 0,protocol:o,path:r,query:a}}});var n_e,o_e=v(()=>{r_e();n_e=t=>typeof t=="object"?"url"in t?oF(t.url):t:oF(t)});var PJt,s0n,j3e=v(()=>{wJt();CJt();OJt();o_e();PJt=async(t,e,r,n)=>{if(!r.endpoint){let a=await xJt(r.serviceId||"");a&&(r.endpoint=()=>Promise.resolve(n_e(a)))}let o=await s0n(t,e,r);if(typeof r.endpointProvider!="function")throw new Error("config.endpointProvider is not set.");return r.endpointProvider(o,n)},s0n=async(t,e,r)=>{let n={},o=e?.getEndpointParameterInstructions?.()||{};for(let[i,a]of Object.entries(o))switch(a.type){case"staticContextParams":n[i]=a.value;break;case"contextParams":n[i]=t[a.name];break;case"clientContextParams":case"builtInParams":n[i]=await SJt(a.name,i,r)();break;default:throw new Error("Unrecognized endpoint parameter instruction: "+JSON.stringify(a))}return Object.keys(o).length===0&&Object.assign(n,r),String(r.serviceId).toLowerCase()==="s3"&&await _Jt(n),n}});var MJt=v(()=>{j3e();o_e()});var RJt,D3e=v(()=>{pC();j3e();RJt=({config:t,instructions:e})=>(r,n)=>async o=>{let i=await PJt(o.input,{getEndpointParameterInstructions(){return e}},{...t},n);n.endpointV2=i,n.authSchemes=i.properties?.authSchemes;let a=n.authSchemes?.[0];if(a){n.signing_region=a.signingRegion,n.signing_service=a.signingName;let u=tT(n)?.selectedHttpAuthScheme?.httpAuthOption;u&&(u.signingProperties=Object.assign(u.signingProperties||{},{signing_region:a.signingRegion,signingRegion:a.signingRegion,signing_service:a.signingName,signingName:a.signingName,signingRegionSet:a.signingRegionSet},a.properties))}return r({...o})}});var AJt,$3e=v(()=>{AJt=(t,e)=>r=>async n=>{let{response:o}=await r(n);try{let i=await e(o,t);return{response:o,output:i}}catch(i){if(Object.defineProperty(i,"$response",{value:o}),!("$metadata"in i)){let a="Deserialization error: to see the raw response, inspect the hidden field {error}.$response on this object.";i.message+=` + `+a,typeof i.$responseBodyText<"u"&&i.$response&&(i.$response.body=i.$responseBodyText)}throw i}}});var IJt,L3e=v(()=>{IJt=(t,e)=>(r,n)=>async o=>{let i=n.endpointV2?.url&&t.urlParser?async()=>t.urlParser(n.endpointV2.url):t.endpoint;if(!i)throw new Error("No valid endpoint provider available.");let a=await e(o.input,{...t,endpoint:i});return r({...o,request:a})}});function xr(t,e,r){return{applyToStack:n=>{n.add(AJt(t,r),u0n),n.add(IJt(t,e),Jte)}}}var u0n,Jte,NJt=v(()=>{$3e();L3e();u0n={name:"deserializerMiddleware",step:"deserialize",tags:["DESERIALIZER"],override:!0},Jte={name:"serializerMiddleware",step:"serialize",tags:["SERIALIZER"],override:!0}});var Ji=v(()=>{$3e();NJt();L3e()});var F3e,Or,jJt=v(()=>{Ji();D3e();F3e={step:"serialize",tags:["ENDPOINT_PARAMETERS","ENDPOINT_V2","ENDPOINT"],name:"endpointV2Middleware",override:!0,relation:"before",toMiddleware:Jte.name},Or=(t,e)=>({applyToStack:r=>{r.addRelativeTo(RJt({config:t,instructions:e}),F3e)}})});var i_e,DJt=v(()=>{pC();o_e();i_e=t=>{let e=t.tls??!0,{endpoint:r}=t,n=r!=null?async()=>n_e(await py(r)()):void 0;return{...t,endpoint:n,tls:e,isCustomEndpoint:!!r,useDualstackEndpoint:py(t.useDualstackEndpoint??!1),useFipsEndpoint:py(t.useFipsEndpoint??!1)}}});var $Jt=v(()=>{});var Li=v(()=>{MJt();D3e();jJt();DJt();$Jt()});var l0n,a_e,LJt=v(()=>{Li();t_e();l0n={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:F3e.name},a_e=(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r})=>({applyToStack:n=>{n.addRelativeTo(N3e(t,{httpAuthSchemeParametersProvider:e,identityProviderConfigProvider:r}),l0n)}})});var y3i,FJt=v(()=>{Ji();t_e();y3i={step:"serialize",tags:["HTTP_AUTH_SCHEME"],name:"httpAuthSchemeMiddleware",override:!0,relation:"before",toMiddleware:Jte.name}});var kJt=v(()=>{t_e();LJt();FJt()});var qJt=v(()=>{});var BJt=v(()=>{qJt()});var UJt=v(()=>{hd()});var zJt=v(()=>{});var HJt=v(()=>{});function c0n(t){return Object.keys(t).reduce((e,r)=>{let n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}var T4,VJt=v(()=>{T4=class t{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){let r=new t({...e,headers:{...e.headers}});return r.query&&(r.query=c0n(r.query)),r}static isInstance(e){if(!e)return!1;let r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return t.clone(this)}}});var JJt=v(()=>{});var KJt=v(()=>{});var WJt=v(()=>{});var Kte=v(()=>{BJt();UJt();zJt();HJt();VJt();JJt();KJt();WJt()});var d0n,f0n,GJt,k3e=v(()=>{Kte();hd();pC();d0n=t=>e=>{throw e},f0n=(t,e)=>{},GJt=t=>(e,r)=>async n=>{if(!T4.isInstance(n.request))return e(n);let i=tT(r).selectedHttpAuthScheme;if(!i)throw new Error("No HttpAuthScheme was selected: unable to sign request");let{httpAuthOption:{signingProperties:a={}},identity:s,signer:u}=i,l=await e({...n,request:await u.sign(n.request,s,a)}).catch((u.errorHandler||d0n)(a));return(u.successHandler||f0n)(l.response,a),l}});var mC,rT,Wte,s_e=v(()=>{(function(t){t.STANDARD="standard",t.ADAPTIVE="adaptive"})(mC||(mC={}));rT=3,Wte=mC.STANDARD});var ZJt,XJt,YJt,QJt,e3t=v(()=>{ZJt=["BandwidthLimitExceeded","EC2ThrottledException","LimitExceededException","PriorRequestNotComplete","ProvisionedThroughputExceededException","RequestLimitExceeded","RequestThrottled","RequestThrottledException","SlowDown","ThrottledException","Throttling","ThrottlingException","TooManyRequestsException","TransactionInProgressException"],XJt=["TimeoutError","RequestTimeout","RequestTimeoutException"],YJt=[500,502,503,504],QJt=["ECONNRESET","ECONNREFUSED","EPIPE","ETIMEDOUT"]});var p0n,J5,u_e,t3t,Gte=v(()=>{e3t();p0n=t=>t.$metadata?.clockSkewCorrected,J5=t=>t.$metadata?.httpStatusCode===429||ZJt.includes(t.name)||t.$retryable?.throttling==!0,u_e=t=>p0n(t)||XJt.includes(t.name)||QJt.includes(t?.code||"")||YJt.includes(t.$metadata?.httpStatusCode||0),t3t=t=>{if(t.$metadata?.httpStatusCode!==void 0){let e=t.$metadata.httpStatusCode;return 500<=e&&e<=599&&!u_e(t)}return!1}});var Zte,q3e=v(()=>{Gte();Zte=class{constructor(e){this.currentCapacity=0,this.enabled=!1,this.lastMaxRate=0,this.measuredTxRate=0,this.requestCount=0,this.lastTimestamp=0,this.timeWindow=0,this.beta=e?.beta??.7,this.minCapacity=e?.minCapacity??1,this.minFillRate=e?.minFillRate??.5,this.scaleConstant=e?.scaleConstant??.4,this.smooth=e?.smooth??.8;let r=this.getCurrentTimeInSeconds();this.lastThrottleTime=r,this.lastTxRateBucket=Math.floor(this.getCurrentTimeInSeconds()),this.fillRate=this.minFillRate,this.maxCapacity=this.minCapacity}getCurrentTimeInSeconds(){return Date.now()/1e3}async getSendToken(){return this.acquireTokenBucket(1)}async acquireTokenBucket(e){if(this.enabled){if(this.refillTokenBucket(),e>this.currentCapacity){let r=(e-this.currentCapacity)/this.fillRate*1e3;await new Promise(n=>setTimeout(n,r))}this.currentCapacity=this.currentCapacity-e}}refillTokenBucket(){let e=this.getCurrentTimeInSeconds();if(!this.lastTimestamp){this.lastTimestamp=e;return}let r=(e-this.lastTimestamp)*this.fillRate;this.currentCapacity=Math.min(this.maxCapacity,this.currentCapacity+r),this.lastTimestamp=e}updateClientSendingRate(e){let r;if(this.updateMeasuredRate(),J5(e)){let o=this.enabled?Math.min(this.measuredTxRate,this.fillRate):this.measuredTxRate;this.lastMaxRate=o,this.calculateTimeWindow(),this.lastThrottleTime=this.getCurrentTimeInSeconds(),r=this.cubicThrottle(o),this.enableTokenBucket()}else this.calculateTimeWindow(),r=this.cubicSuccess(this.getCurrentTimeInSeconds());let n=Math.min(r,2*this.measuredTxRate);this.updateTokenBucketRate(n)}calculateTimeWindow(){this.timeWindow=this.getPrecise(Math.pow(this.lastMaxRate*(1-this.beta)/this.scaleConstant,1/3))}cubicThrottle(e){return this.getPrecise(e*this.beta)}cubicSuccess(e){return this.getPrecise(this.scaleConstant*Math.pow(e-this.lastThrottleTime-this.timeWindow,3)+this.lastMaxRate)}enableTokenBucket(){this.enabled=!0}updateTokenBucketRate(e){this.refillTokenBucket(),this.fillRate=Math.max(e,this.minFillRate),this.maxCapacity=Math.max(e,this.minCapacity),this.currentCapacity=Math.min(this.currentCapacity,this.maxCapacity)}updateMeasuredRate(){let e=this.getCurrentTimeInSeconds(),r=Math.floor(e*2)/2;if(this.requestCount++,r>this.lastTxRateBucket){let n=this.requestCount/(r-this.lastTxRateBucket);this.measuredTxRate=this.getPrecise(n*this.smooth+this.measuredTxRate*(1-this.smooth)),this.requestCount=0,this.lastTxRateBucket=r}}getPrecise(e){return parseFloat(e.toFixed(8))}}});var l_e,c_e,K5=v(()=>{l_e="amz-sdk-invocation-id",c_e="amz-sdk-request"});var r3t,n3t=v(()=>{K5();r3t=()=>{let t=100;return{computeNextBackoffDelay:n=>Math.floor(Math.min(2e4,Math.random()*2**n*t)),setDelayBase:n=>{t=n}}}});var B3e,o3t=v(()=>{K5();B3e=({retryDelay:t,retryCount:e,retryCost:r})=>({getRetryCount:()=>e,getRetryDelay:()=>Math.min(2e4,t),getRetryCost:()=>r})});var E4,f_e=v(()=>{s_e();K5();n3t();o3t();E4=class{constructor(e){this.maxAttempts=e,this.mode=mC.STANDARD,this.capacity=500,this.retryBackoffStrategy=r3t(),this.maxAttemptsProvider=typeof e=="function"?e:async()=>e}async acquireInitialRetryToken(e){return B3e({retryDelay:100,retryCount:0})}async refreshRetryTokenForRetry(e,r){let n=await this.getMaxAttempts();if(this.shouldRetry(e,r,n)){let o=r.errorType;this.retryBackoffStrategy.setDelayBase(o==="THROTTLING"?500:100);let i=this.retryBackoffStrategy.computeNextBackoffDelay(e.getRetryCount()),a=r.retryAfterHint?Math.max(r.retryAfterHint.getTime()-Date.now()||0,i):i,s=this.getCapacityCost(o);return this.capacity-=s,B3e({retryDelay:a,retryCount:e.getRetryCount()+1,retryCost:s})}throw new Error("No retry token available")}recordSuccess(e){this.capacity=Math.max(500,this.capacity+(e.getRetryCost()??1))}getCapacity(){return this.capacity}async getMaxAttempts(){try{return await this.maxAttemptsProvider()}catch{return console.warn(`Max attempts provider could not resolve. Using default of ${rT}`),rT}}shouldRetry(e,r,n){return e.getRetryCount()+1=this.getCapacityCost(r.errorType)&&this.isRetryableError(r.errorType)}getCapacityCost(e){return e==="TRANSIENT"?10:5}isRetryableError(e){return e==="THROTTLING"||e==="TRANSIENT"}}});var p_e,l3t=v(()=>{s_e();q3e();f_e();p_e=class{constructor(e,r){this.maxAttemptsProvider=e,this.mode=mC.ADAPTIVE;let{rateLimiter:n}=r??{};this.rateLimiter=n??new Zte,this.standardRetryStrategy=new E4(e)}async acquireInitialRetryToken(e){return await this.rateLimiter.getSendToken(),this.standardRetryStrategy.acquireInitialRetryToken(e)}async refreshRetryTokenForRetry(e,r){return this.rateLimiter.updateClientSendingRate(r),this.standardRetryStrategy.refreshRetryTokenForRetry(e,r)}recordSuccess(e){this.rateLimiter.updateClientSendingRate({}),this.standardRetryStrategy.recordSuccess(e)}}});var c3t=v(()=>{K5();f_e()});var d3t=v(()=>{});var nT=v(()=>{l3t();c3t();q3e();f_e();s_e();K5();d3t()});var f3t=v(()=>{});var p3t=v(()=>{f3t()});var m3t=v(()=>{hd()});var h3t=v(()=>{});var g3t=v(()=>{});function m0n(t){return Object.keys(t).reduce((e,r)=>{let n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}var G5,y3t=v(()=>{G5=class t{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){let r=new t({...e,headers:{...e.headers}});return r.query&&(r.query=m0n(r.query)),r}static isInstance(e){if(!e)return!1;let r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return t.clone(this)}}});var Xte,b3t=v(()=>{Xte=class{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;let r=e;return typeof r.statusCode=="number"&&typeof r.headers=="object"}}});var _3t=v(()=>{});var v3t=v(()=>{});var m_e=v(()=>{p3t();m3t();h3t();g3t();y3t();b3t();_3t();v3t()});var w3t=v(()=>{nT()});var z3e=v(()=>{nT()});var H3e=v(()=>{Gte()});var V3e,J3e=v(()=>{V3e=t=>t instanceof Error?t:t instanceof Object?Object.assign(new Error,t):typeof t=="string"?new Error(t):new Error(`AWS SDK error wrapper for ${t}`)});var K3e=v(()=>{m_e();Gte();nT();w3t();z3e();H3e();J3e()});var S3t=v(()=>{nT();K3e()});var h_e,C3t=v(()=>{pC();nT();h_e=t=>{let{retryStrategy:e}=t,r=py(t.maxAttempts??rT);return{...t,maxAttempts:r,retryStrategy:async()=>e||(await py(t.retryMode)()===mC.ADAPTIVE?new p_e(r):new E4(r))}}});var x3t=v(()=>{m_e();nT()});var iF,O3t=v(()=>{iF=class{trace(){}debug(){}info(){}warn(){}error(){}}});var P4,aF,Z5,T3t,E3t,P3t=v(()=>{P4=(t,e)=>{let r=[];if(t&&r.push(t),e)for(let n of e)r.push(n);return r},aF=(t,e)=>`${t||"anonymous"}${e&&e.length>0?` (a.k.a. ${e.join(",")})`:""}`,Z5=()=>{let t=[],e=[],r=!1,n=new Set,o=d=>d.sort((f,p)=>T3t[p.step]-T3t[f.step]||E3t[p.priority||"normal"]-E3t[f.priority||"normal"]),i=d=>{let f=!1,p=m=>{let h=P4(m.name,m.aliases);if(h.includes(d)){f=!0;for(let g of h)n.delete(g);return!1}return!0};return t=t.filter(p),e=e.filter(p),f},a=d=>{let f=!1,p=m=>{if(m.middleware===d){f=!0;for(let h of P4(m.name,m.aliases))n.delete(h);return!1}return!0};return t=t.filter(p),e=e.filter(p),f},s=d=>(t.forEach(f=>{d.add(f.middleware,{...f})}),e.forEach(f=>{d.addRelativeTo(f.middleware,{...f})}),d.identifyOnResolve?.(c.identifyOnResolve()),d),u=d=>{let f=[];return d.before.forEach(p=>{p.before.length===0&&p.after.length===0?f.push(p):f.push(...u(p))}),f.push(d),d.after.reverse().forEach(p=>{p.before.length===0&&p.after.length===0?f.push(p):f.push(...u(p))}),f},l=(d=!1)=>{let f=[],p=[],m={};return t.forEach(g=>{let y={...g,before:[],after:[]};for(let b of P4(y.name,y.aliases))m[b]=y;f.push(y)}),e.forEach(g=>{let y={...g,before:[],after:[]};for(let b of P4(y.name,y.aliases))m[b]=y;p.push(y)}),p.forEach(g=>{if(g.toMiddleware){let y=m[g.toMiddleware];if(y===void 0){if(d)return;throw new Error(`${g.toMiddleware} is not found when adding ${aF(g.name,g.aliases)} middleware ${g.relation} ${g.toMiddleware}`)}g.relation==="after"&&y.after.push(g),g.relation==="before"&&y.before.push(g)}}),o(f).map(u).reduce((g,y)=>(g.push(...y),g),[])},c={add:(d,f={})=>{let{name:p,override:m,aliases:h}=f,g={step:"initialize",priority:"normal",middleware:d,...f},y=P4(p,h);if(y.length>0){if(y.some(b=>n.has(b))){if(!m)throw new Error(`Duplicate middleware name '${aF(p,h)}'`);for(let b of y){let _=t.findIndex(x=>x.name===b||x.aliases?.some(O=>O===b));if(_===-1)continue;let w=t[_];if(w.step!==g.step||g.priority!==w.priority)throw new Error(`"${aF(w.name,w.aliases)}" middleware with ${w.priority} priority in ${w.step} step cannot be overridden by "${aF(p,h)}" middleware with ${g.priority} priority in ${g.step} step.`);t.splice(_,1)}}for(let b of y)n.add(b)}t.push(g)},addRelativeTo:(d,f)=>{let{name:p,override:m,aliases:h}=f,g={middleware:d,...f},y=P4(p,h);if(y.length>0){if(y.some(b=>n.has(b))){if(!m)throw new Error(`Duplicate middleware name '${aF(p,h)}'`);for(let b of y){let _=e.findIndex(x=>x.name===b||x.aliases?.some(O=>O===b));if(_===-1)continue;let w=e[_];if(w.toMiddleware!==g.toMiddleware||w.relation!==g.relation)throw new Error(`"${aF(w.name,w.aliases)}" middleware ${w.relation} "${w.toMiddleware}" middleware cannot be overridden by "${aF(p,h)}" middleware ${g.relation} "${g.toMiddleware}" middleware.`);e.splice(_,1)}}for(let b of y)n.add(b)}e.push(g)},clone:()=>s(Z5()),use:d=>{d.applyToStack(c)},remove:d=>typeof d=="string"?i(d):a(d),removeByTag:d=>{let f=!1,p=m=>{let{tags:h,name:g,aliases:y}=m;if(h&&h.includes(d)){let b=P4(g,y);for(let _ of b)n.delete(_);return f=!0,!1}return!0};return t=t.filter(p),e=e.filter(p),f},concat:d=>{let f=s(Z5());return f.use(d),f.identifyOnResolve(r||f.identifyOnResolve()||(d.identifyOnResolve?.()??!1)),f},applyToStack:s,identify:()=>l(!0).map(d=>{let f=d.step??d.relation+" "+d.toMiddleware;return aF(d.name,d.aliases)+" - "+f}),identifyOnResolve(d){return typeof d=="boolean"&&(r=d),r},resolve:(d,f)=>{for(let p of l().map(m=>m.middleware).reverse())d=p(d,f);return r&&console.log(c.identify()),d}};return c},T3t={initialize:5,serialize:4,build:3,finalizeRequest:2,deserialize:1},E3t={high:3,normal:2,low:1}});var W3e=v(()=>{P3t()});var M4,M3t=v(()=>{W3e();M4=class{constructor(e){this.middlewareStack=Z5(),this.config=e}send(e,r,n){let o=typeof r!="function"?r:void 0,i=typeof r=="function"?r:n,a=e.resolveMiddleware(this.middlewareStack,this.config,o);if(i)a(e).then(s=>i(null,s.output),s=>i(s)).catch(()=>{});else return a(e).then(s=>s.output)}destroy(){this.config.requestHandler.destroy&&this.config.requestHandler.destroy()}}});var QN,R4,sF,A4,R3t,G3e=v(()=>{QN={},R4=new Array(64);for(let t=0,e=65,r=90;t+e<=r;t++){let n=String.fromCharCode(t+e);QN[n]=t,R4[t]=n}for(let t=0,e=97,r=122;t+e<=r;t++){let n=String.fromCharCode(t+e),o=t+26;QN[n]=o,R4[o]=n}for(let t=0;t<10;t++){QN[t.toString(10)]=t+52;let e=t.toString(10),r=t+52;QN[e]=r,R4[r]=e}QN["+"]=62;R4[62]="+";QN["/"]=63;R4[63]="/";sF=6,A4=8,R3t=63});var uF,A3t=v(()=>{G3e();uF=t=>{let e=t.length/4*3;t.slice(-2)==="=="?e-=2:t.slice(-1)==="="&&e--;let r=new ArrayBuffer(e),n=new DataView(r);for(let o=0;o>=sF;let s=o/4*3;i>>=a%A4;let u=Math.floor(a/A4);for(let l=0;l>c)}}return new Uint8Array(r)}});var Z3e,X3e=v(()=>{Z3e=t=>new TextEncoder().encode(t)});var I3t=v(()=>{X3e()});var N3t=v(()=>{});var j3t=v(()=>{X3e();I3t();N3t()});function lF(t){let e;typeof t=="string"?e=Z3e(t):e=t;let r=typeof e=="object"&&typeof e.length=="number",n=typeof e=="object"&&typeof e.byteOffset=="number"&&typeof e.byteLength=="number";if(!r&&!n)throw new Error("@smithy/util-base64: toBase64 encoder function only accepts string | Uint8Array.");let o="";for(let i=0;i>c]}o+="==".slice(0,4-u)}return o}var D3t=v(()=>{j3t();G3e()});var X5=v(()=>{A3t();D3t()});var Y3e,Q3e=v(()=>{Y3e=t=>new TextEncoder().encode(t)});var $3t=v(()=>{Q3e()});var g_e,L3t=v(()=>{g_e=t=>{if(typeof t=="string")return t;if(typeof t!="object"||typeof t.byteOffset!="number"||typeof t.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(t)}});var e6e=v(()=>{Q3e();$3t();L3t()});function F3t(t,e="utf-8"){return e==="base64"?lF(t):g_e(t)}function k3t(t,e){return e==="base64"?e1.mutate(uF(t)):e1.mutate(Y3e(t))}var q3t=v(()=>{X5();e6e();t6e()});var e1,t6e=v(()=>{q3t();e1=class t extends Uint8Array{static fromString(e,r="utf-8"){switch(typeof e){case"string":return k3t(e,r);default:throw new Error(`Unsupported conversion from ${typeof e} to Uint8ArrayBlobAdapter.`)}}static mutate(e){return Object.setPrototypeOf(e,t.prototype),e}transformToString(e="utf-8"){return F3t(this,e)}}});var B3t=v(()=>{});var U3t=v(()=>{});var z3t=v(()=>{U3t()});var H3t=v(()=>{hd()});var V3t=v(()=>{});var J3t=v(()=>{});var K3t=v(()=>{});var Yte,W3t=v(()=>{Yte=class{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;let r=e;return typeof r.statusCode=="number"&&typeof r.headers=="object"}}});var G3t=v(()=>{});var Z3t=v(()=>{});var X3t=v(()=>{z3t();H3t();V3t();J3t();K3t();W3t();G3t();Z3t()});var gS,h0n,r6e=v(()=>{gS=t=>encodeURIComponent(t).replace(/[!'()*]/g,h0n),h0n=t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`});var Y3t=v(()=>{r6e()});var y_e=v(()=>{r6e();Y3t()});function Q3t(t){let e=[];for(let r of Object.keys(t).sort()){let n=t[r];if(r=gS(r),Array.isArray(n))for(let o=0,i=n.length;o{y_e()});function t6t(t=0){return new Promise((e,r)=>{t&&setTimeout(()=>{let n=new Error(`Request did not complete within ${t} ms`);n.name="TimeoutError",r(n)},t)})}var r6t=v(()=>{});var n6e,cF,n6t=v(()=>{X3t();e6t();r6t();n6e={supported:void 0},cF=class t{static create(e){return typeof e?.handle=="function"?e:new t(e)}constructor(e){typeof e=="function"?this.configProvider=e().then(r=>r||{}):(this.config=e??{},this.configProvider=Promise.resolve(this.config)),n6e.supported===void 0&&(n6e.supported=typeof Request<"u"&&"keepalive"in new Request("https://[::1]"))}destroy(){}async handle(e,{abortSignal:r}={}){this.config||(this.config=await this.configProvider);let n=this.config.requestTimeout,o=this.config.keepAlive===!0,i=this.config.credentials;if(r?.aborted){let y=new Error("Request aborted");return y.name="AbortError",Promise.reject(y)}let a=e.path,s=Q3t(e.query||{});s&&(a+=`?${s}`),e.fragment&&(a+=`#${e.fragment}`);let u="";if(e.username!=null||e.password!=null){let y=e.username??"",b=e.password??"";u=`${y}:${b}@`}let{port:l,method:c}=e,d=`${e.protocol}//${u}${e.hostname}${l?`:${l}`:""}${a}`,f=c==="GET"||c==="HEAD"?void 0:e.body,p={body:f,headers:new Headers(e.headers),method:c,credentials:i};f&&(p.duplex="half"),typeof AbortController<"u"&&(p.signal=r),n6e.supported&&(p.keepalive=o);let m=()=>{},h=new Request(d,p),g=[fetch(h).then(y=>{let b=y.headers,_={};for(let x of b.entries())_[x[0]]=x[1];return y.body!=null?{response:new Yte({headers:_,reason:y.statusText,statusCode:y.status,body:y.body})}:y.blob().then(x=>({response:new Yte({headers:_,reason:y.statusText,statusCode:y.status,body:x})}))}),t6t(n)];return r&&g.push(new Promise((y,b)=>{let _=()=>{let w=new Error("Request aborted");w.name="AbortError",b(w)};if(typeof r.addEventListener=="function"){let w=r;w.addEventListener("abort",_,{once:!0}),m=()=>w.removeEventListener("abort",_)}else r.onabort=_})),Promise.race(g).finally(m)}updateHttpClientConfig(e,r){this.config=void 0,this.configProvider=this.configProvider.then(n=>(n[e]=r,n))}httpHandlerConfigs(){return this.config??{}}}});async function g0n(t){let e=await b0n(t),r=uF(e);return new Uint8Array(r)}async function y0n(t){let e=[],r=t.getReader(),n=!1,o=0;for(;!n;){let{done:s,value:u}=await r.read();u&&(e.push(u),o+=u.length),n=s}let i=new Uint8Array(o),a=0;for(let s of e)i.set(s,a),a+=s.length;return i}function b0n(t){return new Promise((e,r)=>{let n=new FileReader;n.onloadend=()=>{if(n.readyState!==2)return r(new Error("Reader aborted too early"));let o=n.result??"",i=o.indexOf(","),a=i>-1?i+1:o.length;e(o.substring(a))},n.onabort=()=>r(new Error("Read aborted")),n.onerror=()=>r(n.error),n.readAsDataURL(t)})}var Y5,o6t=v(()=>{X5();Y5=t=>typeof Blob=="function"&&t instanceof Blob?g0n(t):y0n(t)});var Qte=v(()=>{n6t();o6t()});function a6t(t){let e="";for(let r=0;r{i6t={},_0n={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),i6t[t]=e,_0n[e]=t}});var o6e,i6e=v(()=>{o6e=t=>typeof ReadableStream=="function"&&(t?.constructor?.name===ReadableStream.name||t instanceof ReadableStream)});var u6t,c6t,l6t,d6t=v(()=>{Qte();X5();s6t();e6e();i6e();u6t="The stream has already been transformed.",c6t=t=>{if(!l6t(t)&&!o6e(t)){let o=t?.__proto__?.constructor?.name||t;throw new Error(`Unexpected stream implementation, expect Blob or ReadableStream, got ${o}`)}let e=!1,r=async()=>{if(e)throw new Error(u6t);return e=!0,await Y5(t)},n=o=>{if(typeof o.stream!="function")throw new Error(`Cannot transform payload Blob to web stream. Please make sure the Blob.stream() is polyfilled. +If you are using React Native, this API is not yet supported, see: https://react-native.canny.io/feature-requests/p/fetch-streaming-body`);return o.stream()};return Object.assign(t,{transformToByteArray:r,transformToString:async o=>{let i=await r();if(o==="base64")return lF(i);if(o==="hex")return a6t(i);if(o===void 0||o==="utf8"||o==="utf-8")return g_e(i);if(typeof TextDecoder=="function")return new TextDecoder(o).decode(i);throw new Error("TextDecoder is not available, please make sure polyfill is provided.")},transformToWebStream:()=>{if(e)throw new Error(u6t);if(e=!0,l6t(t))return n(t);if(o6e(t))return t;throw new Error(`Cannot transform payload to web stream, got ${t}`)}})},l6t=t=>typeof Blob=="function"&&t instanceof Blob});var f6t=v(()=>{});var p6t=v(()=>{});var a6e=v(()=>{t6e();B3t();d6t();f6t();p6t();i6e()});var dF,m6t=v(()=>{a6e();dF=async(t=new Uint8Array,e)=>{if(t instanceof Uint8Array)return e1.mutate(t);if(!t)return e1.mutate(new Uint8Array);let r=e.streamCollector(t);return e1.mutate(await r)}});var gr,s6e,h6t=v(()=>{W3e();hd();gr=class{constructor(){this.middlewareStack=Z5()}static classBuilder(){return new s6e}resolveMiddlewareWithContext(e,r,n,{middlewareFn:o,clientName:i,commandName:a,inputFilterSensitiveLog:s,outputFilterSensitiveLog:u,smithyContext:l,additionalContext:c,CommandCtor:d}){for(let g of o.bind(this)(d,e,r,n))this.middlewareStack.use(g);let f=e.concat(this.middlewareStack),{logger:p}=r,m={logger:p,clientName:i,commandName:a,inputFilterSensitiveLog:s,outputFilterSensitiveLog:u,[H5]:{commandInstance:this,...l},...c},{requestHandler:h}=r;return f.resolve(g=>h.handle(g.request,n||{}),m)}},s6e=class{constructor(){this._init=()=>{},this._ep={},this._middlewareFn=()=>[],this._commandName="",this._clientName="",this._additionalContext={},this._smithyContext={},this._inputFilterSensitiveLog=e=>e,this._outputFilterSensitiveLog=e=>e,this._serializer=null,this._deserializer=null}init(e){this._init=e}ep(e){return this._ep=e,this}m(e){return this._middlewareFn=e,this}s(e,r,n={}){return this._smithyContext={service:e,operation:r,...n},this}c(e={}){return this._additionalContext=e,this}n(e,r){return this._clientName=e,this._commandName=r,this}f(e=n=>n,r=n=>n){return this._inputFilterSensitiveLog=e,this._outputFilterSensitiveLog=r,this}ser(e){return this._serializer=e,this}de(e){return this._deserializer=e,this}build(){let e=this,r;return r=class extends gr{static getEndpointParameterInstructions(){return e._ep}constructor(...[n]){super(),this.serialize=e._serializer,this.deserialize=e._deserializer,this.input=n??{},e._init(this)}resolveMiddleware(n,o,i){return this.resolveMiddlewareWithContext(n,o,i,{CommandCtor:r,middlewareFn:e._middlewareFn,clientName:e._clientName,commandName:e._commandName,inputFilterSensitiveLog:e._inputFilterSensitiveLog,outputFilterSensitiveLog:e._outputFilterSensitiveLog,smithyContext:e._smithyContext,additionalContext:e._additionalContext})}}}}});var b_e,g6t=v(()=>{b_e="***SensitiveInformation***"});var __e,y6t=v(()=>{__e=(t,e)=>{for(let r of Object.keys(t)){let n=t[r],o=async function(a,s,u){let l=new n(a);if(typeof s=="function")this.send(l,s);else if(typeof u=="function"){if(typeof s!="object")throw new Error(`Expected http options but got ${typeof s}`);this.send(l,s||{},u)}else return this.send(l,s)},i=(r[0].toLowerCase()+r.slice(1)).replace(/Command$/,"");e.prototype[i]=o}}});var I4,v0n,b6t,w0n,_6t,v6t,w6t,u6e,S0n,Q5,ei,S6t,C6t,C0n,ere,tre,l6e,x6t,O6t,T6t,c6e=v(()=>{I4=t=>{if(t!=null){if(typeof t=="string"){let e=parseFloat(t);if(!Number.isNaN(e))return String(e)!==String(t)&&T6t.warn(O6t(`Expected number but observed string: ${t}`)),e}if(typeof t=="number")return t;throw new TypeError(`Expected number, got ${typeof t}: ${t}`)}},v0n=Math.ceil(34028234663852886e22),b6t=t=>{let e=I4(t);if(e!==void 0&&!Number.isNaN(e)&&e!==1/0&&e!==-1/0&&Math.abs(e)>v0n)throw new TypeError(`Expected 32-bit float, got ${t}`);return e},w0n=t=>{if(t!=null){if(Number.isInteger(t)&&!Number.isNaN(t))return t;throw new TypeError(`Expected integer, got ${typeof t}: ${t}`)}},_6t=t=>u6e(t,32),v6t=t=>u6e(t,16),w6t=t=>u6e(t,8),u6e=(t,e)=>{let r=w0n(t);if(r!==void 0&&S0n(r,e)!==r)throw new TypeError(`Expected ${e}-bit integer, got ${t}`);return r},S0n=(t,e)=>{switch(e){case 32:return Int32Array.of(t)[0];case 16:return Int16Array.of(t)[0];case 8:return Int8Array.of(t)[0]}},Q5=(t,e)=>{if(t==null)throw e?new TypeError(`Expected a non-null value for ${e}`):new TypeError("Expected a non-null value");return t},ei=t=>{if(t!=null){if(typeof t=="string")return t;if(["boolean","number","bigint"].includes(typeof t))return T6t.warn(O6t(`Expected string, got ${typeof t}: ${t}`)),String(t);throw new TypeError(`Expected string, got ${typeof t}: ${t}`)}},S6t=t=>I4(typeof t=="string"?ere(t):t),C6t=t=>b6t(typeof t=="string"?ere(t):t),C0n=/(-?(?:0|[1-9]\d*)(?:\.\d+)?(?:[eE][+-]?\d+)?)|(-?Infinity)|(NaN)/g,ere=t=>{let e=t.match(C0n);if(e===null||e[0].length!==t.length)throw new TypeError("Expected real number, got implicit NaN");return parseFloat(t)},tre=t=>_6t(typeof t=="string"?ere(t):t),l6e=t=>v6t(typeof t=="string"?ere(t):t),x6t=t=>w6t(typeof t=="string"?ere(t):t),O6t=t=>String(new TypeError(t).stack||t).split(` +`).slice(0,5).filter(e=>!e.includes("stackTraceWarning")).join(` +`),T6t={warn:console.warn}});var x0n,O0n,E6t,T0n,P6t,dWi,fWi,pWi,v_e,M6t,mWi,E0n,P0n,M0n,N4,R0n,A0n,d6e,R6t=v(()=>{c6e();x0n=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],O0n=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?[zZ]$/),E6t=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let e=O0n.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");let[r,n,o,i,a,s,u,l]=e,c=l6e(d6e(n)),d=N4(o,"month",1,12),f=N4(i,"day",1,31);return M6t(c,d,f,{hours:a,minutes:s,seconds:u,fractionalMilliseconds:l})},T0n=new RegExp(/^(\d{4})-(\d{2})-(\d{2})[tT](\d{2}):(\d{2}):(\d{2})(?:\.(\d+))?(([-+]\d{2}\:\d{2})|[zZ])$/),P6t=t=>{if(t==null)return;if(typeof t!="string")throw new TypeError("RFC-3339 date-times must be expressed as strings");let e=T0n.exec(t);if(!e)throw new TypeError("Invalid RFC-3339 date-time value");let[r,n,o,i,a,s,u,l,c]=e,d=l6e(d6e(n)),f=N4(o,"month",1,12),p=N4(i,"day",1,31),m=M6t(d,f,p,{hours:a,minutes:s,seconds:u,fractionalMilliseconds:l});return c.toUpperCase()!="Z"&&m.setTime(m.getTime()-A0n(c)),m},dWi=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d{2}) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),fWi=new RegExp(/^(?:Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d{2})-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? GMT$/),pWi=new RegExp(/^(?:Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( [1-9]|\d{2}) (\d{1,2}):(\d{2}):(\d{2})(?:\.(\d+))? (\d{4})$/),v_e=t=>{if(t==null)return;let e;if(typeof t=="number")e=t;else if(typeof t=="string")e=S6t(t);else if(typeof t=="object"&&t.tag===1)e=t.value;else throw new TypeError("Epoch timestamps must be expressed as floating point numbers or their string representation");if(Number.isNaN(e)||e===1/0||e===-1/0)throw new TypeError("Epoch timestamps must be valid, non-Infinite, non-NaN numerics");return new Date(Math.round(e*1e3))},M6t=(t,e,r,n)=>{let o=e-1;return P0n(t,o,r),new Date(Date.UTC(t,o,r,N4(n.hours,"hour",0,23),N4(n.minutes,"minute",0,59),N4(n.seconds,"seconds",0,60),R0n(n.fractionalMilliseconds)))},mWi=50*365*24*60*60*1e3,E0n=[31,28,31,30,31,30,31,31,30,31,30,31],P0n=(t,e,r)=>{let n=E0n[e];if(e===1&&M0n(t)&&(n=29),r>n)throw new TypeError(`Invalid day for ${x0n[e]} in ${t}: ${r}`)},M0n=t=>t%4===0&&(t%100!==0||t%400===0),N4=(t,e,r,n)=>{let o=x6t(d6e(t));if(on)throw new TypeError(`${e} must be between ${r} and ${n}, inclusive`);return o},R0n=t=>t==null?0:C6t("0."+t)*1e3,A0n=t=>{let e=t[0],r=1;if(e=="+")r=1;else if(e=="-")r=-1;else throw new TypeError(`Offset direction, ${e}, must be "+" or "-"`);let n=Number(t.substring(1,3)),o=Number(t.substring(4,6));return r*(n*60+o)*60*1e3},d6e=t=>{let e=0;for(;e{eK=class t extends Error{constructor(e){super(e.message),Object.setPrototypeOf(this,t.prototype),this.name=e.name,this.$fault=e.$fault,this.$metadata=e.$metadata}},nc=(t,e={})=>{Object.entries(e).filter(([,n])=>n!==void 0).forEach(([n,o])=>{(t[n]==null||t[n]==="")&&(t[n]=o)});let r=t.message||t.Message||"UnknownError";return t.message=r,delete t.Message,t}});var I0n,w_e,N0n,A6t=v(()=>{f6e();I0n=({output:t,parsedBody:e,exceptionCtor:r,errorCode:n})=>{let o=N0n(t),i=o.httpStatusCode?o.httpStatusCode+"":void 0,a=new r({name:e?.code||e?.Code||n||i||"UnknownError",$fault:"client",$metadata:o});throw nc(a,e)},w_e=t=>({output:e,parsedBody:r,errorCode:n})=>{I0n({output:e,parsedBody:r,exceptionCtor:t,errorCode:n})},N0n=t=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]})});var S_e,I6t=v(()=>{S_e=t=>{switch(t){case"standard":return{retryMode:"standard",connectionTimeout:3100};case"in-region":return{retryMode:"standard",connectionTimeout:1100};case"cross-region":return{retryMode:"standard",connectionTimeout:3100};case"mobile":return{retryMode:"standard",connectionTimeout:3e4};default:return{}}}});var N6t=v(()=>{});var j6t,D6t,$6t=v(()=>{hd();j6t=t=>{let e=[];for(let r in z5){let n=z5[r];t[n]!==void 0&&e.push({algorithmId:()=>n,checksumConstructor:()=>t[n]})}return{_checksumAlgorithms:e,addChecksumAlgorithm(r){this._checksumAlgorithms.push(r)},checksumAlgorithms(){return this._checksumAlgorithms}}},D6t=t=>{let e={};return t.checksumAlgorithms().forEach(r=>{e[r.algorithmId()]=r.checksumConstructor()}),e}});var L6t,F6t,k6t=v(()=>{L6t=t=>{let e=t.retryStrategy;return{setRetryStrategy(r){e=r},retryStrategy(){return e}}},F6t=t=>{let e={};return e.retryStrategy=t.retryStrategy(),e}});var C_e,x_e,q6t=v(()=>{$6t();k6t();C_e=t=>({...j6t(t),...L6t(t)}),x_e=t=>({...D6t(t),...F6t(t)})});var B6t=v(()=>{q6t()});function O_e(t){return encodeURIComponent(t).replace(/[!'()*]/g,function(e){return"%"+e.charCodeAt(0).toString(16).toUpperCase()})}var p6e=v(()=>{});var U6t=v(()=>{});var m6e,z6t=v(()=>{m6e=t=>{let e="#text";for(let r in t)t.hasOwnProperty(r)&&t[r][e]!==void 0?t[r]=t[r][e]:typeof t[r]=="object"&&t[r]!==null&&(t[r]=m6e(t[r]));return t}});var h6e,H6t=v(()=>{h6e=function(){let t=Object.getPrototypeOf(this).constructor,e=Function.bind.apply(String,[null,...arguments]),r=new e;return Object.setPrototypeOf(r,t.prototype),r};h6e.prototype=Object.create(String.prototype,{constructor:{value:h6e,enumerable:!1,writable:!0,configurable:!0}});Object.setPrototypeOf(h6e,String)});var rre,j0n,D0n,$0n,V6t=v(()=>{rre=(t,e)=>{let r={};for(let n in e)j0n(r,t,e,n);return r},j0n=(t,e,r,n)=>{if(e!==null){let a=r[n];typeof a=="function"&&(a=[,a]);let[s=D0n,u=$0n,l=n]=a;(typeof s=="function"&&s(e[l])||typeof s!="function"&&s)&&(t[n]=u(e[l]));return}let[o,i]=r[n];if(typeof i=="function"){let a,s=o===void 0&&(a=i())!=null,u=typeof o=="function"&&!!o(void 0)||typeof o!="function"&&!!o;s?t[n]=a:u&&(t[n]=i())}else{let a=o===void 0&&i!=null,s=typeof o=="function"&&!!o(i)||typeof o!="function"&&!!o;(a||s)&&(t[n]=i)}},D0n=t=>t!=null,$0n=t=>t});var J6t=v(()=>{p6e()});var K6t=v(()=>{});var Qr,W6t=v(()=>{Qr=t=>{if(t==null)return{};if(Array.isArray(t))return t.filter(e=>e!=null).map(Qr);if(typeof t=="object"){let e={};for(let r of Object.keys(t))t[r]!=null&&(e[r]=Qr(t[r]));return e}return t}});var G6t=v(()=>{});var tn=v(()=>{O3t();M3t();m6t();h6t();g6t();y6t();R6t();A6t();I6t();N6t();B6t();f6e();p6e();U6t();z6t();H6t();V6t();c6e();J6t();K6t();W6t();G6t()});var Z6t,X6t=v(()=>{Z6t=t=>t?.body instanceof ReadableStream});var L0n,F0n,k0n,q0n,g6e,T_e,B0n,Y6t=v(()=>{m_e();Gte();tn();nT();kU();X6t();J3e();L0n=t=>(e,r)=>async n=>{let o=await t.retryStrategy(),i=await t.maxAttempts();if(F0n(o)){o=o;let a=await o.acquireInitialRetryToken(r.partition_id),s=new Error,u=0,l=0,{request:c}=n,d=G5.isInstance(c);for(d&&(c.headers[l_e]=gv());;)try{d&&(c.headers[c_e]=`attempt=${u+1}; max=${i}`);let{response:f,output:p}=await e(n);return o.recordSuccess(a),p.$metadata.attempts=u+1,p.$metadata.totalRetryDelay=l,{response:f,output:p}}catch(f){let p=k0n(f);if(s=V3e(f),d&&Z6t(c))throw(r.logger instanceof iF?console:r.logger)?.warn("An error was encountered in a non-retryable streaming request."),s;try{a=await o.refreshRetryTokenForRetry(a,p)}catch{throw s.$metadata||(s.$metadata={}),s.$metadata.attempts=u+1,s.$metadata.totalRetryDelay=l,s}u=a.getRetryCount();let m=a.getRetryDelay();l+=m,await new Promise(h=>setTimeout(h,m))}}else return o=o,o?.mode&&(r.userAgent=[...r.userAgent||[],["cfg/retry-mode",o.mode]]),o.retry(e,n)},F0n=t=>typeof t.acquireInitialRetryToken<"u"&&typeof t.refreshRetryTokenForRetry<"u"&&typeof t.recordSuccess<"u",k0n=t=>{let e={error:t,errorType:q0n(t)},r=B0n(t.$response);return r&&(e.retryAfterHint=r),e},q0n=t=>J5(t)?"THROTTLING":u_e(t)?"TRANSIENT":t3t(t)?"SERVER_ERROR":"CLIENT_ERROR",g6e={name:"retryMiddleware",tags:["RETRY"],step:"finalizeRequest",priority:"high",override:!0},T_e=t=>({applyToStack:e=>{e.add(L0n(t),g6e)}}),B0n=t=>{if(!Xte.isInstance(t))return;let e=Object.keys(t.headers).find(i=>i.toLowerCase()==="retry-after");if(!e)return;let r=t.headers[e],n=Number(r);return Number.isNaN(n)?new Date(r):new Date(n*1e3)}});var E_e=v(()=>{S3t();K3e();C3t();z3e();x3t();H3e();Y6t()});var U0n,P_e,Q6t=v(()=>{E_e();k3e();U0n={step:"finalizeRequest",tags:["HTTP_SIGNING"],name:"httpSigningMiddleware",aliases:["apiKeyMiddleware","tokenMiddleware","awsAuthMiddleware"],override:!0,relation:"after",toMiddleware:g6e.name},P_e=t=>({applyToStack:e=>{e.addRelativeTo(GJt(t),U0n)}})});var e5t=v(()=>{k3e();Q6t()});var tK,t5t=v(()=>{tK=class{constructor(e){this.authSchemes=new Map;for(let[r,n]of Object.entries(e))n!==void 0&&this.authSchemes.set(r,n)}getIdentityProvider(e){return this.authSchemes.get(e)}}});var r5t=v(()=>{Kte();hd()});var n5t=v(()=>{Kte()});var rK,o5t=v(()=>{rK=class{async sign(e,r,n){return e}}});var i5t=v(()=>{r5t();n5t();o5t()});var z0n,a5t,y6e,s5t,u5t=v(()=>{z0n=t=>e=>y6e(e)&&e.expiration.getTime()-Date.now()t.expiration!==void 0,s5t=(t,e,r)=>{if(t===void 0)return;let n=typeof t!="function"?async()=>Promise.resolve(t):t,o,i,a,s=!1,u=async l=>{i||(i=n(l));try{o=await i,a=!0,s=!1}finally{i=void 0}return o};return e===void 0?async l=>((!a||l?.forceRefresh)&&(o=await u(l)),o):async l=>((!a||l?.forceRefresh)&&(o=await u(l)),s?o:r(o)?(e(o)&&await u(l),o):(s=!0,o))}});var l5t=v(()=>{t5t();i5t();u5t()});var c5t=v(()=>{hd()});var nK,d5t=v(()=>{nK=t=>{if(typeof t=="function")return t;let e=Promise.resolve(t);return()=>e}});var f5t=v(()=>{Kte();tn()});function b6e(t,e,r,n,o){return async function*(a,s,...u){let l=a.startingToken||void 0,c=!0,d;for(;c;){if(s[r]=l,o&&(s[o]=s[o]??a.pageSize),a.client instanceof t)d=await H0n(e,a.client,s,...u);else throw new Error(`Invalid client, expected instance of ${t.name}`);yield d;let f=l;l=V0n(d,n),c=!!(l&&(!a.stopOnSameToken||l!==f))}return void 0}}var H0n,V0n,p5t=v(()=>{H0n=async(t,e,r,...n)=>await e.send(new t(r),...n);V0n=(t,e)=>{let r=t,n=e.split(".");for(let o of n){if(!r||typeof r!="object")return;r=r[o]}return r}});var fF=v(()=>{kJt();e5t();l5t();c5t();d5t();f5t();p5t()});var m5t=v(()=>{});var h5t=v(()=>{m5t()});var g5t=v(()=>{hd()});var y5t=v(()=>{});var b5t=v(()=>{});function J0n(t){return Object.keys(t).reduce((e,r)=>{let n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}var M_e,_5t=v(()=>{M_e=class t{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){let r=new t({...e,headers:{...e.headers}});return r.query&&(r.query=J0n(r.query)),r}static isInstance(e){if(!e)return!1;let r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return t.clone(this)}}});var v5t=v(()=>{});var w5t=v(()=>{});var S5t=v(()=>{});var C5t=v(()=>{h5t();g5t();y5t();b5t();_5t();v5t();w5t();S5t()});function K0n(t){return e=>async r=>{let n=r.request;if(M_e.isInstance(n)){let{body:o,headers:i}=n;if(o&&Object.keys(i).map(a=>a.toLowerCase()).indexOf(x5t)===-1)try{let a=t(o);n.headers={...n.headers,[x5t]:String(a)}}catch{}}return e({...r,request:n})}}var x5t,W0n,R_e,_6e=v(()=>{C5t();x5t="content-length";W0n={step:"build",tags:["SET_CONTENT_LENGTH","CONTENT_LENGTH"],name:"contentLengthMiddleware",override:!0},R_e=t=>({applyToStack:e=>{e.add(K0n(t.bodyLengthChecker),W0n)}})});var O5t=v(()=>{});var T5t=v(()=>{O5t()});var E5t=v(()=>{});var P5t=v(()=>{E5t()});var M5t=v(()=>{hd()});var R5t=v(()=>{});var A5t=v(()=>{});function G0n(t){return Object.keys(t).reduce((e,r)=>{let n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}var pF,I5t=v(()=>{pF=class t{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){let r=new t({...e,headers:{...e.headers}});return r.query&&(r.query=G0n(r.query)),r}static isInstance(e){if(!e)return!1;let r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return t.clone(this)}}});var A_e,N5t=v(()=>{A_e=class{constructor(e){this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;let r=e;return typeof r.statusCode=="number"&&typeof r.headers=="object"}}});var j5t=v(()=>{});var D5t=v(()=>{});var nre=v(()=>{P5t();M5t();R5t();A5t();I5t();N5t();j5t();D5t()});var v6e,$5t=v(()=>{nre();v6e=t=>A_e.isInstance(t)?t.headers?.date??t.headers?.Date:void 0});var I_e,w6e=v(()=>{I_e=t=>new Date(Date.now()+t)});var L5t,F5t=v(()=>{w6e();L5t=(t,e)=>Math.abs(I_e(e).getTime()-t)>=3e5});var S6e,k5t=v(()=>{F5t();S6e=(t,e)=>{let r=Date.parse(t);return L5t(r,e)?r-Date.now():e}});var q5t=v(()=>{$5t();w6e();k5t()});var ore,B5t,j4,U5t=v(()=>{nre();q5t();ore=(t,e)=>{if(!e)throw new Error(`Property \`${t}\` is not resolved for AWS SDK SigV4Auth`);return e},B5t=async t=>{let e=ore("context",t.context),r=ore("config",t.config),n=e.endpointV2?.properties?.authSchemes?.[0],i=await ore("signer",r.signer)(n),a=t?.signingRegion,s=t?.signingRegionSet,u=t?.signingName;return{config:r,signer:i,signingRegion:a,signingRegionSet:s,signingName:u}},j4=class{async sign(e,r,n){if(!pF.isInstance(e))throw new Error("The request is not an instance of `HttpRequest` and cannot be signed");let o=await B5t(n),{config:i,signer:a}=o,{signingRegion:s,signingName:u}=o,l=n.context;if(l?.authSchemes?.length??!1){let[d,f]=l.authSchemes;d?.name==="sigv4a"&&f?.name==="sigv4"&&(s=f?.signingRegion??s,u=f?.signingName??u)}return await a.sign(e,{signingDate:I_e(i.systemClockOffset),signingRegion:s,signingService:u})}errorHandler(e){return r=>{let n=r.ServerTime??v6e(r.$response);if(n){let o=ore("config",e.config),i=o.systemClockOffset;o.systemClockOffset=S6e(n,o.systemClockOffset),o.systemClockOffset!==i&&r.$metadata&&(r.$metadata.clockSkewCorrected=!0)}throw r}}successHandler(e,r){let n=v6e(e);if(n){let o=ore("config",r.config);o.systemClockOffset=S6e(n,o.systemClockOffset)}}}});var z5t=v(()=>{fF();ZN()});function V5t(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let e=new Uint8Array(t.length/2);for(let r=0;r{H5t={},C6e={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),H5t[t]=e,C6e[e]=t}});var are,x6e=v(()=>{are=t=>new TextEncoder().encode(t)});var mF,J5t=v(()=>{x6e();mF=t=>typeof t=="string"?are(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t)});var K5t=v(()=>{});var sre=v(()=>{x6e();J5t();K5t()});var W5t,G5t,O6e,Z5t,X5t,T6e,E6e,P6e,M6e,Z0n,Y5t,Q5t,ure,eKt,tKt,rKt,nKt,N_e,oKt,iKt,aKt,R6e,sKt,D4=v(()=>{W5t="X-Amz-Algorithm",G5t="X-Amz-Credential",O6e="X-Amz-Date",Z5t="X-Amz-SignedHeaders",X5t="X-Amz-Expires",T6e="X-Amz-Signature",E6e="X-Amz-Security-Token",P6e="authorization",M6e=O6e.toLowerCase(),Z0n="date",Y5t=[P6e,M6e,Z0n],Q5t=T6e.toLowerCase(),ure="x-amz-content-sha256",eKt=E6e.toLowerCase(),tKt={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},rKt=/^proxy-/,nKt=/^sec-/,N_e="AWS4-HMAC-SHA256",oKt="AWS4-HMAC-SHA256-PAYLOAD",iKt="UNSIGNED-PAYLOAD",aKt=50,R6e="aws4_request",sKt=60*60*24*7});var j_e,A6e,D_e,lKt,uKt,I6e=v(()=>{ire();sre();D4();j_e={},A6e=[],D_e=(t,e,r)=>`${t}/${e}/${r}/${R6e}`,lKt=async(t,e,r,n,o)=>{let i=await uKt(t,e.secretAccessKey,e.accessKeyId),a=`${r}:${n}:${o}:${hC(i)}:${e.sessionToken}`;if(a in j_e)return j_e[a];for(A6e.push(a);A6e.length>aKt;)delete j_e[A6e.shift()];let s=`AWS4${e.secretAccessKey}`;for(let u of[r,n,o,R6e])s=await uKt(t,s,u);return j_e[a]=s},uKt=(t,e,r)=>{let n=new t(e);return n.update(mF(r)),n.digest()}});var $_e,N6e=v(()=>{D4();$_e=({headers:t},e,r)=>{let n={};for(let o of Object.keys(t).sort()){if(t[o]==null)continue;let i=o.toLowerCase();(i in tKt||e?.has(i)||rKt.test(i)||nKt.test(i))&&(!r||r&&!r.has(i))||(n[i]=t[o].trim().replace(/\s+/g," "))}return n}});var j6e,D6e=v(()=>{y_e();D4();j6e=({query:t={}})=>{let e=[],r={};for(let n of Object.keys(t).sort()){if(n.toLowerCase()===Q5t)continue;e.push(n);let o=t[n];typeof o=="string"?r[n]=`${gS(n)}=${gS(o)}`:Array.isArray(o)&&(r[n]=o.slice(0).reduce((i,a)=>i.concat([`${gS(n)}=${gS(a)}`]),[]).sort().join("&"))}return e.map(n=>r[n]).filter(n=>n).join("&")}});var cKt,dKt=v(()=>{cKt=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]"});var lre,$6e=v(()=>{dKt();ire();sre();D4();lre=async({headers:t,body:e},r)=>{for(let n of Object.keys(t))if(n.toLowerCase()===ure)return t[n];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||cKt(e)){let n=new r;return n.update(mF(e)),hC(await n.digest())}return iKt}});function pKt(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}var L_e,fKt,X0n,L6e,mKt=v(()=>{ire();sre();L_e=class{format(e){let r=[];for(let i of Object.keys(e)){let a=are(i);r.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(e[i]))}let n=new Uint8Array(r.reduce((i,a)=>i+a.byteLength,0)),o=0;for(let i of r)n.set(i,o),o+=i.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":let r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,e.value,!1),new Uint8Array(r.buffer);case"integer":let n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":let o=new Uint8Array(9);return o[0]=5,o.set(e.value.bytes,1),o;case"binary":let i=new DataView(new ArrayBuffer(3+e.value.byteLength));i.setUint8(0,6),i.setUint16(1,e.value.byteLength,!1);let a=new Uint8Array(i.buffer);return a.set(e.value,3),a;case"string":let s=are(e.value),u=new DataView(new ArrayBuffer(3+s.byteLength));u.setUint8(0,7),u.setUint16(1,s.byteLength,!1);let l=new Uint8Array(u.buffer);return l.set(s,3),l;case"timestamp":let c=new Uint8Array(9);return c[0]=8,c.set(L6e.fromNumber(e.value.valueOf()).bytes,1),c;case"uuid":if(!X0n.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);let d=new Uint8Array(17);return d[0]=9,d.set(V5t(e.value.replace(/\-/g,"")),1),d}}};(function(t){t[t.boolTrue=0]="boolTrue",t[t.boolFalse=1]="boolFalse",t[t.byte=2]="byte",t[t.short=3]="short",t[t.integer=4]="integer",t[t.long=5]="long",t[t.byteArray=6]="byteArray",t[t.string=7]="string",t[t.timestamp=8]="timestamp",t[t.uuid=9]="uuid"})(fKt||(fKt={}));X0n=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,L6e=class t{constructor(e){if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);let r=new Uint8Array(8);for(let n=7,o=Math.abs(Math.round(e));n>-1&&o>0;n--,o/=256)r[n]=o;return e<0&&pKt(r),new t(r)}valueOf(){let e=this.bytes.slice(0),r=e[0]&128;return r&&pKt(e),parseInt(hC(e),16)*(r?-1:1)}toString(){return String(this.valueOf())}}});var hKt,gKt=v(()=>{hKt=(t,e)=>{t=t.toLowerCase();for(let r of Object.keys(e))if(t===r.toLowerCase())return!0;return!1}});var F6e,k6e=v(()=>{nre();F6e=(t,e={})=>{let{headers:r,query:n={}}=pF.clone(t);for(let o of Object.keys(r)){let i=o.toLowerCase();i.slice(0,6)==="x-amz-"&&!e.unhoistableHeaders?.has(i)&&(n[o]=r[o],delete r[o])}return{...t,headers:r,query:n}}});var F_e,q6e=v(()=>{nre();D4();F_e=t=>{t=pF.clone(t);for(let e of Object.keys(t.headers))Y5t.indexOf(e.toLowerCase())>-1&&delete t.headers[e];return t}});var yKt,Y0n,bKt=v(()=>{yKt=t=>Y0n(t).toISOString().replace(/\.\d{3}Z$/,"Z"),Y0n=t=>typeof t=="number"?new Date(t*1e3):typeof t=="string"?Number(t)?new Date(Number(t)*1e3):new Date(t):t});var cre,k_e,_Kt,vKt=v(()=>{ire();pC();y_e();sre();D4();I6e();N6e();D6e();$6e();mKt();gKt();k6e();q6e();bKt();cre=class{constructor({applyChecksum:e,credentials:r,region:n,service:o,sha256:i,uriEscapePath:a=!0}){this.headerFormatter=new L_e,this.service=o,this.sha256=i,this.uriEscapePath=a,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=py(n),this.credentialProvider=py(r)}async presign(e,r={}){let{signingDate:n=new Date,expiresIn:o=3600,unsignableHeaders:i,unhoistableHeaders:a,signableHeaders:s,signingRegion:u,signingService:l}=r,c=await this.credentialProvider();this.validateResolvedCredentials(c);let d=u??await this.regionProvider(),{longDate:f,shortDate:p}=k_e(n);if(o>sKt)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");let m=D_e(p,d,l??this.service),h=F6e(F_e(e),{unhoistableHeaders:a});c.sessionToken&&(h.query[E6e]=c.sessionToken),h.query[W5t]=N_e,h.query[G5t]=`${c.accessKeyId}/${m}`,h.query[O6e]=f,h.query[X5t]=o.toString(10);let g=$_e(h,i,s);return h.query[Z5t]=_Kt(g),h.query[T6e]=await this.getSignature(f,m,this.getSigningKey(c,d,p,l),this.createCanonicalRequest(h,g,await lre(e,this.sha256))),h}async sign(e,r){return typeof e=="string"?this.signString(e,r):e.headers&&e.payload?this.signEvent(e,r):e.message?this.signMessage(e,r):this.signRequest(e,r)}async signEvent({headers:e,payload:r},{signingDate:n=new Date,priorSignature:o,signingRegion:i,signingService:a}){let s=i??await this.regionProvider(),{shortDate:u,longDate:l}=k_e(n),c=D_e(u,s,a??this.service),d=await lre({headers:{},body:r},this.sha256),f=new this.sha256;f.update(e);let p=hC(await f.digest()),m=[oKt,l,c,o,p,d].join(` +`);return this.signString(m,{signingDate:n,signingRegion:s,signingService:a})}async signMessage(e,{signingDate:r=new Date,signingRegion:n,signingService:o}){return this.signEvent({headers:this.headerFormatter.format(e.message.headers),payload:e.message.body},{signingDate:r,signingRegion:n,signingService:o,priorSignature:e.priorSignature}).then(a=>({message:e.message,signature:a}))}async signString(e,{signingDate:r=new Date,signingRegion:n,signingService:o}={}){let i=await this.credentialProvider();this.validateResolvedCredentials(i);let a=n??await this.regionProvider(),{shortDate:s}=k_e(r),u=new this.sha256(await this.getSigningKey(i,a,s,o));return u.update(mF(e)),hC(await u.digest())}async signRequest(e,{signingDate:r=new Date,signableHeaders:n,unsignableHeaders:o,signingRegion:i,signingService:a}={}){let s=await this.credentialProvider();this.validateResolvedCredentials(s);let u=i??await this.regionProvider(),l=F_e(e),{longDate:c,shortDate:d}=k_e(r),f=D_e(d,u,a??this.service);l.headers[M6e]=c,s.sessionToken&&(l.headers[eKt]=s.sessionToken);let p=await lre(l,this.sha256);!hKt(ure,l.headers)&&this.applyChecksum&&(l.headers[ure]=p);let m=$_e(l,o,n),h=await this.getSignature(c,f,this.getSigningKey(s,u,d,a),this.createCanonicalRequest(l,m,p));return l.headers[P6e]=`${N_e} Credential=${s.accessKeyId}/${f}, SignedHeaders=${_Kt(m)}, Signature=${h}`,l}createCanonicalRequest(e,r,n){let o=Object.keys(r).sort();return`${e.method} +${this.getCanonicalPath(e)} +${j6e(e)} +${o.map(i=>`${i}:${r[i]}`).join(` +`)} + +${o.join(";")} +${n}`}async createStringToSign(e,r,n){let o=new this.sha256;o.update(mF(n));let i=await o.digest();return`${N_e} +${e} +${r} +${hC(i)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){let r=[];for(let i of e.split("/"))i?.length!==0&&i!=="."&&(i===".."?r.pop():r.push(i));let n=`${e?.startsWith("/")?"/":""}${r.join("/")}${r.length>0&&e?.endsWith("/")?"/":""}`;return gS(n).replace(/%2F/g,"/")}return e}async getSignature(e,r,n,o){let i=await this.createStringToSign(e,r,o),a=new this.sha256(await n);return a.update(mF(i)),hC(await a.digest())}getSigningKey(e,r,n,o){return lKt(this.sha256,e,n,r,o||this.service)}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}},k_e=t=>{let e=yKt(t).replace(/[\-:]/g,"");return{longDate:e,shortDate:e.slice(0,8)}},_Kt=t=>Object.keys(t).sort().join(";")});var wKt=v(()=>{vKt();N6e();D6e();$6e();k6e();q6e();I6e()});var q_e,SKt=v(()=>{fF();wKt();q_e=t=>{let e;t.credentials&&(e=s5t(t.credentials,a5t,y6e)),e||(t.credentialDefaultProvider?e=nK(t.credentialDefaultProvider(Object.assign({},t,{parentClientConfig:t}))):e=async()=>{throw new Error("`credentials` is missing")});let{signingEscapePath:r=!0,systemClockOffset:n=t.systemClockOffset||0,sha256:o}=t,i;return t.signer?i=nK(t.signer):t.regionInfoProvider?i=()=>nK(t.region)().then(async a=>[await t.regionInfoProvider(a,{useFipsEndpoint:await t.useFipsEndpoint(),useDualstackEndpoint:await t.useDualstackEndpoint()})||{},a]).then(([a,s])=>{let{signingRegion:u,signingService:l}=a;t.signingRegion=t.signingRegion||u||s,t.signingName=t.signingName||l||t.serviceId;let c={...t,credentials:e,region:t.signingRegion,service:t.signingName,sha256:o,uriEscapePath:r},d=t.signerConstructor||cre;return new d(c)}):i=async a=>{a=Object.assign({},{name:"sigv4",signingName:t.signingName||t.defaultSigningName,signingRegion:await nK(t.region)(),properties:{}},a);let s=a.signingRegion,u=a.signingName;t.signingRegion=t.signingRegion||s,t.signingName=t.signingName||u||t.serviceId;let l={...t,credentials:e,region:t.signingRegion,service:t.signingName,sha256:o,uriEscapePath:r},c=t.signerConstructor||cre;return new c(l)},{...t,systemClockOffset:n,signingEscapePath:r,credentials:e,signer:i}}});var CKt=v(()=>{U5t();z5t();SKt()});var xKt=v(()=>{CKt()});var OKt=v(()=>{});var TKt=v(()=>{tn()});var B_e,B6e=v(()=>{tn();B_e=(t,e)=>dF(t,e).then(r=>e.utf8Encoder(r))});var Kc,EKt,PKt,MKt=v(()=>{B6e();Kc=(t,e)=>B_e(t,e).then(r=>{if(r.length)try{return JSON.parse(r)}catch(n){throw n?.name==="SyntaxError"&&Object.defineProperty(n,"$responseBodyText",{value:r}),n}return{}}),EKt=async(t,e)=>{let r=await Kc(t,e);return r.message=r.message??r.Message,r},PKt=(t,e)=>{let r=(i,a)=>Object.keys(i).find(s=>s.toLowerCase()===a.toLowerCase()),n=i=>{let a=i;return typeof a=="number"&&(a=a.toString()),a.indexOf(",")>=0&&(a=a.split(",")[0]),a.indexOf(":")>=0&&(a=a.split(":")[0]),a.indexOf("#")>=0&&(a=a.split("#")[1]),a},o=r(t.headers,"x-amzn-errortype");if(o!==void 0)return n(t.headers[o]);if(e.code!==void 0)return n(e.code);if(e.__type!==void 0)return n(e.__type)}});var U_e=S(t1=>{"use strict";var RKt=":A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD",Q0n=RKt+"\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040",AKt="["+RKt+"]["+Q0n+"]*",eCn=new RegExp("^"+AKt+"$"),tCn=function(t,e){let r=[],n=e.exec(t);for(;n;){let o=[];o.startIndex=e.lastIndex-n[0].length;let i=n.length;for(let a=0;a"u")};t1.isExist=function(t){return typeof t<"u"};t1.isEmptyObject=function(t){return Object.keys(t).length===0};t1.merge=function(t,e,r){if(e){let n=Object.keys(e),o=n.length;for(let i=0;i{"use strict";var U6e=U_e(),nCn={allowBooleanAttributes:!1,unpairedTags:[]};$Kt.validate=function(t,e){e=Object.assign({},nCn,e);let r=[],n=!1,o=!1;t[0]==="\uFEFF"&&(t=t.substr(1));for(let i=0;i"&&t[i]!==" "&&t[i]!==" "&&t[i]!==` +`&&t[i]!=="\r";i++)u+=t[i];if(u=u.trim(),u[u.length-1]==="/"&&(u=u.substring(0,u.length-1),i--),!dCn(u)){let d;return u.trim().length===0?d="Invalid space after '<'.":d="Tag '"+u+"' is an invalid name.",Wc("InvalidTag",d,db(t,i))}let l=aCn(t,i);if(l===!1)return Wc("InvalidAttr","Attributes for '"+u+"' have open quote.",db(t,i));let c=l.value;if(i=l.index,c[c.length-1]==="/"){let d=i-c.length;c=c.substring(0,c.length-1);let f=DKt(c,e);if(f===!0)n=!0;else return Wc(f.err.code,f.err.msg,db(t,d+f.err.line))}else if(s)if(l.tagClosed){if(c.trim().length>0)return Wc("InvalidTag","Closing tag '"+u+"' can't have attributes or invalid starting.",db(t,a));if(r.length===0)return Wc("InvalidTag","Closing tag '"+u+"' has not been opened.",db(t,a));{let d=r.pop();if(u!==d.tagName){let f=db(t,d.tagStartPos);return Wc("InvalidTag","Expected closing tag '"+d.tagName+"' (opened in line "+f.line+", col "+f.col+") instead of closing tag '"+u+"'.",db(t,a))}r.length==0&&(o=!0)}}else return Wc("InvalidTag","Closing tag '"+u+"' doesn't have proper closing.",db(t,i));else{let d=DKt(c,e);if(d!==!0)return Wc(d.err.code,d.err.msg,db(t,i-c.length+d.err.line));if(o===!0)return Wc("InvalidXml","Multiple possible root nodes found.",db(t,i));e.unpairedTags.indexOf(u)!==-1||r.push({tagName:u,tagStartPos:a}),n=!0}for(i++;i0)return Wc("InvalidXml","Invalid '"+JSON.stringify(r.map(i=>i.tagName),null,4).replace(/\r?\n/g,"")+"' found.",{line:1,col:1})}else return Wc("InvalidXml","Start tag expected.",1);return!0};function IKt(t){return t===" "||t===" "||t===` +`||t==="\r"}function NKt(t,e){let r=e;for(;e5&&n==="xml")return Wc("InvalidXml","XML declaration allowed only at the start of the document.",db(t,e));if(t[e]=="?"&&t[e+1]==">"){e++;break}else continue}return e}function jKt(t,e){if(t.length>e+5&&t[e+1]==="-"&&t[e+2]==="-"){for(e+=3;e"){e+=2;break}}else if(t.length>e+8&&t[e+1]==="D"&&t[e+2]==="O"&&t[e+3]==="C"&&t[e+4]==="T"&&t[e+5]==="Y"&&t[e+6]==="P"&&t[e+7]==="E"){let r=1;for(e+=8;e"&&(r--,r===0))break}else if(t.length>e+9&&t[e+1]==="["&&t[e+2]==="C"&&t[e+3]==="D"&&t[e+4]==="A"&&t[e+5]==="T"&&t[e+6]==="A"&&t[e+7]==="["){for(e+=8;e"){e+=2;break}}return e}var oCn='"',iCn="'";function aCn(t,e){let r="",n="",o=!1;for(;e"&&n===""){o=!0;break}r+=t[e]}return n!==""?!1:{value:r,index:e,tagClosed:o}}var sCn=new RegExp(`(\\s*)([^\\s=]+)(\\s*=)?(\\s*(['"])(([\\s\\S])*?)\\5)?`,"g");function DKt(t,e){let r=U6e.getAllMatches(t,sCn),n={};for(let o=0;o{var LKt={preserveOrder:!1,attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,removeNSPrefix:!1,allowBooleanAttributes:!1,parseTagValue:!0,parseAttributeValue:!1,trimValues:!0,cdataPropName:!1,numberParseOptions:{hex:!0,leadingZeros:!0,eNotation:!0},tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},stopNodes:[],alwaysCreateTextNode:!1,isArray:()=>!1,commentPropName:!1,unpairedTags:[],processEntities:!0,htmlEntities:!1,ignoreDeclaration:!1,ignorePiTags:!1,transformTagName:!1,transformAttributeName:!1,updateTag:function(t,e,r){return t}},fCn=function(t){return Object.assign({},LKt,t)};H6e.buildOptions=fCn;H6e.defaultOptions=LKt});var qKt=S((F7i,kKt)=>{"use strict";var V6e=class{constructor(e){this.tagname=e,this.child=[],this[":@"]={}}add(e,r){e==="__proto__"&&(e="#__proto__"),this.child.push({[e]:r})}addChild(e){e.tagname==="__proto__"&&(e.tagname="#__proto__"),e[":@"]&&Object.keys(e[":@"]).length>0?this.child.push({[e.tagname]:e.child,":@":e[":@"]}):this.child.push({[e.tagname]:e.child})}};kKt.exports=V6e});var UKt=S((k7i,BKt)=>{var pCn=U_e();function mCn(t,e){let r={};if(t[e+3]==="O"&&t[e+4]==="C"&&t[e+5]==="T"&&t[e+6]==="Y"&&t[e+7]==="P"&&t[e+8]==="E"){e=e+9;let n=1,o=!1,i=!1,a="";for(;e"){if(i?t[e-1]==="-"&&t[e-2]==="-"&&(i=!1,n--):n--,n===0)break}else t[e]==="["?o=!0:a+=t[e];if(n!==0)throw new Error("Unclosed DOCTYPE")}else throw new Error("Invalid Tag instead of DOCTYPE");return{entities:r,i:e}}function hCn(t,e){let r="";for(;e{var SCn=/^[-+]?0x[a-fA-F0-9]+$/,CCn=/^([\-\+])?(0*)(\.[0-9]+([eE]\-?[0-9]+)?|[0-9]+(\.[0-9]+([eE]\-?[0-9]+)?)?)$/;!Number.parseInt&&window.parseInt&&(Number.parseInt=window.parseInt);!Number.parseFloat&&window.parseFloat&&(Number.parseFloat=window.parseFloat);var xCn={hex:!0,leadingZeros:!0,decimalPoint:".",eNotation:!0};function OCn(t,e={}){if(e=Object.assign({},xCn,e),!t||typeof t!="string")return t;let r=t.trim();if(e.skipLike!==void 0&&e.skipLike.test(r))return t;if(e.hex&&SCn.test(r))return Number.parseInt(r,16);{let n=CCn.exec(r);if(n){let o=n[1],i=n[2],a=TCn(n[3]),s=n[4]||n[6];if(!e.leadingZeros&&i.length>0&&o&&r[2]!==".")return t;if(!e.leadingZeros&&i.length>0&&!o&&r[1]!==".")return t;{let u=Number(r),l=""+u;return l.search(/[eE]/)!==-1||s?e.eNotation?u:t:r.indexOf(".")!==-1?l==="0"&&a===""||l===a||o&&l==="-"+a?u:t:i?a===l||o+a===l?u:t:r===l||r===o+l?u:t}}else return t}}function TCn(t){return t&&t.indexOf(".")!==-1&&(t=t.replace(/0+$/,""),t==="."?t="0":t[0]==="."?t="0"+t:t[t.length-1]==="."&&(t=t.substr(0,t.length-1))),t}zKt.exports=OCn});var KKt=S((B7i,JKt)=>{"use strict";var VKt=U_e(),fre=qKt(),ECn=UKt(),PCn=HKt(),J6e=class{constructor(e){this.options=e,this.currentNode=null,this.tagsNodeStack=[],this.docTypeEntities={},this.lastEntities={apos:{regex:/&(apos|#39|#x27);/g,val:"'"},gt:{regex:/&(gt|#62|#x3E);/g,val:">"},lt:{regex:/&(lt|#60|#x3C);/g,val:"<"},quot:{regex:/&(quot|#34|#x22);/g,val:'"'}},this.ampEntity={regex:/&(amp|#38|#x26);/g,val:"&"},this.htmlEntities={space:{regex:/&(nbsp|#160);/g,val:" "},cent:{regex:/&(cent|#162);/g,val:"\xA2"},pound:{regex:/&(pound|#163);/g,val:"\xA3"},yen:{regex:/&(yen|#165);/g,val:"\xA5"},euro:{regex:/&(euro|#8364);/g,val:"\u20AC"},copyright:{regex:/&(copy|#169);/g,val:"\xA9"},reg:{regex:/&(reg|#174);/g,val:"\xAE"},inr:{regex:/&(inr|#8377);/g,val:"\u20B9"},num_dec:{regex:/&#([0-9]{1,7});/g,val:(r,n)=>String.fromCharCode(Number.parseInt(n,10))},num_hex:{regex:/&#x([0-9a-fA-F]{1,6});/g,val:(r,n)=>String.fromCharCode(Number.parseInt(n,16))}},this.addExternalEntities=MCn,this.parseXml=jCn,this.parseTextData=RCn,this.resolveNameSpace=ACn,this.buildAttributesMap=NCn,this.isItStopNode=FCn,this.replaceEntitiesValue=$Cn,this.readStopNodeData=qCn,this.saveTextToParentTag=LCn,this.addChild=DCn}};function MCn(t){let e=Object.keys(t);for(let r=0;r0)){a||(t=this.replaceEntitiesValue(t));let s=this.options.tagValueProcessor(e,t,r,o,i);return s==null?t:typeof s!=typeof t||s!==t?s:this.options.trimValues?W6e(t,this.options.parseTagValue,this.options.numberParseOptions):t.trim()===t?W6e(t,this.options.parseTagValue,this.options.numberParseOptions):t}}function ACn(t){if(this.options.removeNSPrefix){let e=t.split(":"),r=t.charAt(0)==="/"?"/":"";if(e[0]==="xmlns")return"";e.length===2&&(t=r+e[1])}return t}var ICn=new RegExp(`([^\\s=]+)\\s*(=\\s*(['"])([\\s\\S]*?)\\3)?`,"gm");function NCn(t,e,r){if(!this.options.ignoreAttributes&&typeof t=="string"){let n=VKt.getAllMatches(t,ICn),o=n.length,i={};for(let a=0;a",i,"Closing Tag is not closed."),u=t.substring(i+2,s).trim();if(this.options.removeNSPrefix){let d=u.indexOf(":");d!==-1&&(u=u.substr(d+1))}this.options.transformTagName&&(u=this.options.transformTagName(u)),r&&(n=this.saveTextToParentTag(n,r,o));let l=o.substring(o.lastIndexOf(".")+1);if(u&&this.options.unpairedTags.indexOf(u)!==-1)throw new Error(`Unpaired tag can not be used as closing tag: `);let c=0;l&&this.options.unpairedTags.indexOf(l)!==-1?(c=o.lastIndexOf(".",o.lastIndexOf(".")-1),this.tagsNodeStack.pop()):c=o.lastIndexOf("."),o=o.substring(0,c),r=this.tagsNodeStack.pop(),n="",i=s}else if(t[i+1]==="?"){let s=K6e(t,i,!1,"?>");if(!s)throw new Error("Pi Tag is not closed.");if(n=this.saveTextToParentTag(n,r,o),!(this.options.ignoreDeclaration&&s.tagName==="?xml"||this.options.ignorePiTags)){let u=new fre(s.tagName);u.add(this.options.textNodeName,""),s.tagName!==s.tagExp&&s.attrExpPresent&&(u[":@"]=this.buildAttributesMap(s.tagExp,o,s.tagName)),this.addChild(r,u,o)}i=s.closeIndex+1}else if(t.substr(i+1,3)==="!--"){let s=$4(t,"-->",i+4,"Comment is not closed.");if(this.options.commentPropName){let u=t.substring(i+4,s-2);n=this.saveTextToParentTag(n,r,o),r.add(this.options.commentPropName,[{[this.options.textNodeName]:u}])}i=s}else if(t.substr(i+1,2)==="!D"){let s=ECn(t,i);this.docTypeEntities=s.entities,i=s.i}else if(t.substr(i+1,2)==="!["){let s=$4(t,"]]>",i,"CDATA is not closed.")-2,u=t.substring(i+9,s);n=this.saveTextToParentTag(n,r,o);let l=this.parseTextData(u,r.tagname,o,!0,!1,!0,!0);l==null&&(l=""),this.options.cdataPropName?r.add(this.options.cdataPropName,[{[this.options.textNodeName]:u}]):r.add(this.options.textNodeName,l),i=s+2}else{let s=K6e(t,i,this.options.removeNSPrefix),u=s.tagName,l=s.rawTagName,c=s.tagExp,d=s.attrExpPresent,f=s.closeIndex;this.options.transformTagName&&(u=this.options.transformTagName(u)),r&&n&&r.tagname!=="!xml"&&(n=this.saveTextToParentTag(n,r,o,!1));let p=r;if(p&&this.options.unpairedTags.indexOf(p.tagname)!==-1&&(r=this.tagsNodeStack.pop(),o=o.substring(0,o.lastIndexOf("."))),u!==e.tagname&&(o+=o?"."+u:u),this.isItStopNode(this.options.stopNodes,o,u)){let m="";if(c.length>0&&c.lastIndexOf("/")===c.length-1)u[u.length-1]==="/"?(u=u.substr(0,u.length-1),o=o.substr(0,o.length-1),c=u):c=c.substr(0,c.length-1),i=s.closeIndex;else if(this.options.unpairedTags.indexOf(u)!==-1)i=s.closeIndex;else{let g=this.readStopNodeData(t,l,f+1);if(!g)throw new Error(`Unexpected end of ${l}`);i=g.i,m=g.tagContent}let h=new fre(u);u!==c&&d&&(h[":@"]=this.buildAttributesMap(c,o,u)),m&&(m=this.parseTextData(m,u,o,!0,d,!0,!0)),o=o.substr(0,o.lastIndexOf(".")),h.add(this.options.textNodeName,m),this.addChild(r,h,o)}else{if(c.length>0&&c.lastIndexOf("/")===c.length-1){u[u.length-1]==="/"?(u=u.substr(0,u.length-1),o=o.substr(0,o.length-1),c=u):c=c.substr(0,c.length-1),this.options.transformTagName&&(u=this.options.transformTagName(u));let m=new fre(u);u!==c&&d&&(m[":@"]=this.buildAttributesMap(c,o,u)),this.addChild(r,m,o),o=o.substr(0,o.lastIndexOf("."))}else{let m=new fre(u);this.tagsNodeStack.push(r),u!==c&&d&&(m[":@"]=this.buildAttributesMap(c,o,u)),this.addChild(r,m,o),r=m}n="",i=f}}else n+=t[i];return e.child};function DCn(t,e,r){let n=this.options.updateTag(e.tagname,r,e[":@"]);n===!1||(typeof n=="string"&&(e.tagname=n),t.addChild(e))}var $Cn=function(t){if(this.options.processEntities){for(let e in this.docTypeEntities){let r=this.docTypeEntities[e];t=t.replace(r.regx,r.val)}for(let e in this.lastEntities){let r=this.lastEntities[e];t=t.replace(r.regex,r.val)}if(this.options.htmlEntities)for(let e in this.htmlEntities){let r=this.htmlEntities[e];t=t.replace(r.regex,r.val)}t=t.replace(this.ampEntity.regex,this.ampEntity.val)}return t};function LCn(t,e,r,n){return t&&(n===void 0&&(n=Object.keys(e.child).length===0),t=this.parseTextData(t,e.tagname,r,!1,e[":@"]?Object.keys(e[":@"]).length!==0:!1,n),t!==void 0&&t!==""&&e.add(this.options.textNodeName,t),t=""),t}function FCn(t,e,r){let n="*."+r;for(let o in t){let i=t[o];if(n===i||e===i)return!0}return!1}function kCn(t,e,r=">"){let n,o="";for(let i=e;i",r,`${e} is not closed`);if(t.substring(r+2,i).trim()===e&&(o--,o===0))return{tagContent:t.substring(n,r),i};r=i}else if(t[r+1]==="?")r=$4(t,"?>",r+1,"StopNode is not closed.");else if(t.substr(r+1,3)==="!--")r=$4(t,"-->",r+3,"StopNode is not closed.");else if(t.substr(r+1,2)==="![")r=$4(t,"]]>",r,"StopNode is not closed.")-2;else{let i=K6e(t,r,">");i&&((i&&i.tagName)===e&&i.tagExp[i.tagExp.length-1]!=="/"&&o++,r=i.closeIndex)}}function W6e(t,e,r){if(e&&typeof t=="string"){let n=t.trim();return n==="true"?!0:n==="false"?!1:PCn(t,r)}else return VKt.isExist(t)?t:""}JKt.exports=J6e});var ZKt=S(GKt=>{"use strict";function BCn(t,e){return WKt(t,e)}function WKt(t,e,r){let n,o={};for(let i=0;i0&&(o[e.textNodeName]=n):n!==void 0&&(o[e.textNodeName]=n),o}function UCn(t){let e=Object.keys(t);for(let r=0;r{var{buildOptions:VCn}=FKt(),JCn=KKt(),{prettify:KCn}=ZKt(),WCn=z6e(),G6e=class{constructor(e){this.externalEntities={},this.options=VCn(e)}parse(e,r){if(typeof e!="string")if(e.toString)e=e.toString();else throw new Error("XML data is accepted in String or Bytes[] form.");if(r){r===!0&&(r={});let i=WCn.validate(e,r);if(i!==!0)throw Error(`${i.err.msg}:${i.err.line}:${i.err.col}`)}let n=new JCn(this.options);n.addExternalEntities(this.externalEntities);let o=n.parseXml(e);return this.options.preserveOrder||o===void 0?o:KCn(o,this.options)}addEntity(e,r){if(r.indexOf("&")!==-1)throw new Error("Entity value can't have '&'");if(e.indexOf("&")!==-1||e.indexOf(";")!==-1)throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for ' '");if(r==="&")throw new Error("An entity with value '&' is not permitted");this.externalEntities[e]=r}};XKt.exports=G6e});var nWt=S((H7i,rWt)=>{var GCn=` +`;function ZCn(t,e){let r="";return e.format&&e.indentBy.length>0&&(r=GCn),eWt(t,e,"",r)}function eWt(t,e,r,n){let o="",i=!1;for(let a=0;a`,i=!1;continue}else if(u===e.commentPropName){o+=n+``,i=!0;continue}else if(u[0]==="?"){let m=QKt(s[":@"],e),h=u==="?xml"?"":n,g=s[u][0][e.textNodeName];g=g.length!==0?" "+g:"",o+=h+`<${u}${g}${m}?>`,i=!0;continue}let c=n;c!==""&&(c+=e.indentBy);let d=QKt(s[":@"],e),f=n+`<${u}${d}`,p=eWt(s[u],e,l,c);e.unpairedTags.indexOf(u)!==-1?e.suppressUnpairedNode?o+=f+">":o+=f+"/>":(!p||p.length===0)&&e.suppressEmptyNode?o+=f+"/>":p&&p.endsWith(">")?o+=f+`>${p}${n}`:(o+=f+">",p&&n!==""&&(p.includes("/>")||p.includes("`),i=!0}return o}function XCn(t){let e=Object.keys(t);for(let r=0;r0&&e.processEntities)for(let r=0;r{"use strict";var QCn=nWt(),exn={attributeNamePrefix:"@_",attributesGroupName:!1,textNodeName:"#text",ignoreAttributes:!0,cdataPropName:!1,format:!1,indentBy:" ",suppressEmptyNode:!1,suppressUnpairedNode:!0,suppressBooleanAttributes:!0,tagValueProcessor:function(t,e){return e},attributeValueProcessor:function(t,e){return e},preserveOrder:!1,commentPropName:!1,unpairedTags:[],entities:[{regex:new RegExp("&","g"),val:"&"},{regex:new RegExp(">","g"),val:">"},{regex:new RegExp("<","g"),val:"<"},{regex:new RegExp("'","g"),val:"'"},{regex:new RegExp('"',"g"),val:"""}],processEntities:!0,stopNodes:[],oneListGroup:!1};function hF(t){this.options=Object.assign({},exn,t),this.options.ignoreAttributes||this.options.attributesGroupName?this.isAttribute=function(){return!1}:(this.attrPrefixLen=this.options.attributeNamePrefix.length,this.isAttribute=nxn),this.processTextOrObjNode=txn,this.options.format?(this.indentate=rxn,this.tagEndChar=`> +`,this.newLine=` +`):(this.indentate=function(){return""},this.tagEndChar=">",this.newLine="")}hF.prototype.build=function(t){return this.options.preserveOrder?QCn(t,this.options):(Array.isArray(t)&&this.options.arrayNodeName&&this.options.arrayNodeName.length>1&&(t={[this.options.arrayNodeName]:t}),this.j2x(t,0).val)};hF.prototype.j2x=function(t,e){let r="",n="";for(let o in t)if(Object.prototype.hasOwnProperty.call(t,o))if(typeof t[o]>"u")this.isAttribute(o)&&(n+="");else if(t[o]===null)this.isAttribute(o)?n+="":o[0]==="?"?n+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(t[o]instanceof Date)n+=this.buildTextValNode(t[o],o,"",e);else if(typeof t[o]!="object"){let i=this.isAttribute(o);if(i)r+=this.buildAttrPairStr(i,""+t[o]);else if(o===this.options.textNodeName){let a=this.options.tagValueProcessor(o,""+t[o]);n+=this.replaceEntitiesValue(a)}else n+=this.buildTextValNode(t[o],o,"",e)}else if(Array.isArray(t[o])){let i=t[o].length,a="",s="";for(let u=0;u"u"))if(l===null)o[0]==="?"?n+=this.indentate(e)+"<"+o+"?"+this.tagEndChar:n+=this.indentate(e)+"<"+o+"/"+this.tagEndChar;else if(typeof l=="object")if(this.options.oneListGroup){let c=this.j2x(l,e+1);a+=c.val,this.options.attributesGroupName&&l.hasOwnProperty(this.options.attributesGroupName)&&(s+=c.attrStr)}else a+=this.processTextOrObjNode(l,o,e);else if(this.options.oneListGroup){let c=this.options.tagValueProcessor(o,l);c=this.replaceEntitiesValue(c),a+=c}else a+=this.buildTextValNode(l,o,"",e)}this.options.oneListGroup&&(a=this.buildObjectNode(a,o,s,e)),n+=a}else if(this.options.attributesGroupName&&o===this.options.attributesGroupName){let i=Object.keys(t[o]),a=i.length;for(let s=0;s"+t+o:this.options.commentPropName!==!1&&e===this.options.commentPropName&&i.length===0?this.indentate(n)+``+this.newLine:this.indentate(n)+"<"+e+r+i+this.tagEndChar+t+this.indentate(n)+o}};hF.prototype.closeTag=function(t){let e="";return this.options.unpairedTags.indexOf(t)!==-1?this.options.suppressUnpairedNode||(e="/"):this.options.suppressEmptyNode?e="/":e=`>`+this.newLine;if(this.options.commentPropName!==!1&&e===this.options.commentPropName)return this.indentate(n)+``+this.newLine;if(e[0]==="?")return this.indentate(n)+"<"+e+r+"?"+this.tagEndChar;{let o=this.options.tagValueProcessor(e,t);return o=this.replaceEntitiesValue(o),o===""?this.indentate(n)+"<"+e+r+this.closeTag(e)+this.tagEndChar:this.indentate(n)+"<"+e+r+">"+o+"0&&this.options.processEntities)for(let e=0;e{"use strict";var oxn=z6e(),ixn=YKt(),axn=iWt();aWt.exports={XMLParser:ixn,XMLValidator:oxn,XMLBuilder:axn}});var uWt,oT,lWt,cWt=v(()=>{tn();uWt=L(sWt());B6e();oT=(t,e)=>B_e(t,e).then(r=>{if(r.length){let n=new uWt.XMLParser({attributeNamePrefix:"",htmlEntities:!0,ignoreAttributes:!1,ignoreDeclaration:!0,parseTagValue:!1,trimValues:!1,tagValueProcessor:(u,l)=>l.trim()===""&&l.includes(` +`)?"":void 0});n.addEntity("#xD","\r"),n.addEntity("#10",` +`);let o;try{o=n.parse(r,!0)}catch(u){throw u&&typeof u=="object"&&Object.defineProperty(u,"$responseBodyText",{value:r}),u}let i="#text",a=Object.keys(o)[0],s=o[a];return s[i]&&(s[a]=s[i],delete s[i]),m6e(s)}return{}}),lWt=async(t,e)=>{let r=await oT(t,e);return r.Error&&(r.Error.message=r.Error.message??r.Error.Message),r}});var dWt=v(()=>{OKt();TKt();MKt();cWt()});var L4=v(()=>{T5t();xKt();dWt()});function sxn(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"cognito-identity",region:t.region},propertiesExtractor:(e,r)=>({signingProperties:{config:e,context:r}})}}function z_e(t){return{schemeId:"smithy.api#noAuth"}}var fWt,pWt,mWt,Z6e=v(()=>{L4();pC();fWt=async(t,e,r)=>({operation:tT(e).operation,region:await py(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});pWt=t=>{let e=[];switch(t.operation){case"GetCredentialsForIdentity":{e.push(z_e(t));break}case"GetId":{e.push(z_e(t));break}case"GetOpenIdToken":{e.push(z_e(t));break}case"UnlinkIdentity":{e.push(z_e(t));break}default:e.push(sxn(t))}return e},mWt=t=>({...q_e(t)})});var hWt,eo,il=v(()=>{hWt=t=>({...t,useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,defaultSigningName:"cognito-identity"}),eo={UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var yWt,gWt=v(()=>{yWt={name:"@aws-sdk/client-cognito-identity",description:"AWS SDK for JavaScript Cognito Identity Client for Node.js, Browser and React Native",version:"3.645.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-cognito-identity","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo cognito-identity","test:e2e":"ts-mocha test/**/*.ispec.ts && karma start karma.conf.js"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.645.0","@aws-sdk/client-sts":"3.645.0","@aws-sdk/core":"3.635.0","@aws-sdk/credential-provider-node":"3.645.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-user-agent":"3.645.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.645.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.4.0","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-node":"^3.0.3","@smithy/invalid-dependency":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.15","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.2.0","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.15","@smithy/util-defaults-mode-node":"^3.0.15","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@aws-sdk/client-iam":"3.645.0","@tsconfig/node16":"16.1.3","@types/chai":"^4.2.11","@types/mocha":"^8.0.4","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-cognito-identity",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-cognito-identity"}}});var X6e,Y6e,bWt,_Wt=v(()=>{X6e={name:"SHA-256"},Y6e={name:"HMAC",hash:X6e},bWt=new Uint8Array([227,176,196,66,152,252,28,20,154,251,244,200,153,111,185,36,39,174,65,228,100,155,147,76,164,149,153,27,120,82,184,85])});function oK(){return typeof window<"u"?window:typeof self<"u"?self:lxn}var lxn,Q6e=v(()=>{lxn={}});var iK,e5e,t5e=v(()=>{iK=L(Ebe());_Wt();Q6e();e5e=function(){function t(e){this.toHash=new Uint8Array(0),this.secret=e,this.reset()}return t.prototype.update=function(e){if(!(0,iK.isEmptyData)(e)){var r=(0,iK.convertToBuffer)(e),n=new Uint8Array(this.toHash.byteLength+r.byteLength);n.set(this.toHash,0),n.set(r,this.toHash.byteLength),this.toHash=n}},t.prototype.digest=function(){var e=this;return this.key?this.key.then(function(r){return oK().crypto.subtle.sign(Y6e,r,e.toHash).then(function(n){return new Uint8Array(n)})}):(0,iK.isEmptyData)(this.toHash)?Promise.resolve(bWt):Promise.resolve().then(function(){return oK().crypto.subtle.digest(X6e,e.toHash)}).then(function(r){return Promise.resolve(new Uint8Array(r))})},t.prototype.reset=function(){var e=this;this.toHash=new Uint8Array(0),this.secret&&this.secret!==void 0&&(this.key=new Promise(function(r,n){oK().crypto.subtle.importKey("raw",(0,iK.convertToBuffer)(e.secret),Y6e,!1,["sign"]).then(r,n)}),this.key.catch(function(){}))},t}()});function vWt(t){if(dxn(t)&&typeof t.crypto.subtle=="object"){var e=t.crypto.subtle;return fxn(e)}return!1}function dxn(t){if(typeof t=="object"&&typeof t.crypto=="object"){var e=t.crypto.getRandomValues;return typeof e=="function"}return!1}function fxn(t){return t&&cxn.every(function(e){return typeof t[e]=="function"})}var cxn,wWt=v(()=>{cxn=["decrypt","digest","encrypt","exportKey","generateKey","importKey","sign","verify"]});var SWt=v(()=>{wWt()});var CWt,xWt,H_e,OWt=v(()=>{t5e();CWt=L(a3e());SWt();Q6e();xWt=L(Ebe()),H_e=function(){function t(e){vWt(oK())?this.hash=new e5e(e):this.hash=new CWt.Sha256(e)}return t.prototype.update=function(e,r){this.hash.update((0,xWt.convertToBuffer)(e))},t.prototype.digest=function(){return this.hash.digest()},t.prototype.reset=function(){this.hash.reset()},t}()});var r5e=v(()=>{OWt();t5e()});var o5e=S((pre,n5e)=>{(function(t,e){typeof pre=="object"&&typeof n5e=="object"?n5e.exports=e():typeof define=="function"&&define.amd?define([],e):typeof pre=="object"?pre.bowser=e():t.bowser=e()})(pre,function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(n,o,i){r.o(n,o)||Object.defineProperty(n,o,{enumerable:!0,get:i})},r.r=function(n){typeof Symbol<"u"&&Symbol.toStringTag&&Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(n,"__esModule",{value:!0})},r.t=function(n,o){if(1&o&&(n=r(n)),8&o||4&o&&typeof n=="object"&&n&&n.__esModule)return n;var i=Object.create(null);if(r.r(i),Object.defineProperty(i,"default",{enumerable:!0,value:n}),2&o&&typeof n!="string")for(var a in n)r.d(i,a,function(s){return n[s]}.bind(null,a));return i},r.n=function(n){var o=n&&n.__esModule?function(){return n.default}:function(){return n};return r.d(o,"a",o),o},r.o=function(n,o){return Object.prototype.hasOwnProperty.call(n,o)},r.p="",r(r.s=90)}({17:function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;var n=r(18),o=function(){function i(){}return i.getFirstMatch=function(a,s){var u=s.match(a);return u&&u.length>0&&u[1]||""},i.getSecondMatch=function(a,s){var u=s.match(a);return u&&u.length>1&&u[2]||""},i.matchAndReturnConst=function(a,s,u){if(a.test(s))return u},i.getWindowsVersionName=function(a){switch(a){case"NT":return"NT";case"XP":return"XP";case"NT 5.0":return"2000";case"NT 5.1":return"XP";case"NT 5.2":return"2003";case"NT 6.0":return"Vista";case"NT 6.1":return"7";case"NT 6.2":return"8";case"NT 6.3":return"8.1";case"NT 10.0":return"10";default:return}},i.getMacOSVersionName=function(a){var s=a.split(".").splice(0,2).map(function(u){return parseInt(u,10)||0});if(s.push(0),s[0]===10)switch(s[1]){case 5:return"Leopard";case 6:return"Snow Leopard";case 7:return"Lion";case 8:return"Mountain Lion";case 9:return"Mavericks";case 10:return"Yosemite";case 11:return"El Capitan";case 12:return"Sierra";case 13:return"High Sierra";case 14:return"Mojave";case 15:return"Catalina";default:return}},i.getAndroidVersionName=function(a){var s=a.split(".").splice(0,2).map(function(u){return parseInt(u,10)||0});if(s.push(0),!(s[0]===1&&s[1]<5))return s[0]===1&&s[1]<6?"Cupcake":s[0]===1&&s[1]>=6?"Donut":s[0]===2&&s[1]<2?"Eclair":s[0]===2&&s[1]===2?"Froyo":s[0]===2&&s[1]>2?"Gingerbread":s[0]===3?"Honeycomb":s[0]===4&&s[1]<1?"Ice Cream Sandwich":s[0]===4&&s[1]<4?"Jelly Bean":s[0]===4&&s[1]>=4?"KitKat":s[0]===5?"Lollipop":s[0]===6?"Marshmallow":s[0]===7?"Nougat":s[0]===8?"Oreo":s[0]===9?"Pie":void 0},i.getVersionPrecision=function(a){return a.split(".").length},i.compareVersions=function(a,s,u){u===void 0&&(u=!1);var l=i.getVersionPrecision(a),c=i.getVersionPrecision(s),d=Math.max(l,c),f=0,p=i.map([a,s],function(m){var h=d-i.getVersionPrecision(m),g=m+new Array(h+1).join(".0");return i.map(g.split("."),function(y){return new Array(20-y.length).join("0")+y}).reverse()});for(u&&(f=d-Math.min(l,c)),d-=1;d>=f;){if(p[0][d]>p[1][d])return 1;if(p[0][d]===p[1][d]){if(d===f)return 0;d-=1}else if(p[0][d]1?c-1:0),f=1;f0){var b=Object.keys(m),_=s.default.find(b,function(R){return p.isOS(R)});if(_){var w=this.satisfies(m[_]);if(w!==void 0)return w}var x=s.default.find(b,function(R){return p.isPlatform(R)});if(x){var O=this.satisfies(m[x]);if(O!==void 0)return O}}if(y>0){var E=Object.keys(g),T=s.default.find(E,function(R){return p.isBrowser(R,!0)});if(T!==void 0)return this.compareVersion(g[T])}},d.isBrowser=function(f,p){p===void 0&&(p=!1);var m=this.getBrowserName().toLowerCase(),h=f.toLowerCase(),g=s.default.getBrowserTypeByAlias(h);return p&&g&&(h=g.toLowerCase()),h===m},d.compareVersion=function(f){var p=[0],m=f,h=!1,g=this.getBrowserVersion();if(typeof g=="string")return f[0]===">"||f[0]==="<"?(m=f.substr(1),f[1]==="="?(h=!0,m=f.substr(2)):p=[],f[0]===">"?p.push(1):p.push(-1)):f[0]==="="?m=f.substr(1):f[0]==="~"&&(h=!0,m=f.substr(1)),p.indexOf(s.default.compareVersions(g,m,h))>-1},d.isOS=function(f){return this.getOSName(!0)===String(f).toLowerCase()},d.isPlatform=function(f){return this.getPlatformType(!0)===String(f).toLowerCase()},d.isEngine=function(f){return this.getEngineName(!0)===String(f).toLowerCase()},d.is=function(f,p){return p===void 0&&(p=!1),this.isBrowser(f,p)||this.isOS(f)||this.isPlatform(f)},d.some=function(f){var p=this;return f===void 0&&(f=[]),f.some(function(m){return p.is(m)})},c}();e.default=l,t.exports=e.default},92:function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;var n,o=(n=r(17))&&n.__esModule?n:{default:n},i=/version\/(\d+(\.?_?\d+)+)/i,a=[{test:[/googlebot/i],describe:function(s){var u={name:"Googlebot"},l=o.default.getFirstMatch(/googlebot\/(\d+(\.\d+))/i,s)||o.default.getFirstMatch(i,s);return l&&(u.version=l),u}},{test:[/opera/i],describe:function(s){var u={name:"Opera"},l=o.default.getFirstMatch(i,s)||o.default.getFirstMatch(/(?:opera)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/opr\/|opios/i],describe:function(s){var u={name:"Opera"},l=o.default.getFirstMatch(/(?:opr|opios)[\s/](\S+)/i,s)||o.default.getFirstMatch(i,s);return l&&(u.version=l),u}},{test:[/SamsungBrowser/i],describe:function(s){var u={name:"Samsung Internet for Android"},l=o.default.getFirstMatch(i,s)||o.default.getFirstMatch(/(?:SamsungBrowser)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/Whale/i],describe:function(s){var u={name:"NAVER Whale Browser"},l=o.default.getFirstMatch(i,s)||o.default.getFirstMatch(/(?:whale)[\s/](\d+(?:\.\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/MZBrowser/i],describe:function(s){var u={name:"MZ Browser"},l=o.default.getFirstMatch(/(?:MZBrowser)[\s/](\d+(?:\.\d+)+)/i,s)||o.default.getFirstMatch(i,s);return l&&(u.version=l),u}},{test:[/focus/i],describe:function(s){var u={name:"Focus"},l=o.default.getFirstMatch(/(?:focus)[\s/](\d+(?:\.\d+)+)/i,s)||o.default.getFirstMatch(i,s);return l&&(u.version=l),u}},{test:[/swing/i],describe:function(s){var u={name:"Swing"},l=o.default.getFirstMatch(/(?:swing)[\s/](\d+(?:\.\d+)+)/i,s)||o.default.getFirstMatch(i,s);return l&&(u.version=l),u}},{test:[/coast/i],describe:function(s){var u={name:"Opera Coast"},l=o.default.getFirstMatch(i,s)||o.default.getFirstMatch(/(?:coast)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/opt\/\d+(?:.?_?\d+)+/i],describe:function(s){var u={name:"Opera Touch"},l=o.default.getFirstMatch(/(?:opt)[\s/](\d+(\.?_?\d+)+)/i,s)||o.default.getFirstMatch(i,s);return l&&(u.version=l),u}},{test:[/yabrowser/i],describe:function(s){var u={name:"Yandex Browser"},l=o.default.getFirstMatch(/(?:yabrowser)[\s/](\d+(\.?_?\d+)+)/i,s)||o.default.getFirstMatch(i,s);return l&&(u.version=l),u}},{test:[/ucbrowser/i],describe:function(s){var u={name:"UC Browser"},l=o.default.getFirstMatch(i,s)||o.default.getFirstMatch(/(?:ucbrowser)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/Maxthon|mxios/i],describe:function(s){var u={name:"Maxthon"},l=o.default.getFirstMatch(i,s)||o.default.getFirstMatch(/(?:Maxthon|mxios)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/epiphany/i],describe:function(s){var u={name:"Epiphany"},l=o.default.getFirstMatch(i,s)||o.default.getFirstMatch(/(?:epiphany)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/puffin/i],describe:function(s){var u={name:"Puffin"},l=o.default.getFirstMatch(i,s)||o.default.getFirstMatch(/(?:puffin)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/sleipnir/i],describe:function(s){var u={name:"Sleipnir"},l=o.default.getFirstMatch(i,s)||o.default.getFirstMatch(/(?:sleipnir)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/k-meleon/i],describe:function(s){var u={name:"K-Meleon"},l=o.default.getFirstMatch(i,s)||o.default.getFirstMatch(/(?:k-meleon)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/micromessenger/i],describe:function(s){var u={name:"WeChat"},l=o.default.getFirstMatch(/(?:micromessenger)[\s/](\d+(\.?_?\d+)+)/i,s)||o.default.getFirstMatch(i,s);return l&&(u.version=l),u}},{test:[/qqbrowser/i],describe:function(s){var u={name:/qqbrowserlite/i.test(s)?"QQ Browser Lite":"QQ Browser"},l=o.default.getFirstMatch(/(?:qqbrowserlite|qqbrowser)[/](\d+(\.?_?\d+)+)/i,s)||o.default.getFirstMatch(i,s);return l&&(u.version=l),u}},{test:[/msie|trident/i],describe:function(s){var u={name:"Internet Explorer"},l=o.default.getFirstMatch(/(?:msie |rv:)(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/\sedg\//i],describe:function(s){var u={name:"Microsoft Edge"},l=o.default.getFirstMatch(/\sedg\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/edg([ea]|ios)/i],describe:function(s){var u={name:"Microsoft Edge"},l=o.default.getSecondMatch(/edg([ea]|ios)\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/vivaldi/i],describe:function(s){var u={name:"Vivaldi"},l=o.default.getFirstMatch(/vivaldi\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/seamonkey/i],describe:function(s){var u={name:"SeaMonkey"},l=o.default.getFirstMatch(/seamonkey\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/sailfish/i],describe:function(s){var u={name:"Sailfish"},l=o.default.getFirstMatch(/sailfish\s?browser\/(\d+(\.\d+)?)/i,s);return l&&(u.version=l),u}},{test:[/silk/i],describe:function(s){var u={name:"Amazon Silk"},l=o.default.getFirstMatch(/silk\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/phantom/i],describe:function(s){var u={name:"PhantomJS"},l=o.default.getFirstMatch(/phantomjs\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/slimerjs/i],describe:function(s){var u={name:"SlimerJS"},l=o.default.getFirstMatch(/slimerjs\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(s){var u={name:"BlackBerry"},l=o.default.getFirstMatch(i,s)||o.default.getFirstMatch(/blackberry[\d]+\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/(web|hpw)[o0]s/i],describe:function(s){var u={name:"WebOS Browser"},l=o.default.getFirstMatch(i,s)||o.default.getFirstMatch(/w(?:eb)?[o0]sbrowser\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/bada/i],describe:function(s){var u={name:"Bada"},l=o.default.getFirstMatch(/dolfin\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/tizen/i],describe:function(s){var u={name:"Tizen"},l=o.default.getFirstMatch(/(?:tizen\s?)?browser\/(\d+(\.?_?\d+)+)/i,s)||o.default.getFirstMatch(i,s);return l&&(u.version=l),u}},{test:[/qupzilla/i],describe:function(s){var u={name:"QupZilla"},l=o.default.getFirstMatch(/(?:qupzilla)[\s/](\d+(\.?_?\d+)+)/i,s)||o.default.getFirstMatch(i,s);return l&&(u.version=l),u}},{test:[/firefox|iceweasel|fxios/i],describe:function(s){var u={name:"Firefox"},l=o.default.getFirstMatch(/(?:firefox|iceweasel|fxios)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/electron/i],describe:function(s){var u={name:"Electron"},l=o.default.getFirstMatch(/(?:electron)\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/MiuiBrowser/i],describe:function(s){var u={name:"Miui"},l=o.default.getFirstMatch(/(?:MiuiBrowser)[\s/](\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/chromium/i],describe:function(s){var u={name:"Chromium"},l=o.default.getFirstMatch(/(?:chromium)[\s/](\d+(\.?_?\d+)+)/i,s)||o.default.getFirstMatch(i,s);return l&&(u.version=l),u}},{test:[/chrome|crios|crmo/i],describe:function(s){var u={name:"Chrome"},l=o.default.getFirstMatch(/(?:chrome|crios|crmo)\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/GSA/i],describe:function(s){var u={name:"Google Search"},l=o.default.getFirstMatch(/(?:GSA)\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:function(s){var u=!s.test(/like android/i),l=s.test(/android/i);return u&&l},describe:function(s){var u={name:"Android Browser"},l=o.default.getFirstMatch(i,s);return l&&(u.version=l),u}},{test:[/playstation 4/i],describe:function(s){var u={name:"PlayStation 4"},l=o.default.getFirstMatch(i,s);return l&&(u.version=l),u}},{test:[/safari|applewebkit/i],describe:function(s){var u={name:"Safari"},l=o.default.getFirstMatch(i,s);return l&&(u.version=l),u}},{test:[/.*/i],describe:function(s){var u=s.search("\\(")!==-1?/^(.*)\/(.*)[ \t]\((.*)/:/^(.*)\/(.*) /;return{name:o.default.getFirstMatch(u,s),version:o.default.getSecondMatch(u,s)}}}];e.default=a,t.exports=e.default},93:function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;var n,o=(n=r(17))&&n.__esModule?n:{default:n},i=r(18),a=[{test:[/Roku\/DVP/],describe:function(s){var u=o.default.getFirstMatch(/Roku\/DVP-(\d+\.\d+)/i,s);return{name:i.OS_MAP.Roku,version:u}}},{test:[/windows phone/i],describe:function(s){var u=o.default.getFirstMatch(/windows phone (?:os)?\s?(\d+(\.\d+)*)/i,s);return{name:i.OS_MAP.WindowsPhone,version:u}}},{test:[/windows /i],describe:function(s){var u=o.default.getFirstMatch(/Windows ((NT|XP)( \d\d?.\d)?)/i,s),l=o.default.getWindowsVersionName(u);return{name:i.OS_MAP.Windows,version:u,versionName:l}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(s){var u={name:i.OS_MAP.iOS},l=o.default.getSecondMatch(/(Version\/)(\d[\d.]+)/,s);return l&&(u.version=l),u}},{test:[/macintosh/i],describe:function(s){var u=o.default.getFirstMatch(/mac os x (\d+(\.?_?\d+)+)/i,s).replace(/[_\s]/g,"."),l=o.default.getMacOSVersionName(u),c={name:i.OS_MAP.MacOS,version:u};return l&&(c.versionName=l),c}},{test:[/(ipod|iphone|ipad)/i],describe:function(s){var u=o.default.getFirstMatch(/os (\d+([_\s]\d+)*) like mac os x/i,s).replace(/[_\s]/g,".");return{name:i.OS_MAP.iOS,version:u}}},{test:function(s){var u=!s.test(/like android/i),l=s.test(/android/i);return u&&l},describe:function(s){var u=o.default.getFirstMatch(/android[\s/-](\d+(\.\d+)*)/i,s),l=o.default.getAndroidVersionName(u),c={name:i.OS_MAP.Android,version:u};return l&&(c.versionName=l),c}},{test:[/(web|hpw)[o0]s/i],describe:function(s){var u=o.default.getFirstMatch(/(?:web|hpw)[o0]s\/(\d+(\.\d+)*)/i,s),l={name:i.OS_MAP.WebOS};return u&&u.length&&(l.version=u),l}},{test:[/blackberry|\bbb\d+/i,/rim\stablet/i],describe:function(s){var u=o.default.getFirstMatch(/rim\stablet\sos\s(\d+(\.\d+)*)/i,s)||o.default.getFirstMatch(/blackberry\d+\/(\d+([_\s]\d+)*)/i,s)||o.default.getFirstMatch(/\bbb(\d+)/i,s);return{name:i.OS_MAP.BlackBerry,version:u}}},{test:[/bada/i],describe:function(s){var u=o.default.getFirstMatch(/bada\/(\d+(\.\d+)*)/i,s);return{name:i.OS_MAP.Bada,version:u}}},{test:[/tizen/i],describe:function(s){var u=o.default.getFirstMatch(/tizen[/\s](\d+(\.\d+)*)/i,s);return{name:i.OS_MAP.Tizen,version:u}}},{test:[/linux/i],describe:function(){return{name:i.OS_MAP.Linux}}},{test:[/CrOS/],describe:function(){return{name:i.OS_MAP.ChromeOS}}},{test:[/PlayStation 4/],describe:function(s){var u=o.default.getFirstMatch(/PlayStation 4[/\s](\d+(\.\d+)*)/i,s);return{name:i.OS_MAP.PlayStation4,version:u}}}];e.default=a,t.exports=e.default},94:function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;var n,o=(n=r(17))&&n.__esModule?n:{default:n},i=r(18),a=[{test:[/googlebot/i],describe:function(){return{type:"bot",vendor:"Google"}}},{test:[/huawei/i],describe:function(s){var u=o.default.getFirstMatch(/(can-l01)/i,s)&&"Nova",l={type:i.PLATFORMS_MAP.mobile,vendor:"Huawei"};return u&&(l.model=u),l}},{test:[/nexus\s*(?:7|8|9|10).*/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Nexus"}}},{test:[/ipad/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/Macintosh(.*?) FxiOS(.*?)\//],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Apple",model:"iPad"}}},{test:[/kftt build/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon",model:"Kindle Fire HD 7"}}},{test:[/silk/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet,vendor:"Amazon"}}},{test:[/tablet(?! pc)/i],describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(s){var u=s.test(/ipod|iphone/i),l=s.test(/like (ipod|iphone)/i);return u&&!l},describe:function(s){var u=o.default.getFirstMatch(/(ipod|iphone)/i,s);return{type:i.PLATFORMS_MAP.mobile,vendor:"Apple",model:u}}},{test:[/nexus\s*[0-6].*/i,/galaxy nexus/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Nexus"}}},{test:[/[^-]mobi/i],describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(s){return s.getBrowserName(!0)==="blackberry"},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"BlackBerry"}}},{test:function(s){return s.getBrowserName(!0)==="bada"},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(s){return s.getBrowserName()==="windows phone"},describe:function(){return{type:i.PLATFORMS_MAP.mobile,vendor:"Microsoft"}}},{test:function(s){var u=Number(String(s.getOSVersion()).split(".")[0]);return s.getOSName(!0)==="android"&&u>=3},describe:function(){return{type:i.PLATFORMS_MAP.tablet}}},{test:function(s){return s.getOSName(!0)==="android"},describe:function(){return{type:i.PLATFORMS_MAP.mobile}}},{test:function(s){return s.getOSName(!0)==="macos"},describe:function(){return{type:i.PLATFORMS_MAP.desktop,vendor:"Apple"}}},{test:function(s){return s.getOSName(!0)==="windows"},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(s){return s.getOSName(!0)==="linux"},describe:function(){return{type:i.PLATFORMS_MAP.desktop}}},{test:function(s){return s.getOSName(!0)==="playstation 4"},describe:function(){return{type:i.PLATFORMS_MAP.tv}}},{test:function(s){return s.getOSName(!0)==="roku"},describe:function(){return{type:i.PLATFORMS_MAP.tv}}}];e.default=a,t.exports=e.default},95:function(t,e,r){"use strict";e.__esModule=!0,e.default=void 0;var n,o=(n=r(17))&&n.__esModule?n:{default:n},i=r(18),a=[{test:function(s){return s.getBrowserName(!0)==="microsoft edge"},describe:function(s){if(/\sedg\//i.test(s))return{name:i.ENGINE_MAP.Blink};var u=o.default.getFirstMatch(/edge\/(\d+(\.?_?\d+)+)/i,s);return{name:i.ENGINE_MAP.EdgeHTML,version:u}}},{test:[/trident/i],describe:function(s){var u={name:i.ENGINE_MAP.Trident},l=o.default.getFirstMatch(/trident\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:function(s){return s.test(/presto/i)},describe:function(s){var u={name:i.ENGINE_MAP.Presto},l=o.default.getFirstMatch(/presto\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:function(s){var u=s.test(/gecko/i),l=s.test(/like gecko/i);return u&&!l},describe:function(s){var u={name:i.ENGINE_MAP.Gecko},l=o.default.getFirstMatch(/gecko\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}},{test:[/(apple)?webkit\/537\.36/i],describe:function(){return{name:i.ENGINE_MAP.Blink}}},{test:[/(apple)?webkit/i],describe:function(s){var u={name:i.ENGINE_MAP.WebKit},l=o.default.getFirstMatch(/webkit\/(\d+(\.?_?\d+)+)/i,s);return l&&(u.version=l),u}}];e.default=a,t.exports=e.default}})})});var TWt,V_e,i5e=v(()=>{TWt=L(o5e()),V_e=({serviceId:t,clientVersion:e})=>async()=>{let r=typeof window<"u"&&window?.navigator?.userAgent?TWt.default.parse(window.navigator.userAgent):void 0,n=[["aws-sdk-js",e],["ua","2.0"],[`os/${r?.os?.name||"other"}`,r?.os?.version],["lang/js"],["md/browser",`${r?.browser?.name??"unknown"}_${r?.browser?.version??"unknown"}`]];return t&&n.push([`api/${t}`,e]),n}});var EWt=v(()=>{});var J_e,PWt=v(()=>{J_e=t=>()=>Promise.reject(t)});var a5e=v(()=>{EWt();PWt()});var MWt,K_e,RWt=v(()=>{MWt=typeof TextEncoder=="function"?new TextEncoder:null,K_e=t=>{if(typeof t=="string"){if(MWt)return MWt.encode(t).byteLength;let e=t.length;for(let r=e-1;r>=0;r--){let n=t.charCodeAt(r);n>127&&n<=2047?e++:n>2047&&n<=65535&&(e+=2),n>=56320&&n<=57343&&r--}return e}else{if(typeof t.byteLength=="number")return t.byteLength;if(typeof t.size=="number")return t.size}throw new Error(`Body Length computation failed for ${t}`)}});var s5e=v(()=>{RWt()});var u5e,l5e=v(()=>{u5e=t=>new TextEncoder().encode(t)});var AWt=v(()=>{l5e()});var IWt,NWt=v(()=>{IWt=t=>{if(typeof t=="string")return t;if(typeof t!="object"||typeof t.byteOffset!="number"||typeof t.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(t)}});var jWt=v(()=>{l5e();AWt();NWt()});var HWt,aT,sT,sK,DWt,hre,aK,mre,r1,c5e,$Wt,LWt,FWt,VWt,JWt,iT,kWt,qWt,BWt,UWt,zWt,pxn,KWt,WWt=v(()=>{HWt="required",aT="fn",sT="argv",sK="ref",DWt="isSet",hre="booleanEquals",aK="error",mre="endpoint",r1="tree",c5e="PartitionResult",$Wt={[HWt]:!1,type:"String"},LWt={[HWt]:!0,default:!1,type:"Boolean"},FWt={[sK]:"Endpoint"},VWt={[aT]:hre,[sT]:[{[sK]:"UseFIPS"},!0]},JWt={[aT]:hre,[sT]:[{[sK]:"UseDualStack"},!0]},iT={},kWt={[aT]:"getAttr",[sT]:[{[sK]:c5e},"supportsFIPS"]},qWt={[aT]:hre,[sT]:[!0,{[aT]:"getAttr",[sT]:[{[sK]:c5e},"supportsDualStack"]}]},BWt=[VWt],UWt=[JWt],zWt=[{[sK]:"Region"}],pxn={version:"1.0",parameters:{Region:$Wt,UseDualStack:LWt,UseFIPS:LWt,Endpoint:$Wt},rules:[{conditions:[{[aT]:DWt,[sT]:[FWt]}],rules:[{conditions:BWt,error:"Invalid Configuration: FIPS and custom endpoint are not supported",type:aK},{conditions:UWt,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",type:aK},{endpoint:{url:FWt,properties:iT,headers:iT},type:mre}],type:r1},{conditions:[{[aT]:DWt,[sT]:zWt}],rules:[{conditions:[{[aT]:"aws.partition",[sT]:zWt,assign:c5e}],rules:[{conditions:[VWt,JWt],rules:[{conditions:[{[aT]:hre,[sT]:[!0,kWt]},qWt],rules:[{endpoint:{url:"https://cognito-identity-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:iT,headers:iT},type:mre}],type:r1},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",type:aK}],type:r1},{conditions:BWt,rules:[{conditions:[{[aT]:hre,[sT]:[kWt,!0]}],rules:[{endpoint:{url:"https://cognito-identity-fips.{Region}.{PartitionResult#dnsSuffix}",properties:iT,headers:iT},type:mre}],type:r1},{error:"FIPS is enabled but this partition does not support FIPS",type:aK}],type:r1},{conditions:UWt,rules:[{conditions:[qWt],rules:[{endpoint:{url:"https://cognito-identity.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:iT,headers:iT},type:mre}],type:r1},{error:"DualStack is enabled but this partition does not support DualStack",type:aK}],type:r1},{endpoint:{url:"https://cognito-identity.{Region}.{PartitionResult#dnsSuffix}",properties:iT,headers:iT},type:mre}],type:r1}],type:r1},{error:"Invalid Configuration: Missing Region",type:aK}]},KWt=pxn});var GWt,ZWt=v(()=>{Vbe();nF();WWt();GWt=(t,e={})=>zte(KWt,{endpointParams:t,logger:e.logger});XN.aws=Hte});var XWt,YWt=v(()=>{L4();fF();tn();r_e();X5();jWt();Z6e();ZWt();XWt=t=>({apiVersion:"2014-06-30",base64Decoder:t?.base64Decoder??uF,base64Encoder:t?.base64Encoder??lF,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??GWt,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??pWt,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new j4},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new rK}],logger:t?.logger??new iF,serviceId:t?.serviceId??"Cognito Identity",urlParser:t?.urlParser??oF,utf8Decoder:t?.utf8Decoder??u5e,utf8Encoder:t?.utf8Encoder??IWt})});var QWt,e8t=v(()=>{QWt=["in-region","cross-region","mobile","standard","legacy"]});var t8t,W_e,mxn,r8t=v(()=>{ZN();t8t=L(o5e());e8t();W_e=({defaultsMode:t}={})=>Y4t(async()=>{let e=typeof t=="function"?await t():t;switch(e?.toLowerCase()){case"auto":return Promise.resolve(mxn()?"mobile":"standard");case"mobile":case"in-region":case"cross-region":case"standard":case"legacy":return Promise.resolve(e?.toLocaleLowerCase());case void 0:return Promise.resolve("legacy");default:throw new Error(`Invalid parameter for "defaultsMode", expect ${QWt.join(", ")}, got ${e}`)}}),mxn=()=>{let e=(typeof window<"u"&&window?.navigator?.userAgent?t8t.default.parse(window.navigator.userAgent):void 0)?.platform?.type;return e==="tablet"||e==="mobile"}});var d5e=v(()=>{r8t()});var n8t,o8t=v(()=>{gWt();r5e();i5e();Vte();Qte();a5e();s5e();nT();YWt();tn();d5e();n8t=t=>{let e=W_e(t),r=()=>e().then(S_e),n=XWt(t);return{...n,...t,runtime:"browser",defaultsMode:e,bodyLengthChecker:t?.bodyLengthChecker??K_e,credentialDefaultProvider:t?.credentialDefaultProvider??(o=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:t?.defaultUserAgentProvider??V_e({serviceId:n.serviceId,clientVersion:yWt.version}),maxAttempts:t?.maxAttempts??rT,region:t?.region??J_e("Region is missing"),requestHandler:cF.create(t?.requestHandler??r),retryMode:t?.retryMode??(async()=>(await r()).retryMode||Wte),sha256:t?.sha256??H_e,streamCollector:t?.streamCollector??Y5,useDualstackEndpoint:t?.useDualstackEndpoint??(()=>Promise.resolve(Xbe)),useFipsEndpoint:t?.useFipsEndpoint??(()=>Promise.resolve(Ybe))}}});var G_e,Z_e,i8t=v(()=>{G_e=t=>{let e=async()=>{if(t.region===void 0)throw new Error("Region is missing from runtimeConfig");let r=t.region;return typeof r=="string"?r:r()};return{setRegion(r){e=r},region(){return e}}},Z_e=t=>({region:t.region()})});var a8t=v(()=>{});var f5e=v(()=>{});var s8t=v(()=>{f5e()});var u8t=v(()=>{s8t();f5e()});var l8t=v(()=>{a8t();u8t()});var p5e=v(()=>{i8t();l8t()});var c8t,d8t,f8t=v(()=>{c8t=t=>{let e=t.httpHandler;return{setHttpHandler(r){e=r},httpHandler(){return e},updateHttpClientConfig(r,n){e.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return e.httpHandlerConfigs()}}},d8t=t=>({httpHandler:t.httpHandler()})});var p8t=v(()=>{f8t()});var m8t=v(()=>{hd()});var h8t=v(()=>{});var g8t=v(()=>{});function gxn(t){return Object.keys(t).reduce((e,r)=>{let n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}var X_e,y8t=v(()=>{X_e=class t{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){let r=new t({...e,headers:{...e.headers}});return r.query&&(r.query=gxn(r.query)),r}static isInstance(e){if(!e)return!1;let r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return t.clone(this)}}});var b8t=v(()=>{});var _8t=v(()=>{});var v8t=v(()=>{});var m5e=v(()=>{p8t();m8t();h8t();g8t();y8t();b8t();_8t();v8t()});var w8t,S8t,C8t=v(()=>{w8t=t=>{let e=t.httpAuthSchemes,r=t.httpAuthSchemeProvider,n=t.credentials;return{setHttpAuthScheme(o){let i=e.findIndex(a=>a.schemeId===o.schemeId);i===-1?e.push(o):e.splice(i,1,o)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(o){r=o},httpAuthSchemeProvider(){return r},setCredentials(o){n=o},credentials(){return n}}},S8t=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()})});var Y_e,x8t,O8t=v(()=>{p5e();m5e();tn();C8t();Y_e=t=>t,x8t=(t,e)=>{let r={...Y_e(G_e(t)),...Y_e(C_e(t)),...Y_e(c8t(t)),...Y_e(w8t(t))};return e.forEach(n=>n.configure(r)),{...t,...Z_e(r),...x_e(r),...d8t(r),...S8t(r)}}});var gF,Q_e=v(()=>{c3e();d3e();f3e();M3e();Vte();fF();_6e();Li();E_e();tn();Z6e();il();o8t();O8t();gF=class extends M4{constructor(...[e]){let r=n8t(e||{}),n=hWt(r),o=Lbe(n),i=h_e(o),a=e_e(i),s=a,u=i_e(s),l=mWt(u),c=x8t(l,e?.extensions||[]);super(c),this.config=c,this.middlewareStack.use(Gbe(this.config)),this.middlewareStack.use(T_e(this.config)),this.middlewareStack.use(R_e(this.config)),this.middlewareStack.use(Nbe(this.config)),this.middlewareStack.use(jbe(this.config)),this.middlewareStack.use($be(this.config)),this.middlewareStack.use(a_e(this.config,{httpAuthSchemeParametersProvider:fWt,identityProviderConfigProvider:async d=>new tK({"aws.auth#sigv4":d.credentials})})),this.middlewareStack.use(P_e(this.config))}destroy(){super.destroy()}}});var my,h5e=v(()=>{tn();my=class t extends eK{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}}});var eve,tve,rve,nve,ove,ive,ave,sve,uve,lve,cve,g5e=v(()=>{h5e();eve=class t extends my{constructor(e){super({name:"InternalErrorException",$fault:"server",...e}),this.name="InternalErrorException",this.$fault="server",Object.setPrototypeOf(this,t.prototype)}},tve=class t extends my{constructor(e){super({name:"InvalidParameterException",$fault:"client",...e}),this.name="InvalidParameterException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},rve=class t extends my{constructor(e){super({name:"LimitExceededException",$fault:"client",...e}),this.name="LimitExceededException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},nve=class t extends my{constructor(e){super({name:"NotAuthorizedException",$fault:"client",...e}),this.name="NotAuthorizedException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},ove=class t extends my{constructor(e){super({name:"ResourceConflictException",$fault:"client",...e}),this.name="ResourceConflictException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},ive=class t extends my{constructor(e){super({name:"TooManyRequestsException",$fault:"client",...e}),this.name="TooManyRequestsException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},ave=class t extends my{constructor(e){super({name:"ResourceNotFoundException",$fault:"client",...e}),this.name="ResourceNotFoundException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},sve=class t extends my{constructor(e){super({name:"ExternalServiceException",$fault:"client",...e}),this.name="ExternalServiceException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},uve=class t extends my{constructor(e){super({name:"InvalidIdentityPoolConfigurationException",$fault:"client",...e}),this.name="InvalidIdentityPoolConfigurationException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},lve=class t extends my{constructor(e){super({name:"DeveloperUserAlreadyRegisteredException",$fault:"client",...e}),this.name="DeveloperUserAlreadyRegisteredException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},cve=class t extends my{constructor(e){super({name:"ConcurrentModificationException",$fault:"client",...e}),this.name="ConcurrentModificationException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}}});function ac(t){return{"content-type":"application/x-amz-json-1.1","x-amz-target":`AWSCognitoIdentityService.${t}`}}var T8t,E8t,P8t,M8t,R8t,A8t,I8t,N8t,j8t,D8t,$8t,L8t,F8t,k8t,q8t,B8t,U8t,z8t,H8t,V8t,J8t,K8t,W8t,G8t,Z8t,X8t,Y8t,Q8t,eGt,tGt,rGt,nGt,oGt,iGt,aGt,sGt,uGt,lGt,cGt,dGt,fGt,pGt,mGt,hGt,gGt,yGt,oc,bxn,_xn,vxn,wxn,Sxn,Cxn,xxn,Oxn,Txn,Exn,Pxn,Mxn,Rxn,Axn,bGt,Ixn,Ki,Nxn,ic,El=v(()=>{L4();m5e();tn();h5e();g5e();T8t=async(t,e)=>{let r=ac("CreateIdentityPool"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},E8t=async(t,e)=>{let r=ac("DeleteIdentities"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},P8t=async(t,e)=>{let r=ac("DeleteIdentityPool"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},M8t=async(t,e)=>{let r=ac("DescribeIdentity"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},R8t=async(t,e)=>{let r=ac("DescribeIdentityPool"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},A8t=async(t,e)=>{let r=ac("GetCredentialsForIdentity"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},I8t=async(t,e)=>{let r=ac("GetId"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},N8t=async(t,e)=>{let r=ac("GetIdentityPoolRoles"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},j8t=async(t,e)=>{let r=ac("GetOpenIdToken"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},D8t=async(t,e)=>{let r=ac("GetOpenIdTokenForDeveloperIdentity"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},$8t=async(t,e)=>{let r=ac("GetPrincipalTagAttributeMap"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},L8t=async(t,e)=>{let r=ac("ListIdentities"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},F8t=async(t,e)=>{let r=ac("ListIdentityPools"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},k8t=async(t,e)=>{let r=ac("ListTagsForResource"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},q8t=async(t,e)=>{let r=ac("LookupDeveloperIdentity"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},B8t=async(t,e)=>{let r=ac("MergeDeveloperIdentities"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},U8t=async(t,e)=>{let r=ac("SetIdentityPoolRoles"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},z8t=async(t,e)=>{let r=ac("SetPrincipalTagAttributeMap"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},H8t=async(t,e)=>{let r=ac("TagResource"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},V8t=async(t,e)=>{let r=ac("UnlinkDeveloperIdentity"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},J8t=async(t,e)=>{let r=ac("UnlinkIdentity"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},K8t=async(t,e)=>{let r=ac("UntagResource"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},W8t=async(t,e)=>{let r=ac("UpdateIdentityPool"),n;return n=JSON.stringify(Qr(t)),ic(e,r,"/",void 0,n)},G8t=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Qr(r),{$metadata:Ki(t),...n}},Z8t=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Qr(r),{$metadata:Ki(t),...n}},X8t=async(t,e)=>t.statusCode>=300?oc(t,e):(await dF(t.body,e),{$metadata:Ki(t)}),Y8t=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=bGt(r,e),{$metadata:Ki(t),...n}},Q8t=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Qr(r),{$metadata:Ki(t),...n}},eGt=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Rxn(r,e),{$metadata:Ki(t),...n}},tGt=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Qr(r),{$metadata:Ki(t),...n}},rGt=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Qr(r),{$metadata:Ki(t),...n}},nGt=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Qr(r),{$metadata:Ki(t),...n}},oGt=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Qr(r),{$metadata:Ki(t),...n}},iGt=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Qr(r),{$metadata:Ki(t),...n}},aGt=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Ixn(r,e),{$metadata:Ki(t),...n}},sGt=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Qr(r),{$metadata:Ki(t),...n}},uGt=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Qr(r),{$metadata:Ki(t),...n}},lGt=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Qr(r),{$metadata:Ki(t),...n}},cGt=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Qr(r),{$metadata:Ki(t),...n}},dGt=async(t,e)=>t.statusCode>=300?oc(t,e):(await dF(t.body,e),{$metadata:Ki(t)}),fGt=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Qr(r),{$metadata:Ki(t),...n}},pGt=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Qr(r),{$metadata:Ki(t),...n}},mGt=async(t,e)=>t.statusCode>=300?oc(t,e):(await dF(t.body,e),{$metadata:Ki(t)}),hGt=async(t,e)=>t.statusCode>=300?oc(t,e):(await dF(t.body,e),{$metadata:Ki(t)}),gGt=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Qr(r),{$metadata:Ki(t),...n}},yGt=async(t,e)=>{if(t.statusCode>=300)return oc(t,e);let r=await Kc(t.body,e),n={};return n=Qr(r),{$metadata:Ki(t),...n}},oc=async(t,e)=>{let r={...t,body:await EKt(t.body,e)},n=PKt(t,r.body);switch(n){case"InternalErrorException":case"com.amazonaws.cognitoidentity#InternalErrorException":throw await wxn(r,e);case"InvalidParameterException":case"com.amazonaws.cognitoidentity#InvalidParameterException":throw await Cxn(r,e);case"LimitExceededException":case"com.amazonaws.cognitoidentity#LimitExceededException":throw await xxn(r,e);case"NotAuthorizedException":case"com.amazonaws.cognitoidentity#NotAuthorizedException":throw await Oxn(r,e);case"ResourceConflictException":case"com.amazonaws.cognitoidentity#ResourceConflictException":throw await Txn(r,e);case"TooManyRequestsException":case"com.amazonaws.cognitoidentity#TooManyRequestsException":throw await Pxn(r,e);case"ResourceNotFoundException":case"com.amazonaws.cognitoidentity#ResourceNotFoundException":throw await Exn(r,e);case"ExternalServiceException":case"com.amazonaws.cognitoidentity#ExternalServiceException":throw await vxn(r,e);case"InvalidIdentityPoolConfigurationException":case"com.amazonaws.cognitoidentity#InvalidIdentityPoolConfigurationException":throw await Sxn(r,e);case"DeveloperUserAlreadyRegisteredException":case"com.amazonaws.cognitoidentity#DeveloperUserAlreadyRegisteredException":throw await _xn(r,e);case"ConcurrentModificationException":case"com.amazonaws.cognitoidentity#ConcurrentModificationException":throw await bxn(r,e);default:let o=r.body;return Nxn({output:t,parsedBody:o,errorCode:n})}},bxn=async(t,e)=>{let r=t.body,n=Qr(r),o=new cve({$metadata:Ki(t),...n});return nc(o,r)},_xn=async(t,e)=>{let r=t.body,n=Qr(r),o=new lve({$metadata:Ki(t),...n});return nc(o,r)},vxn=async(t,e)=>{let r=t.body,n=Qr(r),o=new sve({$metadata:Ki(t),...n});return nc(o,r)},wxn=async(t,e)=>{let r=t.body,n=Qr(r),o=new eve({$metadata:Ki(t),...n});return nc(o,r)},Sxn=async(t,e)=>{let r=t.body,n=Qr(r),o=new uve({$metadata:Ki(t),...n});return nc(o,r)},Cxn=async(t,e)=>{let r=t.body,n=Qr(r),o=new tve({$metadata:Ki(t),...n});return nc(o,r)},xxn=async(t,e)=>{let r=t.body,n=Qr(r),o=new rve({$metadata:Ki(t),...n});return nc(o,r)},Oxn=async(t,e)=>{let r=t.body,n=Qr(r),o=new nve({$metadata:Ki(t),...n});return nc(o,r)},Txn=async(t,e)=>{let r=t.body,n=Qr(r),o=new ove({$metadata:Ki(t),...n});return nc(o,r)},Exn=async(t,e)=>{let r=t.body,n=Qr(r),o=new ave({$metadata:Ki(t),...n});return nc(o,r)},Pxn=async(t,e)=>{let r=t.body,n=Qr(r),o=new ive({$metadata:Ki(t),...n});return nc(o,r)},Mxn=(t,e)=>rre(t,{AccessKeyId:ei,Expiration:r=>Q5(v_e(I4(r))),SecretKey:ei,SessionToken:ei}),Rxn=(t,e)=>rre(t,{Credentials:r=>Mxn(r,e),IdentityId:ei}),Axn=(t,e)=>(t||[]).filter(n=>n!=null).map(n=>bGt(n,e)),bGt=(t,e)=>rre(t,{CreationDate:r=>Q5(v_e(I4(r))),IdentityId:ei,LastModifiedDate:r=>Q5(v_e(I4(r))),Logins:Qr}),Ixn=(t,e)=>rre(t,{Identities:r=>Axn(r,e),IdentityPoolId:ei,NextToken:ei}),Ki=t=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}),Nxn=w_e(my),ic=async(t,e,r,n,o)=>{let{hostname:i,protocol:a="https",port:s,path:u}=await t.endpoint(),l={protocol:a,hostname:i,port:s,method:"POST",path:u.endsWith("/")?u.slice(0,-1)+r:u+r,headers:e};return n!==void 0&&(l.hostname=n),o!==void 0&&(l.body=o),new X_e(l)}});var dve,y5e=v(()=>{Li();Ji();tn();il();El();dve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","CreateIdentityPool",{}).n("CognitoIdentityClient","CreateIdentityPoolCommand").f(void 0,void 0).ser(T8t).de(G8t).build(){}});var fve,b5e=v(()=>{Li();Ji();tn();il();El();fve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","DeleteIdentities",{}).n("CognitoIdentityClient","DeleteIdentitiesCommand").f(void 0,void 0).ser(E8t).de(Z8t).build(){}});var pve,_5e=v(()=>{Li();Ji();tn();il();El();pve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","DeleteIdentityPool",{}).n("CognitoIdentityClient","DeleteIdentityPoolCommand").f(void 0,void 0).ser(P8t).de(X8t).build(){}});var mve,v5e=v(()=>{Li();Ji();tn();il();El();mve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","DescribeIdentity",{}).n("CognitoIdentityClient","DescribeIdentityCommand").f(void 0,void 0).ser(M8t).de(Y8t).build(){}});var hve,w5e=v(()=>{Li();Ji();tn();il();El();hve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","DescribeIdentityPool",{}).n("CognitoIdentityClient","DescribeIdentityPoolCommand").f(void 0,void 0).ser(R8t).de(Q8t).build(){}});var uK,S5e=v(()=>{Li();Ji();tn();il();El();uK=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetCredentialsForIdentity",{}).n("CognitoIdentityClient","GetCredentialsForIdentityCommand").f(void 0,void 0).ser(A8t).de(eGt).build(){}});var lK,C5e=v(()=>{Li();Ji();tn();il();El();lK=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetId",{}).n("CognitoIdentityClient","GetIdCommand").f(void 0,void 0).ser(I8t).de(tGt).build(){}});var gve,x5e=v(()=>{Li();Ji();tn();il();El();gve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetIdentityPoolRoles",{}).n("CognitoIdentityClient","GetIdentityPoolRolesCommand").f(void 0,void 0).ser(N8t).de(rGt).build(){}});var yve,O5e=v(()=>{Li();Ji();tn();il();El();yve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetOpenIdToken",{}).n("CognitoIdentityClient","GetOpenIdTokenCommand").f(void 0,void 0).ser(j8t).de(nGt).build(){}});var bve,T5e=v(()=>{Li();Ji();tn();il();El();bve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetOpenIdTokenForDeveloperIdentity",{}).n("CognitoIdentityClient","GetOpenIdTokenForDeveloperIdentityCommand").f(void 0,void 0).ser(D8t).de(oGt).build(){}});var _ve,E5e=v(()=>{Li();Ji();tn();il();El();_ve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","GetPrincipalTagAttributeMap",{}).n("CognitoIdentityClient","GetPrincipalTagAttributeMapCommand").f(void 0,void 0).ser($8t).de(iGt).build(){}});var vve,P5e=v(()=>{Li();Ji();tn();il();El();vve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","ListIdentities",{}).n("CognitoIdentityClient","ListIdentitiesCommand").f(void 0,void 0).ser(L8t).de(aGt).build(){}});var cK,wve=v(()=>{Li();Ji();tn();il();El();cK=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","ListIdentityPools",{}).n("CognitoIdentityClient","ListIdentityPoolsCommand").f(void 0,void 0).ser(F8t).de(sGt).build(){}});var Sve,M5e=v(()=>{Li();Ji();tn();il();El();Sve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","ListTagsForResource",{}).n("CognitoIdentityClient","ListTagsForResourceCommand").f(void 0,void 0).ser(k8t).de(uGt).build(){}});var Cve,R5e=v(()=>{Li();Ji();tn();il();El();Cve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","LookupDeveloperIdentity",{}).n("CognitoIdentityClient","LookupDeveloperIdentityCommand").f(void 0,void 0).ser(q8t).de(lGt).build(){}});var xve,A5e=v(()=>{Li();Ji();tn();il();El();xve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","MergeDeveloperIdentities",{}).n("CognitoIdentityClient","MergeDeveloperIdentitiesCommand").f(void 0,void 0).ser(B8t).de(cGt).build(){}});var Ove,I5e=v(()=>{Li();Ji();tn();il();El();Ove=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","SetIdentityPoolRoles",{}).n("CognitoIdentityClient","SetIdentityPoolRolesCommand").f(void 0,void 0).ser(U8t).de(dGt).build(){}});var Tve,N5e=v(()=>{Li();Ji();tn();il();El();Tve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","SetPrincipalTagAttributeMap",{}).n("CognitoIdentityClient","SetPrincipalTagAttributeMapCommand").f(void 0,void 0).ser(z8t).de(fGt).build(){}});var Eve,j5e=v(()=>{Li();Ji();tn();il();El();Eve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","TagResource",{}).n("CognitoIdentityClient","TagResourceCommand").f(void 0,void 0).ser(H8t).de(pGt).build(){}});var Pve,D5e=v(()=>{Li();Ji();tn();il();El();Pve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","UnlinkDeveloperIdentity",{}).n("CognitoIdentityClient","UnlinkDeveloperIdentityCommand").f(void 0,void 0).ser(V8t).de(mGt).build(){}});var Mve,$5e=v(()=>{Li();Ji();tn();il();El();Mve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","UnlinkIdentity",{}).n("CognitoIdentityClient","UnlinkIdentityCommand").f(void 0,void 0).ser(J8t).de(hGt).build(){}});var Rve,L5e=v(()=>{Li();Ji();tn();il();El();Rve=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","UntagResource",{}).n("CognitoIdentityClient","UntagResourceCommand").f(void 0,void 0).ser(K8t).de(gGt).build(){}});var Ave,F5e=v(()=>{Li();Ji();tn();il();El();Ave=class extends gr.classBuilder().ep({...eo}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSCognitoIdentityService","UpdateIdentityPool",{}).n("CognitoIdentityClient","UpdateIdentityPoolCommand").f(void 0,void 0).ser(W8t).de(yGt).build(){}});var jxn,k5e,_Gt=v(()=>{tn();Q_e();y5e();b5e();_5e();v5e();w5e();S5e();C5e();x5e();O5e();T5e();E5e();P5e();wve();M5e();R5e();A5e();I5e();N5e();j5e();D5e();$5e();L5e();F5e();jxn={CreateIdentityPoolCommand:dve,DeleteIdentitiesCommand:fve,DeleteIdentityPoolCommand:pve,DescribeIdentityCommand:mve,DescribeIdentityPoolCommand:hve,GetCredentialsForIdentityCommand:uK,GetIdCommand:lK,GetIdentityPoolRolesCommand:gve,GetOpenIdTokenCommand:yve,GetOpenIdTokenForDeveloperIdentityCommand:bve,GetPrincipalTagAttributeMapCommand:_ve,ListIdentitiesCommand:vve,ListIdentityPoolsCommand:cK,ListTagsForResourceCommand:Sve,LookupDeveloperIdentityCommand:Cve,MergeDeveloperIdentitiesCommand:xve,SetIdentityPoolRolesCommand:Ove,SetPrincipalTagAttributeMapCommand:Tve,TagResourceCommand:Eve,UnlinkDeveloperIdentityCommand:Pve,UnlinkIdentityCommand:Mve,UntagResourceCommand:Rve,UpdateIdentityPoolCommand:Ave},k5e=class extends gF{};__e(jxn,k5e)});var vGt=v(()=>{y5e();b5e();_5e();v5e();w5e();S5e();C5e();x5e();O5e();T5e();E5e();P5e();wve();M5e();R5e();A5e();I5e();N5e();j5e();D5e();$5e();L5e();F5e()});var wGt=v(()=>{});var ira,SGt=v(()=>{fF();Q_e();wve();ira=b6e(gF,cK,"NextToken","NextToken","MaxResults")});var CGt=v(()=>{wGt();SGt()});var xGt=v(()=>{g5e()});var OGt=v(()=>{Q_e();_Gt();vGt();CGt();xGt()});var q5e={};Jn(q5e,{CognitoIdentityClient:()=>gF,GetCredentialsForIdentityCommand:()=>uK,GetIdCommand:()=>lK});var B5e=v(()=>{OGt()});function Ive(t){return async()=>{t.logger?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");let{GetCredentialsForIdentityCommand:e,CognitoIdentityClient:r}=await Promise.resolve().then(()=>(B5e(),q5e)),{Credentials:{AccessKeyId:n=Dxn(t.logger),Expiration:o,SecretKey:i=Lxn(t.logger),SessionToken:a}=$xn(t.logger)}=await(t.client??new r(Object.assign({},t.clientConfig??{},{region:t.clientConfig?.region??t.parentClientConfig?.region}))).send(new e({CustomRoleArn:t.customRoleArn,IdentityId:t.identityId,Logins:t.logins?await Abe(t.logins):void 0}));return{identityId:t.identityId,accessKeyId:n,secretAccessKey:i,sessionToken:a,expiration:o}}}function Dxn(t){throw new xm("Response from Amazon Cognito contained no access key ID",{logger:t})}function $xn(t){throw new xm("Response from Amazon Cognito contained no credentials",{logger:t})}function Lxn(t){throw new xm("Response from Amazon Cognito contained no secret key",{logger:t})}var U5e=v(()=>{ZN();s3e()});var z5e,Nve,TGt=v(()=>{z5e="IdentityIds",Nve=class{constructor(e="aws:cognito-identity-ids"){this.dbName=e}getItem(e){return this.withObjectStore("readonly",r=>{let n=r.get(e);return new Promise(o=>{n.onerror=()=>o(null),n.onsuccess=()=>o(n.result?n.result.value:null)})}).catch(()=>null)}removeItem(e){return this.withObjectStore("readwrite",r=>{let n=r.delete(e);return new Promise((o,i)=>{n.onerror=()=>i(n.error),n.onsuccess=()=>o()})})}setItem(e,r){return this.withObjectStore("readwrite",n=>{let o=n.put({id:e,value:r});return new Promise((i,a)=>{o.onerror=()=>a(o.error),o.onsuccess=()=>i()})})}getDb(){let e=self.indexedDB.open(this.dbName,1);return new Promise((r,n)=>{e.onsuccess=()=>{r(e.result)},e.onerror=()=>{n(e.error)},e.onblocked=()=>{n(new Error("Unable to access DB"))},e.onupgradeneeded=()=>{let o=e.result;o.onerror=()=>{n(new Error("Failed to create object store"))},o.createObjectStore(z5e,{keyPath:"id"})}})}withObjectStore(e,r){return this.getDb().then(n=>{let o=n.transaction(z5e,e);return o.oncomplete=()=>n.close(),new Promise((i,a)=>{o.onerror=()=>a(o.error),i(r(o.objectStore(z5e)))}).catch(i=>{throw n.close(),i})})}}});var jve,EGt=v(()=>{jve=class{constructor(e={}){this.store=e}getItem(e){return e in this.store?this.store[e]:null}removeItem(e){delete this.store[e]}setItem(e,r){this.store[e]=r}}});function PGt(){return typeof self=="object"&&self.indexedDB?new Nve:typeof window=="object"&&window.localStorage?window.localStorage:Fxn}var Fxn,MGt=v(()=>{TGt();EGt();Fxn=new jve});function RGt({accountId:t,cache:e=PGt(),client:r,clientConfig:n,customRoleArn:o,identityPoolId:i,logins:a,userIdentifier:s=!a||Object.keys(a).length===0?"ANONYMOUS":void 0,logger:u,parentClientConfig:l}){u?.debug("@aws-sdk/credential-provider-cognito-identity - fromCognitoIdentity");let c=s?`aws:cognito-identity-credentials:${i}:${s}`:void 0,d=async()=>{let{GetIdCommand:f,CognitoIdentityClient:p}=await Promise.resolve().then(()=>(B5e(),q5e)),m=r??new p(Object.assign({},n??{},{region:n?.region??l?.region})),h=c&&await e.getItem(c);if(!h){let{IdentityId:g=kxn(u)}=await m.send(new f({AccountId:t,IdentityPoolId:i,Logins:a?await Abe(a):void 0}));h=g,c&&Promise.resolve(e.setItem(c,h)).catch(()=>{})}return d=Ive({client:m,customRoleArn:o,logins:a,identityId:h}),d()};return()=>d().catch(async f=>{throw c&&Promise.resolve(e.removeItem(c)).catch(()=>{}),f})}function kxn(t){throw new xm("Response from Amazon Cognito contained no identity ID",{logger:t})}var AGt=v(()=>{ZN();U5e();MGt();s3e()});var H5e=v(()=>{V4t();J4t();K4t();U5e();AGt()});var qxn,IGt=v(()=>{H5e();qxn=t=>Ive({...t})});var Bxn,NGt=v(()=>{H5e();Bxn=t=>RGt({...t})});var Uxn,zxn,Hxn,jGt,DGt=v(()=>{ZN();Uxn="169.254.170.2",zxn="169.254.170.23",Hxn="[fd00:ec2::23]",jGt=(t,e)=>{if(t.protocol!=="https:"&&!(t.hostname===Uxn||t.hostname===zxn||t.hostname===Hxn)){if(t.hostname.includes("[")){if(t.hostname==="[::1]"||t.hostname==="[0000:0000:0000:0000:0000:0000:0000:0001]")return}else{if(t.hostname==="localhost")return;let r=t.hostname.split("."),n=o=>{let i=parseInt(o,10);return 0<=i&&i<=255};if(r[0]==="127"&&n(r[1])&&n(r[2])&&n(r[3])&&r.length===4)return}throw new xm(`URL not accepted. It must either be HTTPS or match one of the following: + - loopback CIDR 127.0.0.0/8 or [::1/128] + - ECS container host 169.254.170.2 + - EKS container host 169.254.170.23 or [fd00:ec2::23]`,{logger:e})}}});var $Gt=v(()=>{});var LGt=v(()=>{$Gt()});var FGt=v(()=>{hd()});var kGt=v(()=>{});var qGt=v(()=>{});function Vxn(t){return Object.keys(t).reduce((e,r)=>{let n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}var Dve,BGt=v(()=>{Dve=class t{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){let r=new t({...e,headers:{...e.headers}});return r.query&&(r.query=Vxn(r.query)),r}static isInstance(e){if(!e)return!1;let r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return t.clone(this)}}});var UGt=v(()=>{});var zGt=v(()=>{});var HGt=v(()=>{});var VGt=v(()=>{LGt();FGt();kGt();qGt();BGt();UGt();zGt();HGt()});function JGt(t){return new Dve({protocol:t.protocol,hostname:t.hostname,port:Number(t.port),path:t.pathname,query:Array.from(t.searchParams.entries()).reduce((e,[r,n])=>(e[r]=n,e),{}),fragment:t.hash})}async function KGt(t,e){let n=await c6t(t.body).transformToString();if(t.statusCode===200){let o=JSON.parse(n);if(typeof o.AccessKeyId!="string"||typeof o.SecretAccessKey!="string"||typeof o.Token!="string"||typeof o.Expiration!="string")throw new xm("HTTP credential provider response not of the required format, an object matching: { AccessKeyId: string, SecretAccessKey: string, Token: string, Expiration: string(rfc3339) }",{logger:e});return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.Token,expiration:E6t(o.Expiration)}}if(t.statusCode>=400&&t.statusCode<500){let o={};try{o=JSON.parse(n)}catch{}throw Object.assign(new xm(`Server responded with status: ${t.statusCode}`,{logger:e}),{Code:o.Code,Message:o.Message})}throw new xm(`Server responded with status: ${t.statusCode}`,{logger:e})}var WGt=v(()=>{ZN();VGt();tn();a6e()});var GGt,ZGt=v(()=>{GGt=(t,e,r)=>async()=>{for(let n=0;nsetTimeout(i,r))}return await t()}});var V5e,XGt=v(()=>{Qte();ZN();DGt();WGt();ZGt();V5e=(t={})=>{t.logger?.debug("@aws-sdk/credential-provider-http - fromHttp");let e,r=t.credentialsFullUri;if(r)e=r;else throw new xm("No HTTP credential provider host provided.",{logger:t.logger});let n=new URL(e);jGt(n,t.logger);let o=new cF;return GGt(async()=>{let i=JGt(n);t.authorizationToken&&(i.headers.Authorization=t.authorizationToken);let a=await o.handle(i);return KGt(a.response)},t.maxRetries??3,t.timeout??1e3)}});var YGt=v(()=>{XGt()});function Jxn(t){return{schemeId:"aws.auth#sigv4",signingProperties:{name:"sts",region:t.region},propertiesExtractor:(e,r)=>({signingProperties:{config:e,context:r}})}}function QGt(t){return{schemeId:"smithy.api#noAuth"}}var e9t,t9t,Kxn,r9t,J5e=v(()=>{L4();pC();gre();e9t=async(t,e,r)=>({operation:tT(e).operation,region:await py(t.region)()||(()=>{throw new Error("expected `region` to be configured for `aws.auth#sigv4`")})()});t9t=t=>{let e=[];switch(t.operation){case"AssumeRoleWithSAML":{e.push(QGt(t));break}case"AssumeRoleWithWebIdentity":{e.push(QGt(t));break}default:e.push(Jxn(t))}return e},Kxn=t=>({...t,stsClientCtor:yS}),r9t=t=>{let e=Kxn(t);return{...q_e(e)}}});var n9t,hy,uT=v(()=>{n9t=t=>({...t,useDualstackEndpoint:t.useDualstackEndpoint??!1,useFipsEndpoint:t.useFipsEndpoint??!1,useGlobalEndpoint:t.useGlobalEndpoint??!1,defaultSigningName:"sts"}),hy={UseGlobalEndpoint:{type:"builtInParams",name:"useGlobalEndpoint"},UseFIPS:{type:"builtInParams",name:"useFipsEndpoint"},Endpoint:{type:"builtInParams",name:"endpoint"},Region:{type:"builtInParams",name:"region"},UseDualStack:{type:"builtInParams",name:"useDualstackEndpoint"}}});var i9t,o9t=v(()=>{i9t={name:"@aws-sdk/client-sts",description:"AWS SDK for JavaScript Sts Client for Node.js, Browser and React Native",version:"3.645.0",scripts:{build:"concurrently 'yarn:build:cjs' 'yarn:build:es' 'yarn:build:types'","build:cjs":"node ../../scripts/compilation/inline client-sts","build:es":"tsc -p tsconfig.es.json","build:include:deps":"lerna run --scope $npm_package_name --include-dependencies build","build:types":"rimraf ./dist-types tsconfig.types.tsbuildinfo && tsc -p tsconfig.types.json","build:types:downlevel":"downlevel-dts dist-types dist-types/ts3.4",clean:"rimraf ./dist-* && rimraf *.tsbuildinfo","extract:docs":"api-extractor run --local","generate:client":"node ../../scripts/generate-clients/single-service --solo sts",test:"yarn test:unit","test:unit":"jest"},main:"./dist-cjs/index.js",types:"./dist-types/index.d.ts",module:"./dist-es/index.js",sideEffects:!1,dependencies:{"@aws-crypto/sha256-browser":"5.2.0","@aws-crypto/sha256-js":"5.2.0","@aws-sdk/client-sso-oidc":"3.645.0","@aws-sdk/core":"3.635.0","@aws-sdk/credential-provider-node":"3.645.0","@aws-sdk/middleware-host-header":"3.620.0","@aws-sdk/middleware-logger":"3.609.0","@aws-sdk/middleware-recursion-detection":"3.620.0","@aws-sdk/middleware-user-agent":"3.645.0","@aws-sdk/region-config-resolver":"3.614.0","@aws-sdk/types":"3.609.0","@aws-sdk/util-endpoints":"3.645.0","@aws-sdk/util-user-agent-browser":"3.609.0","@aws-sdk/util-user-agent-node":"3.614.0","@smithy/config-resolver":"^3.0.5","@smithy/core":"^2.4.0","@smithy/fetch-http-handler":"^3.2.4","@smithy/hash-node":"^3.0.3","@smithy/invalid-dependency":"^3.0.3","@smithy/middleware-content-length":"^3.0.5","@smithy/middleware-endpoint":"^3.1.0","@smithy/middleware-retry":"^3.0.15","@smithy/middleware-serde":"^3.0.3","@smithy/middleware-stack":"^3.0.3","@smithy/node-config-provider":"^3.1.4","@smithy/node-http-handler":"^3.1.4","@smithy/protocol-http":"^4.1.0","@smithy/smithy-client":"^3.2.0","@smithy/types":"^3.3.0","@smithy/url-parser":"^3.0.3","@smithy/util-base64":"^3.0.0","@smithy/util-body-length-browser":"^3.0.0","@smithy/util-body-length-node":"^3.0.0","@smithy/util-defaults-mode-browser":"^3.0.15","@smithy/util-defaults-mode-node":"^3.0.15","@smithy/util-endpoints":"^2.0.5","@smithy/util-middleware":"^3.0.3","@smithy/util-retry":"^3.0.3","@smithy/util-utf8":"^3.0.0",tslib:"^2.6.2"},devDependencies:{"@tsconfig/node16":"16.1.3","@types/node":"^16.18.96",concurrently:"7.0.0","downlevel-dts":"0.10.1",rimraf:"3.0.2",typescript:"~4.9.5"},engines:{node:">=16.0.0"},typesVersions:{"<4.0":{"dist-types/*":["dist-types/ts3.4/*"]}},files:["dist-*/**"],author:{name:"AWS SDK for JavaScript Team",url:"https://aws.amazon.com/javascript/"},license:"Apache-2.0",browser:{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.browser"},"react-native":{"./dist-es/runtimeConfig":"./dist-es/runtimeConfig.native"},homepage:"https://github.com/aws/aws-sdk-js-v3/tree/main/clients/client-sts",repository:{type:"git",url:"https://github.com/aws/aws-sdk-js-v3.git",directory:"clients/client-sts"}}});var K5e,W5e=v(()=>{K5e=t=>new TextEncoder().encode(t)});var a9t=v(()=>{W5e()});var s9t,u9t=v(()=>{s9t=t=>{if(typeof t=="string")return t;if(typeof t!="object"||typeof t.byteOffset!="number"||typeof t.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return new TextDecoder("utf-8").decode(t)}});var l9t=v(()=>{W5e();a9t();u9t()});var v9t,Wo,rs,ns,bF,yF,sg,w9t,S9t,C9t,Pl,c9t,lT,dK,Z5e,d9t,G5e,x9t,f9t,ug,p9t,O9t,T9t,gy,qv,m9t,E9t,P9t,h9t,M9t,g9t,y9t,b9t,_9t,Gxn,R9t,A9t=v(()=>{v9t="required",Wo="type",rs="fn",ns="argv",bF="ref",yF="booleanEquals",sg="stringEquals",w9t="sigv4",S9t="sts",C9t="us-east-1",Pl="endpoint",c9t="https://sts.{Region}.{PartitionResult#dnsSuffix}",lT="tree",dK="error",Z5e="getAttr",d9t={[v9t]:!1,[Wo]:"String"},G5e={[v9t]:!0,default:!1,[Wo]:"Boolean"},x9t={[bF]:"Endpoint"},f9t={[rs]:"isSet",[ns]:[{[bF]:"Region"}]},ug={[bF]:"Region"},p9t={[rs]:"aws.partition",[ns]:[ug],assign:"PartitionResult"},O9t={[bF]:"UseFIPS"},T9t={[bF]:"UseDualStack"},gy={url:"https://sts.amazonaws.com",properties:{authSchemes:[{name:w9t,signingName:S9t,signingRegion:C9t}]},headers:{}},qv={},m9t={conditions:[{[rs]:sg,[ns]:[ug,"aws-global"]}],[Pl]:gy,[Wo]:Pl},E9t={[rs]:yF,[ns]:[O9t,!0]},P9t={[rs]:yF,[ns]:[T9t,!0]},h9t={[rs]:Z5e,[ns]:[{[bF]:"PartitionResult"},"supportsFIPS"]},M9t={[bF]:"PartitionResult"},g9t={[rs]:yF,[ns]:[!0,{[rs]:Z5e,[ns]:[M9t,"supportsDualStack"]}]},y9t=[{[rs]:"isSet",[ns]:[x9t]}],b9t=[E9t],_9t=[P9t],Gxn={version:"1.0",parameters:{Region:d9t,UseDualStack:G5e,UseFIPS:G5e,Endpoint:d9t,UseGlobalEndpoint:G5e},rules:[{conditions:[{[rs]:yF,[ns]:[{[bF]:"UseGlobalEndpoint"},!0]},{[rs]:"not",[ns]:y9t},f9t,p9t,{[rs]:yF,[ns]:[O9t,!1]},{[rs]:yF,[ns]:[T9t,!1]}],rules:[{conditions:[{[rs]:sg,[ns]:[ug,"ap-northeast-1"]}],endpoint:gy,[Wo]:Pl},{conditions:[{[rs]:sg,[ns]:[ug,"ap-south-1"]}],endpoint:gy,[Wo]:Pl},{conditions:[{[rs]:sg,[ns]:[ug,"ap-southeast-1"]}],endpoint:gy,[Wo]:Pl},{conditions:[{[rs]:sg,[ns]:[ug,"ap-southeast-2"]}],endpoint:gy,[Wo]:Pl},m9t,{conditions:[{[rs]:sg,[ns]:[ug,"ca-central-1"]}],endpoint:gy,[Wo]:Pl},{conditions:[{[rs]:sg,[ns]:[ug,"eu-central-1"]}],endpoint:gy,[Wo]:Pl},{conditions:[{[rs]:sg,[ns]:[ug,"eu-north-1"]}],endpoint:gy,[Wo]:Pl},{conditions:[{[rs]:sg,[ns]:[ug,"eu-west-1"]}],endpoint:gy,[Wo]:Pl},{conditions:[{[rs]:sg,[ns]:[ug,"eu-west-2"]}],endpoint:gy,[Wo]:Pl},{conditions:[{[rs]:sg,[ns]:[ug,"eu-west-3"]}],endpoint:gy,[Wo]:Pl},{conditions:[{[rs]:sg,[ns]:[ug,"sa-east-1"]}],endpoint:gy,[Wo]:Pl},{conditions:[{[rs]:sg,[ns]:[ug,C9t]}],endpoint:gy,[Wo]:Pl},{conditions:[{[rs]:sg,[ns]:[ug,"us-east-2"]}],endpoint:gy,[Wo]:Pl},{conditions:[{[rs]:sg,[ns]:[ug,"us-west-1"]}],endpoint:gy,[Wo]:Pl},{conditions:[{[rs]:sg,[ns]:[ug,"us-west-2"]}],endpoint:gy,[Wo]:Pl},{endpoint:{url:c9t,properties:{authSchemes:[{name:w9t,signingName:S9t,signingRegion:"{Region}"}]},headers:qv},[Wo]:Pl}],[Wo]:lT},{conditions:y9t,rules:[{conditions:b9t,error:"Invalid Configuration: FIPS and custom endpoint are not supported",[Wo]:dK},{conditions:_9t,error:"Invalid Configuration: Dualstack and custom endpoint are not supported",[Wo]:dK},{endpoint:{url:x9t,properties:qv,headers:qv},[Wo]:Pl}],[Wo]:lT},{conditions:[f9t],rules:[{conditions:[p9t],rules:[{conditions:[E9t,P9t],rules:[{conditions:[{[rs]:yF,[ns]:[!0,h9t]},g9t],rules:[{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:qv,headers:qv},[Wo]:Pl}],[Wo]:lT},{error:"FIPS and DualStack are enabled, but this partition does not support one or both",[Wo]:dK}],[Wo]:lT},{conditions:b9t,rules:[{conditions:[{[rs]:yF,[ns]:[h9t,!0]}],rules:[{conditions:[{[rs]:sg,[ns]:[{[rs]:Z5e,[ns]:[M9t,"name"]},"aws-us-gov"]}],endpoint:{url:"https://sts.{Region}.amazonaws.com",properties:qv,headers:qv},[Wo]:Pl},{endpoint:{url:"https://sts-fips.{Region}.{PartitionResult#dnsSuffix}",properties:qv,headers:qv},[Wo]:Pl}],[Wo]:lT},{error:"FIPS is enabled but this partition does not support FIPS",[Wo]:dK}],[Wo]:lT},{conditions:_9t,rules:[{conditions:[g9t],rules:[{endpoint:{url:"https://sts.{Region}.{PartitionResult#dualStackDnsSuffix}",properties:qv,headers:qv},[Wo]:Pl}],[Wo]:lT},{error:"DualStack is enabled but this partition does not support DualStack",[Wo]:dK}],[Wo]:lT},m9t,{endpoint:{url:c9t,properties:qv,headers:qv},[Wo]:Pl}],[Wo]:lT}],[Wo]:lT},{error:"Invalid Configuration: Missing Region",[Wo]:dK}]},R9t=Gxn});var I9t,N9t=v(()=>{Vbe();nF();A9t();I9t=(t,e={})=>zte(R9t,{endpointParams:t,logger:e.logger});XN.aws=Hte});var j9t,D9t=v(()=>{L4();fF();tn();r_e();X5();l9t();J5e();N9t();j9t=t=>({apiVersion:"2011-06-15",base64Decoder:t?.base64Decoder??uF,base64Encoder:t?.base64Encoder??lF,disableHostPrefix:t?.disableHostPrefix??!1,endpointProvider:t?.endpointProvider??I9t,extensions:t?.extensions??[],httpAuthSchemeProvider:t?.httpAuthSchemeProvider??t9t,httpAuthSchemes:t?.httpAuthSchemes??[{schemeId:"aws.auth#sigv4",identityProvider:e=>e.getIdentityProvider("aws.auth#sigv4"),signer:new j4},{schemeId:"smithy.api#noAuth",identityProvider:e=>e.getIdentityProvider("smithy.api#noAuth")||(async()=>({})),signer:new rK}],logger:t?.logger??new iF,serviceId:t?.serviceId??"STS",urlParser:t?.urlParser??oF,utf8Decoder:t?.utf8Decoder??K5e,utf8Encoder:t?.utf8Encoder??s9t})});var $9t,L9t=v(()=>{o9t();r5e();i5e();Vte();Qte();a5e();s5e();nT();D9t();tn();d5e();$9t=t=>{let e=W_e(t),r=()=>e().then(S_e),n=j9t(t);return{...n,...t,runtime:"browser",defaultsMode:e,bodyLengthChecker:t?.bodyLengthChecker??K_e,credentialDefaultProvider:t?.credentialDefaultProvider??(o=>()=>Promise.reject(new Error("Credential is missing"))),defaultUserAgentProvider:t?.defaultUserAgentProvider??V_e({serviceId:n.serviceId,clientVersion:i9t.version}),maxAttempts:t?.maxAttempts??rT,region:t?.region??J_e("Region is missing"),requestHandler:cF.create(t?.requestHandler??r),retryMode:t?.retryMode??(async()=>(await r()).retryMode||Wte),sha256:t?.sha256??H_e,streamCollector:t?.streamCollector??Y5,useDualstackEndpoint:t?.useDualstackEndpoint??(()=>Promise.resolve(Xbe)),useFipsEndpoint:t?.useFipsEndpoint??(()=>Promise.resolve(Ybe))}}});var F9t,k9t,q9t=v(()=>{F9t=t=>{let e=t.httpHandler;return{setHttpHandler(r){e=r},httpHandler(){return e},updateHttpClientConfig(r,n){e.updateHttpClientConfig(r,n)},httpHandlerConfigs(){return e.httpHandlerConfigs()}}},k9t=t=>({httpHandler:t.httpHandler()})});var B9t=v(()=>{q9t()});var U9t=v(()=>{hd()});var z9t=v(()=>{});var H9t=v(()=>{});function Zxn(t){return Object.keys(t).reduce((e,r)=>{let n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}var $ve,V9t=v(()=>{$ve=class t{constructor(e){this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){let r=new t({...e,headers:{...e.headers}});return r.query&&(r.query=Zxn(r.query)),r}static isInstance(e){if(!e)return!1;let r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return t.clone(this)}}});var J9t=v(()=>{});var K9t=v(()=>{});var W9t=v(()=>{});var X5e=v(()=>{B9t();U9t();z9t();H9t();V9t();J9t();K9t();W9t()});var G9t,Z9t,X9t=v(()=>{G9t=t=>{let e=t.httpAuthSchemes,r=t.httpAuthSchemeProvider,n=t.credentials;return{setHttpAuthScheme(o){let i=e.findIndex(a=>a.schemeId===o.schemeId);i===-1?e.push(o):e.splice(i,1,o)},httpAuthSchemes(){return e},setHttpAuthSchemeProvider(o){r=o},httpAuthSchemeProvider(){return r},setCredentials(o){n=o},credentials(){return n}}},Z9t=t=>({httpAuthSchemes:t.httpAuthSchemes(),httpAuthSchemeProvider:t.httpAuthSchemeProvider(),credentials:t.credentials()})});var Lve,Y9t,Q9t=v(()=>{p5e();X5e();tn();X9t();Lve=t=>t,Y9t=(t,e)=>{let r={...Lve(G_e(t)),...Lve(C_e(t)),...Lve(F9t(t)),...Lve(G9t(t))};return e.forEach(n=>n.configure(r)),{...t,...Z_e(r),...x_e(r),...k9t(r),...Z9t(r)}}});var yS,gre=v(()=>{c3e();d3e();f3e();M3e();Vte();fF();_6e();Li();E_e();tn();J5e();uT();L9t();Q9t();yS=class extends M4{constructor(...[e]){let r=$9t(e||{}),n=n9t(r),o=Lbe(n),i=h_e(o),a=e_e(i),s=a,u=i_e(s),l=r9t(u),c=Y9t(l,e?.extensions||[]);super(c),this.config=c,this.middlewareStack.use(Gbe(this.config)),this.middlewareStack.use(T_e(this.config)),this.middlewareStack.use(R_e(this.config)),this.middlewareStack.use(Nbe(this.config)),this.middlewareStack.use(jbe(this.config)),this.middlewareStack.use($be(this.config)),this.middlewareStack.use(a_e(this.config,{httpAuthSchemeParametersProvider:e9t,identityProviderConfigProvider:async d=>new tK({"aws.auth#sigv4":d.credentials})})),this.middlewareStack.use(P_e(this.config))}destroy(){super.destroy()}}});var fb,Fve=v(()=>{tn();fb=class t extends eK{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}}});var yre,bre,_re,vre,wre,Sre,Cre,xre,fK,Y5e,Q5e,eKe,tKe,rKe,nKe,oKe,_F=v(()=>{tn();Fve();yre=class t extends fb{constructor(e){super({name:"ExpiredTokenException",$fault:"client",...e}),this.name="ExpiredTokenException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},bre=class t extends fb{constructor(e){super({name:"MalformedPolicyDocumentException",$fault:"client",...e}),this.name="MalformedPolicyDocumentException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},_re=class t extends fb{constructor(e){super({name:"PackedPolicyTooLargeException",$fault:"client",...e}),this.name="PackedPolicyTooLargeException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},vre=class t extends fb{constructor(e){super({name:"RegionDisabledException",$fault:"client",...e}),this.name="RegionDisabledException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},wre=class t extends fb{constructor(e){super({name:"IDPRejectedClaimException",$fault:"client",...e}),this.name="IDPRejectedClaimException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},Sre=class t extends fb{constructor(e){super({name:"InvalidIdentityTokenException",$fault:"client",...e}),this.name="InvalidIdentityTokenException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},Cre=class t extends fb{constructor(e){super({name:"IDPCommunicationErrorException",$fault:"client",...e}),this.name="IDPCommunicationErrorException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},xre=class t extends fb{constructor(e){super({name:"InvalidAuthorizationMessageException",$fault:"client",...e}),this.name="InvalidAuthorizationMessageException",this.$fault="client",Object.setPrototypeOf(this,t.prototype)}},fK=t=>({...t,...t.SecretAccessKey&&{SecretAccessKey:b_e}}),Y5e=t=>({...t,...t.Credentials&&{Credentials:fK(t.Credentials)}}),Q5e=t=>({...t,...t.SAMLAssertion&&{SAMLAssertion:b_e}}),eKe=t=>({...t,...t.Credentials&&{Credentials:fK(t.Credentials)}}),tKe=t=>({...t,...t.WebIdentityToken&&{WebIdentityToken:b_e}}),rKe=t=>({...t,...t.Credentials&&{Credentials:fK(t.Credentials)}}),nKe=t=>({...t,...t.Credentials&&{Credentials:fK(t.Credentials)}}),oKe=t=>({...t,...t.Credentials&&{Credentials:fK(t.Credentials)}})});var e7t,t7t,r7t,n7t,o7t,i7t,a7t,s7t,u7t,l7t,c7t,d7t,f7t,p7t,m7t,h7t,vF,Xxn,Yxn,Qxn,eOn,tOn,rOn,nOn,oOn,iOn,aOn,sOn,uOn,lOn,cOn,dOn,fOn,kve,pOn,mOn,hOn,gOn,yOn,g7t,NKe,bOn,_On,vOn,Ore,wOn,SOn,COn,xOn,OOn,TOn,EOn,POn,MOn,ROn,AOn,IOn,NOn,jOn,yy,DOn,wF,SF,CF,xF,pK,$On,iKe,n1,LOn,FOn,mK,o1,hK,pb,aKe,kOn,sKe,mb,uKe,lKe,cKe,dKe,fKe,qOn,BOn,UOn,zOn,pKe,mKe,hKe,gKe,bS,_S,yKe,bKe,_Ke,vKe,vS,wKe,i1,gK,SKe,CKe,xKe,OKe,wS,yK,TKe,EKe,bK,_K,PKe,MKe,OF,RKe,AKe,IKe,Ml,TF,HOn,a1=v(()=>{L4();X5e();tn();_F();Fve();e7t=async(t,e)=>{let r=SF,n;return n=TF({...iOn(t,e),[xF]:$On,[OF]:CF}),wF(e,r,"/",void 0,n)},t7t=async(t,e)=>{let r=SF,n;return n=TF({...aOn(t,e),[xF]:LOn,[OF]:CF}),wF(e,r,"/",void 0,n)},r7t=async(t,e)=>{let r=SF,n;return n=TF({...sOn(t,e),[xF]:FOn,[OF]:CF}),wF(e,r,"/",void 0,n)},n7t=async(t,e)=>{let r=SF,n;return n=TF({...uOn(t,e),[xF]:kOn,[OF]:CF}),wF(e,r,"/",void 0,n)},o7t=async(t,e)=>{let r=SF,n;return n=TF({...lOn(t,e),[xF]:qOn,[OF]:CF}),wF(e,r,"/",void 0,n)},i7t=async(t,e)=>{let r=SF,n;return n=TF({...cOn(t,e),[xF]:BOn,[OF]:CF}),wF(e,r,"/",void 0,n)},a7t=async(t,e)=>{let r=SF,n;return n=TF({...dOn(t,e),[xF]:UOn,[OF]:CF}),wF(e,r,"/",void 0,n)},s7t=async(t,e)=>{let r=SF,n;return n=TF({...fOn(t,e),[xF]:zOn,[OF]:CF}),wF(e,r,"/",void 0,n)},u7t=async(t,e)=>{if(t.statusCode>=300)return vF(t,e);let r=await oT(t.body,e),n={};return n=bOn(r.AssumeRoleResult,e),{$metadata:yy(t),...n}},l7t=async(t,e)=>{if(t.statusCode>=300)return vF(t,e);let r=await oT(t.body,e),n={};return n=_On(r.AssumeRoleWithSAMLResult,e),{$metadata:yy(t),...n}},c7t=async(t,e)=>{if(t.statusCode>=300)return vF(t,e);let r=await oT(t.body,e),n={};return n=vOn(r.AssumeRoleWithWebIdentityResult,e),{$metadata:yy(t),...n}},d7t=async(t,e)=>{if(t.statusCode>=300)return vF(t,e);let r=await oT(t.body,e),n={};return n=wOn(r.DecodeAuthorizationMessageResult,e),{$metadata:yy(t),...n}},f7t=async(t,e)=>{if(t.statusCode>=300)return vF(t,e);let r=await oT(t.body,e),n={};return n=xOn(r.GetAccessKeyInfoResult,e),{$metadata:yy(t),...n}},p7t=async(t,e)=>{if(t.statusCode>=300)return vF(t,e);let r=await oT(t.body,e),n={};return n=OOn(r.GetCallerIdentityResult,e),{$metadata:yy(t),...n}},m7t=async(t,e)=>{if(t.statusCode>=300)return vF(t,e);let r=await oT(t.body,e),n={};return n=TOn(r.GetFederationTokenResult,e),{$metadata:yy(t),...n}},h7t=async(t,e)=>{if(t.statusCode>=300)return vF(t,e);let r=await oT(t.body,e),n={};return n=EOn(r.GetSessionTokenResult,e),{$metadata:yy(t),...n}},vF=async(t,e)=>{let r={...t,body:await lWt(t.body,e)},n=HOn(t,r.body);switch(n){case"ExpiredTokenException":case"com.amazonaws.sts#ExpiredTokenException":throw await Xxn(r,e);case"MalformedPolicyDocument":case"com.amazonaws.sts#MalformedPolicyDocumentException":throw await rOn(r,e);case"PackedPolicyTooLarge":case"com.amazonaws.sts#PackedPolicyTooLargeException":throw await nOn(r,e);case"RegionDisabledException":case"com.amazonaws.sts#RegionDisabledException":throw await oOn(r,e);case"IDPRejectedClaim":case"com.amazonaws.sts#IDPRejectedClaimException":throw await Qxn(r,e);case"InvalidIdentityToken":case"com.amazonaws.sts#InvalidIdentityTokenException":throw await tOn(r,e);case"IDPCommunicationError":case"com.amazonaws.sts#IDPCommunicationErrorException":throw await Yxn(r,e);case"InvalidAuthorizationMessageException":case"com.amazonaws.sts#InvalidAuthorizationMessageException":throw await eOn(r,e);default:let o=r.body;return DOn({output:t,parsedBody:o.Error,errorCode:n})}},Xxn=async(t,e)=>{let r=t.body,n=SOn(r.Error,e),o=new yre({$metadata:yy(t),...n});return nc(o,r)},Yxn=async(t,e)=>{let r=t.body,n=POn(r.Error,e),o=new Cre({$metadata:yy(t),...n});return nc(o,r)},Qxn=async(t,e)=>{let r=t.body,n=MOn(r.Error,e),o=new wre({$metadata:yy(t),...n});return nc(o,r)},eOn=async(t,e)=>{let r=t.body,n=ROn(r.Error,e),o=new xre({$metadata:yy(t),...n});return nc(o,r)},tOn=async(t,e)=>{let r=t.body,n=AOn(r.Error,e),o=new Sre({$metadata:yy(t),...n});return nc(o,r)},rOn=async(t,e)=>{let r=t.body,n=IOn(r.Error,e),o=new bre({$metadata:yy(t),...n});return nc(o,r)},nOn=async(t,e)=>{let r=t.body,n=NOn(r.Error,e),o=new _re({$metadata:yy(t),...n});return nc(o,r)},oOn=async(t,e)=>{let r=t.body,n=jOn(r.Error,e),o=new vre({$metadata:yy(t),...n});return nc(o,r)},iOn=(t,e)=>{let r={};if(t[i1]!=null&&(r[i1]=t[i1]),t[gK]!=null&&(r[gK]=t[gK]),t[_S]!=null){let n=kve(t[_S],e);t[_S]?.length===0&&(r.PolicyArns=[]),Object.entries(n).forEach(([o,i])=>{let a=`PolicyArns.${o}`;r[a]=i})}if(t[bS]!=null&&(r[bS]=t[bS]),t[mb]!=null&&(r[mb]=t[mb]),t[bK]!=null){let n=g7t(t[bK],e);t[bK]?.length===0&&(r.Tags=[]),Object.entries(n).forEach(([o,i])=>{let a=`Tags.${o}`;r[a]=i})}if(t[PKe]!=null){let n=yOn(t[PKe],e);t[PKe]?.length===0&&(r.TransitiveTagKeys=[]),Object.entries(n).forEach(([o,i])=>{let a=`TransitiveTagKeys.${o}`;r[a]=i})}if(t[lKe]!=null&&(r[lKe]=t[lKe]),t[yK]!=null&&(r[yK]=t[yK]),t[_K]!=null&&(r[_K]=t[_K]),t[wS]!=null&&(r[wS]=t[wS]),t[_Ke]!=null){let n=hOn(t[_Ke],e);t[_Ke]?.length===0&&(r.ProvidedContexts=[]),Object.entries(n).forEach(([o,i])=>{let a=`ProvidedContexts.${o}`;r[a]=i})}return r},aOn=(t,e)=>{let r={};if(t[i1]!=null&&(r[i1]=t[i1]),t[yKe]!=null&&(r[yKe]=t[yKe]),t[xKe]!=null&&(r[xKe]=t[xKe]),t[_S]!=null){let n=kve(t[_S],e);t[_S]?.length===0&&(r.PolicyArns=[]),Object.entries(n).forEach(([o,i])=>{let a=`PolicyArns.${o}`;r[a]=i})}return t[bS]!=null&&(r[bS]=t[bS]),t[mb]!=null&&(r[mb]=t[mb]),r},sOn=(t,e)=>{let r={};if(t[i1]!=null&&(r[i1]=t[i1]),t[gK]!=null&&(r[gK]=t[gK]),t[AKe]!=null&&(r[AKe]=t[AKe]),t[vKe]!=null&&(r[vKe]=t[vKe]),t[_S]!=null){let n=kve(t[_S],e);t[_S]?.length===0&&(r.PolicyArns=[]),Object.entries(n).forEach(([o,i])=>{let a=`PolicyArns.${o}`;r[a]=i})}return t[bS]!=null&&(r[bS]=t[bS]),t[mb]!=null&&(r[mb]=t[mb]),r},uOn=(t,e)=>{let r={};return t[cKe]!=null&&(r[cKe]=t[cKe]),r},lOn=(t,e)=>{let r={};return t[pK]!=null&&(r[pK]=t[pK]),r},cOn=(t,e)=>({}),dOn=(t,e)=>{let r={};if(t[hKe]!=null&&(r[hKe]=t[hKe]),t[bS]!=null&&(r[bS]=t[bS]),t[_S]!=null){let n=kve(t[_S],e);t[_S]?.length===0&&(r.PolicyArns=[]),Object.entries(n).forEach(([o,i])=>{let a=`PolicyArns.${o}`;r[a]=i})}if(t[mb]!=null&&(r[mb]=t[mb]),t[bK]!=null){let n=g7t(t[bK],e);t[bK]?.length===0&&(r.Tags=[]),Object.entries(n).forEach(([o,i])=>{let a=`Tags.${o}`;r[a]=i})}return r},fOn=(t,e)=>{let r={};return t[mb]!=null&&(r[mb]=t[mb]),t[yK]!=null&&(r[yK]=t[yK]),t[_K]!=null&&(r[_K]=t[_K]),r},kve=(t,e)=>{let r={},n=1;for(let o of t){if(o===null)continue;let i=pOn(o,e);Object.entries(i).forEach(([a,s])=>{r[`member.${n}.${a}`]=s}),n++}return r},pOn=(t,e)=>{let r={};return t[IKe]!=null&&(r[IKe]=t[IKe]),r},mOn=(t,e)=>{let r={};return t[bKe]!=null&&(r[bKe]=t[bKe]),t[aKe]!=null&&(r[aKe]=t[aKe]),r},hOn=(t,e)=>{let r={},n=1;for(let o of t){if(o===null)continue;let i=mOn(o,e);Object.entries(i).forEach(([a,s])=>{r[`member.${n}.${a}`]=s}),n++}return r},gOn=(t,e)=>{let r={};return t[mKe]!=null&&(r[mKe]=t[mKe]),t[RKe]!=null&&(r[RKe]=t[RKe]),r},yOn=(t,e)=>{let r={},n=1;for(let o of t)o!==null&&(r[`member.${n}`]=o,n++);return r},g7t=(t,e)=>{let r={},n=1;for(let o of t){if(o===null)continue;let i=gOn(o,e);Object.entries(i).forEach(([a,s])=>{r[`member.${n}.${a}`]=s}),n++}return r},NKe=(t,e)=>{let r={};return t[iKe]!=null&&(r[iKe]=ei(t[iKe])),t[o1]!=null&&(r[o1]=ei(t[o1])),r},bOn=(t,e)=>{let r={};return t[pb]!=null&&(r[pb]=Ore(t[pb],e)),t[n1]!=null&&(r[n1]=NKe(t[n1],e)),t[vS]!=null&&(r[vS]=tre(t[vS])),t[wS]!=null&&(r[wS]=ei(t[wS])),r},_On=(t,e)=>{let r={};return t[pb]!=null&&(r[pb]=Ore(t[pb],e)),t[n1]!=null&&(r[n1]=NKe(t[n1],e)),t[vS]!=null&&(r[vS]=tre(t[vS])),t[SKe]!=null&&(r[SKe]=ei(t[SKe])),t[TKe]!=null&&(r[TKe]=ei(t[TKe])),t[pKe]!=null&&(r[pKe]=ei(t[pKe])),t[hK]!=null&&(r[hK]=ei(t[hK])),t[gKe]!=null&&(r[gKe]=ei(t[gKe])),t[wS]!=null&&(r[wS]=ei(t[wS])),r},vOn=(t,e)=>{let r={};return t[pb]!=null&&(r[pb]=Ore(t[pb],e)),t[OKe]!=null&&(r[OKe]=ei(t[OKe])),t[n1]!=null&&(r[n1]=NKe(t[n1],e)),t[vS]!=null&&(r[vS]=tre(t[vS])),t[wKe]!=null&&(r[wKe]=ei(t[wKe])),t[hK]!=null&&(r[hK]=ei(t[hK])),t[wS]!=null&&(r[wS]=ei(t[wS])),r},Ore=(t,e)=>{let r={};return t[pK]!=null&&(r[pK]=ei(t[pK])),t[CKe]!=null&&(r[CKe]=ei(t[CKe])),t[EKe]!=null&&(r[EKe]=ei(t[EKe])),t[uKe]!=null&&(r[uKe]=Q5(P6t(t[uKe]))),r},wOn=(t,e)=>{let r={};return t[sKe]!=null&&(r[sKe]=ei(t[sKe])),r},SOn=(t,e)=>{let r={};return t[Ml]!=null&&(r[Ml]=ei(t[Ml])),r},COn=(t,e)=>{let r={};return t[fKe]!=null&&(r[fKe]=ei(t[fKe])),t[o1]!=null&&(r[o1]=ei(t[o1])),r},xOn=(t,e)=>{let r={};return t[mK]!=null&&(r[mK]=ei(t[mK])),r},OOn=(t,e)=>{let r={};return t[MKe]!=null&&(r[MKe]=ei(t[MKe])),t[mK]!=null&&(r[mK]=ei(t[mK])),t[o1]!=null&&(r[o1]=ei(t[o1])),r},TOn=(t,e)=>{let r={};return t[pb]!=null&&(r[pb]=Ore(t[pb],e)),t[dKe]!=null&&(r[dKe]=COn(t[dKe],e)),t[vS]!=null&&(r[vS]=tre(t[vS])),r},EOn=(t,e)=>{let r={};return t[pb]!=null&&(r[pb]=Ore(t[pb],e)),r},POn=(t,e)=>{let r={};return t[Ml]!=null&&(r[Ml]=ei(t[Ml])),r},MOn=(t,e)=>{let r={};return t[Ml]!=null&&(r[Ml]=ei(t[Ml])),r},ROn=(t,e)=>{let r={};return t[Ml]!=null&&(r[Ml]=ei(t[Ml])),r},AOn=(t,e)=>{let r={};return t[Ml]!=null&&(r[Ml]=ei(t[Ml])),r},IOn=(t,e)=>{let r={};return t[Ml]!=null&&(r[Ml]=ei(t[Ml])),r},NOn=(t,e)=>{let r={};return t[Ml]!=null&&(r[Ml]=ei(t[Ml])),r},jOn=(t,e)=>{let r={};return t[Ml]!=null&&(r[Ml]=ei(t[Ml])),r},yy=t=>({httpStatusCode:t.statusCode,requestId:t.headers["x-amzn-requestid"]??t.headers["x-amzn-request-id"]??t.headers["x-amz-request-id"],extendedRequestId:t.headers["x-amz-id-2"],cfId:t.headers["x-amz-cf-id"]}),DOn=w_e(fb),wF=async(t,e,r,n,o)=>{let{hostname:i,protocol:a="https",port:s,path:u}=await t.endpoint(),l={protocol:a,hostname:i,port:s,method:"POST",path:u.endsWith("/")?u.slice(0,-1)+r:u+r,headers:e};return n!==void 0&&(l.hostname=n),o!==void 0&&(l.body=o),new $ve(l)},SF={"content-type":"application/x-www-form-urlencoded"},CF="2011-06-15",xF="Action",pK="AccessKeyId",$On="AssumeRole",iKe="AssumedRoleId",n1="AssumedRoleUser",LOn="AssumeRoleWithSAML",FOn="AssumeRoleWithWebIdentity",mK="Account",o1="Arn",hK="Audience",pb="Credentials",aKe="ContextAssertion",kOn="DecodeAuthorizationMessage",sKe="DecodedMessage",mb="DurationSeconds",uKe="Expiration",lKe="ExternalId",cKe="EncodedMessage",dKe="FederatedUser",fKe="FederatedUserId",qOn="GetAccessKeyInfo",BOn="GetCallerIdentity",UOn="GetFederationToken",zOn="GetSessionToken",pKe="Issuer",mKe="Key",hKe="Name",gKe="NameQualifier",bS="Policy",_S="PolicyArns",yKe="PrincipalArn",bKe="ProviderArn",_Ke="ProvidedContexts",vKe="ProviderId",vS="PackedPolicySize",wKe="Provider",i1="RoleArn",gK="RoleSessionName",SKe="Subject",CKe="SecretAccessKey",xKe="SAMLAssertion",OKe="SubjectFromWebIdentityToken",wS="SourceIdentity",yK="SerialNumber",TKe="SubjectType",EKe="SessionToken",bK="Tags",_K="TokenCode",PKe="TransitiveTagKeys",MKe="UserId",OF="Version",RKe="Value",AKe="WebIdentityToken",IKe="arn",Ml="message",TF=t=>Object.entries(t).map(([e,r])=>O_e(e)+"="+O_e(r)).join("&"),HOn=(t,e)=>{if(e.Error?.Code!==void 0)return e.Error.Code;if(t.statusCode==404)return"NotFound"}});var s1,qve=v(()=>{Li();Ji();tn();uT();_F();a1();s1=class extends gr.classBuilder().ep({...hy}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRole",{}).n("STSClient","AssumeRoleCommand").f(void 0,Y5e).ser(e7t).de(u7t).build(){}});var Tre,jKe=v(()=>{Li();Ji();tn();uT();_F();a1();Tre=class extends gr.classBuilder().ep({...hy}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithSAML",{}).n("STSClient","AssumeRoleWithSAMLCommand").f(Q5e,eKe).ser(t7t).de(l7t).build(){}});var F4,Bve=v(()=>{Li();Ji();tn();uT();_F();a1();F4=class extends gr.classBuilder().ep({...hy}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","AssumeRoleWithWebIdentity",{}).n("STSClient","AssumeRoleWithWebIdentityCommand").f(tKe,rKe).ser(r7t).de(c7t).build(){}});var Ere,DKe=v(()=>{Li();Ji();tn();uT();a1();Ere=class extends gr.classBuilder().ep({...hy}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","DecodeAuthorizationMessage",{}).n("STSClient","DecodeAuthorizationMessageCommand").f(void 0,void 0).ser(n7t).de(d7t).build(){}});var Pre,$Ke=v(()=>{Li();Ji();tn();uT();a1();Pre=class extends gr.classBuilder().ep({...hy}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetAccessKeyInfo",{}).n("STSClient","GetAccessKeyInfoCommand").f(void 0,void 0).ser(o7t).de(f7t).build(){}});var Mre,LKe=v(()=>{Li();Ji();tn();uT();a1();Mre=class extends gr.classBuilder().ep({...hy}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetCallerIdentity",{}).n("STSClient","GetCallerIdentityCommand").f(void 0,void 0).ser(i7t).de(p7t).build(){}});var Rre,FKe=v(()=>{Li();Ji();tn();uT();_F();a1();Rre=class extends gr.classBuilder().ep({...hy}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetFederationToken",{}).n("STSClient","GetFederationTokenCommand").f(void 0,nKe).ser(a7t).de(m7t).build(){}});var Are,kKe=v(()=>{Li();Ji();tn();uT();_F();a1();Are=class extends gr.classBuilder().ep({...hy}).m(function(e,r,n,o){return[xr(n,this.serialize,this.deserialize),Or(n,e.getEndpointParameterInstructions())]}).s("AWSSecurityTokenServiceV20110615","GetSessionToken",{}).n("STSClient","GetSessionTokenCommand").f(void 0,oKe).ser(s7t).de(h7t).build(){}});var VOn,Uve,y7t=v(()=>{tn();qve();jKe();Bve();DKe();$Ke();LKe();FKe();kKe();gre();VOn={AssumeRoleCommand:s1,AssumeRoleWithSAMLCommand:Tre,AssumeRoleWithWebIdentityCommand:F4,DecodeAuthorizationMessageCommand:Ere,GetAccessKeyInfoCommand:Pre,GetCallerIdentityCommand:Mre,GetFederationTokenCommand:Rre,GetSessionTokenCommand:Are},Uve=class extends yS{};__e(VOn,Uve)});var b7t=v(()=>{qve();jKe();Bve();DKe();$Ke();LKe();FKe();kKe()});var _7t=v(()=>{_F()});var v7t,w7t,S7t,C7t,x7t,O7t,T7t=v(()=>{qve();Bve();v7t="us-east-1",w7t=t=>{if(typeof t?.Arn=="string"){let e=t.Arn.split(":");if(e.length>4&&e[4]!=="")return e[4]}},S7t=async(t,e,r)=>{let n=typeof t=="function"?await t():t,o=typeof e=="function"?await e():e;return r?.debug?.("@aws-sdk/client-sts::resolveRegion","accepting first of:",`${n} (provider)`,`${o} (parent client)`,`${v7t} (STS default)`),n??o??v7t},C7t=(t,e)=>{let r,n;return async(o,i)=>{if(n=o,!r){let{logger:l=t?.parentClientConfig?.logger,region:c,requestHandler:d=t?.parentClientConfig?.requestHandler,credentialProviderLogger:f}=t,p=await S7t(c,t?.parentClientConfig?.region,f),m=!O7t(d);r=new e({credentialDefaultProvider:()=>async()=>n,region:p,requestHandler:m?d:void 0,logger:l})}let{Credentials:a,AssumedRoleUser:s}=await r.send(new s1(i));if(!a||!a.AccessKeyId||!a.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRole call with role ${i.RoleArn}`);let u=w7t(s);return{accessKeyId:a.AccessKeyId,secretAccessKey:a.SecretAccessKey,sessionToken:a.SessionToken,expiration:a.Expiration,...a.CredentialScope&&{credentialScope:a.CredentialScope},...u&&{accountId:u}}}},x7t=(t,e)=>{let r;return async n=>{if(!r){let{logger:s=t?.parentClientConfig?.logger,region:u,requestHandler:l=t?.parentClientConfig?.requestHandler,credentialProviderLogger:c}=t,d=await S7t(u,t?.parentClientConfig?.region,c),f=!O7t(l);r=new e({region:d,requestHandler:f?l:void 0,logger:s})}let{Credentials:o,AssumedRoleUser:i}=await r.send(new F4(n));if(!o||!o.AccessKeyId||!o.SecretAccessKey)throw new Error(`Invalid response from STS.assumeRoleWithWebIdentity call with role ${n.RoleArn}`);let a=w7t(i);return{accessKeyId:o.AccessKeyId,secretAccessKey:o.SecretAccessKey,sessionToken:o.SessionToken,expiration:o.Expiration,...o.CredentialScope&&{credentialScope:o.CredentialScope},...a&&{accountId:a}}}},O7t=t=>t?.metadata?.handlerProtocol==="h2"});var E7t,P7t,M7t,JOn,R7t=v(()=>{T7t();gre();E7t=(t,e)=>e?class extends t{constructor(n){super(n);for(let o of e)this.middlewareStack.use(o)}}:t,P7t=(t={},e)=>C7t(t,E7t(yS,e)),M7t=(t={},e)=>x7t(t,E7t(yS,e)),JOn=t=>e=>t({roleAssumer:P7t(e),roleAssumerWithWebIdentity:M7t(e),...e})});var A7t={};Jn(A7t,{$Command:()=>gr,AssumeRoleCommand:()=>s1,AssumeRoleResponseFilterSensitiveLog:()=>Y5e,AssumeRoleWithSAMLCommand:()=>Tre,AssumeRoleWithSAMLRequestFilterSensitiveLog:()=>Q5e,AssumeRoleWithSAMLResponseFilterSensitiveLog:()=>eKe,AssumeRoleWithWebIdentityCommand:()=>F4,AssumeRoleWithWebIdentityRequestFilterSensitiveLog:()=>tKe,AssumeRoleWithWebIdentityResponseFilterSensitiveLog:()=>rKe,CredentialsFilterSensitiveLog:()=>fK,DecodeAuthorizationMessageCommand:()=>Ere,ExpiredTokenException:()=>yre,GetAccessKeyInfoCommand:()=>Pre,GetCallerIdentityCommand:()=>Mre,GetFederationTokenCommand:()=>Rre,GetFederationTokenResponseFilterSensitiveLog:()=>nKe,GetSessionTokenCommand:()=>Are,GetSessionTokenResponseFilterSensitiveLog:()=>oKe,IDPCommunicationErrorException:()=>Cre,IDPRejectedClaimException:()=>wre,InvalidAuthorizationMessageException:()=>xre,InvalidIdentityTokenException:()=>Sre,MalformedPolicyDocumentException:()=>bre,PackedPolicyTooLargeException:()=>_re,RegionDisabledException:()=>vre,STS:()=>Uve,STSClient:()=>yS,STSServiceException:()=>fb,__Client:()=>M4,decorateDefaultCredentialProvider:()=>JOn,getDefaultRoleAssumer:()=>P7t,getDefaultRoleAssumerWithWebIdentity:()=>M7t});var qKe=v(()=>{gre();y7t();b7t();_7t();R7t();Fve()});var I7t={};Jn(I7t,{AssumeRoleCommand:()=>s1,STSClient:()=>yS});var N7t=v(()=>{qKe()});var KOn,j7t=v(()=>{ZN();KOn=t=>{let e;return async()=>{t.logger?.debug("@aws-sdk/credential-providers - fromTemporaryCredentials (STS)");let r={...t.params,RoleSessionName:t.params.RoleSessionName??"aws-sdk-js-"+Date.now()};if(r?.SerialNumber){if(!t.mfaCodeProvider)throw new xm("Temporary credential requires multi-factor authentication, but no MFA code callback was provided.",{tryNextLink:!1,logger:t.logger});r.TokenCode=await t.mfaCodeProvider(r?.SerialNumber)}let{AssumeRoleCommand:n,STSClient:o}=await Promise.resolve().then(()=>(N7t(),I7t));if(e||(e=new o({...t.clientConfig,credentials:t.masterCredentials})),t.clientPlugins)for(let a of t.clientPlugins)e.middlewareStack.use(a);let{Credentials:i}=await e.send(new n(r));if(!i||!i.AccessKeyId||!i.SecretAccessKey)throw new xm(`Invalid response from STS.assumeRole call with role ${r.RoleArn}`,{logger:t.logger});return{accessKeyId:i.AccessKeyId,secretAccessKey:i.SecretAccessKey,sessionToken:i.SessionToken,expiration:i.Expiration,credentialScope:i.CredentialScope}}}});var D7t=v(()=>{});var $7t,L7t=v(()=>{$7t=t=>async()=>{t.logger?.debug("@aws-sdk/credential-provider-web-identity - fromWebToken");let{roleArn:e,roleSessionName:r,webIdentityToken:n,providerId:o,policyArns:i,policy:a,durationSeconds:s}=t,{roleAssumerWithWebIdentity:u}=t;if(!u){let{getDefaultRoleAssumerWithWebIdentity:l}=await Promise.resolve().then(()=>(qKe(),A7t));u=l({...t.clientConfig,credentialProviderLogger:t.logger,parentClientConfig:t.parentClientConfig},t.clientPlugins)}return u({RoleArn:e,RoleSessionName:r??`aws-sdk-js-session-${Date.now()}`,WebIdentityToken:n,ProviderId:o,PolicyArns:i,Policy:a,DurationSeconds:s})}});var F7t=v(()=>{D7t();L7t()});var WOn,k7t=v(()=>{F7t();WOn=t=>$7t({...t})});var q7t={};Jn(q7t,{fromCognitoIdentity:()=>qxn,fromCognitoIdentityPool:()=>Bxn,fromHttp:()=>V5e,fromTemporaryCredentials:()=>KOn,fromWebToken:()=>WOn});var B7t=v(()=>{IGt();NGt();YGt();j7t();k7t()});var BKe=S(Su=>{"use strict";Su.HttpAuthLocation=void 0;(function(t){t.HEADER="header",t.QUERY="query"})(Su.HttpAuthLocation||(Su.HttpAuthLocation={}));Su.HttpApiKeyAuthLocation=void 0;(function(t){t.HEADER="header",t.QUERY="query"})(Su.HttpApiKeyAuthLocation||(Su.HttpApiKeyAuthLocation={}));Su.EndpointURLScheme=void 0;(function(t){t.HTTP="http",t.HTTPS="https"})(Su.EndpointURLScheme||(Su.EndpointURLScheme={}));Su.AlgorithmId=void 0;(function(t){t.MD5="md5",t.CRC32="crc32",t.CRC32C="crc32c",t.SHA1="sha1",t.SHA256="sha256"})(Su.AlgorithmId||(Su.AlgorithmId={}));var GOn=t=>{let e=[];return t.sha256!==void 0&&e.push({algorithmId:()=>Su.AlgorithmId.SHA256,checksumConstructor:()=>t.sha256}),t.md5!=null&&e.push({algorithmId:()=>Su.AlgorithmId.MD5,checksumConstructor:()=>t.md5}),{addChecksumAlgorithm(r){e.push(r)},checksumAlgorithms(){return e}}},ZOn=t=>{let e={};return t.checksumAlgorithms().forEach(r=>{e[r.algorithmId()]=r.checksumConstructor()}),e},XOn=t=>GOn(t),YOn=t=>ZOn(t);Su.FieldPosition=void 0;(function(t){t[t.HEADER=0]="HEADER",t[t.TRAILER=1]="TRAILER"})(Su.FieldPosition||(Su.FieldPosition={}));var QOn="__smithy_context";Su.IniSectionType=void 0;(function(t){t.PROFILE="profile",t.SSO_SESSION="sso-session",t.SERVICES="services"})(Su.IniSectionType||(Su.IniSectionType={}));Su.RequestHandlerProtocol=void 0;(function(t){t.HTTP_0_9="http/0.9",t.HTTP_1_0="http/1.0",t.TDS_8_0="tds/8.0"})(Su.RequestHandlerProtocol||(Su.RequestHandlerProtocol={}));Su.SMITHY_CONTEXT_KEY=QOn;Su.getDefaultClientConfiguration=XOn;Su.resolveDefaultRuntimeConfig=YOn});var JKe=S(EF=>{"use strict";var eTn=BKe(),tTn=t=>({setHttpHandler(e){t.httpHandler=e},httpHandler(){return t.httpHandler},updateHttpClientConfig(e,r){t.httpHandler?.updateHttpClientConfig(e,r)},httpHandlerConfigs(){return t.httpHandler.httpHandlerConfigs()}}),rTn=t=>({httpHandler:t.httpHandler()}),UKe=class{constructor({name:e,kind:r=eTn.FieldPosition.HEADER,values:n=[]}){M(this,"name");M(this,"kind");M(this,"values");this.name=e,this.kind=r,this.values=n}add(e){this.values.push(e)}set(e){this.values=e}remove(e){this.values=this.values.filter(r=>r!==e)}toString(){return this.values.map(e=>e.includes(",")||e.includes(" ")?`"${e}"`:e).join(", ")}get(){return this.values}},zKe=class{constructor({fields:e=[],encoding:r="utf-8"}){M(this,"entries",{});M(this,"encoding");e.forEach(this.setField.bind(this)),this.encoding=r}setField(e){this.entries[e.name.toLowerCase()]=e}getField(e){return this.entries[e.toLowerCase()]}removeField(e){delete this.entries[e.toLowerCase()]}getByType(e){return Object.values(this.entries).filter(r=>r.kind===e)}},HKe=class t{constructor(e){M(this,"method");M(this,"protocol");M(this,"hostname");M(this,"port");M(this,"path");M(this,"query");M(this,"headers");M(this,"username");M(this,"password");M(this,"fragment");M(this,"body");this.method=e.method||"GET",this.hostname=e.hostname||"localhost",this.port=e.port,this.query=e.query||{},this.headers=e.headers||{},this.body=e.body,this.protocol=e.protocol?e.protocol.slice(-1)!==":"?`${e.protocol}:`:e.protocol:"https:",this.path=e.path?e.path.charAt(0)!=="/"?`/${e.path}`:e.path:"/",this.username=e.username,this.password=e.password,this.fragment=e.fragment}static clone(e){let r=new t({...e,headers:{...e.headers}});return r.query&&(r.query=nTn(r.query)),r}static isInstance(e){if(!e)return!1;let r=e;return"method"in r&&"protocol"in r&&"hostname"in r&&"path"in r&&typeof r.query=="object"&&typeof r.headers=="object"}clone(){return t.clone(this)}};function nTn(t){return Object.keys(t).reduce((e,r)=>{let n=t[r];return{...e,[r]:Array.isArray(n)?[...n]:n}},{})}var VKe=class{constructor(e){M(this,"statusCode");M(this,"reason");M(this,"headers");M(this,"body");this.statusCode=e.statusCode,this.reason=e.reason,this.headers=e.headers||{},this.body=e.body}static isInstance(e){if(!e)return!1;let r=e;return typeof r.statusCode=="number"&&typeof r.headers=="object"}};function oTn(t){return/^[a-z0-9][a-z0-9\.\-]*[a-z0-9]$/.test(t)}EF.Field=UKe;EF.Fields=zKe;EF.HttpRequest=HKe;EF.HttpResponse=VKe;EF.getHttpHandlerExtensionConfiguration=tTn;EF.isValidHostname=oTn;EF.resolveHttpHandlerRuntimeConfig=rTn});var z7t=S(WKe=>{"use strict";var U7t={},KKe={};for(let t=0;t<256;t++){let e=t.toString(16).toLowerCase();e.length===1&&(e=`0${e}`),U7t[t]=e,KKe[e]=t}function iTn(t){if(t.length%2!==0)throw new Error("Hex encoded strings must have an even number length");let e=new Uint8Array(t.length/2);for(let r=0;r{"use strict";var sTn=t=>typeof ArrayBuffer=="function"&&t instanceof ArrayBuffer||Object.prototype.toString.call(t)==="[object ArrayBuffer]";H7t.isArrayBuffer=sTn});var V7t=S(XKe=>{"use strict";var uTn=GKe(),ZKe=rS(),lTn=(t,e=0,r=t.byteLength-e)=>{if(!uTn.isArrayBuffer(t))throw new TypeError(`The "input" argument must be ArrayBuffer. Received type ${typeof t} (${t})`);return ZKe.Buffer.from(t,e,r)},cTn=(t,e)=>{if(typeof t!="string")throw new TypeError(`The "input" argument must be of type string. Received type ${typeof t} (${t})`);return e?ZKe.Buffer.from(t,e):ZKe.Buffer.from(t)};XKe.fromArrayBuffer=lTn;XKe.fromString=cTn});var W7t=S(zve=>{"use strict";var J7t=V7t(),K7t=t=>{let e=J7t.fromString(t,"utf8");return new Uint8Array(e.buffer,e.byteOffset,e.byteLength/Uint8Array.BYTES_PER_ELEMENT)},dTn=t=>typeof t=="string"?K7t(t):ArrayBuffer.isView(t)?new Uint8Array(t.buffer,t.byteOffset,t.byteLength/Uint8Array.BYTES_PER_ELEMENT):new Uint8Array(t),fTn=t=>{if(typeof t=="string")return t;if(typeof t!="object"||typeof t.byteOffset!="number"||typeof t.byteLength!="number")throw new Error("@smithy/util-utf8: toUtf8 encoder function only accepts string | Uint8Array.");return J7t.fromArrayBuffer(t.buffer,t.byteOffset,t.byteLength).toString("utf8")};zve.fromUtf8=K7t;zve.toUint8Array=dTn;zve.toUtf8=fTn});var Z7t=S(YKe=>{"use strict";var G7t=BKe(),pTn=t=>t[G7t.SMITHY_CONTEXT_KEY]||(t[G7t.SMITHY_CONTEXT_KEY]={}),mTn=t=>{if(typeof t=="function")return t;let e=Promise.resolve(t);return()=>e};YKe.getSmithyContext=pTn;YKe.normalizeProvider=mTn});var Y7t=S(QKe=>{"use strict";var X7t=t=>encodeURIComponent(t).replace(/[!'()*]/g,hTn),hTn=t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`,gTn=t=>t.split("/").map(X7t).join("/");QKe.escapeUri=X7t;QKe.escapeUriPath=gTn});var SZt=S(ti=>{"use strict";var PF=z7t(),k4=W7t(),yTn=GKe(),rZt=JKe(),Q7t=Z7t(),Hve=Y7t(),nZt="X-Amz-Algorithm",oZt="X-Amz-Credential",iWe="X-Amz-Date",iZt="X-Amz-SignedHeaders",aZt="X-Amz-Expires",aWe="X-Amz-Signature",sWe="X-Amz-Security-Token",bTn="X-Amz-Region-Set",uWe="authorization",lWe=iWe.toLowerCase(),sZt="date",uZt=[uWe,lWe,sZt],lZt=aWe.toLowerCase(),Gve="x-amz-content-sha256",cZt=sWe.toLowerCase(),_Tn="host",dZt={authorization:!0,"cache-control":!0,connection:!0,expect:!0,from:!0,"keep-alive":!0,"max-forwards":!0,pragma:!0,referer:!0,te:!0,trailer:!0,"transfer-encoding":!0,upgrade:!0,"user-agent":!0,"x-amzn-trace-id":!0},fZt=/^proxy-/,pZt=/^sec-/,vTn=[/^proxy-/i,/^sec-/i],Vve="AWS4-HMAC-SHA256",wTn="AWS4-ECDSA-P256-SHA256",mZt="AWS4-HMAC-SHA256-PAYLOAD",hZt="UNSIGNED-PAYLOAD",gZt=50,cWe="aws4_request",yZt=60*60*24*7,vK={},Jve=[],Kve=(t,e,r)=>`${t}/${e}/${r}/${cWe}`,bZt=async(t,e,r,n,o)=>{let i=await eZt(t,e.secretAccessKey,e.accessKeyId),a=`${r}:${n}:${o}:${PF.toHex(i)}:${e.sessionToken}`;if(a in vK)return vK[a];for(Jve.push(a);Jve.length>gZt;)delete vK[Jve.shift()];let s=`AWS4${e.secretAccessKey}`;for(let u of[r,n,o,cWe])s=await eZt(t,s,u);return vK[a]=s},STn=()=>{Jve.length=0,Object.keys(vK).forEach(t=>{delete vK[t]})},eZt=(t,e,r)=>{let n=new t(e);return n.update(k4.toUint8Array(r)),n.digest()},eWe=({headers:t},e,r)=>{let n={};for(let o of Object.keys(t).sort()){if(t[o]==null)continue;let i=o.toLowerCase();(i in dZt||e?.has(i)||fZt.test(i)||pZt.test(i))&&(!r||r&&!r.has(i))||(n[i]=t[o].trim().replace(/\s+/g," "))}return n},Wve=async({headers:t,body:e},r)=>{for(let n of Object.keys(t))if(n.toLowerCase()===Gve)return t[n];if(e==null)return"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855";if(typeof e=="string"||ArrayBuffer.isView(e)||yTn.isArrayBuffer(e)){let n=new r;return n.update(k4.toUint8Array(e)),PF.toHex(await n.digest())}return hZt},tWe=class{format(e){let r=[];for(let i of Object.keys(e)){let a=k4.fromUtf8(i);r.push(Uint8Array.from([a.byteLength]),a,this.formatHeaderValue(e[i]))}let n=new Uint8Array(r.reduce((i,a)=>i+a.byteLength,0)),o=0;for(let i of r)n.set(i,o),o+=i.byteLength;return n}formatHeaderValue(e){switch(e.type){case"boolean":return Uint8Array.from([e.value?0:1]);case"byte":return Uint8Array.from([2,e.value]);case"short":let r=new DataView(new ArrayBuffer(3));return r.setUint8(0,3),r.setInt16(1,e.value,!1),new Uint8Array(r.buffer);case"integer":let n=new DataView(new ArrayBuffer(5));return n.setUint8(0,4),n.setInt32(1,e.value,!1),new Uint8Array(n.buffer);case"long":let o=new Uint8Array(9);return o[0]=5,o.set(e.value.bytes,1),o;case"binary":let i=new DataView(new ArrayBuffer(3+e.value.byteLength));i.setUint8(0,6),i.setUint16(1,e.value.byteLength,!1);let a=new Uint8Array(i.buffer);return a.set(e.value,3),a;case"string":let s=k4.fromUtf8(e.value),u=new DataView(new ArrayBuffer(3+s.byteLength));u.setUint8(0,7),u.setUint16(1,s.byteLength,!1);let l=new Uint8Array(u.buffer);return l.set(s,3),l;case"timestamp":let c=new Uint8Array(9);return c[0]=8,c.set(rWe.fromNumber(e.value.valueOf()).bytes,1),c;case"uuid":if(!CTn.test(e.value))throw new Error(`Invalid UUID received: ${e.value}`);let d=new Uint8Array(17);return d[0]=9,d.set(PF.fromHex(e.value.replace(/\-/g,"")),1),d}}},CTn=/^[a-f0-9]{8}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{4}-[a-f0-9]{12}$/,rWe=class t{constructor(e){M(this,"bytes");if(this.bytes=e,e.byteLength!==8)throw new Error("Int64 buffers must be exactly 8 bytes")}static fromNumber(e){if(e>9223372036854776e3||e<-9223372036854776e3)throw new Error(`${e} is too large (or, if negative, too small) to represent as an Int64`);let r=new Uint8Array(8);for(let n=7,o=Math.abs(Math.round(e));n>-1&&o>0;n--,o/=256)r[n]=o;return e<0&&tZt(r),new t(r)}valueOf(){let e=this.bytes.slice(0),r=e[0]&128;return r&&tZt(e),parseInt(PF.toHex(e),16)*(r?-1:1)}toString(){return String(this.valueOf())}};function tZt(t){for(let e=0;e<8;e++)t[e]^=255;for(let e=7;e>-1&&(t[e]++,t[e]===0);e--);}var _Zt=(t,e)=>{t=t.toLowerCase();for(let r of Object.keys(e))if(t===r.toLowerCase())return!0;return!1},vZt=(t,e={})=>{let{headers:r,query:n={}}=rZt.HttpRequest.clone(t);for(let o of Object.keys(r)){let i=o.toLowerCase();(i.slice(0,6)==="x-amz-"&&!e.unhoistableHeaders?.has(i)||e.hoistableHeaders?.has(i))&&(n[o]=r[o],delete r[o])}return{...t,headers:r,query:n}},nWe=t=>{t=rZt.HttpRequest.clone(t);for(let e of Object.keys(t.headers))uZt.indexOf(e.toLowerCase())>-1&&delete t.headers[e];return t},wZt=({query:t={}})=>{let e=[],r={};for(let n of Object.keys(t)){if(n.toLowerCase()===lZt)continue;let o=Hve.escapeUri(n);e.push(o);let i=t[n];typeof i=="string"?r[o]=`${o}=${Hve.escapeUri(i)}`:Array.isArray(i)&&(r[o]=i.slice(0).reduce((a,s)=>a.concat([`${o}=${Hve.escapeUri(s)}`]),[]).sort().join("&"))}return e.sort().map(n=>r[n]).filter(n=>n).join("&")},xTn=t=>OTn(t).toISOString().replace(/\.\d{3}Z$/,"Z"),OTn=t=>typeof t=="number"?new Date(t*1e3):typeof t=="string"?Number(t)?new Date(Number(t)*1e3):new Date(t):t,Zve=class{constructor({applyChecksum:e,credentials:r,region:n,service:o,sha256:i,uriEscapePath:a=!0}){M(this,"service");M(this,"regionProvider");M(this,"credentialProvider");M(this,"sha256");M(this,"uriEscapePath");M(this,"applyChecksum");this.service=o,this.sha256=i,this.uriEscapePath=a,this.applyChecksum=typeof e=="boolean"?e:!0,this.regionProvider=Q7t.normalizeProvider(n),this.credentialProvider=Q7t.normalizeProvider(r)}createCanonicalRequest(e,r,n){let o=Object.keys(r).sort();return`${e.method} +${this.getCanonicalPath(e)} +${wZt(e)} +${o.map(i=>`${i}:${r[i]}`).join(` +`)} + +${o.join(";")} +${n}`}async createStringToSign(e,r,n,o){let i=new this.sha256;i.update(k4.toUint8Array(n));let a=await i.digest();return`${o} +${e} +${r} +${PF.toHex(a)}`}getCanonicalPath({path:e}){if(this.uriEscapePath){let r=[];for(let i of e.split("/"))i?.length!==0&&i!=="."&&(i===".."?r.pop():r.push(i));let n=`${e?.startsWith("/")?"/":""}${r.join("/")}${r.length>0&&e?.endsWith("/")?"/":""}`;return Hve.escapeUri(n).replace(/%2F/g,"/")}return e}validateResolvedCredentials(e){if(typeof e!="object"||typeof e.accessKeyId!="string"||typeof e.secretAccessKey!="string")throw new Error("Resolved credential object is not valid")}formatDate(e){let r=xTn(e).replace(/[\-:]/g,"");return{longDate:r,shortDate:r.slice(0,8)}}getCanonicalHeaderList(e){return Object.keys(e).sort().join(";")}},oWe=class extends Zve{constructor({applyChecksum:r,credentials:n,region:o,service:i,sha256:a,uriEscapePath:s=!0}){super({applyChecksum:r,credentials:n,region:o,service:i,sha256:a,uriEscapePath:s});M(this,"headerFormatter",new tWe)}async presign(r,n={}){let{signingDate:o=new Date,expiresIn:i=3600,unsignableHeaders:a,unhoistableHeaders:s,signableHeaders:u,hoistableHeaders:l,signingRegion:c,signingService:d}=n,f=await this.credentialProvider();this.validateResolvedCredentials(f);let p=c??await this.regionProvider(),{longDate:m,shortDate:h}=this.formatDate(o);if(i>yZt)return Promise.reject("Signature version 4 presigned URLs must have an expiration date less than one week in the future");let g=Kve(h,p,d??this.service),y=vZt(nWe(r),{unhoistableHeaders:s,hoistableHeaders:l});f.sessionToken&&(y.query[sWe]=f.sessionToken),y.query[nZt]=Vve,y.query[oZt]=`${f.accessKeyId}/${g}`,y.query[iWe]=m,y.query[aZt]=i.toString(10);let b=eWe(y,a,u);return y.query[iZt]=this.getCanonicalHeaderList(b),y.query[aWe]=await this.getSignature(m,g,this.getSigningKey(f,p,h,d),this.createCanonicalRequest(y,b,await Wve(r,this.sha256))),y}async sign(r,n){return typeof r=="string"?this.signString(r,n):r.headers&&r.payload?this.signEvent(r,n):r.message?this.signMessage(r,n):this.signRequest(r,n)}async signEvent({headers:r,payload:n},{signingDate:o=new Date,priorSignature:i,signingRegion:a,signingService:s}){let u=a??await this.regionProvider(),{shortDate:l,longDate:c}=this.formatDate(o),d=Kve(l,u,s??this.service),f=await Wve({headers:{},body:n},this.sha256),p=new this.sha256;p.update(r);let m=PF.toHex(await p.digest()),h=[mZt,c,d,i,m,f].join(` +`);return this.signString(h,{signingDate:o,signingRegion:u,signingService:s})}async signMessage(r,{signingDate:n=new Date,signingRegion:o,signingService:i}){return this.signEvent({headers:this.headerFormatter.format(r.message.headers),payload:r.message.body},{signingDate:n,signingRegion:o,signingService:i,priorSignature:r.priorSignature}).then(s=>({message:r.message,signature:s}))}async signString(r,{signingDate:n=new Date,signingRegion:o,signingService:i}={}){let a=await this.credentialProvider();this.validateResolvedCredentials(a);let s=o??await this.regionProvider(),{shortDate:u}=this.formatDate(n),l=new this.sha256(await this.getSigningKey(a,s,u,i));return l.update(k4.toUint8Array(r)),PF.toHex(await l.digest())}async signRequest(r,{signingDate:n=new Date,signableHeaders:o,unsignableHeaders:i,signingRegion:a,signingService:s}={}){let u=await this.credentialProvider();this.validateResolvedCredentials(u);let l=a??await this.regionProvider(),c=nWe(r),{longDate:d,shortDate:f}=this.formatDate(n),p=Kve(f,l,s??this.service);c.headers[lWe]=d,u.sessionToken&&(c.headers[cZt]=u.sessionToken);let m=await Wve(c,this.sha256);!_Zt(Gve,c.headers)&&this.applyChecksum&&(c.headers[Gve]=m);let h=eWe(c,i,o),g=await this.getSignature(d,p,this.getSigningKey(u,l,f,s),this.createCanonicalRequest(c,h,m));return c.headers[uWe]=`${Vve} Credential=${u.accessKeyId}/${p}, SignedHeaders=${this.getCanonicalHeaderList(h)}, Signature=${g}`,c}async getSignature(r,n,o,i){let a=await this.createStringToSign(r,n,i,Vve),s=new this.sha256(await o);return s.update(k4.toUint8Array(a)),PF.toHex(await s.digest())}getSigningKey(r,n,o,i){return bZt(this.sha256,r,o,n,i||this.service)}},TTn={SignatureV4a:null};ti.ALGORITHM_IDENTIFIER=Vve;ti.ALGORITHM_IDENTIFIER_V4A=wTn;ti.ALGORITHM_QUERY_PARAM=nZt;ti.ALWAYS_UNSIGNABLE_HEADERS=dZt;ti.AMZ_DATE_HEADER=lWe;ti.AMZ_DATE_QUERY_PARAM=iWe;ti.AUTH_HEADER=uWe;ti.CREDENTIAL_QUERY_PARAM=oZt;ti.DATE_HEADER=sZt;ti.EVENT_ALGORITHM_IDENTIFIER=mZt;ti.EXPIRES_QUERY_PARAM=aZt;ti.GENERATED_HEADERS=uZt;ti.HOST_HEADER=_Tn;ti.KEY_TYPE_IDENTIFIER=cWe;ti.MAX_CACHE_SIZE=gZt;ti.MAX_PRESIGNED_TTL=yZt;ti.PROXY_HEADER_PATTERN=fZt;ti.REGION_SET_PARAM=bTn;ti.SEC_HEADER_PATTERN=pZt;ti.SHA256_HEADER=Gve;ti.SIGNATURE_HEADER=lZt;ti.SIGNATURE_QUERY_PARAM=aWe;ti.SIGNED_HEADERS_QUERY_PARAM=iZt;ti.SignatureV4=oWe;ti.SignatureV4Base=Zve;ti.TOKEN_HEADER=cZt;ti.TOKEN_QUERY_PARAM=sWe;ti.UNSIGNABLE_PATTERNS=vTn;ti.UNSIGNED_PAYLOAD=hZt;ti.clearCredentialCache=STn;ti.createScope=Kve;ti.getCanonicalHeaders=eWe;ti.getCanonicalQuery=wZt;ti.getPayloadHash=Wve;ti.getSigningKey=bZt;ti.hasHeader=_Zt;ti.moveHeadersToQuery=vZt;ti.prepareRequest=nWe;ti.signatureV4aContainer=TTn});var sc=S((lsa,CZt)=>{"use strict";CZt.exports={ArrayIsArray(t){return Array.isArray(t)},ArrayPrototypeIncludes(t,e){return t.includes(e)},ArrayPrototypeIndexOf(t,e){return t.indexOf(e)},ArrayPrototypeJoin(t,e){return t.join(e)},ArrayPrototypeMap(t,e){return t.map(e)},ArrayPrototypePop(t,e){return t.pop(e)},ArrayPrototypePush(t,e){return t.push(e)},ArrayPrototypeSlice(t,e,r){return t.slice(e,r)},Error,FunctionPrototypeCall(t,e,...r){return t.call(e,...r)},FunctionPrototypeSymbolHasInstance(t,e){return Function.prototype[Symbol.hasInstance].call(t,e)},MathFloor:Math.floor,Number,NumberIsInteger:Number.isInteger,NumberIsNaN:Number.isNaN,NumberMAX_SAFE_INTEGER:Number.MAX_SAFE_INTEGER,NumberMIN_SAFE_INTEGER:Number.MIN_SAFE_INTEGER,NumberParseInt:Number.parseInt,ObjectDefineProperties(t,e){return Object.defineProperties(t,e)},ObjectDefineProperty(t,e,r){return Object.defineProperty(t,e,r)},ObjectGetOwnPropertyDescriptor(t,e){return Object.getOwnPropertyDescriptor(t,e)},ObjectKeys(t){return Object.keys(t)},ObjectSetPrototypeOf(t,e){return Object.setPrototypeOf(t,e)},Promise,PromisePrototypeCatch(t,e){return t.catch(e)},PromisePrototypeThen(t,e,r){return t.then(e,r)},PromiseReject(t){return Promise.reject(t)},PromiseResolve(t){return Promise.resolve(t)},ReflectApply:Reflect.apply,RegExpPrototypeTest(t,e){return t.test(e)},SafeSet:Set,String,StringPrototypeSlice(t,e,r){return t.slice(e,r)},StringPrototypeToLowerCase(t){return t.toLowerCase()},StringPrototypeToUpperCase(t){return t.toUpperCase()},StringPrototypeTrim(t){return t.trim()},Symbol,SymbolFor:Symbol.for,SymbolAsyncIterator:Symbol.asyncIterator,SymbolHasInstance:Symbol.hasInstance,SymbolIterator:Symbol.iterator,SymbolDispose:Symbol.dispose||Symbol("Symbol.dispose"),SymbolAsyncDispose:Symbol.asyncDispose||Symbol("Symbol.asyncDispose"),TypedArrayPrototypeSet(t,e,r){return t.set(e,r)},Boolean,Uint8Array}});var wK=S((csa,Xve)=>{"use strict";var{AbortController:xZt,AbortSignal:ETn}=typeof self<"u"?self:typeof window<"u"?window:void 0;Xve.exports=xZt;Xve.exports.AbortSignal=ETn;Xve.exports.default=xZt});var Ire=S((dsa,dWe)=>{"use strict";var SK=typeof Reflect=="object"?Reflect:null,OZt=SK&&typeof SK.apply=="function"?SK.apply:function(e,r,n){return Function.prototype.apply.call(e,r,n)},Yve;SK&&typeof SK.ownKeys=="function"?Yve=SK.ownKeys:Object.getOwnPropertySymbols?Yve=function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:Yve=function(e){return Object.getOwnPropertyNames(e)};function PTn(t){console&&console.warn&&console.warn(t)}var EZt=Number.isNaN||function(e){return e!==e};function uu(){uu.init.call(this)}dWe.exports=uu;dWe.exports.once=ITn;uu.EventEmitter=uu;uu.prototype._events=void 0;uu.prototype._eventsCount=0;uu.prototype._maxListeners=void 0;var TZt=10;function Qve(t){if(typeof t!="function")throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}Object.defineProperty(uu,"defaultMaxListeners",{enumerable:!0,get:function(){return TZt},set:function(t){if(typeof t!="number"||t<0||EZt(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");TZt=t}});uu.init=function(){(this._events===void 0||this._events===Object.getPrototypeOf(this)._events)&&(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0};uu.prototype.setMaxListeners=function(e){if(typeof e!="number"||e<0||EZt(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this};function PZt(t){return t._maxListeners===void 0?uu.defaultMaxListeners:t._maxListeners}uu.prototype.getMaxListeners=function(){return PZt(this)};uu.prototype.emit=function(e){for(var r=[],n=1;n0&&(a=r[0]),a instanceof Error)throw a;var s=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw s.context=a,s}var u=i[e];if(u===void 0)return!1;if(typeof u=="function")OZt(u,this,r);else for(var l=u.length,c=NZt(u,l),n=0;n0&&a.length>o&&!a.warned){a.warned=!0;var s=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");s.name="MaxListenersExceededWarning",s.emitter=t,s.type=e,s.count=a.length,PTn(s)}return t}uu.prototype.addListener=function(e,r){return MZt(this,e,r,!1)};uu.prototype.on=uu.prototype.addListener;uu.prototype.prependListener=function(e,r){return MZt(this,e,r,!0)};function MTn(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,arguments.length===0?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function RZt(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=MTn.bind(n);return o.listener=r,n.wrapFn=o,o}uu.prototype.once=function(e,r){return Qve(r),this.on(e,RZt(this,e,r)),this};uu.prototype.prependOnceListener=function(e,r){return Qve(r),this.prependListener(e,RZt(this,e,r)),this};uu.prototype.removeListener=function(e,r){var n,o,i,a,s;if(Qve(r),o=this._events,o===void 0)return this;if(n=o[e],n===void 0)return this;if(n===r||n.listener===r)--this._eventsCount===0?this._events=Object.create(null):(delete o[e],o.removeListener&&this.emit("removeListener",e,n.listener||r));else if(typeof n!="function"){for(i=-1,a=n.length-1;a>=0;a--)if(n[a]===r||n[a].listener===r){s=n[a].listener,i=a;break}if(i<0)return this;i===0?n.shift():RTn(n,i),n.length===1&&(o[e]=n[0]),o.removeListener!==void 0&&this.emit("removeListener",e,s||r)}return this};uu.prototype.off=uu.prototype.removeListener;uu.prototype.removeAllListeners=function(e){var r,n,o;if(n=this._events,n===void 0)return this;if(n.removeListener===void 0)return arguments.length===0?(this._events=Object.create(null),this._eventsCount=0):n[e]!==void 0&&(--this._eventsCount===0?this._events=Object.create(null):delete n[e]),this;if(arguments.length===0){var i=Object.keys(n),a;for(o=0;o=0;o--)this.removeListener(e,r[o]);return this};function AZt(t,e,r){var n=t._events;if(n===void 0)return[];var o=n[e];return o===void 0?[]:typeof o=="function"?r?[o.listener||o]:[o]:r?ATn(o):NZt(o,o.length)}uu.prototype.listeners=function(e){return AZt(this,e,!0)};uu.prototype.rawListeners=function(e){return AZt(this,e,!1)};uu.listenerCount=function(t,e){return typeof t.listenerCount=="function"?t.listenerCount(e):IZt.call(t,e)};uu.prototype.listenerCount=IZt;function IZt(t){var e=this._events;if(e!==void 0){var r=e[t];if(typeof r=="function")return 1;if(r!==void 0)return r.length}return 0}uu.prototype.eventNames=function(){return this._eventsCount>0?Yve(this._events):[]};function NZt(t,e){for(var r=new Array(e),n=0;n{"use strict";var jTn=rS(),{kResistStopPropagation:DTn,SymbolDispose:$Tn}=sc(),LTn=globalThis.AbortSignal||wK().AbortSignal,FTn=globalThis.AbortController||wK().AbortController,kTn=Object.getPrototypeOf(async function(){}).constructor,DZt=globalThis.Blob||jTn.Blob,qTn=typeof DZt<"u"?function(e){return e instanceof DZt}:function(e){return!1},$Zt=(t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new ERR_INVALID_ARG_TYPE(e,"AbortSignal",t)},BTn=(t,e)=>{if(typeof t!="function")throw new ERR_INVALID_ARG_TYPE(e,"Function",t)},fWe=class extends Error{constructor(e){if(!Array.isArray(e))throw new TypeError(`Expected input to be an Array, got ${typeof e}`);let r="";for(let n=0;n{t=n,e=o}),resolve:t,reject:e}},promisify(t){return new Promise((e,r)=>{t((n,...o)=>n?r(n):e(...o))})},debuglog(){return function(){}},format(t,...e){return t.replace(/%([sdifj])/g,function(...[r,n]){let o=e.shift();return n==="f"?o.toFixed(6):n==="j"?JSON.stringify(o):n==="s"&&typeof o=="object"?`${o.constructor!==Object?o.constructor.name:""} {}`.trim():o.toString()})},inspect(t){switch(typeof t){case"string":if(t.includes("'"))if(t.includes('"')){if(!t.includes("`")&&!t.includes("${"))return`\`${t}\``}else return`"${t}"`;return`'${t}'`;case"number":return isNaN(t)?"NaN":Object.is(t,-0)?String(t):t;case"bigint":return`${String(t)}n`;case"boolean":case"undefined":return String(t);case"object":return"{}"}},types:{isAsyncFunction(t){return t instanceof kTn},isArrayBufferView(t){return ArrayBuffer.isView(t)}},isBlob:qTn,deprecate(t,e){return t},addAbortListener:Ire().addAbortListener||function(e,r){if(e===void 0)throw new ERR_INVALID_ARG_TYPE("signal","AbortSignal",e);$Zt(e,"signal"),BTn(r,"listener");let n;return e.aborted?queueMicrotask(()=>r()):(e.addEventListener("abort",r,{__proto__:null,once:!0,[DTn]:!0}),n=()=>{e.removeEventListener("abort",r)}),{__proto__:null,[$Tn](){var o;(o=n)===null||o===void 0||o()}}},AbortSignalAny:LTn.any||function(e){if(e.length===1)return e[0];let r=new FTn,n=()=>r.abort();return e.forEach(o=>{$Zt(o,"signals"),o.addEventListener("abort",n,{once:!0})}),r.signal.addEventListener("abort",()=>{e.forEach(o=>o.removeEventListener("abort",n))},{once:!0}),r.signal}};pWe.exports.promisify.custom=Symbol.for("nodejs.util.promisify.custom")});var hb=S((psa,kZt)=>{"use strict";var{format:UTn,inspect:ewe,AggregateError:zTn}=by(),HTn=globalThis.AggregateError||zTn,VTn=Symbol("kIsNodeError"),JTn=["string","function","number","object","Function","Object","boolean","bigint","symbol"],KTn=/^([A-Z][a-z0-9]*)+$/,WTn="__node_internal_",twe={};function q4(t,e){if(!t)throw new twe.ERR_INTERNAL_ASSERTION(e)}function LZt(t){let e="",r=t.length,n=t[0]==="-"?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function GTn(t,e,r){if(typeof e=="function")return q4(e.length<=r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${e.length}).`),e(...r);let n=(e.match(/%[dfijoOs]/g)||[]).length;return q4(n===r.length,`Code: ${t}; The provided arguments length (${r.length}) does not match the required ones (${n}).`),r.length===0?e:UTn(e,...r)}function lg(t,e,r){r||(r=Error);class n extends r{constructor(...i){super(GTn(t,e,i))}toString(){return`${this.name} [${t}]: ${this.message}`}}Object.defineProperties(n.prototype,{name:{value:r.name,writable:!0,enumerable:!1,configurable:!0},toString:{value(){return`${this.name} [${t}]: ${this.message}`},writable:!0,enumerable:!1,configurable:!0}}),n.prototype.code=t,n.prototype[VTn]=!0,twe[t]=n}function FZt(t){let e=WTn+t.name;return Object.defineProperty(t,"name",{value:e}),t}function ZTn(t,e){if(t&&e&&t!==e){if(Array.isArray(e.errors))return e.errors.push(t),e;let r=new HTn([e,t],e.message);return r.code=e.code,r}return t||e}var mWe=class extends Error{constructor(e="The operation was aborted",r=void 0){if(r!==void 0&&typeof r!="object")throw new twe.ERR_INVALID_ARG_TYPE("options","Object",r);super(e,r),this.code="ABORT_ERR",this.name="AbortError"}};lg("ERR_ASSERTION","%s",Error);lg("ERR_INVALID_ARG_TYPE",(t,e,r)=>{q4(typeof t=="string","'name' must be a string"),Array.isArray(e)||(e=[e]);let n="The ";t.endsWith(" argument")?n+=`${t} `:n+=`"${t}" ${t.includes(".")?"property":"argument"} `,n+="must be ";let o=[],i=[],a=[];for(let u of e)q4(typeof u=="string","All expected entries have to be of type string"),JTn.includes(u)?o.push(u.toLowerCase()):KTn.test(u)?i.push(u):(q4(u!=="object",'The value "object" should be written as "Object"'),a.push(u));if(i.length>0){let u=o.indexOf("object");u!==-1&&(o.splice(o,u,1),i.push("Object"))}if(o.length>0){switch(o.length){case 1:n+=`of type ${o[0]}`;break;case 2:n+=`one of type ${o[0]} or ${o[1]}`;break;default:{let u=o.pop();n+=`one of type ${o.join(", ")}, or ${u}`}}(i.length>0||a.length>0)&&(n+=" or ")}if(i.length>0){switch(i.length){case 1:n+=`an instance of ${i[0]}`;break;case 2:n+=`an instance of ${i[0]} or ${i[1]}`;break;default:{let u=i.pop();n+=`an instance of ${i.join(", ")}, or ${u}`}}a.length>0&&(n+=" or ")}switch(a.length){case 0:break;case 1:a[0].toLowerCase()!==a[0]&&(n+="an "),n+=`${a[0]}`;break;case 2:n+=`one of ${a[0]} or ${a[1]}`;break;default:{let u=a.pop();n+=`one of ${a.join(", ")}, or ${u}`}}if(r==null)n+=`. Received ${r}`;else if(typeof r=="function"&&r.name)n+=`. Received function ${r.name}`;else if(typeof r=="object"){var s;if((s=r.constructor)!==null&&s!==void 0&&s.name)n+=`. Received an instance of ${r.constructor.name}`;else{let u=ewe(r,{depth:-1});n+=`. Received ${u}`}}else{let u=ewe(r,{colors:!1});u.length>25&&(u=`${u.slice(0,25)}...`),n+=`. Received type ${typeof r} (${u})`}return n},TypeError);lg("ERR_INVALID_ARG_VALUE",(t,e,r="is invalid")=>{let n=ewe(e);return n.length>128&&(n=n.slice(0,128)+"..."),`The ${t.includes(".")?"property":"argument"} '${t}' ${r}. Received ${n}`},TypeError);lg("ERR_INVALID_RETURN_VALUE",(t,e,r)=>{var n;let o=r!=null&&(n=r.constructor)!==null&&n!==void 0&&n.name?`instance of ${r.constructor.name}`:`type ${typeof r}`;return`Expected ${t} to be returned from the "${e}" function but got ${o}.`},TypeError);lg("ERR_MISSING_ARGS",(...t)=>{q4(t.length>0,"At least one arg needs to be specified");let e,r=t.length;switch(t=(Array.isArray(t)?t:[t]).map(n=>`"${n}"`).join(" or "),r){case 1:e+=`The ${t[0]} argument`;break;case 2:e+=`The ${t[0]} and ${t[1]} arguments`;break;default:{let n=t.pop();e+=`The ${t.join(", ")}, and ${n} arguments`}break}return`${e} must be specified`},TypeError);lg("ERR_OUT_OF_RANGE",(t,e,r)=>{q4(e,'Missing "range" argument');let n;return Number.isInteger(r)&&Math.abs(r)>2**32?n=LZt(String(r)):typeof r=="bigint"?(n=String(r),(r>2n**32n||r<-(2n**32n))&&(n=LZt(n)),n+="n"):n=ewe(r),`The value of "${t}" is out of range. It must be ${e}. Received ${n}`},RangeError);lg("ERR_MULTIPLE_CALLBACK","Callback called multiple times",Error);lg("ERR_METHOD_NOT_IMPLEMENTED","The %s method is not implemented",Error);lg("ERR_STREAM_ALREADY_FINISHED","Cannot call %s after a stream was finished",Error);lg("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable",Error);lg("ERR_STREAM_DESTROYED","Cannot call %s after a stream was destroyed",Error);lg("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError);lg("ERR_STREAM_PREMATURE_CLOSE","Premature close",Error);lg("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF",Error);lg("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event",Error);lg("ERR_STREAM_WRITE_AFTER_END","write after end",Error);lg("ERR_UNKNOWN_ENCODING","Unknown encoding: %s",TypeError);kZt.exports={AbortError:mWe,aggregateTwoErrors:FZt(ZTn),hideStackFrames:FZt,codes:twe}});var xK=S((msa,GZt)=>{"use strict";var{ArrayIsArray:gWe,ArrayPrototypeIncludes:zZt,ArrayPrototypeJoin:HZt,ArrayPrototypeMap:XTn,NumberIsInteger:yWe,NumberIsNaN:YTn,NumberMAX_SAFE_INTEGER:QTn,NumberMIN_SAFE_INTEGER:eEn,NumberParseInt:tEn,ObjectPrototypeHasOwnProperty:rEn,RegExpPrototypeExec:VZt,String:nEn,StringPrototypeToUpperCase:oEn,StringPrototypeTrim:iEn}=sc(),{hideStackFrames:SS,codes:{ERR_SOCKET_BAD_PORT:aEn,ERR_INVALID_ARG_TYPE:_y,ERR_INVALID_ARG_VALUE:CK,ERR_OUT_OF_RANGE:B4,ERR_UNKNOWN_SIGNAL:qZt}}=hb(),{normalizeEncoding:sEn}=by(),{isAsyncFunction:uEn,isArrayBufferView:lEn}=by().types,BZt={};function cEn(t){return t===(t|0)}function dEn(t){return t===t>>>0}var fEn=/^[0-7]+$/,pEn="must be a 32-bit unsigned integer or an octal string";function mEn(t,e,r){if(typeof t>"u"&&(t=r),typeof t=="string"){if(VZt(fEn,t)===null)throw new CK(e,t,pEn);t=tEn(t,8)}return JZt(t,e),t}var hEn=SS((t,e,r=eEn,n=QTn)=>{if(typeof t!="number")throw new _y(e,"number",t);if(!yWe(t))throw new B4(e,"an integer",t);if(tn)throw new B4(e,`>= ${r} && <= ${n}`,t)}),gEn=SS((t,e,r=-2147483648,n=2147483647)=>{if(typeof t!="number")throw new _y(e,"number",t);if(!yWe(t))throw new B4(e,"an integer",t);if(tn)throw new B4(e,`>= ${r} && <= ${n}`,t)}),JZt=SS((t,e,r=!1)=>{if(typeof t!="number")throw new _y(e,"number",t);if(!yWe(t))throw new B4(e,"an integer",t);let n=r?1:0,o=4294967295;if(to)throw new B4(e,`>= ${n} && <= ${o}`,t)});function bWe(t,e){if(typeof t!="string")throw new _y(e,"string",t)}function yEn(t,e,r=void 0,n){if(typeof t!="number")throw new _y(e,"number",t);if(r!=null&&tn||(r!=null||n!=null)&&YTn(t))throw new B4(e,`${r!=null?`>= ${r}`:""}${r!=null&&n!=null?" && ":""}${n!=null?`<= ${n}`:""}`,t)}var bEn=SS((t,e,r)=>{if(!zZt(r,t)){let o="must be one of: "+HZt(XTn(r,i=>typeof i=="string"?`'${i}'`:nEn(i)),", ");throw new CK(e,t,o)}});function KZt(t,e){if(typeof t!="boolean")throw new _y(e,"boolean",t)}function hWe(t,e,r){return t==null||!rEn(t,e)?r:t[e]}var _En=SS((t,e,r=null)=>{let n=hWe(r,"allowArray",!1),o=hWe(r,"allowFunction",!1);if(!hWe(r,"nullable",!1)&&t===null||!n&&gWe(t)||typeof t!="object"&&(!o||typeof t!="function"))throw new _y(e,"Object",t)}),vEn=SS((t,e)=>{if(t!=null&&typeof t!="object"&&typeof t!="function")throw new _y(e,"a dictionary",t)}),rwe=SS((t,e,r=0)=>{if(!gWe(t))throw new _y(e,"Array",t);if(t.length{if(!lEn(t))throw new _y(e,["Buffer","TypedArray","DataView"],t)});function TEn(t,e){let r=sEn(e),n=t.length;if(r==="hex"&&n%2!==0)throw new CK("encoding",e,`is invalid for data of length ${n}`)}function EEn(t,e="Port",r=!0){if(typeof t!="number"&&typeof t!="string"||typeof t=="string"&&iEn(t).length===0||+t!==+t>>>0||t>65535||t===0&&!r)throw new aEn(e,t,r);return t|0}var WZt=SS((t,e)=>{if(t!==void 0&&(t===null||typeof t!="object"||!("aborted"in t)))throw new _y(e,"AbortSignal",t)}),PEn=SS((t,e)=>{if(typeof t!="function")throw new _y(e,"Function",t)}),MEn=SS((t,e)=>{if(typeof t!="function"||uEn(t))throw new _y(e,"Function",t)}),REn=SS((t,e)=>{if(t!==void 0)throw new _y(e,"undefined",t)});function AEn(t,e,r){if(!zZt(r,t))throw new _y(e,`('${HZt(r,"|")}')`,t)}var IEn=/^(?:<[^>]*>)(?:\s*;\s*[^;"\s]+(?:=(")?[^;"\s]*\1)?)*$/;function UZt(t,e){if(typeof t>"u"||!VZt(IEn,t))throw new CK(e,t,'must be an array or string of format "; rel=preload; as=style"')}function NEn(t){if(typeof t=="string")return UZt(t,"hints"),t;if(gWe(t)){let e=t.length,r="";if(e===0)return r;for(let n=0;n; rel=preload; as=style"')}GZt.exports={isInt32:cEn,isUint32:dEn,parseFileMode:mEn,validateArray:rwe,validateStringArray:wEn,validateBooleanArray:SEn,validateAbortSignalArray:CEn,validateBoolean:KZt,validateBuffer:OEn,validateDictionary:vEn,validateEncoding:TEn,validateFunction:PEn,validateInt32:gEn,validateInteger:hEn,validateNumber:yEn,validateObject:_En,validateOneOf:bEn,validatePlainFunction:MEn,validatePort:EEn,validateSignalName:xEn,validateString:bWe,validateUint32:JZt,validateUndefined:REn,validateUnion:AEn,validateAbortSignal:WZt,validateLinkHeaderValue:NEn}});var MF=S((hsa,QZt)=>{var Gc=QZt.exports={},cT,dT;function _We(){throw new Error("setTimeout has not been defined")}function vWe(){throw new Error("clearTimeout has not been defined")}(function(){try{typeof setTimeout=="function"?cT=setTimeout:cT=_We}catch{cT=_We}try{typeof clearTimeout=="function"?dT=clearTimeout:dT=vWe}catch{dT=vWe}})();function ZZt(t){if(cT===setTimeout)return setTimeout(t,0);if((cT===_We||!cT)&&setTimeout)return cT=setTimeout,setTimeout(t,0);try{return cT(t,0)}catch{try{return cT.call(null,t,0)}catch{return cT.call(this,t,0)}}}function jEn(t){if(dT===clearTimeout)return clearTimeout(t);if((dT===vWe||!dT)&&clearTimeout)return dT=clearTimeout,clearTimeout(t);try{return dT(t)}catch{try{return dT.call(null,t)}catch{return dT.call(this,t)}}}var u1=[],OK=!1,U4,nwe=-1;function DEn(){!OK||!U4||(OK=!1,U4.length?u1=U4.concat(u1):nwe=-1,u1.length&&XZt())}function XZt(){if(!OK){var t=ZZt(DEn);OK=!0;for(var e=u1.length;e;){for(U4=u1,u1=[];++nwe1)for(var r=1;r{"use strict";var{SymbolAsyncIterator:eXt,SymbolIterator:tXt,SymbolFor:z4}=sc(),rXt=z4("nodejs.stream.destroyed"),nXt=z4("nodejs.stream.errored"),wWe=z4("nodejs.stream.readable"),SWe=z4("nodejs.stream.writable"),oXt=z4("nodejs.stream.disturbed"),$En=z4("nodejs.webstream.isClosedPromise"),LEn=z4("nodejs.webstream.controllerErrorFunction");function owe(t,e=!1){var r;return!!(t&&typeof t.pipe=="function"&&typeof t.on=="function"&&(!e||typeof t.pause=="function"&&typeof t.resume=="function")&&(!t._writableState||((r=t._readableState)===null||r===void 0?void 0:r.readable)!==!1)&&(!t._writableState||t._readableState))}function iwe(t){var e;return!!(t&&typeof t.write=="function"&&typeof t.on=="function"&&(!t._readableState||((e=t._writableState)===null||e===void 0?void 0:e.writable)!==!1))}function FEn(t){return!!(t&&typeof t.pipe=="function"&&t._readableState&&typeof t.on=="function"&&typeof t.write=="function")}function fT(t){return t&&(t._readableState||t._writableState||typeof t.write=="function"&&typeof t.on=="function"||typeof t.pipe=="function"&&typeof t.on=="function")}function iXt(t){return!!(t&&!fT(t)&&typeof t.pipeThrough=="function"&&typeof t.getReader=="function"&&typeof t.cancel=="function")}function aXt(t){return!!(t&&!fT(t)&&typeof t.getWriter=="function"&&typeof t.abort=="function")}function sXt(t){return!!(t&&!fT(t)&&typeof t.readable=="object"&&typeof t.writable=="object")}function kEn(t){return iXt(t)||aXt(t)||sXt(t)}function qEn(t,e){return t==null?!1:e===!0?typeof t[eXt]=="function":e===!1?typeof t[tXt]=="function":typeof t[eXt]=="function"||typeof t[tXt]=="function"}function awe(t){if(!fT(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!!(t.destroyed||t[rXt]||n!=null&&n.destroyed)}function uXt(t){if(!iwe(t))return null;if(t.writableEnded===!0)return!0;let e=t._writableState;return e!=null&&e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function BEn(t,e){if(!iwe(t))return null;if(t.writableFinished===!0)return!0;let r=t._writableState;return r!=null&&r.errored?!1:typeof r?.finished!="boolean"?null:!!(r.finished||e===!1&&r.ended===!0&&r.length===0)}function UEn(t){if(!owe(t))return null;if(t.readableEnded===!0)return!0;let e=t._readableState;return!e||e.errored?!1:typeof e?.ended!="boolean"?null:e.ended}function lXt(t,e){if(!owe(t))return null;let r=t._readableState;return r!=null&&r.errored?!1:typeof r?.endEmitted!="boolean"?null:!!(r.endEmitted||e===!1&&r.ended===!0&&r.length===0)}function cXt(t){return t&&t[wWe]!=null?t[wWe]:typeof t?.readable!="boolean"?null:awe(t)?!1:owe(t)&&t.readable&&!lXt(t)}function dXt(t){return t&&t[SWe]!=null?t[SWe]:typeof t?.writable!="boolean"?null:awe(t)?!1:iwe(t)&&t.writable&&!uXt(t)}function zEn(t,e){return fT(t)?awe(t)?!0:!(e?.readable!==!1&&cXt(t)||e?.writable!==!1&&dXt(t)):null}function HEn(t){var e,r;return fT(t)?t.writableErrored?t.writableErrored:(e=(r=t._writableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function VEn(t){var e,r;return fT(t)?t.readableErrored?t.readableErrored:(e=(r=t._readableState)===null||r===void 0?void 0:r.errored)!==null&&e!==void 0?e:null:null}function JEn(t){if(!fT(t))return null;if(typeof t.closed=="boolean")return t.closed;let e=t._writableState,r=t._readableState;return typeof e?.closed=="boolean"||typeof r?.closed=="boolean"?e?.closed||r?.closed:typeof t._closed=="boolean"&&fXt(t)?t._closed:null}function fXt(t){return typeof t._closed=="boolean"&&typeof t._defaultKeepAlive=="boolean"&&typeof t._removedConnection=="boolean"&&typeof t._removedContLen=="boolean"}function pXt(t){return typeof t._sent100=="boolean"&&fXt(t)}function KEn(t){var e;return typeof t._consuming=="boolean"&&typeof t._dumped=="boolean"&&((e=t.req)===null||e===void 0?void 0:e.upgradeOrConnect)===void 0}function WEn(t){if(!fT(t))return null;let e=t._writableState,r=t._readableState,n=e||r;return!n&&pXt(t)||!!(n&&n.autoDestroy&&n.emitClose&&n.closed===!1)}function GEn(t){var e;return!!(t&&((e=t[oXt])!==null&&e!==void 0?e:t.readableDidRead||t.readableAborted))}function ZEn(t){var e,r,n,o,i,a,s,u,l,c;return!!(t&&((e=(r=(n=(o=(i=(a=t[nXt])!==null&&a!==void 0?a:t.readableErrored)!==null&&i!==void 0?i:t.writableErrored)!==null&&o!==void 0?o:(s=t._readableState)===null||s===void 0?void 0:s.errorEmitted)!==null&&n!==void 0?n:(u=t._writableState)===null||u===void 0?void 0:u.errorEmitted)!==null&&r!==void 0?r:(l=t._readableState)===null||l===void 0?void 0:l.errored)!==null&&e!==void 0?e:!((c=t._writableState)===null||c===void 0)&&c.errored))}mXt.exports={isDestroyed:awe,kIsDestroyed:rXt,isDisturbed:GEn,kIsDisturbed:oXt,isErrored:ZEn,kIsErrored:nXt,isReadable:cXt,kIsReadable:wWe,kIsClosedPromise:$En,kControllerErrorFunction:LEn,kIsWritable:SWe,isClosed:JEn,isDuplexNodeStream:FEn,isFinished:zEn,isIterable:qEn,isReadableNodeStream:owe,isReadableStream:iXt,isReadableEnded:UEn,isReadableFinished:lXt,isReadableErrored:VEn,isNodeStream:fT,isWebStream:kEn,isWritable:dXt,isWritableNodeStream:iwe,isWritableStream:aXt,isWritableEnded:uXt,isWritableFinished:BEn,isWritableErrored:HEn,isServerRequest:KEn,isServerResponse:pXt,willEmitClose:WEn,isTransformStream:sXt}});var c1=S((ysa,EWe)=>{var RF=MF(),{AbortError:CXt,codes:XEn}=hb(),{ERR_INVALID_ARG_TYPE:YEn,ERR_STREAM_PREMATURE_CLOSE:hXt}=XEn,{kEmptyObject:xWe,once:OWe}=by(),{validateAbortSignal:QEn,validateFunction:ePn,validateObject:tPn,validateBoolean:rPn}=xK(),{Promise:nPn,PromisePrototypeThen:oPn,SymbolDispose:xXt}=sc(),{isClosed:iPn,isReadable:gXt,isReadableNodeStream:CWe,isReadableStream:aPn,isReadableFinished:yXt,isReadableErrored:bXt,isWritable:_Xt,isWritableNodeStream:vXt,isWritableStream:sPn,isWritableFinished:wXt,isWritableErrored:SXt,isNodeStream:uPn,willEmitClose:lPn,kIsClosedPromise:cPn}=pT(),TK;function dPn(t){return t.setHeader&&typeof t.abort=="function"}var TWe=()=>{};function OXt(t,e,r){var n,o;if(arguments.length===2?(r=e,e=xWe):e==null?e=xWe:tPn(e,"options"),ePn(r,"callback"),QEn(e.signal,"options.signal"),r=OWe(r),aPn(t)||sPn(t))return fPn(t,e,r);if(!uPn(t))throw new YEn("stream",["ReadableStream","WritableStream","Stream"],t);let i=(n=e.readable)!==null&&n!==void 0?n:CWe(t),a=(o=e.writable)!==null&&o!==void 0?o:vXt(t),s=t._writableState,u=t._readableState,l=()=>{t.writable||f()},c=lPn(t)&&CWe(t)===i&&vXt(t)===a,d=wXt(t,!1),f=()=>{d=!0,t.destroyed&&(c=!1),!(c&&(!t.readable||i))&&(!i||p)&&r.call(t)},p=yXt(t,!1),m=()=>{p=!0,t.destroyed&&(c=!1),!(c&&(!t.writable||a))&&(!a||d)&&r.call(t)},h=x=>{r.call(t,x)},g=iPn(t),y=()=>{g=!0;let x=SXt(t)||bXt(t);if(x&&typeof x!="boolean")return r.call(t,x);if(i&&!p&&CWe(t,!0)&&!yXt(t,!1))return r.call(t,new hXt);if(a&&!d&&!wXt(t,!1))return r.call(t,new hXt);r.call(t)},b=()=>{g=!0;let x=SXt(t)||bXt(t);if(x&&typeof x!="boolean")return r.call(t,x);r.call(t)},_=()=>{t.req.on("finish",f)};dPn(t)?(t.on("complete",f),c||t.on("abort",y),t.req?_():t.on("request",_)):a&&!s&&(t.on("end",l),t.on("close",l)),!c&&typeof t.aborted=="boolean"&&t.on("aborted",y),t.on("end",m),t.on("finish",f),e.error!==!1&&t.on("error",h),t.on("close",y),g?RF.nextTick(y):s!=null&&s.errorEmitted||u!=null&&u.errorEmitted?c||RF.nextTick(b):(!i&&(!c||gXt(t))&&(d||_Xt(t)===!1)||!a&&(!c||_Xt(t))&&(p||gXt(t)===!1)||u&&t.req&&t.aborted)&&RF.nextTick(b);let w=()=>{r=TWe,t.removeListener("aborted",y),t.removeListener("complete",f),t.removeListener("abort",y),t.removeListener("request",_),t.req&&t.req.removeListener("finish",f),t.removeListener("end",l),t.removeListener("close",l),t.removeListener("finish",f),t.removeListener("end",m),t.removeListener("error",h),t.removeListener("close",y)};if(e.signal&&!g){let x=()=>{let O=r;w(),O.call(t,new CXt(void 0,{cause:e.signal.reason}))};if(e.signal.aborted)RF.nextTick(x);else{TK=TK||by().addAbortListener;let O=TK(e.signal,x),E=r;r=OWe((...T)=>{O[xXt](),E.apply(t,T)})}}return w}function fPn(t,e,r){let n=!1,o=TWe;if(e.signal)if(o=()=>{n=!0,r.call(t,new CXt(void 0,{cause:e.signal.reason}))},e.signal.aborted)RF.nextTick(o);else{TK=TK||by().addAbortListener;let a=TK(e.signal,o),s=r;r=OWe((...u)=>{a[xXt](),s.apply(t,u)})}let i=(...a)=>{n||RF.nextTick(()=>r.apply(t,a))};return oPn(t[cPn].promise,i,i),TWe}function pPn(t,e){var r;let n=!1;return e===null&&(e=xWe),(r=e)!==null&&r!==void 0&&r.cleanup&&(rPn(e.cleanup,"cleanup"),n=e.cleanup),new nPn((o,i)=>{let a=OXt(t,e,s=>{n&&a(),s?i(s):o()})})}EWe.exports=OXt;EWe.exports.finished=pPn});var H4=S((bsa,NXt)=>{"use strict";var mT=MF(),{aggregateTwoErrors:mPn,codes:{ERR_MULTIPLE_CALLBACK:hPn},AbortError:gPn}=hb(),{Symbol:PXt}=sc(),{kIsDestroyed:yPn,isDestroyed:bPn,isFinished:_Pn,isServerRequest:vPn}=pT(),MXt=PXt("kDestroy"),PWe=PXt("kConstruct");function RXt(t,e,r){t&&(t.stack,e&&!e.errored&&(e.errored=t),r&&!r.errored&&(r.errored=t))}function wPn(t,e){let r=this._readableState,n=this._writableState,o=n||r;return n!=null&&n.destroyed||r!=null&&r.destroyed?(typeof e=="function"&&e(),this):(RXt(t,n,r),n&&(n.destroyed=!0),r&&(r.destroyed=!0),o.constructed?TXt(this,t,e):this.once(MXt,function(i){TXt(this,mPn(i,t),e)}),this)}function TXt(t,e,r){let n=!1;function o(i){if(n)return;n=!0;let a=t._readableState,s=t._writableState;RXt(i,s,a),s&&(s.closed=!0),a&&(a.closed=!0),typeof r=="function"&&r(i),i?mT.nextTick(SPn,t,i):mT.nextTick(AXt,t)}try{t._destroy(e||null,o)}catch(i){o(i)}}function SPn(t,e){MWe(t,e),AXt(t)}function AXt(t){let e=t._readableState,r=t._writableState;r&&(r.closeEmitted=!0),e&&(e.closeEmitted=!0),(r!=null&&r.emitClose||e!=null&&e.emitClose)&&t.emit("close")}function MWe(t,e){let r=t._readableState,n=t._writableState;n!=null&&n.errorEmitted||r!=null&&r.errorEmitted||(n&&(n.errorEmitted=!0),r&&(r.errorEmitted=!0),t.emit("error",e))}function CPn(){let t=this._readableState,e=this._writableState;t&&(t.constructed=!0,t.closed=!1,t.closeEmitted=!1,t.destroyed=!1,t.errored=null,t.errorEmitted=!1,t.reading=!1,t.ended=t.readable===!1,t.endEmitted=t.readable===!1),e&&(e.constructed=!0,e.destroyed=!1,e.closed=!1,e.closeEmitted=!1,e.errored=null,e.errorEmitted=!1,e.finalCalled=!1,e.prefinished=!1,e.ended=e.writable===!1,e.ending=e.writable===!1,e.finished=e.writable===!1)}function RWe(t,e,r){let n=t._readableState,o=t._writableState;if(o!=null&&o.destroyed||n!=null&&n.destroyed)return this;n!=null&&n.autoDestroy||o!=null&&o.autoDestroy?t.destroy(e):e&&(e.stack,o&&!o.errored&&(o.errored=e),n&&!n.errored&&(n.errored=e),r?mT.nextTick(MWe,t,e):MWe(t,e))}function xPn(t,e){if(typeof t._construct!="function")return;let r=t._readableState,n=t._writableState;r&&(r.constructed=!1),n&&(n.constructed=!1),t.once(PWe,e),!(t.listenerCount(PWe)>1)&&mT.nextTick(OPn,t)}function OPn(t){let e=!1;function r(n){if(e){RWe(t,n??new hPn);return}e=!0;let o=t._readableState,i=t._writableState,a=i||o;o&&(o.constructed=!0),i&&(i.constructed=!0),a.destroyed?t.emit(MXt,n):n?RWe(t,n,!0):mT.nextTick(TPn,t)}try{t._construct(n=>{mT.nextTick(r,n)})}catch(n){mT.nextTick(r,n)}}function TPn(t){t.emit(PWe)}function EXt(t){return t?.setHeader&&typeof t.abort=="function"}function IXt(t){t.emit("close")}function EPn(t,e){t.emit("error",e),mT.nextTick(IXt,t)}function PPn(t,e){!t||bPn(t)||(!e&&!_Pn(t)&&(e=new gPn),vPn(t)?(t.socket=null,t.destroy(e)):EXt(t)?t.abort():EXt(t.req)?t.req.abort():typeof t.destroy=="function"?t.destroy(e):typeof t.close=="function"?t.close():e?mT.nextTick(EPn,t,e):mT.nextTick(IXt,t),t.destroyed||(t[yPn]=!0))}NXt.exports={construct:xPn,destroyer:PPn,destroy:wPn,undestroy:CPn,errorOrDestroy:RWe}});var lwe=S((_sa,DXt)=>{"use strict";var{ArrayIsArray:MPn,ObjectSetPrototypeOf:jXt}=sc(),{EventEmitter:swe}=Ire();function uwe(t){swe.call(this,t)}jXt(uwe.prototype,swe.prototype);jXt(uwe,swe);uwe.prototype.pipe=function(t,e){let r=this;function n(c){t.writable&&t.write(c)===!1&&r.pause&&r.pause()}r.on("data",n);function o(){r.readable&&r.resume&&r.resume()}t.on("drain",o),!t._isStdio&&(!e||e.end!==!1)&&(r.on("end",a),r.on("close",s));let i=!1;function a(){i||(i=!0,t.end())}function s(){i||(i=!0,typeof t.destroy=="function"&&t.destroy())}function u(c){l(),swe.listenerCount(this,"error")===0&&this.emit("error",c)}AWe(r,"error",u),AWe(t,"error",u);function l(){r.removeListener("data",n),t.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",s),r.removeListener("error",u),t.removeListener("error",u),r.removeListener("end",l),r.removeListener("close",l),t.removeListener("close",l)}return r.on("end",l),r.on("close",l),t.on("close",l),t.emit("pipe",r),t};function AWe(t,e,r){if(typeof t.prependListener=="function")return t.prependListener(e,r);!t._events||!t._events[e]?t.on(e,r):MPn(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]}DXt.exports={Stream:uwe,prependListener:AWe}});var Nre=S((vsa,cwe)=>{"use strict";var{SymbolDispose:RPn}=sc(),{AbortError:$Xt,codes:APn}=hb(),{isNodeStream:LXt,isWebStream:IPn,kControllerErrorFunction:NPn}=pT(),jPn=c1(),{ERR_INVALID_ARG_TYPE:FXt}=APn,IWe,DPn=(t,e)=>{if(typeof t!="object"||!("aborted"in t))throw new FXt(e,"AbortSignal",t)};cwe.exports.addAbortSignal=function(e,r){if(DPn(e,"signal"),!LXt(r)&&!IPn(r))throw new FXt("stream",["ReadableStream","WritableStream","Stream"],r);return cwe.exports.addAbortSignalNoValidate(e,r)};cwe.exports.addAbortSignalNoValidate=function(t,e){if(typeof t!="object"||!("aborted"in t))return e;let r=LXt(e)?()=>{e.destroy(new $Xt(void 0,{cause:t.reason}))}:()=>{e[NPn](new $Xt(void 0,{cause:t.reason}))};if(t.aborted)r();else{IWe=IWe||by().addAbortListener;let n=IWe(t,r);jPn(e,n[RPn])}return e}});var BXt=S((Ssa,qXt)=>{"use strict";var{StringPrototypeSlice:kXt,SymbolIterator:$Pn,TypedArrayPrototypeSet:dwe,Uint8Array:LPn}=sc(),{Buffer:NWe}=rS(),{inspect:FPn}=by();qXt.exports=class{constructor(){this.head=null,this.tail=null,this.length=0}push(e){let r={data:e,next:null};this.length>0?this.tail.next=r:this.head=r,this.tail=r,++this.length}unshift(e){let r={data:e,next:this.head};this.length===0&&(this.tail=r),this.head=r,++this.length}shift(){if(this.length===0)return;let e=this.head.data;return this.length===1?this.head=this.tail=null:this.head=this.head.next,--this.length,e}clear(){this.head=this.tail=null,this.length=0}join(e){if(this.length===0)return"";let r=this.head,n=""+r.data;for(;(r=r.next)!==null;)n+=e+r.data;return n}concat(e){if(this.length===0)return NWe.alloc(0);let r=NWe.allocUnsafe(e>>>0),n=this.head,o=0;for(;n;)dwe(r,n.data,o),o+=n.data.length,n=n.next;return r}consume(e,r){let n=this.head.data;if(ei.length)r+=i,e-=i.length;else{e===i.length?(r+=i,++o,n.next?this.head=n.next:this.head=this.tail=null):(r+=kXt(i,0,e),this.head=n,n.data=kXt(i,e));break}++o}while((n=n.next)!==null);return this.length-=o,r}_getBuffer(e){let r=NWe.allocUnsafe(e),n=e,o=this.head,i=0;do{let a=o.data;if(e>a.length)dwe(r,a,n-e),e-=a.length;else{e===a.length?(dwe(r,a,n-e),++i,o.next?this.head=o.next:this.head=this.tail=null):(dwe(r,new LPn(a.buffer,a.byteOffset,e),n-e),this.head=o,o.data=a.slice(e));break}++i}while((o=o.next)!==null);return this.length-=i,r}[Symbol.for("nodejs.util.inspect.custom")](e,r){return FPn(this,{...r,depth:0,customInspect:!1})}}});var jre=S((Csa,VXt)=>{"use strict";var{MathFloor:kPn,NumberIsInteger:qPn}=sc(),{validateInteger:BPn}=xK(),{ERR_INVALID_ARG_VALUE:UPn}=hb().codes,UXt=16*1024,zXt=16;function zPn(t,e,r){return t.highWaterMark!=null?t.highWaterMark:e?t[r]:null}function HXt(t){return t?zXt:UXt}function HPn(t,e){BPn(e,"value",0),t?zXt=e:UXt=e}function VPn(t,e,r,n){let o=zPn(e,n,r);if(o!=null){if(!qPn(o)||o<0){let i=n?`options.${r}`:"options.highWaterMark";throw new UPn(i,o)}return kPn(o)}return HXt(t.objectMode)}VXt.exports={getHighWaterMark:VPn,getDefaultHighWaterMark:HXt,setDefaultHighWaterMark:HPn}});var WXt=S((jWe,KXt)=>{var fwe=rS(),hT=fwe.Buffer;function JXt(t,e){for(var r in t)e[r]=t[r]}hT.from&&hT.alloc&&hT.allocUnsafe&&hT.allocUnsafeSlow?KXt.exports=fwe:(JXt(fwe,jWe),jWe.Buffer=V4);function V4(t,e,r){return hT(t,e,r)}V4.prototype=Object.create(hT.prototype);JXt(hT,V4);V4.from=function(t,e,r){if(typeof t=="number")throw new TypeError("Argument must not be a number");return hT(t,e,r)};V4.alloc=function(t,e,r){if(typeof t!="number")throw new TypeError("Argument must be a number");var n=hT(t);return e!==void 0?typeof r=="string"?n.fill(e,r):n.fill(e):n.fill(0),n};V4.allocUnsafe=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return hT(t)};V4.allocUnsafeSlow=function(t){if(typeof t!="number")throw new TypeError("Argument must be a number");return fwe.SlowBuffer(t)}});var XXt=S(ZXt=>{"use strict";var $We=WXt().Buffer,GXt=$We.isEncoding||function(t){switch(t=""+t,t&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function JPn(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}function KPn(t){var e=JPn(t);if(typeof e!="string"&&($We.isEncoding===GXt||!GXt(t)))throw new Error("Unknown encoding: "+t);return e||t}ZXt.StringDecoder=Dre;function Dre(t){this.encoding=KPn(t);var e;switch(this.encoding){case"utf16le":this.text=QPn,this.end=eMn,e=4;break;case"utf8":this.fillLast=ZPn,e=4;break;case"base64":this.text=tMn,this.end=rMn,e=3;break;default:this.write=nMn,this.end=oMn;return}this.lastNeed=0,this.lastTotal=0,this.lastChar=$We.allocUnsafe(e)}Dre.prototype.write=function(t){if(t.length===0)return"";var e,r;if(this.lastNeed){if(e=this.fillLast(t),e===void 0)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r>5===6?2:t>>4===14?3:t>>3===30?4:t>>6===2?-1:-2}function WPn(t,e,r){var n=e.length-1;if(n=0?(o>0&&(t.lastNeed=o-1),o):--n=0?(o>0&&(t.lastNeed=o-2),o):--n=0?(o>0&&(o===2?o=0:t.lastNeed=o-3),o):0))}function GPn(t,e,r){if((e[0]&192)!==128)return t.lastNeed=0,"\uFFFD";if(t.lastNeed>1&&e.length>1){if((e[1]&192)!==128)return t.lastNeed=1,"\uFFFD";if(t.lastNeed>2&&e.length>2&&(e[2]&192)!==128)return t.lastNeed=2,"\uFFFD"}}function ZPn(t){var e=this.lastTotal-this.lastNeed,r=GPn(this,t,e);if(r!==void 0)return r;if(this.lastNeed<=t.length)return t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,e,0,t.length),this.lastNeed-=t.length}function XPn(t,e){var r=WPn(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function YPn(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"\uFFFD":e}function QPn(t,e){if((t.length-e)%2===0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function eMn(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function tMn(t,e){var r=(t.length-e)%3;return r===0?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,r===1?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-r))}function rMn(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function nMn(t){return t.toString(this.encoding)}function oMn(t){return t&&t.length?this.write(t):""}});var LWe=S((Osa,tYt)=>{"use strict";var YXt=MF(),{PromisePrototypeThen:iMn,SymbolAsyncIterator:QXt,SymbolIterator:eYt}=sc(),{Buffer:aMn}=rS(),{ERR_INVALID_ARG_TYPE:sMn,ERR_STREAM_NULL_VALUES:uMn}=hb().codes;function lMn(t,e,r){let n;if(typeof e=="string"||e instanceof aMn)return new t({objectMode:!0,...r,read(){this.push(e),this.push(null)}});let o;if(e&&e[QXt])o=!0,n=e[QXt]();else if(e&&e[eYt])o=!1,n=e[eYt]();else throw new sMn("iterable",["Iterable"],e);let i=new t({objectMode:!0,highWaterMark:1,...r}),a=!1;i._read=function(){a||(a=!0,u())},i._destroy=function(l,c){iMn(s(l),()=>YXt.nextTick(c,l),d=>YXt.nextTick(c,d||l))};async function s(l){let c=l!=null,d=typeof n.throw=="function";if(c&&d){let{value:f,done:p}=await n.throw(l);if(await f,p)return}if(typeof n.return=="function"){let{value:f}=await n.return();await f}}async function u(){for(;;){try{let{value:l,done:c}=o?await n.next():n.next();if(c)i.push(null);else{let d=l&&typeof l.then=="function"?await l:l;if(d===null)throw a=!1,new uMn;if(i.push(d))continue;a=!1}}catch(l){i.destroy(l)}break}}return i}tYt.exports=lMn});var Lre=S((Tsa,_Yt)=>{var gC=MF(),{ArrayPrototypeIndexOf:cMn,NumberIsInteger:dMn,NumberIsNaN:fMn,NumberParseInt:pMn,ObjectDefineProperties:VWe,ObjectKeys:mMn,ObjectSetPrototypeOf:oYt,Promise:iYt,SafeSet:hMn,SymbolAsyncDispose:gMn,SymbolAsyncIterator:yMn,Symbol:bMn}=sc();_Yt.exports=ri;ri.ReadableState=gwe;var{EventEmitter:_Mn}=Ire(),{Stream:AF,prependListener:vMn}=lwe(),{Buffer:FWe}=rS(),{addAbortSignal:wMn}=Nre(),aYt=c1(),Ei=by().debuglog("stream",t=>{Ei=t}),SMn=BXt(),MK=H4(),{getHighWaterMark:CMn,getDefaultHighWaterMark:xMn}=jre(),{aggregateTwoErrors:rYt,codes:{ERR_INVALID_ARG_TYPE:OMn,ERR_METHOD_NOT_IMPLEMENTED:TMn,ERR_OUT_OF_RANGE:EMn,ERR_STREAM_PUSH_AFTER_EOF:PMn,ERR_STREAM_UNSHIFT_AFTER_END_EVENT:MMn},AbortError:RMn}=hb(),{validateObject:AMn}=xK(),J4=bMn("kPaused"),{StringDecoder:sYt}=XXt(),IMn=LWe();oYt(ri.prototype,AF.prototype);oYt(ri,AF);var kWe=()=>{},{errorOrDestroy:EK}=MK,PK=1,NMn=2,uYt=4,$re=8,lYt=16,pwe=32,mwe=64,cYt=128,jMn=256,DMn=512,$Mn=1024,zWe=2048,HWe=4096,LMn=8192,FMn=16384,kMn=32768,dYt=65536,qMn=1<<17,BMn=1<<18;function Om(t){return{enumerable:!1,get(){return(this.state&t)!==0},set(e){e?this.state|=t:this.state&=~t}}}VWe(gwe.prototype,{objectMode:Om(PK),ended:Om(NMn),endEmitted:Om(uYt),reading:Om($re),constructed:Om(lYt),sync:Om(pwe),needReadable:Om(mwe),emittedReadable:Om(cYt),readableListening:Om(jMn),resumeScheduled:Om(DMn),errorEmitted:Om($Mn),emitClose:Om(zWe),autoDestroy:Om(HWe),destroyed:Om(LMn),closed:Om(FMn),closeEmitted:Om(kMn),multiAwaitDrain:Om(dYt),readingMore:Om(qMn),dataEmitted:Om(BMn)});function gwe(t,e,r){typeof r!="boolean"&&(r=e instanceof gT()),this.state=zWe|HWe|lYt|pwe,t&&t.objectMode&&(this.state|=PK),r&&t&&t.readableObjectMode&&(this.state|=PK),this.highWaterMark=t?CMn(this,t,"readableHighWaterMark",r):xMn(!1),this.buffer=new SMn,this.length=0,this.pipes=[],this.flowing=null,this[J4]=null,t&&t.emitClose===!1&&(this.state&=~zWe),t&&t.autoDestroy===!1&&(this.state&=~HWe),this.errored=null,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.awaitDrainWriters=null,this.decoder=null,this.encoding=null,t&&t.encoding&&(this.decoder=new sYt(t.encoding),this.encoding=t.encoding)}function ri(t){if(!(this instanceof ri))return new ri(t);let e=this instanceof gT();this._readableState=new gwe(t,this,e),t&&(typeof t.read=="function"&&(this._read=t.read),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&!e&&wMn(t.signal,this)),AF.call(this,t),MK.construct(this,()=>{this._readableState.needReadable&&hwe(this,this._readableState)})}ri.prototype.destroy=MK.destroy;ri.prototype._undestroy=MK.undestroy;ri.prototype._destroy=function(t,e){e(t)};ri.prototype[_Mn.captureRejectionSymbol]=function(t){this.destroy(t)};ri.prototype[gMn]=function(){let t;return this.destroyed||(t=this.readableEnded?null:new RMn,this.destroy(t)),new iYt((e,r)=>aYt(this,n=>n&&n!==t?r(n):e(null)))};ri.prototype.push=function(t,e){return fYt(this,t,e,!1)};ri.prototype.unshift=function(t,e){return fYt(this,t,e,!0)};function fYt(t,e,r,n){Ei("readableAddChunk",e);let o=t._readableState,i;if((o.state&PK)===0&&(typeof e=="string"?(r=r||o.defaultEncoding,o.encoding!==r&&(n&&o.encoding?e=FWe.from(e,r).toString(o.encoding):(e=FWe.from(e,r),r=""))):e instanceof FWe?r="":AF._isUint8Array(e)?(e=AF._uint8ArrayToBuffer(e),r=""):e!=null&&(i=new OMn("chunk",["string","Buffer","Uint8Array"],e))),i)EK(t,i);else if(e===null)o.state&=~$re,HMn(t,o);else if((o.state&PK)!==0||e&&e.length>0)if(n)if((o.state&uYt)!==0)EK(t,new MMn);else{if(o.destroyed||o.errored)return!1;qWe(t,o,e,!0)}else if(o.ended)EK(t,new PMn);else{if(o.destroyed||o.errored)return!1;o.state&=~$re,o.decoder&&!r?(e=o.decoder.write(e),o.objectMode||e.length!==0?qWe(t,o,e,!1):hwe(t,o)):qWe(t,o,e,!1)}else n||(o.state&=~$re,hwe(t,o));return!o.ended&&(o.length0?((e.state&dYt)!==0?e.awaitDrainWriters.clear():e.awaitDrainWriters=null,e.dataEmitted=!0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),(e.state&mwe)!==0&&ywe(t)),hwe(t,e)}ri.prototype.isPaused=function(){let t=this._readableState;return t[J4]===!0||t.flowing===!1};ri.prototype.setEncoding=function(t){let e=new sYt(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;let r=this._readableState.buffer,n="";for(let o of r)n+=e.write(o);return r.clear(),n!==""&&r.push(n),this._readableState.length=n.length,this};var UMn=1073741824;function zMn(t){if(t>UMn)throw new EMn("size","<= 1GiB",t);return t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++,t}function nYt(t,e){return t<=0||e.length===0&&e.ended?0:(e.state&PK)!==0?1:fMn(t)?e.flowing&&e.length?e.buffer.first().length:e.length:t<=e.length?t:e.ended?e.length:0}ri.prototype.read=function(t){Ei("read",t),t===void 0?t=NaN:dMn(t)||(t=pMn(t,10));let e=this._readableState,r=t;if(t>e.highWaterMark&&(e.highWaterMark=zMn(t)),t!==0&&(e.state&=~cYt),t===0&&e.needReadable&&((e.highWaterMark!==0?e.length>=e.highWaterMark:e.length>0)||e.ended))return Ei("read: emitReadable",e.length,e.ended),e.length===0&&e.ended?BWe(this):ywe(this),null;if(t=nYt(t,e),t===0&&e.ended)return e.length===0&&BWe(this),null;let n=(e.state&mwe)!==0;if(Ei("need readable",n),(e.length===0||e.length-t0?o=yYt(t,e):o=null,o===null?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.multiAwaitDrain?e.awaitDrainWriters.clear():e.awaitDrainWriters=null),e.length===0&&(e.ended||(e.needReadable=!0),r!==t&&e.ended&&BWe(this)),o!==null&&!e.errorEmitted&&!e.closeEmitted&&(e.dataEmitted=!0,this.emit("data",o)),o};function HMn(t,e){if(Ei("onEofChunk"),!e.ended){if(e.decoder){let r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?ywe(t):(e.needReadable=!1,e.emittedReadable=!0,pYt(t))}}function ywe(t){let e=t._readableState;Ei("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(Ei("emitReadable",e.flowing),e.emittedReadable=!0,gC.nextTick(pYt,t))}function pYt(t){let e=t._readableState;Ei("emitReadable_",e.destroyed,e.length,e.ended),!e.destroyed&&!e.errored&&(e.length||e.ended)&&(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,hYt(t)}function hwe(t,e){!e.readingMore&&e.constructed&&(e.readingMore=!0,gC.nextTick(VMn,t,e))}function VMn(t,e){for(;!e.reading&&!e.ended&&(e.length1&&n.pipes.includes(t)&&(Ei("false write response, pause",n.awaitDrainWriters.size),n.awaitDrainWriters.add(t)),r.pause()),u||(u=JMn(r,t),t.on("drain",u))}r.on("data",f);function f(y){Ei("ondata");let b=t.write(y);Ei("dest.write",b),b===!1&&d()}function p(y){if(Ei("onerror",y),g(),t.removeListener("error",p),t.listenerCount("error")===0){let b=t._writableState||t._readableState;b&&!b.errorEmitted?EK(t,y):t.emit("error",y)}}vMn(t,"error",p);function m(){t.removeListener("finish",h),g()}t.once("close",m);function h(){Ei("onfinish"),t.removeListener("close",m),g()}t.once("finish",h);function g(){Ei("unpipe"),r.unpipe(t)}return t.emit("pipe",r),t.writableNeedDrain===!0?d():n.flowing||(Ei("pipe resume"),r.resume()),t};function JMn(t,e){return function(){let n=t._readableState;n.awaitDrainWriters===e?(Ei("pipeOnDrain",1),n.awaitDrainWriters=null):n.multiAwaitDrain&&(Ei("pipeOnDrain",n.awaitDrainWriters.size),n.awaitDrainWriters.delete(e)),(!n.awaitDrainWriters||n.awaitDrainWriters.size===0)&&t.listenerCount("data")&&t.resume()}}ri.prototype.unpipe=function(t){let e=this._readableState,r={hasUnpiped:!1};if(e.pipes.length===0)return this;if(!t){let o=e.pipes;e.pipes=[],this.pause();for(let i=0;i0,n.flowing!==!1&&this.resume()):t==="readable"&&!n.endEmitted&&!n.readableListening&&(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,Ei("on readable",n.length,n.reading),n.length?ywe(this):n.reading||gC.nextTick(KMn,this)),r};ri.prototype.addListener=ri.prototype.on;ri.prototype.removeListener=function(t,e){let r=AF.prototype.removeListener.call(this,t,e);return t==="readable"&&gC.nextTick(mYt,this),r};ri.prototype.off=ri.prototype.removeListener;ri.prototype.removeAllListeners=function(t){let e=AF.prototype.removeAllListeners.apply(this,arguments);return(t==="readable"||t===void 0)&&gC.nextTick(mYt,this),e};function mYt(t){let e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&e[J4]===!1?e.flowing=!0:t.listenerCount("data")>0?t.resume():e.readableListening||(e.flowing=null)}function KMn(t){Ei("readable nexttick read 0"),t.read(0)}ri.prototype.resume=function(){let t=this._readableState;return t.flowing||(Ei("resume"),t.flowing=!t.readableListening,WMn(this,t)),t[J4]=!1,this};function WMn(t,e){e.resumeScheduled||(e.resumeScheduled=!0,gC.nextTick(GMn,t,e))}function GMn(t,e){Ei("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),hYt(t),e.flowing&&!e.reading&&t.read(0)}ri.prototype.pause=function(){return Ei("call pause flowing=%j",this._readableState.flowing),this._readableState.flowing!==!1&&(Ei("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState[J4]=!0,this};function hYt(t){let e=t._readableState;for(Ei("flow",e.flowing);e.flowing&&t.read()!==null;);}ri.prototype.wrap=function(t){let e=!1;t.on("data",n=>{!this.push(n)&&t.pause&&(e=!0,t.pause())}),t.on("end",()=>{this.push(null)}),t.on("error",n=>{EK(this,n)}),t.on("close",()=>{this.destroy()}),t.on("destroy",()=>{this.destroy()}),this._read=()=>{e&&t.resume&&(e=!1,t.resume())};let r=mMn(t);for(let n=1;n{o=a?rYt(o,a):null,r(),r=kWe});try{for(;;){let a=t.destroyed?null:t.read();if(a!==null)yield a;else{if(o)throw o;if(o===null)return;await new iYt(n)}}}catch(a){throw o=rYt(o,a),o}finally{(o||e?.destroyOnReturn!==!1)&&(o===void 0||t._readableState.autoDestroy)?MK.destroyer(t,null):(t.off("readable",n),i())}}VWe(ri.prototype,{readable:{__proto__:null,get(){let t=this._readableState;return!!t&&t.readable!==!1&&!t.destroyed&&!t.errorEmitted&&!t.endEmitted},set(t){this._readableState&&(this._readableState.readable=!!t)}},readableDidRead:{__proto__:null,enumerable:!1,get:function(){return this._readableState.dataEmitted}},readableAborted:{__proto__:null,enumerable:!1,get:function(){return!!(this._readableState.readable!==!1&&(this._readableState.destroyed||this._readableState.errored)&&!this._readableState.endEmitted)}},readableHighWaterMark:{__proto__:null,enumerable:!1,get:function(){return this._readableState.highWaterMark}},readableBuffer:{__proto__:null,enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}},readableFlowing:{__proto__:null,enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}},readableLength:{__proto__:null,enumerable:!1,get(){return this._readableState.length}},readableObjectMode:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.objectMode:!1}},readableEncoding:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.encoding:null}},errored:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.errored:null}},closed:{__proto__:null,get(){return this._readableState?this._readableState.closed:!1}},destroyed:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.destroyed:!1},set(t){this._readableState&&(this._readableState.destroyed=t)}},readableEnded:{__proto__:null,enumerable:!1,get(){return this._readableState?this._readableState.endEmitted:!1}}});VWe(gwe.prototype,{pipesCount:{__proto__:null,get(){return this.pipes.length}},paused:{__proto__:null,get(){return this[J4]!==!1},set(t){this[J4]=!!t}}});ri._fromList=yYt;function yYt(t,e){if(e.length===0)return null;let r;return e.objectMode?r=e.buffer.shift():!t||t>=e.length?(e.decoder?r=e.buffer.join(""):e.buffer.length===1?r=e.buffer.first():r=e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r}function BWe(t){let e=t._readableState;Ei("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,gC.nextTick(XMn,e,t))}function XMn(t,e){if(Ei("endReadableNT",t.endEmitted,t.length),!t.errored&&!t.closeEmitted&&!t.endEmitted&&t.length===0){if(t.endEmitted=!0,e.emit("end"),e.writable&&e.allowHalfOpen===!1)gC.nextTick(YMn,e);else if(t.autoDestroy){let r=e._writableState;(!r||r.autoDestroy&&(r.finished||r.writable===!1))&&e.destroy()}}}function YMn(t){t.writable&&!t.writableEnded&&!t.destroyed&&t.end()}ri.from=function(t,e){return IMn(ri,t,e)};var UWe;function bYt(){return UWe===void 0&&(UWe={}),UWe}ri.fromWeb=function(t,e){return bYt().newStreamReadableFromReadableStream(t,e)};ri.toWeb=function(t,e){return bYt().newReadableStreamFromStreamReadable(t,e)};ri.wrap=function(t,e){var r,n;return new ri({objectMode:(r=(n=t.readableObjectMode)!==null&&n!==void 0?n:t.objectMode)!==null&&r!==void 0?r:!0,...e,destroy(o,i){MK.destroyer(t,o),i(o)}}).wrap(t)}});var Swe=S((Esa,AYt)=>{var K4=MF(),{ArrayPrototypeSlice:SYt,Error:QMn,FunctionPrototypeSymbolHasInstance:CYt,ObjectDefineProperty:xYt,ObjectDefineProperties:eRn,ObjectSetPrototypeOf:OYt,StringPrototypeToLowerCase:tRn,Symbol:rRn,SymbolHasInstance:nRn}=sc();AYt.exports=uc;uc.WritableState=qre;var{EventEmitter:oRn}=Ire(),Fre=lwe().Stream,{Buffer:bwe}=rS(),wwe=H4(),{addAbortSignal:iRn}=Nre(),{getHighWaterMark:aRn,getDefaultHighWaterMark:sRn}=jre(),{ERR_INVALID_ARG_TYPE:uRn,ERR_METHOD_NOT_IMPLEMENTED:lRn,ERR_MULTIPLE_CALLBACK:TYt,ERR_STREAM_CANNOT_PIPE:cRn,ERR_STREAM_DESTROYED:kre,ERR_STREAM_ALREADY_FINISHED:dRn,ERR_STREAM_NULL_VALUES:fRn,ERR_STREAM_WRITE_AFTER_END:pRn,ERR_UNKNOWN_ENCODING:EYt}=hb().codes,{errorOrDestroy:RK}=wwe;OYt(uc.prototype,Fre.prototype);OYt(uc,Fre);function WWe(){}var AK=rRn("kOnFinished");function qre(t,e,r){typeof r!="boolean"&&(r=e instanceof gT()),this.objectMode=!!(t&&t.objectMode),r&&(this.objectMode=this.objectMode||!!(t&&t.writableObjectMode)),this.highWaterMark=t?aRn(this,t,"writableHighWaterMark",r):sRn(!1),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;let n=!!(t&&t.decodeStrings===!1);this.decodeStrings=!n,this.defaultEncoding=t&&t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=hRn.bind(void 0,e),this.writecb=null,this.writelen=0,this.afterWriteTickInfo=null,vwe(this),this.pendingcb=0,this.constructed=!0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!t||t.emitClose!==!1,this.autoDestroy=!t||t.autoDestroy!==!1,this.errored=null,this.closed=!1,this.closeEmitted=!1,this[AK]=[]}function vwe(t){t.buffered=[],t.bufferedIndex=0,t.allBuffers=!0,t.allNoop=!0}qre.prototype.getBuffer=function(){return SYt(this.buffered,this.bufferedIndex)};xYt(qre.prototype,"bufferedRequestCount",{__proto__:null,get(){return this.buffered.length-this.bufferedIndex}});function uc(t){let e=this instanceof gT();if(!e&&!CYt(uc,this))return new uc(t);this._writableState=new qre(t,this,e),t&&(typeof t.write=="function"&&(this._write=t.write),typeof t.writev=="function"&&(this._writev=t.writev),typeof t.destroy=="function"&&(this._destroy=t.destroy),typeof t.final=="function"&&(this._final=t.final),typeof t.construct=="function"&&(this._construct=t.construct),t.signal&&iRn(t.signal,this)),Fre.call(this,t),wwe.construct(this,()=>{let r=this._writableState;r.writing||ZWe(this,r),XWe(this,r)})}xYt(uc,nRn,{__proto__:null,value:function(t){return CYt(this,t)?!0:this!==uc?!1:t&&t._writableState instanceof qre}});uc.prototype.pipe=function(){RK(this,new cRn)};function PYt(t,e,r,n){let o=t._writableState;if(typeof r=="function")n=r,r=o.defaultEncoding;else{if(!r)r=o.defaultEncoding;else if(r!=="buffer"&&!bwe.isEncoding(r))throw new EYt(r);typeof n!="function"&&(n=WWe)}if(e===null)throw new fRn;if(!o.objectMode)if(typeof e=="string")o.decodeStrings!==!1&&(e=bwe.from(e,r),r="buffer");else if(e instanceof bwe)r="buffer";else if(Fre._isUint8Array(e))e=Fre._uint8ArrayToBuffer(e),r="buffer";else throw new uRn("chunk",["string","Buffer","Uint8Array"],e);let i;return o.ending?i=new pRn:o.destroyed&&(i=new kre("write")),i?(K4.nextTick(n,i),RK(t,i,!0),i):(o.pendingcb++,mRn(t,o,e,r,n))}uc.prototype.write=function(t,e,r){return PYt(this,t,e,r)===!0};uc.prototype.cork=function(){this._writableState.corked++};uc.prototype.uncork=function(){let t=this._writableState;t.corked&&(t.corked--,t.writing||ZWe(this,t))};uc.prototype.setDefaultEncoding=function(e){if(typeof e=="string"&&(e=tRn(e)),!bwe.isEncoding(e))throw new EYt(e);return this._writableState.defaultEncoding=e,this};function mRn(t,e,r,n,o){let i=e.objectMode?1:r.length;e.length+=i;let a=e.lengthr.bufferedIndex&&ZWe(t,r),n?r.afterWriteTickInfo!==null&&r.afterWriteTickInfo.cb===o?r.afterWriteTickInfo.count++:(r.afterWriteTickInfo={count:1,cb:o,stream:t,state:r},K4.nextTick(gRn,r.afterWriteTickInfo)):MYt(t,r,1,o))}function gRn({stream:t,state:e,count:r,cb:n}){return e.afterWriteTickInfo=null,MYt(t,e,r,n)}function MYt(t,e,r,n){for(!e.ending&&!t.destroyed&&e.length===0&&e.needDrain&&(e.needDrain=!1,t.emit("drain"));r-- >0;)e.pendingcb--,n();e.destroyed&&GWe(e),XWe(t,e)}function GWe(t){if(t.writing)return;for(let o=t.bufferedIndex;o1&&t._writev){e.pendingcb-=i-1;let s=e.allNoop?WWe:l=>{for(let c=a;c256?(r.splice(0,a),e.bufferedIndex=0):e.bufferedIndex=a}e.bufferProcessing=!1}uc.prototype._write=function(t,e,r){if(this._writev)this._writev([{chunk:t,encoding:e}],r);else throw new lRn("_write()")};uc.prototype._writev=null;uc.prototype.end=function(t,e,r){let n=this._writableState;typeof t=="function"?(r=t,t=null,e=null):typeof e=="function"&&(r=e,e=null);let o;if(t!=null){let i=PYt(this,t,e);i instanceof QMn&&(o=i)}return n.corked&&(n.corked=1,this.uncork()),o||(!n.errored&&!n.ending?(n.ending=!0,XWe(this,n,!0),n.ended=!0):n.finished?o=new dRn("end"):n.destroyed&&(o=new kre("end"))),typeof r=="function"&&(o||n.finished?K4.nextTick(r,o):n[AK].push(r)),this};function _we(t){return t.ending&&!t.destroyed&&t.constructed&&t.length===0&&!t.errored&&t.buffered.length===0&&!t.finished&&!t.writing&&!t.errorEmitted&&!t.closeEmitted}function yRn(t,e){let r=!1;function n(o){if(r){RK(t,o??TYt());return}if(r=!0,e.pendingcb--,o){let i=e[AK].splice(0);for(let a=0;a{_we(o)?KWe(n,o):o.pendingcb--},t,e)):_we(e)&&(e.pendingcb++,KWe(t,e))))}function KWe(t,e){e.pendingcb--,e.finished=!0;let r=e[AK].splice(0);for(let n=0;n{var YWe=MF(),vRn=rS(),{isReadable:wRn,isWritable:SRn,isIterable:IYt,isNodeStream:CRn,isReadableNodeStream:NYt,isWritableNodeStream:jYt,isDuplexNodeStream:xRn,isReadableStream:DYt,isWritableStream:$Yt}=pT(),LYt=c1(),{AbortError:zYt,codes:{ERR_INVALID_ARG_TYPE:ORn,ERR_INVALID_RETURN_VALUE:FYt}}=hb(),{destroyer:NK}=H4(),TRn=gT(),HYt=Lre(),ERn=Swe(),{createDeferredPromise:kYt}=by(),qYt=LWe(),BYt=globalThis.Blob||vRn.Blob,PRn=typeof BYt<"u"?function(e){return e instanceof BYt}:function(e){return!1},MRn=globalThis.AbortController||wK().AbortController,{FunctionPrototypeCall:UYt}=sc(),IF=class extends TRn{constructor(e){super(e),e?.readable===!1&&(this._readableState.readable=!1,this._readableState.ended=!0,this._readableState.endEmitted=!0),e?.writable===!1&&(this._writableState.writable=!1,this._writableState.ending=!0,this._writableState.ended=!0,this._writableState.finished=!0)}};VYt.exports=function t(e,r){if(xRn(e))return e;if(NYt(e))return IK({readable:e});if(jYt(e))return IK({writable:e});if(CRn(e))return IK({writable:!1,readable:!1});if(DYt(e))return IK({readable:HYt.fromWeb(e)});if($Yt(e))return IK({writable:ERn.fromWeb(e)});if(typeof e=="function"){let{value:o,write:i,final:a,destroy:s}=RRn(e);if(IYt(o))return qYt(IF,o,{objectMode:!0,write:i,final:a,destroy:s});let u=o?.then;if(typeof u=="function"){let l,c=UYt(u,o,d=>{if(d!=null)throw new FYt("nully","body",d)},d=>{NK(l,d)});return l=new IF({objectMode:!0,readable:!1,write:i,final(d){a(async()=>{try{await c,YWe.nextTick(d,null)}catch(f){YWe.nextTick(d,f)}})},destroy:s})}throw new FYt("Iterable, AsyncIterable or AsyncFunction",r,o)}if(PRn(e))return t(e.arrayBuffer());if(IYt(e))return qYt(IF,e,{objectMode:!0,writable:!1});if(DYt(e?.readable)&&$Yt(e?.writable))return IF.fromWeb(e);if(typeof e?.writable=="object"||typeof e?.readable=="object"){let o=e!=null&&e.readable?NYt(e?.readable)?e?.readable:t(e.readable):void 0,i=e!=null&&e.writable?jYt(e?.writable)?e?.writable:t(e.writable):void 0;return IK({readable:o,writable:i})}let n=e?.then;if(typeof n=="function"){let o;return UYt(n,e,i=>{i!=null&&o.push(i),o.push(null)},i=>{NK(o,i)}),o=new IF({objectMode:!0,writable:!1,read(){}})}throw new ORn(r,["Blob","ReadableStream","WritableStream","Stream","Iterable","AsyncIterable","Function","{ readable, writable } pair","Promise"],e)};function RRn(t){let{promise:e,resolve:r}=kYt(),n=new MRn,o=n.signal;return{value:t(async function*(){for(;;){let a=e;e=null;let{chunk:s,done:u,cb:l}=await a;if(YWe.nextTick(l),u)return;if(o.aborted)throw new zYt(void 0,{cause:o.reason});({promise:e,resolve:r}=kYt()),yield s}}(),{signal:o}),write(a,s,u){let l=r;r=null,l({chunk:a,done:!1,cb:u})},final(a){let s=r;r=null,s({done:!0,cb:a})},destroy(a,s){n.abort(),s(a)}}}function IK(t){let e=t.readable&&typeof t.readable.read!="function"?HYt.wrap(t.readable):t.readable,r=t.writable,n=!!wRn(e),o=!!SRn(r),i,a,s,u,l;function c(d){let f=u;u=null,f?f(d):d&&l.destroy(d)}return l=new IF({readableObjectMode:!!(e!=null&&e.readableObjectMode),writableObjectMode:!!(r!=null&&r.writableObjectMode),readable:n,writable:o}),o&&(LYt(r,d=>{o=!1,d&&NK(e,d),c(d)}),l._write=function(d,f,p){r.write(d,f)?p():i=p},l._final=function(d){r.end(),a=d},r.on("drain",function(){if(i){let d=i;i=null,d()}}),r.on("finish",function(){if(a){let d=a;a=null,d()}})),n&&(LYt(e,d=>{n=!1,d&&NK(e,d),c(d)}),e.on("readable",function(){if(s){let d=s;s=null,d()}}),e.on("end",function(){l.push(null)}),l._read=function(){for(;;){let d=e.read();if(d===null){s=l._read;return}if(!l.push(d))return}}),l._destroy=function(d,f){!d&&u!==null&&(d=new zYt),s=null,i=null,a=null,u===null?f(d):(u=f,NK(r,d),NK(e,d))},l}});var gT=S((Msa,GYt)=>{"use strict";var{ObjectDefineProperties:ARn,ObjectGetOwnPropertyDescriptor:d1,ObjectKeys:IRn,ObjectSetPrototypeOf:KYt}=sc();GYt.exports=yC;var t8e=Lre(),CS=Swe();KYt(yC.prototype,t8e.prototype);KYt(yC,t8e);{let t=IRn(CS.prototype);for(let e=0;e{"use strict";var{ObjectSetPrototypeOf:ZYt,Symbol:NRn}=sc();XYt.exports=f1;var{ERR_METHOD_NOT_IMPLEMENTED:jRn}=hb().codes,n8e=gT(),{getHighWaterMark:DRn}=jre();ZYt(f1.prototype,n8e.prototype);ZYt(f1,n8e);var Bre=NRn("kCallback");function f1(t){if(!(this instanceof f1))return new f1(t);let e=t?DRn(this,t,"readableHighWaterMark",!0):null;e===0&&(t={...t,highWaterMark:null,readableHighWaterMark:e,writableHighWaterMark:t.writableHighWaterMark||0}),n8e.call(this,t),this._readableState.sync=!1,this[Bre]=null,t&&(typeof t.transform=="function"&&(this._transform=t.transform),typeof t.flush=="function"&&(this._flush=t.flush)),this.on("prefinish",$Rn)}function r8e(t){typeof this._flush=="function"&&!this.destroyed?this._flush((e,r)=>{if(e){t?t(e):this.destroy(e);return}r!=null&&this.push(r),this.push(null),t&&t()}):(this.push(null),t&&t())}function $Rn(){this._final!==r8e&&r8e.call(this)}f1.prototype._final=r8e;f1.prototype._transform=function(t,e,r){throw new jRn("_transform()")};f1.prototype._write=function(t,e,r){let n=this._readableState,o=this._writableState,i=n.length;this._transform(t,e,(a,s)=>{if(a){r(a);return}s!=null&&this.push(s),o.ended||i===n.length||n.length{"use strict";var{ObjectSetPrototypeOf:YYt}=sc();QYt.exports=jK;var i8e=o8e();YYt(jK.prototype,i8e.prototype);YYt(jK,i8e);function jK(t){if(!(this instanceof jK))return new jK(t);i8e.call(this,t)}jK.prototype._transform=function(t,e,r){r(null,t)}});var Twe=S((Isa,oQt)=>{var Ure=MF(),{ArrayIsArray:LRn,Promise:FRn,SymbolAsyncIterator:kRn,SymbolDispose:qRn}=sc(),Owe=c1(),{once:BRn}=by(),URn=H4(),eQt=gT(),{aggregateTwoErrors:zRn,codes:{ERR_INVALID_ARG_TYPE:h8e,ERR_INVALID_RETURN_VALUE:s8e,ERR_MISSING_ARGS:HRn,ERR_STREAM_DESTROYED:VRn,ERR_STREAM_PREMATURE_CLOSE:JRn},AbortError:KRn}=hb(),{validateFunction:WRn,validateAbortSignal:GRn}=xK(),{isIterable:W4,isReadable:u8e,isReadableNodeStream:xwe,isNodeStream:tQt,isTransformStream:DK,isWebStream:ZRn,isReadableStream:l8e,isReadableFinished:XRn}=pT(),YRn=globalThis.AbortController||wK().AbortController,c8e,d8e,f8e;function rQt(t,e,r){let n=!1;t.on("close",()=>{n=!0});let o=Owe(t,{readable:e,writable:r},i=>{n=!i});return{destroy:i=>{n||(n=!0,URn.destroyer(t,i||new VRn("pipe")))},cleanup:o}}function QRn(t){return WRn(t[t.length-1],"streams[stream.length - 1]"),t.pop()}function p8e(t){if(W4(t))return t;if(xwe(t))return eAn(t);throw new h8e("val",["Readable","Iterable","AsyncIterable"],t)}async function*eAn(t){d8e||(d8e=Lre()),yield*d8e.prototype[kRn].call(t)}async function Cwe(t,e,r,{end:n}){let o,i=null,a=l=>{if(l&&(o=l),i){let c=i;i=null,c()}},s=()=>new FRn((l,c)=>{o?c(o):i=()=>{o?c(o):l()}});e.on("drain",a);let u=Owe(e,{readable:!1},a);try{e.writableNeedDrain&&await s();for await(let l of t)e.write(l)||await s();n&&(e.end(),await s()),r()}catch(l){r(o!==l?zRn(o,l):l)}finally{u(),e.off("drain",a)}}async function m8e(t,e,r,{end:n}){DK(e)&&(e=e.writable);let o=e.getWriter();try{for await(let i of t)await o.ready,o.write(i).catch(()=>{});await o.ready,n&&await o.close(),r()}catch(i){try{await o.abort(i),r(i)}catch(a){r(a)}}}function tAn(...t){return nQt(t,BRn(QRn(t)))}function nQt(t,e,r){if(t.length===1&&LRn(t[0])&&(t=t[0]),t.length<2)throw new HRn("streams");let n=new YRn,o=n.signal,i=r?.signal,a=[];GRn(i,"options.signal");function s(){m(new KRn)}f8e=f8e||by().addAbortListener;let u;i&&(u=f8e(i,s));let l,c,d=[],f=0;function p(_){m(_,--f===0)}function m(_,w){var x;if(_&&(!l||l.code==="ERR_STREAM_PREMATURE_CLOSE")&&(l=_),!(!l&&!w)){for(;d.length;)d.shift()(l);(x=u)===null||x===void 0||x[qRn](),n.abort(),w&&(l||a.forEach(O=>O()),Ure.nextTick(e,l,c))}}let h;for(let _=0;_0,E=x||r?.end!==!1,T=_===t.length-1;if(tQt(w)){let R=function(I){I&&I.name!=="AbortError"&&I.code!=="ERR_STREAM_PREMATURE_CLOSE"&&p(I)};var b=R;if(E){let{destroy:I,cleanup:j}=rQt(w,x,O);d.push(I),u8e(w)&&T&&a.push(j)}w.on("error",R),u8e(w)&&T&&a.push(()=>{w.removeListener("error",R)})}if(_===0)if(typeof w=="function"){if(h=w({signal:o}),!W4(h))throw new s8e("Iterable, AsyncIterable or Stream","source",h)}else W4(w)||xwe(w)||DK(w)?h=w:h=eQt.from(w);else if(typeof w=="function"){if(DK(h)){var g;h=p8e((g=h)===null||g===void 0?void 0:g.readable)}else h=p8e(h);if(h=w(h,{signal:o}),x){if(!W4(h,!0))throw new s8e("AsyncIterable",`transform[${_-1}]`,h)}else{var y;c8e||(c8e=a8e());let R=new c8e({objectMode:!0}),I=(y=h)===null||y===void 0?void 0:y.then;if(typeof I=="function")f++,I.call(h,B=>{c=B,B!=null&&R.write(B),E&&R.end(),Ure.nextTick(p)},B=>{R.destroy(B),Ure.nextTick(p,B)});else if(W4(h,!0))f++,Cwe(h,R,p,{end:E});else if(l8e(h)||DK(h)){let B=h.readable||h;f++,Cwe(B,R,p,{end:E})}else throw new s8e("AsyncIterable or Promise","destination",h);h=R;let{destroy:j,cleanup:F}=rQt(h,!1,!0);d.push(j),T&&a.push(F)}}else if(tQt(w)){if(xwe(h)){f+=2;let R=rAn(h,w,p,{end:E});u8e(w)&&T&&a.push(R)}else if(DK(h)||l8e(h)){let R=h.readable||h;f++,Cwe(R,w,p,{end:E})}else if(W4(h))f++,Cwe(h,w,p,{end:E});else throw new h8e("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],h);h=w}else if(ZRn(w)){if(xwe(h))f++,m8e(p8e(h),w,p,{end:E});else if(l8e(h)||W4(h))f++,m8e(h,w,p,{end:E});else if(DK(h))f++,m8e(h.readable,w,p,{end:E});else throw new h8e("val",["Readable","Iterable","AsyncIterable","ReadableStream","TransformStream"],h);h=w}else h=eQt.from(w)}return(o!=null&&o.aborted||i!=null&&i.aborted)&&Ure.nextTick(s),h}function rAn(t,e,r,{end:n}){let o=!1;if(e.on("close",()=>{o||r(new JRn)}),t.pipe(e,{end:!1}),n){let a=function(){o=!0,e.end()};var i=a;XRn(t)?Ure.nextTick(a):t.once("end",a)}else r();return Owe(t,{readable:!0,writable:!1},a=>{let s=t._readableState;a&&a.code==="ERR_STREAM_PREMATURE_CLOSE"&&s&&s.ended&&!s.errored&&!s.errorEmitted?t.once("end",r).once("error",r):r(a)}),Owe(e,{readable:!1,writable:!0},r)}oQt.exports={pipelineImpl:nQt,pipeline:tAn}});var y8e=S((Nsa,cQt)=>{"use strict";var{pipeline:nAn}=Twe(),Ewe=gT(),{destroyer:oAn}=H4(),{isNodeStream:Pwe,isReadable:iQt,isWritable:aQt,isWebStream:g8e,isTransformStream:G4,isWritableStream:sQt,isReadableStream:uQt}=pT(),{AbortError:iAn,codes:{ERR_INVALID_ARG_VALUE:lQt,ERR_MISSING_ARGS:aAn}}=hb(),sAn=c1();cQt.exports=function(...e){if(e.length===0)throw new aAn("streams");if(e.length===1)return Ewe.from(e[0]);let r=[...e];if(typeof e[0]=="function"&&(e[0]=Ewe.from(e[0])),typeof e[e.length-1]=="function"){let p=e.length-1;e[p]=Ewe.from(e[p])}for(let p=0;p0&&!(aQt(e[p])||sQt(e[p])||G4(e[p])))throw new lQt(`streams[${p}]`,r[p],"must be writable")}let n,o,i,a,s;function u(p){let m=a;a=null,m?m(p):p?s.destroy(p):!f&&!d&&s.destroy()}let l=e[0],c=nAn(e,u),d=!!(aQt(l)||sQt(l)||G4(l)),f=!!(iQt(c)||uQt(c)||G4(c));if(s=new Ewe({writableObjectMode:!!(l!=null&&l.writableObjectMode),readableObjectMode:!!(c!=null&&c.readableObjectMode),writable:d,readable:f}),d){if(Pwe(l))s._write=function(m,h,g){l.write(m,h)?g():n=g},s._final=function(m){l.end(),o=m},l.on("drain",function(){if(n){let m=n;n=null,m()}});else if(g8e(l)){let h=(G4(l)?l.writable:l).getWriter();s._write=async function(g,y,b){try{await h.ready,h.write(g).catch(()=>{}),b()}catch(_){b(_)}},s._final=async function(g){try{await h.ready,h.close().catch(()=>{}),o=g}catch(y){g(y)}}}let p=G4(c)?c.readable:c;sAn(p,()=>{if(o){let m=o;o=null,m()}})}if(f){if(Pwe(c))c.on("readable",function(){if(i){let p=i;i=null,p()}}),c.on("end",function(){s.push(null)}),s._read=function(){for(;;){let p=c.read();if(p===null){i=s._read;return}if(!s.push(p))return}};else if(g8e(c)){let m=(G4(c)?c.readable:c).getReader();s._read=async function(){for(;;)try{let{value:h,done:g}=await m.read();if(!s.push(h))return;if(g){s.push(null);return}}catch{return}}}}return s._destroy=function(p,m){!p&&a!==null&&(p=new iAn),i=null,n=null,o=null,a===null?m(p):(a=m,Pwe(c)&&oAn(c,p))},s}});var vQt=S((jsa,v8e)=>{"use strict";var uAn=globalThis.AbortController||wK().AbortController,{codes:{ERR_INVALID_ARG_VALUE:lAn,ERR_INVALID_ARG_TYPE:zre,ERR_MISSING_ARGS:cAn,ERR_OUT_OF_RANGE:dAn},AbortError:yT}=hb(),{validateAbortSignal:Z4,validateInteger:dQt,validateObject:X4}=xK(),fAn=sc().Symbol("kWeak"),pAn=sc().Symbol("kResistStopPropagation"),{finished:mAn}=c1(),hAn=y8e(),{addAbortSignalNoValidate:gAn}=Nre(),{isWritable:yAn,isNodeStream:bAn}=pT(),{deprecate:_An}=by(),{ArrayPrototypePush:vAn,Boolean:wAn,MathFloor:fQt,Number:SAn,NumberIsNaN:CAn,Promise:pQt,PromiseReject:mQt,PromiseResolve:xAn,PromisePrototypeThen:hQt,Symbol:yQt}=sc(),Mwe=yQt("kEmpty"),gQt=yQt("kEof");function OAn(t,e){if(e!=null&&X4(e,"options"),e?.signal!=null&&Z4(e.signal,"options.signal"),bAn(t)&&!yAn(t))throw new lAn("stream",t,"must be writable");let r=hAn(this,t);return e!=null&&e.signal&&gAn(e.signal,r),r}function Rwe(t,e){if(typeof t!="function")throw new zre("fn",["Function","AsyncFunction"],t);e!=null&&X4(e,"options"),e?.signal!=null&&Z4(e.signal,"options.signal");let r=1;e?.concurrency!=null&&(r=fQt(e.concurrency));let n=r-1;return e?.highWaterMark!=null&&(n=fQt(e.highWaterMark)),dQt(r,"options.concurrency",1),dQt(n,"options.highWaterMark",0),n+=r,async function*(){let i=by().AbortSignalAny([e?.signal].filter(wAn)),a=this,s=[],u={signal:i},l,c,d=!1,f=0;function p(){d=!0,m()}function m(){f-=1,h()}function h(){c&&!d&&f=n||f>=r)&&await new pQt(b=>{c=b})}s.push(gQt)}catch(y){let b=mQt(y);hQt(b,m,p),s.push(b)}finally{d=!0,l&&(l(),l=null)}}g();try{for(;;){for(;s.length>0;){let y=await s[0];if(y===gQt)return;if(i.aborted)throw new yT;y!==Mwe&&(yield y),s.shift(),h()}await new pQt(y=>{l=y})}}finally{d=!0,c&&(c(),c=null)}}.call(this)}function TAn(t=void 0){return t!=null&&X4(t,"options"),t?.signal!=null&&Z4(t.signal,"options.signal"),async function*(){let r=0;for await(let o of this){var n;if(t!=null&&(n=t.signal)!==null&&n!==void 0&&n.aborted)throw new yT({cause:t.signal.reason});yield[r++,o]}}.call(this)}async function bQt(t,e=void 0){for await(let r of _8e.call(this,t,e))return!0;return!1}async function EAn(t,e=void 0){if(typeof t!="function")throw new zre("fn",["Function","AsyncFunction"],t);return!await bQt.call(this,async(...r)=>!await t(...r),e)}async function PAn(t,e){for await(let r of _8e.call(this,t,e))return r}async function MAn(t,e){if(typeof t!="function")throw new zre("fn",["Function","AsyncFunction"],t);async function r(n,o){return await t(n,o),Mwe}for await(let n of Rwe.call(this,r,e));}function _8e(t,e){if(typeof t!="function")throw new zre("fn",["Function","AsyncFunction"],t);async function r(n,o){return await t(n,o)?n:Mwe}return Rwe.call(this,r,e)}var b8e=class extends cAn{constructor(){super("reduce"),this.message="Reduce of an empty stream requires an initial value"}};async function RAn(t,e,r){var n;if(typeof t!="function")throw new zre("reducer",["Function","AsyncFunction"],t);r!=null&&X4(r,"options"),r?.signal!=null&&Z4(r.signal,"options.signal");let o=arguments.length>1;if(r!=null&&(n=r.signal)!==null&&n!==void 0&&n.aborted){let l=new yT(void 0,{cause:r.signal.reason});throw this.once("error",()=>{}),await mAn(this.destroy(l)),l}let i=new uAn,a=i.signal;if(r!=null&&r.signal){let l={once:!0,[fAn]:this,[pAn]:!0};r.signal.addEventListener("abort",()=>i.abort(),l)}let s=!1;try{for await(let l of this){var u;if(s=!0,r!=null&&(u=r.signal)!==null&&u!==void 0&&u.aborted)throw new yT;o?e=await t(e,l,{signal:a}):(e=l,o=!0)}if(!s&&!o)throw new b8e}finally{i.abort()}return e}async function AAn(t){t!=null&&X4(t,"options"),t?.signal!=null&&Z4(t.signal,"options.signal");let e=[];for await(let n of this){var r;if(t!=null&&(r=t.signal)!==null&&r!==void 0&&r.aborted)throw new yT(void 0,{cause:t.signal.reason});vAn(e,n)}return e}function IAn(t,e){let r=Rwe.call(this,t,e);return async function*(){for await(let o of r)yield*o}.call(this)}function _Qt(t){if(t=SAn(t),CAn(t))return 0;if(t<0)throw new dAn("number",">= 0",t);return t}function NAn(t,e=void 0){return e!=null&&X4(e,"options"),e?.signal!=null&&Z4(e.signal,"options.signal"),t=_Qt(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new yT;for await(let i of this){var o;if(e!=null&&(o=e.signal)!==null&&o!==void 0&&o.aborted)throw new yT;t--<=0&&(yield i)}}.call(this)}function jAn(t,e=void 0){return e!=null&&X4(e,"options"),e?.signal!=null&&Z4(e.signal,"options.signal"),t=_Qt(t),async function*(){var n;if(e!=null&&(n=e.signal)!==null&&n!==void 0&&n.aborted)throw new yT;for await(let i of this){var o;if(e!=null&&(o=e.signal)!==null&&o!==void 0&&o.aborted)throw new yT;if(t-- >0&&(yield i),t<=0)return}}.call(this)}v8e.exports.streamReturningOperators={asIndexedPairs:_An(TAn,"readable.asIndexedPairs will be removed in a future version."),drop:NAn,filter:_8e,flatMap:IAn,map:Rwe,take:jAn,compose:OAn};v8e.exports.promiseReturningOperators={every:EAn,forEach:MAn,reduce:RAn,toArray:AAn,some:bQt,find:PAn}});var w8e=S((Dsa,wQt)=>{"use strict";var{ArrayPrototypePop:DAn,Promise:$An}=sc(),{isIterable:LAn,isNodeStream:FAn,isWebStream:kAn}=pT(),{pipelineImpl:qAn}=Twe(),{finished:BAn}=c1();S8e();function UAn(...t){return new $An((e,r)=>{let n,o,i=t[t.length-1];if(i&&typeof i=="object"&&!FAn(i)&&!LAn(i)&&!kAn(i)){let a=DAn(t);n=a.signal,o=a.end}qAn(t,(a,s)=>{a?r(a):e(s)},{signal:n,end:o})})}wQt.exports={finished:BAn,pipeline:UAn}});var S8e=S(($sa,RQt)=>{var{Buffer:zAn}=rS(),{ObjectDefineProperty:p1,ObjectKeys:xQt,ReflectApply:OQt}=sc(),{promisify:{custom:TQt}}=by(),{streamReturningOperators:SQt,promiseReturningOperators:CQt}=vQt(),{codes:{ERR_ILLEGAL_CONSTRUCTOR:EQt}}=hb(),HAn=y8e(),{setDefaultHighWaterMark:VAn,getDefaultHighWaterMark:JAn}=jre(),{pipeline:PQt}=Twe(),{destroyer:KAn}=H4(),MQt=c1(),C8e=w8e(),Hre=pT(),al=RQt.exports=lwe().Stream;al.isDestroyed=Hre.isDestroyed;al.isDisturbed=Hre.isDisturbed;al.isErrored=Hre.isErrored;al.isReadable=Hre.isReadable;al.isWritable=Hre.isWritable;al.Readable=Lre();for(let t of xQt(SQt)){let r=function(...n){if(new.target)throw EQt();return al.Readable.from(OQt(e,this,n))};x8e=r;let e=SQt[t];p1(r,"name",{__proto__:null,value:e.name}),p1(r,"length",{__proto__:null,value:e.length}),p1(al.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var x8e;for(let t of xQt(CQt)){let r=function(...o){if(new.target)throw EQt();return OQt(e,this,o)};x8e=r;let e=CQt[t];p1(r,"name",{__proto__:null,value:e.name}),p1(r,"length",{__proto__:null,value:e.length}),p1(al.Readable.prototype,t,{__proto__:null,value:r,enumerable:!1,configurable:!0,writable:!0})}var x8e;al.Writable=Swe();al.Duplex=gT();al.Transform=o8e();al.PassThrough=a8e();al.pipeline=PQt;var{addAbortSignal:WAn}=Nre();al.addAbortSignal=WAn;al.finished=MQt;al.destroy=KAn;al.compose=HAn;al.setDefaultHighWaterMark=VAn;al.getDefaultHighWaterMark=JAn;p1(al,"promises",{__proto__:null,configurable:!0,enumerable:!0,get(){return C8e}});p1(PQt,TQt,{__proto__:null,enumerable:!0,get(){return C8e.pipeline}});p1(MQt,TQt,{__proto__:null,enumerable:!0,get(){return C8e.finished}});al.Stream=al;al._isUint8Array=function(e){return e instanceof Uint8Array};al._uint8ArrayToBuffer=function(e){return zAn.from(e.buffer,e.byteOffset,e.byteLength)}});var Vre=S((Lsa,Zc)=>{"use strict";var Tm=S8e(),GAn=w8e(),ZAn=Tm.Readable.destroy;Zc.exports=Tm.Readable;Zc.exports._uint8ArrayToBuffer=Tm._uint8ArrayToBuffer;Zc.exports._isUint8Array=Tm._isUint8Array;Zc.exports.isDisturbed=Tm.isDisturbed;Zc.exports.isErrored=Tm.isErrored;Zc.exports.isReadable=Tm.isReadable;Zc.exports.Readable=Tm.Readable;Zc.exports.Writable=Tm.Writable;Zc.exports.Duplex=Tm.Duplex;Zc.exports.Transform=Tm.Transform;Zc.exports.PassThrough=Tm.PassThrough;Zc.exports.addAbortSignal=Tm.addAbortSignal;Zc.exports.finished=Tm.finished;Zc.exports.destroy=Tm.destroy;Zc.exports.destroy=ZAn;Zc.exports.pipeline=Tm.pipeline;Zc.exports.compose=Tm.compose;Object.defineProperty(Tm,"promises",{configurable:!0,enumerable:!0,get(){return GAn}});Zc.exports.Stream=Tm.Stream;Zc.exports.default=Zc.exports});var NQt=S(Jre=>{"use strict";Object.defineProperty(Jre,"__esModule",{value:!0});Jre.Headers=void 0;var AQt;typeof globalThis.Headers<"u"?Jre.Headers=AQt=globalThis.Headers:Jre.Headers=AQt=class IQt{constructor(e){if(this.headers=new Map,e)if(e instanceof IQt)e.forEach((r,n)=>this.append(n,r));else if(Array.isArray(e))for(let[r,n]of e)if(typeof r=="string"&&typeof n=="string")this.append(r,n);else throw new TypeError("Each header entry must be a [string, string] tuple");else for(let[r,n]of Object.entries(e))if(typeof n=="string")this.append(r,n);else throw new TypeError("Header values must be strings")}append(e,r){let n=e.toLowerCase(),o=this.headers.get(n)||[];this.headers.set(n,[...o,r])}delete(e){let r=e.toLowerCase();this.headers.delete(r)}get(e){let r=e.toLowerCase(),n=this.headers.get(r);return n?n.join(", "):null}has(e){let r=e.toLowerCase();return this.headers.has(r)}set(e,r){let n=e.toLowerCase();this.headers.set(n,[r])}forEach(e,r){let n=r?e.bind(r):e;this.headers.forEach((o,i)=>n(o.join(", "),i,this))}getSetCookie(){return this.headers.get("set-cookie")||[]}*entries(){for(let[e,r]of this.headers.entries())yield[e,r.join(", ")]}*keys(){yield*this.headers.keys()}*values(){for(let e of this.headers.values())yield e.join(", ")}[Symbol.iterator](){return this.entries()}}});var O8e=S(Y4=>{"use strict";Object.defineProperty(Y4,"__esModule",{value:!0});Y4.unknownRawResponse=Y4.abortRawResponse=void 0;Y4.toRawResponse=XAn;var jQt=NQt();Y4.abortRawResponse={headers:new jQt.Headers,redirected:!1,status:499,statusText:"Client Closed Request",type:"error",url:""};Y4.unknownRawResponse={headers:new jQt.Headers,redirected:!1,status:0,statusText:"Unknown Error",type:"error",url:""};function XAn(t){return{headers:t.headers,redirected:t.redirected,status:t.status,statusText:t.statusText,type:t.type,url:t.url}}});var Q4=S((qsa,DQt)=>{"use strict";DQt.exports=TypeError});var $Qt=S(()=>{});var Zre=S((zsa,rer)=>{var D8e=typeof Map=="function"&&Map.prototype,T8e=Object.getOwnPropertyDescriptor&&D8e?Object.getOwnPropertyDescriptor(Map.prototype,"size"):null,Iwe=D8e&&T8e&&typeof T8e.get=="function"?T8e.get:null,LQt=D8e&&Map.prototype.forEach,$8e=typeof Set=="function"&&Set.prototype,E8e=Object.getOwnPropertyDescriptor&&$8e?Object.getOwnPropertyDescriptor(Set.prototype,"size"):null,Nwe=$8e&&E8e&&typeof E8e.get=="function"?E8e.get:null,FQt=$8e&&Set.prototype.forEach,YAn=typeof WeakMap=="function"&&WeakMap.prototype,Wre=YAn?WeakMap.prototype.has:null,QAn=typeof WeakSet=="function"&&WeakSet.prototype,Gre=QAn?WeakSet.prototype.has:null,eIn=typeof WeakRef=="function"&&WeakRef.prototype,kQt=eIn?WeakRef.prototype.deref:null,tIn=Boolean.prototype.valueOf,rIn=Object.prototype.toString,nIn=Function.prototype.toString,oIn=String.prototype.match,L8e=String.prototype.slice,NF=String.prototype.replace,iIn=String.prototype.toUpperCase,qQt=String.prototype.toLowerCase,GQt=RegExp.prototype.test,BQt=Array.prototype.concat,bT=Array.prototype.join,aIn=Array.prototype.slice,UQt=Math.floor,R8e=typeof BigInt=="function"?BigInt.prototype.valueOf:null,P8e=Object.getOwnPropertySymbols,A8e=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?Symbol.prototype.toString:null,$K=typeof Symbol=="function"&&typeof Symbol.iterator=="object",vy=typeof Symbol=="function"&&Symbol.toStringTag&&(typeof Symbol.toStringTag===$K||!0)?Symbol.toStringTag:null,ZQt=Object.prototype.propertyIsEnumerable,zQt=(typeof Reflect=="function"?Reflect.getPrototypeOf:Object.getPrototypeOf)||([].__proto__===Array.prototype?function(t){return t.__proto__}:null);function HQt(t,e){if(t===1/0||t===-1/0||t!==t||t&&t>-1e3&&t<1e3||GQt.call(/e/,e))return e;var r=/[0-9](?=(?:[0-9]{3})+(?![0-9]))/g;if(typeof t=="number"){var n=t<0?-UQt(-t):UQt(t);if(n!==t){var o=String(n),i=L8e.call(e,o.length+1);return NF.call(o,r,"$&_")+"."+NF.call(NF.call(i,/([0-9]{3})/g,"$&_"),/_$/,"")}}return NF.call(e,r,"$&_")}var I8e=$Qt(),VQt=I8e.custom,JQt=QQt(VQt)?VQt:null,XQt={__proto__:null,double:'"',single:"'"},sIn={__proto__:null,double:/(["\\])/g,single:/(['\\])/g};rer.exports=function t(e,r,n,o){var i=r||{};if(m1(i,"quoteStyle")&&!m1(XQt,i.quoteStyle))throw new TypeError('option "quoteStyle" must be "single" or "double"');if(m1(i,"maxStringLength")&&(typeof i.maxStringLength=="number"?i.maxStringLength<0&&i.maxStringLength!==1/0:i.maxStringLength!==null))throw new TypeError('option "maxStringLength", if provided, must be a positive integer, Infinity, or `null`');var a=m1(i,"customInspect")?i.customInspect:!0;if(typeof a!="boolean"&&a!=="symbol")throw new TypeError("option \"customInspect\", if provided, must be `true`, `false`, or `'symbol'`");if(m1(i,"indent")&&i.indent!==null&&i.indent!==" "&&!(parseInt(i.indent,10)===i.indent&&i.indent>0))throw new TypeError('option "indent" must be "\\t", an integer > 0, or `null`');if(m1(i,"numericSeparator")&&typeof i.numericSeparator!="boolean")throw new TypeError('option "numericSeparator", if provided, must be `true` or `false`');var s=i.numericSeparator;if(typeof e>"u")return"undefined";if(e===null)return"null";if(typeof e=="boolean")return e?"true":"false";if(typeof e=="string")return ter(e,i);if(typeof e=="number"){if(e===0)return 1/0/e>0?"0":"-0";var u=String(e);return s?HQt(e,u):u}if(typeof e=="bigint"){var l=String(e)+"n";return s?HQt(e,l):l}var c=typeof i.depth>"u"?5:i.depth;if(typeof n>"u"&&(n=0),n>=c&&c>0&&typeof e=="object")return N8e(e)?"[Array]":"[Object]";var d=OIn(i,n);if(typeof o>"u")o=[];else if(eer(o,e)>=0)return"[Circular]";function f(B,U,J){if(U&&(o=aIn.call(o),o.push(U)),J){var G={depth:i.depth};return m1(i,"quoteStyle")&&(G.quoteStyle=i.quoteStyle),t(B,G,n+1,o)}return t(B,i,n+1,o)}if(typeof e=="function"&&!KQt(e)){var p=gIn(e),m=Awe(e,f);return"[Function"+(p?": "+p:" (anonymous)")+"]"+(m.length>0?" { "+bT.call(m,", ")+" }":"")}if(QQt(e)){var h=$K?NF.call(String(e),/^(Symbol\(.*\))_[^)]*$/,"$1"):A8e.call(e);return typeof e=="object"&&!$K?Kre(h):h}if(SIn(e)){for(var g="<"+qQt.call(String(e.nodeName)),y=e.attributes||[],b=0;b",g}if(N8e(e)){if(e.length===0)return"[]";var _=Awe(e,f);return d&&!xIn(_)?"["+j8e(_,d)+"]":"[ "+bT.call(_,", ")+" ]"}if(cIn(e)){var w=Awe(e,f);return!("cause"in Error.prototype)&&"cause"in e&&!ZQt.call(e,"cause")?"{ ["+String(e)+"] "+bT.call(BQt.call("[cause]: "+f(e.cause),w),", ")+" }":w.length===0?"["+String(e)+"]":"{ ["+String(e)+"] "+bT.call(w,", ")+" }"}if(typeof e=="object"&&a){if(JQt&&typeof e[JQt]=="function"&&I8e)return I8e(e,{depth:c-n});if(a!=="symbol"&&typeof e.inspect=="function")return e.inspect()}if(yIn(e)){var x=[];return LQt&&LQt.call(e,function(B,U){x.push(f(U,e,!0)+" => "+f(B,e))}),WQt("Map",Iwe.call(e),x,d)}if(vIn(e)){var O=[];return FQt&&FQt.call(e,function(B){O.push(f(B,e))}),WQt("Set",Nwe.call(e),O,d)}if(bIn(e))return M8e("WeakMap");if(wIn(e))return M8e("WeakSet");if(_In(e))return M8e("WeakRef");if(fIn(e))return Kre(f(Number(e)));if(mIn(e))return Kre(f(R8e.call(e)));if(pIn(e))return Kre(tIn.call(e));if(dIn(e))return Kre(f(String(e)));if(typeof window<"u"&&e===window)return"{ [object Window] }";if(typeof globalThis<"u"&&e===globalThis||typeof window<"u"&&e===window)return"{ [object globalThis] }";if(!lIn(e)&&!KQt(e)){var E=Awe(e,f),T=zQt?zQt(e)===Object.prototype:e instanceof Object||e.constructor===Object,R=e instanceof Object?"":"null prototype",I=!T&&vy&&Object(e)===e&&vy in e?L8e.call(jF(e),8,-1):R?"Object":"",j=T||typeof e.constructor!="function"?"":e.constructor.name?e.constructor.name+" ":"",F=j+(I||R?"["+bT.call(BQt.call([],I||[],R||[]),": ")+"] ":"");return E.length===0?F+"{}":d?F+"{"+j8e(E,d)+"}":F+"{ "+bT.call(E,", ")+" }"}return String(e)};function YQt(t,e,r){var n=r.quoteStyle||e,o=XQt[n];return o+t+o}function uIn(t){return NF.call(String(t),/"/g,""")}function N8e(t){return jF(t)==="[object Array]"&&(!vy||!(typeof t=="object"&&vy in t))}function lIn(t){return jF(t)==="[object Date]"&&(!vy||!(typeof t=="object"&&vy in t))}function KQt(t){return jF(t)==="[object RegExp]"&&(!vy||!(typeof t=="object"&&vy in t))}function cIn(t){return jF(t)==="[object Error]"&&(!vy||!(typeof t=="object"&&vy in t))}function dIn(t){return jF(t)==="[object String]"&&(!vy||!(typeof t=="object"&&vy in t))}function fIn(t){return jF(t)==="[object Number]"&&(!vy||!(typeof t=="object"&&vy in t))}function pIn(t){return jF(t)==="[object Boolean]"&&(!vy||!(typeof t=="object"&&vy in t))}function QQt(t){if($K)return t&&typeof t=="object"&&t instanceof Symbol;if(typeof t=="symbol")return!0;if(!t||typeof t!="object"||!A8e)return!1;try{return A8e.call(t),!0}catch{}return!1}function mIn(t){if(!t||typeof t!="object"||!R8e)return!1;try{return R8e.call(t),!0}catch{}return!1}var hIn=Object.prototype.hasOwnProperty||function(t){return t in this};function m1(t,e){return hIn.call(t,e)}function jF(t){return rIn.call(t)}function gIn(t){if(t.name)return t.name;var e=oIn.call(nIn.call(t),/^function\s*([\w$]+)/);return e?e[1]:null}function eer(t,e){if(t.indexOf)return t.indexOf(e);for(var r=0,n=t.length;re.maxStringLength){var r=t.length-e.maxStringLength,n="... "+r+" more character"+(r>1?"s":"");return ter(L8e.call(t,0,e.maxStringLength),e)+n}var o=sIn[e.quoteStyle||"single"];o.lastIndex=0;var i=NF.call(NF.call(t,o,"\\$1"),/[\x00-\x1f]/g,CIn);return YQt(i,"single",e)}function CIn(t){var e=t.charCodeAt(0),r={8:"b",9:"t",10:"n",12:"f",13:"r"}[e];return r?"\\"+r:"\\x"+(e<16?"0":"")+iIn.call(e.toString(16))}function Kre(t){return"Object("+t+")"}function M8e(t){return t+" { ? }"}function WQt(t,e,r,n){var o=n?j8e(r,n):bT.call(r,", ");return t+" ("+e+") {"+o+"}"}function xIn(t){for(var e=0;e=0)return!1;return!0}function OIn(t,e){var r;if(t.indent===" ")r=" ";else if(typeof t.indent=="number"&&t.indent>0)r=bT.call(Array(t.indent+1)," ");else return null;return{base:r,prev:bT.call(Array(e+1),r)}}function j8e(t,e){if(t.length===0)return"";var r=` +`+e.prev+e.base;return r+bT.call(t,","+r)+` +`+e.prev}function Awe(t,e){var r=N8e(t),n=[];if(r){n.length=t.length;for(var o=0;o{"use strict";var TIn=Zre(),EIn=Q4(),jwe=function(t,e,r){for(var n=t,o;(o=n.next)!=null;n=o)if(o.key===e)return n.next=o.next,r||(o.next=t.next,t.next=o),o},PIn=function(t,e){if(t){var r=jwe(t,e);return r&&r.value}},MIn=function(t,e,r){var n=jwe(t,e);n?n.value=r:t.next={key:e,next:t.next,value:r}},RIn=function(t,e){return t?!!jwe(t,e):!1},AIn=function(t,e){if(t)return jwe(t,e,!0)};ner.exports=function(){var e,r={assert:function(n){if(!r.has(n))throw new EIn("Side channel does not contain "+TIn(n))},delete:function(n){var o=e&&e.next,i=AIn(e,n);return i&&o&&o===i&&(e=void 0),!!i},get:function(n){return PIn(e,n)},has:function(n){return RIn(e,n)},set:function(n,o){e||(e={next:void 0}),MIn(e,n,o)}};return r}});var F8e=S((Vsa,ier)=>{"use strict";ier.exports=Object});var ser=S((Jsa,aer)=>{"use strict";aer.exports=Error});var ler=S((Ksa,uer)=>{"use strict";uer.exports=EvalError});var der=S((Wsa,cer)=>{"use strict";cer.exports=RangeError});var per=S((Gsa,fer)=>{"use strict";fer.exports=ReferenceError});var her=S((Zsa,mer)=>{"use strict";mer.exports=SyntaxError});var yer=S((Xsa,ger)=>{"use strict";ger.exports=URIError});var _er=S((Ysa,ber)=>{"use strict";ber.exports=Math.abs});var wer=S((Qsa,ver)=>{"use strict";ver.exports=Math.floor});var Cer=S((eua,Ser)=>{"use strict";Ser.exports=Math.max});var Oer=S((tua,xer)=>{"use strict";xer.exports=Math.min});var Eer=S((rua,Ter)=>{"use strict";Ter.exports=Math.pow});var Mer=S((nua,Per)=>{"use strict";Per.exports=Math.round});var Aer=S((oua,Rer)=>{"use strict";Rer.exports=Number.isNaN||function(e){return e!==e}});var Ner=S((iua,Ier)=>{"use strict";var IIn=Aer();Ier.exports=function(e){return IIn(e)||e===0?e:e<0?-1:1}});var Der=S((aua,jer)=>{"use strict";jer.exports=Object.getOwnPropertyDescriptor});var k8e=S((sua,$er)=>{"use strict";var Dwe=Der();if(Dwe)try{Dwe([],"length")}catch{Dwe=null}$er.exports=Dwe});var Fer=S((uua,Ler)=>{"use strict";var $we=Object.defineProperty||!1;if($we)try{$we({},"a",{value:1})}catch{$we=!1}Ler.exports=$we});var qer=S((lua,ker)=>{"use strict";ker.exports=function(){if(typeof Symbol!="function"||typeof Object.getOwnPropertySymbols!="function")return!1;if(typeof Symbol.iterator=="symbol")return!0;var e={},r=Symbol("test"),n=Object(r);if(typeof r=="string"||Object.prototype.toString.call(r)!=="[object Symbol]"||Object.prototype.toString.call(n)!=="[object Symbol]")return!1;var o=42;e[r]=o;for(var i in e)return!1;if(typeof Object.keys=="function"&&Object.keys(e).length!==0||typeof Object.getOwnPropertyNames=="function"&&Object.getOwnPropertyNames(e).length!==0)return!1;var a=Object.getOwnPropertySymbols(e);if(a.length!==1||a[0]!==r||!Object.prototype.propertyIsEnumerable.call(e,r))return!1;if(typeof Object.getOwnPropertyDescriptor=="function"){var s=Object.getOwnPropertyDescriptor(e,r);if(s.value!==o||s.enumerable!==!0)return!1}return!0}});var zer=S((cua,Uer)=>{"use strict";var Ber=typeof Symbol<"u"&&Symbol,NIn=qer();Uer.exports=function(){return typeof Ber!="function"||typeof Symbol!="function"||typeof Ber("foo")!="symbol"||typeof Symbol("bar")!="symbol"?!1:NIn()}});var q8e=S((dua,Her)=>{"use strict";Her.exports=typeof Reflect<"u"&&Reflect.getPrototypeOf||null});var B8e=S((fua,Ver)=>{"use strict";var jIn=F8e();Ver.exports=jIn.getPrototypeOf||null});var Wer=S((pua,Ker)=>{"use strict";var DIn="Function.prototype.bind called on incompatible ",$In=Object.prototype.toString,LIn=Math.max,FIn="[object Function]",Jer=function(e,r){for(var n=[],o=0;o{"use strict";var BIn=Wer();Ger.exports=Function.prototype.bind||BIn});var Lwe=S((hua,Zer)=>{"use strict";Zer.exports=Function.prototype.call});var U8e=S((gua,Xer)=>{"use strict";Xer.exports=Function.prototype.apply});var Qer=S((yua,Yer)=>{"use strict";Yer.exports=typeof Reflect<"u"&&Reflect&&Reflect.apply});var ttr=S((bua,etr)=>{"use strict";var UIn=Xre(),zIn=U8e(),HIn=Lwe(),VIn=Qer();etr.exports=VIn||UIn.call(HIn,zIn)});var z8e=S((_ua,rtr)=>{"use strict";var JIn=Xre(),KIn=Q4(),WIn=Lwe(),GIn=ttr();rtr.exports=function(e){if(e.length<1||typeof e[0]!="function")throw new KIn("a function is required");return GIn(JIn,WIn,e)}});var utr=S((vua,str)=>{"use strict";var ZIn=z8e(),ntr=k8e(),itr;try{itr=[].__proto__===Array.prototype}catch(t){if(!t||typeof t!="object"||!("code"in t)||t.code!=="ERR_PROTO_ACCESS")throw t}var H8e=!!itr&&ntr&&ntr(Object.prototype,"__proto__"),atr=Object,otr=atr.getPrototypeOf;str.exports=H8e&&typeof H8e.get=="function"?ZIn([H8e.get]):typeof otr=="function"?function(e){return otr(e==null?e:atr(e))}:!1});var ptr=S((wua,ftr)=>{"use strict";var ltr=q8e(),ctr=B8e(),dtr=utr();ftr.exports=ltr?function(e){return ltr(e)}:ctr?function(e){if(!e||typeof e!="object"&&typeof e!="function")throw new TypeError("getProto: not an object");return ctr(e)}:dtr?function(e){return dtr(e)}:null});var htr=S((Sua,mtr)=>{"use strict";var XIn=Function.prototype.call,YIn=Object.prototype.hasOwnProperty,QIn=Xre();mtr.exports=QIn.call(XIn,YIn)});var qwe=S((Cua,wtr)=>{"use strict";var Pi,eNn=F8e(),tNn=ser(),rNn=ler(),nNn=der(),oNn=per(),qK=her(),kK=Q4(),iNn=yer(),aNn=_er(),sNn=wer(),uNn=Cer(),lNn=Oer(),cNn=Eer(),dNn=Mer(),fNn=Ner(),_tr=Function,V8e=function(t){try{return _tr('"use strict"; return ('+t+").constructor;")()}catch{}},Yre=k8e(),pNn=Fer(),J8e=function(){throw new kK},mNn=Yre?function(){try{return arguments.callee,J8e}catch{try{return Yre(arguments,"callee").get}catch{return J8e}}}():J8e,LK=zer()(),ph=ptr(),hNn=B8e(),gNn=q8e(),vtr=U8e(),Qre=Lwe(),FK={},yNn=typeof Uint8Array>"u"||!ph?Pi:ph(Uint8Array),e2={__proto__:null,"%AggregateError%":typeof AggregateError>"u"?Pi:AggregateError,"%Array%":Array,"%ArrayBuffer%":typeof ArrayBuffer>"u"?Pi:ArrayBuffer,"%ArrayIteratorPrototype%":LK&&ph?ph([][Symbol.iterator]()):Pi,"%AsyncFromSyncIteratorPrototype%":Pi,"%AsyncFunction%":FK,"%AsyncGenerator%":FK,"%AsyncGeneratorFunction%":FK,"%AsyncIteratorPrototype%":FK,"%Atomics%":typeof Atomics>"u"?Pi:Atomics,"%BigInt%":typeof BigInt>"u"?Pi:BigInt,"%BigInt64Array%":typeof BigInt64Array>"u"?Pi:BigInt64Array,"%BigUint64Array%":typeof BigUint64Array>"u"?Pi:BigUint64Array,"%Boolean%":Boolean,"%DataView%":typeof DataView>"u"?Pi:DataView,"%Date%":Date,"%decodeURI%":decodeURI,"%decodeURIComponent%":decodeURIComponent,"%encodeURI%":encodeURI,"%encodeURIComponent%":encodeURIComponent,"%Error%":tNn,"%eval%":eval,"%EvalError%":rNn,"%Float32Array%":typeof Float32Array>"u"?Pi:Float32Array,"%Float64Array%":typeof Float64Array>"u"?Pi:Float64Array,"%FinalizationRegistry%":typeof FinalizationRegistry>"u"?Pi:FinalizationRegistry,"%Function%":_tr,"%GeneratorFunction%":FK,"%Int8Array%":typeof Int8Array>"u"?Pi:Int8Array,"%Int16Array%":typeof Int16Array>"u"?Pi:Int16Array,"%Int32Array%":typeof Int32Array>"u"?Pi:Int32Array,"%isFinite%":isFinite,"%isNaN%":isNaN,"%IteratorPrototype%":LK&&ph?ph(ph([][Symbol.iterator]())):Pi,"%JSON%":typeof JSON=="object"?JSON:Pi,"%Map%":typeof Map>"u"?Pi:Map,"%MapIteratorPrototype%":typeof Map>"u"||!LK||!ph?Pi:ph(new Map()[Symbol.iterator]()),"%Math%":Math,"%Number%":Number,"%Object%":eNn,"%Object.getOwnPropertyDescriptor%":Yre,"%parseFloat%":parseFloat,"%parseInt%":parseInt,"%Promise%":typeof Promise>"u"?Pi:Promise,"%Proxy%":typeof Proxy>"u"?Pi:Proxy,"%RangeError%":nNn,"%ReferenceError%":oNn,"%Reflect%":typeof Reflect>"u"?Pi:Reflect,"%RegExp%":RegExp,"%Set%":typeof Set>"u"?Pi:Set,"%SetIteratorPrototype%":typeof Set>"u"||!LK||!ph?Pi:ph(new Set()[Symbol.iterator]()),"%SharedArrayBuffer%":typeof SharedArrayBuffer>"u"?Pi:SharedArrayBuffer,"%String%":String,"%StringIteratorPrototype%":LK&&ph?ph(""[Symbol.iterator]()):Pi,"%Symbol%":LK?Symbol:Pi,"%SyntaxError%":qK,"%ThrowTypeError%":mNn,"%TypedArray%":yNn,"%TypeError%":kK,"%Uint8Array%":typeof Uint8Array>"u"?Pi:Uint8Array,"%Uint8ClampedArray%":typeof Uint8ClampedArray>"u"?Pi:Uint8ClampedArray,"%Uint16Array%":typeof Uint16Array>"u"?Pi:Uint16Array,"%Uint32Array%":typeof Uint32Array>"u"?Pi:Uint32Array,"%URIError%":iNn,"%WeakMap%":typeof WeakMap>"u"?Pi:WeakMap,"%WeakRef%":typeof WeakRef>"u"?Pi:WeakRef,"%WeakSet%":typeof WeakSet>"u"?Pi:WeakSet,"%Function.prototype.call%":Qre,"%Function.prototype.apply%":vtr,"%Object.defineProperty%":pNn,"%Object.getPrototypeOf%":hNn,"%Math.abs%":aNn,"%Math.floor%":sNn,"%Math.max%":uNn,"%Math.min%":lNn,"%Math.pow%":cNn,"%Math.round%":dNn,"%Math.sign%":fNn,"%Reflect.getPrototypeOf%":gNn};if(ph)try{null.error}catch(t){gtr=ph(ph(t)),e2["%Error.prototype%"]=gtr}var gtr,bNn=function t(e){var r;if(e==="%AsyncFunction%")r=V8e("async function () {}");else if(e==="%GeneratorFunction%")r=V8e("function* () {}");else if(e==="%AsyncGeneratorFunction%")r=V8e("async function* () {}");else if(e==="%AsyncGenerator%"){var n=t("%AsyncGeneratorFunction%");n&&(r=n.prototype)}else if(e==="%AsyncIteratorPrototype%"){var o=t("%AsyncGenerator%");o&&ph&&(r=ph(o.prototype))}return e2[e]=r,r},ytr={__proto__:null,"%ArrayBufferPrototype%":["ArrayBuffer","prototype"],"%ArrayPrototype%":["Array","prototype"],"%ArrayProto_entries%":["Array","prototype","entries"],"%ArrayProto_forEach%":["Array","prototype","forEach"],"%ArrayProto_keys%":["Array","prototype","keys"],"%ArrayProto_values%":["Array","prototype","values"],"%AsyncFunctionPrototype%":["AsyncFunction","prototype"],"%AsyncGenerator%":["AsyncGeneratorFunction","prototype"],"%AsyncGeneratorPrototype%":["AsyncGeneratorFunction","prototype","prototype"],"%BooleanPrototype%":["Boolean","prototype"],"%DataViewPrototype%":["DataView","prototype"],"%DatePrototype%":["Date","prototype"],"%ErrorPrototype%":["Error","prototype"],"%EvalErrorPrototype%":["EvalError","prototype"],"%Float32ArrayPrototype%":["Float32Array","prototype"],"%Float64ArrayPrototype%":["Float64Array","prototype"],"%FunctionPrototype%":["Function","prototype"],"%Generator%":["GeneratorFunction","prototype"],"%GeneratorPrototype%":["GeneratorFunction","prototype","prototype"],"%Int8ArrayPrototype%":["Int8Array","prototype"],"%Int16ArrayPrototype%":["Int16Array","prototype"],"%Int32ArrayPrototype%":["Int32Array","prototype"],"%JSONParse%":["JSON","parse"],"%JSONStringify%":["JSON","stringify"],"%MapPrototype%":["Map","prototype"],"%NumberPrototype%":["Number","prototype"],"%ObjectPrototype%":["Object","prototype"],"%ObjProto_toString%":["Object","prototype","toString"],"%ObjProto_valueOf%":["Object","prototype","valueOf"],"%PromisePrototype%":["Promise","prototype"],"%PromiseProto_then%":["Promise","prototype","then"],"%Promise_all%":["Promise","all"],"%Promise_reject%":["Promise","reject"],"%Promise_resolve%":["Promise","resolve"],"%RangeErrorPrototype%":["RangeError","prototype"],"%ReferenceErrorPrototype%":["ReferenceError","prototype"],"%RegExpPrototype%":["RegExp","prototype"],"%SetPrototype%":["Set","prototype"],"%SharedArrayBufferPrototype%":["SharedArrayBuffer","prototype"],"%StringPrototype%":["String","prototype"],"%SymbolPrototype%":["Symbol","prototype"],"%SyntaxErrorPrototype%":["SyntaxError","prototype"],"%TypedArrayPrototype%":["TypedArray","prototype"],"%TypeErrorPrototype%":["TypeError","prototype"],"%Uint8ArrayPrototype%":["Uint8Array","prototype"],"%Uint8ClampedArrayPrototype%":["Uint8ClampedArray","prototype"],"%Uint16ArrayPrototype%":["Uint16Array","prototype"],"%Uint32ArrayPrototype%":["Uint32Array","prototype"],"%URIErrorPrototype%":["URIError","prototype"],"%WeakMapPrototype%":["WeakMap","prototype"],"%WeakSetPrototype%":["WeakSet","prototype"]},ene=Xre(),Fwe=htr(),_Nn=ene.call(Qre,Array.prototype.concat),vNn=ene.call(vtr,Array.prototype.splice),btr=ene.call(Qre,String.prototype.replace),kwe=ene.call(Qre,String.prototype.slice),wNn=ene.call(Qre,RegExp.prototype.exec),SNn=/[^%.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|%$))/g,CNn=/\\(\\)?/g,xNn=function(e){var r=kwe(e,0,1),n=kwe(e,-1);if(r==="%"&&n!=="%")throw new qK("invalid intrinsic syntax, expected closing `%`");if(n==="%"&&r!=="%")throw new qK("invalid intrinsic syntax, expected opening `%`");var o=[];return btr(e,SNn,function(i,a,s,u){o[o.length]=s?btr(u,CNn,"$1"):a||i}),o},ONn=function(e,r){var n=e,o;if(Fwe(ytr,n)&&(o=ytr[n],n="%"+o[0]+"%"),Fwe(e2,n)){var i=e2[n];if(i===FK&&(i=bNn(n)),typeof i>"u"&&!r)throw new kK("intrinsic "+e+" exists, but is not available. Please file an issue!");return{alias:o,name:n,value:i}}throw new qK("intrinsic "+e+" does not exist!")};wtr.exports=function(e,r){if(typeof e!="string"||e.length===0)throw new kK("intrinsic name must be a non-empty string");if(arguments.length>1&&typeof r!="boolean")throw new kK('"allowMissing" argument must be a boolean');if(wNn(/^%?[^%]*%?$/,e)===null)throw new qK("`%` may not be present anywhere but at the beginning and end of the intrinsic name");var n=xNn(e),o=n.length>0?n[0]:"",i=ONn("%"+o+"%",r),a=i.name,s=i.value,u=!1,l=i.alias;l&&(o=l[0],vNn(n,_Nn([0,1],l)));for(var c=1,d=!0;c=n.length){var h=Yre(s,f);d=!!h,d&&"get"in h&&!("originalValue"in h.get)?s=h.get:s=s[f]}else d=Fwe(s,f),s=s[f];d&&!u&&(e2[a]=s)}}return s}});var K8e=S((xua,xtr)=>{"use strict";var Str=qwe(),Ctr=z8e(),TNn=Ctr([Str("%String.prototype.indexOf%")]);xtr.exports=function(e,r){var n=Str(e,!!r);return typeof n=="function"&&TNn(e,".prototype.")>-1?Ctr([n]):n}});var W8e=S((Oua,Ttr)=>{"use strict";var ENn=qwe(),tne=K8e(),PNn=Zre(),MNn=Q4(),Otr=ENn("%Map%",!0),RNn=tne("Map.prototype.get",!0),ANn=tne("Map.prototype.set",!0),INn=tne("Map.prototype.has",!0),NNn=tne("Map.prototype.delete",!0),jNn=tne("Map.prototype.size",!0);Ttr.exports=!!Otr&&function(){var e,r={assert:function(n){if(!r.has(n))throw new MNn("Side channel does not contain "+PNn(n))},delete:function(n){if(e){var o=NNn(e,n);return jNn(e)===0&&(e=void 0),o}return!1},get:function(n){if(e)return RNn(e,n)},has:function(n){return e?INn(e,n):!1},set:function(n,o){e||(e=new Otr),ANn(e,n,o)}};return r}});var Ptr=S((Tua,Etr)=>{"use strict";var DNn=qwe(),Uwe=K8e(),$Nn=Zre(),Bwe=W8e(),LNn=Q4(),BK=DNn("%WeakMap%",!0),FNn=Uwe("WeakMap.prototype.get",!0),kNn=Uwe("WeakMap.prototype.set",!0),qNn=Uwe("WeakMap.prototype.has",!0),BNn=Uwe("WeakMap.prototype.delete",!0);Etr.exports=BK?function(){var e,r,n={assert:function(o){if(!n.has(o))throw new LNn("Side channel does not contain "+$Nn(o))},delete:function(o){if(BK&&o&&(typeof o=="object"||typeof o=="function")){if(e)return BNn(e,o)}else if(Bwe&&r)return r.delete(o);return!1},get:function(o){return BK&&o&&(typeof o=="object"||typeof o=="function")&&e?FNn(e,o):r&&r.get(o)},has:function(o){return BK&&o&&(typeof o=="object"||typeof o=="function")&&e?qNn(e,o):!!r&&r.has(o)},set:function(o,i){BK&&o&&(typeof o=="object"||typeof o=="function")?(e||(e=new BK),kNn(e,o,i)):Bwe&&(r||(r=Bwe()),r.set(o,i))}};return n}:Bwe});var Rtr=S((Eua,Mtr)=>{"use strict";var UNn=Q4(),zNn=Zre(),HNn=oer(),VNn=W8e(),JNn=Ptr(),KNn=JNn||VNn||HNn;Mtr.exports=function(){var e,r={assert:function(n){if(!r.has(n))throw new UNn("Side channel does not contain "+zNn(n))},delete:function(n){return!!e&&e.delete(n)},get:function(n){return e&&e.get(n)},has:function(n){return!!e&&e.has(n)},set:function(n,o){e||(e=KNn()),e.set(n,o)}};return r}});var zwe=S((Pua,Atr)=>{"use strict";var WNn=String.prototype.replace,GNn=/%20/g,G8e={RFC1738:"RFC1738",RFC3986:"RFC3986"};Atr.exports={default:G8e.RFC3986,formatters:{RFC1738:function(t){return WNn.call(t,GNn,"+")},RFC3986:function(t){return String(t)}},RFC1738:G8e.RFC1738,RFC3986:G8e.RFC3986}});var Y8e=S((Mua,Ntr)=>{"use strict";var ZNn=zwe(),Z8e=Object.prototype.hasOwnProperty,t2=Array.isArray,_T=function(){for(var t=[],e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t}(),XNn=function(e){for(;e.length>1;){var r=e.pop(),n=r.obj[r.prop];if(t2(n)){for(var o=[],i=0;i=X8e?a.slice(u,u+X8e):a,c=[],d=0;d=48&&f<=57||f>=65&&f<=90||f>=97&&f<=122||i===ZNn.RFC1738&&(f===40||f===41)){c[c.length]=l.charAt(d);continue}if(f<128){c[c.length]=_T[f];continue}if(f<2048){c[c.length]=_T[192|f>>6]+_T[128|f&63];continue}if(f<55296||f>=57344){c[c.length]=_T[224|f>>12]+_T[128|f>>6&63]+_T[128|f&63];continue}d+=1,f=65536+((f&1023)<<10|l.charCodeAt(d)&1023),c[c.length]=_T[240|f>>18]+_T[128|f>>12&63]+_T[128|f>>6&63]+_T[128|f&63]}s+=c.join("")}return s},r1n=function(e){for(var r=[{obj:{o:e},prop:"o"}],n=[],o=0;o{"use strict";var Dtr=Rtr(),Hwe=Y8e(),rne=zwe(),s1n=Object.prototype.hasOwnProperty,$tr={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,r){return e+"["+r+"]"},repeat:function(e){return e}},vT=Array.isArray,u1n=Array.prototype.push,Ltr=function(t,e){u1n.apply(t,vT(e)?e:[e])},l1n=Date.prototype.toISOString,jtr=rne.default,Em={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,commaRoundTrip:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Hwe.encode,encodeValuesOnly:!1,filter:void 0,format:jtr,formatter:rne.formatters[jtr],indices:!1,serializeDate:function(e){return l1n.call(e)},skipNulls:!1,strictNullHandling:!1},c1n=function(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e=="symbol"||typeof e=="bigint"},Q8e={},d1n=function t(e,r,n,o,i,a,s,u,l,c,d,f,p,m,h,g,y,b){for(var _=e,w=b,x=0,O=!1;(w=w.get(Q8e))!==void 0&&!O;){var E=w.get(e);if(x+=1,typeof E<"u"){if(E===x)throw new RangeError("Cyclic object value");O=!0}typeof w.get(Q8e)>"u"&&(x=0)}if(typeof c=="function"?_=c(r,_):_ instanceof Date?_=p(_):n==="comma"&&vT(_)&&(_=Hwe.maybeMap(_,function(ee){return ee instanceof Date?p(ee):ee})),_===null){if(a)return l&&!g?l(r,Em.encoder,y,"key",m):r;_=""}if(c1n(_)||Hwe.isBuffer(_)){if(l){var T=g?r:l(r,Em.encoder,y,"key",m);return[h(T)+"="+h(l(_,Em.encoder,y,"value",m))]}return[h(r)+"="+h(String(_))]}var R=[];if(typeof _>"u")return R;var I;if(n==="comma"&&vT(_))g&&l&&(_=Hwe.maybeMap(_,l)),I=[{value:_.length>0?_.join(",")||null:void 0}];else if(vT(c))I=c;else{var j=Object.keys(_);I=d?j.sort(d):j}var F=u?String(r).replace(/\./g,"%2E"):String(r),B=o&&vT(_)&&_.length===1?F+"[]":F;if(i&&vT(_)&&_.length===0)return B+"[]";for(var U=0;U"u"?e.encodeDotInKeys===!0?!0:Em.allowDots:!!e.allowDots;return{addQueryPrefix:typeof e.addQueryPrefix=="boolean"?e.addQueryPrefix:Em.addQueryPrefix,allowDots:s,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:Em.allowEmptyArrays,arrayFormat:a,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Em.charsetSentinel,commaRoundTrip:!!e.commaRoundTrip,delimiter:typeof e.delimiter>"u"?Em.delimiter:e.delimiter,encode:typeof e.encode=="boolean"?e.encode:Em.encode,encodeDotInKeys:typeof e.encodeDotInKeys=="boolean"?e.encodeDotInKeys:Em.encodeDotInKeys,encoder:typeof e.encoder=="function"?e.encoder:Em.encoder,encodeValuesOnly:typeof e.encodeValuesOnly=="boolean"?e.encodeValuesOnly:Em.encodeValuesOnly,filter:i,format:n,formatter:o,serializeDate:typeof e.serializeDate=="function"?e.serializeDate:Em.serializeDate,skipNulls:typeof e.skipNulls=="boolean"?e.skipNulls:Em.skipNulls,sort:typeof e.sort=="function"?e.sort:null,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Em.strictNullHandling}};Ftr.exports=function(t,e){var r=t,n=f1n(e),o,i;typeof n.filter=="function"?(i=n.filter,r=i("",r)):vT(n.filter)&&(i=n.filter,o=i);var a=[];if(typeof r!="object"||r===null)return"";var s=$tr[n.arrayFormat],u=s==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);for(var l=Dtr(),c=0;c0?m+p:""}});var ztr=S((Aua,Utr)=>{"use strict";var r2=Y8e(),eGe=Object.prototype.hasOwnProperty,qtr=Array.isArray,Tc={allowDots:!1,allowEmptyArrays:!1,allowPrototypes:!1,allowSparse:!1,arrayLimit:20,charset:"utf-8",charsetSentinel:!1,comma:!1,decodeDotInKeys:!1,decoder:r2.decode,delimiter:"&",depth:5,duplicates:"combine",ignoreQueryPrefix:!1,interpretNumericEntities:!1,parameterLimit:1e3,parseArrays:!0,plainObjects:!1,strictDepth:!1,strictNullHandling:!1,throwOnLimitExceeded:!1},p1n=function(t){return t.replace(/&#(\d+);/g,function(e,r){return String.fromCharCode(parseInt(r,10))})},Btr=function(t,e,r){if(t&&typeof t=="string"&&e.comma&&t.indexOf(",")>-1)return t.split(",");if(e.throwOnLimitExceeded&&r>=e.arrayLimit)throw new RangeError("Array limit exceeded. Only "+e.arrayLimit+" element"+(e.arrayLimit===1?"":"s")+" allowed in an array.");return t},m1n="utf8=%26%2310003%3B",h1n="utf8=%E2%9C%93",g1n=function(e,r){var n={__proto__:null},o=r.ignoreQueryPrefix?e.replace(/^\?/,""):e;o=o.replace(/%5B/gi,"[").replace(/%5D/gi,"]");var i=r.parameterLimit===1/0?void 0:r.parameterLimit,a=o.split(r.delimiter,r.throwOnLimitExceeded?i+1:i);if(r.throwOnLimitExceeded&&a.length>i)throw new RangeError("Parameter limit exceeded. Only "+i+" parameter"+(i===1?"":"s")+" allowed.");var s=-1,u,l=r.charset;if(r.charsetSentinel)for(u=0;u-1&&(m=qtr(m)?[m]:m);var h=eGe.call(n,p);h&&r.duplicates==="combine"?n[p]=r2.combine(n[p],m):(!h||r.duplicates==="last")&&(n[p]=m)}return n},y1n=function(t,e,r,n){var o=0;if(t.length>0&&t[t.length-1]==="[]"){var i=t.slice(0,-1).join("");o=Array.isArray(e)&&e[i]?e[i].length:0}for(var a=n?e:Btr(e,r,o),s=t.length-1;s>=0;--s){var u,l=t[s];if(l==="[]"&&r.parseArrays)u=r.allowEmptyArrays&&(a===""||r.strictNullHandling&&a===null)?[]:r2.combine([],a);else{u=r.plainObjects?{__proto__:null}:{};var c=l.charAt(0)==="["&&l.charAt(l.length-1)==="]"?l.slice(1,-1):l,d=r.decodeDotInKeys?c.replace(/%2E/g,"."):c,f=parseInt(d,10);!r.parseArrays&&d===""?u={0:a}:!isNaN(f)&&l!==d&&String(f)===d&&f>=0&&r.parseArrays&&f<=r.arrayLimit?(u=[],u[f]=a):d!=="__proto__"&&(u[d]=a)}a=u}return a},b1n=function(e,r,n,o){if(e){var i=n.allowDots?e.replace(/\.([^.[]+)/g,"[$1]"):e,a=/(\[[^[\]]*])/,s=/(\[[^[\]]*])/g,u=n.depth>0&&a.exec(i),l=u?i.slice(0,u.index):i,c=[];if(l){if(!n.plainObjects&&eGe.call(Object.prototype,l)&&!n.allowPrototypes)return;c.push(l)}for(var d=0;n.depth>0&&(u=s.exec(i))!==null&&d"u"?Tc.charset:e.charset,n=typeof e.duplicates>"u"?Tc.duplicates:e.duplicates;if(n!=="combine"&&n!=="first"&&n!=="last")throw new TypeError("The duplicates option must be either combine, first, or last");var o=typeof e.allowDots>"u"?e.decodeDotInKeys===!0?!0:Tc.allowDots:!!e.allowDots;return{allowDots:o,allowEmptyArrays:typeof e.allowEmptyArrays=="boolean"?!!e.allowEmptyArrays:Tc.allowEmptyArrays,allowPrototypes:typeof e.allowPrototypes=="boolean"?e.allowPrototypes:Tc.allowPrototypes,allowSparse:typeof e.allowSparse=="boolean"?e.allowSparse:Tc.allowSparse,arrayLimit:typeof e.arrayLimit=="number"?e.arrayLimit:Tc.arrayLimit,charset:r,charsetSentinel:typeof e.charsetSentinel=="boolean"?e.charsetSentinel:Tc.charsetSentinel,comma:typeof e.comma=="boolean"?e.comma:Tc.comma,decodeDotInKeys:typeof e.decodeDotInKeys=="boolean"?e.decodeDotInKeys:Tc.decodeDotInKeys,decoder:typeof e.decoder=="function"?e.decoder:Tc.decoder,delimiter:typeof e.delimiter=="string"||r2.isRegExp(e.delimiter)?e.delimiter:Tc.delimiter,depth:typeof e.depth=="number"||e.depth===!1?+e.depth:Tc.depth,duplicates:n,ignoreQueryPrefix:e.ignoreQueryPrefix===!0,interpretNumericEntities:typeof e.interpretNumericEntities=="boolean"?e.interpretNumericEntities:Tc.interpretNumericEntities,parameterLimit:typeof e.parameterLimit=="number"?e.parameterLimit:Tc.parameterLimit,parseArrays:e.parseArrays!==!1,plainObjects:typeof e.plainObjects=="boolean"?e.plainObjects:Tc.plainObjects,strictDepth:typeof e.strictDepth=="boolean"?!!e.strictDepth:Tc.strictDepth,strictNullHandling:typeof e.strictNullHandling=="boolean"?e.strictNullHandling:Tc.strictNullHandling,throwOnLimitExceeded:typeof e.throwOnLimitExceeded=="boolean"?e.throwOnLimitExceeded:!1}};Utr.exports=function(t,e){var r=_1n(e);if(t===""||t===null||typeof t>"u")return r.plainObjects?{__proto__:null}:{};for(var n=typeof t=="string"?g1n(t,r):t,o=r.plainObjects?{__proto__:null}:{},i=Object.keys(n),a=0;a{"use strict";var v1n=ktr(),w1n=ztr(),S1n=zwe();Htr.exports={formats:S1n,parse:w1n,stringify:v1n}});var Vtr=S(nne=>{"use strict";var C1n=nne&&nne.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(nne,"__esModule",{value:!0});nne.createRequestUrl=O1n;var x1n=C1n(tGe());function O1n(t,e){return Object.keys(e??{}).length>0?`${t}?${x1n.default.stringify(e,{arrayFormat:"repeat"})}`:t}});var Jtr=S(Vwe=>{"use strict";Object.defineProperty(Vwe,"__esModule",{value:!0});Vwe.RUNTIME=void 0;Vwe.RUNTIME=T1n();function T1n(){var t,e,r,n,o;return typeof window<"u"&&typeof window.document<"u"?{type:"browser",version:window.navigator.userAgent}:typeof globalThis<"u"&&((t=globalThis?.navigator)===null||t===void 0?void 0:t.userAgent)==="Cloudflare-Workers"?{type:"workerd"}:typeof EdgeRuntime=="string"?{type:"edge-runtime"}:typeof self=="object"&&typeof self?.importScripts=="function"&&(((e=self.constructor)===null||e===void 0?void 0:e.name)==="DedicatedWorkerGlobalScope"||((r=self.constructor)===null||r===void 0?void 0:r.name)==="ServiceWorkerGlobalScope"||((n=self.constructor)===null||n===void 0?void 0:n.name)==="SharedWorkerGlobalScope")?{type:"web-worker"}:typeof Deno<"u"&&typeof Deno.version<"u"&&typeof Deno.version.deno<"u"?{type:"deno",version:Deno.version.deno}:typeof Bun<"u"&&typeof Bun.version<"u"?{type:"bun",version:Bun.version}:typeof process<"u"&&"version"in process&&!!process.version&&"versions"in process&&!!(!((o=process.versions)===null||o===void 0)&&o.node)?{type:"node",version:process.versions.node,parsedVersion:Number(process.versions.node.split(".")[0])}:typeof navigator<"u"&&navigator?.product==="ReactNative"?{type:"react-native"}:{type:"unknown"}}});var UK=S(Jwe=>{"use strict";Object.defineProperty(Jwe,"__esModule",{value:!0});Jwe.RUNTIME=void 0;var E1n=Jtr();Object.defineProperty(Jwe,"RUNTIME",{enumerable:!0,get:function(){return E1n.RUNTIME}})});var rGe=S((zK,Ktr)=>{"use strict";var P1n=function(){if(typeof self<"u")return self;if(typeof window<"u"||typeof window<"u")return window;throw new Error("unable to locate global object")},n2=P1n();Ktr.exports=zK=n2.fetch;n2.fetch&&(zK.default=n2.fetch.bind(n2));zK.Headers=n2.Headers;zK.Request=n2.Request;zK.Response=n2.Response});var Gtr=S(bC=>{"use strict";var M1n=bC&&bC.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),R1n=bC&&bC.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Wtr=bC&&bC.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=18?fetch:Kwe.RUNTIME.type==="node"?(yield Promise.resolve().then(()=>Wtr(rGe()))).default:typeof fetch=="function"?fetch:(yield Promise.resolve().then(()=>Wtr(rGe()))).default})}});var Ztr=S(one=>{"use strict";var N1n=one&&one.__awaiter||function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?i(c.value):o(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(one,"__esModule",{value:!0});one.getRequestBody=D1n;var j1n=fbe();function D1n(t){return N1n(this,arguments,void 0,function*({body:e,type:r}){return r.includes("json")?(0,j1n.toJson)(e):e})}});var Xtr=S(HK=>{"use strict";var _C=HK&&HK.__awaiter||function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?i(c.value):o(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(HK,"__esModule",{value:!0});HK.Node18UniversalStreamWrapper=void 0;var nGe=class t{constructor(e){this.readableStream=e,this.reader=this.readableStream.getReader(),this.events={data:[],end:[],error:[],readable:[],close:[],pause:[],resume:[]},this.paused=!1,this.resumeCallback=null,this.encoding=null}on(e,r){var n;(n=this.events[e])===null||n===void 0||n.push(r)}off(e,r){var n;this.events[e]=(n=this.events[e])===null||n===void 0?void 0:n.filter(o=>o!==r)}pipe(e){return this.on("data",r=>_C(this,void 0,void 0,function*(){if(e instanceof t)e._write(r);else if(e instanceof WritableStream){let n=e.getWriter();n.write(r).then(()=>n.releaseLock())}else e.write(r)})),this.on("end",()=>_C(this,void 0,void 0,function*(){e instanceof t?e._end():e instanceof WritableStream?e.getWriter().close():e.end()})),this.on("error",r=>_C(this,void 0,void 0,function*(){e instanceof t?e._error(r):e instanceof WritableStream?e.getWriter().abort(r):e.destroy(r)})),this._startReading(),e}pipeTo(e){return this.pipe(e)}unpipe(e){this.off("data",r=>_C(this,void 0,void 0,function*(){if(e instanceof t)e._write(r);else if(e instanceof WritableStream){let n=e.getWriter();n.write(r).then(()=>n.releaseLock())}else e.write(r)})),this.off("end",()=>_C(this,void 0,void 0,function*(){e instanceof t?e._end():e instanceof WritableStream?e.getWriter().close():e.end()})),this.off("error",r=>_C(this,void 0,void 0,function*(){e instanceof t?e._error(r):e instanceof WritableStream?e.getWriter().abort(r):e.destroy(r)}))}destroy(e){this.reader.cancel(e).then(()=>{this._emit("close")}).catch(r=>{this._emit("error",r)})}pause(){this.paused=!0,this._emit("pause")}resume(){this.paused&&(this.paused=!1,this._emit("resume"),this.resumeCallback&&(this.resumeCallback(),this.resumeCallback=null))}get isPaused(){return this.paused}read(){return _C(this,void 0,void 0,function*(){this.paused&&(yield new Promise(n=>{this.resumeCallback=n}));let{done:e,value:r}=yield this.reader.read();if(!e)return r})}setEncoding(e){this.encoding=e}text(){return _C(this,void 0,void 0,function*(){let e=[];for(;;){let{done:n,value:o}=yield this.reader.read();if(n)break;o&&e.push(o)}return new TextDecoder(this.encoding||"utf-8").decode(yield new Blob(e).arrayBuffer())})}json(){return _C(this,void 0,void 0,function*(){let e=yield this.text();return JSON.parse(e)})}_write(e){this._emit("data",e)}_end(){this._emit("end")}_error(e){this._emit("error",e)}_emit(e,r){if(this.events[e])for(let n of this.events[e]||[])n(r)}_startReading(){return _C(this,void 0,void 0,function*(){try{for(this._emit("readable");;){this.paused&&(yield new Promise(n=>{this.resumeCallback=n}));let{done:e,value:r}=yield this.reader.read();if(e){this._emit("end"),this._emit("close");break}r&&this._emit("data",r)}}catch(e){this._emit("error",e)}})}[Symbol.asyncIterator](){return{next:()=>_C(this,void 0,void 0,function*(){this.paused&&(yield new Promise(n=>{this.resumeCallback=n}));let{done:e,value:r}=yield this.reader.read();return e?{done:!0,value:void 0}:{done:!1,value:r}}),[Symbol.asyncIterator](){return this}}}};HK.Node18UniversalStreamWrapper=nGe});var Ytr=S(VK=>{"use strict";var ine=VK&&VK.__awaiter||function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?i(c.value):o(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(VK,"__esModule",{value:!0});VK.UndiciStreamWrapper=void 0;var oGe=class t{constructor(e){this.readableStream=e,this.reader=this.readableStream.getReader(),this.events={data:[],end:[],error:[],readable:[],close:[],pause:[],resume:[]},this.paused=!1,this.resumeCallback=null,this.encoding=null}on(e,r){var n;(n=this.events[e])===null||n===void 0||n.push(r)}off(e,r){var n;this.events[e]=(n=this.events[e])===null||n===void 0?void 0:n.filter(o=>o!==r)}pipe(e){return this.on("data",r=>{if(e instanceof t)e._write(r);else{let n=e.getWriter();n.write(r).then(()=>n.releaseLock())}}),this.on("end",()=>{e instanceof t?e._end():e.getWriter().close()}),this.on("error",r=>{e instanceof t?e._error(r):e.getWriter().abort(r)}),this._startReading(),e}pipeTo(e){return this.pipe(e)}unpipe(e){this.off("data",r=>{if(e instanceof t)e._write(r);else{let n=e.getWriter();n.write(r).then(()=>n.releaseLock())}}),this.off("end",()=>{e instanceof t?e._end():e.getWriter().close()}),this.off("error",r=>{e instanceof t?e._error(r):e.getWriter().abort(r)})}destroy(e){this.reader.cancel(e).then(()=>{this._emit("close")}).catch(r=>{this._emit("error",r)})}pause(){this.paused=!0,this._emit("pause")}resume(){this.paused&&(this.paused=!1,this._emit("resume"),this.resumeCallback&&(this.resumeCallback(),this.resumeCallback=null))}get isPaused(){return this.paused}read(){return ine(this,void 0,void 0,function*(){this.paused&&(yield new Promise(n=>{this.resumeCallback=n}));let{done:e,value:r}=yield this.reader.read();if(!e)return r})}setEncoding(e){this.encoding=e}text(){return ine(this,void 0,void 0,function*(){let e=[];for(;;){let{done:n,value:o}=yield this.reader.read();if(n)break;o&&e.push(o)}return new TextDecoder(this.encoding||"utf-8").decode(yield new Blob(e).arrayBuffer())})}json(){return ine(this,void 0,void 0,function*(){let e=yield this.text();return JSON.parse(e)})}_write(e){this._emit("data",e)}_end(){this._emit("end")}_error(e){this._emit("error",e)}_emit(e,r){if(this.events[e])for(let n of this.events[e]||[])n(r)}_startReading(){return ine(this,void 0,void 0,function*(){try{for(this._emit("readable");;){this.paused&&(yield new Promise(n=>{this.resumeCallback=n}));let{done:e,value:r}=yield this.reader.read();if(e){this._emit("end"),this._emit("close");break}r&&this._emit("data",r)}}catch(e){this._emit("error",e)}})}[Symbol.asyncIterator](){return{next:()=>ine(this,void 0,void 0,function*(){this.paused&&(yield new Promise(n=>{this.resumeCallback=n}));let{done:e,value:r}=yield this.reader.read();return e?{done:!0,value:void 0}:{done:!1,value:r}}),[Symbol.asyncIterator](){return this}}}};VK.UndiciStreamWrapper=oGe});var Qtr=S(DF=>{"use strict";var Wwe=DF&&DF.__awaiter||function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?i(c.value):o(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})},$1n=DF&&DF.__asyncValues||function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(a){return new Promise(function(s,u){a=t[i](a),o(s,u,a.done,a.value)})}}function o(i,a,s,u){Promise.resolve(u).then(function(l){i({value:l,done:s})},a)}};Object.defineProperty(DF,"__esModule",{value:!0});DF.NodePre18StreamWrapper=void 0;var iGe=class{constructor(e){this.readableStream=e}on(e,r){this.readableStream.on(e,r)}off(e,r){this.readableStream.off(e,r)}pipe(e){return this.readableStream.pipe(e),e}pipeTo(e){return this.pipe(e)}unpipe(e){e?this.readableStream.unpipe(e):this.readableStream.unpipe()}destroy(e){this.readableStream.destroy(e)}pause(){this.readableStream.pause()}resume(){this.readableStream.resume()}get isPaused(){return this.readableStream.isPaused()}read(){return Wwe(this,void 0,void 0,function*(){return new Promise((e,r)=>{let n=this.readableStream.read();n?e(n):(this.readableStream.once("readable",()=>{let o=this.readableStream.read();e(o)}),this.readableStream.once("error",r))})})}setEncoding(e){this.readableStream.setEncoding(e),this.encoding=e}text(){return Wwe(this,void 0,void 0,function*(){var e,r,n,o;let i=[],a=new TextEncoder;this.readableStream.setEncoding(this.encoding||"utf-8");try{for(var s=!0,u=$1n(this.readableStream),l;l=yield u.next(),e=l.done,!e;s=!0){o=l.value,s=!1;let d=o;i.push(a.encode(d))}}catch(d){r={error:d}}finally{try{!s&&!e&&(n=u.return)&&(yield n.call(u))}finally{if(r)throw r.error}}return new TextDecoder(this.encoding||"utf-8").decode(Buffer.concat(i))})}json(){return Wwe(this,void 0,void 0,function*(){let e=yield this.text();return JSON.parse(e)})}[Symbol.asyncIterator](){let r=this.readableStream[Symbol.asyncIterator]();return{next(){return Wwe(this,void 0,void 0,function*(){let{value:n,done:o}=yield r.next();return{value:n,done:o}})},[Symbol.asyncIterator](){return this}}}};DF.NodePre18StreamWrapper=iGe});var err=S(vC=>{"use strict";var L1n=vC&&vC.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),F1n=vC&&vC.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),aGe=vC&&vC.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=18?new(yield Promise.resolve().then(()=>aGe(Xtr()))).Node18UniversalStreamWrapper(t):Gwe.RUNTIME.type!=="node"&&typeof fetch=="function"?new(yield Promise.resolve().then(()=>aGe(Ytr()))).UndiciStreamWrapper(t):new(yield Promise.resolve().then(()=>aGe(Qtr()))).NodePre18StreamWrapper(t)})}});var trr=S(ane=>{"use strict";var B1n=ane&&ane.__awaiter||function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?i(c.value):o(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(ane,"__esModule",{value:!0});ane.getResponseBody=z1n;var U1n=err();function z1n(t,e){return B1n(this,void 0,void 0,function*(){if(t.body!=null&&e==="blob")return yield t.blob();if(t.body!=null&&e==="arrayBuffer")return yield t.arrayBuffer();if(t.body!=null&&e==="sse")return t.body;if(t.body!=null&&e==="streaming")return(0,U1n.chooseStreamWrapper)(t.body);if(t.body!=null&&e==="text")return yield t.text();{let r=yield t.text();if(r.length>0)try{return JSON.parse(r)}catch{return{ok:!1,error:{reason:"non-json",statusCode:t.status,rawBody:r}}}else return}})}});var rrr=S(Zwe=>{"use strict";Object.defineProperty(Zwe,"__esModule",{value:!0});Zwe.getTimeoutSignal=V1n;Zwe.anySignal=J1n;var H1n="timeout";function V1n(t){let e=new AbortController,r=setTimeout(()=>e.abort(H1n),t);return{signal:e.signal,abortId:r}}function J1n(...t){let e=t.length===1&&Array.isArray(t[0])?t[0]:t,r=new AbortController;for(let n of e){if(n.aborted){r.abort(n?.reason);break}n.addEventListener("abort",()=>r.abort(n?.reason),{signal:r.signal})}return r.signal}});var orr=S(JK=>{"use strict";var K1n=JK&&JK.__awaiter||function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?i(c.value):o(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(JK,"__esModule",{value:!0});JK.makeRequest=void 0;var nrr=rrr(),W1n=(t,e,r,n,o,i,a,s,u)=>K1n(void 0,void 0,void 0,function*(){let l=[],c;if(i!=null){let{signal:p,abortId:m}=(0,nrr.getTimeoutSignal)(i);c=m,l.push(p)}a!=null&&l.push(a);let d=(0,nrr.anySignal)(l),f=yield t(e,{method:r,headers:n,body:o,signal:d,credentials:s?"include":void 0,duplex:u});return c!=null&&clearTimeout(c),f});JK.makeRequest=W1n});var irr=S(sne=>{"use strict";var G1n=sne&&sne.__awaiter||function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?i(c.value):o(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(sne,"__esModule",{value:!0});sne.requestWithRetries=tjn;var Z1n=1e3,X1n=6e4,Y1n=2,Q1n=.2;function ejn(t){let e=1+(Math.random()*2-1)*Q1n;return t*e}function tjn(t){return G1n(this,arguments,void 0,function*(e,r=Y1n){let n=yield e();for(let o=0;o=500);++o){let i=Math.min(Z1n*Math.pow(2,o),X1n),a=ejn(i);yield new Promise(s=>setTimeout(s,a)),n=yield e()}return n})}});var urr=S(o2=>{"use strict";var arr=o2&&o2.__awaiter||function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?i(c.value):o(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(o2,"__esModule",{value:!0});o2.fetcher=void 0;o2.fetcherImpl=srr;var rjn=fbe(),KK=O8e(),njn=Vtr(),ojn=Gtr(),ijn=Ztr(),ajn=trr(),sjn=orr(),ujn=irr();function srr(t){return arr(this,void 0,void 0,function*(){let e={};if(t.body!==void 0&&t.contentType!=null&&(e["Content-Type"]=t.contentType),t.headers!=null)for(let[i,a]of Object.entries(t.headers))a!=null&&(e[i]=a);let r=(0,njn.createRequestUrl)(t.url,t.queryParameters),n=yield(0,ijn.getRequestBody)({body:t.body,type:t.requestType==="json"?"json":"other"}),o=yield(0,ojn.getFetchFn)();try{let i=yield(0,ujn.requestWithRetries)(()=>arr(this,void 0,void 0,function*(){return(0,sjn.makeRequest)(o,r,t.method,e,n,t.timeoutMs,t.abortSignal,t.withCredentials,t.duplex)}),t.maxRetries),a=yield(0,ajn.getResponseBody)(i,t.responseType);return i.status>=200&&i.status<400?{ok:!0,body:a,headers:i.headers,rawResponse:(0,KK.toRawResponse)(i)}:{ok:!1,error:{reason:"status-code",statusCode:i.status,body:a},rawResponse:(0,KK.toRawResponse)(i)}}catch(i){return t.abortSignal!=null&&t.abortSignal.aborted?{ok:!1,error:{reason:"unknown",errorMessage:"The user aborted a request"},rawResponse:KK.abortRawResponse}:i instanceof Error&&i.name==="AbortError"?{ok:!1,error:{reason:"timeout"},rawResponse:KK.abortRawResponse}:i instanceof Error?{ok:!1,error:{reason:"unknown",errorMessage:i.message},rawResponse:KK.unknownRawResponse}:{ok:!1,error:{reason:"unknown",errorMessage:(0,rjn.toJson)(i)},rawResponse:KK.unknownRawResponse}}})}o2.fetcher=srr});var lrr=S(sGe=>{"use strict";Object.defineProperty(sGe,"__esModule",{value:!0});sGe.getHeader=ljn;function ljn(t,e){for(let[r,n]of Object.entries(t))if(r.toLowerCase()===e.toLowerCase())return n}});var crr=S(WK=>{"use strict";var cjn=WK&&WK.__awaiter||function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?i(c.value):o(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(WK,"__esModule",{value:!0});WK.Supplier=void 0;WK.Supplier={get:t=>cjn(void 0,void 0,void 0,function*(){return typeof t=="function"?t():t})}});var drr=S(GK=>{"use strict";var djn=GK&&GK.__awaiter||function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?i(c.value):o(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})};Object.defineProperty(GK,"__esModule",{value:!0});GK.HttpResponsePromise=void 0;var uGe=class t extends Promise{constructor(e){super(r=>{r(void 0)}),this.innerPromise=e}static fromFunction(e,...r){return new t(e(...r))}static interceptFunction(e){return(...r)=>t.fromPromise(e(...r))}static fromPromise(e){return new t(e)}static fromExecutor(e){let r=new Promise(e);return new t(r)}static fromResult(e){let r=Promise.resolve(e);return new t(r)}unwrap(){return this.unwrappedPromise||(this.unwrappedPromise=this.innerPromise.then(({data:e})=>e)),this.unwrappedPromise}then(e,r){return this.unwrap().then(e,r)}catch(e){return this.unwrap().catch(e)}finally(e){return this.unwrap().finally(e)}withRawResponse(){return djn(this,void 0,void 0,function*(){return yield this.innerPromise})}};GK.HttpResponsePromise=uGe});var frr=S(wy=>{"use strict";Object.defineProperty(wy,"__esModule",{value:!0});wy.HttpResponsePromise=wy.unknownRawResponse=wy.toRawResponse=wy.abortRawResponse=wy.Supplier=wy.getHeader=wy.fetcher=void 0;var fjn=urr();Object.defineProperty(wy,"fetcher",{enumerable:!0,get:function(){return fjn.fetcher}});var pjn=lrr();Object.defineProperty(wy,"getHeader",{enumerable:!0,get:function(){return pjn.getHeader}});var mjn=crr();Object.defineProperty(wy,"Supplier",{enumerable:!0,get:function(){return mjn.Supplier}});var lGe=O8e();Object.defineProperty(wy,"abortRawResponse",{enumerable:!0,get:function(){return lGe.abortRawResponse}});Object.defineProperty(wy,"toRawResponse",{enumerable:!0,get:function(){return lGe.toRawResponse}});Object.defineProperty(wy,"unknownRawResponse",{enumerable:!0,get:function(){return lGe.unknownRawResponse}});var hjn=drr();Object.defineProperty(wy,"HttpResponsePromise",{enumerable:!0,get:function(){return hjn.HttpResponsePromise}})});var prr=S((cGe,dGe)=>{(function(t,e){typeof cGe=="object"&&typeof dGe<"u"?dGe.exports=e():typeof define=="function"&&define.amd?define(e):function(){var r=t.Base64,n=e();n.noConflict=function(){return t.Base64=r,n},t.Meteor&&(Base64=n),t.Base64=n}()})(typeof self<"u"?self:typeof window<"u"||typeof window<"u"?window:cGe,function(){"use strict";var t="3.7.7",e=t,r=typeof Buffer=="function",n=typeof TextDecoder=="function"?new TextDecoder:void 0,o=typeof TextEncoder=="function"?new TextEncoder:void 0,i="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",a=Array.prototype.slice.call(i),s=function($){var q={};return $.forEach(function(Y,D){return q[Y]=D}),q}(a),u=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,l=String.fromCharCode.bind(String),c=typeof Uint8Array.from=="function"?Uint8Array.from.bind(Uint8Array):function($){return new Uint8Array(Array.prototype.slice.call($,0))},d=function($){return $.replace(/=/g,"").replace(/[+\/]/g,function(q){return q=="+"?"-":"_"})},f=function($){return $.replace(/[^A-Za-z0-9\+\/]/g,"")},p=function($){for(var q,Y,D,A,V="",K=$.length%3,se=0;se<$.length;){if((Y=$.charCodeAt(se++))>255||(D=$.charCodeAt(se++))>255||(A=$.charCodeAt(se++))>255)throw new TypeError("invalid character found");q=Y<<16|D<<8|A,V+=a[q>>18&63]+a[q>>12&63]+a[q>>6&63]+a[q&63]}return K?V.slice(0,K-3)+"===".substring(K):V},m=typeof btoa=="function"?function($){return btoa($)}:r?function($){return Buffer.from($,"binary").toString("base64")}:p,h=r?function($){return Buffer.from($).toString("base64")}:function($){for(var q=4096,Y=[],D=0,A=$.length;D>>6)+l(128|q&63):l(224|q>>>12&15)+l(128|q>>>6&63)+l(128|q&63)}else{var q=65536+($.charCodeAt(0)-55296)*1024+($.charCodeAt(1)-56320);return l(240|q>>>18&7)+l(128|q>>>12&63)+l(128|q>>>6&63)+l(128|q&63)}},b=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,_=function($){return $.replace(b,y)},w=r?function($){return Buffer.from($,"utf8").toString("base64")}:o?function($){return h(o.encode($))}:function($){return m(_($))},x=function($,q){return q===void 0&&(q=!1),q?d(w($)):w($)},O=function($){return x($,!0)},E=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,T=function($){switch($.length){case 4:var q=(7&$.charCodeAt(0))<<18|(63&$.charCodeAt(1))<<12|(63&$.charCodeAt(2))<<6|63&$.charCodeAt(3),Y=q-65536;return l((Y>>>10)+55296)+l((Y&1023)+56320);case 3:return l((15&$.charCodeAt(0))<<12|(63&$.charCodeAt(1))<<6|63&$.charCodeAt(2));default:return l((31&$.charCodeAt(0))<<6|63&$.charCodeAt(1))}},R=function($){return $.replace(E,T)},I=function($){if($=$.replace(/\s+/g,""),!u.test($))throw new TypeError("malformed base64.");$+="==".slice(2-($.length&3));for(var q,Y="",D,A,V=0;V<$.length;)q=s[$.charAt(V++)]<<18|s[$.charAt(V++)]<<12|(D=s[$.charAt(V++)])<<6|(A=s[$.charAt(V++)]),Y+=D===64?l(q>>16&255):A===64?l(q>>16&255,q>>8&255):l(q>>16&255,q>>8&255,q&255);return Y},j=typeof atob=="function"?function($){return atob(f($))}:r?function($){return Buffer.from($,"base64").toString("binary")}:I,F=r?function($){return c(Buffer.from($,"base64"))}:function($){return c(j($).split("").map(function(q){return q.charCodeAt(0)}))},B=function($){return F(J($))},U=r?function($){return Buffer.from($,"base64").toString("utf8")}:n?function($){return n.decode(F($))}:function($){return R(j($))},J=function($){return f($.replace(/[-_]/g,function(q){return q=="-"?"+":"/"}))},G=function($){return U(J($))},oe=function($){if(typeof $!="string")return!1;var q=$.replace(/\s+/g,"").replace(/={0,2}$/,"");return!/[^\s0-9a-zA-Z\+/]/.test(q)||!/[^\s0-9a-zA-Z\-_]/.test(q)},ne=function($){return{value:$,enumerable:!1,writable:!0,configurable:!0}},z=function(){var $=function(q,Y){return Object.defineProperty(String.prototype,q,ne(Y))};$("fromBase64",function(){return G(this)}),$("toBase64",function(q){return x(this,q)}),$("toBase64URI",function(){return x(this,!0)}),$("toBase64URL",function(){return x(this,!0)}),$("toUint8Array",function(){return B(this)})},ee=function(){var $=function(q,Y){return Object.defineProperty(Uint8Array.prototype,q,ne(Y))};$("toBase64",function(q){return g(this,q)}),$("toBase64URI",function(){return g(this,!0)}),$("toBase64URL",function(){return g(this,!0)})},ie=function(){z(),ee()},Z={version:t,VERSION:e,atob:j,atobPolyfill:I,btoa:m,btoaPolyfill:p,fromBase64:G,toBase64:x,encode:x,encodeURI:O,encodeURL:O,utob:_,btou:R,decode:G,isValid:oe,fromUint8Array:g,toUint8Array:B,extendString:z,extendUint8Array:ee,extendBuiltins:ie};return Z.Base64={},Object.keys(Z).forEach(function($){return Z.Base64[$]=Z[$]}),Z})});var hrr=S(Xwe=>{"use strict";Object.defineProperty(Xwe,"__esModule",{value:!0});Xwe.BasicAuth=void 0;var mrr=prr(),gjn=/^Basic /i;Xwe.BasicAuth={toAuthorizationHeader:t=>t==null?void 0:`Basic ${mrr.Base64.encode(`${t.username}:${t.password}`)}`,fromAuthorizationHeader:t=>{let e=t.replace(gjn,""),r=mrr.Base64.decode(e),[n,o]=r.split(":",2);if(n==null||o==null)throw new Error("Invalid basic auth");return{username:n,password:o}}}});var grr=S(Ywe=>{"use strict";Object.defineProperty(Ywe,"__esModule",{value:!0});Ywe.BearerToken=void 0;var yjn=/^Bearer /i;Ywe.BearerToken={toAuthorizationHeader:t=>{if(t!=null)return`Bearer ${t}`},fromAuthorizationHeader:t=>t.replace(yjn,"").trim()}});var yrr=S(ZK=>{"use strict";Object.defineProperty(ZK,"__esModule",{value:!0});ZK.BearerToken=ZK.BasicAuth=void 0;var bjn=hrr();Object.defineProperty(ZK,"BasicAuth",{enumerable:!0,get:function(){return bjn.BasicAuth}});var _jn=grr();Object.defineProperty(ZK,"BearerToken",{enumerable:!0,get:function(){return _jn.BearerToken}})});var pGe=S(Bv=>{"use strict";var brr=Bv&&Bv.__awaiter||function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?i(c.value):o(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})},_rr=Bv&&Bv.__asyncValues||function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(a){return new Promise(function(s,u){a=t[i](a),o(s,u,a.done,a.value)})}}function o(i,a,s,u){Promise.resolve(u).then(function(l){i({value:l,done:s})},a)}},wC=Bv&&Bv.__await||function(t){return this instanceof wC?(this.v=t,this):new wC(t)},vrr=Bv&&Bv.__asyncGenerator||function(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(p){return function(m){return Promise.resolve(m).then(p,d)}}function s(p,m){n[p]&&(o[p]=function(h){return new Promise(function(g,y){i.push([p,h,g,y])>1||u(p,h)})},m&&(o[p]=m(o[p])))}function u(p,m){try{l(n[p](m))}catch(h){f(i[0][3],h)}}function l(p){p.value instanceof wC?Promise.resolve(p.value.v).then(c,d):f(i[0][2],p)}function c(p){u("next",p)}function d(p){u("throw",p)}function f(p,m){p(m),i.shift(),i.length&&u(i[0][0],i[0][1])}};Object.defineProperty(Bv,"__esModule",{value:!0});Bv.Stream=void 0;Bv.readableStreamAsyncIterable=wrr;var vjn=UK(),wjn="data:",fGe=class{constructor({stream:e,parse:r,eventShape:n,signal:o}){this.controller=new AbortController,this.stream=e,this.parse=r,n.type==="sse"?(this.prefix=wjn,this.messageTerminator=` +`,this.streamTerminator=n.streamTerminator):this.messageTerminator=n.messageTerminator,o?.addEventListener("abort",()=>this.controller.abort())}iterMessages(){return vrr(this,arguments,function*(){var r,n,o,i;this.controller.signal;let a=wrr(this.stream),s="",u=!1;try{for(var l=!0,c=_rr(a),d;d=yield wC(c.next()),r=d.done,!r;l=!0){i=d.value,l=!1;let f=i;s+=this.decodeChunk(f);let p;for(;(p=s.indexOf(this.messageTerminator))>=0;){let m=s.slice(0,p+1);if(s=s.slice(p+this.messageTerminator.length),!m.trim())continue;if(!u&&this.prefix!=null){let g=m.indexOf(this.prefix);if(g===-1)continue;u=!0,m=m.slice(g+this.prefix.length)}if(this.streamTerminator!=null&&m.includes(this.streamTerminator))return yield wC(void 0);let h=yield wC(this.parse(JSON.parse(m)));yield yield wC(h),u=!1}}}catch(f){n={error:f}}finally{try{!l&&!r&&(o=c.return)&&(yield wC(o.call(c)))}finally{if(n)throw n.error}}})}[Symbol.asyncIterator](){return vrr(this,arguments,function*(){var r,n,o,i;try{for(var a=!0,s=_rr(this.iterMessages()),u;u=yield wC(s.next()),r=u.done,!r;a=!0)i=u.value,a=!1,yield yield wC(i)}catch(l){n={error:l}}finally{try{!a&&!r&&(o=s.return)&&(yield wC(o.call(s)))}finally{if(n)throw n.error}}})}decodeChunk(e){let r="";if(typeof TextDecoder<"u"){let n=new TextDecoder("utf8");r+=n.decode(e)}else vjn.RUNTIME.type==="node"&&typeof e<"u"&&(r+=Buffer.isBuffer(e)?e:Buffer.from(e));return r}};Bv.Stream=fGe;function wrr(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{next(){return brr(this,void 0,void 0,function*(){try{let r=yield e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}})},return(){return brr(this,void 0,void 0,function*(){let r=e.cancel();return e.releaseLock(),yield r,{done:!0,value:void 0}})},[Symbol.asyncIterator](){return this}}}});var Srr=S(Qwe=>{"use strict";Object.defineProperty(Qwe,"__esModule",{value:!0});Qwe.Stream=void 0;var Sjn=pGe();Object.defineProperty(Qwe,"Stream",{enumerable:!0,get:function(){return Sjn.Stream}})});var Crr=S(une=>{"use strict";var Cjn=une&&une.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(une,"__esModule",{value:!0});une.encodeAsFormParameter=Ojn;var xjn=Cjn(tGe());function Ojn(t){let r=xjn.default.stringify(t,{encode:!1}).split("&").map(n=>{let[o,i]=n.split("=");return[o,i]});return Object.fromEntries(r)}});var Trr=S((nla,Orr)=>{"use strict";var mGe=Object.defineProperty,Tjn=Object.getOwnPropertyDescriptor,Ejn=Object.getOwnPropertyNames,Pjn=Object.prototype.hasOwnProperty,Mjn=(t,e)=>{for(var r in e)mGe(t,r,{get:e[r],enumerable:!0})},Rjn=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ejn(e))!Pjn.call(t,o)&&o!==r&&mGe(t,o,{get:()=>e[o],enumerable:!(n=Tjn(e,o))||n.enumerable});return t},Ajn=t=>Rjn(mGe({},"__esModule",{value:!0}),t),xrr={};Mjn(xrr,{Blob:()=>jjn,File:()=>Djn,FormData:()=>Njn});Orr.exports=Ajn(xrr);var Ijn=function(){return typeof globalThis<"u"?globalThis:typeof self<"u"?self:window}(),{FormData:Njn,Blob:jjn,File:Djn}=Ijn});var krr=S((ola,Frr)=>{"use strict";var yGe=Object.defineProperty,$jn=Object.getOwnPropertyDescriptor,Ljn=Object.getOwnPropertyNames,Fjn=Object.prototype.hasOwnProperty,kjn=(t,e)=>{for(var r in e)yGe(t,r,{get:e[r],enumerable:!0})},qjn=(t,e,r,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Ljn(e))!Fjn.call(t,o)&&o!==r&&yGe(t,o,{get:()=>e[o],enumerable:!(n=$jn(e,o))||n.enumerable});return t},Bjn=t=>qjn(yGe({},"__esModule",{value:!0}),t),bGe=(t,e,r)=>{if(!e.has(t))throw TypeError("Cannot "+r)},Ec=(t,e,r)=>(bGe(t,e,"read from private field"),r?r.call(t):e.get(t)),wT=(t,e,r)=>{if(e.has(t))throw TypeError("Cannot add the same private member more than once");e instanceof WeakSet?e.add(t):e.set(t,r)},lne=(t,e,r,n)=>(bGe(t,e,"write to private field"),n?n.call(t,r):e.set(t,r),r),hGe=(t,e,r)=>(bGe(t,e,"access private method"),r),Nrr={};kjn(Nrr,{FormDataEncoder:()=>Gjn,isFile:()=>a2,isFormData:()=>$rr});Frr.exports=Bjn(Nrr);var h1=t=>typeof t=="function",Ujn=t=>h1(t[Symbol.asyncIterator]),Err=65536;function*jrr(t){if(t.byteLength<=Err){yield t;return}let e=0;for(;e{if(Ujn(t))return Prr(t);if(h1(t.getReader))return Prr(zjn(t));throw new TypeError("Unsupported data source: Expected either ReadableStream or async iterable.")},Mrr="abcdefghijklmnopqrstuvwxyz0123456789";function Vjn(){let t=16,e="";for(;t--;)e+=Mrr[Math.random()*Mrr.length<<0];return e}var Drr=t=>String(t).replace(/\r|\n/g,(e,r,n)=>e==="\r"&&n[r+1]!==` +`||e===` +`&&n[r-1]!=="\r"?`\r +`:e),Jjn=t=>Object.prototype.toString.call(t).slice(8,-1).toLowerCase();function Rrr(t){if(Jjn(t)!=="object")return!1;let e=Object.getPrototypeOf(t);return e==null?!0:(e.constructor&&e.constructor.toString())===Object.toString()}function Arr(t,e){if(typeof e=="string"){for(let[r,n]of Object.entries(t))if(e.toLowerCase()===r.toLowerCase())return n}}var Kjn=t=>new Proxy(t,{get:(e,r)=>Arr(e,r),has:(e,r)=>Arr(e,r)!==void 0}),$rr=t=>!!(t&&h1(t.constructor)&&t[Symbol.toStringTag]==="FormData"&&h1(t.append)&&h1(t.getAll)&&h1(t.entries)&&h1(t[Symbol.iterator])),Irr=t=>String(t).replace(/\r/g,"%0D").replace(/\n/g,"%0A").replace(/"/g,"%22"),a2=t=>!!(t&&typeof t=="object"&&h1(t.constructor)&&t[Symbol.toStringTag]==="File"&&h1(t.stream)&&t.name!=null),Wjn={enableAdditionalHeaders:!1},eSe={writable:!1,configurable:!1},$F,cne,tSe,dne,i2,fne,pne,rSe,nSe,_Ge,gGe,Lrr,Gjn=class{constructor(t,e,r){if(wT(this,nSe),wT(this,gGe),wT(this,$F,`\r +`),wT(this,cne,void 0),wT(this,tSe,void 0),wT(this,dne,"-".repeat(2)),wT(this,i2,new TextEncoder),wT(this,fne,void 0),wT(this,pne,void 0),wT(this,rSe,void 0),!$rr(t))throw new TypeError("Expected first argument to be a FormData instance.");let n;if(Rrr(e)?r=e:n=e,n||(n=Vjn()),typeof n!="string")throw new TypeError("Expected boundary argument to be a string.");if(r&&!Rrr(r))throw new TypeError("Expected options argument to be an object.");lne(this,pne,Array.from(t.entries())),lne(this,rSe,{...Wjn,...r}),lne(this,cne,Ec(this,i2).encode(Ec(this,$F))),lne(this,tSe,Ec(this,cne).byteLength),this.boundary=`form-data-boundary-${n}`,this.contentType=`multipart/form-data; boundary=${this.boundary}`,lne(this,fne,Ec(this,i2).encode(`${Ec(this,dne)}${this.boundary}${Ec(this,dne)}${Ec(this,$F).repeat(2)}`));let o={"Content-Type":this.contentType},i=hGe(this,gGe,Lrr).call(this);i&&(this.contentLength=i,o["Content-Length"]=i),this.headers=Kjn(Object.freeze(o)),Object.defineProperties(this,{boundary:eSe,contentType:eSe,contentLength:eSe,headers:eSe})}*values(){for(let[t,e]of Ec(this,pne)){let r=a2(e)?e:Ec(this,i2).encode(Drr(e));yield hGe(this,nSe,_Ge).call(this,t,r),yield r,yield Ec(this,cne)}yield Ec(this,fne)}async*encode(){for(let t of this.values())a2(t)?yield*Hjn(t.stream()):yield*jrr(t)}[Symbol.iterator](){return this.values()}[Symbol.asyncIterator](){return this.encode()}};$F=new WeakMap;cne=new WeakMap;tSe=new WeakMap;dne=new WeakMap;i2=new WeakMap;fne=new WeakMap;pne=new WeakMap;rSe=new WeakMap;nSe=new WeakSet;_Ge=function(t,e){let r="";if(r+=`${Ec(this,dne)}${this.boundary}${Ec(this,$F)}`,r+=`Content-Disposition: form-data; name="${Irr(t)}"`,a2(e)&&(r+=`; filename="${Irr(e.name)}"${Ec(this,$F)}`,r+=`Content-Type: ${e.type||"application/octet-stream"}`),Ec(this,rSe).enableAdditionalHeaders===!0){let n=a2(e)?e.size:e.byteLength;n!=null&&!isNaN(n)&&(r+=`${Ec(this,$F)}Content-Length: ${n}`)}return Ec(this,i2).encode(`${r}${Ec(this,$F).repeat(2)}`)};gGe=new WeakSet;Lrr=function(){let t=0;for(let[e,r]of Ec(this,pne)){let n=a2(r)?r:Ec(this,i2).encode(Drr(r)),o=a2(n)?n.size:n.byteLength;if(o==null||isNaN(o))return;t+=hGe(this,nSe,_Ge).call(this,e,n).byteLength,t+=o,t+=Ec(this,tSe)}return String(t+Ec(this,fne).byteLength)}});var Brr=S((ala,qrr)=>{"use strict";qrr.exports=typeof self=="object"?self.FormData:window.FormData});var Urr=S(cg=>{"use strict";var Zjn=cg&&cg.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Xjn=cg&&cg.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),XK=cg&&cg.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o=18?t=new iSe:oSe.RUNTIME.type==="node"?t=new aSe:t=new sSe,yield t.setup(),t})}var iSe=class{setup(){return LF(this,void 0,void 0,function*(){this.fd=new(yield Promise.resolve().then(()=>XK(Trr()))).FormData})}append(e,r){var n;(n=this.fd)===null||n===void 0||n.append(e,r)}appendFile(e,r,n){return LF(this,void 0,void 0,function*(){var o,i;n==null&&vGe(r)&&(n=r.name),r instanceof(yield Promise.resolve().then(()=>XK(Vre()))).Readable?(o=this.fd)===null||o===void 0||o.append(e,{type:void 0,name:n,[Symbol.toStringTag]:"File",stream(){return r}}):(i=this.fd)===null||i===void 0||i.append(e,r,n)})}getRequest(){return LF(this,void 0,void 0,function*(){let e=new(yield Promise.resolve().then(()=>XK(krr()))).FormDataEncoder(this.fd);return{body:yield(yield Promise.resolve().then(()=>XK(Vre()))).Readable.from(e),headers:e.headers,duplex:"half"}})}};cg.Node18FormData=iSe;var aSe=class{setup(){return LF(this,void 0,void 0,function*(){this.fd=new(yield Promise.resolve().then(()=>XK(Brr()))).default})}append(e,r){var n;(n=this.fd)===null||n===void 0||n.append(e,r)}appendFile(e,r,n){return LF(this,void 0,void 0,function*(){var o,i;n==null&&vGe(r)&&(n=r.name);let a;r instanceof(yield Promise.resolve().then(()=>XK(Vre()))).Readable?a=r:a=Buffer.from(yield r.arrayBuffer()),n==null?(o=this.fd)===null||o===void 0||o.append(e,a):(i=this.fd)===null||i===void 0||i.append(e,a,{filename:n})})}getRequest(){return{body:this.fd,headers:this.fd?this.fd.getHeaders():{}}}};cg.Node16FormData=aSe;var sSe=class{setup(){return LF(this,void 0,void 0,function*(){this.fd=new FormData})}append(e,r){var n;(n=this.fd)===null||n===void 0||n.append(e,r)}appendFile(e,r,n){return LF(this,void 0,void 0,function*(){var o;n==null&&vGe(r)&&(n=r.name),(o=this.fd)===null||o===void 0||o.append(e,new Blob([r]),n)})}getRequest(){return{body:this.fd,headers:{}}}};cg.WebFormData=sSe});var zrr=S(g1=>{"use strict";var Qjn=g1&&g1.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),eDn=g1&&g1.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Qjn(e,t,r)};Object.defineProperty(g1,"__esModule",{value:!0});g1.encodeAsFormParameter=void 0;var tDn=Crr();Object.defineProperty(g1,"encodeAsFormParameter",{enumerable:!0,get:function(){return tDn.encodeAsFormParameter}});eDn(Urr(),g1)});var mh=S(uSe=>{"use strict";Object.defineProperty(uSe,"__esModule",{value:!0});uSe.SchemaType=void 0;uSe.SchemaType={BIGINT:"bigint",DATE:"date",ENUM:"enum",LIST:"list",STRING_LITERAL:"stringLiteral",BOOLEAN_LITERAL:"booleanLiteral",OBJECT:"object",ANY:"any",BOOLEAN:"boolean",NUMBER:"number",STRING:"string",UNKNOWN:"unknown",RECORD:"record",SET:"set",UNION:"union",UNDISCRIMINATED_UNION:"undiscriminatedUnion",NULLABLE:"nullable",OPTIONAL:"optional",OPTIONAL_NULLABLE:"optionalNullable"}});var gb=S(wGe=>{"use strict";Object.defineProperty(wGe,"__esModule",{value:!0});wGe.getErrorMessageForIncorrectType=rDn;function rDn(t,e){return`Expected ${e}. Received ${nDn(t)}.`}function nDn(t){if(Array.isArray(t))return"list";if(t===null)return"null";if(t instanceof BigInt)return"BigInt";switch(typeof t){case"string":return`"${t}"`;case"bigint":case"number":case"boolean":case"undefined":return`${t}`}return typeof t}});var ST=S(SGe=>{"use strict";Object.defineProperty(SGe,"__esModule",{value:!0});SGe.maybeSkipValidation=oDn;function oDn(t){return Object.assign(Object.assign({},t),{json:Hrr(t.json),parse:Hrr(t.parse)})}function Hrr(t){return(e,r)=>{let n=t(e,r),{skipValidation:o=!1}=r??{};return!n.ok&&o?(console.warn(["Failed to validate.",...n.errors.map(i=>" - "+(i.path.length>0?`${i.path.join(".")}: ${i.message}`:i.message))].join(` +`)),{ok:!0,value:e}):n}}});var xGe=S(CGe=>{"use strict";Object.defineProperty(CGe,"__esModule",{value:!0});CGe.stringifyValidationError=iDn;function iDn(t){return t.path.length===0?t.message:`${t.path.join(" -> ")}: ${t.message}`}});var TGe=S(lSe=>{"use strict";Object.defineProperty(lSe,"__esModule",{value:!0});lSe.JsonError=void 0;var aDn=xGe(),OGe=class t extends Error{constructor(e){super(e.map(aDn.stringifyValidationError).join("; ")),this.errors=e,Object.setPrototypeOf(this,t.prototype)}};lSe.JsonError=OGe});var PGe=S(cSe=>{"use strict";Object.defineProperty(cSe,"__esModule",{value:!0});cSe.ParseError=void 0;var sDn=xGe(),EGe=class t extends Error{constructor(e){super(e.map(sDn.stringifyValidationError).join("; ")),this.errors=e,Object.setPrototypeOf(this,t.prototype)}};cSe.ParseError=EGe});var Grr=S(s2=>{"use strict";Object.defineProperty(s2,"__esModule",{value:!0});s2.getSchemaUtils=mne;s2.nullable=Vrr;s2.optional=Jrr;s2.optionalNullable=Krr;s2.transform=Wrr;var MGe=mh(),uDn=TGe(),lDn=PGe();function mne(t){return{nullable:()=>Vrr(t),optional:()=>Jrr(t),optionalNullable:()=>Krr(t),transform:e=>Wrr(t,e),parseOrThrow:(e,r)=>{let n=t.parse(e,r);if(n.ok)return n.value;throw new lDn.ParseError(n.errors)},jsonOrThrow:(e,r)=>{let n=t.json(e,r);if(n.ok)return n.value;throw new uDn.JsonError(n.errors)}}}function Vrr(t){let e={parse:(r,n)=>r==null?{ok:!0,value:null}:t.parse(r,n),json:(r,n)=>r==null?{ok:!0,value:null}:t.json(r,n),getType:()=>MGe.SchemaType.NULLABLE};return Object.assign(Object.assign({},e),mne(e))}function Jrr(t){let e={parse:(r,n)=>r==null?{ok:!0,value:void 0}:t.parse(r,n),json:(r,n)=>n?.omitUndefined&&r===void 0?{ok:!0,value:void 0}:r==null?{ok:!0,value:null}:t.json(r,n),getType:()=>MGe.SchemaType.OPTIONAL};return Object.assign(Object.assign({},e),mne(e))}function Krr(t){let e={parse:(r,n)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:t.parse(r,n),json:(r,n)=>r===void 0?{ok:!0,value:void 0}:r===null?{ok:!0,value:null}:t.json(r,n),getType:()=>MGe.SchemaType.OPTIONAL_NULLABLE};return Object.assign(Object.assign({},e),mne(e))}function Wrr(t,e){let r={parse:(n,o)=>{let i=t.parse(n,o);return i.ok?{ok:!0,value:e.transform(i.value)}:i},json:(n,o)=>{let i=e.untransform(n);return t.json(i,o)},getType:()=>t.getType()};return Object.assign(Object.assign({},r),mne(r))}});var y_=S(xS=>{"use strict";Object.defineProperty(xS,"__esModule",{value:!0});xS.ParseError=xS.JsonError=xS.transform=xS.optional=xS.getSchemaUtils=void 0;var RGe=Grr();Object.defineProperty(xS,"getSchemaUtils",{enumerable:!0,get:function(){return RGe.getSchemaUtils}});Object.defineProperty(xS,"optional",{enumerable:!0,get:function(){return RGe.optional}});Object.defineProperty(xS,"transform",{enumerable:!0,get:function(){return RGe.transform}});var cDn=TGe();Object.defineProperty(xS,"JsonError",{enumerable:!0,get:function(){return cDn.JsonError}});var dDn=PGe();Object.defineProperty(xS,"ParseError",{enumerable:!0,get:function(){return dDn.ParseError}})});var Xrr=S(AGe=>{"use strict";Object.defineProperty(AGe,"__esModule",{value:!0});AGe.bigint=hDn;var fDn=mh(),Zrr=gb(),pDn=ST(),mDn=y_();function hDn(){let t={parse:(e,{breadcrumbsPrefix:r=[]}={})=>typeof e=="bigint"?{ok:!0,value:e}:typeof e=="number"?{ok:!0,value:BigInt(e)}:{ok:!1,errors:[{path:r,message:(0,Zrr.getErrorMessageForIncorrectType)(e,"bigint | number")}]},json:(e,{breadcrumbsPrefix:r=[]}={})=>typeof e!="bigint"?{ok:!1,errors:[{path:r,message:(0,Zrr.getErrorMessageForIncorrectType)(e,"bigint")}]}:{ok:!0,value:e},getType:()=>fDn.SchemaType.BIGINT};return Object.assign(Object.assign({},(0,pDn.maybeSkipValidation)(t)),(0,mDn.getSchemaUtils)(t))}});var Yrr=S(dSe=>{"use strict";Object.defineProperty(dSe,"__esModule",{value:!0});dSe.bigint=void 0;var gDn=Xrr();Object.defineProperty(dSe,"bigint",{enumerable:!0,get:function(){return gDn.bigint}})});var Qrr=S(NGe=>{"use strict";Object.defineProperty(NGe,"__esModule",{value:!0});NGe.date=wDn;var yDn=mh(),IGe=gb(),bDn=ST(),_Dn=y_(),vDn=/^([+-]?\d{4}(?!\d{2}\b))((-?)((0[1-9]|1[0-2])(\3([12]\d|0[1-9]|3[01]))?|W([0-4]\d|5[0-2])(-?[1-7])?|(00[1-9]|0[1-9]\d|[12]\d{2}|3([0-5]\d|6[1-6])))([T\s]((([01]\d|2[0-3])((:?)[0-5]\d)?|24:?00)([.,]\d+(?!:))?)?(\17[0-5]\d([.,]\d+)?)?([zZ]|([+-])([01]\d|2[0-3]):?([0-5]\d)?)?)?)?$/;function wDn(){let t={parse:(e,{breadcrumbsPrefix:r=[]}={})=>typeof e!="string"?{ok:!1,errors:[{path:r,message:(0,IGe.getErrorMessageForIncorrectType)(e,"string")}]}:vDn.test(e)?{ok:!0,value:new Date(e)}:{ok:!1,errors:[{path:r,message:(0,IGe.getErrorMessageForIncorrectType)(e,"ISO 8601 date string")}]},json:(e,{breadcrumbsPrefix:r=[]}={})=>e instanceof Date?{ok:!0,value:e.toISOString()}:{ok:!1,errors:[{path:r,message:(0,IGe.getErrorMessageForIncorrectType)(e,"Date object")}]},getType:()=>yDn.SchemaType.DATE};return Object.assign(Object.assign({},(0,bDn.maybeSkipValidation)(t)),(0,_Dn.getSchemaUtils)(t))}});var enr=S(fSe=>{"use strict";Object.defineProperty(fSe,"__esModule",{value:!0});fSe.date=void 0;var SDn=Qrr();Object.defineProperty(fSe,"date",{enumerable:!0,get:function(){return SDn.date}})});var y1=S(jGe=>{"use strict";Object.defineProperty(jGe,"__esModule",{value:!0});jGe.createIdentitySchemaCreator=ODn;var CDn=y_(),xDn=ST();function ODn(t,e){return()=>{let r={parse:e,json:e,getType:()=>t};return Object.assign(Object.assign({},(0,xDn.maybeSkipValidation)(r)),(0,CDn.getSchemaUtils)(r))}}});var rnr=S(DGe=>{"use strict";Object.defineProperty(DGe,"__esModule",{value:!0});DGe.enum_=PDn;var TDn=mh(),EDn=y1(),tnr=gb();function PDn(t){let e=new Set(t);return(0,EDn.createIdentitySchemaCreator)(TDn.SchemaType.ENUM,(n,{allowUnrecognizedEnumValues:o,breadcrumbsPrefix:i=[]}={})=>typeof n!="string"?{ok:!1,errors:[{path:i,message:(0,tnr.getErrorMessageForIncorrectType)(n,"string")}]}:!e.has(n)&&!o?{ok:!1,errors:[{path:i,message:(0,tnr.getErrorMessageForIncorrectType)(n,"enum")}]}:{ok:!0,value:n})()}});var $Ge=S(pSe=>{"use strict";Object.defineProperty(pSe,"__esModule",{value:!0});pSe.enum_=void 0;var MDn=rnr();Object.defineProperty(pSe,"enum_",{enumerable:!0,get:function(){return MDn.enum_}})});var LGe=S(hne=>{"use strict";Object.defineProperty(hne,"__esModule",{value:!0});hne.lazy=ADn;hne.constructLazyBaseSchema=nnr;hne.getMemoizedSchema=mSe;var RDn=y_();function ADn(t){let e=nnr(t);return Object.assign(Object.assign({},e),(0,RDn.getSchemaUtils)(e))}function nnr(t){return{parse:(e,r)=>mSe(t).parse(e,r),json:(e,r)=>mSe(t).json(e,r),getType:()=>mSe(t).getType()}}function mSe(t){let e=t;return e.__zurg_memoized==null&&(e.__zurg_memoized=t()),e.__zurg_memoized}});var kGe=S(FGe=>{"use strict";Object.defineProperty(FGe,"__esModule",{value:!0});FGe.entries=IDn;function IDn(t){return Object.entries(t)}});var BGe=S(qGe=>{"use strict";Object.defineProperty(qGe,"__esModule",{value:!0});qGe.filterObject=NDn;function NDn(t,e){let r=new Set(e);return Object.entries(t).reduce((n,[o,i])=>(r.has(o)&&(n[o]=i),n),{})}});var gne=S(UGe=>{"use strict";Object.defineProperty(UGe,"__esModule",{value:!0});UGe.isPlainObject=jDn;function jDn(t){if(typeof t!="object"||t===null)return!1;if(Object.getPrototypeOf(t)===null)return!0;let e=t;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(t)===e}});var HGe=S(zGe=>{"use strict";Object.defineProperty(zGe,"__esModule",{value:!0});zGe.keys=DDn;function DDn(t){return Object.keys(t)}});var onr=S(VGe=>{"use strict";Object.defineProperty(VGe,"__esModule",{value:!0});VGe.partition=$Dn;function $Dn(t,e){let r=[],n=[];for(let o of t)e(o)?r.push(o):n.push(o);return[r,n]}});var snr=S(hSe=>{"use strict";Object.defineProperty(hSe,"__esModule",{value:!0});hSe.getObjectLikeUtils=inr;hSe.withParsedProperties=anr;var LDn=BGe(),FDn=gb(),kDn=gne(),qDn=y_();function inr(t){return{withParsedProperties:e=>anr(t,e)}}function anr(t,e){let r={parse:(n,o)=>{let i=t.parse(n,o);if(!i.ok)return i;let a=Object.entries(e).reduce((s,[u,l])=>Object.assign(Object.assign({},s),{[u]:typeof l=="function"?l(i.value):l}),{});return{ok:!0,value:Object.assign(Object.assign({},i.value),a)}},json:(n,o)=>{var i;if(!(0,kDn.isPlainObject)(n))return{ok:!1,errors:[{path:(i=o?.breadcrumbsPrefix)!==null&&i!==void 0?i:[],message:(0,FDn.getErrorMessageForIncorrectType)(n,"object")}]};let a=new Set(Object.keys(e)),s=(0,LDn.filterObject)(n,Object.keys(n).filter(u=>!a.has(u)));return t.json(s,o)},getType:()=>t.getType()};return Object.assign(Object.assign(Object.assign({},r),(0,qDn.getSchemaUtils)(r)),inr(r))}});var yne=S(YK=>{"use strict";Object.defineProperty(YK,"__esModule",{value:!0});YK.withParsedProperties=YK.getObjectLikeUtils=void 0;var unr=snr();Object.defineProperty(YK,"getObjectLikeUtils",{enumerable:!0,get:function(){return unr.getObjectLikeUtils}});Object.defineProperty(YK,"withParsedProperties",{enumerable:!0,get:function(){return unr.withParsedProperties}})});var JGe=S(gSe=>{"use strict";Object.defineProperty(gSe,"__esModule",{value:!0});gSe.property=BDn;gSe.isProperty=UDn;function BDn(t,e){return{rawKey:t,valueSchema:e,isProperty:!0}}function UDn(t){return t.isProperty}});var GGe=S(bSe=>{"use strict";Object.defineProperty(bSe,"__esModule",{value:!0});bSe.object=KDn;bSe.getObjectUtils=ySe;var u2=mh(),lnr=kGe(),cnr=BGe(),zDn=gb(),HDn=gne(),mnr=HGe(),VDn=ST(),JDn=onr(),KGe=yne(),WGe=y_(),bne=JGe();function KDn(t){let e={_getRawProperties:()=>Object.entries(t).map(([r,n])=>(0,bne.isProperty)(n)?n.rawKey:r),_getParsedProperties:()=>(0,mnr.keys)(t),parse:(r,n)=>{let o={},i=[];for(let[a,s]of(0,lnr.entries)(t)){let u=(0,bne.isProperty)(s)?s.rawKey:a,l=(0,bne.isProperty)(s)?s.valueSchema:s,c={rawKey:u,parsedKey:a,valueSchema:l};o[u]=c,pnr(l)&&i.push(u)}return dnr({value:r,requiredKeys:i,getProperty:a=>{let s=o[a];if(s!=null)return{transformedKey:s.parsedKey,transform:u=>{var l;return s.valueSchema.parse(u,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(l=n?.breadcrumbsPrefix)!==null&&l!==void 0?l:[],a]}))}}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},json:(r,n)=>{let o=[];for(let[i,a]of(0,lnr.entries)(t)){let s=(0,bne.isProperty)(a)?a.valueSchema:a;pnr(s)&&o.push(i)}return dnr({value:r,requiredKeys:o,getProperty:i=>{let a=t[i];if(a!=null)return(0,bne.isProperty)(a)?{transformedKey:a.rawKey,transform:s=>{var u;return a.valueSchema.json(s,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(u=n?.breadcrumbsPrefix)!==null&&u!==void 0?u:[],i]}))}}:{transformedKey:i,transform:s=>{var u;return a.json(s,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(u=n?.breadcrumbsPrefix)!==null&&u!==void 0?u:[],i]}))}}},unrecognizedObjectKeys:n?.unrecognizedObjectKeys,skipValidation:n?.skipValidation,breadcrumbsPrefix:n?.breadcrumbsPrefix,omitUndefined:n?.omitUndefined})},getType:()=>u2.SchemaType.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},(0,VDn.maybeSkipValidation)(e)),(0,WGe.getSchemaUtils)(e)),(0,KGe.getObjectLikeUtils)(e)),ySe(e))}function dnr({value:t,requiredKeys:e,getProperty:r,unrecognizedObjectKeys:n="fail",skipValidation:o=!1,breadcrumbsPrefix:i=[]}){if(!(0,HDn.isPlainObject)(t))return{ok:!1,errors:[{path:i,message:(0,zDn.getErrorMessageForIncorrectType)(t,"object")}]};let a=new Set(e),s=[],u={};for(let[l,c]of Object.entries(t)){let d=r(l);if(d!=null){a.delete(l);let f=d.transform(c);f.ok?u[d.transformedKey]=f.value:(u[l]=c,s.push(...f.errors))}else switch(n){case"fail":s.push({path:[...i,l],message:`Unexpected key "${l}"`});break;case"strip":break;case"passthrough":u[l]=c;break}}return s.push(...e.filter(l=>a.has(l)).map(l=>({path:i,message:`Missing required key "${l}"`}))),s.length===0||o?{ok:!0,value:u}:{ok:!1,errors:s}}function ySe(t){return{extend:e=>{let r={_getParsedProperties:()=>[...t._getParsedProperties(),...e._getParsedProperties()],_getRawProperties:()=>[...t._getRawProperties(),...e._getRawProperties()],parse:(n,o)=>fnr({extensionKeys:e._getRawProperties(),value:n,transformBase:i=>t.parse(i,o),transformExtension:i=>e.parse(i,o)}),json:(n,o)=>fnr({extensionKeys:e._getParsedProperties(),value:n,transformBase:i=>t.json(i,o),transformExtension:i=>e.json(i,o)}),getType:()=>u2.SchemaType.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},r),(0,WGe.getSchemaUtils)(r)),(0,KGe.getObjectLikeUtils)(r)),ySe(r))},passthrough:()=>{let e={_getParsedProperties:()=>t._getParsedProperties(),_getRawProperties:()=>t._getRawProperties(),parse:(r,n)=>{let o=t.parse(r,Object.assign(Object.assign({},n),{unrecognizedObjectKeys:"passthrough"}));return o.ok?{ok:!0,value:Object.assign(Object.assign({},r),o.value)}:o},json:(r,n)=>{let o=t.json(r,Object.assign(Object.assign({},n),{unrecognizedObjectKeys:"passthrough"}));return o.ok?{ok:!0,value:Object.assign(Object.assign({},r),o.value)}:o},getType:()=>u2.SchemaType.OBJECT};return Object.assign(Object.assign(Object.assign(Object.assign({},e),(0,WGe.getSchemaUtils)(e)),(0,KGe.getObjectLikeUtils)(e)),ySe(e))}}}function fnr({extensionKeys:t,value:e,transformBase:r,transformExtension:n}){let o=new Set(t),[i,a]=(0,JDn.partition)((0,mnr.keys)(e),l=>o.has(l)),s=r((0,cnr.filterObject)(e,a)),u=n((0,cnr.filterObject)(e,i));return s.ok&&u.ok?{ok:!0,value:Object.assign(Object.assign({},s.value),u.value)}:{ok:!1,errors:[...s.ok?[]:s.errors,...u.ok?[]:u.errors]}}function pnr(t){return!WDn(t)}function WDn(t){switch(t.getType()){case u2.SchemaType.ANY:case u2.SchemaType.UNKNOWN:case u2.SchemaType.OPTIONAL:case u2.SchemaType.OPTIONAL_NULLABLE:return!0;default:return!1}}});var hnr=S(ZGe=>{"use strict";Object.defineProperty(ZGe,"__esModule",{value:!0});ZGe.objectWithoutOptionalProperties=ZDn;var GDn=GGe();function ZDn(t){return(0,GDn.object)(t)}});var XGe=S(OS=>{"use strict";Object.defineProperty(OS,"__esModule",{value:!0});OS.property=OS.isProperty=OS.objectWithoutOptionalProperties=OS.object=OS.getObjectUtils=void 0;var gnr=GGe();Object.defineProperty(OS,"getObjectUtils",{enumerable:!0,get:function(){return gnr.getObjectUtils}});Object.defineProperty(OS,"object",{enumerable:!0,get:function(){return gnr.object}});var XDn=hnr();Object.defineProperty(OS,"objectWithoutOptionalProperties",{enumerable:!0,get:function(){return XDn.objectWithoutOptionalProperties}});var ynr=JGe();Object.defineProperty(OS,"isProperty",{enumerable:!0,get:function(){return ynr.isProperty}});Object.defineProperty(OS,"property",{enumerable:!0,get:function(){return ynr.property}})});var bnr=S(QGe=>{"use strict";Object.defineProperty(QGe,"__esModule",{value:!0});QGe.lazyObject=t$n;var YDn=XGe(),QDn=yne(),e$n=y_(),YGe=LGe();function t$n(t){let e=Object.assign(Object.assign({},(0,YGe.constructLazyBaseSchema)(t)),{_getRawProperties:()=>(0,YGe.getMemoizedSchema)(t)._getRawProperties(),_getParsedProperties:()=>(0,YGe.getMemoizedSchema)(t)._getParsedProperties()});return Object.assign(Object.assign(Object.assign(Object.assign({},e),(0,e$n.getSchemaUtils)(e)),(0,QDn.getObjectLikeUtils)(e)),(0,YDn.getObjectUtils)(e))}});var _nr=S(QK=>{"use strict";Object.defineProperty(QK,"__esModule",{value:!0});QK.lazyObject=QK.lazy=void 0;var r$n=LGe();Object.defineProperty(QK,"lazy",{enumerable:!0,get:function(){return r$n.lazy}});var n$n=bnr();Object.defineProperty(QK,"lazyObject",{enumerable:!0,get:function(){return n$n.lazyObject}})});var wnr=S(e9e=>{"use strict";Object.defineProperty(e9e,"__esModule",{value:!0});e9e.list=u$n;var o$n=mh(),i$n=gb(),a$n=ST(),s$n=y_();function u$n(t){let e={parse:(r,n)=>vnr(r,(o,i)=>{var a;return t.parse(o,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(a=n?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],`[${i}]`]}))}),json:(r,n)=>vnr(r,(o,i)=>{var a;return t.json(o,Object.assign(Object.assign({},n),{breadcrumbsPrefix:[...(a=n?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],`[${i}]`]}))}),getType:()=>o$n.SchemaType.LIST};return Object.assign(Object.assign({},(0,a$n.maybeSkipValidation)(e)),(0,s$n.getSchemaUtils)(e))}function vnr(t,e){return Array.isArray(t)?t.map((n,o)=>e(n,o)).reduce((n,o)=>{if(n.ok&&o.ok)return{ok:!0,value:[...n.value,o.value]};let i=[];return n.ok||i.push(...n.errors),o.ok||i.push(...o.errors),{ok:!1,errors:i}},{ok:!0,value:[]}):{ok:!1,errors:[{message:(0,i$n.getErrorMessageForIncorrectType)(t,"list"),path:[]}]}}});var t9e=S(_Se=>{"use strict";Object.defineProperty(_Se,"__esModule",{value:!0});_Se.list=void 0;var l$n=wnr();Object.defineProperty(_Se,"list",{enumerable:!0,get:function(){return l$n.list}})});var Snr=S(r9e=>{"use strict";Object.defineProperty(r9e,"__esModule",{value:!0});r9e.stringLiteral=p$n;var c$n=mh(),d$n=y1(),f$n=gb();function p$n(t){return(0,d$n.createIdentitySchemaCreator)(c$n.SchemaType.STRING_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===t?{ok:!0,value:t}:{ok:!1,errors:[{path:n,message:(0,f$n.getErrorMessageForIncorrectType)(r,`"${t}"`)}]})()}});var Cnr=S(n9e=>{"use strict";Object.defineProperty(n9e,"__esModule",{value:!0});n9e.booleanLiteral=y$n;var m$n=mh(),h$n=y1(),g$n=gb();function y$n(t){return(0,h$n.createIdentitySchemaCreator)(m$n.SchemaType.BOOLEAN_LITERAL,(r,{breadcrumbsPrefix:n=[]}={})=>r===t?{ok:!0,value:t}:{ok:!1,errors:[{path:n,message:(0,g$n.getErrorMessageForIncorrectType)(r,`${t.toString()}`)}]})()}});var xnr=S(eW=>{"use strict";Object.defineProperty(eW,"__esModule",{value:!0});eW.booleanLiteral=eW.stringLiteral=void 0;var b$n=Snr();Object.defineProperty(eW,"stringLiteral",{enumerable:!0,get:function(){return b$n.stringLiteral}});var _$n=Cnr();Object.defineProperty(eW,"booleanLiteral",{enumerable:!0,get:function(){return _$n.booleanLiteral}})});var Onr=S(vSe=>{"use strict";Object.defineProperty(vSe,"__esModule",{value:!0});vSe.any=void 0;var v$n=mh(),w$n=y1();vSe.any=(0,w$n.createIdentitySchemaCreator)(v$n.SchemaType.ANY,t=>({ok:!0,value:t}))});var Tnr=S(wSe=>{"use strict";Object.defineProperty(wSe,"__esModule",{value:!0});wSe.boolean=void 0;var S$n=mh(),C$n=y1(),x$n=gb();wSe.boolean=(0,C$n.createIdentitySchemaCreator)(S$n.SchemaType.BOOLEAN,(t,{breadcrumbsPrefix:e=[]}={})=>typeof t=="boolean"?{ok:!0,value:t}:{ok:!1,errors:[{path:e,message:(0,x$n.getErrorMessageForIncorrectType)(t,"boolean")}]})});var Enr=S(SSe=>{"use strict";Object.defineProperty(SSe,"__esModule",{value:!0});SSe.number=void 0;var O$n=mh(),T$n=y1(),E$n=gb();SSe.number=(0,T$n.createIdentitySchemaCreator)(O$n.SchemaType.NUMBER,(t,{breadcrumbsPrefix:e=[]}={})=>typeof t=="number"?{ok:!0,value:t}:{ok:!1,errors:[{path:e,message:(0,E$n.getErrorMessageForIncorrectType)(t,"number")}]})});var Pnr=S(CSe=>{"use strict";Object.defineProperty(CSe,"__esModule",{value:!0});CSe.string=void 0;var P$n=mh(),M$n=y1(),R$n=gb();CSe.string=(0,M$n.createIdentitySchemaCreator)(P$n.SchemaType.STRING,(t,{breadcrumbsPrefix:e=[]}={})=>typeof t=="string"?{ok:!0,value:t}:{ok:!1,errors:[{path:e,message:(0,R$n.getErrorMessageForIncorrectType)(t,"string")}]})});var Mnr=S(xSe=>{"use strict";Object.defineProperty(xSe,"__esModule",{value:!0});xSe.unknown=void 0;var A$n=mh(),I$n=y1();xSe.unknown=(0,I$n.createIdentitySchemaCreator)(A$n.SchemaType.UNKNOWN,t=>({ok:!0,value:t}))});var Rnr=S(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});TS.unknown=TS.string=TS.number=TS.boolean=TS.any=void 0;var N$n=Onr();Object.defineProperty(TS,"any",{enumerable:!0,get:function(){return N$n.any}});var j$n=Tnr();Object.defineProperty(TS,"boolean",{enumerable:!0,get:function(){return j$n.boolean}});var D$n=Enr();Object.defineProperty(TS,"number",{enumerable:!0,get:function(){return D$n.number}});var $$n=Pnr();Object.defineProperty(TS,"string",{enumerable:!0,get:function(){return $$n.string}});var L$n=Mnr();Object.defineProperty(TS,"unknown",{enumerable:!0,get:function(){return L$n.unknown}})});var Inr=S(i9e=>{"use strict";Object.defineProperty(i9e,"__esModule",{value:!0});i9e.record=z$n;var o9e=mh(),F$n=kGe(),k$n=gb(),q$n=gne(),B$n=ST(),U$n=y_();function z$n(t,e){let r={parse:(n,o)=>Anr({value:n,isKeyNumeric:t.getType()===o9e.SchemaType.NUMBER,transformKey:i=>{var a;return t.parse(i,Object.assign(Object.assign({},o),{breadcrumbsPrefix:[...(a=o?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],`${i} (key)`]}))},transformValue:(i,a)=>{var s;return e.parse(i,Object.assign(Object.assign({},o),{breadcrumbsPrefix:[...(s=o?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`${a}`]}))},breadcrumbsPrefix:o?.breadcrumbsPrefix}),json:(n,o)=>Anr({value:n,isKeyNumeric:t.getType()===o9e.SchemaType.NUMBER,transformKey:i=>{var a;return t.json(i,Object.assign(Object.assign({},o),{breadcrumbsPrefix:[...(a=o?.breadcrumbsPrefix)!==null&&a!==void 0?a:[],`${i} (key)`]}))},transformValue:(i,a)=>{var s;return e.json(i,Object.assign(Object.assign({},o),{breadcrumbsPrefix:[...(s=o?.breadcrumbsPrefix)!==null&&s!==void 0?s:[],`${a}`]}))},breadcrumbsPrefix:o?.breadcrumbsPrefix}),getType:()=>o9e.SchemaType.RECORD};return Object.assign(Object.assign({},(0,B$n.maybeSkipValidation)(r)),(0,U$n.getSchemaUtils)(r))}function Anr({value:t,isKeyNumeric:e,transformKey:r,transformValue:n,breadcrumbsPrefix:o=[]}){return(0,q$n.isPlainObject)(t)?(0,F$n.entries)(t).reduce((i,[a,s])=>{if(s===void 0)return i;let u=i,l=a;if(e){let p=a.length>0?Number(a):NaN;isNaN(p)||(l=p)}let c=r(l),d=n(s,l);if(u.ok&&c.ok&&d.ok)return{ok:!0,value:Object.assign(Object.assign({},u.value),{[c.value]:d.value})};let f=[];return u.ok||f.push(...u.errors),c.ok||f.push(...c.errors),d.ok||f.push(...d.errors),{ok:!1,errors:f}},{ok:!0,value:{}}):{ok:!1,errors:[{path:o,message:(0,k$n.getErrorMessageForIncorrectType)(t,"object")}]}}});var Nnr=S(OSe=>{"use strict";Object.defineProperty(OSe,"__esModule",{value:!0});OSe.record=void 0;var H$n=Inr();Object.defineProperty(OSe,"record",{enumerable:!0,get:function(){return H$n.record}})});var jnr=S(a9e=>{"use strict";Object.defineProperty(a9e,"__esModule",{value:!0});a9e.set=Z$n;var V$n=mh(),J$n=gb(),K$n=ST(),W$n=t9e(),G$n=y_();function Z$n(t){let e=(0,W$n.list)(t),r={parse:(n,o)=>{let i=e.parse(n,o);return i.ok?{ok:!0,value:new Set(i.value)}:i},json:(n,o)=>{var i;return n instanceof Set?e.json([...n],o):{ok:!1,errors:[{path:(i=o?.breadcrumbsPrefix)!==null&&i!==void 0?i:[],message:(0,J$n.getErrorMessageForIncorrectType)(n,"Set")}]}},getType:()=>V$n.SchemaType.SET};return Object.assign(Object.assign({},(0,K$n.maybeSkipValidation)(r)),(0,G$n.getSchemaUtils)(r))}});var Dnr=S(TSe=>{"use strict";Object.defineProperty(TSe,"__esModule",{value:!0});TSe.set=void 0;var X$n=jnr();Object.defineProperty(TSe,"set",{enumerable:!0,get:function(){return X$n.set}})});var Lnr=S(s9e=>{"use strict";Object.defineProperty(s9e,"__esModule",{value:!0});s9e.undiscriminatedUnion=tLn;var Y$n=mh(),Q$n=ST(),eLn=y_();function tLn(t){let e={parse:(r,n)=>$nr((o,i)=>o.parse(r,i),t,n),json:(r,n)=>$nr((o,i)=>o.json(r,i),t,n),getType:()=>Y$n.SchemaType.UNDISCRIMINATED_UNION};return Object.assign(Object.assign({},(0,Q$n.maybeSkipValidation)(e)),(0,eLn.getSchemaUtils)(e))}function $nr(t,e,r){let n=[];for(let[o,i]of e.entries()){let a=t(i,Object.assign(Object.assign({},r),{skipValidation:!1}));if(a.ok)return a;for(let s of a.errors)n.push({path:s.path,message:`[Variant ${o}] ${s.message}`})}return{ok:!1,errors:n}}});var Fnr=S(ESe=>{"use strict";Object.defineProperty(ESe,"__esModule",{value:!0});ESe.undiscriminatedUnion=void 0;var rLn=Lnr();Object.defineProperty(ESe,"undiscriminatedUnion",{enumerable:!0,get:function(){return rLn.undiscriminatedUnion}})});var knr=S(u9e=>{"use strict";Object.defineProperty(u9e,"__esModule",{value:!0});u9e.discriminant=nLn;function nLn(t,e){return{parsedDiscriminant:t,rawDiscriminant:e}}});var Bnr=S(_ne=>{"use strict";var oLn=_ne&&_ne.__rest||function(t,e){var r={};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&e.indexOf(n)<0&&(r[n]=t[n]);if(t!=null&&typeof Object.getOwnPropertySymbols=="function")for(var o=0,n=Object.getOwnPropertySymbols(t);oqnr({value:a,discriminant:r,transformedDiscriminant:n,transformDiscriminantValue:u=>{var l;return o.parse(u,{allowUnrecognizedEnumValues:s?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(l=s?.breadcrumbsPrefix)!==null&&l!==void 0?l:[],r]})},getAdditionalPropertiesSchema:u=>e[u],allowUnrecognizedUnionMembers:s?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(u,l)=>l.parse(u,s),breadcrumbsPrefix:s?.breadcrumbsPrefix}),json:(a,s)=>qnr({value:a,discriminant:n,transformedDiscriminant:r,transformDiscriminantValue:u=>{var l;return o.json(u,{allowUnrecognizedEnumValues:s?.allowUnrecognizedUnionMembers,breadcrumbsPrefix:[...(l=s?.breadcrumbsPrefix)!==null&&l!==void 0?l:[],n]})},getAdditionalPropertiesSchema:u=>e[u],allowUnrecognizedUnionMembers:s?.allowUnrecognizedUnionMembers,transformAdditionalProperties:(u,l)=>l.json(u,s),breadcrumbsPrefix:s?.breadcrumbsPrefix}),getType:()=>iLn.SchemaType.UNION};return Object.assign(Object.assign(Object.assign({},(0,lLn.maybeSkipValidation)(i)),(0,fLn.getSchemaUtils)(i)),(0,dLn.getObjectLikeUtils)(i))}function qnr({value:t,discriminant:e,transformedDiscriminant:r,transformDiscriminantValue:n,getAdditionalPropertiesSchema:o,allowUnrecognizedUnionMembers:i=!1,transformAdditionalProperties:a,breadcrumbsPrefix:s=[]}){if(!(0,sLn.isPlainObject)(t))return{ok:!1,errors:[{path:s,message:(0,aLn.getErrorMessageForIncorrectType)(t,"object")}]};let u=t,l=e,c=u[l],d=oLn(u,[typeof l=="symbol"?l:l+""]);if(c==null)return{ok:!1,errors:[{path:s,message:`Missing discriminant ("${e}")`}]};let f=n(c);if(!f.ok)return{ok:!1,errors:f.errors};let p=o(f.value);if(p==null)return i?{ok:!0,value:Object.assign({[r]:f.value},d)}:{ok:!1,errors:[{path:[...s,e],message:"Unexpected discriminant value"}]};let m=a(d,p);return m.ok?{ok:!0,value:Object.assign({[r]:c},m.value)}:m}});var Unr=S(tW=>{"use strict";Object.defineProperty(tW,"__esModule",{value:!0});tW.union=tW.discriminant=void 0;var mLn=knr();Object.defineProperty(tW,"discriminant",{enumerable:!0,get:function(){return mLn.discriminant}});var hLn=Bnr();Object.defineProperty(tW,"union",{enumerable:!0,get:function(){return hLn.union}})});var znr=S(gd=>{"use strict";var gLn=gd&&gd.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),b_=gd&&gd.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&gLn(e,t,r)};Object.defineProperty(gd,"__esModule",{value:!0});b_(Yrr(),gd);b_(enr(),gd);b_($Ge(),gd);b_(_nr(),gd);b_(t9e(),gd);b_(xnr(),gd);b_(XGe(),gd);b_(yne(),gd);b_(Rnr(),gd);b_(Nnr(),gd);b_(y_(),gd);b_(Dnr(),gd);b_(Fnr(),gd);b_(Unr(),gd)});var Hnr=S(l2=>{"use strict";var yLn=l2&&l2.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),bLn=l2&&l2.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&yLn(e,t,r)};Object.defineProperty(l2,"__esModule",{value:!0});bLn(znr(),l2)});var re=S(dg=>{"use strict";var Vnr=dg&&dg.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),_Ln=dg&&dg.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),vne=dg&&dg.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&Vnr(e,t,r)},vLn=dg&&dg.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var wne=fg&&fg.__awaiter||function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?i(c.value):o(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})},Sne=fg&&fg.__asyncValues||function(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var e=t[Symbol.asyncIterator],r;return e?e.call(t):(t=typeof __values=="function"?__values(t):t[Symbol.iterator](),r={},n("next"),n("throw"),n("return"),r[Symbol.asyncIterator]=function(){return this},r);function n(i){r[i]=t[i]&&function(a){return new Promise(function(s,u){a=t[i](a),o(s,u,a.done,a.value)})}}function o(i,a,s,u){Promise.resolve(u).then(function(l){i({value:l,done:s})},a)}},Rl=fg&&fg.__await||function(t){return this instanceof Rl?(this.v=t,this):new Rl(t)},Cne=fg&&fg.__asyncGenerator||function(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),o,i=[];return o=Object.create((typeof AsyncIterator=="function"?AsyncIterator:Object).prototype),s("next"),s("throw"),s("return",a),o[Symbol.asyncIterator]=function(){return this},o;function a(p){return function(m){return Promise.resolve(m).then(p,d)}}function s(p,m){n[p]&&(o[p]=function(h){return new Promise(function(g,y){i.push([p,h,g,y])>1||u(p,h)})},m&&(o[p]=m(o[p])))}function u(p,m){try{l(n[p](m))}catch(h){f(i[0][3],h)}}function l(p){p.value instanceof Rl?Promise.resolve(p.value.v).then(c,d):f(i[0][2],p)}function c(p){u("next",p)}function d(p){u("throw",p)}function f(p,m){p(m),i.shift(),i.length&&u(i[0][0],i[0][1])}};Object.defineProperty(fg,"__esModule",{value:!0});fg.LineDecoder=fg.StreamUtils=void 0;fg._iterSSEMessages=Jnr;fg._decodeChunks=CLn;fg.readableStreamAsyncIterable=d9e;var rW=Oc(),l9e=class t{constructor(e,r){this.iterator=e,this.controller=r}static fromSSEResponse(e,r){let n=!1;function o(){return Cne(this,arguments,function*(){var a,s,u,l;if(n)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let c=!1;try{try{for(var d=!0,f=Sne(Jnr(e,r)),p;p=yield Rl(f.next()),a=p.done,!a;d=!0){l=p.value,d=!1;let m=l;if(!c){if(m.data.startsWith("[DONE]")){c=!0;continue}if(m.event===null){let h;try{h=JSON.parse(m.data)}catch(g){throw console.error("Could not parse message into JSON:",m.data),console.error("From chunk:",m.raw),g}if(h&&h.error)throw new rW.CohereError({message:`Error: ${h.error}`});yield yield Rl(h)}else{let h;try{h=JSON.parse(m.data)}catch(g){throw console.error("Could not parse message into JSON:",m.data),console.error("From chunk:",m.raw),g}if(m.event=="error")throw new rW.CohereError({message:`Error: ${h.message}, ${h.error}`});yield yield Rl({event:m.event,data:h})}}}}catch(m){s={error:m}}finally{try{!d&&!a&&(u=f.return)&&(yield Rl(u.call(f)))}finally{if(s)throw s.error}}c=!0}catch(m){if(m instanceof Error&&m.name==="AbortError")return yield Rl(void 0);throw m}finally{c||r?.abort()}})}return new t(o,r)}static fromReadableStream(e,r){let n=!1;function o(){return Cne(this,arguments,function*(){var s,u,l,c;let d=new FF,f=d9e(e);try{for(var p=!0,m=Sne(f),h;h=yield Rl(m.next()),s=h.done,!s;p=!0){c=h.value,p=!1;let g=c;for(let y of d.decode(g))yield yield Rl(y)}}catch(g){u={error:g}}finally{try{!p&&!s&&(l=m.return)&&(yield Rl(l.call(m)))}finally{if(u)throw u.error}}for(let g of d.flush())yield yield Rl(g)})}function i(){return Cne(this,arguments,function*(){var s,u,l,c;if(n)throw new Error("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");n=!0;let d=!1;try{try{for(var f=!0,p=Sne(o()),m;m=yield Rl(p.next()),s=m.done,!s;f=!0){c=m.value,f=!1;let h=c;d||h&&(yield yield Rl(JSON.parse(h)))}}catch(h){u={error:h}}finally{try{!f&&!s&&(l=p.return)&&(yield Rl(l.call(p)))}finally{if(u)throw u.error}}d=!0}catch(h){if(h instanceof Error&&h.name==="AbortError")return yield Rl(void 0);throw h}finally{d||r?.abort()}})}return new t(i,r)}[Symbol.asyncIterator](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),o=i=>({next:()=>{if(i.length===0){let a=n.next();e.push(a),r.push(a)}return i.shift()}});return[new t(()=>o(e),this.controller),new t(()=>o(r),this.controller)]}toReadableStream(){let e=this,r,n=new TextEncoder;return new ReadableStream({start(){return wne(this,void 0,void 0,function*(){r=e[Symbol.asyncIterator]()})},pull(o){return wne(this,void 0,void 0,function*(){try{let{value:i,done:a}=yield r.next();if(a)return o.close();let s=n.encode(JSON.stringify(i)+` +`);o.enqueue(s)}catch(i){o.error(i)}})},cancel(){return wne(this,void 0,void 0,function*(){var o;yield(o=r.return)===null||o===void 0?void 0:o.call(r)})}})}};fg.StreamUtils=l9e;function Jnr(t,e){return Cne(this,arguments,function*(){var n,o,i,a;if(!t.body)throw e?.abort(),new rW.CohereError({message:"Attempted to iterate over a response with no body"});let s=new c9e,u=new FF,l=d9e(t.body);try{for(var c=!0,d=Sne(wLn(l)),f;f=yield Rl(d.next()),n=f.done,!n;c=!0){a=f.value,c=!1;let p=a;for(let m of u.decode(p)){let h=s.decode(m);h&&(yield yield Rl(h))}}}catch(p){o={error:p}}finally{try{!c&&!n&&(i=d.return)&&(yield Rl(i.call(d)))}finally{if(o)throw o.error}}for(let p of u.flush()){let m=s.decode(p);m&&(yield yield Rl(m))}})}function wLn(t){return Cne(this,arguments,function*(){var r,n,o,i;let a=new Uint8Array;try{for(var s=!0,u=Sne(t),l;l=yield Rl(u.next()),r=l.done,!r;s=!0){i=l.value,s=!1;let c=i;if(c==null)continue;let d=c instanceof ArrayBuffer?new Uint8Array(c):typeof c=="string"?new TextEncoder().encode(c):c,f=new Uint8Array(a.length+d.length);f.set(a),f.set(d,a.length),a=f;let p;for(;(p=SLn(a))!==-1;)yield yield Rl(a.slice(0,p)),a=a.slice(p)}}catch(c){n={error:c}}finally{try{!s&&!r&&(o=u.return)&&(yield Rl(o.call(u)))}finally{if(n)throw n.error}}a.length>0&&(yield yield Rl(a))})}function SLn(t){for(let n=0;n0&&(o=[this.buffer.join("")+o[0],...o.slice(1)],this.buffer=[]),n||(this.buffer=[o.pop()||""]),o)}decodeText(e){var r;if(e==null)return"";if(typeof e=="string")return e;if(typeof Buffer<"u"){if(e instanceof Buffer)return e.toString();if(e instanceof Uint8Array)return Buffer.from(e).toString();throw new rW.CohereError({message:`Unexpected: received non-Uint8Array (${e.constructor.name}) stream chunk in an environment with a global "Buffer" defined, which this library assumes to be Node. Please report this error.`})}if(typeof TextDecoder<"u"){if(e instanceof Uint8Array||e instanceof ArrayBuffer)return(r=this.textDecoder)!==null&&r!==void 0||(this.textDecoder=new TextDecoder("utf8")),this.textDecoder.decode(e);throw new rW.CohereError({message:`Unexpected: received non-Uint8Array/ArrayBuffer (${e.constructor.name}) in a web platform. Please report this error.`})}throw new rW.CohereError({message:"Unexpected: neither Buffer nor TextDecoder are available as globals. Please report this error."})}flush(){if(!this.buffer.length&&!this.trailingCR)return[];let e=[this.buffer.join("")];return this.buffer=[],this.trailingCR=!1,e}};fg.LineDecoder=FF;FF.NEWLINE_CHARS=new Set([` +`,"\r"]);FF.NEWLINE_REGEXP=/\r\n|[\n\r]/g;function CLn(t){let e=new FF,r=[];for(let n of t)r.push(...e.decode(n));return r}function xLn(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}function d9e(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{next(){return wne(this,void 0,void 0,function*(){try{let r=yield e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}})},return(){return wne(this,void 0,void 0,function*(){let r=e.cancel();return e.releaseLock(),yield r,{done:!0,value:void 0}})},[Symbol.asyncIterator](){return this}}}});var One=S(CT=>{"use strict";var OLn=CT&&CT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),TLn=CT&&CT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ELn=CT&&CT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var PLn=xT&&xT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),MLn=xT&&xT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),RLn=xT&&xT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var ILn=OT&&OT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),NLn=OT&&OT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),jLn=OT&&OT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var $Ln=TT&&TT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),LLn=TT&&TT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),FLn=TT&&TT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var qLn=ET&&ET.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),BLn=ET&&ET.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ULn=ET&&ET.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var zLn=PT&&PT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),HLn=PT&&PT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),VLn=PT&&PT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var WLn=MT&&MT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),GLn=MT&&MT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ZLn=MT&&MT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var YLn=RT&&RT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),QLn=RT&&RT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),eFn=RT&&RT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var nFn=AT&&AT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),oFn=AT&&AT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),iFn=AT&&AT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var sFn=IT&&IT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),uFn=IT&&IT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),lFn=IT&&IT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var dFn=NT&&NT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),fFn=NT&&NT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pFn=NT&&NT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var gFn=jT&&jT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),yFn=jT&&jT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),bFn=jT&&jT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var wFn=DT&&DT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),SFn=DT&&DT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),CFn=DT&&DT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var TFn=$T&&$T.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),EFn=$T&&$T.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),PFn=$T&&$T.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var MFn=LT&<.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),RFn=LT&<.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),AFn=LT&<.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var jFn=FT&&FT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),DFn=FT&&FT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$Fn=FT&&FT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var kFn=kT&&kT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),qFn=kT&&kT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),BFn=kT&&kT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var UFn=qT&&qT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),zFn=qT&&qT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),HFn=qT&&qT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var WFn=BT&&BT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),GFn=BT&&BT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ZFn=BT&&BT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var YFn=UT&&UT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),QFn=UT&&UT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ekn=UT&&UT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var tkn=zT&&zT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rkn=zT&&zT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nkn=zT&&zT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var akn=HT&&HT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),skn=HT&&HT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ukn=HT&&HT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var fkn=VT&&VT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),pkn=VT&&VT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mkn=VT&&VT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var hkn=JT&&JT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),gkn=JT&&JT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ykn=JT&&JT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var _kn=KT&&KT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),vkn=KT&&KT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),wkn=KT&&KT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Ckn=WT&&WT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),xkn=WT&&WT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Okn=WT&&WT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Pkn=GT&>.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Mkn=GT&>.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Rkn=GT&>.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Nkn=ZT&&ZT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),jkn=ZT&&ZT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Dkn=ZT&&ZT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var $kn=XT&&XT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Lkn=XT&&XT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Fkn=XT&&XT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Bkn=YT&&YT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Ukn=YT&&YT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),zkn=YT&&YT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Vkn=QT&&QT.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Jkn=QT&&QT.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Kkn=QT&&QT.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Zkn=eE&&eE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Xkn=eE&&eE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Ykn=eE&&eE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var tqn=tE&&tE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rqn=tE&&tE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nqn=tE&&tE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var iqn=rE&&rE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),aqn=rE&&rE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),sqn=rE&&rE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var uqn=nE&&nE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),lqn=nE&&nE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),cqn=nE&&nE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var dqn=oE&&oE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),fqn=oE&&oE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pqn=oE&&oE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot,untransform:t=>t})});var G9e=S(iE=>{"use strict";var yqn=iE&&iE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),bqn=iE&&iE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_qn=iE&&iE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var wqn=aE&&aE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Sqn=aE&&aE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Cqn=aE&&aE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Tqn=sE&&sE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Eqn=sE&&sE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Pqn=sE&&sE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Aqn=uE&&uE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Iqn=uE&&uE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Nqn=uE&&uE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var $qn=lE&&lE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Lqn=lE&&lE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Fqn=lE&&lE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Bqn=cE&&cE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Uqn=cE&&cE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),zqn=cE&&cE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Vqn=dE&&dE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Jqn=dE&&dE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Kqn=dE&&dE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Gqn=fE&&fE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Zqn=fE&&fE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Xqn=fE&&fE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Yqn=pE&&pE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Qqn=pE&&pE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),eBn=pE&&pE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var tBn=mE&&mE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rBn=mE&&mE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nBn=mE&&mE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var aBn=hE&&hE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),sBn=hE&&hE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),uBn=hE&&hE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var dBn=gE&&gE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),fBn=gE&&gE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pBn=gE&&gE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var gBn=yE&&yE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),yBn=yE&&yE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),bBn=yE&&yE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var vBn=bE&&bE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),wBn=bE&&bE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),SBn=bE&&bE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var xBn=_E&&_E.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),OBn=_E&&_E.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),TBn=_E&&_E.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot,untransform:t=>t})});var i7e=S(vE=>{"use strict";var qBn=vE&&vE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),BBn=vE&&vE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),UBn=vE&&vE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var HBn=wE&&wE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),VBn=wE&&wE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),JBn=wE&&wE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var WBn=SE&&SE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),GBn=SE&&SE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ZBn=SE&&SE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var YBn=CE&&CE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),QBn=CE&&CE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),eUn=CE&&CE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var tUn=xE&&xE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rUn=xE&&xE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nUn=xE&&xE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var oUn=OE&&OE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),iUn=OE&&OE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),aUn=OE&&OE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot,untransform:t=>t})});var l7e=S(TE=>{"use strict";var cUn=TE&&TE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),dUn=TE&&TE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),fUn=TE&&TE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var gUn=EE&&EE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),yUn=EE&&EE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),bUn=EE&&EE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var CUn=PE&&PE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),xUn=PE&&PE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),OUn=PE&&PE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var EUn=ME&&ME.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),PUn=ME&&ME.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),MUn=ME&&ME.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var RUn=RE&&RE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),AUn=RE&&RE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),IUn=RE&&RE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var NUn=AE&&AE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),jUn=AE&&AE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),DUn=AE&&AE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var $Un=IE&&IE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),LUn=IE&&IE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),FUn=IE&&IE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var kUn=NE&&NE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),qUn=NE&&NE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),BUn=NE&&NE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var VUn=jE&&jE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),JUn=jE&&jE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),KUn=jE&&jE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var ZUn=pg&&pg.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),CC=pg&&pg.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZUn(e,t,r)};Object.defineProperty(pg,"__esModule",{value:!0});CC(f9e(),pg);CC(p9e(),pg);CC(m9e(),pg);CC(dor(),pg);CC(i7e(),pg);CC(a7e(),pg);CC(s7e(),pg);CC(gor(),pg);CC(c7e(),pg);CC(d7e(),pg);CC(yor(),pg)});var y7e=S(DE=>{"use strict";var XUn=DE&&DE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),YUn=DE&&DE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),QUn=DE&&DE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var tzn=$E&&$E.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rzn=$E&&$E.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nzn=$E&&$E.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var izn=LE&&LE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),azn=LE&&LE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),szn=LE&&LE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var lzn=FE&&FE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),czn=FE&&FE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),dzn=FE&&FE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot,untransform:t=>t})});var S7e=S(kE=>{"use strict";var hzn=kE&&kE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),gzn=kE&&kE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),yzn=kE&&kE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var _zn=qE&&qE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),vzn=qE&&qE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),wzn=qE&&qE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var xzn=BE&&BE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Ozn=BE&&BE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Tzn=BE&&BE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot,untransform:t=>t})});var T7e=S(UE=>{"use strict";var Rzn=UE&&UE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Azn=UE&&UE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Izn=UE&&UE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var jzn=zE&&zE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Dzn=zE&&zE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$zn=zE&&zE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var qzn=HE&&HE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Bzn=HE&&HE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Uzn=HE&&HE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot,untransform:t=>t})});var R7e=S(VE=>{"use strict";var Vzn=VE&&VE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Jzn=VE&&VE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Kzn=VE&&VE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Gzn=JE&&JE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Zzn=JE&&JE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Xzn=JE&&JE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var e4n=KE&&KE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),t4n=KE&&KE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r4n=KE&&KE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var i4n=WE&&WE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),a4n=WE&&WE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s4n=WE&&WE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot,untransform:t=>t})});var D7e=S(GE=>{"use strict";var d4n=GE&&GE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),f4n=GE&&GE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),p4n=GE&&GE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var h4n=ZE&&ZE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),g4n=ZE&&ZE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),y4n=ZE&&ZE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var _4n=XE&&XE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),v4n=XE&&XE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),w4n=XE&&XE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot,untransform:t=>t})});var DSe=S(YE=>{"use strict";var E4n=YE&&YE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),P4n=YE&&YE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),M4n=YE&&YE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var I4n=QE&&QE.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),N4n=QE&&QE.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),j4n=QE&&QE.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var D4n=eP&&eP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),$4n=eP&&eP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),L4n=eP&&eP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var k4n=tP&&tP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),q4n=tP&&tP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),B4n=tP&&tP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var z4n=rP&&rP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),H4n=rP&&rP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),V4n=rP&&rP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var W4n=nP&&nP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),G4n=nP&&nP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Z4n=nP&&nP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Y4n=oP&&oP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Q4n=oP&&oP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),e2n=oP&&oP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var t2n=iP&&iP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),r2n=iP&&iP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),n2n=iP&&iP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot,untransform:t=>t})});var z7e=S(aP=>{"use strict";var s2n=aP&&aP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),u2n=aP&&aP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),l2n=aP&&aP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var d2n=sP&&sP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),f2n=sP&&sP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),p2n=sP&&sP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var h2n=uP&&uP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),g2n=uP&&uP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),y2n=uP&&uP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var T2n=lP&&lP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),E2n=lP&&lP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),P2n=lP&&lP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var L2n=cP&&cP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),F2n=cP&&cP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),k2n=cP&&cP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var B2n=dP&&dP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),U2n=dP&&dP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),z2n=dP&&dP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var H2n=fP&&fP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),V2n=fP&&fP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),J2n=fP&&fP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var W2n=pP&&pP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),G2n=pP&&pP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Z2n=pP&&pP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var X2n=mP&&mP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Y2n=mP&&mP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Q2n=mP&&mP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot,untransform:t=>t})});var G7e=S(hP=>{"use strict";var nHn=hP&&hP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),oHn=hP&&hP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),iHn=hP&&hP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var sHn=gP&&gP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),uHn=gP&&gP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),lHn=gP&&gP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var dHn=yP&&yP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),fHn=yP&&yP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pHn=yP&&yP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var bHn=bP&&bP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),_Hn=bP&&bP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),vHn=bP&&bP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";Object.defineProperty(_P,"__esModule",{value:!0});_P.V2RerankRequest=_P.V2EmbedRequest=_P.V2ChatRequest=_P.V2ChatStreamRequest=void 0;var wHn=wor();Object.defineProperty(_P,"V2ChatStreamRequest",{enumerable:!0,get:function(){return wHn.V2ChatStreamRequest}});var SHn=Sor();Object.defineProperty(_P,"V2ChatRequest",{enumerable:!0,get:function(){return SHn.V2ChatRequest}});var CHn=Eor();Object.defineProperty(_P,"V2EmbedRequest",{enumerable:!0,get:function(){return CHn.V2EmbedRequest}});var xHn=Por();Object.defineProperty(_P,"V2RerankRequest",{enumerable:!0,get:function(){return xHn.V2RerankRequest}})});var Mor=S(p2=>{"use strict";var OHn=p2&&p2.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),THn=p2&&p2.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&OHn(e,t,r)};Object.defineProperty(p2,"__esModule",{value:!0});THn(Z7e(),p2)});var Aor=S(BF=>{"use strict";var EHn=BF&&BF.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Ror=BF&&BF.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&EHn(e,t,r)};Object.defineProperty(BF,"__esModule",{value:!0});Ror(g7e(),BF);Ror(Mor(),BF)});var X7e=S(vP=>{"use strict";var PHn=vP&&vP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),MHn=vP&&vP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),RHn=vP&&vP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var IHn=m2&&m2.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),NHn=m2&&m2.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&IHn(e,t,r)};Object.defineProperty(m2,"__esModule",{value:!0});NHn(X7e(),m2)});var Ior=S(wP=>{"use strict";var jHn=wP&&wP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),DHn=wP&&wP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$Hn=wP&&wP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";Object.defineProperty(qSe,"__esModule",{value:!0});qSe.CreateEmbedJobRequest=void 0;var qHn=Ior();Object.defineProperty(qSe,"CreateEmbedJobRequest",{enumerable:!0,get:function(){return qHn.CreateEmbedJobRequest}})});var Nor=S(h2=>{"use strict";var BHn=h2&&h2.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),UHn=h2&&h2.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&BHn(e,t,r)};Object.defineProperty(h2,"__esModule",{value:!0});UHn(Q7e(),h2)});var Dor=S(zF=>{"use strict";var zHn=zF&&zF.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),jor=zF&&zF.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&zHn(e,t,r)};Object.defineProperty(zF,"__esModule",{value:!0});jor(Y7e(),zF);jor(Nor(),zF)});var eZe=S(SP=>{"use strict";var HHn=SP&&SP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),VHn=SP&&SP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),JHn=SP&&SP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var WHn=CP&&CP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),GHn=CP&&CP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ZHn=CP&&CP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var YHn=xP&&xP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),QHn=xP&&xP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),eVn=xP&&xP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var tVn=OP&&OP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rVn=OP&&OP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nVn=OP&&OP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var sVn=TP&&TP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),uVn=TP&&TP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),lVn=TP&&TP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var dVn=EP&&EP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),fVn=EP&&EP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pVn=EP&&EP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var mVn=PP&&PP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),hVn=PP&&PP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),gVn=PP&&PP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var yVn=MP&&MP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),bVn=MP&&MP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_Vn=MP&&MP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var SVn=RP&&RP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),USe=RP&&RP.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&SVn(e,t,r)};Object.defineProperty(RP,"__esModule",{value:!0});USe(Lor(),RP);USe(kor(),RP);USe(qor(),RP);USe(Bor(),RP)});var Uor=S(AP=>{"use strict";var CVn=AP&&AP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),xVn=AP&&AP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),OVn=AP&&AP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var TVn=IP&&IP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),EVn=IP&&IP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),PVn=IP&&IP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var MVn=HF&&HF.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Hor=HF&&HF.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&MVn(e,t,r)};Object.defineProperty(HF,"__esModule",{value:!0});Hor(oZe(),HF);Hor(zor(),HF)});var aZe=S(NP=>{"use strict";var RVn=NP&&NP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),AVn=NP&&NP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),IVn=NP&&NP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var jVn=jP&&jP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),DVn=jP&&jP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$Vn=jP&&jP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var FVn=DP&&DP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),kVn=DP&&DP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qVn=DP&&DP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var zVn=$P&&$P.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),HVn=$P&&$P.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),VVn=$P&&$P.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var KVn=LP&&LP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),WVn=LP&&LP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),GVn=LP&&LP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var XVn=FP&&FP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),YVn=FP&&FP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),QVn=FP&&FP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var eJn=kP&&kP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),tJn=kP&&kP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),rJn=kP&&kP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var aJn=qP&&qP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),sJn=qP&&qP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),uJn=qP&&qP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var cJn=BP&&BP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),dJn=BP&&BP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),fJn=BP&&BP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var hJn=UP&&UP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),gJn=UP&&UP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),yJn=UP&&UP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var _Jn=zP&&zP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),vJn=zP&&zP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),wJn=zP&&zP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var CJn=HP&&HP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),xJn=HP&&HP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),OJn=HP&&HP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var EJn=VP&&VP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),PJn=VP&&VP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),MJn=VP&&VP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var RJn=JP&&JP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),AJn=JP&&JP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),IJn=JP&&JP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var jJn=KP&&KP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),DJn=KP&&KP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),$Jn=KP&&KP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var FJn=WP&&WP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),kJn=WP&&WP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qJn=WP&&WP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var UJn=GP&&GP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),zJn=GP&&GP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),HJn=GP&&GP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var VJn=ZP&&ZP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),JJn=ZP&&ZP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),KJn=ZP&&ZP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var GJn=Nl&&Nl.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),hh=Nl&&Nl.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&GJn(e,t,r)};Object.defineProperty(Nl,"__esModule",{value:!0});hh(aZe(),Nl);hh(sZe(),Nl);hh(uZe(),Nl);hh(lZe(),Nl);hh(cZe(),Nl);hh(dZe(),Nl);hh(HSe(),Nl);hh($ne(),Nl);hh(uW(),Nl);hh(Jor(),Nl);hh(Wor(),Nl);hh(Zor(),Nl);hh(Xor(),Nl);hh(Qor(),Nl);hh(pZe(),Nl);hh(eir(),Nl);hh(mZe(),Nl);hh(tir(),Nl)});var rir=S(y2=>{"use strict";var ZJn=y2&&y2.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),XJn=y2&&y2.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&ZJn(e,t,r)};Object.defineProperty(y2,"__esModule",{value:!0});XJn(hZe(),y2)});var oir=S(Hv=>{"use strict";var nir=Hv&&Hv.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),YJn=Hv&&Hv.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),QJn=Hv&&Hv.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var t3n=XP&&XP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),r3n=XP&&XP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),n3n=XP&&XP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";Object.defineProperty(VSe,"__esModule",{value:!0});VSe.FinetuningUpdateFinetunedModelRequest=void 0;var a3n=air();Object.defineProperty(VSe,"FinetuningUpdateFinetunedModelRequest",{enumerable:!0,get:function(){return a3n.FinetuningUpdateFinetunedModelRequest}})});var sir=S(b2=>{"use strict";var s3n=b2&&b2.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),u3n=b2&&b2.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&s3n(e,t,r)};Object.defineProperty(b2,"__esModule",{value:!0});u3n(gZe(),b2)});var lir=S(JF=>{"use strict";var l3n=JF&&JF.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),uir=JF&&JF.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&l3n(e,t,r)};Object.defineProperty(JF,"__esModule",{value:!0});uir(oir(),JF);uir(sir(),JF)});var JSe=S(QP=>{"use strict";var c3n=QP&&QP.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),d3n=QP&&QP.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),f3n=QP&&QP.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var p3n=eM&&eM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),m3n=eM&&eM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),h3n=eM&&eM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var y3n=tM&&tM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),b3n=tM&&tM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),_3n=tM&&tM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var w3n=nM&&nM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),S3n=nM&&nM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),C3n=nM&&nM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var T3n=oM&&oM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),E3n=oM&&oM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),P3n=oM&&oM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";Object.defineProperty(cW,"__esModule",{value:!0});cW.UpdateConnectorRequest=cW.CreateConnectorRequest=void 0;var A3n=dir();Object.defineProperty(cW,"CreateConnectorRequest",{enumerable:!0,get:function(){return A3n.CreateConnectorRequest}});var I3n=fir();Object.defineProperty(cW,"UpdateConnectorRequest",{enumerable:!0,get:function(){return I3n.UpdateConnectorRequest}})});var pir=S(_2=>{"use strict";var N3n=_2&&_2.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),j3n=_2&&_2.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&N3n(e,t,r)};Object.defineProperty(_2,"__esModule",{value:!0});j3n(bZe(),_2)});var mir=S(v2=>{"use strict";var D3n=v2&&v2.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),$3n=v2&&v2.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&D3n(e,t,r)};Object.defineProperty(v2,"__esModule",{value:!0});$3n(pir(),v2)});var gir=S(Cu=>{"use strict";var hir=Cu&&Cu.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),L3n=Cu&&Cu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),kne=Cu&&Cu.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var F3n=iM&&iM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),k3n=iM&&iM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),q3n=iM&&iM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var U3n=aM&&aM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),z3n=aM&&aM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),H3n=aM&&aM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var J3n=sM&&sM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),K3n=sM&&sM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),W3n=sM&&sM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Z3n=uM&&uM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),X3n=uM&&uM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Y3n=uM&&uM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var e6n=lM&&lM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),t6n=lM&&lM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r6n=lM&&lM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var n6n=cM&&cM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),o6n=cM&&cM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),i6n=cM&&cM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var u6n=dM&&dM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),l6n=dM&&dM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),c6n=dM&&dM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var d6n=fM&&fM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),f6n=fM&&fM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),p6n=fM&&fM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var g6n=pM&&pM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),y6n=pM&&pM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),b6n=pM&&pM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var _6n=mM&&mM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),v6n=mM&&mM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),w6n=mM&&mM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var O6n=hM&&hM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),T6n=hM&&hM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),E6n=hM&&hM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var M6n=gM&&gM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),R6n=gM&&gM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),A6n=gM&&gM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var N6n=yM&&yM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),j6n=yM&&yM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),D6n=yM&&yM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var L6n=bM&&bM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),F6n=bM&&bM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),k6n=bM&&bM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var U6n=_M&&_M.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),z6n=_M&&_M.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),H6n=_M&&_M.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var V6n=vM&&vM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),J6n=vM&&vM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),K6n=vM&&vM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var Z6n=wM&&wM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),X6n=wM&&wM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Y6n=wM&&wM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var e5n=SM&&SM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),t5n=SM&&SM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r5n=SM&&SM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var o5n=CM&&CM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),i5n=CM&&CM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),a5n=CM&&CM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var u5n=xM&&xM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),l5n=xM&&xM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),c5n=xM&&xM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var f5n=OM&&OM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),p5n=OM&&OM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),m5n=OM&&OM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var g5n=TM&&TM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),y5n=TM&&TM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),b5n=TM&&TM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot,untransform:t=>t})});var FZe=S(EM=>{"use strict";var w5n=EM&&EM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),S5n=EM&&EM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),C5n=EM&&EM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var I5n=PM&&PM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),N5n=PM&&PM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),j5n=PM&&PM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var F5n=MM&&MM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),k5n=MM&&MM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),q5n=MM&&MM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var B5n=RM&&RM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),U5n=RM&&RM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),z5n=RM&&RM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var J5n=AM&&AM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),K5n=AM&&AM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),W5n=AM&&AM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot,untransform:t=>t})});var zZe=S(IM=>{"use strict";var oKn=IM&&IM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),iKn=IM&&IM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),aKn=IM&&IM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var uKn=NM&&NM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),lKn=NM&&NM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),cKn=NM&&NM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var fKn=jM&&jM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),pKn=jM&&jM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),mKn=jM&&jM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var gKn=DM&&DM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),yKn=DM&&DM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),bKn=DM&&DM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var vKn=$M&&$M.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),wKn=$M&&$M.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),SKn=$M&&$M.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var xKn=LM&&LM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),OKn=LM&&LM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),TKn=LM&&LM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var PKn=FM&&FM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),MKn=FM&&FM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),RKn=FM&&FM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var IKn=kM&&kM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),NKn=kM&&kM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),jKn=kM&&kM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var $Kn=qM&&qM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),LKn=qM&&qM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),FKn=qM&&qM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var qKn=BM&&BM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),BKn=BM&&BM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),UKn=BM&&BM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var JKn=UM&&UM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),KKn=UM&&UM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),WKn=UM&&UM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var XKn=zM&&zM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),YKn=zM&&zM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),QKn=zM&&zM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot,untransform:t=>t})});var QZe=S(HM=>{"use strict";var nWn=HM&&HM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),oWn=HM&&HM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),iWn=HM&&HM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var sWn=VM&&VM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),uWn=VM&&VM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),lWn=VM&&VM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var dWn=JM&&JM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),fWn=JM&&JM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pWn=JM&&JM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var mWn=KM&&KM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),hWn=KM&&KM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),gWn=KM&&KM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var bWn=WM&&WM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),_Wn=WM&&WM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),vWn=WM&&WM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var CWn=GM&&GM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),xWn=GM&&GM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),OWn=GM&&GM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var EWn=ZM&&ZM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),PWn=ZM&&ZM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),MWn=ZM&&ZM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var RWn=XM&&XM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),AWn=XM&&XM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),IWn=XM&&XM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var DWn=YM&&YM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),$Wn=YM&&YM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),LWn=YM&&YM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var FWn=QM&&QM.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),kWn=QM&&QM.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),qWn=QM&&QM.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var HWn=eR&&eR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),VWn=eR&&eR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),JWn=eR&&eR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot,untransform:t=>t})});var lXe=S(tR=>{"use strict";var GWn=tR&&tR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ZWn=tR&&tR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),XWn=tR&&tR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var YWn=rR&&rR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),QWn=rR&&rR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),e8n=rR&&rR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var r8n=nR&&nR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),n8n=nR&&nR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o8n=nR&&nR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var i8n=oR&&oR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),a8n=oR&&oR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s8n=oR&&oR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var l8n=iR&&iR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),c8n=iR&&iR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),d8n=iR&&iR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var m8n=aR&&aR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),h8n=aR&&aR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),g8n=aR&&aR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var b8n=sR&&sR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),_8n=sR&&sR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),v8n=sR&&sR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var w8n=uR&&uR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),S8n=uR&&uR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),C8n=uR&&uR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var O8n=lR&&lR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),T8n=lR&&lR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),E8n=lR&&lR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var R8n=cR&&cR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),A8n=cR&&cR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),I8n=cR&&cR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var D8n=dR&&dR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),$8n=dR&&dR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),L8n=dR&&dR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var k8n=fR&&fR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),q8n=fR&&fR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),B8n=fR&&fR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var z8n=pR&&pR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),H8n=pR&&pR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),V8n=pR&&pR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var K8n=mR&&mR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),W8n=mR&&mR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),G8n=mR&&mR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var X8n=hR&&hR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Y8n=hR&&hR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Q8n=hR&&hR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var tGn=gR&&gR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),rGn=gR&&gR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),nGn=gR&&gR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var iGn=yR&&yR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),aGn=yR&&yR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),sGn=yR&&yR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var uGn=bR&&bR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),lGn=bR&&bR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),cGn=bR&&bR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var dGn=_R&&_R.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),fGn=_R&&_R.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),pGn=_R&&_R.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var mGn=vR&&vR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),hGn=vR&&vR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),gGn=vR&&vR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var bGn=wR&&wR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),_Gn=wR&&wR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),vGn=wR&&wR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var SGn=SR&&SR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),CGn=SR&&SR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),xGn=SR&&SR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var OGn=CR&&CR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),TGn=CR&&CR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),EGn=CR&&CR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;ot,untransform:t=>t})});var TXe=S(xR=>{"use strict";var AGn=xR&&xR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),IGn=xR&&xR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),NGn=xR&&xR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var DGn=OR&&OR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),$Gn=OR&&OR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),LGn=OR&&OR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var kGn=TR&&TR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),qGn=TR&&TR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),BGn=TR&&TR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var VGn=ER&&ER.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),JGn=ER&&ER.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),KGn=ER&&ER.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var GGn=PR&&PR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ZGn=PR&&PR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),XGn=PR&&PR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var QGn=MR&&MR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),e9n=MR&&MR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),t9n=MR&&MR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var r9n=RR&&RR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),n9n=RR&&RR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),o9n=RR&&RR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var i9n=AR&&AR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),a9n=AR&&AR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s9n=AR&&AR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var u9n=IR&&IR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),l9n=IR&&IR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),c9n=IR&&IR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var d9n=NR&&NR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),f9n=NR&&NR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),p9n=NR&&NR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var m9n=jR&&jR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),h9n=jR&&jR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),g9n=jR&&jR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var b9n=DR&&DR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),_9n=DR&&DR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),v9n=DR&&DR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var w9n=$R&&$R.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),S9n=$R&&$R.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),C9n=$R&&$R.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var O9n=FR&&FR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),T9n=FR&&FR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),E9n=FR&&FR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var P9n=kR&&kR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),M9n=kR&&kR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),R9n=kR&&kR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var I9n=qR&&qR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),N9n=qR&&qR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),j9n=qR&&qR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var L9n=BR&&BR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),F9n=BR&&BR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),k9n=BR&&BR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var B9n=UR&&UR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),U9n=UR&&UR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),z9n=UR&&UR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var J9n=zR&&zR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),K9n=zR&&zR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),W9n=zR&&zR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var X9n=HR&&HR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Y9n=HR&&HR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Q9n=HR&&HR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var e7n=VR&&VR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),t7n=VR&&VR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),r7n=VR&&VR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var i7n=JR&&JR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),a7n=JR&&JR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),s7n=JR&&JR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var u7n=KR&&KR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),l7n=KR&&KR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),c7n=KR&&KR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var f7n=WR&&WR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),p7n=WR&&WR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),m7n=WR&&WR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var h7n=GR&&GR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),g7n=GR&&GR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),y7n=GR&&GR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var _7n=fe&&fe.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),ge=fe&&fe.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&_7n(e,t,r)};Object.defineProperty(fe,"__esModule",{value:!0});ge(_Ze(),fe);ge(vZe(),fe);ge(wZe(),fe);ge(Sir(),fe);ge(zZe(),fe);ge(HZe(),fe);ge(VZe(),fe);ge(FZe(),fe);ge(JZe(),fe);ge(KZe(),fe);ge(xir(),fe);ge(QZe(),fe);ge(eXe(),fe);ge(Oir(),fe);ge(oXe(),fe);ge(Eir(),fe);ge(cXe(),fe);ge(dXe(),fe);ge(fXe(),fe);ge(Rir(),fe);ge(mXe(),fe);ge(hXe(),fe);ge(gXe(),fe);ge(yXe(),fe);ge(Iir(),fe);ge(_Xe(),fe);ge(vXe(),fe);ge(wXe(),fe);ge(Nir(),fe);ge(jir(),fe);ge($ir(),fe);ge(Lir(),fe);ge(fW(),fe);ge(jZe(),fe);ge(zne(),fe);ge($Ze(),fe);ge(Hne(),fe);ge(i0e(),fe);ge(dW(),fe);ge(CXe(),fe);ge(s0e(),fe);ge(xXe(),fe);ge(OXe(),fe);ge(l0e(),fe);ge(RZe(),fe);ge(XSe(),fe);ge(qne(),fe);ge(TZe(),fe);ge(GSe(),fe);ge(pW(),fe);ge(f7e(),fe);ge(p7e(),fe);ge(m7e(),fe);ge(__(),fe);ge(SC(),fe);ge(CZe(),fe);ge(OZe(),fe);ge(PZe(),fe);ge(MZe(),fe);ge(AZe(),fe);ge(IZe(),fe);ge(NZe(),fe);ge(kZe(),fe);ge(qZe(),fe);ge(UZe(),fe);ge(ASe(),fe);ge(f2(),fe);ge(y7e(),fe);ge(b7e(),fe);ge(_7e(),fe);ge(v7e(),fe);ge(S7e(),fe);ge(C7e(),fe);ge(D9e(),fe);ge(Tne(),fe);ge(ISe(),fe);ge(J9e(),fe);ge(K9e(),fe);ge(W9e(),fe);ge(G9e(),fe);ge(Pne(),fe);ge(x7e(),fe);ge(T7e(),fe);ge(E7e(),fe);ge(P7e(),fe);ge(R7e(),fe);ge(A7e(),fe);ge(One(),fe);ge(I7e(),fe);ge(N7e(),fe);ge(D7e(),fe);ge(L7e(),fe);ge(F7e(),fe);ge(DSe(),fe);ge(k7e(),fe);ge($Se(),fe);ge(q7e(),fe);ge(LSe(),fe);ge(B7e(),fe);ge(U7e(),fe);ge(FSe(),fe);ge(z7e(),fe);ge(kSe(),fe);ge(MSe(),fe);ge(u7e(),fe);ge(l7e(),fe);ge(e7e(),fe);ge(t7e(),fe);ge(RSe(),fe);ge(PSe(),fe);ge(Uv(),fe);ge(h9e(),fe);ge(g9e(),fe);ge(y9e(),fe);ge(b9e(),fe);ge(v9e(),fe);ge(w9e(),fe);ge(S9e(),fe);ge(C9e(),fe);ge(O9e(),fe);ge(T9e(),fe);ge(E9e(),fe);ge(P9e(),fe);ge(M9e(),fe);ge(A9e(),fe);ge(I9e(),fe);ge(N9e(),fe);ge(L9e(),fe);ge(F9e(),fe);ge(k9e(),fe);ge(q9e(),fe);ge(B9e(),fe);ge(U9e(),fe);ge(z9e(),fe);ge(H9e(),fe);ge(V9e(),fe);ge(Z9e(),fe);ge(X9e(),fe);ge(Y9e(),fe);ge(Q9e(),fe);ge(n7e(),fe);ge(o7e(),fe);ge(rXe(),fe);ge(nXe(),fe);ge(Jne(),fe);ge(WZe(),fe);ge(GZe(),fe);ge(ZZe(),fe);ge(XZe(),fe);ge(YZe(),fe);ge(Nne(),fe);ge(jne(),fe);ge(n0e(),fe);ge(iXe(),fe);ge(aXe(),fe);ge(sXe(),fe);ge(V7e(),fe);ge(J7e(),fe);ge(K7e(),fe);ge(W7e(),fe);ge(G7e(),fe);ge(TXe(),fe);ge(EXe(),fe);ge(PXe(),fe);ge(Fir(),fe);ge(kir(),fe);ge(lXe(),fe);ge(IXe(),fe);ge(tZe(),fe);ge(eZe(),fe);ge(rZe(),fe);ge(qir(),fe);ge(Bir(),fe);ge(Uir(),fe);ge(jXe(),fe);ge(zir(),fe);ge($Xe(),fe);ge(Vir(),fe);ge(BSe(),fe);ge(LXe(),fe);ge(FXe(),fe);ge(wW(),fe);ge(Jir(),fe);ge(JSe(),fe);ge(yZe(),fe);ge(KSe(),fe);ge(Kir(),fe);ge(Wir(),fe);ge(Gir(),fe);ge(Zir(),fe);ge(Xir(),fe);ge(BXe(),fe);ge(UXe(),fe);ge(Qir(),fe)});var tar=S(ZR=>{"use strict";var v7n=ZR&&ZR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),w7n=ZR&&ZR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),S7n=ZR&&ZR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var I7n=XR&&XR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),N7n=XR&&XR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),j7n=XR&&XR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var H7n=YR&&YR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),V7n=YR&&YR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),J7n=YR&&YR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var G7n=QR&&QR.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),Z7n=QR&&QR.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),X7n=QR&&QR.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var eZn=eA&&eA.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),tZn=eA&&eA.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),rZn=eA&&eA.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var aZn=tA&&tA.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),sZn=tA&&tA.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),uZn=tA&&tA.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var cZn=rA&&rA.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),dZn=rA&&rA.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),fZn=rA&&rA.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var hZn=nA&&nA.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),gZn=nA&&nA.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),yZn=nA&&nA.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var wZn=oA&&oA.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),SZn=oA&&oA.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),CZn=oA&&oA.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var xZn=iA&&iA.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),OZn=iA&&iA.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),TZn=iA&&iA.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";Object.defineProperty(Pc,"__esModule",{value:!0});Pc.DetokenizeRequest=Pc.TokenizeRequest=Pc.SummarizeRequest=Pc.ClassifyRequest=Pc.RerankRequest=Pc.EmbedRequest=Pc.GenerateRequest=Pc.GenerateStreamRequest=Pc.ChatRequest=Pc.ChatStreamRequest=void 0;var EZn=tar();Object.defineProperty(Pc,"ChatStreamRequest",{enumerable:!0,get:function(){return EZn.ChatStreamRequest}});var PZn=rar();Object.defineProperty(Pc,"ChatRequest",{enumerable:!0,get:function(){return PZn.ChatRequest}});var MZn=nar();Object.defineProperty(Pc,"GenerateStreamRequest",{enumerable:!0,get:function(){return MZn.GenerateStreamRequest}});var RZn=oar();Object.defineProperty(Pc,"GenerateRequest",{enumerable:!0,get:function(){return RZn.GenerateRequest}});var AZn=iar();Object.defineProperty(Pc,"EmbedRequest",{enumerable:!0,get:function(){return AZn.EmbedRequest}});var IZn=aar();Object.defineProperty(Pc,"RerankRequest",{enumerable:!0,get:function(){return IZn.RerankRequest}});var NZn=sar();Object.defineProperty(Pc,"ClassifyRequest",{enumerable:!0,get:function(){return NZn.ClassifyRequest}});var jZn=uar();Object.defineProperty(Pc,"SummarizeRequest",{enumerable:!0,get:function(){return jZn.SummarizeRequest}});var DZn=lar();Object.defineProperty(Pc,"TokenizeRequest",{enumerable:!0,get:function(){return DZn.TokenizeRequest}});var $Zn=car();Object.defineProperty(Pc,"DetokenizeRequest",{enumerable:!0,get:function(){return $Zn.DetokenizeRequest}})});var far=S(x2=>{"use strict";var LZn=x2&&x2.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),FZn=x2&&x2.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&LZn(e,t,r)};Object.defineProperty(x2,"__esModule",{value:!0});FZn(dar(),x2)});var O1=S(x1=>{"use strict";var kZn=x1&&x1.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),HXe=x1&&x1.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&kZn(e,t,r)};Object.defineProperty(x1,"__esModule",{value:!0});HXe(gir(),x1);HXe(ear(),x1);HXe(far(),x1)});var VXe=S(Qs=>{"use strict";var qZn=Qs&&Qs.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),BZn=Qs&&Qs.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),UZn=Qs&&Qs.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;op0e(void 0,void 0,void 0,function*(){let r=Object.assign({},process.env);try{return t(),yield e()}finally{process.env=r}}),QZn={1:{chat:PS.StreamedChatResponse,generate:PS.GenerateStreamedResponse},2:{chat:PS.V2ChatStreamResponse,generate:PS.GenerateStreamedResponse}},eXn={1:{chat:PS.NonStreamedChatResponse,embed:PS.EmbedResponse,generate:PS.Generation,rerank:PS.RerankResponse},2:{chat:PS.V2ChatResponse,embed:PS.EmbedByTypeResponse,generate:PS.Generation,rerank:PS.V2RerankResponse}},tXn=(t,e,r,n)=>p0e(void 0,void 0,void 0,function*(){let o=t?QZn[r][e]:eXn[r][e],i={unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]},a=yield o.parseOrThrow(n,i);return o.jsonOrThrow(a,i)});Qs.mapResponseFromBedrock=tXn;var rXn=(t,e,r,n)=>{let o={bedrock:n?"invoke-with-response-stream":"invoke",sagemaker:n?"invocations-response-stream":"invocations"}[t];return{bedrock:`https://${t}-runtime.${e}.amazonaws.com/model/${r}/${o}`,sagemaker:`https://runtime.sagemaker.${e}.amazonaws.com/endpoints/${r}/${o}`}[t]};Qs.getUrl=rXn;var nXn=(t,e,r,n,o,i)=>p0e(void 0,void 0,void 0,function*(){let a=(0,VZn.fromNodeProviderChain)(),s=yield YZn(()=>{i.awsAccessKey&&(process.env.AWS_ACCESS_KEY_ID=i.awsAccessKey),i.awsSecretKey&&(process.env.AWS_SECRET_ACCESS_KEY=i.awsSecretKey),i.awsSessionToken&&(process.env.AWS_SESSION_TOKEN=i.awsSessionToken)},()=>a()),u=new KZn.SignatureV4({service:o,region:i.awsRegion,credentials:s,sha256:HZn.Sha256});delete r.connection,r.host=t.hostname;let l=new JZn.HttpRequest({method:e.toUpperCase(),protocol:t.protocol,path:t.pathname,headers:r,body:n});return(yield u.sign(l)).headers});Qs.getAuthHeaders=nXn;var oXn=t=>{let e=/{[^\}]*}/,r=t.match(e);if(r?.[0]){let n=JSON.parse(r[0]);if(n.bytes){let o=Buffer.from(n.bytes,"base64").toString("utf-8"),i=JSON.parse(o);if(i.event_type)return i}}};Qs.parseAWSEvent=oXn;var iXn=t=>({v1:1,v2:2})[t]||1,aXn=(t,{awsRegion:e,awsAccessKey:r,awsSecretKey:n,awsSessionToken:o})=>i=>p0e(void 0,void 0,void 0,function*(){var a,s,u,l;let c=i.url.split("/"),d=c.pop(),f=iXn(c.pop()),p=i.body;console.assert(p.model,"model is required");let m=!!p.stream,h=(0,Qs.getUrl)(t,e,p.model,m);d==="rerank"&&(p.api_version=f),delete p.stream,delete p.model,delete i.headers.Authorization,i.headers.Host=new URL(h).hostname;let g=yield(0,Qs.getAuthHeaders)(new URL(h),i.method,i.headers,JSON.stringify(p),t,{awsRegion:e,awsAccessKey:r,awsSecretKey:n,awsSessionToken:o});i.url=h,i.headers=g;let y=yield(0,GZn.fetcher)(i);if(!y.ok)return y;try{if(m){let x=(0,ZZn.readableStreamAsyncIterable)(y.body),O=new XZn.LineDecoder,E=new WZn.PassThrough;try{for(var b=!0,_=zZn(x),w;w=yield _.next(),a=w.done,!a;b=!0){l=w.value,b=!1;let T=l;for(let R of O.decode(T)){let I=(0,Qs.parseAWSEvent)(R);if(I){let j=yield(0,Qs.mapResponseFromBedrock)(m,d,f,I);E.push(JSON.stringify(j)+` +`)}}}}catch(T){s={error:T}}finally{try{!b&&!a&&(u=_.return)&&(yield u.call(_))}finally{if(s)throw s.error}}for(let T of O.flush()){let R=(0,Qs.parseAWSEvent)(T);if(R){let I=yield(0,Qs.mapResponseFromBedrock)(m,d,f,R);E.push(JSON.stringify(I)+` +`)}}return E.end(),{ok:!0,body:E,rawResponse:y.rawResponse}}else{let x=yield y.body;return{ok:!0,body:yield(0,Qs.mapResponseFromBedrock)(m,d,f,x),rawResponse:y.rawResponse}}}catch(x){throw x}});Qs.fetchOverride=aXn});var T1=S(m0e=>{"use strict";Object.defineProperty(m0e,"__esModule",{value:!0});m0e.CohereEnvironment=void 0;m0e.CohereEnvironment={Production:"https://api.cohere.com"}});var WF=S((par,h0e)=>{(function(t,e,r){typeof h0e<"u"&&h0e.exports?h0e.exports=r():typeof define=="function"&&define.amd?define(r):e[t]=r()})("urljoin",par,function(){function t(e){var r=[];if(e.length===0)return"";if(typeof e[0]!="string")throw new TypeError("Url must be a string. Received "+e[0]);if(e[0].match(/^[^/:]+:\/*$/)&&e.length>1){var n=e.shift();e[0]=n+e[0]}e[0].match(/^file:\/\/\//)?e[0]=e[0].replace(/^([^/:]+):\/*/,"$1:///"):e[0]=e[0].replace(/^([^/:]+):\/*/,"$1://");for(var o=0;o0&&(i=i.replace(/^[\/]+/,"")),o0?"?":"")+s.join("&"),a}return function(){var e;return typeof arguments[0]=="object"?e=arguments[0]:e=[].slice.call(arguments),t(e)}})});var KXe=S(w_=>{"use strict";var sXn=w_&&w_.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),uXn=w_&&w_.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Zne=w_&&w_.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oxW(this,void 0,void 0,function*(){return GF.V2ChatStreamResponse.parseOrThrow(s,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]})}),signal:r?.abortSignal,eventShape:{type:"sse",streamTerminator:"[DONE]"}}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new Nn.BadRequestError(a.error.body,a.rawResponse);case 401:throw new Nn.UnauthorizedError(a.error.body,a.rawResponse);case 403:throw new Nn.ForbiddenError(a.error.body,a.rawResponse);case 404:throw new Nn.NotFoundError(a.error.body,a.rawResponse);case 422:throw new Nn.UnprocessableEntityError(a.error.body,a.rawResponse);case 429:throw new Nn.TooManyRequestsError(a.error.body,a.rawResponse);case 498:throw new Nn.InvalidTokenError(a.error.body,a.rawResponse);case 499:throw new Nn.ClientClosedRequestError(a.error.body,a.rawResponse);case 500:throw new Nn.InternalServerError(a.error.body,a.rawResponse);case 501:throw new Nn.NotImplementedError(a.error.body,a.rawResponse);case 503:throw new Nn.ServiceUnavailableError(a.error.body,a.rawResponse);case 504:throw new Nn.GatewayTimeoutError(a.error.body,a.rawResponse);default:throw new mg.CohereError({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case"non-json":throw new mg.CohereError({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case"timeout":throw new mg.CohereTimeoutError("Timeout exceeded when calling POST /v2/chat.");case"unknown":throw new mg.CohereError({message:a.error.errorMessage,rawResponse:a.rawResponse})}})}chat(e,r){return Wi.HttpResponsePromise.fromPromise(this.__chat(e,r))}__chat(e,r){return xW(this,void 0,void 0,function*(){var n,o,i;let a=yield((n=this._options.fetcher)!==null&&n!==void 0?n:Wi.fetcher)({url:(0,y0e.default)((i=(o=yield Wi.Supplier.get(this._options.baseUrl))!==null&&o!==void 0?o:yield Wi.Supplier.get(this._options.environment))!==null&&i!==void 0?i:g0e.CohereEnvironment.Production,"v2/chat"),method:"POST",headers:Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield Wi.Supplier.get(this._options.clientName))!=null?yield Wi.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":Wi.RUNTIME.type,"X-Fern-Runtime-Version":Wi.RUNTIME.version},r?.headers),contentType:"application/json",requestType:"json",body:Object.assign(Object.assign({},GF.V2ChatRequest.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0})),{stream:!1}),timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:3e5,maxRetries:r?.maxRetries,abortSignal:r?.abortSignal});if(a.ok)return{data:GF.V2ChatResponse.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new Nn.BadRequestError(a.error.body,a.rawResponse);case 401:throw new Nn.UnauthorizedError(a.error.body,a.rawResponse);case 403:throw new Nn.ForbiddenError(a.error.body,a.rawResponse);case 404:throw new Nn.NotFoundError(a.error.body,a.rawResponse);case 422:throw new Nn.UnprocessableEntityError(a.error.body,a.rawResponse);case 429:throw new Nn.TooManyRequestsError(a.error.body,a.rawResponse);case 498:throw new Nn.InvalidTokenError(a.error.body,a.rawResponse);case 499:throw new Nn.ClientClosedRequestError(a.error.body,a.rawResponse);case 500:throw new Nn.InternalServerError(a.error.body,a.rawResponse);case 501:throw new Nn.NotImplementedError(a.error.body,a.rawResponse);case 503:throw new Nn.ServiceUnavailableError(a.error.body,a.rawResponse);case 504:throw new Nn.GatewayTimeoutError(a.error.body,a.rawResponse);default:throw new mg.CohereError({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case"non-json":throw new mg.CohereError({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case"timeout":throw new mg.CohereTimeoutError("Timeout exceeded when calling POST /v2/chat.");case"unknown":throw new mg.CohereError({message:a.error.errorMessage,rawResponse:a.rawResponse})}})}embed(e,r){return Wi.HttpResponsePromise.fromPromise(this.__embed(e,r))}__embed(e,r){return xW(this,void 0,void 0,function*(){var n,o,i;let a=yield((n=this._options.fetcher)!==null&&n!==void 0?n:Wi.fetcher)({url:(0,y0e.default)((i=(o=yield Wi.Supplier.get(this._options.baseUrl))!==null&&o!==void 0?o:yield Wi.Supplier.get(this._options.environment))!==null&&i!==void 0?i:g0e.CohereEnvironment.Production,"v2/embed"),method:"POST",headers:Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield Wi.Supplier.get(this._options.clientName))!=null?yield Wi.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":Wi.RUNTIME.type,"X-Fern-Runtime-Version":Wi.RUNTIME.version},r?.headers),contentType:"application/json",requestType:"json",body:GF.V2EmbedRequest.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0}),timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:3e5,maxRetries:r?.maxRetries,abortSignal:r?.abortSignal});if(a.ok)return{data:GF.EmbedByTypeResponse.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new Nn.BadRequestError(a.error.body,a.rawResponse);case 401:throw new Nn.UnauthorizedError(a.error.body,a.rawResponse);case 403:throw new Nn.ForbiddenError(a.error.body,a.rawResponse);case 404:throw new Nn.NotFoundError(a.error.body,a.rawResponse);case 422:throw new Nn.UnprocessableEntityError(a.error.body,a.rawResponse);case 429:throw new Nn.TooManyRequestsError(a.error.body,a.rawResponse);case 498:throw new Nn.InvalidTokenError(a.error.body,a.rawResponse);case 499:throw new Nn.ClientClosedRequestError(a.error.body,a.rawResponse);case 500:throw new Nn.InternalServerError(a.error.body,a.rawResponse);case 501:throw new Nn.NotImplementedError(a.error.body,a.rawResponse);case 503:throw new Nn.ServiceUnavailableError(a.error.body,a.rawResponse);case 504:throw new Nn.GatewayTimeoutError(a.error.body,a.rawResponse);default:throw new mg.CohereError({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case"non-json":throw new mg.CohereError({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case"timeout":throw new mg.CohereTimeoutError("Timeout exceeded when calling POST /v2/embed.");case"unknown":throw new mg.CohereError({message:a.error.errorMessage,rawResponse:a.rawResponse})}})}rerank(e,r){return Wi.HttpResponsePromise.fromPromise(this.__rerank(e,r))}__rerank(e,r){return xW(this,void 0,void 0,function*(){var n,o,i;let a=yield((n=this._options.fetcher)!==null&&n!==void 0?n:Wi.fetcher)({url:(0,y0e.default)((i=(o=yield Wi.Supplier.get(this._options.baseUrl))!==null&&o!==void 0?o:yield Wi.Supplier.get(this._options.environment))!==null&&i!==void 0?i:g0e.CohereEnvironment.Production,"v2/rerank"),method:"POST",headers:Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield Wi.Supplier.get(this._options.clientName))!=null?yield Wi.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":Wi.RUNTIME.type,"X-Fern-Runtime-Version":Wi.RUNTIME.version},r?.headers),contentType:"application/json",requestType:"json",body:GF.V2RerankRequest.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0}),timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:3e5,maxRetries:r?.maxRetries,abortSignal:r?.abortSignal});if(a.ok)return{data:GF.V2RerankResponse.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new Nn.BadRequestError(a.error.body,a.rawResponse);case 401:throw new Nn.UnauthorizedError(a.error.body,a.rawResponse);case 403:throw new Nn.ForbiddenError(a.error.body,a.rawResponse);case 404:throw new Nn.NotFoundError(a.error.body,a.rawResponse);case 422:throw new Nn.UnprocessableEntityError(a.error.body,a.rawResponse);case 429:throw new Nn.TooManyRequestsError(a.error.body,a.rawResponse);case 498:throw new Nn.InvalidTokenError(a.error.body,a.rawResponse);case 499:throw new Nn.ClientClosedRequestError(a.error.body,a.rawResponse);case 500:throw new Nn.InternalServerError(a.error.body,a.rawResponse);case 501:throw new Nn.NotImplementedError(a.error.body,a.rawResponse);case 503:throw new Nn.ServiceUnavailableError(a.error.body,a.rawResponse);case 504:throw new Nn.GatewayTimeoutError(a.error.body,a.rawResponse);default:throw new mg.CohereError({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case"non-json":throw new mg.CohereError({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case"timeout":throw new mg.CohereTimeoutError("Timeout exceeded when calling POST /v2/rerank.");case"unknown":throw new mg.CohereError({message:a.error.errorMessage,rawResponse:a.rawResponse})}})}_getAuthorizationHeader(){return xW(this,void 0,void 0,function*(){var e;let r=(e=yield Wi.Supplier.get(this._options.token))!==null&&e!==void 0?e:process==null?void 0:process.env.CO_API_KEY;if(r==null)throw new mg.CohereError({message:"Please specify a bearer by either passing it in to the constructor or initializing a CO_API_KEY environment variable"});return`Bearer ${r}`})}};w_.V2=JXe});var mar=S(S_=>{"use strict";var cXn=S_&&S_.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),dXn=S_&&S_.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),Yne=S_&&S_.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var pXn=C_&&C_.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),mXn=C_&&C_.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),toe=C_&&C_.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;of):u.keep_fields=n.keepFields),n.optionalFields!=null&&(Array.isArray(n.optionalFields)?u.optional_fields=n.optionalFields.map(f=>f):u.optional_fields=n.optionalFields),n.textSeparator!=null&&(u.text_separator=n.textSeparator),n.csvDelimiter!=null&&(u.csv_delimiter=n.csvDelimiter);let l=yield ko.newFormData();yield l.appendFile("data",e),r!=null&&(yield l.appendFile("eval_data",r));let c=yield l.getRequest(),d=yield((i=this._options.fetcher)!==null&&i!==void 0?i:ko.fetcher)({url:(0,eoe.default)((s=(a=yield ko.Supplier.get(this._options.baseUrl))!==null&&a!==void 0?a:yield ko.Supplier.get(this._options.environment))!==null&&s!==void 0?s:Qne.CohereEnvironment.Production,"v1/datasets"),method:"POST",headers:Object.assign(Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield ko.Supplier.get(this._options.clientName))!=null?yield ko.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":ko.RUNTIME.type,"X-Fern-Runtime-Version":ko.RUNTIME.version},c.headers),o?.headers),queryParameters:u,requestType:"file",duplex:c.duplex,body:c.body,timeoutMs:o?.timeoutInSeconds!=null?o.timeoutInSeconds*1e3:3e5,maxRetries:o?.maxRetries,abortSignal:o?.abortSignal});if(d.ok)return{data:O2.DatasetsCreateResponse.parseOrThrow(d.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:d.rawResponse};if(d.error.reason==="status-code")switch(d.error.statusCode){case 400:throw new Rr.BadRequestError(d.error.body,d.rawResponse);case 401:throw new Rr.UnauthorizedError(d.error.body,d.rawResponse);case 403:throw new Rr.ForbiddenError(d.error.body,d.rawResponse);case 404:throw new Rr.NotFoundError(d.error.body,d.rawResponse);case 422:throw new Rr.UnprocessableEntityError(d.error.body,d.rawResponse);case 429:throw new Rr.TooManyRequestsError(d.error.body,d.rawResponse);case 498:throw new Rr.InvalidTokenError(d.error.body,d.rawResponse);case 499:throw new Rr.ClientClosedRequestError(d.error.body,d.rawResponse);case 500:throw new Rr.InternalServerError(d.error.body,d.rawResponse);case 501:throw new Rr.NotImplementedError(d.error.body,d.rawResponse);case 503:throw new Rr.ServiceUnavailableError(d.error.body,d.rawResponse);case 504:throw new Rr.GatewayTimeoutError(d.error.body,d.rawResponse);default:throw new Xc.CohereError({statusCode:d.error.statusCode,body:d.error.body,rawResponse:d.rawResponse})}switch(d.error.reason){case"non-json":throw new Xc.CohereError({statusCode:d.error.statusCode,body:d.error.rawBody,rawResponse:d.rawResponse});case"timeout":throw new Xc.CohereTimeoutError("Timeout exceeded when calling POST /v1/datasets.");case"unknown":throw new Xc.CohereError({message:d.error.errorMessage,rawResponse:d.rawResponse})}})}getUsage(e){return ko.HttpResponsePromise.fromPromise(this.__getUsage(e))}__getUsage(e){return OW(this,void 0,void 0,function*(){var r,n,o;let i=yield((r=this._options.fetcher)!==null&&r!==void 0?r:ko.fetcher)({url:(0,eoe.default)((o=(n=yield ko.Supplier.get(this._options.baseUrl))!==null&&n!==void 0?n:yield ko.Supplier.get(this._options.environment))!==null&&o!==void 0?o:Qne.CohereEnvironment.Production,"v1/datasets/usage"),method:"GET",headers:Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield ko.Supplier.get(this._options.clientName))!=null?yield ko.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":ko.RUNTIME.type,"X-Fern-Runtime-Version":ko.RUNTIME.version},e?.headers),contentType:"application/json",requestType:"json",timeoutMs:e?.timeoutInSeconds!=null?e.timeoutInSeconds*1e3:3e5,maxRetries:e?.maxRetries,abortSignal:e?.abortSignal});if(i.ok)return{data:O2.DatasetsGetUsageResponse.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new Rr.BadRequestError(i.error.body,i.rawResponse);case 401:throw new Rr.UnauthorizedError(i.error.body,i.rawResponse);case 403:throw new Rr.ForbiddenError(i.error.body,i.rawResponse);case 404:throw new Rr.NotFoundError(i.error.body,i.rawResponse);case 422:throw new Rr.UnprocessableEntityError(i.error.body,i.rawResponse);case 429:throw new Rr.TooManyRequestsError(i.error.body,i.rawResponse);case 498:throw new Rr.InvalidTokenError(i.error.body,i.rawResponse);case 499:throw new Rr.ClientClosedRequestError(i.error.body,i.rawResponse);case 500:throw new Rr.InternalServerError(i.error.body,i.rawResponse);case 501:throw new Rr.NotImplementedError(i.error.body,i.rawResponse);case 503:throw new Rr.ServiceUnavailableError(i.error.body,i.rawResponse);case 504:throw new Rr.GatewayTimeoutError(i.error.body,i.rawResponse);default:throw new Xc.CohereError({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}switch(i.error.reason){case"non-json":throw new Xc.CohereError({statusCode:i.error.statusCode,body:i.error.rawBody,rawResponse:i.rawResponse});case"timeout":throw new Xc.CohereTimeoutError("Timeout exceeded when calling GET /v1/datasets/usage.");case"unknown":throw new Xc.CohereError({message:i.error.errorMessage,rawResponse:i.rawResponse})}})}get(e,r){return ko.HttpResponsePromise.fromPromise(this.__get(e,r))}__get(e,r){return OW(this,void 0,void 0,function*(){var n,o,i;let a=yield((n=this._options.fetcher)!==null&&n!==void 0?n:ko.fetcher)({url:(0,eoe.default)((i=(o=yield ko.Supplier.get(this._options.baseUrl))!==null&&o!==void 0?o:yield ko.Supplier.get(this._options.environment))!==null&&i!==void 0?i:Qne.CohereEnvironment.Production,`v1/datasets/${encodeURIComponent(e)}`),method:"GET",headers:Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield ko.Supplier.get(this._options.clientName))!=null?yield ko.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":ko.RUNTIME.type,"X-Fern-Runtime-Version":ko.RUNTIME.version},r?.headers),contentType:"application/json",requestType:"json",timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:3e5,maxRetries:r?.maxRetries,abortSignal:r?.abortSignal});if(a.ok)return{data:O2.DatasetsGetResponse.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new Rr.BadRequestError(a.error.body,a.rawResponse);case 401:throw new Rr.UnauthorizedError(a.error.body,a.rawResponse);case 403:throw new Rr.ForbiddenError(a.error.body,a.rawResponse);case 404:throw new Rr.NotFoundError(a.error.body,a.rawResponse);case 422:throw new Rr.UnprocessableEntityError(a.error.body,a.rawResponse);case 429:throw new Rr.TooManyRequestsError(a.error.body,a.rawResponse);case 498:throw new Rr.InvalidTokenError(a.error.body,a.rawResponse);case 499:throw new Rr.ClientClosedRequestError(a.error.body,a.rawResponse);case 500:throw new Rr.InternalServerError(a.error.body,a.rawResponse);case 501:throw new Rr.NotImplementedError(a.error.body,a.rawResponse);case 503:throw new Rr.ServiceUnavailableError(a.error.body,a.rawResponse);case 504:throw new Rr.GatewayTimeoutError(a.error.body,a.rawResponse);default:throw new Xc.CohereError({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case"non-json":throw new Xc.CohereError({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case"timeout":throw new Xc.CohereTimeoutError("Timeout exceeded when calling GET /v1/datasets/{id}.");case"unknown":throw new Xc.CohereError({message:a.error.errorMessage,rawResponse:a.rawResponse})}})}delete(e,r){return ko.HttpResponsePromise.fromPromise(this.__delete(e,r))}__delete(e,r){return OW(this,void 0,void 0,function*(){var n,o,i;let a=yield((n=this._options.fetcher)!==null&&n!==void 0?n:ko.fetcher)({url:(0,eoe.default)((i=(o=yield ko.Supplier.get(this._options.baseUrl))!==null&&o!==void 0?o:yield ko.Supplier.get(this._options.environment))!==null&&i!==void 0?i:Qne.CohereEnvironment.Production,`v1/datasets/${encodeURIComponent(e)}`),method:"DELETE",headers:Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield ko.Supplier.get(this._options.clientName))!=null?yield ko.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":ko.RUNTIME.type,"X-Fern-Runtime-Version":ko.RUNTIME.version},r?.headers),contentType:"application/json",requestType:"json",timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:3e5,maxRetries:r?.maxRetries,abortSignal:r?.abortSignal});if(a.ok)return{data:O2.datasets.delete.Response.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new Rr.BadRequestError(a.error.body,a.rawResponse);case 401:throw new Rr.UnauthorizedError(a.error.body,a.rawResponse);case 403:throw new Rr.ForbiddenError(a.error.body,a.rawResponse);case 404:throw new Rr.NotFoundError(a.error.body,a.rawResponse);case 422:throw new Rr.UnprocessableEntityError(a.error.body,a.rawResponse);case 429:throw new Rr.TooManyRequestsError(a.error.body,a.rawResponse);case 498:throw new Rr.InvalidTokenError(a.error.body,a.rawResponse);case 499:throw new Rr.ClientClosedRequestError(a.error.body,a.rawResponse);case 500:throw new Rr.InternalServerError(a.error.body,a.rawResponse);case 501:throw new Rr.NotImplementedError(a.error.body,a.rawResponse);case 503:throw new Rr.ServiceUnavailableError(a.error.body,a.rawResponse);case 504:throw new Rr.GatewayTimeoutError(a.error.body,a.rawResponse);default:throw new Xc.CohereError({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case"non-json":throw new Xc.CohereError({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case"timeout":throw new Xc.CohereTimeoutError("Timeout exceeded when calling DELETE /v1/datasets/{id}.");case"unknown":throw new Xc.CohereError({message:a.error.errorMessage,rawResponse:a.rawResponse})}})}_getAuthorizationHeader(){return OW(this,void 0,void 0,function*(){var e;let r=(e=yield ko.Supplier.get(this._options.token))!==null&&e!==void 0?e:process==null?void 0:process.env.CO_API_KEY;if(r==null)throw new Xc.CohereError({message:"Please specify a bearer by either passing it in to the constructor or initializing a CO_API_KEY environment variable"});return`Bearer ${r}`})}};C_.Datasets=GXe});var gar=S(x_=>{"use strict";var gXn=x_&&x_.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),yXn=x_&&x_.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),roe=x_&&x_.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var _Xn=O_&&O_.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),vXn=O_&&O_.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),noe=O_&&O_.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var SXn=T_&&T_.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),CXn=T_&&T_.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ooe=T_&&T_.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{"use strict";var OXn=xy&&xy.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),TXn=xy&&xy.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),ioe=xy&&xy.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;oE_(this,void 0,void 0,function*(){return Yc.StreamedChatResponse.parseOrThrow(l,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]})}),signal:r?.abortSignal,eventShape:{type:"json",messageTerminator:` +`}}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 400:throw new Re.BadRequestError(u.error.body,u.rawResponse);case 401:throw new Re.UnauthorizedError(u.error.body,u.rawResponse);case 403:throw new Re.ForbiddenError(u.error.body,u.rawResponse);case 404:throw new Re.NotFoundError(u.error.body,u.rawResponse);case 422:throw new Re.UnprocessableEntityError(u.error.body,u.rawResponse);case 429:throw new Re.TooManyRequestsError(u.error.body,u.rawResponse);case 498:throw new Re.InvalidTokenError(u.error.body,u.rawResponse);case 499:throw new Re.ClientClosedRequestError(u.error.body,u.rawResponse);case 500:throw new Re.InternalServerError(u.error.body,u.rawResponse);case 501:throw new Re.NotImplementedError(u.error.body,u.rawResponse);case 503:throw new Re.ServiceUnavailableError(u.error.body,u.rawResponse);case 504:throw new Re.GatewayTimeoutError(u.error.body,u.rawResponse);default:throw new Co.CohereError({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}switch(u.error.reason){case"non-json":throw new Co.CohereError({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case"timeout":throw new Co.CohereTimeoutError("Timeout exceeded when calling POST /v1/chat.");case"unknown":throw new Co.CohereError({message:u.error.errorMessage,rawResponse:u.rawResponse})}})}chat(e,r){return rt.HttpResponsePromise.fromPromise(this.__chat(e,r))}__chat(e,r){return E_(this,void 0,void 0,function*(){var n,o,i;let{accepts:a}=e,s=Sar(e,["accepts"]),u=yield((n=this._options.fetcher)!==null&&n!==void 0?n:rt.fetcher)({url:(0,TC.default)((i=(o=yield rt.Supplier.get(this._options.baseUrl))!==null&&o!==void 0?o:yield rt.Supplier.get(this._options.environment))!==null&&i!==void 0?i:OC.CohereEnvironment.Production,"v1/chat"),method:"POST",headers:Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield rt.Supplier.get(this._options.clientName))!=null?yield rt.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":rt.RUNTIME.type,"X-Fern-Runtime-Version":rt.RUNTIME.version,Accepts:a??void 0},r?.headers),contentType:"application/json",requestType:"json",body:Object.assign(Object.assign({},Yc.ChatRequest.jsonOrThrow(s,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0})),{stream:!1}),timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:3e5,maxRetries:r?.maxRetries,abortSignal:r?.abortSignal});if(u.ok)return{data:Yc.NonStreamedChatResponse.parseOrThrow(u.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:u.rawResponse};if(u.error.reason==="status-code")switch(u.error.statusCode){case 400:throw new Re.BadRequestError(u.error.body,u.rawResponse);case 401:throw new Re.UnauthorizedError(u.error.body,u.rawResponse);case 403:throw new Re.ForbiddenError(u.error.body,u.rawResponse);case 404:throw new Re.NotFoundError(u.error.body,u.rawResponse);case 422:throw new Re.UnprocessableEntityError(u.error.body,u.rawResponse);case 429:throw new Re.TooManyRequestsError(u.error.body,u.rawResponse);case 498:throw new Re.InvalidTokenError(u.error.body,u.rawResponse);case 499:throw new Re.ClientClosedRequestError(u.error.body,u.rawResponse);case 500:throw new Re.InternalServerError(u.error.body,u.rawResponse);case 501:throw new Re.NotImplementedError(u.error.body,u.rawResponse);case 503:throw new Re.ServiceUnavailableError(u.error.body,u.rawResponse);case 504:throw new Re.GatewayTimeoutError(u.error.body,u.rawResponse);default:throw new Co.CohereError({statusCode:u.error.statusCode,body:u.error.body,rawResponse:u.rawResponse})}switch(u.error.reason){case"non-json":throw new Co.CohereError({statusCode:u.error.statusCode,body:u.error.rawBody,rawResponse:u.rawResponse});case"timeout":throw new Co.CohereTimeoutError("Timeout exceeded when calling POST /v1/chat.");case"unknown":throw new Co.CohereError({message:u.error.errorMessage,rawResponse:u.rawResponse})}})}generateStream(e,r){return rt.HttpResponsePromise.fromPromise(this.__generateStream(e,r))}__generateStream(e,r){return E_(this,void 0,void 0,function*(){var n,o,i;let a=yield((n=this._options.fetcher)!==null&&n!==void 0?n:rt.fetcher)({url:(0,TC.default)((i=(o=yield rt.Supplier.get(this._options.baseUrl))!==null&&o!==void 0?o:yield rt.Supplier.get(this._options.environment))!==null&&i!==void 0?i:OC.CohereEnvironment.Production,"v1/generate"),method:"POST",headers:Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield rt.Supplier.get(this._options.clientName))!=null?yield rt.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":rt.RUNTIME.type,"X-Fern-Runtime-Version":rt.RUNTIME.version},r?.headers),contentType:"application/json",requestType:"json",body:Object.assign(Object.assign({},Yc.GenerateStreamRequest.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0})),{stream:!0}),responseType:"sse",timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:3e5,maxRetries:r?.maxRetries,abortSignal:r?.abortSignal});if(a.ok)return{data:new rt.Stream({stream:a.body,parse:s=>E_(this,void 0,void 0,function*(){return Yc.GenerateStreamedResponse.parseOrThrow(s,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]})}),signal:r?.abortSignal,eventShape:{type:"json",messageTerminator:` +`}}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new Re.BadRequestError(a.error.body,a.rawResponse);case 401:throw new Re.UnauthorizedError(a.error.body,a.rawResponse);case 403:throw new Re.ForbiddenError(a.error.body,a.rawResponse);case 404:throw new Re.NotFoundError(a.error.body,a.rawResponse);case 422:throw new Re.UnprocessableEntityError(a.error.body,a.rawResponse);case 429:throw new Re.TooManyRequestsError(a.error.body,a.rawResponse);case 498:throw new Re.InvalidTokenError(a.error.body,a.rawResponse);case 499:throw new Re.ClientClosedRequestError(a.error.body,a.rawResponse);case 500:throw new Re.InternalServerError(a.error.body,a.rawResponse);case 501:throw new Re.NotImplementedError(a.error.body,a.rawResponse);case 503:throw new Re.ServiceUnavailableError(a.error.body,a.rawResponse);case 504:throw new Re.GatewayTimeoutError(a.error.body,a.rawResponse);default:throw new Co.CohereError({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case"non-json":throw new Co.CohereError({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case"timeout":throw new Co.CohereTimeoutError("Timeout exceeded when calling POST /v1/generate.");case"unknown":throw new Co.CohereError({message:a.error.errorMessage,rawResponse:a.rawResponse})}})}generate(e,r){return rt.HttpResponsePromise.fromPromise(this.__generate(e,r))}__generate(e,r){return E_(this,void 0,void 0,function*(){var n,o,i;let a=yield((n=this._options.fetcher)!==null&&n!==void 0?n:rt.fetcher)({url:(0,TC.default)((i=(o=yield rt.Supplier.get(this._options.baseUrl))!==null&&o!==void 0?o:yield rt.Supplier.get(this._options.environment))!==null&&i!==void 0?i:OC.CohereEnvironment.Production,"v1/generate"),method:"POST",headers:Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield rt.Supplier.get(this._options.clientName))!=null?yield rt.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":rt.RUNTIME.type,"X-Fern-Runtime-Version":rt.RUNTIME.version},r?.headers),contentType:"application/json",requestType:"json",body:Object.assign(Object.assign({},Yc.GenerateRequest.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0})),{stream:!1}),timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:3e5,maxRetries:r?.maxRetries,abortSignal:r?.abortSignal});if(a.ok)return{data:Yc.Generation.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new Re.BadRequestError(a.error.body,a.rawResponse);case 401:throw new Re.UnauthorizedError(a.error.body,a.rawResponse);case 403:throw new Re.ForbiddenError(a.error.body,a.rawResponse);case 404:throw new Re.NotFoundError(a.error.body,a.rawResponse);case 422:throw new Re.UnprocessableEntityError(a.error.body,a.rawResponse);case 429:throw new Re.TooManyRequestsError(a.error.body,a.rawResponse);case 498:throw new Re.InvalidTokenError(a.error.body,a.rawResponse);case 499:throw new Re.ClientClosedRequestError(a.error.body,a.rawResponse);case 500:throw new Re.InternalServerError(a.error.body,a.rawResponse);case 501:throw new Re.NotImplementedError(a.error.body,a.rawResponse);case 503:throw new Re.ServiceUnavailableError(a.error.body,a.rawResponse);case 504:throw new Re.GatewayTimeoutError(a.error.body,a.rawResponse);default:throw new Co.CohereError({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case"non-json":throw new Co.CohereError({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case"timeout":throw new Co.CohereTimeoutError("Timeout exceeded when calling POST /v1/generate.");case"unknown":throw new Co.CohereError({message:a.error.errorMessage,rawResponse:a.rawResponse})}})}embed(e={},r){return rt.HttpResponsePromise.fromPromise(this.__embed(e,r))}__embed(){return E_(this,arguments,void 0,function*(e={},r){var n,o,i;let a=yield((n=this._options.fetcher)!==null&&n!==void 0?n:rt.fetcher)({url:(0,TC.default)((i=(o=yield rt.Supplier.get(this._options.baseUrl))!==null&&o!==void 0?o:yield rt.Supplier.get(this._options.environment))!==null&&i!==void 0?i:OC.CohereEnvironment.Production,"v1/embed"),method:"POST",headers:Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield rt.Supplier.get(this._options.clientName))!=null?yield rt.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":rt.RUNTIME.type,"X-Fern-Runtime-Version":rt.RUNTIME.version},r?.headers),contentType:"application/json",requestType:"json",body:Yc.EmbedRequest.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0}),timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:3e5,maxRetries:r?.maxRetries,abortSignal:r?.abortSignal});if(a.ok)return{data:Yc.EmbedResponse.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new Re.BadRequestError(a.error.body,a.rawResponse);case 401:throw new Re.UnauthorizedError(a.error.body,a.rawResponse);case 403:throw new Re.ForbiddenError(a.error.body,a.rawResponse);case 404:throw new Re.NotFoundError(a.error.body,a.rawResponse);case 422:throw new Re.UnprocessableEntityError(a.error.body,a.rawResponse);case 429:throw new Re.TooManyRequestsError(a.error.body,a.rawResponse);case 498:throw new Re.InvalidTokenError(a.error.body,a.rawResponse);case 499:throw new Re.ClientClosedRequestError(a.error.body,a.rawResponse);case 500:throw new Re.InternalServerError(a.error.body,a.rawResponse);case 501:throw new Re.NotImplementedError(a.error.body,a.rawResponse);case 503:throw new Re.ServiceUnavailableError(a.error.body,a.rawResponse);case 504:throw new Re.GatewayTimeoutError(a.error.body,a.rawResponse);default:throw new Co.CohereError({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case"non-json":throw new Co.CohereError({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case"timeout":throw new Co.CohereTimeoutError("Timeout exceeded when calling POST /v1/embed.");case"unknown":throw new Co.CohereError({message:a.error.errorMessage,rawResponse:a.rawResponse})}})}rerank(e,r){return rt.HttpResponsePromise.fromPromise(this.__rerank(e,r))}__rerank(e,r){return E_(this,void 0,void 0,function*(){var n,o,i;let a=yield((n=this._options.fetcher)!==null&&n!==void 0?n:rt.fetcher)({url:(0,TC.default)((i=(o=yield rt.Supplier.get(this._options.baseUrl))!==null&&o!==void 0?o:yield rt.Supplier.get(this._options.environment))!==null&&i!==void 0?i:OC.CohereEnvironment.Production,"v1/rerank"),method:"POST",headers:Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield rt.Supplier.get(this._options.clientName))!=null?yield rt.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":rt.RUNTIME.type,"X-Fern-Runtime-Version":rt.RUNTIME.version},r?.headers),contentType:"application/json",requestType:"json",body:Yc.RerankRequest.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0}),timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:3e5,maxRetries:r?.maxRetries,abortSignal:r?.abortSignal});if(a.ok)return{data:Yc.RerankResponse.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new Re.BadRequestError(a.error.body,a.rawResponse);case 401:throw new Re.UnauthorizedError(a.error.body,a.rawResponse);case 403:throw new Re.ForbiddenError(a.error.body,a.rawResponse);case 404:throw new Re.NotFoundError(a.error.body,a.rawResponse);case 422:throw new Re.UnprocessableEntityError(a.error.body,a.rawResponse);case 429:throw new Re.TooManyRequestsError(a.error.body,a.rawResponse);case 498:throw new Re.InvalidTokenError(a.error.body,a.rawResponse);case 499:throw new Re.ClientClosedRequestError(a.error.body,a.rawResponse);case 500:throw new Re.InternalServerError(a.error.body,a.rawResponse);case 501:throw new Re.NotImplementedError(a.error.body,a.rawResponse);case 503:throw new Re.ServiceUnavailableError(a.error.body,a.rawResponse);case 504:throw new Re.GatewayTimeoutError(a.error.body,a.rawResponse);default:throw new Co.CohereError({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case"non-json":throw new Co.CohereError({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case"timeout":throw new Co.CohereTimeoutError("Timeout exceeded when calling POST /v1/rerank.");case"unknown":throw new Co.CohereError({message:a.error.errorMessage,rawResponse:a.rawResponse})}})}classify(e,r){return rt.HttpResponsePromise.fromPromise(this.__classify(e,r))}__classify(e,r){return E_(this,void 0,void 0,function*(){var n,o,i;let a=yield((n=this._options.fetcher)!==null&&n!==void 0?n:rt.fetcher)({url:(0,TC.default)((i=(o=yield rt.Supplier.get(this._options.baseUrl))!==null&&o!==void 0?o:yield rt.Supplier.get(this._options.environment))!==null&&i!==void 0?i:OC.CohereEnvironment.Production,"v1/classify"),method:"POST",headers:Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield rt.Supplier.get(this._options.clientName))!=null?yield rt.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":rt.RUNTIME.type,"X-Fern-Runtime-Version":rt.RUNTIME.version},r?.headers),contentType:"application/json",requestType:"json",body:Yc.ClassifyRequest.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0}),timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:3e5,maxRetries:r?.maxRetries,abortSignal:r?.abortSignal});if(a.ok)return{data:Yc.ClassifyResponse.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new Re.BadRequestError(a.error.body,a.rawResponse);case 401:throw new Re.UnauthorizedError(a.error.body,a.rawResponse);case 403:throw new Re.ForbiddenError(a.error.body,a.rawResponse);case 404:throw new Re.NotFoundError(a.error.body,a.rawResponse);case 422:throw new Re.UnprocessableEntityError(a.error.body,a.rawResponse);case 429:throw new Re.TooManyRequestsError(a.error.body,a.rawResponse);case 498:throw new Re.InvalidTokenError(a.error.body,a.rawResponse);case 499:throw new Re.ClientClosedRequestError(a.error.body,a.rawResponse);case 500:throw new Re.InternalServerError(a.error.body,a.rawResponse);case 501:throw new Re.NotImplementedError(a.error.body,a.rawResponse);case 503:throw new Re.ServiceUnavailableError(a.error.body,a.rawResponse);case 504:throw new Re.GatewayTimeoutError(a.error.body,a.rawResponse);default:throw new Co.CohereError({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case"non-json":throw new Co.CohereError({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case"timeout":throw new Co.CohereTimeoutError("Timeout exceeded when calling POST /v1/classify.");case"unknown":throw new Co.CohereError({message:a.error.errorMessage,rawResponse:a.rawResponse})}})}summarize(e,r){return rt.HttpResponsePromise.fromPromise(this.__summarize(e,r))}__summarize(e,r){return E_(this,void 0,void 0,function*(){var n,o,i;let a=yield((n=this._options.fetcher)!==null&&n!==void 0?n:rt.fetcher)({url:(0,TC.default)((i=(o=yield rt.Supplier.get(this._options.baseUrl))!==null&&o!==void 0?o:yield rt.Supplier.get(this._options.environment))!==null&&i!==void 0?i:OC.CohereEnvironment.Production,"v1/summarize"),method:"POST",headers:Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield rt.Supplier.get(this._options.clientName))!=null?yield rt.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":rt.RUNTIME.type,"X-Fern-Runtime-Version":rt.RUNTIME.version},r?.headers),contentType:"application/json",requestType:"json",body:Yc.SummarizeRequest.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0}),timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:3e5,maxRetries:r?.maxRetries,abortSignal:r?.abortSignal});if(a.ok)return{data:Yc.SummarizeResponse.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new Re.BadRequestError(a.error.body,a.rawResponse);case 401:throw new Re.UnauthorizedError(a.error.body,a.rawResponse);case 403:throw new Re.ForbiddenError(a.error.body,a.rawResponse);case 404:throw new Re.NotFoundError(a.error.body,a.rawResponse);case 422:throw new Re.UnprocessableEntityError(a.error.body,a.rawResponse);case 429:throw new Re.TooManyRequestsError(a.error.body,a.rawResponse);case 498:throw new Re.InvalidTokenError(a.error.body,a.rawResponse);case 499:throw new Re.ClientClosedRequestError(a.error.body,a.rawResponse);case 500:throw new Re.InternalServerError(a.error.body,a.rawResponse);case 501:throw new Re.NotImplementedError(a.error.body,a.rawResponse);case 503:throw new Re.ServiceUnavailableError(a.error.body,a.rawResponse);case 504:throw new Re.GatewayTimeoutError(a.error.body,a.rawResponse);default:throw new Co.CohereError({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case"non-json":throw new Co.CohereError({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case"timeout":throw new Co.CohereTimeoutError("Timeout exceeded when calling POST /v1/summarize.");case"unknown":throw new Co.CohereError({message:a.error.errorMessage,rawResponse:a.rawResponse})}})}tokenize(e,r){return rt.HttpResponsePromise.fromPromise(this.__tokenize(e,r))}__tokenize(e,r){return E_(this,void 0,void 0,function*(){var n,o,i;let a=yield((n=this._options.fetcher)!==null&&n!==void 0?n:rt.fetcher)({url:(0,TC.default)((i=(o=yield rt.Supplier.get(this._options.baseUrl))!==null&&o!==void 0?o:yield rt.Supplier.get(this._options.environment))!==null&&i!==void 0?i:OC.CohereEnvironment.Production,"v1/tokenize"),method:"POST",headers:Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield rt.Supplier.get(this._options.clientName))!=null?yield rt.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":rt.RUNTIME.type,"X-Fern-Runtime-Version":rt.RUNTIME.version},r?.headers),contentType:"application/json",requestType:"json",body:Yc.TokenizeRequest.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0}),timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:3e5,maxRetries:r?.maxRetries,abortSignal:r?.abortSignal});if(a.ok)return{data:Yc.TokenizeResponse.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new Re.BadRequestError(a.error.body,a.rawResponse);case 401:throw new Re.UnauthorizedError(a.error.body,a.rawResponse);case 403:throw new Re.ForbiddenError(a.error.body,a.rawResponse);case 404:throw new Re.NotFoundError(a.error.body,a.rawResponse);case 422:throw new Re.UnprocessableEntityError(a.error.body,a.rawResponse);case 429:throw new Re.TooManyRequestsError(a.error.body,a.rawResponse);case 498:throw new Re.InvalidTokenError(a.error.body,a.rawResponse);case 499:throw new Re.ClientClosedRequestError(a.error.body,a.rawResponse);case 500:throw new Re.InternalServerError(a.error.body,a.rawResponse);case 501:throw new Re.NotImplementedError(a.error.body,a.rawResponse);case 503:throw new Re.ServiceUnavailableError(a.error.body,a.rawResponse);case 504:throw new Re.GatewayTimeoutError(a.error.body,a.rawResponse);default:throw new Co.CohereError({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case"non-json":throw new Co.CohereError({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case"timeout":throw new Co.CohereTimeoutError("Timeout exceeded when calling POST /v1/tokenize.");case"unknown":throw new Co.CohereError({message:a.error.errorMessage,rawResponse:a.rawResponse})}})}detokenize(e,r){return rt.HttpResponsePromise.fromPromise(this.__detokenize(e,r))}__detokenize(e,r){return E_(this,void 0,void 0,function*(){var n,o,i;let a=yield((n=this._options.fetcher)!==null&&n!==void 0?n:rt.fetcher)({url:(0,TC.default)((i=(o=yield rt.Supplier.get(this._options.baseUrl))!==null&&o!==void 0?o:yield rt.Supplier.get(this._options.environment))!==null&&i!==void 0?i:OC.CohereEnvironment.Production,"v1/detokenize"),method:"POST",headers:Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield rt.Supplier.get(this._options.clientName))!=null?yield rt.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":rt.RUNTIME.type,"X-Fern-Runtime-Version":rt.RUNTIME.version},r?.headers),contentType:"application/json",requestType:"json",body:Yc.DetokenizeRequest.jsonOrThrow(e,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0}),timeoutMs:r?.timeoutInSeconds!=null?r.timeoutInSeconds*1e3:3e5,maxRetries:r?.maxRetries,abortSignal:r?.abortSignal});if(a.ok)return{data:Yc.DetokenizeResponse.parseOrThrow(a.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:a.rawResponse};if(a.error.reason==="status-code")switch(a.error.statusCode){case 400:throw new Re.BadRequestError(a.error.body,a.rawResponse);case 401:throw new Re.UnauthorizedError(a.error.body,a.rawResponse);case 403:throw new Re.ForbiddenError(a.error.body,a.rawResponse);case 404:throw new Re.NotFoundError(a.error.body,a.rawResponse);case 422:throw new Re.UnprocessableEntityError(a.error.body,a.rawResponse);case 429:throw new Re.TooManyRequestsError(a.error.body,a.rawResponse);case 498:throw new Re.InvalidTokenError(a.error.body,a.rawResponse);case 499:throw new Re.ClientClosedRequestError(a.error.body,a.rawResponse);case 500:throw new Re.InternalServerError(a.error.body,a.rawResponse);case 501:throw new Re.NotImplementedError(a.error.body,a.rawResponse);case 503:throw new Re.ServiceUnavailableError(a.error.body,a.rawResponse);case 504:throw new Re.GatewayTimeoutError(a.error.body,a.rawResponse);default:throw new Co.CohereError({statusCode:a.error.statusCode,body:a.error.body,rawResponse:a.rawResponse})}switch(a.error.reason){case"non-json":throw new Co.CohereError({statusCode:a.error.statusCode,body:a.error.rawBody,rawResponse:a.rawResponse});case"timeout":throw new Co.CohereTimeoutError("Timeout exceeded when calling POST /v1/detokenize.");case"unknown":throw new Co.CohereError({message:a.error.errorMessage,rawResponse:a.rawResponse})}})}checkApiKey(e){return rt.HttpResponsePromise.fromPromise(this.__checkApiKey(e))}__checkApiKey(e){return E_(this,void 0,void 0,function*(){var r,n,o;let i=yield((r=this._options.fetcher)!==null&&r!==void 0?r:rt.fetcher)({url:(0,TC.default)((o=(n=yield rt.Supplier.get(this._options.baseUrl))!==null&&n!==void 0?n:yield rt.Supplier.get(this._options.environment))!==null&&o!==void 0?o:OC.CohereEnvironment.Production,"v1/check-api-key"),method:"POST",headers:Object.assign({Authorization:yield this._getAuthorizationHeader(),"X-Client-Name":(yield rt.Supplier.get(this._options.clientName))!=null?yield rt.Supplier.get(this._options.clientName):void 0,"X-Fern-Language":"JavaScript","X-Fern-SDK-Name":"cohere-ai","X-Fern-SDK-Version":"7.19.0","User-Agent":"cohere-ai/7.19.0","X-Fern-Runtime":rt.RUNTIME.type,"X-Fern-Runtime-Version":rt.RUNTIME.version},e?.headers),contentType:"application/json",requestType:"json",timeoutMs:e?.timeoutInSeconds!=null?e.timeoutInSeconds*1e3:3e5,maxRetries:e?.maxRetries,abortSignal:e?.abortSignal});if(i.ok)return{data:Yc.CheckApiKeyResponse.parseOrThrow(i.body,{unrecognizedObjectKeys:"passthrough",allowUnrecognizedUnionMembers:!0,allowUnrecognizedEnumValues:!0,skipValidation:!0,breadcrumbsPrefix:["response"]}),rawResponse:i.rawResponse};if(i.error.reason==="status-code")switch(i.error.statusCode){case 400:throw new Re.BadRequestError(i.error.body,i.rawResponse);case 401:throw new Re.UnauthorizedError(i.error.body,i.rawResponse);case 403:throw new Re.ForbiddenError(i.error.body,i.rawResponse);case 404:throw new Re.NotFoundError(i.error.body,i.rawResponse);case 422:throw new Re.UnprocessableEntityError(i.error.body,i.rawResponse);case 429:throw new Re.TooManyRequestsError(i.error.body,i.rawResponse);case 498:throw new Re.InvalidTokenError(i.error.body,i.rawResponse);case 499:throw new Re.ClientClosedRequestError(i.error.body,i.rawResponse);case 500:throw new Re.InternalServerError(i.error.body,i.rawResponse);case 501:throw new Re.NotImplementedError(i.error.body,i.rawResponse);case 503:throw new Re.ServiceUnavailableError(i.error.body,i.rawResponse);case 504:throw new Re.GatewayTimeoutError(i.error.body,i.rawResponse);default:throw new Co.CohereError({statusCode:i.error.statusCode,body:i.error.body,rawResponse:i.rawResponse})}switch(i.error.reason){case"non-json":throw new Co.CohereError({statusCode:i.error.statusCode,body:i.error.rawBody,rawResponse:i.rawResponse});case"timeout":throw new Co.CohereTimeoutError("Timeout exceeded when calling POST /v1/check-api-key.");case"unknown":throw new Co.CohereError({message:i.error.errorMessage,rawResponse:i.rawResponse})}})}_getAuthorizationHeader(){return E_(this,void 0,void 0,function*(){var e;let r=(e=yield rt.Supplier.get(this._options.token))!==null&&e!==void 0?e:process==null?void 0:process.env.CO_API_KEY;if(r==null)throw new Co.CohereError({message:"Please specify a bearer by either passing it in to the constructor or initializing a CO_API_KEY environment variable"});return`Bearer ${r}`})}};xy.CohereClient=tYe});var nYe=S(S0e=>{"use strict";Object.defineProperty(S0e,"__esModule",{value:!0});S0e.CohereClientV2=void 0;var jXn=KXe(),DXn=w0e(),rYe=class{constructor(e){this._options=e,this.client=new DXn.CohereClient(this._options),this.clientV2=new jXn.V2(this._options),this.chat=this.clientV2.chat.bind(this.clientV2),this.chatStream=this.clientV2.chatStream.bind(this.clientV2),this.embed=this.clientV2.embed.bind(this.clientV2),this.rerank=this.clientV2.rerank.bind(this.clientV2),this.generateStream=this.client.generateStream.bind(this.clientV2),this.generate=this.client.generate.bind(this.clientV2),this.classify=this.client.classify.bind(this.clientV2),this.summarize=this.client.summarize.bind(this.clientV2),this.tokenize=this.client.tokenize.bind(this.clientV2),this.detokenize=this.client.detokenize.bind(this.clientV2),this.checkApiKey=this.client.checkApiKey.bind(this.clientV2),this.embedJobs=this.client.embedJobs,this.datasets=this.client.datasets,this.connectors=this.client.connectors,this.models=this.client.models,this.finetuning=this.client.finetuning}};S0e.CohereClientV2=rYe});var aYe=S(PW=>{"use strict";Object.defineProperty(PW,"__esModule",{value:!0});PW.AwsClientV2=PW.AwsClient=void 0;var $Xn=w0e(),LXn=nYe(),oYe=class extends $Xn.CohereClient{constructor(e){e.token="n/a",super(e)}};PW.AwsClient=oYe;var iYe=class extends LXn.CohereClientV2{constructor(e){e.token="n/a",super(e)}};PW.AwsClientV2=iYe});var Oar=S(MW=>{"use strict";Object.defineProperty(MW,"__esModule",{value:!0});MW.BedrockClientV2=MW.BedrockClient=void 0;var Car=VXe(),xar=aYe(),sYe=class extends xar.AwsClient{constructor(e){super(Object.assign(Object.assign({},e),{fetcher:(0,Car.fetchOverride)("bedrock",e)}))}};MW.BedrockClient=sYe;var uYe=class extends xar.AwsClientV2{constructor(e){super(Object.assign(Object.assign({},e),{fetcher:(0,Car.fetchOverride)("bedrock",e)}))}};MW.BedrockClientV2=uYe});var Tar=S(C0e=>{"use strict";Object.defineProperty(C0e,"__esModule",{value:!0});C0e.CustomClient=void 0;var FXn=w0e(),lYe=class extends FXn.CohereClient{constructor(e={}){var r,n;try{let o=/\/v1\/?$/,i=(r=e.environment)===null||r===void 0?void 0:r.toString().replace(o,"");i!==((n=e.environment)===null||n===void 0?void 0:n.toString())&&(e.environment=i)}catch{}super(e),this._options=e}};C0e.CustomClient=lYe});var Mar=S(RW=>{"use strict";Object.defineProperty(RW,"__esModule",{value:!0});RW.SagemakerClientV2=RW.SagemakerClient=void 0;var Ear=aYe(),Par=VXe(),cYe=class extends Ear.AwsClient{constructor(e){super(Object.assign(Object.assign({},e),{fetcher:(0,Par.fetchOverride)("sagemaker",e)}))}};RW.SagemakerClient=cYe;var dYe=class extends Ear.AwsClientV2{constructor(e){super(Object.assign(Object.assign({},e),{fetcher:(0,Par.fetchOverride)("sagemaker",e)}))}};RW.SagemakerClientV2=dYe});var Nar=S(lu=>{"use strict";var kXn=lu&&lu.__createBinding||(Object.create?function(t,e,r,n){n===void 0&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);(!o||("get"in o?!e.__esModule:o.writable||o.configurable))&&(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){n===void 0&&(n=r),t[n]=e[r]}),qXn=lu&&lu.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),BXn=lu&&lu.__importStar||function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var n=[];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(n[n.length]=o);return n},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var n=t(e),o=0;o{jar=L(Nar(),1);Yu()});function PC(t,e){e?(yh[0]=yh[16]=yh[1]=yh[2]=yh[3]=yh[4]=yh[5]=yh[6]=yh[7]=yh[8]=yh[9]=yh[10]=yh[11]=yh[12]=yh[13]=yh[14]=yh[15]=0,this.blocks=yh):this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0],t?(this.h0=3238371032,this.h1=914150663,this.h2=812702999,this.h3=4144912697,this.h4=4290775857,this.h5=1750603025,this.h6=1694076839,this.h7=3204075428):(this.h0=1779033703,this.h1=3144134277,this.h2=1013904242,this.h3=2773480762,this.h4=1359893119,this.h5=2600822924,this.h6=528734635,this.h7=1541459225),this.block=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0,this.is224=t}var _r,VXn,EC,x0e,yh,O0e,fYe=v(()=>{_r="0123456789abcdef".split(""),VXn=[-2147483648,8388608,32768,128],EC=[24,16,8,0],x0e=[1116352408,1899447441,3049323471,3921009573,961987163,1508970993,2453635748,2870763221,3624381080,310598401,607225278,1426881987,1925078388,2162078206,2614888103,3248222580,3835390401,4022224774,264347078,604807628,770255983,1249150122,1555081692,1996064986,2554220882,2821834349,2952996808,3210313671,3336571891,3584528711,113926993,338241895,666307205,773529912,1294757372,1396182291,1695183700,1986661051,2177026350,2456956037,2730485921,2820302411,3259730800,3345764771,3516065817,3600352804,4094571909,275423344,430227734,506948616,659060556,883997877,958139571,1322822218,1537002063,1747873779,1955562222,2024104815,2227730452,2361852424,2428436474,2756734187,3204031479,3329325298],yh=[];PC.prototype.update=function(t){if(!this.finalized){var e,r=typeof t;if(r!=="string"){if(r==="object"){if(t===null)throw new Error(ERROR);if(ARRAY_BUFFER&&t.constructor===ArrayBuffer)t=new Uint8Array(t);else if(!Array.isArray(t)&&(!ARRAY_BUFFER||!ArrayBuffer.isView(t)))throw new Error(ERROR)}else throw new Error(ERROR);e=!0}for(var n,o=0,i,a=t.length,s=this.blocks;o>>2]|=t[o]<>>2]|=n<>>2]|=(192|n>>>6)<>>2]|=(128|n&63)<=57344?(s[i>>>2]|=(224|n>>>12)<>>2]|=(128|n>>>6&63)<>>2]|=(128|n&63)<>>2]|=(240|n>>>18)<>>2]|=(128|n>>>12&63)<>>2]|=(128|n>>>6&63)<>>2]|=(128|n&63)<=64?(this.block=s[16],this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296<<0,this.bytes=this.bytes%4294967296),this}};PC.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var t=this.blocks,e=this.lastByteIndex;t[16]=this.block,t[e>>>2]|=VXn[e&3],this.block=t[16],e>=56&&(this.hashed||this.hash(),t[0]=this.block,t[16]=t[1]=t[2]=t[3]=t[4]=t[5]=t[6]=t[7]=t[8]=t[9]=t[10]=t[11]=t[12]=t[13]=t[14]=t[15]=0),t[14]=this.hBytes<<3|this.bytes>>>29,t[15]=this.bytes<<3,this.hash()}};PC.prototype.hash=function(){var t=this.h0,e=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7,u=this.blocks,l,c,d,f,p,m,h,g,y,b,_;for(l=16;l<64;++l)p=u[l-15],c=(p>>>7|p<<25)^(p>>>18|p<<14)^p>>>3,p=u[l-2],d=(p>>>17|p<<15)^(p>>>19|p<<13)^p>>>10,u[l]=u[l-16]+c+u[l-7]+d<<0;for(_=e&r,l=0;l<64;l+=4)this.first?(this.is224?(g=300032,p=u[0]-1413257819,s=p-150054599<<0,n=p+24177077<<0):(g=704751109,p=u[0]-210244248,s=p-1521486534<<0,n=p+143694565<<0),this.first=!1):(c=(t>>>2|t<<30)^(t>>>13|t<<19)^(t>>>22|t<<10),d=(o>>>6|o<<26)^(o>>>11|o<<21)^(o>>>25|o<<7),g=t&e,f=g^t&r^_,h=o&i^~o&a,p=s+d+h+x0e[l]+u[l],m=c+f,s=n+p<<0,n=p+m<<0),c=(n>>>2|n<<30)^(n>>>13|n<<19)^(n>>>22|n<<10),d=(s>>>6|s<<26)^(s>>>11|s<<21)^(s>>>25|s<<7),y=n&t,f=y^n&e^g,h=a&s^~a&o,p=i+d+h+x0e[l+1]+u[l+1],m=c+f,a=r+p<<0,r=p+m<<0,c=(r>>>2|r<<30)^(r>>>13|r<<19)^(r>>>22|r<<10),d=(a>>>6|a<<26)^(a>>>11|a<<21)^(a>>>25|a<<7),b=r&n,f=b^r&t^y,h=i&a^~i&s,p=o+d+h+x0e[l+2]+u[l+2],m=c+f,i=e+p<<0,e=p+m<<0,c=(e>>>2|e<<30)^(e>>>13|e<<19)^(e>>>22|e<<10),d=(i>>>6|i<<26)^(i>>>11|i<<21)^(i>>>25|i<<7),_=e&r,f=_^e&n^b,h=i&a^~i&s,p=o+d+h+x0e[l+3]+u[l+3],m=c+f,o=t+p<<0,t=p+m<<0,this.chromeBugWorkAround=!0;this.h0=this.h0+t<<0,this.h1=this.h1+e<<0,this.h2=this.h2+r<<0,this.h3=this.h3+n<<0,this.h4=this.h4+o<<0,this.h5=this.h5+i<<0,this.h6=this.h6+a<<0,this.h7=this.h7+s<<0};PC.prototype.hex=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7,u=_r[t>>>28&15]+_r[t>>>24&15]+_r[t>>>20&15]+_r[t>>>16&15]+_r[t>>>12&15]+_r[t>>>8&15]+_r[t>>>4&15]+_r[t&15]+_r[e>>>28&15]+_r[e>>>24&15]+_r[e>>>20&15]+_r[e>>>16&15]+_r[e>>>12&15]+_r[e>>>8&15]+_r[e>>>4&15]+_r[e&15]+_r[r>>>28&15]+_r[r>>>24&15]+_r[r>>>20&15]+_r[r>>>16&15]+_r[r>>>12&15]+_r[r>>>8&15]+_r[r>>>4&15]+_r[r&15]+_r[n>>>28&15]+_r[n>>>24&15]+_r[n>>>20&15]+_r[n>>>16&15]+_r[n>>>12&15]+_r[n>>>8&15]+_r[n>>>4&15]+_r[n&15]+_r[o>>>28&15]+_r[o>>>24&15]+_r[o>>>20&15]+_r[o>>>16&15]+_r[o>>>12&15]+_r[o>>>8&15]+_r[o>>>4&15]+_r[o&15]+_r[i>>>28&15]+_r[i>>>24&15]+_r[i>>>20&15]+_r[i>>>16&15]+_r[i>>>12&15]+_r[i>>>8&15]+_r[i>>>4&15]+_r[i&15]+_r[a>>>28&15]+_r[a>>>24&15]+_r[a>>>20&15]+_r[a>>>16&15]+_r[a>>>12&15]+_r[a>>>8&15]+_r[a>>>4&15]+_r[a&15];return this.is224||(u+=_r[s>>>28&15]+_r[s>>>24&15]+_r[s>>>20&15]+_r[s>>>16&15]+_r[s>>>12&15]+_r[s>>>8&15]+_r[s>>>4&15]+_r[s&15]),u};PC.prototype.toString=PC.prototype.hex;PC.prototype.digest=function(){this.finalize();var t=this.h0,e=this.h1,r=this.h2,n=this.h3,o=this.h4,i=this.h5,a=this.h6,s=this.h7,u=[t>>>24&255,t>>>16&255,t>>>8&255,t&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255,r>>>24&255,r>>>16&255,r>>>8&255,r&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255,a>>>24&255,a>>>16&255,a>>>8&255,a&255];return this.is224||u.push(s>>>24&255,s>>>16&255,s>>>8&255,s&255),u};PC.prototype.array=PC.prototype.digest;PC.prototype.arrayBuffer=function(){this.finalize();var t=new ArrayBuffer(this.is224?28:32),e=new DataView(t);return e.setUint32(0,this.h0),e.setUint32(4,this.h1),e.setUint32(8,this.h2),e.setUint32(12,this.h3),e.setUint32(16,this.h4),e.setUint32(20,this.h5),e.setUint32(24,this.h6),this.is224||e.setUint32(28,this.h7),t};O0e=(...t)=>new PC(!1,!0).update(t.join("")).hex()});var JXn,Dar=v(()=>{Do();fYe();JXn={};Tt(JXn,{sha256:()=>O0e})});function WXn(t){return t.message!==void 0?{text:t.text,message:wY(t.message)}:{text:t.text}}function GXn(t){let e={text:t.text};return t.message!==void 0&&(e.message=t.message.toDict()),e}var KXn,$ar,Lar,ZXn,pYe,kar=v(()=>{Do();iO();fYe();Dar();KXn={};Tt(KXn,{BaseCache:()=>Lar,InMemoryCache:()=>pYe,defaultHashKeyEncoder:()=>$ar,deserializeStoredGeneration:()=>WXn,serializeGeneration:()=>GXn});$ar=(...t)=>O0e(t.join("_"));Lar=class{constructor(){M(this,"keyEncoder",$ar)}makeDefaultKeyEncoder(t){this.keyEncoder=t}},ZXn=new Map,pYe=class Far extends Lar{constructor(r){super();M(this,"cache");this.cache=r??new Map}lookup(r,n){return Promise.resolve(this.cache.get(this.keyEncoder(r,n))??null)}async update(r,n,o){this.cache.set(this.keyEncoder(r,n),o)}static global(){return new Far(ZXn)}}});function eYn(t,e){let r=Array.from({length:t.length},(n,o)=>({start:o,end:o+1}));for(;r.length>1;){let n=null;for(let o=0;oe.get(t.slice(r.start,r.end).join(","))).filter(r=>r!=null)}function rYn(t){return t.replace(/[\\^$*+?.()|[\]{}]/g,"\\$&")}function hYe(t){switch(t){case"gpt2":return"gpt2";case"code-cushman-001":case"code-cushman-002":case"code-davinci-001":case"code-davinci-002":case"cushman-codex":case"davinci-codex":case"davinci-002":case"text-davinci-002":case"text-davinci-003":return"p50k_base";case"code-davinci-edit-001":case"text-davinci-edit-001":return"p50k_edit";case"ada":case"babbage":case"babbage-002":case"code-search-ada-code-001":case"code-search-babbage-code-001":case"curie":case"davinci":case"text-ada-001":case"text-babbage-001":case"text-curie-001":case"text-davinci-001":case"text-search-ada-doc-001":case"text-search-babbage-doc-001":case"text-search-curie-doc-001":case"text-search-davinci-doc-001":case"text-similarity-ada-001":case"text-similarity-babbage-001":case"text-similarity-curie-001":case"text-similarity-davinci-001":return"r50k_base";case"gpt-3.5-turbo-instruct-0914":case"gpt-3.5-turbo-instruct":case"gpt-3.5-turbo-16k-0613":case"gpt-3.5-turbo-16k":case"gpt-3.5-turbo-0613":case"gpt-3.5-turbo-0301":case"gpt-3.5-turbo":case"gpt-4-32k-0613":case"gpt-4-32k-0314":case"gpt-4-32k":case"gpt-4-0613":case"gpt-4-0314":case"gpt-4":case"gpt-3.5-turbo-1106":case"gpt-35-turbo":case"gpt-4-1106-preview":case"gpt-4-vision-preview":case"gpt-3.5-turbo-0125":case"gpt-4-turbo":case"gpt-4-turbo-2024-04-09":case"gpt-4-turbo-preview":case"gpt-4-0125-preview":case"text-embedding-ada-002":case"text-embedding-3-small":case"text-embedding-3-large":return"cl100k_base";case"gpt-4o":case"gpt-4o-2024-05-13":case"gpt-4o-2024-08-06":case"gpt-4o-mini-2024-07-18":case"gpt-4o-mini":return"o200k_base";default:throw new Error("Unknown model")}}var qar,XXn,YXn,QXn,mYe,T0e,Bar=v(()=>{qar=L(L2e(),1),XXn=Object.defineProperty,YXn=(t,e,r)=>e in t?XXn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,QXn=(t,e,r)=>(YXn(t,typeof e!="symbol"?e+"":e,r),r);mYe=class{constructor(t,e){M(this,"specialTokens");M(this,"inverseSpecialTokens");M(this,"patStr");M(this,"textEncoder",new TextEncoder);M(this,"textDecoder",new TextDecoder("utf-8"));M(this,"rankMap",new Map);M(this,"textMap",new Map);this.patStr=t.pat_str;let r=t.bpe_ranks.split(` +`).filter(Boolean).reduce((n,o)=>{let[i,a,...s]=o.split(" "),u=Number.parseInt(a,10);return s.forEach((l,c)=>n[l]=u+c),n},{});for(let[n,o]of Object.entries(r)){let i=qar.default.toByteArray(n);this.rankMap.set(i.join(","),o),this.textMap.set(o,i)}this.specialTokens={...t.special_tokens,...e},this.inverseSpecialTokens=Object.entries(this.specialTokens).reduce((n,[o,i])=>(n[i]=this.textEncoder.encode(o),n),{})}encode(t,e=[],r="all"){let n=new RegExp(this.patStr,"ug"),o=mYe.specialTokenRegex(Object.keys(this.specialTokens)),i=[],a=new Set(e==="all"?Object.keys(this.specialTokens):e),s=new Set(r==="all"?Object.keys(this.specialTokens).filter(l=>!a.has(l)):r);if(s.size>0){let l=mYe.specialTokenRegex([...s]),c=t.match(l);if(c!=null)throw new Error(`The text contains a special token that is not allowed: ${c[0]}`)}let u=0;for(;;){let l=null,c=u;for(;o.lastIndex=c,l=o.exec(t),!(l==null||a.has(l[0]));)c=l.index+1;let d=l?.index??t.length;for(let p of t.substring(u,d).matchAll(n)){let m=this.textEncoder.encode(p[0]),h=this.rankMap.get(m.join(","));if(h!=null){i.push(h);continue}i.push(...tYn(m,this.rankMap))}if(l==null)break;let f=this.specialTokens[l[0]];i.push(f),u=l.index+l[0].length}return i}decode(t){let e=[],r=0;for(let i=0;inew RegExp(t.map(e=>rYn(e)).join("|"),"g"))});var Uar=v(()=>{Bar()});async function gYe(t){return t in E0e||(E0e[t]=oYn.fetch(`https://tiktoken.pages.dev/js/${t}.json`).then(e=>e.json()).then(e=>new T0e(e)).catch(e=>{throw delete E0e[t],e})),await E0e[t]}async function P0e(t){return gYe(hYe(t))}var nYn,E0e,oYn,yYe=v(()=>{Do();nz();Uar();nYn={};Tt(nYn,{encodingForModel:()=>P0e,getEncoding:()=>gYe});E0e={},oYn=new kw({})});function Wv(t){return typeof t!="object"||!t?!1:!!("type"in t&&t.type==="function"&&"function"in t&&typeof t.function=="object"&&t.function&&"name"in t.function&&"parameters"in t.function)}var iYn,M0e,aYn,zar,Har,sYn,IW,M2,Gv=v(()=>{Do();iO();nz();Yh();$Q();kar();yYe();iYn={};Tt(iYn,{BaseLangChain:()=>IW,BaseLanguageModel:()=>M2,calculateMaxTokens:()=>Har,getEmbeddingContextSize:()=>aYn,getModelContextSize:()=>zar,getModelNameForTiktoken:()=>M0e,isOpenAITool:()=>Wv});M0e=t=>t.startsWith("gpt-3.5-turbo-16k")?"gpt-3.5-turbo-16k":t.startsWith("gpt-3.5-turbo-")?"gpt-3.5-turbo":t.startsWith("gpt-4-32k")?"gpt-4-32k":t.startsWith("gpt-4-")?"gpt-4":t.startsWith("gpt-4o")?"gpt-4o":t,aYn=t=>{switch(t){case"text-embedding-ada-002":return 8191;default:return 2046}},zar=t=>{switch(M0e(t)){case"gpt-3.5-turbo-16k":return 16384;case"gpt-3.5-turbo":return 4096;case"gpt-4-32k":return 32768;case"gpt-4":return 8192;case"text-davinci-003":return 4097;case"text-curie-001":return 2048;case"text-babbage-001":return 2048;case"text-ada-001":return 2048;case"code-davinci-002":return 8e3;case"code-cushman-001":return 2048;default:return 4097}};Har=async({prompt:t,modelName:e})=>{let r;try{r=(await P0e(M0e(e))).encode(t).length}catch{console.warn("Failed to calculate number of tokens, falling back to approximate count"),r=Math.ceil(t.length/4)}return zar(e)-r},sYn=()=>!1,IW=class extends Lo{constructor(e){super(e);M(this,"verbose");M(this,"callbacks");M(this,"tags");M(this,"metadata");this.verbose=e.verbose??sYn(),this.callbacks=e.callbacks,this.tags=e.tags??[],this.metadata=e.metadata??{}}get lc_attributes(){return{callbacks:void 0,verbose:void 0}}},M2=class extends IW{constructor({callbacks:e,callbackManager:r,...n}){let{cache:o,...i}=n;super({callbacks:e??r,...i});M(this,"caller");M(this,"cache");M(this,"_encoding");typeof o=="object"?this.cache=o:o?this.cache=pYe.global():this.cache=void 0,this.caller=new kw(n??{})}get callKeys(){return["stop","timeout","signal","tags","metadata","callbacks"]}async getNumTokens(e){let r;typeof e=="string"?r=e:r=e.map(o=>typeof o=="string"?o:o.type==="text"&&"text"in o?o.text:"").join("");let n=Math.ceil(r.length/4);if(!this._encoding)try{this._encoding=await P0e("modelName"in this?M0e(this.modelName):"gpt2")}catch(o){console.warn("Failed to calculate number of tokens, falling back to approximate count",o)}if(this._encoding)try{n=this._encoding.encode(r).length}catch(o){console.warn("Failed to calculate number of tokens, falling back to approximate count",o)}return n}static _convertInputToPromptValue(e){return typeof e=="string"?new jQ(e):Array.isArray(e)?new DQ(e.map(Nw)):e}_identifyingParams(){return{}}_getSerializedCacheKeyParametersForCall({config:e,...r}){let n={...this._identifyingParams(),...r,_type:this._llmType(),_model:this._modelType()};return Object.entries(n).filter(([a,s])=>s!==void 0).map(([a,s])=>`${a}:${JSON.stringify(s)}`).sort().join(",")}serialize(){return{...this._identifyingParams(),_type:this._llmType(),_model:this._modelType()}}static async deserialize(e){throw new Error("Use .toJSON() instead")}}});function soe(t){return t!==void 0&&Array.isArray(t.lc_namespace)}function uoe(t){return t!==void 0&&Lo.isRunnable(t)&&"lc_name"in t.constructor&&typeof t.constructor.lc_name=="function"&&t.constructor.lc_name()==="RunnableToolLike"}function loe(t){return!!t&&typeof t=="object"&&"name"in t&&"schema"in t&&(Ga(t.schema)||t.schema!=null&&typeof t.schema=="object"&&"type"in t.schema&&typeof t.schema.type=="string"&&["null","boolean","object","array","number","string"].includes(t.schema.type))}function yg(t){return loe(t)||uoe(t)||soe(t)}var bYe=v(()=>{mN();Yh()});function Var(t,e){let r=typeof e=="number"?void 0:e;return{name:t.name,description:t.description,parameters:Hi(t.schema),...r?.strict!==void 0?{strict:r.strict}:{}}}function M1(t,e){let r=typeof e=="number"?void 0:e,n;return yg(t)?n={type:"function",function:Var(t)}:n=t,r?.strict!==void 0&&(n.function.strict=r.strict),n}var uYn,R1=v(()=>{Do();o_();bYe();uYn={};Tt(uYn,{convertToOpenAIFunction:()=>Var,convertToOpenAITool:()=>M1,isLangChainTool:()=>yg,isRunnableToolLike:()=>uoe,isStructuredTool:()=>soe,isStructuredToolParams:()=>loe})});function R0e(t){let e=t.constructor;return new e({...t,content:t.contentBlocks,response_metadata:{...t.response_metadata,output_version:"v1"}})}var Jar,Kar=v(()=>{Jar=t=>t()});function _Ye(t){let e=[];for(let r of t){let n=r;if(Array.isArray(r.content))for(let o=0;o{Do();mY();Gg();z0();iO();Yu();xY();H$();cO();gm();mN();o_();Yh();js();Gv();mhe();Kar();lYn={};Tt(lYn,{BaseChatModel:()=>bh,SimpleChatModel:()=>cYn});bh=class R2 extends M2{constructor(r){super(r);M(this,"lc_namespace",["langchain","chat_models",this._llmType()]);M(this,"disableStreaming",!1);M(this,"outputVersion");this.outputVersion=Jar(()=>{let n=r.outputVersion??dn("LC_OUTPUT_VERSION");return n&&["v0","v1"].includes(n)?n:"v0"})}get callKeys(){return[...super.callKeys,"outputVersion"]}_separateRunnableConfigFromCallOptionsCompat(r){let[n,o]=super._separateRunnableConfigFromCallOptions(r);return o.signal=n.signal,[n,o]}async invoke(r,n){let o=R2._convertInputToPromptValue(r);return(await this.generatePrompt([o],n,n?.callbacks)).generations[0][0].message}async*_streamResponseChunks(r,n,o){throw new Error("Not implemented.")}async*_streamIterator(r,n){if(this._streamResponseChunks===R2.prototype._streamResponseChunks||this.disableStreaming)yield this.invoke(r,n);else{let i=R2._convertInputToPromptValue(r).toChatMessages(),[a,s]=this._separateRunnableConfigFromCallOptionsCompat(n),u={...a.metadata,...this.getLsParams(s)},l=await Gl.configure(a.callbacks,this.callbacks,a.tags,this.tags,u,this.metadata,{verbose:this.verbose}),c={options:s,invocation_params:this?.invocationParams(s),batch_size:1},d=s.outputVersion??this.outputVersion,f=await l?.handleChatModelStart(this.toJSON(),[_Ye(i)],a.runId,void 0,c,void 0,void 0,a.runName),p,m;try{for await(let h of this._streamResponseChunks(i,s,f?.[0])){if(h.message.id==null){let g=f?.at(0)?.runId;g!=null&&h.message._updateId(`run-${g}`)}h.message.response_metadata={...h.generationInfo,...h.message.response_metadata},d==="v1"?yield R0e(h.message):yield h.message,p?p=p.concat(h):p=h,bY(h.message)&&h.message.usage_metadata!==void 0&&(m={tokenUsage:{promptTokens:h.message.usage_metadata.input_tokens,completionTokens:h.message.usage_metadata.output_tokens,totalTokens:h.message.usage_metadata.total_tokens}})}}catch(h){throw await Promise.all((f??[]).map(g=>g?.handleLLMError(h))),h}await Promise.all((f??[]).map(h=>h?.handleLLMEnd({generations:[[p]],llmOutput:m})))}}getLsParams(r){let n=this.getName().startsWith("Chat")?this.getName().replace("Chat",""):this.getName();return{ls_model_type:"chat",ls_stop:r.stop,ls_provider:n}}async _generateUncached(r,n,o,i){let a=r.map(p=>p.map(Nw)),s;if(i!==void 0&&i.length===a.length)s=i;else{let p={...o.metadata,...this.getLsParams(n)},m=await Gl.configure(o.callbacks,this.callbacks,o.tags,this.tags,p,this.metadata,{verbose:this.verbose}),h={options:n,invocation_params:this?.invocationParams(n),batch_size:1};s=await m?.handleChatModelStart(this.toJSON(),a.map(_Ye),o.runId,void 0,h,void 0,void 0,o.runName)}let u=n.outputVersion??this.outputVersion,l=[],c=[];if(!!s?.[0].handlers.find(CY)&&!this.disableStreaming&&a.length===1&&this._streamResponseChunks!==R2.prototype._streamResponseChunks)try{let p=await this._streamResponseChunks(a[0],n,s?.[0]),m,h;for await(let g of p){if(g.message.id==null){let y=s?.at(0)?.runId;y!=null&&g.message._updateId(`run-${y}`)}m===void 0?m=g:m=eb(m,g),bY(g.message)&&g.message.usage_metadata!==void 0&&(h={tokenUsage:{promptTokens:g.message.usage_metadata.input_tokens,completionTokens:g.message.usage_metadata.output_tokens,totalTokens:g.message.usage_metadata.total_tokens}})}if(m===void 0)throw new Error("Received empty response from chat model call.");l.push([m]),await s?.[0].handleLLMEnd({generations:l,llmOutput:h})}catch(p){throw await s?.[0].handleLLMError(p),p}else{let p=await Promise.allSettled(a.map(async(m,h)=>{let g=await this._generate(m,{...n,promptIndex:h},s?.[h]);if(u==="v1")for(let y of g.generations)y.message=R0e(y.message);return g}));await Promise.all(p.map(async(m,h)=>{if(m.status==="fulfilled"){let g=m.value;for(let y of g.generations){if(y.message.id==null){let b=s?.at(0)?.runId;b!=null&&y.message._updateId(`run-${b}`)}y.message.response_metadata={...y.generationInfo,...y.message.response_metadata}}return g.generations.length===1&&(g.generations[0].message.response_metadata={...g.llmOutput,...g.generations[0].message.response_metadata}),l[h]=g.generations,c[h]=g.llmOutput,s?.[h]?.handleLLMEnd({generations:[g.generations],llmOutput:g.llmOutput})}else return await s?.[h]?.handleLLMError(m.reason),Promise.reject(m.reason)}))}let f={generations:l,llmOutput:c.length?this._combineLLMOutput?.(...c):void 0};return Object.defineProperty(f,uN,{value:s?{runIds:s?.map(p=>p.runId)}:void 0,configurable:!0}),f}async _generateCached({messages:r,cache:n,llmStringKey:o,parsedOptions:i,handledOptions:a}){let s=r.map(b=>b.map(Nw)),u={...a.metadata,...this.getLsParams(i)},l=await Gl.configure(a.callbacks,this.callbacks,a.tags,this.tags,u,this.metadata,{verbose:this.verbose}),c={options:i,invocation_params:this?.invocationParams(i),batch_size:1},d=await l?.handleChatModelStart(this.toJSON(),s.map(_Ye),a.runId,void 0,c,void 0,void 0,a.runName),f=[],m=(await Promise.allSettled(s.map(async(b,_)=>{let w=R2._convertInputToPromptValue(b).toString(),x=await n.lookup(w,o);return x==null&&f.push(_),x}))).map((b,_)=>({result:b,runManager:d?.[_]})).filter(({result:b})=>b.status==="fulfilled"&&b.value!=null||b.status==="rejected"),h=i.outputVersion??this.outputVersion,g=[];await Promise.all(m.map(async({result:b,runManager:_},w)=>{if(b.status==="fulfilled"){let x=b.value;return g[w]=x.map(O=>("message"in O&&eh(O.message)&&qs(O.message)&&(O.message.usage_metadata={input_tokens:0,output_tokens:0,total_tokens:0},h==="v1"&&(O.message=R0e(O.message))),O.generationInfo={...O.generationInfo,tokenUsage:{}},O)),x.length&&await _?.handleLLMNewToken(x[0].text),_?.handleLLMEnd({generations:[x]},void 0,void 0,void 0,{cached:!0})}else return await _?.handleLLMError(b.reason,void 0,void 0,void 0,{cached:!0}),Promise.reject(b.reason)}));let y={generations:g,missingPromptIndices:f,startedRunManagers:d};return Object.defineProperty(y,uN,{value:d?{runIds:d?.map(b=>b.runId)}:void 0,configurable:!0}),y}async generate(r,n,o){let i;Array.isArray(n)?i={stop:n}:i=n;let a=r.map(h=>h.map(Nw)),[s,u]=this._separateRunnableConfigFromCallOptionsCompat(i);if(s.callbacks=s.callbacks??o,!this.cache)return this._generateUncached(a,u,s);let{cache:l}=this,c=this._getSerializedCacheKeyParametersForCall(u),{generations:d,missingPromptIndices:f,startedRunManagers:p}=await this._generateCached({messages:a,cache:l,llmStringKey:c,parsedOptions:u,handledOptions:s}),m={};if(f.length>0){let h=await this._generateUncached(f.map(g=>a[g]),u,s,p!==void 0?f.map(g=>p?.[g]):void 0);await Promise.all(h.generations.map(async(g,y)=>{let b=f[y];d[b]=g;let _=R2._convertInputToPromptValue(a[b]).toString();return l.update(_,c,g)})),m=h.llmOutput??{}}return{generations:d,llmOutput:m}}invocationParams(r){return{}}_modelType(){return"base_chat_model"}async generatePrompt(r,n,o){let i=r.map(a=>a.toChatMessages());return this.generate(i,n,o)}withStructuredOutput(r,n){if(typeof this.bindTools!="function")throw new Error('Chat model must implement ".bindTools()" to use withStructuredOutput.');if(n?.strict)throw new Error('"strict" mode is not supported for this model by default.');let o=r,i=n?.name,a=rL(o)??"A function available to call.",s=n?.method,u=n?.includeRaw;if(s==="jsonMode")throw new Error('Base withStructuredOutput implementation only supports "functionCalling" as a method.');let l=i??"extract",c;Ga(o)?c=[{type:"function",function:{name:l,description:a,parameters:Hi(o)}}]:("name"in o&&(l=o.name),c=[{type:"function",function:{name:l,description:a,parameters:o}}]);let d=this.bindTools(c),f=i_.from(g=>{if(!Nr.isInstance(g))throw new Error("Input is not an AIMessageChunk.");if(!g.tool_calls||g.tool_calls.length===0)throw new Error("No tool calls found in the response.");let y=g.tool_calls.find(b=>b.name===l);if(!y)throw new Error(`No tool call found with name ${l}.`);return y.args});if(!u)return d.pipe(f).withConfig({runName:"StructuredOutput"});let p=wu.assign({parsed:(g,y)=>f.invoke(g.raw,y)}),m=wu.assign({parsed:()=>null}),h=p.withFallbacks({fallbacks:[m]});return Sl.from([{raw:d},h]).withConfig({runName:"StructuredOutputRunnable"})}},cYn=class extends bh{async _generate(t,e,r){let n=await this._call(t,e,r),o=new li(n);if(typeof o.content!="string")throw new Error("Cannot generate with a simple chat model when output is not a string.");return{generations:[{text:o.content,message:o}]}}}});function War(t,e=0){return(bg[t[e+0]]+bg[t[e+1]]+bg[t[e+2]]+bg[t[e+3]]+"-"+bg[t[e+4]]+bg[t[e+5]]+"-"+bg[t[e+6]]+bg[t[e+7]]+"-"+bg[t[e+8]]+bg[t[e+9]]+"-"+bg[t[e+10]]+bg[t[e+11]]+bg[t[e+12]]+bg[t[e+13]]+bg[t[e+14]]+bg[t[e+15]]).toLowerCase()}var bg,A0e,Gar=v(()=>{bg=[];for(A0e=0;A0e<256;++A0e)bg.push((A0e+256).toString(16).slice(1))});function vYe(){if(!I0e&&(I0e=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!I0e))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return I0e(dYn)}var I0e,dYn,Zar=v(()=>{dYn=new Uint8Array(16)});var fYn,wYe,Xar=v(()=>{fYn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),wYe={randomUUID:fYn}});function pYn(t,e,r){if(wYe.randomUUID&&!e&&!t)return wYe.randomUUID();t=t||{};var n=t.random||(t.rng||vYe)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(var o=0;o<16;++o)e[r+o]=n[o];return e}return War(n)}var SYe,Yar=v(()=>{Xar();Zar();Gar();SYe=pYn});var Qar=v(()=>{Yar()});var hYn,Zv=v(()=>{Do();mN();hYn={};Tt(hYn,{extendInteropZodObject:()=>AEt,getInteropZodDefaultGetter:()=>NEt,getInteropZodObjectShape:()=>kme,getSchemaDescription:()=>rL,interopParse:()=>PEt,interopParseAsync:()=>tL,interopSafeParse:()=>EEt,interopSafeParseAsync:()=>eL,interopZodObjectMakeFieldsOptional:()=>jEt,interopZodObjectPartial:()=>IEt,interopZodObjectPassthrough:()=>qme,interopZodObjectStrict:()=>g6,interopZodTransformInputSchema:()=>Q$,isInteropZodLiteral:()=>TEt,isInteropZodObject:()=>REt,isInteropZodSchema:()=>Ga,isShapelessZodSchema:()=>MEt,isSimpleStringZodSchema:()=>y6,isZodArrayV4:()=>OQ,isZodLiteralV3:()=>zze,isZodLiteralV4:()=>Hze,isZodObjectV3:()=>Bme,isZodObjectV4:()=>Bw,isZodSchema:()=>OEt,isZodSchemaV3:()=>Xl,isZodSchemaV4:()=>el})});function esr(t){let e=[],r=[];typeof t=="string"?r=[{output:t}]:t instanceof Map||typeof t=="object"&&t!==null&&!Array.isArray(t)?r=[t]:Array.isArray(t)||(r=[{output:t}]);for(let n of r)!(n instanceof Map)&&(typeof n!="object"||n===null)&&(n={output:n}),e.push(n);return e}function N0e(t,e){let r=i=>{switch(i){case"system":return"SYSTEM";case"human":return"USER";case"ai":return"CHATBOT";case"tool":return"TOOL";default:throw new Error(`Unknown message type: '${i}'. Accepted types: 'human', 'ai', 'system', 'tool'`)}},n=i=>{if(typeof i=="string")return i;throw new Error(`ChatCohere does not support non text message content. Received: ${JSON.stringify(i,null,2)}`)},o=i=>qs(i)&&i.tool_calls?i.tool_calls.map(a=>({name:a.name,parameters:a.args})):[];if(t._getType().toLowerCase()==="ai")return{role:r(t._getType()),message:n(t.content),toolCalls:o(t)};if(t._getType().toLowerCase()==="tool")return{role:r(t._getType()),message:n(t.content),toolResults:e};if(t._getType().toLowerCase()==="human"||t._getType().toLowerCase()==="system")return{role:r(t._getType()),message:n(t.content)};throw new Error("Got unknown message type. Supported types are AIMessage, ToolMessage, HumanMessage, and SystemMessage")}function gYn(t){return"name"in t&&"description"in t&&"parameterDefinitions"in t}function tsr(t){return t._getType()==="tool"}function rsr(t){let e="properties"in t?t.properties:{},r="required"in t?t.required:[],n={};return Object.keys(e).forEach(o=>{n[o]=e[o],r===void 0&&(r=[]),n[o].required=r.includes(o)}),n}function yYn(t){if(t){if(t.every(gYn))return t;if(t.every(Wv))return t.map(e=>({name:e.function.name,description:e.function.description??"",parameterDefinitions:rsr(e.function.parameters)}));if(t.every(yg))return t.map(e=>{let r=Ga(e.schema)?Hi(e.schema):e.schema;return{name:e.name,description:e.description??"",parameterDefinitions:rsr(r)}});throw new Error("Can not pass in a mix of tool schema types to ChatCohere.")}else return}var CYe,nsr=v(()=>{aoe();js();Gv();R1();A1();gm();Qar();Zv();o_();CYe=class extends bh{constructor(e){super(e??{});M(this,"lc_serializable",!0);M(this,"client");M(this,"model","command-r-plus");M(this,"temperature",.3);M(this,"streaming",!1);M(this,"streamUsage",!0);this.client=AW(e),this.model=e?.model??this.model,this.temperature=e?.temperature??this.temperature,this.streaming=e?.streaming??this.streaming,this.streamUsage=e?.streamUsage??this.streamUsage}static lc_name(){return"ChatCohere"}getLsParams(e){let r=this.invocationParams(e);return{ls_provider:"cohere",ls_model_name:this.model,ls_model_type:"chat",ls_temperature:this.temperature??void 0,ls_max_tokens:typeof r.maxTokens=="number"?r.maxTokens:void 0,ls_stop:Array.isArray(r.stopSequences)?r.stopSequences:void 0}}_llmType(){return"cohere"}invocationParams(e){if(e.tool_choice)throw new Error("'tool_choice' call option is not supported by ChatCohere.");let r={model:this.model,preamble:e.preamble,conversationId:e.conversationId,promptTruncation:e.promptTruncation,connectors:e.connectors,searchQueriesOnly:e.searchQueriesOnly,documents:e.documents,temperature:e.temperature??this.temperature,forceSingleStep:e.forceSingleStep,tools:e.tools};return Object.fromEntries(Object.entries(r).filter(([,n])=>n!==void 0))}bindTools(e,r){return this.withConfig({tools:yYn(e),...r})}_getChatRequest(e,r){let n=this.invocationParams(r),o=this._messagesToCohereToolResultsCurrChatTurn(e),i=[],a="",s=[];if(n.forceSingleStep){a="";for(let l=0;l=0;l-=1){let c=e[l];if(c._getType().toLowerCase()==="human"&&c.content){a=c.content.toString();break}}}else{for(let l=0;l0?"":e[e.length-1].content.toString()}return{message:a,chatHistory:i,toolResults:o.length>0?o:void 0,...n}}_getCurrChatTurnMessages(e){let r=[];for(let n=e.length-1;n>=0;n-=1){let o=e[n];if(r.push(o),o._getType().toLowerCase()==="human")break}return r.reverse()}_messagesToCohereToolResultsCurrChatTurn(e){let r=[],n=this._getCurrChatTurnMessages(e);for(let o of n)if(tsr(o)){let i=o,a=n.filter(s=>qs(s)&&s.tool_calls!==void 0);if(a.length>0){let s=a[a.length-1];s.tool_calls&&r.push(...s.tool_calls.filter(u=>u.id===i.tool_call_id).map(u=>({call:{name:u.name,parameters:u.args},outputs:esr(i.content)})))}}return r}_messageToCohereToolResults(e,r){let n=[],o=e[r];if(!tsr(o))throw new Error("The message index does not correspond to an instance of ToolMessage");let a=e.slice(0,r).filter(s=>qs(s)&&s.tool_calls).slice(-1)[0];return a.tool_calls&&n.push(...a.tool_calls.filter(s=>s.id===o.tool_call_id).map(s=>({call:{name:s.name,parameters:s.args},outputs:esr(o.content)}))),n}_formatCohereToolCalls(e=null){if(!e)return[];let r=[];for(let n of e)r.push({id:SYe().substring(0,32),function:{name:n.name,arguments:n.parameters},type:"function"});return r}_convertCohereToolCallToLangchain(e){return e.map(r=>({name:r.function.name,args:r.function.arguments,id:r.id,type:"tool_call"}))}async _generate(e,r,n){let o={},i=this._getChatRequest(e,r);if(this.streaming){let c=this._streamResponseChunks(e,r,n),d={};for await(let p of c){let m=p.generationInfo?.completion??0;d[m]===void 0?d[m]=p:d[m]=d[m].concat(p)}return{generations:Object.entries(d).sort(([p],[m])=>parseInt(p,10)-parseInt(m,10)).map(([p,m])=>m),llmOutput:{estimatedTokenUsage:o}}}let a=await this.caller.callWithOptions({signal:r.signal},async()=>{let c;try{c=await this.client.chat(i)}catch(d){throw d.status=d.status??d.statusCode,d}return c});if(a.meta?.tokens){let{inputTokens:c,outputTokens:d}=a.meta.tokens;d&&(o.completionTokens=(o.completionTokens??0)+d),c&&(o.promptTokens=(o.promptTokens??0)+c),o.totalTokens=(o.totalTokens??0)+(o.promptTokens??0)+(o.completionTokens??0)}let s={...a};delete s.text,a.toolCalls&&a.toolCalls.length>0&&(s.toolCalls=this._formatCohereToolCalls(a.toolCalls));let u=[];return"toolCalls"in s&&(u=this._convertCohereToolCallToLangchain(s.toolCalls)),{generations:[{text:a.text,message:new li({content:a.text,additional_kwargs:s,tool_calls:u,usage_metadata:{input_tokens:o.promptTokens??0,output_tokens:o.completionTokens??0,total_tokens:o.totalTokens??0}}),generationInfo:s}],llmOutput:{estimatedTokenUsage:o}}}async*_streamResponseChunks(e,r,n){let o=this._getChatRequest(e,r),i=await this.caller.call(async()=>{let a;try{a=await this.client.chatStream(o)}catch(s){throw s.status=s.status??s.statusCode,s}return a});for await(let a of i)if(a.eventType==="text-generation")yield new Oi({text:a.text,message:new Nr({content:a.text})}),await n?.handleLLMNewToken(a.text);else if(a.eventType!=="stream-end")yield new Oi({text:"",message:new Nr({content:"",additional_kwargs:{...a}}),generationInfo:{...a}});else if(a.eventType==="stream-end"&&(this.streamUsage||r.streamUsage)){let s=a.response.meta?.tokens?.inputTokens??0,u=a.response.meta?.tokens?.outputTokens??0,l={...a.response};a.response.toolCalls&&a.response.toolCalls.length>0&&(l.toolCalls=this._formatCohereToolCalls(a.response.toolCalls));let c=[],d=l.toolCalls??[];d.length>0&&(c=d.map(f=>({name:f.function.name,args:f.function.arguments,id:f.id,index:f.index,type:"tool_call_chunk"}))),yield new Oi({text:"",message:new Nr({content:"",additional_kwargs:{eventType:"stream-end"},tool_call_chunks:c,usage_metadata:{input_tokens:s,output_tokens:u,total_tokens:s+u}}),generationInfo:{eventType:"stream-end",...l}})}}_combineLLMOutput(...e){return e.reduce((r,n)=>{if(n&&n.estimatedTokenUsage){let o=r.estimatedTokenUsage?.completionTokens??0,i=r.estimatedTokenUsage?.promptTokens??0,a=r.estimatedTokenUsage?.totalTokens??0;o+=n.estimatedTokenUsage.completionTokens??0,i+=n.estimatedTokenUsage.promptTokens??0,a+=n.estimatedTokenUsage.totalTokens??0,r.estimatedTokenUsage={completionTokens:o,promptTokens:i,totalTokens:a}}return r},{estimatedTokenUsage:{completionTokens:0,promptTokens:0,totalTokens:0}})}get lc_secrets(){return{apiKey:"COHERE_API_KEY",api_key:"COHERE_API_KEY"}}get lc_aliases(){return{apiKey:"cohere_api_key",api_key:"cohere_api_key"}}}});var bYn,xYe,j0e,doe=v(()=>{Do();xY();H$();cO();gm();Gv();bYn={};Tt(bYn,{BaseLLM:()=>xYe,LLM:()=>j0e});xYe=class coe extends M2{constructor(){super(...arguments);M(this,"lc_namespace",["langchain","llms",this._llmType()])}async invoke(r,n){let o=coe._convertInputToPromptValue(r);return(await this.generatePrompt([o],n,n?.callbacks)).generations[0][0].text}async*_streamResponseChunks(r,n,o){throw new Error("Not implemented.")}_separateRunnableConfigFromCallOptionsCompat(r){let[n,o]=super._separateRunnableConfigFromCallOptions(r);return o.signal=n.signal,[n,o]}async*_streamIterator(r,n){if(this._streamResponseChunks===coe.prototype._streamResponseChunks)yield this.invoke(r,n);else{let o=coe._convertInputToPromptValue(r),[i,a]=this._separateRunnableConfigFromCallOptionsCompat(n),s=await Gl.configure(i.callbacks,this.callbacks,i.tags,this.tags,i.metadata,this.metadata,{verbose:this.verbose}),u={options:a,invocation_params:this?.invocationParams(a),batch_size:1},l=await s?.handleLLMStart(this.toJSON(),[o.toString()],i.runId,void 0,u,void 0,void 0,i.runName),c=new Fw({text:""});try{for await(let d of this._streamResponseChunks(o.toString(),a,l?.[0]))c?c=c.concat(d):c=d,typeof d.text=="string"&&(yield d.text)}catch(d){throw await Promise.all((l??[]).map(f=>f?.handleLLMError(d))),d}await Promise.all((l??[]).map(d=>d?.handleLLMEnd({generations:[[c]]})))}}async generatePrompt(r,n,o){let i=r.map(a=>a.toString());return this.generate(i,n,o)}invocationParams(r){return{}}_flattenLLMResult(r){let n=[];for(let o=0;of?.handleLLMError(d))),d}let c=this._flattenLLMResult(u);await Promise.all((a??[]).map((d,f)=>d?.handleLLMEnd(c[f])))}let l=a?.map(c=>c.runId)||void 0;return Object.defineProperty(u,uN,{value:l?{runIds:l}:void 0,configurable:!0}),u}async _generateCached({prompts:r,cache:n,llmStringKey:o,parsedOptions:i,handledOptions:a,runId:s}){let u=await Gl.configure(a.callbacks,this.callbacks,a.tags,this.tags,a.metadata,this.metadata,{verbose:this.verbose}),l={options:i,invocation_params:this?.invocationParams(i),batch_size:r.length},c=await u?.handleLLMStart(this.toJSON(),r,s,void 0,l,void 0,void 0,a?.runName),d=[],p=(await Promise.allSettled(r.map(async(g,y)=>{let b=await n.lookup(g,o);return b==null&&d.push(y),b}))).map((g,y)=>({result:g,runManager:c?.[y]})).filter(({result:g})=>g.status==="fulfilled"&&g.value!=null||g.status==="rejected"),m=[];await Promise.all(p.map(async({result:g,runManager:y},b)=>{if(g.status==="fulfilled"){let _=g.value;return m[b]=_.map(w=>(w.generationInfo={...w.generationInfo,tokenUsage:{}},w)),_.length&&await y?.handleLLMNewToken(_[0].text),y?.handleLLMEnd({generations:[_]},void 0,void 0,void 0,{cached:!0})}else return await y?.handleLLMError(g.reason,void 0,void 0,void 0,{cached:!0}),Promise.reject(g.reason)}));let h={generations:m,missingPromptIndices:d,startedRunManagers:c};return Object.defineProperty(h,uN,{value:c?{runIds:c?.map(g=>g.runId)}:void 0,configurable:!0}),h}async generate(r,n,o){if(!Array.isArray(r))throw new Error("Argument 'prompts' is expected to be a string[]");let i;Array.isArray(n)?i={stop:n}:i=n;let[a,s]=this._separateRunnableConfigFromCallOptionsCompat(i);if(a.callbacks=a.callbacks??o,!this.cache)return this._generateUncached(r,s,a);let{cache:u}=this,l=this._getSerializedCacheKeyParametersForCall(s),{generations:c,missingPromptIndices:d,startedRunManagers:f}=await this._generateCached({prompts:r,cache:u,llmStringKey:l,parsedOptions:s,handledOptions:a,runId:a.runId}),p={};if(d.length>0){let m=await this._generateUncached(d.map(h=>r[h]),s,a,f!==void 0?d.map(h=>f?.[h]):void 0);await Promise.all(m.generations.map(async(h,g)=>{let y=d[g];return c[y]=h,u.update(r[y],l,h)})),p=m.llmOutput??{}}return{generations:c,llmOutput:p}}_identifyingParams(){return{}}_modelType(){return"base_llm"}},j0e=class extends xYe{async _generate(t,e,r){return{generations:await Promise.all(t.map((o,i)=>this._call(o,{...e,promptIndex:i},r).then(a=>[{text:a}])))}}}});var osr=v(()=>{aoe();doe()});var _Yn,MS,A2=v(()=>{Do();nz();_Yn={};Tt(_Yn,{Embeddings:()=>MS});MS=class{constructor(t){M(this,"caller");this.caller=new kw(t??{})}}});var vYn,RS,YF=v(()=>{Do();vYn={};Tt(vYn,{chunkArray:()=>RS});RS=(t,e)=>t.reduce((r,n,o)=>{let i=Math.floor(o/e),a=r[i]||[];return r[i]=a.concat([n]),r},[])});var OYe,isr=v(()=>{aoe();A2();YF();OYe=class extends MS{constructor(e){let r={maxConcurrency:2,...e};super(r);M(this,"model");M(this,"batchSize",48);M(this,"embeddingTypes",["float"]);M(this,"client");if(this.client=AW(r),this.model=r?.model??this.model,!this.model)throw new Error("Model not specified for CohereEmbeddings instance. Please provide a model name from the options here: https://docs.cohere.com/reference/embed");this.batchSize=r?.batchSize??this.batchSize,this.embeddingTypes=r?.embeddingTypes??this.embeddingTypes}async embedDocuments(e){let r=RS(e,this.batchSize),n=r.map(a=>this.embeddingWithRetry({model:this.model,texts:a,inputType:"search_document",embeddingTypes:this.embeddingTypes})),o=await Promise.all(n),i=[];for(let a=0;a{let r;try{r=await this.client.embed(e)}catch(n){throw n.status=n.status??n.statusCode,n}return r})}get lc_secrets(){return{apiKey:"COHERE_API_KEY",api_key:"COHERE_API_KEY"}}get lc_aliases(){return{apiKey:"cohere_api_key",api_key:"cohere_api_key"}}}});var wYn,asr,ssr=v(()=>{Do();wYn={};Tt(wYn,{BaseDocumentCompressor:()=>asr});asr=class{static isBaseDocumentCompressor(t){return t?.compressDocuments!==void 0}}});var usr=v(()=>{aoe();ssr()});var TYe=v(()=>{nsr();osr();isr();usr()});function I1(t){if(typeof t=="object"&&t!==null){let e={...t};"additionalProperties"in e&&delete e.additionalProperties,"$schema"in e&&delete e.$schema,"strict"in e&&delete e.strict;for(let r in e)r in e&&(Array.isArray(e[r])?e[r]=e[r].map(I1):typeof e[r]=="object"&&e[r]!==null&&(e[r]=I1(e[r])));return e}return t}function foe(t){let e=I1(Ga(t)?Hi(t):t),{$schema:r,...n}=e;return n}function lsr(t){let e=I1(t),{$schema:r,...n}=e;return n}var D0e=v(()=>{Zv();o_()});function csr(t,e=0){return(_g[t[e+0]]+_g[t[e+1]]+_g[t[e+2]]+_g[t[e+3]]+"-"+_g[t[e+4]]+_g[t[e+5]]+"-"+_g[t[e+6]]+_g[t[e+7]]+"-"+_g[t[e+8]]+_g[t[e+9]]+"-"+_g[t[e+10]]+_g[t[e+11]]+_g[t[e+12]]+_g[t[e+13]]+_g[t[e+14]]+_g[t[e+15]]).toLowerCase()}var _g,dsr=v(()=>{_g=[];for(let t=0;t<256;++t)_g.push((t+256).toString(16).slice(1))});function PYe(){if(!EYe){if(typeof crypto>"u"||!crypto.getRandomValues)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");EYe=crypto.getRandomValues.bind(crypto)}return EYe(SYn)}var EYe,SYn,fsr=v(()=>{SYn=new Uint8Array(16)});var CYn,MYe,psr=v(()=>{CYn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),MYe={randomUUID:CYn}});function xYn(t,e,r){if(MYe.randomUUID&&!e&&!t)return MYe.randomUUID();t=t||{};let n=t.random??t.rng?.()??PYe();if(n.length<16)throw new Error("Random bytes length must be >= 16");if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){if(r=r||0,r<0||r+16>e.length)throw new RangeError(`UUID byte range ${r}:${r+15} is out of buffer bounds`);for(let o=0;o<16;++o)e[r+o]=n[o];return e}return csr(n)}var $0e,msr=v(()=>{psr();fsr();dsr();$0e=xYn});var hsr=v(()=>{msr()});function OYn(t){let e=t._getType();return ud.isInstance(t)?t.role:e==="tool"?e:t.name??e}function TYn(t){switch(t){case"supervisor":case"ai":case"model":return"model";case"system":return"system";case"human":return"user";case"tool":case"function":return"function";default:throw new Error(`Unknown / unsupported author: ${t}`)}}function EYn(t){if("mimeType"in t&&"data"in t)return{inlineData:{mimeType:t.mimeType,data:t.data}};if("mimeType"in t&&"fileUri"in t)return{fileData:{mimeType:t.mimeType,fileUri:t.fileUri}};throw new Error("Invalid media content")}function PYn(t,e){return e.map(r=>qs(r)?r.tool_calls??[]:[]).flat().find(r=>r.id===t.tool_call_id)?.name}function MYn(t){return{providerName:"Google Gemini",fromStandardTextBlock(r){return{text:r.text}},fromStandardImageBlock(r){if(!t)throw new Error("This model does not support images");if(r.source_type==="url"){let n=Wg({dataUrl:r.url});return n?{inlineData:{mimeType:n.mime_type,data:n.data}}:{fileData:{mimeType:r.mime_type??"",fileUri:r.url}}}if(r.source_type==="base64")return{inlineData:{mimeType:r.mime_type??"",data:r.data}};throw new Error(`Unsupported source type: ${r.source_type}`)},fromStandardAudioBlock(r){if(!t)throw new Error("This model does not support audio");if(r.source_type==="url"){let n=Wg({dataUrl:r.url});return n?{inlineData:{mimeType:n.mime_type,data:n.data}}:{fileData:{mimeType:r.mime_type??"",fileUri:r.url}}}if(r.source_type==="base64")return{inlineData:{mimeType:r.mime_type??"",data:r.data}};throw new Error(`Unsupported source type: ${r.source_type}`)},fromStandardFileBlock(r){if(!t)throw new Error("This model does not support files");if(r.source_type==="text")return{text:r.text};if(r.source_type==="url"){let n=Wg({dataUrl:r.url});return n?{inlineData:{mimeType:n.mime_type,data:n.data}}:{fileData:{mimeType:r.mime_type??"",fileUri:r.url}}}if(r.source_type==="base64")return{inlineData:{mimeType:r.mime_type??"",data:r.data}};throw new Error(`Unsupported source type: ${r.source_type}`)}}}function gsr(t,e){if(Qm(t))return oO(t,MYn(e));if(t.type==="text")return{text:t.text};if(t.type==="executableCode")return{executableCode:t.executableCode};if(t.type==="codeExecutionResult")return{codeExecutionResult:t.codeExecutionResult};if(t.type==="image_url"){if(!e)throw new Error("This model does not support images");let r;if(typeof t.image_url=="string")r=t.image_url;else if(typeof t.image_url=="object"&&"url"in t.image_url)r=t.image_url.url;else throw new Error("Please provide image as base64 encoded data URL");let[n,o]=r.split(",");if(!n.startsWith("data:"))throw new Error("Please provide image as base64 encoded data URL");let[i,a]=n.replace(/^data:/,"").split(";");if(a!=="base64")throw new Error("Please provide image as base64 encoded data URL");return{inlineData:{data:o,mimeType:i}}}else{if(t.type==="media")return EYn(t);if(t.type==="tool_use")return{functionCall:{name:t.name,args:t.input}};if(t.type?.includes("/")&&t.type.split("/").length===2&&"data"in t&&typeof t.data=="string")return{inlineData:{mimeType:t.type,data:t.data}};if("functionCall"in t)return;throw"type"in t?new Error(`Unknown content type ${t.type}`):new Error(`Unknown content ${JSON.stringify(t)}`)}}function RYn(t,e,r){if(yY(t)){let i=t.name??PYn(t,r);if(i===void 0)throw new Error(`Google requires a tool name for each tool call response, and we could not infer a called tool name for ToolMessage "${t.id}" from your passed messages. Please populate a "name" field on that ToolMessage explicitly.`);let a=Array.isArray(t.content)?t.content.map(s=>gsr(s,e)).filter(s=>s!==void 0):t.content;return t.status==="error"?[{functionResponse:{name:i,response:{error:{details:a}}}}]:[{functionResponse:{name:i,response:{result:a}}}]}let n=[],o=[];return typeof t.content=="string"&&t.content&&o.push({text:t.content}),Array.isArray(t.content)&&o.push(...t.content.map(i=>gsr(i,e)).filter(i=>i!==void 0)),qs(t)&&t.tool_calls?.length&&(n=t.tool_calls.map(i=>({functionCall:{name:i.name,args:i.args}}))),[...o,...n]}function RYe(t,e,r=!1){return t.reduce((n,o,i)=>{if(!eh(o))throw new Error("Unsupported message input");let a=OYn(o);if(a==="system"&&i!==0)throw new Error("System message should be the first one");let s=TYn(a),u=n.content[n.content.length];if(!n.mergeWithPreviousContent&&u&&u.role===s)throw new Error("Google Generative AI requires alternate messages between authors");let l=RYn(o,e,t.slice(0,i));if(n.mergeWithPreviousContent){let f=n.content[n.content.length-1];if(!f)throw new Error("There was a problem parsing your system message. Please try a prompt without one.");return f.parts.push(...l),{mergeWithPreviousContent:!1,content:n.content}}let c=s;(c==="function"||c==="system"&&!r)&&(c="user");let d={role:c,parts:l};return{mergeWithPreviousContent:a==="system"&&!r,content:[...n.content,d]}},{content:[],mergeWithPreviousContent:!1}).content}function ysr(t,e){if(!t.candidates||t.candidates.length===0||!t.candidates[0])return{generations:[],llmOutput:{filters:t.promptFeedback}};let r=t.functionCalls(),[n]=t.candidates,{content:o,...i}=n,a;Array.isArray(o?.parts)&&o.parts.length===1&&o.parts[0].text?a=o.parts[0].text:Array.isArray(o?.parts)&&o.parts.length>0?a=o.parts.map(l=>"text"in l?{type:"text",text:l.text}:"inlineData"in l?{type:"inlineData",inlineData:l.inlineData}:"functionCall"in l?{type:"functionCall",functionCall:l.functionCall}:"functionResponse"in l?{type:"functionResponse",functionResponse:l.functionResponse}:"fileData"in l?{type:"fileData",fileData:l.fileData}:"executableCode"in l?{type:"executableCode",executableCode:l.executableCode}:"codeExecutionResult"in l?{type:"codeExecutionResult",codeExecutionResult:l.codeExecutionResult}:l):a=[];let s="";return typeof a=="string"?s=a:Array.isArray(a)&&a.length>0&&(s=a.find(c=>"text"in c)?.text??s),{generations:[{text:s,message:new li({content:a??"",tool_calls:r?.map(l=>({...l,type:"tool_call",id:"id"in l&&typeof l.id=="string"?l.id:$0e()})),additional_kwargs:{...i},usage_metadata:e?.usageMetadata}),generationInfo:i}],llmOutput:{tokenUsage:{promptTokens:e?.usageMetadata?.input_tokens,completionTokens:e?.usageMetadata?.output_tokens,totalTokens:e?.usageMetadata?.total_tokens}}}}function bsr(t,e){if(!t.candidates||t.candidates.length===0)return null;let r=t.functionCalls(),[n]=t.candidates,{content:o,...i}=n,a;Array.isArray(o?.parts)&&o.parts.every(l=>"text"in l)?a=o.parts.map(l=>l.text).join(""):Array.isArray(o?.parts)?a=o.parts.map(l=>"text"in l?{type:"text",text:l.text}:"inlineData"in l?{type:"inlineData",inlineData:l.inlineData}:"functionCall"in l?{type:"functionCall",functionCall:l.functionCall}:"functionResponse"in l?{type:"functionResponse",functionResponse:l.functionResponse}:"fileData"in l?{type:"fileData",fileData:l.fileData}:"executableCode"in l?{type:"executableCode",executableCode:l.executableCode}:"codeExecutionResult"in l?{type:"codeExecutionResult",codeExecutionResult:l.codeExecutionResult}:l):a=[];let s="";a&&typeof a=="string"?s=a:Array.isArray(a)&&(s=a.find(c=>"text"in c)?.text??"");let u=[];return r&&u.push(...r.map(l=>({...l,args:JSON.stringify(l.args),index:e.index,type:"tool_call_chunk",id:"id"in l&&typeof l.id=="string"?l.id:$0e()}))),new Oi({text:s,message:new Nr({content:a||"",name:o?o.role:void 0,tool_call_chunks:u,additional_kwargs:{},response_metadata:{model_provider:"google-genai"},usage_metadata:e.usageMetadata}),generationInfo:i})}function _sr(t){return t.every(e=>"functionDeclarations"in e&&Array.isArray(e.functionDeclarations))?t:[{functionDeclarations:t.map(e=>{if(yg(e)){let r=foe(e.schema);return r.type==="object"&&"properties"in r&&Object.keys(r.properties).length===0?{name:e.name,description:e.description}:{name:e.name,description:e.description,parameters:r}}return Wv(e)?{name:e.function.name,description:e.function.description??"A function available to call.",parameters:lsr(e.function.parameters)}:e})}]}var AYe=v(()=>{D0e();js();gm();R1();Gv();hsr()});var IYe,vsr=v(()=>{Zv();_O();IYe=class extends Mz{constructor(e){super(e);M(this,"lc_namespace",["langchain","google_genai","output_parsers"]);M(this,"returnId",!1);M(this,"keyName");M(this,"returnSingle",!1);M(this,"zodSchema");this.keyName=e.keyName,this.returnSingle=e.returnSingle??this.returnSingle,this.zodSchema=e.zodSchema}static lc_name(){return"GoogleGenerativeAIToolsOutputParser"}async _validateResult(e){if(this.zodSchema===void 0)return e;let r=await eL(this.zodSchema,e);if(r.success)return r.data;throw new nh(`Failed to parse. Text: "${JSON.stringify(e,null,2)}". Error: ${JSON.stringify(r.error.issues)}`,JSON.stringify(e,null,2))}async parseResult(e){let r=e.flatMap(i=>{let{message:a}=i;return!("tool_calls"in a)||!Array.isArray(a.tool_calls)?[]:a.tool_calls});if(r[0]===void 0)throw new Error("No parseable tool calls provided to GoogleGenerativeAIToolsOutputParser.");let[n]=r;return await this._validateResult(n.args)}}});function DYn(t){let e=[];return t?.apiClient&&e.push(t.apiClient),e.push(`${jYn}/${NYn}`),e.join(" ")}async function $Yn(t){var e;let r=new Headers;r.append("Content-Type","application/json"),r.append("x-goog-api-client",DYn(t.requestOptions)),r.append("x-goog-api-key",t.apiKey);let n=(e=t.requestOptions)===null||e===void 0?void 0:e.customHeaders;if(n){if(!(n instanceof Headers))try{n=new Headers(n)}catch(o){throw new aA(`unable to convert customHeaders value ${JSON.stringify(n)} to Headers: ${o.message}`)}for(let[o,i]of n.entries()){if(o==="x-goog-api-key")throw new aA(`Cannot set reserved header name ${o}`);if(o==="x-goog-api-client")throw new aA(`Header name ${o} can only be set using the apiClient field`);r.append(o,i)}}return r}async function LYn(t,e,r,n,o,i){let a=new NYe(t,e,r,n,i);return{url:a.toString(),fetchOptions:Object.assign(Object.assign({},BYn(i)),{method:"POST",headers:await $Yn(a),body:o})}}async function goe(t,e,r,n,o,i={},a=fetch){let{url:s,fetchOptions:u}=await LYn(t,e,r,n,o,i);return FYn(s,u,a)}async function FYn(t,e,r=fetch){let n;try{n=await r(t,e)}catch(o){kYn(o,t)}return n.ok||await qYn(n,t),n}function kYn(t,e){let r=t;throw r.name==="AbortError"?(r=new k0e(`Request aborted when fetching ${e.toString()}: ${t.message}`),r.stack=t.stack):t instanceof F0e||t instanceof aA||(r=new _h(`Error fetching from ${e.toString()}: ${t.message}`),r.stack=t.stack),r}async function qYn(t,e){let r="",n;try{let o=await t.json();r=o.error.message,o.error.details&&(r+=` ${JSON.stringify(o.error.details)}`,n=o.error.details)}catch{}throw new F0e(`Error fetching from ${e.toString()}: [${t.status} ${t.statusText}] ${r}`,t.status,t.statusText,n)}function BYn(t){let e={};if(t?.signal!==void 0||t?.timeout>=0){let r=new AbortController;t?.timeout>=0&&setTimeout(()=>r.abort(),t.timeout),t?.signal&&t.signal.addEventListener("abort",()=>{r.abort()}),e.signal=r.signal}return e}function DYe(t){return t.text=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning text from the first candidate only. Access response.candidates directly to use the other candidates.`),L0e(t.candidates[0]))throw new QF(`${ek(t)}`,t);return UYn(t)}else if(t.promptFeedback)throw new QF(`Text not available. ${ek(t)}`,t);return""},t.functionCall=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),L0e(t.candidates[0]))throw new QF(`${ek(t)}`,t);return console.warn("response.functionCall() is deprecated. Use response.functionCalls() instead."),Asr(t)[0]}else if(t.promptFeedback)throw new QF(`Function call not available. ${ek(t)}`,t)},t.functionCalls=()=>{if(t.candidates&&t.candidates.length>0){if(t.candidates.length>1&&console.warn(`This response had ${t.candidates.length} candidates. Returning function calls from the first candidate only. Access response.candidates directly to use the other candidates.`),L0e(t.candidates[0]))throw new QF(`${ek(t)}`,t);return Asr(t)}else if(t.promptFeedback)throw new QF(`Function call not available. ${ek(t)}`,t)},t}function UYn(t){var e,r,n,o;let i=[];if(!((r=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||r===void 0)&&r.parts)for(let a of(o=(n=t.candidates)===null||n===void 0?void 0:n[0].content)===null||o===void 0?void 0:o.parts)a.text&&i.push(a.text),a.executableCode&&i.push("\n```"+a.executableCode.language+` +`+a.executableCode.code+"\n```\n"),a.codeExecutionResult&&i.push("\n```\n"+a.codeExecutionResult.output+"\n```\n");return i.length>0?i.join(""):""}function Asr(t){var e,r,n,o;let i=[];if(!((r=(e=t.candidates)===null||e===void 0?void 0:e[0].content)===null||r===void 0)&&r.parts)for(let a of(o=(n=t.candidates)===null||n===void 0?void 0:n[0].content)===null||o===void 0?void 0:o.parts)a.functionCall&&i.push(a.functionCall);if(i.length>0)return i}function L0e(t){return!!t.finishReason&&zYn.includes(t.finishReason)}function ek(t){var e,r,n;let o="";if((!t.candidates||t.candidates.length===0)&&t.promptFeedback)o+="Response was blocked",!((e=t.promptFeedback)===null||e===void 0)&&e.blockReason&&(o+=` due to ${t.promptFeedback.blockReason}`),!((r=t.promptFeedback)===null||r===void 0)&&r.blockReasonMessage&&(o+=`: ${t.promptFeedback.blockReasonMessage}`);else if(!((n=t.candidates)===null||n===void 0)&&n[0]){let i=t.candidates[0];L0e(i)&&(o+=`Candidate was blocked due to ${i.finishReason}`,i.finishMessage&&(o+=`: ${i.finishMessage}`))}return o}function moe(t){return this instanceof moe?(this.v=t,this):new moe(t)}function HYn(t,e,r){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n=r.apply(t,e||[]),o,i=[];return o={},a("next"),a("throw"),a("return"),o[Symbol.asyncIterator]=function(){return this},o;function a(f){n[f]&&(o[f]=function(p){return new Promise(function(m,h){i.push([f,p,m,h])>1||s(f,p)})})}function s(f,p){try{u(n[f](p))}catch(m){d(i[0][3],m)}}function u(f){f.value instanceof moe?Promise.resolve(f.value.v).then(l,c):d(i[0][2],f)}function l(f){s("next",f)}function c(f){s("throw",f)}function d(f,p){f(p),i.shift(),i.length&&s(i[0][0],i[0][1])}}function VYn(t){let e=t.body.pipeThrough(new TextDecoderStream("utf8",{fatal:!0})),r=WYn(e),[n,o]=r.tee();return{stream:KYn(n),response:JYn(o)}}async function JYn(t){let e=[],r=t.getReader();for(;;){let{done:n,value:o}=await r.read();if(n)return DYe(GYn(e));e.push(o)}}function KYn(t){return HYn(this,arguments,function*(){let r=t.getReader();for(;;){let{value:n,done:o}=yield moe(r.read());if(o)break;yield yield moe(DYe(n))}})}function WYn(t){let e=t.getReader();return new ReadableStream({start(n){let o="";return i();function i(){return e.read().then(({value:a,done:s})=>{if(s){if(o.trim()){n.error(new _h("Failed to parse stream"));return}n.close();return}o+=a;let u=o.match(Isr),l;for(;u;){try{l=JSON.parse(u[1])}catch{n.error(new _h(`Error parsing JSON response: "${u[1]}"`));return}n.enqueue(l),o=o.substring(u[0].length),u=o.match(Isr)}return i()}).catch(a=>{let s=a;throw s.stack=a.stack,s.name==="AbortError"?s=new k0e("Request aborted when reading from the stream"):s=new _h("Error reading from the stream"),s})}}})}function GYn(t){let e=t[t.length-1],r={promptFeedback:e?.promptFeedback};for(let n of t){if(n.candidates){let o=0;for(let i of n.candidates)if(r.candidates||(r.candidates=[]),r.candidates[o]||(r.candidates[o]={index:o}),r.candidates[o].citationMetadata=i.citationMetadata,r.candidates[o].groundingMetadata=i.groundingMetadata,r.candidates[o].finishReason=i.finishReason,r.candidates[o].finishMessage=i.finishMessage,r.candidates[o].safetyRatings=i.safetyRatings,i.content&&i.content.parts){r.candidates[o].content||(r.candidates[o].content={role:i.content.role||"user",parts:[]});let a={};for(let s of i.content.parts)s.text&&(a.text=s.text),s.functionCall&&(a.functionCall=s.functionCall),s.executableCode&&(a.executableCode=s.executableCode),s.codeExecutionResult&&(a.codeExecutionResult=s.codeExecutionResult),Object.keys(a).length===0&&(a.text=""),r.candidates[o].content.parts.push(a)}o++}n.usageMetadata&&(r.usageMetadata=n.usageMetadata)}return r}async function Lsr(t,e,r,n){let o=await goe(e,N2.STREAM_GENERATE_CONTENT,t,!0,JSON.stringify(r),n);return VYn(o)}async function Fsr(t,e,r,n){let i=await(await goe(e,N2.GENERATE_CONTENT,t,!1,JSON.stringify(r),n)).json();return{response:DYe(i)}}function ksr(t){if(t!=null){if(typeof t=="string")return{role:"system",parts:[{text:t}]};if(t.text)return{role:"system",parts:[t]};if(t.parts)return t.role?t:{role:"system",parts:t.parts}}}function hoe(t){let e=[];if(typeof t=="string")e=[{text:t}];else for(let r of t)typeof r=="string"?e.push({text:r}):e.push(r);return ZYn(e)}function ZYn(t){let e={role:"user",parts:[]},r={role:"function",parts:[]},n=!1,o=!1;for(let i of t)"functionResponse"in i?(r.parts.push(i),o=!0):(e.parts.push(i),n=!0);if(n&&o)throw new _h("Within a single message, FunctionResponse cannot be mixed with other type of part in the request for sending chat message.");if(!n&&!o)throw new _h("No content is provided for sending chat message.");return n?e:r}function XYn(t,e){var r;let n={model:e?.model,generationConfig:e?.generationConfig,safetySettings:e?.safetySettings,tools:e?.tools,toolConfig:e?.toolConfig,systemInstruction:e?.systemInstruction,cachedContent:(r=e?.cachedContent)===null||r===void 0?void 0:r.name,contents:[]},o=t.generateContentRequest!=null;if(t.contents){if(o)throw new aA("CountTokensRequest must have one of contents or generateContentRequest, not both.");n.contents=t.contents}else if(o)n=Object.assign(Object.assign({},n),t.generateContentRequest);else{let i=hoe(t);n.contents=[i]}return{generateContentRequest:n}}function Nsr(t){let e;return t.contents?e=t:e={contents:[hoe(t)]},t.systemInstruction&&(e.systemInstruction=ksr(t.systemInstruction)),e}function YYn(t){return typeof t=="string"||Array.isArray(t)?{content:hoe(t)}:t}function eQn(t){let e=!1;for(let r of t){let{role:n,parts:o}=r;if(!e&&n!=="user")throw new _h(`First content should be with role 'user', got ${n}`);if(!xsr.includes(n))throw new _h(`Each item should include role field. Got ${n} but valid roles are: ${JSON.stringify(xsr)}`);if(!Array.isArray(o))throw new _h("Content should have 'parts' property with an array of Parts");if(o.length===0)throw new _h("Each Content should have at least one part");let i={text:0,inlineData:0,functionCall:0,functionResponse:0,fileData:0,executableCode:0,codeExecutionResult:0};for(let s of o)for(let u of jsr)u in s&&(i[u]+=1);let a=QYn[n];for(let s of jsr)if(!a.includes(s)&&i[s]>0)throw new _h(`Content with role '${n}' can't contain '${s}' part`);e=!0}}function Dsr(t){var e;if(t.candidates===void 0||t.candidates.length===0)return!1;let r=(e=t.candidates[0])===null||e===void 0?void 0:e.content;if(r===void 0||r.parts===void 0||r.parts.length===0)return!1;for(let n of r.parts)if(n===void 0||Object.keys(n).length===0||n.text!==void 0&&n.text==="")return!1;return!0}async function tQn(t,e,r,n){return(await goe(e,N2.COUNT_TOKENS,t,!1,JSON.stringify(r),n)).json()}async function rQn(t,e,r,n){return(await goe(e,N2.EMBED_CONTENT,t,!1,JSON.stringify(r),n)).json()}async function nQn(t,e,r,n){let o=r.requests.map(a=>Object.assign(Object.assign({},a),{model:e}));return(await goe(e,N2.BATCH_EMBED_CONTENTS,t,!1,JSON.stringify({requests:o}),n)).json()}var wsr,Ssr,Csr,xsr,Osr,Tsr,Esr,Psr,poe,Msr,I2,Rsr,_h,QF,F0e,aA,k0e,AYn,IYn,NYn,jYn,N2,NYe,zYn,Isr,jsr,QYn,$sr,jYe,q0e,j2,B0e=v(()=>{(function(t){t.STRING="string",t.NUMBER="number",t.INTEGER="integer",t.BOOLEAN="boolean",t.ARRAY="array",t.OBJECT="object"})(wsr||(wsr={}));(function(t){t.LANGUAGE_UNSPECIFIED="language_unspecified",t.PYTHON="python"})(Ssr||(Ssr={}));(function(t){t.OUTCOME_UNSPECIFIED="outcome_unspecified",t.OUTCOME_OK="outcome_ok",t.OUTCOME_FAILED="outcome_failed",t.OUTCOME_DEADLINE_EXCEEDED="outcome_deadline_exceeded"})(Csr||(Csr={}));xsr=["user","model","function","system"];(function(t){t.HARM_CATEGORY_UNSPECIFIED="HARM_CATEGORY_UNSPECIFIED",t.HARM_CATEGORY_HATE_SPEECH="HARM_CATEGORY_HATE_SPEECH",t.HARM_CATEGORY_SEXUALLY_EXPLICIT="HARM_CATEGORY_SEXUALLY_EXPLICIT",t.HARM_CATEGORY_HARASSMENT="HARM_CATEGORY_HARASSMENT",t.HARM_CATEGORY_DANGEROUS_CONTENT="HARM_CATEGORY_DANGEROUS_CONTENT",t.HARM_CATEGORY_CIVIC_INTEGRITY="HARM_CATEGORY_CIVIC_INTEGRITY"})(Osr||(Osr={}));(function(t){t.HARM_BLOCK_THRESHOLD_UNSPECIFIED="HARM_BLOCK_THRESHOLD_UNSPECIFIED",t.BLOCK_LOW_AND_ABOVE="BLOCK_LOW_AND_ABOVE",t.BLOCK_MEDIUM_AND_ABOVE="BLOCK_MEDIUM_AND_ABOVE",t.BLOCK_ONLY_HIGH="BLOCK_ONLY_HIGH",t.BLOCK_NONE="BLOCK_NONE"})(Tsr||(Tsr={}));(function(t){t.HARM_PROBABILITY_UNSPECIFIED="HARM_PROBABILITY_UNSPECIFIED",t.NEGLIGIBLE="NEGLIGIBLE",t.LOW="LOW",t.MEDIUM="MEDIUM",t.HIGH="HIGH"})(Esr||(Esr={}));(function(t){t.BLOCKED_REASON_UNSPECIFIED="BLOCKED_REASON_UNSPECIFIED",t.SAFETY="SAFETY",t.OTHER="OTHER"})(Psr||(Psr={}));(function(t){t.FINISH_REASON_UNSPECIFIED="FINISH_REASON_UNSPECIFIED",t.STOP="STOP",t.MAX_TOKENS="MAX_TOKENS",t.SAFETY="SAFETY",t.RECITATION="RECITATION",t.LANGUAGE="LANGUAGE",t.BLOCKLIST="BLOCKLIST",t.PROHIBITED_CONTENT="PROHIBITED_CONTENT",t.SPII="SPII",t.MALFORMED_FUNCTION_CALL="MALFORMED_FUNCTION_CALL",t.OTHER="OTHER"})(poe||(poe={}));(function(t){t.TASK_TYPE_UNSPECIFIED="TASK_TYPE_UNSPECIFIED",t.RETRIEVAL_QUERY="RETRIEVAL_QUERY",t.RETRIEVAL_DOCUMENT="RETRIEVAL_DOCUMENT",t.SEMANTIC_SIMILARITY="SEMANTIC_SIMILARITY",t.CLASSIFICATION="CLASSIFICATION",t.CLUSTERING="CLUSTERING"})(Msr||(Msr={}));(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.AUTO="AUTO",t.ANY="ANY",t.NONE="NONE"})(I2||(I2={}));(function(t){t.MODE_UNSPECIFIED="MODE_UNSPECIFIED",t.MODE_DYNAMIC="MODE_DYNAMIC"})(Rsr||(Rsr={}));_h=class extends Error{constructor(e){super(`[GoogleGenerativeAI Error]: ${e}`)}},QF=class extends _h{constructor(e,r){super(e),this.response=r}},F0e=class extends _h{constructor(e,r,n,o){super(e),this.status=r,this.statusText=n,this.errorDetails=o}},aA=class extends _h{},k0e=class extends _h{};AYn="https://generativelanguage.googleapis.com",IYn="v1beta",NYn="0.24.1",jYn="genai-js";(function(t){t.GENERATE_CONTENT="generateContent",t.STREAM_GENERATE_CONTENT="streamGenerateContent",t.COUNT_TOKENS="countTokens",t.EMBED_CONTENT="embedContent",t.BATCH_EMBED_CONTENTS="batchEmbedContents"})(N2||(N2={}));NYe=class{constructor(e,r,n,o,i){this.model=e,this.task=r,this.apiKey=n,this.stream=o,this.requestOptions=i}toString(){var e,r;let n=((e=this.requestOptions)===null||e===void 0?void 0:e.apiVersion)||IYn,i=`${((r=this.requestOptions)===null||r===void 0?void 0:r.baseUrl)||AYn}/${n}/${this.model}:${this.task}`;return this.stream&&(i+="?alt=sse"),i}};zYn=[poe.RECITATION,poe.SAFETY,poe.LANGUAGE];Isr=/^data\: (.*)(?:\n\n|\r\r|\r\n\r\n)/;jsr=["text","inlineData","functionCall","functionResponse","executableCode","codeExecutionResult"],QYn={user:["text","inlineData"],function:["functionResponse"],model:["text","functionCall","executableCode","codeExecutionResult"],system:["text"]};$sr="SILENT_ERROR",jYe=class{constructor(e,r,n,o={}){this.model=r,this.params=n,this._requestOptions=o,this._history=[],this._sendPromise=Promise.resolve(),this._apiKey=e,n?.history&&(eQn(n.history),this._history=n.history)}async getHistory(){return await this._sendPromise,this._history}async sendMessage(e,r={}){var n,o,i,a,s,u;await this._sendPromise;let l=hoe(e),c={safetySettings:(n=this.params)===null||n===void 0?void 0:n.safetySettings,generationConfig:(o=this.params)===null||o===void 0?void 0:o.generationConfig,tools:(i=this.params)===null||i===void 0?void 0:i.tools,toolConfig:(a=this.params)===null||a===void 0?void 0:a.toolConfig,systemInstruction:(s=this.params)===null||s===void 0?void 0:s.systemInstruction,cachedContent:(u=this.params)===null||u===void 0?void 0:u.cachedContent,contents:[...this._history,l]},d=Object.assign(Object.assign({},this._requestOptions),r),f;return this._sendPromise=this._sendPromise.then(()=>Fsr(this._apiKey,this.model,c,d)).then(p=>{var m;if(Dsr(p.response)){this._history.push(l);let h=Object.assign({parts:[],role:"model"},(m=p.response.candidates)===null||m===void 0?void 0:m[0].content);this._history.push(h)}else{let h=ek(p.response);h&&console.warn(`sendMessage() was unsuccessful. ${h}. Inspect response object for details.`)}f=p}).catch(p=>{throw this._sendPromise=Promise.resolve(),p}),await this._sendPromise,f}async sendMessageStream(e,r={}){var n,o,i,a,s,u;await this._sendPromise;let l=hoe(e),c={safetySettings:(n=this.params)===null||n===void 0?void 0:n.safetySettings,generationConfig:(o=this.params)===null||o===void 0?void 0:o.generationConfig,tools:(i=this.params)===null||i===void 0?void 0:i.tools,toolConfig:(a=this.params)===null||a===void 0?void 0:a.toolConfig,systemInstruction:(s=this.params)===null||s===void 0?void 0:s.systemInstruction,cachedContent:(u=this.params)===null||u===void 0?void 0:u.cachedContent,contents:[...this._history,l]},d=Object.assign(Object.assign({},this._requestOptions),r),f=Lsr(this._apiKey,this.model,c,d);return this._sendPromise=this._sendPromise.then(()=>f).catch(p=>{throw new Error($sr)}).then(p=>p.response).then(p=>{if(Dsr(p)){this._history.push(l);let m=Object.assign({},p.candidates[0].content);m.role||(m.role="model"),this._history.push(m)}else{let m=ek(p);m&&console.warn(`sendMessageStream() was unsuccessful. ${m}. Inspect response object for details.`)}}).catch(p=>{p.message!==$sr&&console.error(p)}),f}};q0e=class{constructor(e,r,n={}){this.apiKey=e,this._requestOptions=n,r.model.includes("/")?this.model=r.model:this.model=`models/${r.model}`,this.generationConfig=r.generationConfig||{},this.safetySettings=r.safetySettings||[],this.tools=r.tools,this.toolConfig=r.toolConfig,this.systemInstruction=ksr(r.systemInstruction),this.cachedContent=r.cachedContent}async generateContent(e,r={}){var n;let o=Nsr(e),i=Object.assign(Object.assign({},this._requestOptions),r);return Fsr(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(n=this.cachedContent)===null||n===void 0?void 0:n.name},o),i)}async generateContentStream(e,r={}){var n;let o=Nsr(e),i=Object.assign(Object.assign({},this._requestOptions),r);return Lsr(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(n=this.cachedContent)===null||n===void 0?void 0:n.name},o),i)}startChat(e){var r;return new jYe(this.apiKey,this.model,Object.assign({generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:(r=this.cachedContent)===null||r===void 0?void 0:r.name},e),this._requestOptions)}async countTokens(e,r={}){let n=XYn(e,{model:this.model,generationConfig:this.generationConfig,safetySettings:this.safetySettings,tools:this.tools,toolConfig:this.toolConfig,systemInstruction:this.systemInstruction,cachedContent:this.cachedContent}),o=Object.assign(Object.assign({},this._requestOptions),r);return tQn(this.apiKey,this.model,n,o)}async embedContent(e,r={}){let n=YYn(e),o=Object.assign(Object.assign({},this._requestOptions),r);return rQn(this.apiKey,this.model,n,o)}async batchEmbedContents(e,r={}){let n=Object.assign(Object.assign({},this._requestOptions),r);return nQn(this.apiKey,this.model,e,n)}};j2=class{constructor(e){this.apiKey=e}getGenerativeModel(e,r){if(!e.model)throw new _h("Must provide a model name. Example: genai.getGenerativeModel({ model: 'my-model-name' })");return new q0e(this.apiKey,e,r)}getGenerativeModelFromCachedContent(e,r,n){if(!e.name)throw new aA("Cached content must contain a `name` field.");if(!e.model)throw new aA("Cached content must contain a `model` field.");let o=["model","systemInstruction"];for(let a of o)if(r?.[a]&&e[a]&&r?.[a]!==e[a]){if(a==="model"){let s=r.model.startsWith("models/")?r.model.replace("models/",""):r.model,u=e.model.startsWith("models/")?e.model.replace("models/",""):e.model;if(s===u)continue}throw new aA(`Different value for "${a}" specified in modelParams (${r[a]}) and cachedContent (${e[a]})`)}let i=Object.assign(Object.assign({},r),{model:e.model,tools:e.tools,toolConfig:e.toolConfig,systemInstruction:e.systemInstruction,cachedContent:e});return new q0e(this.apiKey,i,n)}}});function $Ye(t,e){let r=oQn(t),n=aQn(r,e);return{tools:r,toolConfig:n}}function oQn(t){let e=[],r=[];return t.forEach(o=>{if(yg(o)){let[i]=_sr([o]);i.functionDeclarations&&e.push(...i.functionDeclarations)}else if(Wv(o)){let{functionDeclarations:i}=iQn(o);if(i)e.push(...i);else throw new Error("Failed to convert OpenAI structured tool to GenerativeAI tool")}else r.push(o)}),r.find(o=>"functionDeclarations"in o)?r.map(o=>{if(e?.length>0&&"functionDeclarations"in o){let i={functionDeclarations:[...o.functionDeclarations||[],...e]};return e=[],i}return o}):[...r,...e.length>0?[{functionDeclarations:e}]:[]]}function iQn(t){return{functionDeclarations:[{name:t.function.name,description:t.function.description,parameters:I1(t.function.parameters)}]}}function aQn(t,e){if(!t.length||!e)return;let{toolChoice:r,allowedFunctionNames:n}=e,o={any:I2.ANY,auto:I2.AUTO,none:I2.NONE};if(r&&["any","auto","none"].includes(r))return{functionCallingConfig:{mode:o[r]??"MODE_UNSPECIFIED",allowedFunctionNames:n}};if(typeof r=="string"||n)return{functionCallingConfig:{mode:I2.ANY,allowedFunctionNames:[...n??[],...r&&typeof r=="string"?[r]:[]]}}}var qsr=v(()=>{D0e();AYe();B0e();R1();Gv()});var LYe,Bsr=v(()=>{D0e();AYe();vsr();qsr();B0e();Yu();A1();Ov();Zv();_O();LYe=class extends bh{constructor(e){super(e);M(this,"lc_serializable",!0);M(this,"lc_namespace",["langchain","chat_models","google_genai"]);M(this,"model");M(this,"temperature");M(this,"maxOutputTokens");M(this,"topP");M(this,"topK");M(this,"stopSequences",[]);M(this,"safetySettings");M(this,"apiKey");M(this,"streaming",!1);M(this,"json");M(this,"streamUsage",!0);M(this,"convertSystemMessageToHumanContent");M(this,"client");if(this.model=e.model.replace(/^models\//,""),this.maxOutputTokens=e.maxOutputTokens??this.maxOutputTokens,this.maxOutputTokens&&this.maxOutputTokens<0)throw new Error("`maxOutputTokens` must be a positive integer");if(this.temperature=e.temperature??this.temperature,this.temperature&&(this.temperature<0||this.temperature>2))throw new Error("`temperature` must be in the range of [0.0,2.0]");if(this.topP=e.topP??this.topP,this.topP&&this.topP<0)throw new Error("`topP` must be a positive integer");if(this.topP&&this.topP>1)throw new Error("`topP` must be below 1.");if(this.topK=e.topK??this.topK,this.topK&&this.topK<0)throw new Error("`topK` must be a positive integer");if(this.stopSequences=e.stopSequences??this.stopSequences,this.apiKey=e.apiKey??dn("GOOGLE_API_KEY"),!this.apiKey)throw new Error("Please set an API key for Google GenerativeAI in the environment variable GOOGLE_API_KEY or in the `apiKey` field of the ChatGoogleGenerativeAI constructor");if(this.safetySettings=e.safetySettings??this.safetySettings,this.safetySettings&&this.safetySettings.length>0&&new Set(this.safetySettings.map(n=>n.category)).size!==this.safetySettings.length)throw new Error("The categories in `safetySettings` array must be unique");this.streaming=e.streaming??this.streaming,this.json=e.json,this.client=new j2(this.apiKey).getGenerativeModel({model:this.model,safetySettings:this.safetySettings,generationConfig:{stopSequences:this.stopSequences,maxOutputTokens:this.maxOutputTokens,temperature:this.temperature,topP:this.topP,topK:this.topK,...this.json?{responseMimeType:"application/json"}:{}}},{apiVersion:e.apiVersion,baseUrl:e.baseUrl}),this.streamUsage=e.streamUsage??this.streamUsage}static lc_name(){return"ChatGoogleGenerativeAI"}get lc_secrets(){return{apiKey:"GOOGLE_API_KEY"}}get lc_aliases(){return{apiKey:"google_api_key"}}get _isMultimodalModel(){return this.model.includes("vision")||this.model.startsWith("gemini-1.5")||this.model.startsWith("gemini-2")||this.model.startsWith("gemma-3-")&&!this.model.startsWith("gemma-3-1b")}useCachedContent(e,r,n){this.apiKey&&(this.client=new j2(this.apiKey).getGenerativeModelFromCachedContent(e,r,n))}get useSystemInstruction(){return typeof this.convertSystemMessageToHumanContent=="boolean"?!this.convertSystemMessageToHumanContent:this.computeUseSystemInstruction}get computeUseSystemInstruction(){return this.model==="gemini-1.0-pro-001"||this.model.startsWith("gemini-pro-vision")||this.model.startsWith("gemini-1.0-pro-vision")?!1:this.model!=="gemini-pro"}getLsParams(e){return{ls_provider:"google_genai",ls_model_name:this.model,ls_model_type:"chat",ls_temperature:this.client.generationConfig.temperature,ls_max_tokens:this.client.generationConfig.maxOutputTokens,ls_stop:e.stop}}_combineLLMOutput(){return[]}_llmType(){return"googlegenerativeai"}bindTools(e,r){return this.withConfig({tools:$Ye(e)?.tools,...r})}invocationParams(e){let r=e?.tools?.length?$Ye(e.tools,{toolChoice:e.tool_choice,allowedFunctionNames:e.allowedFunctionNames}):void 0;return e?.responseSchema?(this.client.generationConfig.responseSchema=e.responseSchema,this.client.generationConfig.responseMimeType="application/json"):(this.client.generationConfig.responseSchema=void 0,this.client.generationConfig.responseMimeType=this.json?"application/json":void 0),{...r?.tools?{tools:r.tools}:{},...r?.toolConfig?{toolConfig:r.toolConfig}:{}}}async _generate(e,r,n){let o=RYe(e,this._isMultimodalModel,this.useSystemInstruction),i=o;if(o[0].role==="system"){let[c]=o;this.client.systemInstruction=c,i=o.slice(1)}let a=this.invocationParams(r);if(this.streaming){let c={},d=this._streamResponseChunks(e,r,n),f={};for await(let m of d){let h=m.generationInfo?.completion??0;f[h]===void 0?f[h]=m:f[h]=f[h].concat(m)}return{generations:Object.entries(f).sort(([m],[h])=>parseInt(m,10)-parseInt(h,10)).map(([m,h])=>h),llmOutput:{estimatedTokenUsage:c}}}let s=await this.completionWithRetry({...a,contents:i}),u;if("usageMetadata"in s.response){let c=s.response.usageMetadata;u={input_tokens:c.promptTokenCount??0,output_tokens:c.candidatesTokenCount??0,total_tokens:c.totalTokenCount??0}}let l=ysr(s.response,{usageMetadata:u});return l.generations?.length>0&&await n?.handleLLMNewToken(l.generations[0]?.text??""),l}async*_streamResponseChunks(e,r,n){let o=RYe(e,this._isMultimodalModel,this.useSystemInstruction),i=o;if(o[0].role==="system"){let[m]=o;this.client.systemInstruction=m,i=o.slice(1)}let s={...this.invocationParams(r),contents:i},u=await this.caller.callWithOptions({signal:r?.signal},async()=>{let{stream:m}=await this.client.generateContentStream(s);return m}),l,c=0,d=0,f=0,p=0;for await(let m of u){if("usageMetadata"in m&&m.usageMetadata!==void 0&&this.streamUsage!==!1&&r.streamUsage!==!1){l={input_tokens:m.usageMetadata.promptTokenCount??0,output_tokens:m.usageMetadata.candidatesTokenCount??0,total_tokens:m.usageMetadata.totalTokenCount??0};let g=m.usageMetadata.promptTokenCount??0;l.input_tokens=Math.max(0,g-c),c=g;let y=m.usageMetadata.candidatesTokenCount??0;l.output_tokens=Math.max(0,y-d),d=y;let b=m.usageMetadata.totalTokenCount??0;l.total_tokens=Math.max(0,b-f),f=b}let h=bsr(m,{usageMetadata:l,index:p});p+=1,h&&(yield h,await n?.handleLLMNewToken(h.text??""))}}async completionWithRetry(e,r){return this.caller.callWithOptions({signal:r?.signal},async()=>{try{return await this.client.generateContent(e)}catch(n){throw n.message?.includes("400 Bad Request")&&(n.status=400),n}})}withStructuredOutput(e,r){let n=e,o=r?.name,i=r?.method,a=r?.includeRaw;if(i==="jsonMode")throw new Error('ChatGoogleGenerativeAI only supports "jsonSchema" or "functionCalling" as a method.');let s,u;if(i==="functionCalling"){let f=o??"extract",p;if(Ga(n)){let m=foe(n);p=[{functionDeclarations:[{name:f,description:m.description??"A function available to call.",parameters:m}]}],u=new IYe({returnSingle:!0,keyName:f,zodSchema:n})}else{let m;typeof n.name=="string"&&typeof n.parameters=="object"&&n.parameters!=null?(m=n,m.parameters=I1(n.parameters),f=n.name):m={name:f,description:n.description??"",parameters:I1(n)},p=[{functionDeclarations:[m]}],u=new IYe({returnSingle:!0,keyName:f})}s=this.bindTools(p).withConfig({allowedFunctionNames:[f]})}else{let f=foe(n);s=this.withConfig({responseSchema:f}),u=new Tv}if(!a)return s.pipe(u).withConfig({runName:"ChatGoogleGenerativeAIStructuredOutput"});let l=wu.assign({parsed:(f,p)=>u.invoke(f.raw,p)}),c=wu.assign({parsed:()=>null}),d=l.withFallbacks({fallbacks:[c]});return Sl.from([{raw:s},d]).withConfig({runName:"StructuredOutputRunnable"})}}});var FYe,Usr=v(()=>{B0e();Yu();A2();YF();FYe=class extends MS{constructor(e){super(e??{});M(this,"apiKey");M(this,"modelName","embedding-001");M(this,"model","embedding-001");M(this,"taskType");M(this,"title");M(this,"stripNewLines",!0);M(this,"maxBatchSize",100);M(this,"client");if(this.modelName=e?.model?.replace(/^models\//,"")??e?.modelName?.replace(/^models\//,"")??this.modelName,this.model=this.modelName,this.taskType=e?.taskType??this.taskType,this.title=e?.title??this.title,this.title&&this.taskType!=="RETRIEVAL_DOCUMENT")throw new Error("title can only be sepcified with TaskType.RETRIEVAL_DOCUMENT");if(this.apiKey=e?.apiKey??dn("GOOGLE_API_KEY"),!this.apiKey)throw new Error("Please set an API key for Google GenerativeAI in the environmentb variable GOOGLE_API_KEY or in the `apiKey` field of the GoogleGenerativeAIEmbeddings constructor");this.client=new j2(this.apiKey).getGenerativeModel({model:this.model},{baseUrl:e?.baseUrl})}_convertToContent(e){return{content:{role:"user",parts:[{text:this.stripNewLines?e.replace(/\n/g," "):e}]},taskType:this.taskType,title:this.title}}async _embedQueryContent(e){let r=this._convertToContent(e);return(await this.client.embedContent(r)).embedding.values??[]}async _embedDocumentsContent(e){let r=RS(e,this.maxBatchSize),n=r.map(a=>({requests:a.map(s=>this._convertToContent(s))}));return(await Promise.allSettled(n.map(a=>this.client.batchEmbedContents(a)))).flatMap((a,s)=>a.status==="fulfilled"?a.value.embeddings.map(u=>u.values||[]):Array(r[s].length).fill([]))}embedQuery(e){return this.caller.call(this._embedQueryContent.bind(this),e)}embedDocuments(e){return this.caller.call(this._embedDocumentsContent.bind(this),e)}}});var kYe=v(()=>{Bsr();Usr()});function zsr(t,e=0){return(vg[t[e+0]]+vg[t[e+1]]+vg[t[e+2]]+vg[t[e+3]]+"-"+vg[t[e+4]]+vg[t[e+5]]+"-"+vg[t[e+6]]+vg[t[e+7]]+"-"+vg[t[e+8]]+vg[t[e+9]]+"-"+vg[t[e+10]]+vg[t[e+11]]+vg[t[e+12]]+vg[t[e+13]]+vg[t[e+14]]+vg[t[e+15]]).toLowerCase()}var vg,U0e,Hsr=v(()=>{vg=[];for(U0e=0;U0e<256;++U0e)vg.push((U0e+256).toString(16).slice(1))});function qYe(){if(!z0e&&(z0e=typeof crypto<"u"&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto),!z0e))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return z0e(sQn)}var z0e,sQn,Vsr=v(()=>{sQn=new Uint8Array(16)});var uQn,BYe,Jsr=v(()=>{uQn=typeof crypto<"u"&&crypto.randomUUID&&crypto.randomUUID.bind(crypto),BYe={randomUUID:uQn}});function lQn(t,e,r){if(BYe.randomUUID&&!e&&!t)return BYe.randomUUID();t=t||{};var n=t.random||(t.rng||qYe)();if(n[6]=n[6]&15|64,n[8]=n[8]&63|128,e){r=r||0;for(var o=0;o<16;++o)e[r+o]=n[o];return e}return zsr(n)}var UYe,Ksr=v(()=>{Jsr();Vsr();Hsr();UYe=lQn});var Wsr=v(()=>{Ksr()});function Zsr(t,e){return new Nr({content:t.thinking??t.content??"",tool_call_chunks:t.tool_calls?.map(r=>({name:r.function.name,args:JSON.stringify(r.function.arguments),type:"tool_call_chunk",index:0,id:UYe()})),response_metadata:e?.responseMetadata,usage_metadata:e?.usageMetadata})}function Gsr(t){let e=t.match(/^data:.*?;base64,(.*)$/);return e?e[1]:""}function cQn(t){if(typeof t.content=="string")return[{role:"assistant",content:t.content}];let r=t.content.filter(o=>o.type==="text"&&typeof o.text=="string").map(o=>({role:"assistant",content:o.text})),n;if(t.content.find(o=>o.type==="tool_use")&&t.tool_calls?.length){let o=t.tool_calls?.map(i=>({id:i.id,type:"function",function:{name:i.name,arguments:i.args}}));o&&(n={role:"assistant",tool_calls:o,content:""})}else if(t.content.find(o=>o.type==="tool_use")&&!t.tool_calls?.length)throw new Error("'tool_use' content type is not supported without tool calls.");return[...r,...n?[n]:[]]}function dQn(t){return typeof t.content=="string"?[{role:"user",content:t.content}]:t.content.map(e=>{if(e.type==="text")return{role:"user",content:e.text};if(e.type==="image_url"){if(typeof e.image_url=="string")return{role:"user",content:"",images:[Gsr(e.image_url)]};if(e.image_url.url&&typeof e.image_url.url=="string")return{role:"user",content:"",images:[Gsr(e.image_url.url)]}}throw new Error(`Unsupported content type: ${e.type}`)})}function fQn(t){if(typeof t.content=="string")return[{role:"system",content:t.content}];if(t.content.every(e=>e.type==="text"&&typeof e.text=="string"))return t.content.map(e=>({role:"system",content:e.text}));throw new Error(`Unsupported content type(s): ${t.content.map(e=>e.type).join(", ")}`)}function pQn(t){if(typeof t.content!="string")throw new Error("Non string tool message content is not supported");return[{role:"tool",content:t.content}]}function Xsr(t){return t.flatMap(e=>{if(["human","generic"].includes(e._getType()))return dQn(e);if(e._getType()==="ai")return cQn(e);if(e._getType()==="system")return fQn(e);if(e._getType()==="tool")return pQn(e);throw new Error(`Unsupported message type: ${e._getType()}`)})}var Ysr=v(()=>{js();Wsr()});function mQn(t){return t&&DataView.prototype.isPrototypeOf(t)}function NW(t){if(typeof t!="string"&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||t==="")throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function HYe(t){return typeof t!="string"&&(t=String(t)),t}function VYe(t){var e={next:function(){var r=t.shift();return{done:r===void 0,value:r}}};return bb.iterable&&(e[Symbol.iterator]=function(){return e}),e}function Rm(t){this.map={},t instanceof Rm?t.forEach(function(e,r){this.append(r,e)},this):Array.isArray(t)?t.forEach(function(e){if(e.length!=2)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+e.length);this.append(e[0],e[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function zYe(t){if(!t._noBody){if(t.bodyUsed)return Promise.reject(new TypeError("Already read"));t.bodyUsed=!0}}function rur(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function hQn(t){var e=new FileReader,r=rur(e);return e.readAsArrayBuffer(t),r}function gQn(t){var e=new FileReader,r=rur(e),n=/charset=([A-Za-z0-9_-]+)/.exec(t.type),o=n?n[1]:"utf-8";return e.readAsText(t,o),r}function yQn(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n-1?e:t}function $2(t,e){if(!(this instanceof $2))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');e=e||{};var r=e.body;if(t instanceof $2){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new Rm(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,!r&&t._bodyInit!=null&&(r=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",(e.headers||!this.headers)&&(this.headers=new Rm(e.headers)),this.method=_Qn(e.method||this.method||"GET"),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in wg){var i=new AbortController;return i.signal}}(),this.referrer=null,(this.method==="GET"||this.method==="HEAD")&&r)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(r),(this.method==="GET"||this.method==="HEAD")&&(e.cache==="no-store"||e.cache==="no-cache")){var n=/([?&])_=[^&]*/;if(n.test(this.url))this.url=this.url.replace(n,"$1_="+new Date().getTime());else{var o=/\?/;this.url+=(o.test(this.url)?"&":"?")+"_="+new Date().getTime()}}}function vQn(t){var e=new FormData;return t.trim().split("&").forEach(function(r){if(r){var n=r.split("="),o=n.shift().replace(/\+/g," "),i=n.join("=").replace(/\+/g," ");e.append(decodeURIComponent(o),decodeURIComponent(i))}}),e}function wQn(t){var e=new Rm,r=t.replace(/\r?\n[\t ]+/g," ");return r.split("\r").map(function(n){return n.indexOf(` +`)===0?n.substr(1,n.length):n}).forEach(function(n){var o=n.split(":"),i=o.shift().trim();if(i){var a=o.join(":").trim();try{e.append(i,a)}catch(s){console.warn("Response "+s.message)}}}),e}function sA(t,e){if(!(this instanceof sA))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=e.status===void 0?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=e.statusText===void 0?"":""+e.statusText,this.headers=new Rm(e.headers),this.url=e.url||"",this._initBody(t)}function our(t,e){return new Promise(function(r,n){var o=new $2(t,e);if(o.signal&&o.signal.aborted)return n(new D2("Aborted","AbortError"));var i=new XMLHttpRequest;function a(){i.abort()}i.onload=function(){var l={statusText:i.statusText,headers:wQn(i.getAllResponseHeaders()||"")};o.url.indexOf("file://")===0&&(i.status<200||i.status>599)?l.status=200:l.status=i.status,l.url="responseURL"in i?i.responseURL:l.headers.get("X-Request-URL");var c="response"in i?i.response:i.responseText;setTimeout(function(){r(new sA(c,l))},0)},i.onerror=function(){setTimeout(function(){n(new TypeError("Network request failed"))},0)},i.ontimeout=function(){setTimeout(function(){n(new TypeError("Network request timed out"))},0)},i.onabort=function(){setTimeout(function(){n(new D2("Aborted","AbortError"))},0)};function s(l){try{return l===""&&wg.location.href?wg.location.href:l}catch{return l}}if(i.open(o.method,s(o.url),!0),o.credentials==="include"?i.withCredentials=!0:o.credentials==="omit"&&(i.withCredentials=!1),"responseType"in i&&(bb.blob?i.responseType="blob":bb.arrayBuffer&&(i.responseType="arraybuffer")),e&&typeof e.headers=="object"&&!(e.headers instanceof Rm||wg.Headers&&e.headers instanceof wg.Headers)){var u=[];Object.getOwnPropertyNames(e.headers).forEach(function(l){u.push(NW(l)),i.setRequestHeader(l,HYe(e.headers[l]))}),o.headers.forEach(function(l,c){u.indexOf(c)===-1&&i.setRequestHeader(c,l)})}else o.headers.forEach(function(l,c){i.setRequestHeader(c,l)});o.signal&&(o.signal.addEventListener("abort",a),i.onreadystatechange=function(){i.readyState===4&&o.signal.removeEventListener("abort",a)}),i.send(typeof o._bodyInit>"u"?null:o._bodyInit)})}var wg,bb,Qsr,tur,bQn,SQn,D2,iur=v(()=>{wg=typeof globalThis<"u"&&globalThis||typeof self<"u"&&self||typeof window<"u"&&window||{},bb={searchParams:"URLSearchParams"in wg,iterable:"Symbol"in wg&&"iterator"in Symbol,blob:"FileReader"in wg&&"Blob"in wg&&function(){try{return new Blob,!0}catch{return!1}}(),formData:"FormData"in wg,arrayBuffer:"ArrayBuffer"in wg};bb.arrayBuffer&&(Qsr=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],tur=ArrayBuffer.isView||function(t){return t&&Qsr.indexOf(Object.prototype.toString.call(t))>-1});Rm.prototype.append=function(t,e){t=NW(t),e=HYe(e);var r=this.map[t];this.map[t]=r?r+", "+e:e};Rm.prototype.delete=function(t){delete this.map[NW(t)]};Rm.prototype.get=function(t){return t=NW(t),this.has(t)?this.map[t]:null};Rm.prototype.has=function(t){return this.map.hasOwnProperty(NW(t))};Rm.prototype.set=function(t,e){this.map[NW(t)]=HYe(e)};Rm.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)};Rm.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),VYe(t)};Rm.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),VYe(t)};Rm.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),VYe(t)};bb.iterable&&(Rm.prototype[Symbol.iterator]=Rm.prototype.entries);bQn=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];$2.prototype.clone=function(){return new $2(this,{body:this._bodyInit})};nur.call($2.prototype);nur.call(sA.prototype);sA.prototype.clone=function(){return new sA(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new Rm(this.headers),url:this.url})};sA.error=function(){var t=new sA(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};SQn=[301,302,303,307,308];sA.redirect=function(t,e){if(SQn.indexOf(e)===-1)throw new RangeError("Invalid status code");return new sA(null,{status:e,headers:{location:t}})};D2=wg.DOMException;try{new D2}catch{D2=function(e,r){this.message=e,this.name=r;var n=Error(e);this.stack=n.stack},D2.prototype=Object.create(Error.prototype),D2.prototype.constructor=D2}our.polyfill=!0;wg.fetch||(wg.fetch=our,wg.Headers=Rm,wg.Request=$2,wg.Response=sA)});function TQn(){if(typeof window<"u"&&window.navigator){let t=navigator;return"userAgentData"in t&&t.userAgentData?.platform?`${t.userAgentData.platform.toLowerCase()} Browser/${navigator.userAgent};`:navigator.platform?`${navigator.platform.toLowerCase()} Browser/${navigator.userAgent};`:`unknown Browser/${navigator.userAgent};`}else if(typeof process<"u")return`${process.arch} ${process.platform} Node.js/${process.version}`;return""}function EQn(t){if(t instanceof Headers){let e={};return t.forEach((r,n)=>{e[n]=r}),e}else return Array.isArray(t)?Object.fromEntries(t):t||{}}var sur,uur,CQn,xQn,OQn,JYe,WYe,GYe,ZYe,XYe,aur,jW,PQn,MQn,RQn,AQn,IQn,KYe,DW,t_a,H0e=v(()=>{iur();sur="11434",uur=`http://127.0.0.1:${sur}`,CQn="0.5.18",xQn=Object.defineProperty,OQn=(t,e,r)=>e in t?xQn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,JYe=(t,e,r)=>(OQn(t,typeof e!="symbol"?e+"":e,r),r),WYe=class t extends Error{constructor(e,r){super(e),this.error=e,this.status_code=r,this.name="ResponseError",Error.captureStackTrace&&Error.captureStackTrace(this,t)}},GYe=class{constructor(e,r,n){JYe(this,"abortController"),JYe(this,"itr"),JYe(this,"doneCallback"),this.abortController=e,this.itr=r,this.doneCallback=n}abort(){this.abortController.abort()}async*[Symbol.asyncIterator](){for await(let e of this.itr){if("error"in e)throw new Error(e.error);if(yield e,e.done||e.status==="success"){this.doneCallback();return}}throw new Error("Did not receive done or success response in stream.")}},ZYe=async t=>{if(t.ok)return;let e=`Error ${t.status}: ${t.statusText}`,r=null;if(t.headers.get("content-type")?.includes("application/json"))try{r=await t.json(),e=r.error||e}catch{console.log("Failed to parse error response as JSON")}else try{console.log("Getting text from response"),e=await t.text()||e}catch{console.log("Failed to get text from error response")}throw new WYe(e,t.status)};XYe=async(t,e,r={})=>{let n={"Content-Type":"application/json",Accept:"application/json","User-Agent":`ollama-js/${CQn} (${TQn()})`};r.headers=EQn(r.headers);let o=Object.fromEntries(Object.entries(r.headers).filter(([i])=>!Object.keys(n).some(a=>a.toLowerCase()===i.toLowerCase())));return r.headers={...n,...o},t(e,r)},aur=async(t,e,r)=>{let n=await XYe(t,e,{headers:r?.headers});return await ZYe(n),n},jW=async(t,e,r,n)=>{let i=(s=>s!==null&&typeof s=="object"&&!Array.isArray(s))(r)?JSON.stringify(r):r,a=await XYe(t,e,{method:"POST",body:i,signal:n?.signal,headers:n?.headers});return await ZYe(a),a},PQn=async(t,e,r,n)=>{let o=await XYe(t,e,{method:"DELETE",body:JSON.stringify(r),headers:n?.headers});return await ZYe(o),o},MQn=async function*(t){let e=new TextDecoder("utf-8"),r="",n=t.getReader();for(;;){let{done:o,value:i}=await n.read();if(o)break;r+=e.decode(i);let a=r.split(` +`);r=a.pop()??"";for(let s of a)try{yield JSON.parse(s)}catch{console.warn("invalid json: ",s)}}for(let o of r.split(` +`).filter(i=>i!==""))try{yield JSON.parse(o)}catch{console.warn("invalid json: ",o)}},RQn=t=>{if(!t)return uur;let e=t.includes("://");t.startsWith(":")&&(t=`http://127.0.0.1${t}`,e=!0),e||(t=`http://${t}`);let r=new URL(t),n=r.port;n||(e?n=r.protocol==="https:"?"443":"80":n=sur);let o="";r.username&&(o=r.username,r.password&&(o+=`:${r.password}`),o+="@");let i=`${r.protocol}//${o}${r.hostname}:${n}${r.pathname}`;return i.endsWith("/")&&(i=i.slice(0,-1)),i},AQn=Object.defineProperty,IQn=(t,e,r)=>e in t?AQn(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r,KYe=(t,e,r)=>(IQn(t,typeof e!="symbol"?e+"":e,r),r),DW=class{constructor(e){KYe(this,"config"),KYe(this,"fetch"),KYe(this,"ongoingStreamedRequests",[]),this.config={host:"",headers:e?.headers},e?.proxy||(this.config.host=RQn(e?.host??uur)),this.fetch=e?.fetch??fetch}abort(){for(let e of this.ongoingStreamedRequests)e.abort();this.ongoingStreamedRequests.length=0}async processStreamableRequest(e,r){r.stream=r.stream??!1;let n=`${this.config.host}/api/${e}`;if(r.stream){let i=new AbortController,a=await jW(this.fetch,n,r,{signal:i.signal,headers:this.config.headers});if(!a.body)throw new Error("Missing body");let s=MQn(a.body),u=new GYe(i,s,()=>{let l=this.ongoingStreamedRequests.indexOf(u);l>-1&&this.ongoingStreamedRequests.splice(l,1)});return this.ongoingStreamedRequests.push(u),u}return await(await jW(this.fetch,n,r,{headers:this.config.headers})).json()}async encodeImage(e){if(typeof e!="string"){let r=new Uint8Array(e),n="",o=r.byteLength;for(let i=0;i{Ysr();js();A1();H0e();gm();Ov();R1();cO();_O();Zv();o_();YYe=class extends bh{constructor(e){super(e??{});M(this,"model","llama3");M(this,"numa");M(this,"numCtx");M(this,"numBatch");M(this,"numGpu");M(this,"mainGpu");M(this,"lowVram");M(this,"f16Kv");M(this,"logitsAll");M(this,"vocabOnly");M(this,"useMmap");M(this,"useMlock");M(this,"embeddingOnly");M(this,"numThread");M(this,"numKeep");M(this,"seed");M(this,"numPredict");M(this,"topK");M(this,"topP");M(this,"tfsZ");M(this,"typicalP");M(this,"repeatLastN");M(this,"temperature");M(this,"repeatPenalty");M(this,"presencePenalty");M(this,"frequencyPenalty");M(this,"mirostat");M(this,"mirostatTau");M(this,"mirostatEta");M(this,"penalizeNewline");M(this,"streaming");M(this,"format");M(this,"keepAlive");M(this,"client");M(this,"checkOrPullModel",!1);M(this,"baseUrl","http://127.0.0.1:11434");M(this,"think");this.client=new DW({fetch:e?.fetch,host:e?.baseUrl,headers:e?.headers}),this.baseUrl=e?.baseUrl??this.baseUrl,this.model=e?.model??this.model,this.numa=e?.numa,this.numCtx=e?.numCtx,this.numBatch=e?.numBatch,this.numGpu=e?.numGpu,this.mainGpu=e?.mainGpu,this.lowVram=e?.lowVram,this.f16Kv=e?.f16Kv,this.logitsAll=e?.logitsAll,this.vocabOnly=e?.vocabOnly,this.useMmap=e?.useMmap,this.useMlock=e?.useMlock,this.embeddingOnly=e?.embeddingOnly,this.numThread=e?.numThread,this.numKeep=e?.numKeep,this.seed=e?.seed,this.numPredict=e?.numPredict,this.topK=e?.topK,this.topP=e?.topP,this.tfsZ=e?.tfsZ,this.typicalP=e?.typicalP,this.repeatLastN=e?.repeatLastN,this.temperature=e?.temperature,this.repeatPenalty=e?.repeatPenalty,this.presencePenalty=e?.presencePenalty,this.frequencyPenalty=e?.frequencyPenalty,this.mirostat=e?.mirostat,this.mirostatTau=e?.mirostatTau,this.mirostatEta=e?.mirostatEta,this.penalizeNewline=e?.penalizeNewline,this.streaming=e?.streaming,this.format=e?.format,this.keepAlive=e?.keepAlive,this.think=e?.think,this.checkOrPullModel=e?.checkOrPullModel??this.checkOrPullModel}static lc_name(){return"ChatOllama"}_llmType(){return"ollama"}async pull(e,r){let{stream:n,insecure:o,logProgress:i}={stream:!0,...r};if(n)for await(let a of await this.client.pull({model:e,insecure:o,stream:n}))i&&console.log(a);else{let a=await this.client.pull({model:e,insecure:o});i&&console.log(a)}}bindTools(e,r){return this.withConfig({tools:e.map(n=>M1(n)),...r})}getLsParams(e){let r=this.invocationParams(e);return{ls_provider:"ollama",ls_model_name:this.model,ls_model_type:"chat",ls_temperature:r.options?.temperature??void 0,ls_max_tokens:r.options?.num_predict??void 0,ls_stop:e.stop}}invocationParams(e){return{model:this.model,format:e?.format??this.format,keep_alive:this.keepAlive,think:this.think,options:{numa:this.numa,num_ctx:this.numCtx,num_batch:this.numBatch,num_gpu:this.numGpu,main_gpu:this.mainGpu,low_vram:this.lowVram,f16_kv:this.f16Kv,logits_all:this.logitsAll,vocab_only:this.vocabOnly,use_mmap:this.useMmap,use_mlock:this.useMlock,embedding_only:this.embeddingOnly,num_thread:this.numThread,num_keep:this.numKeep,seed:this.seed,num_predict:this.numPredict,top_k:this.topK,top_p:this.topP,tfs_z:this.tfsZ,typical_p:this.typicalP,repeat_last_n:this.repeatLastN,temperature:this.temperature,repeat_penalty:this.repeatPenalty,presence_penalty:this.presencePenalty,frequency_penalty:this.frequencyPenalty,mirostat:this.mirostat,mirostat_tau:this.mirostatTau,mirostat_eta:this.mirostatEta,penalize_newline:this.penalizeNewline,stop:e?.stop},tools:e?.tools?.length?e.tools.map(r=>M1(r)):void 0}}async checkModelExistsOnMachine(e){let{models:r}=await this.client.list();return!!r.find(n=>n.name===e||n.name===`${e}:latest`)}async _generate(e,r,n){this.checkOrPullModel&&(await this.checkModelExistsOnMachine(this.model)||await this.pull(this.model,{logProgress:!0}));let o;for await(let a of this._streamResponseChunks(e,r,n))o?o=eb(o,a.message):o=a.message;let i=new li({id:o?.id,content:o?.content??"",tool_calls:o?.tool_calls,response_metadata:o?.response_metadata,usage_metadata:o?.usage_metadata});return{generations:[{text:typeof i.content=="string"?i.content:"",message:i}]}}async*_streamResponseChunks(e,r,n){this.checkOrPullModel&&(await this.checkModelExistsOnMachine(this.model)||await this.pull(this.model,{logProgress:!0}));let o=this.invocationParams(r),i=Xsr(e),a={input_tokens:0,output_tokens:0,total_tokens:0},s=await this.client.chat({...o,messages:i,stream:!0}),u;for await(let l of s){r.signal?.aborted&&this.client.abort();let{message:c,...d}=l;a.input_tokens+=d.prompt_eval_count??0,a.output_tokens+=d.eval_count??0,a.total_tokens=a.input_tokens+a.output_tokens,u=d;let f=this.think?c.thinking??c.content??"":c.content??"";yield new Oi({text:f,message:Zsr(c)}),await n?.handleLLMNewToken(f)}yield new Oi({text:"",message:new Nr({content:"",response_metadata:u,usage_metadata:a})})}withStructuredOutput(e,r){if(r?.method===void 0||r?.method==="jsonSchema"){let n=Ga(e),o=n?Hi(e):e,i=this.bindTools([{type:"function",function:{name:"extract",description:o.description,parameters:o}}]).withConfig({format:"json",ls_structured_output_format:{kwargs:{method:"jsonSchema"},schema:Hi(e)}}),a=n?Kw.fromZodSchema(e):new Tv;if(!r?.includeRaw)return i.pipe(a);let s=wu.assign({parsed:(c,d)=>a.invoke(c.raw,d)}),u=wu.assign({parsed:()=>null}),l=s.withFallbacks({fallbacks:[u]});return Sl.from([{raw:i},l])}else return super.withStructuredOutput(e,r)}}});var QYe,cur=v(()=>{H0e();A2();QYe=class extends MS{constructor(e){super({maxConcurrency:1,...e});M(this,"model","mxbai-embed-large");M(this,"baseUrl","http://localhost:11434");M(this,"keepAlive");M(this,"requestOptions");M(this,"client");M(this,"truncate",!1);this.client=new DW({fetch:e?.fetch,host:e?.baseUrl,headers:e?.headers?new Headers(e.headers):void 0}),this.baseUrl=e?.baseUrl??this.baseUrl,this.model=e?.model??this.model,this.keepAlive=e?.keepAlive,this.truncate=e?.truncate??this.truncate,this.requestOptions=e?.requestOptions?this._convertOptions(e?.requestOptions):void 0}_convertOptions(e){let r={},n={embeddingOnly:"embedding_only",frequencyPenalty:"frequency_penalty",keepAlive:"keep_alive",logitsAll:"logits_all",lowVram:"low_vram",mainGpu:"main_gpu",mirostat:"mirostat",mirostatEta:"mirostat_eta",mirostatTau:"mirostat_tau",numBatch:"num_batch",numCtx:"num_ctx",numGpu:"num_gpu",numKeep:"num_keep",numPredict:"num_predict",numThread:"num_thread",penalizeNewline:"penalize_newline",presencePenalty:"presence_penalty",repeatLastN:"repeat_last_n",repeatPenalty:"repeat_penalty",temperature:"temperature",stop:"stop",tfsZ:"tfs_z",topK:"top_k",topP:"top_p",typicalP:"typical_p",useMlock:"use_mlock",useMmap:"use_mmap",vocabOnly:"vocab_only",f16Kv:"f16_kv",numa:"numa",seed:"seed"};for(let[o,i]of Object.entries(e)){let a=n[o];a?r[a]=i:r[o]=i}return r}async embedDocuments(e){return this.embeddingWithRetry(e)}async embedQuery(e){return(await this.embeddingWithRetry([e]))[0]}async embeddingWithRetry(e){return(await this.caller.call(()=>this.client.embed({model:this.model,input:e,keep_alive:this.keepAlive,options:this.requestOptions,truncate:this.truncate}))).embeddings}}});var dur=v(()=>{H0e();gm();doe()});var eQe=v(()=>{lur();cur();dur()});function uA(t){return t?!!(/^o\d/.test(t??"")||t.startsWith("gpt-5")&&!t.startsWith("gpt-5-chat")):!1}function NQn(t){return t.role!=="system"&&t.role!=="developer"&&t.role!=="assistant"&&t.role!=="user"&&t.role!=="function"&&t.role!=="tool"&&console.warn(`Unknown message role: ${t.role}`),t.role}function lA(t){let e=t._getType();switch(e){case"system":return"system";case"ai":return"assistant";case"human":return"user";case"function":return"function";case"tool":return"tool";case"generic":if(!ud.isInstance(t))throw new Error("Invalid generic chat message");return NQn(t);default:throw new Error(`Unknown message type: ${e}`)}}var MC,tk=v(()=>{js();MC=t=>t()});function cA(t){let{azureOpenAIApiDeploymentName:e,azureOpenAIApiInstanceName:r,azureOpenAIApiKey:n,azureOpenAIBasePath:o,baseURL:i,azureADTokenProvider:a,azureOpenAIEndpoint:s}=t;if((n||a)&&o&&e)return`${o}/${e}`;if((n||a)&&s&&e)return`${s}/openai/deployments/${e}`;if(n||a){if(!r)throw new Error("azureOpenAIApiInstanceName is required when using azureOpenAIApiKey");if(!e)throw new Error("azureOpenAIApiDeploymentName is a required parameter when using azureOpenAIApiKey");return`https://${r}.openai.azure.com/openai/deployments/${e}`}return i}function tQe(t){return typeof Headers<"u"&&t!==null&&typeof t=="object"&&Object.prototype.toString.call(t)==="[object Headers]"}function yoe(t){let e=MC(()=>{if(tQe(t))return t;if(Array.isArray(t))return new Headers(t);if(typeof t=="object"&&t!==null&&"values"in t&&tQe(t.values))return t.values;if(typeof t=="object"&&t!==null){let r=Object.entries(t).filter(([,n])=>typeof n=="string").map(([n,o])=>[n,o]);return new Headers(r)}return new Headers});return Object.fromEntries(e.entries())}var rk=v(()=>{tk()});function fur(t,e){let r;return yg(t)?r=M1(t):r=t,e?.strict!==void 0&&(r.function.strict=e.strict),r}function jQn(t){return t.anyOf!==void 0&&Array.isArray(t.anyOf)}function pur(t){let e=["namespace functions {",""];for(let r of t)r.description&&e.push(`// ${r.description}`),Object.keys(r.parameters.properties??{}).length>0?(e.push(`type ${r.name} = (_: {`),e.push(mur(r.parameters,0)),e.push("}) => any;")):e.push(`type ${r.name} = () => any;`),e.push("");return e.push("} // namespace functions"),e.join(` +`)}function mur(t,e){let r=[];for(let[n,o]of Object.entries(t.properties??{}))o.description&&e<2&&r.push(`// ${o.description}`),t.required?.includes(n)?r.push(`${n}: ${V0e(o,e)},`):r.push(`${n}?: ${V0e(o,e)},`);return r.map(n=>" ".repeat(e)+n).join(` +`)}function V0e(t,e){if(jQn(t))return t.anyOf.map(r=>V0e(r,e)).join(" | ");switch(t.type){case"string":return t.enum?t.enum.map(r=>`"${r}"`).join(" | "):"string";case"number":return t.enum?t.enum.map(r=>`${r}`).join(" | "):"number";case"integer":return t.enum?t.enum.map(r=>`${r}`).join(" | "):"number";case"boolean":return"boolean";case"null":return"null";case"object":return["{",mur(t,e+2),"}"].join(` +`);case"array":return t.items?`${V0e(t.items,e)}[]`:"any[]";default:return""}}function J0e(t){if(t)return t==="any"||t==="required"?"required":t==="auto"?"auto":t==="none"?"none":typeof t=="string"?{type:"function",function:{name:t}}:t}function $W(t){return"type"in t&&t.type!=="function"}function hur(t){return t!=null&&typeof t=="object"&&"type"in t&&t.type!=="function"}function L2(t){return typeof t=="object"&&t!==null&&"metadata"in t&&typeof t.metadata=="object"&&t.metadata!==null&&"customTool"in t.metadata&&typeof t.metadata.customTool=="object"&&t.metadata.customTool!==null}function K0e(t){return"type"in t&&t.type==="custom"&&"custom"in t&&typeof t.custom=="object"&&t.custom!==null}function gur(t){if(t.type==="custom_tool_call")return{...t,type:"tool_call",call_id:t.id,id:t.call_id,name:t.name,isCustomTool:!0,args:{input:t.input}}}function yur(t){return t.type==="tool_call"&&"isCustomTool"in t&&t.isCustomTool===!0}function bur(t){let e=()=>{if(t.custom.format){if(t.custom.format.type==="grammar")return{type:"grammar",definition:t.custom.format.grammar.definition,syntax:t.custom.format.grammar.syntax};if(t.custom.format.type==="text")return{type:"text"}}};return{type:"custom",name:t.custom.name,description:t.custom.description,format:e()}}function _ur(t){let e=()=>{if(t.format){if(t.format.type==="grammar")return{type:"grammar",grammar:{definition:t.format.definition,syntax:t.format.syntax}};if(t.format.type==="text")return{type:"text"}}};return{type:"custom",custom:{name:t.name,description:t.description,format:e()}}}var boe=v(()=>{Zv();o_();R1()});function _oe(t){return typeof t=="object"&&t!==null&&("name"in t&&t.name==="AbortError"||"message"in t&&String(t.message).includes("FetchRequestCanceledException"))}var voe,W0e=v(()=>{voe=t=>{if(t instanceof Error)return t;if(typeof t=="object"&&t!==null){try{if(Object.prototype.toString.call(t)==="[object Error]"){let e=new Error(t.message,t.cause?{cause:t.cause}:{});return t.stack&&(e.stack=t.stack),t.cause&&!e.cause&&(e.cause=t.cause),t.name&&(e.name=t.name),e}}catch{}try{return new Error(JSON.stringify(t))}catch{}}return new Error(t)}});var Ft,Am,Mc,nk,dA,LW,FW,kW,qW,BW,UW,zW,HW,VW,JW,fA,pA=v(()=>{W0e();Ft=class extends Error{},Am=class t extends Ft{constructor(e,r,n,o){super(`${t.makeMessage(e,r,n)}`),this.status=e,this.headers=o,this.requestID=o?.get("x-request-id"),this.error=r;let i=r;this.code=i?.code,this.param=i?.param,this.type=i?.type}static makeMessage(e,r,n){let o=r?.message?typeof r.message=="string"?r.message:JSON.stringify(r.message):r?JSON.stringify(r):n;return e&&o?`${e} ${o}`:e?`${e} status code (no body)`:o||"(no status code or body)"}static generate(e,r,n,o){if(!e||!o)return new nk({message:n,cause:voe(r)});let i=r?.error;return e===400?new LW(e,i,n,o):e===401?new FW(e,i,n,o):e===403?new kW(e,i,n,o):e===404?new qW(e,i,n,o):e===409?new BW(e,i,n,o):e===422?new UW(e,i,n,o):e===429?new zW(e,i,n,o):e>=500?new HW(e,i,n,o):new t(e,i,n,o)}},Mc=class extends Am{constructor({message:e}={}){super(void 0,void 0,e||"Request was aborted.",void 0)}},nk=class extends Am{constructor({message:e,cause:r}){super(void 0,void 0,e||"Connection error.",void 0),r&&(this.cause=r)}},dA=class extends nk{constructor({message:e}={}){super({message:e??"Request timed out."})}},LW=class extends Am{},FW=class extends Am{},kW=class extends Am{},qW=class extends Am{},BW=class extends Am{},UW=class extends Am{},zW=class extends Am{},HW=class extends Am{},VW=class extends Ft{constructor(){super("Could not parse response content as the length limit was reached")}},JW=class extends Ft{constructor(){super("Could not parse response content as the request was rejected by the content filter")}},fA=class extends Error{constructor(e){super(e)}}});var RC=v(()=>{pA()});function woe(t){return t!==void 0&&"function"in t&&t.function!==void 0}function vur(t,e){let r={...t};return Object.defineProperties(r,{$brand:{value:"auto-parseable-response-format",enumerable:!1},$parseRaw:{value:e,enumerable:!1}}),r}function Soe(t){return t?.$brand==="auto-parseable-response-format"}function F2(t){return t?.$brand==="auto-parseable-tool"}function wur(t,e){return!e||!rQe(e)?{...t,choices:t.choices.map(r=>(Cur(r.message.tool_calls),{...r,message:{...r.message,parsed:null,...r.message.tool_calls?{tool_calls:r.message.tool_calls}:void 0}}))}:Coe(t,e)}function Coe(t,e){let r=t.choices.map(n=>{if(n.finish_reason==="length")throw new VW;if(n.finish_reason==="content_filter")throw new JW;return Cur(n.message.tool_calls),{...n,message:{...n.message,...n.message.tool_calls?{tool_calls:n.message.tool_calls?.map(o=>FQn(e,o))??void 0}:void 0,parsed:n.message.content&&!n.message.refusal?LQn(e,n.message.content):null}}});return{...t,choices:r}}function LQn(t,e){return t.response_format?.type!=="json_schema"?null:t.response_format?.type==="json_schema"?"$parseRaw"in t.response_format?t.response_format.$parseRaw(e):JSON.parse(e):null}function FQn(t,e){let r=t.tools?.find(n=>woe(n)&&n.function?.name===e.function.name);return{...e,function:{...e.function,parsed_arguments:F2(r)?r.$parseRaw(e.function.arguments):r?.function.strict?JSON.parse(e.function.arguments):null}}}function Sur(t,e){if(!t||!("tools"in t)||!t.tools)return!1;let r=t.tools?.find(n=>woe(n)&&n.function?.name===e.function.name);return woe(r)&&(F2(r)||r?.function.strict||!1)}function rQe(t){return Soe(t.response_format)?!0:t.tools?.some(e=>F2(e)||e.type==="function"&&e.function.strict===!0)??!1}function Cur(t){for(let e of t||[])if(e.type!=="function")throw new Ft(`Currently only \`function\` tool calls are supported; Received \`${e.type}\``)}function xur(t){for(let e of t??[]){if(e.type!=="function")throw new Ft(`Currently only \`function\` tool types support auto-parsing; Received \`${e.type}\``);if(e.function.strict!==!0)throw new Ft(`The \`${e.function.name}\` tool is not marked with \`strict: true\`. Only strict function tools can be auto-parsed`)}}var KW=v(()=>{RC()});var Tur,Our,Eur,G0e=v(()=>{Tur=Symbol("Let zodToJsonSchema decide on which parser to use"),Our={name:void 0,$refStrategy:"root",effectStrategy:"input",pipeStrategy:"all",dateStrategy:"format:date-time",mapStrategy:"entries",nullableStrategy:"from-target",removeAdditionalStrategy:"passthrough",definitionPath:"definitions",target:"jsonSchema7",strictUnions:!1,errorMessages:!1,markdownDescription:!1,patternStrategy:"escape",applyRegexFlags:!1,emailStrategy:"format:email",base64Strategy:"contentEncoding:base64",nameStrategy:"ref"},Eur=t=>typeof t=="string"?{...Our,basePath:["#"],definitions:{},name:t}:{...Our,basePath:["#"],definitions:{},...t}});function Pur(t){if(!t)return!0;for(let e in t)return!1;return!0}var xoe,nQe=v(()=>{xoe=t=>"_def"in t?t._def:t});var Mur,oQe=v(()=>{G0e();nQe();Mur=t=>{let e=Eur(t),r=e.name!==void 0?[...e.basePath,e.definitionPath,e.name]:e.basePath;return{...e,currentPath:r,propertyPath:void 0,seenRefs:new Set,seen:new Map(Object.entries(e.definitions).map(([n,o])=>[xoe(o),{def:xoe(o),path:[...e.basePath,e.definitionPath,n],jsonSchema:void 0}]))}}});function iQe(t,e,r,n){n?.errorMessages&&r&&(t.errorMessage={...t.errorMessage,[e]:r})}function Fi(t,e,r,n,o){t[e]=r,iQe(t,e,n,o)}var ok=v(()=>{});function Rur(){return{}}var aQe=v(()=>{});function Aur(t,e){let r={type:"array"};return t.type?._def?.typeName!==Me.ZodAny&&(r.items=hn(t.type._def,{...e,currentPath:[...e.currentPath,"items"]})),t.minLength&&Fi(r,"minItems",t.minLength.value,t.minLength.message,e),t.maxLength&&Fi(r,"maxItems",t.maxLength.value,t.maxLength.message,e),t.exactLength&&(Fi(r,"minItems",t.exactLength.value,t.exactLength.message,e),Fi(r,"maxItems",t.exactLength.value,t.exactLength.message,e)),r}var sQe=v(()=>{yO();ok();yd()});function Iur(t,e){let r={type:"integer",format:"int64"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"min":e.target==="jsonSchema7"?n.inclusive?Fi(r,"minimum",n.value,n.message,e):Fi(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Fi(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Fi(r,"maximum",n.value,n.message,e):Fi(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Fi(r,"maximum",n.value,n.message,e));break;case"multipleOf":Fi(r,"multipleOf",n.value,n.message,e);break}return r}var uQe=v(()=>{ok()});function Nur(){return{type:"boolean"}}var lQe=v(()=>{});function jur(t,e){return hn(t.type._def,e)}var cQe=v(()=>{yd()});var Dur,dQe=v(()=>{yd();Dur=(t,e)=>hn(t.innerType._def,e)});function fQe(t,e,r){let n=r??e.dateStrategy;if(Array.isArray(n))return{anyOf:n.map((o,i)=>fQe(t,e,o))};switch(n){case"string":case"format:date-time":return{type:"string",format:"date-time"};case"format:date":return{type:"string",format:"date"};case"integer":return kQn(t,e)}}var kQn,pQe=v(()=>{ok();kQn=(t,e)=>{let r={type:"integer",format:"unix-time"};if(e.target==="openApi3")return r;for(let n of t.checks)switch(n.kind){case"min":Fi(r,"minimum",n.value,n.message,e);break;case"max":Fi(r,"maximum",n.value,n.message,e);break}return r}});function $ur(t,e){return{...hn(t.innerType._def,e),default:t.defaultValue()}}var mQe=v(()=>{yd()});function Lur(t,e,r){return e.effectStrategy==="input"?hn(t.schema._def,e,r):{}}var hQe=v(()=>{yd()});function Fur(t){return{type:"string",enum:[...t.values]}}var gQe=v(()=>{});function kur(t,e){let r=[hn(t.left._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),hn(t.right._def,{...e,currentPath:[...e.currentPath,"allOf","1"]})].filter(i=>!!i),n=e.target==="jsonSchema2019-09"?{unevaluatedProperties:!1}:void 0,o=[];return r.forEach(i=>{if(qQn(i))o.push(...i.allOf),i.unevaluatedProperties===void 0&&(n=void 0);else{let a=i;if("additionalProperties"in i&&i.additionalProperties===!1){let{additionalProperties:s,...u}=i;a=u}else n=void 0;o.push(a)}}),o.length?{allOf:o,...n}:void 0}var qQn,yQe=v(()=>{yd();qQn=t=>"type"in t&&t.type==="string"?!1:"allOf"in t});function qur(t,e){let r=typeof t.value;return r!=="bigint"&&r!=="number"&&r!=="boolean"&&r!=="string"?{type:Array.isArray(t.value)?"array":"object"}:e.target==="openApi3"?{type:r==="bigint"?"integer":r,enum:[t.value]}:{type:r==="bigint"?"integer":r,const:t.value}}var bQe=v(()=>{});function Z0e(t,e){let r={type:"string"};function n(o){return e.patternStrategy==="escape"?BQn(o):o}if(t.checks)for(let o of t.checks)switch(o.kind){case"min":Fi(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,o.value):o.value,o.message,e);break;case"max":Fi(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,o.value):o.value,o.message,e);break;case"email":switch(e.emailStrategy){case"format:email":AC(r,"email",o.message,e);break;case"format:idn-email":AC(r,"idn-email",o.message,e);break;case"pattern:zod":IC(r,k2.email,o.message,e);break}break;case"url":AC(r,"uri",o.message,e);break;case"uuid":AC(r,"uuid",o.message,e);break;case"regex":IC(r,o.regex,o.message,e);break;case"cuid":IC(r,k2.cuid,o.message,e);break;case"cuid2":IC(r,k2.cuid2,o.message,e);break;case"startsWith":IC(r,RegExp(`^${n(o.value)}`),o.message,e);break;case"endsWith":IC(r,RegExp(`${n(o.value)}$`),o.message,e);break;case"datetime":AC(r,"date-time",o.message,e);break;case"date":AC(r,"date",o.message,e);break;case"time":AC(r,"time",o.message,e);break;case"duration":AC(r,"duration",o.message,e);break;case"length":Fi(r,"minLength",typeof r.minLength=="number"?Math.max(r.minLength,o.value):o.value,o.message,e),Fi(r,"maxLength",typeof r.maxLength=="number"?Math.min(r.maxLength,o.value):o.value,o.message,e);break;case"includes":{IC(r,RegExp(n(o.value)),o.message,e);break}case"ip":{o.version!=="v6"&&AC(r,"ipv4",o.message,e),o.version!=="v4"&&AC(r,"ipv6",o.message,e);break}case"emoji":IC(r,k2.emoji,o.message,e);break;case"ulid":{IC(r,k2.ulid,o.message,e);break}case"base64":{switch(e.base64Strategy){case"format:binary":{AC(r,"binary",o.message,e);break}case"contentEncoding:base64":{Fi(r,"contentEncoding","base64",o.message,e);break}case"pattern:zod":{IC(r,k2.base64,o.message,e);break}}break}case"nanoid":IC(r,k2.nanoid,o.message,e);case"toLowerCase":case"toUpperCase":case"trim":break;default:}return r}var _Qe,k2,BQn,AC,IC,Bur,X0e=v(()=>{ok();k2={cuid:/^[cC][^\s-]{8,}$/,cuid2:/^[0-9a-z]+$/,ulid:/^[0-9A-HJKMNP-TV-Z]{26}$/,email:/^(?!\.)(?!.*\.\.)([a-zA-Z0-9_'+\-\.]*)[a-zA-Z0-9_+-]@([a-zA-Z0-9][a-zA-Z0-9\-]*\.)+[a-zA-Z]{2,}$/,emoji:()=>(_Qe===void 0&&(_Qe=RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u")),_Qe),uuid:/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/,ipv4:/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,ipv6:/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,base64:/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,nanoid:/^[a-zA-Z0-9_-]{21}$/};BQn=t=>Array.from(t).map(e=>/[a-zA-Z0-9]/.test(e)?e:`\\${e}`).join(""),AC=(t,e,r,n)=>{t.format||t.anyOf?.some(o=>o.format)?(t.anyOf||(t.anyOf=[]),t.format&&(t.anyOf.push({format:t.format,...t.errorMessage&&n.errorMessages&&{errorMessage:{format:t.errorMessage.format}}}),delete t.format,t.errorMessage&&(delete t.errorMessage.format,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.anyOf.push({format:e,...r&&n.errorMessages&&{errorMessage:{format:r}}})):Fi(t,"format",e,r,n)},IC=(t,e,r,n)=>{t.pattern||t.allOf?.some(o=>o.pattern)?(t.allOf||(t.allOf=[]),t.pattern&&(t.allOf.push({pattern:t.pattern,...t.errorMessage&&n.errorMessages&&{errorMessage:{pattern:t.errorMessage.pattern}}}),delete t.pattern,t.errorMessage&&(delete t.errorMessage.pattern,Object.keys(t.errorMessage).length===0&&delete t.errorMessage)),t.allOf.push({pattern:Bur(e,n),...r&&n.errorMessages&&{errorMessage:{pattern:r}}})):Fi(t,"pattern",Bur(e,n),r,n)},Bur=(t,e)=>{let r=typeof t=="function"?t():t;if(!e.applyRegexFlags||!r.flags)return r.source;let n={i:r.flags.includes("i"),m:r.flags.includes("m"),s:r.flags.includes("s")},o=n.i?r.source.toLowerCase():r.source,i="",a=!1,s=!1,u=!1;for(let l=0;l({...n,[o]:hn(t.valueType._def,{...e,currentPath:[...e.currentPath,"properties",o]})??{}}),{}),additionalProperties:!1};let r={type:"object",additionalProperties:hn(t.valueType._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??{}};if(e.target==="openApi3")return r;if(t.keyType?._def.typeName===Me.ZodString&&t.keyType._def.checks?.length){let n=Object.entries(Z0e(t.keyType._def,e)).reduce((o,[i,a])=>i==="type"?o:{...o,[i]:a},{});return{...r,propertyNames:n}}else if(t.keyType?._def.typeName===Me.ZodEnum)return{...r,propertyNames:{enum:t.keyType._def.values}};return r}var Q0e=v(()=>{yO();yd();X0e()});function Uur(t,e){if(e.mapStrategy==="record")return Y0e(t,e);let r=hn(t.keyType._def,{...e,currentPath:[...e.currentPath,"items","items","0"]})||{},n=hn(t.valueType._def,{...e,currentPath:[...e.currentPath,"items","items","1"]})||{};return{type:"array",maxItems:125,items:{type:"array",items:[r,n],minItems:2,maxItems:2}}}var vQe=v(()=>{yd();Q0e()});function zur(t){let e=t.values,n=Object.keys(t.values).filter(i=>typeof e[e[i]]!="number").map(i=>e[i]),o=Array.from(new Set(n.map(i=>typeof i)));return{type:o.length===1?o[0]==="string"?"string":"number":["string","number"],enum:n}}var wQe=v(()=>{});function Hur(){return{not:{}}}var SQe=v(()=>{});function Vur(t){return t.target==="openApi3"?{enum:["null"],nullable:!0}:{type:"null"}}var CQe=v(()=>{});function Kur(t,e){if(e.target==="openApi3")return Jur(t,e);let r=t.options instanceof Map?Array.from(t.options.values()):t.options;if(r.every(n=>n._def.typeName in Ooe&&(!n._def.checks||!n._def.checks.length))){let n=r.reduce((o,i)=>{let a=Ooe[i._def.typeName];return a&&!o.includes(a)?[...o,a]:o},[]);return{type:n.length>1?n:n[0]}}else if(r.every(n=>n._def.typeName==="ZodLiteral"&&!n.description)){let n=r.reduce((o,i)=>{let a=typeof i._def.value;switch(a){case"string":case"number":case"boolean":return[...o,a];case"bigint":return[...o,"integer"];case"object":if(i._def.value===null)return[...o,"null"];case"symbol":case"undefined":case"function":default:return o}},[]);if(n.length===r.length){let o=n.filter((i,a,s)=>s.indexOf(i)===a);return{type:o.length>1?o:o[0],enum:r.reduce((i,a)=>i.includes(a._def.value)?i:[...i,a._def.value],[])}}}else if(r.every(n=>n._def.typeName==="ZodEnum"))return{type:"string",enum:r.reduce((n,o)=>[...n,...o._def.values.filter(i=>!n.includes(i))],[])};return Jur(t,e)}var Ooe,Jur,eCe=v(()=>{yd();Ooe={ZodString:"string",ZodNumber:"number",ZodBigInt:"integer",ZodBoolean:"boolean",ZodNull:"null"};Jur=(t,e)=>{let r=(t.options instanceof Map?Array.from(t.options.values()):t.options).map((n,o)=>hn(n._def,{...e,currentPath:[...e.currentPath,"anyOf",`${o}`]})).filter(n=>!!n&&(!e.strictUnions||typeof n=="object"&&Object.keys(n).length>0));return r.length?{anyOf:r}:void 0}});function Wur(t,e){if(["ZodString","ZodNumber","ZodBigInt","ZodBoolean","ZodNull"].includes(t.innerType._def.typeName)&&(!t.innerType._def.checks||!t.innerType._def.checks.length))return e.target==="openApi3"||e.nullableStrategy==="property"?{type:Ooe[t.innerType._def.typeName],nullable:!0}:{type:[Ooe[t.innerType._def.typeName],"null"]};if(e.target==="openApi3"){let n=hn(t.innerType._def,{...e,currentPath:[...e.currentPath]});return n&&"$ref"in n?{allOf:[n],nullable:!0}:n&&{...n,nullable:!0}}let r=hn(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","0"]});return r&&{anyOf:[r,{type:"null"}]}}var xQe=v(()=>{yd();eCe()});function Gur(t,e){let r={type:"number"};if(!t.checks)return r;for(let n of t.checks)switch(n.kind){case"int":r.type="integer",iQe(r,"type",n.message,e);break;case"min":e.target==="jsonSchema7"?n.inclusive?Fi(r,"minimum",n.value,n.message,e):Fi(r,"exclusiveMinimum",n.value,n.message,e):(n.inclusive||(r.exclusiveMinimum=!0),Fi(r,"minimum",n.value,n.message,e));break;case"max":e.target==="jsonSchema7"?n.inclusive?Fi(r,"maximum",n.value,n.message,e):Fi(r,"exclusiveMaximum",n.value,n.message,e):(n.inclusive||(r.exclusiveMaximum=!0),Fi(r,"maximum",n.value,n.message,e));break;case"multipleOf":Fi(r,"multipleOf",n.value,n.message,e);break}return r}var OQe=v(()=>{ok()});function UQn(t,e){return e.removeAdditionalStrategy==="strict"?t.catchall._def.typeName==="ZodNever"?t.unknownKeys!=="strict":hn(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??!0:t.catchall._def.typeName==="ZodNever"?t.unknownKeys==="passthrough":hn(t.catchall._def,{...e,currentPath:[...e.currentPath,"additionalProperties"]})??!0}function Zur(t,e){let r={type:"object",...Object.entries(t.shape()).reduce((n,[o,i])=>{if(i===void 0||i._def===void 0)return n;let a=[...e.currentPath,"properties",o],s=hn(i._def,{...e,currentPath:a,propertyPath:a});if(s===void 0)return n;if(e.openaiStrictMode&&i.isOptional()&&!i.isNullable()&&typeof i._def?.defaultValue>"u")throw new Error(`Zod field at \`${a.join("/")}\` uses \`.optional()\` without \`.nullable()\` which is not supported by the API. See: https://platform.openai.com/docs/guides/structured-outputs?api-mode=responses#all-fields-must-be-required`);return{properties:{...n.properties,[o]:s},required:i.isOptional()&&!e.openaiStrictMode?n.required:[...n.required,o]}},{properties:{},required:[]}),additionalProperties:UQn(t,e)};return r.required.length||delete r.required,r}var TQe=v(()=>{yd()});var Xur,EQe=v(()=>{yd();Xur=(t,e)=>{if(e.propertyPath&&e.currentPath.slice(0,e.propertyPath.length).toString()===e.propertyPath.toString())return hn(t.innerType._def,{...e,currentPath:e.currentPath});let r=hn(t.innerType._def,{...e,currentPath:[...e.currentPath,"anyOf","1"]});return r?{anyOf:[{not:{}},r]}:{}}});var Yur,PQe=v(()=>{yd();Yur=(t,e)=>{if(e.pipeStrategy==="input")return hn(t.in._def,e);if(e.pipeStrategy==="output")return hn(t.out._def,e);let r=hn(t.in._def,{...e,currentPath:[...e.currentPath,"allOf","0"]}),n=hn(t.out._def,{...e,currentPath:[...e.currentPath,"allOf",r?"1":"0"]});return{allOf:[r,n].filter(o=>o!==void 0)}}});function Qur(t,e){return hn(t.type._def,e)}var MQe=v(()=>{yd()});function elr(t,e){let n={type:"array",uniqueItems:!0,items:hn(t.valueType._def,{...e,currentPath:[...e.currentPath,"items"]})};return t.minSize&&Fi(n,"minItems",t.minSize.value,t.minSize.message,e),t.maxSize&&Fi(n,"maxItems",t.maxSize.value,t.maxSize.message,e),n}var RQe=v(()=>{ok();yd()});function tlr(t,e){return t.rest?{type:"array",minItems:t.items.length,items:t.items.map((r,n)=>hn(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[]),additionalItems:hn(t.rest._def,{...e,currentPath:[...e.currentPath,"additionalItems"]})}:{type:"array",minItems:t.items.length,maxItems:t.items.length,items:t.items.map((r,n)=>hn(r._def,{...e,currentPath:[...e.currentPath,"items",`${n}`]})).reduce((r,n)=>n===void 0?r:[...r,n],[])}}var AQe=v(()=>{yd()});function rlr(){return{not:{}}}var IQe=v(()=>{});function nlr(){return{}}var NQe=v(()=>{});var olr,jQe=v(()=>{yd();olr=(t,e)=>hn(t.innerType._def,e)});function hn(t,e,r=!1){let n=e.seen.get(t);if(e.override){let a=e.override?.(t,e,n,r);if(a!==Tur)return a}if(n&&!r){let a=zQn(n,e);if(a!==void 0)return"$ref"in a&&e.seenRefs.add(a.$ref),a}let o={def:t,path:e.currentPath,jsonSchema:void 0};e.seen.set(t,o);let i=VQn(t,t.typeName,e,r);return i&&JQn(t,e,i),o.jsonSchema=i,i}var zQn,HQn,VQn,JQn,yd=v(()=>{yO();aQe();sQe();uQe();lQe();cQe();dQe();pQe();mQe();hQe();gQe();yQe();bQe();vQe();wQe();SQe();CQe();xQe();OQe();TQe();EQe();PQe();MQe();Q0e();RQe();X0e();AQe();IQe();eCe();NQe();jQe();G0e();zQn=(t,e)=>{switch(e.$refStrategy){case"root":return{$ref:t.path.join("/")};case"extract-to-root":let r=t.path.slice(e.basePath.length+1).join("_");return r!==e.name&&e.nameStrategy==="duplicate-ref"&&(e.definitions[r]=t.def),{$ref:[...e.basePath,e.definitionPath,r].join("/")};case"relative":return{$ref:HQn(e.currentPath,t.path)};case"none":case"seen":return t.path.lengthe.currentPath[o]===n)?(console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`),{}):e.$refStrategy==="seen"?{}:void 0}},HQn=(t,e)=>{let r=0;for(;r{switch(e){case Me.ZodString:return Z0e(t,r);case Me.ZodNumber:return Gur(t,r);case Me.ZodObject:return Zur(t,r);case Me.ZodBigInt:return Iur(t,r);case Me.ZodBoolean:return Nur();case Me.ZodDate:return fQe(t,r);case Me.ZodUndefined:return rlr();case Me.ZodNull:return Vur(r);case Me.ZodArray:return Aur(t,r);case Me.ZodUnion:case Me.ZodDiscriminatedUnion:return Kur(t,r);case Me.ZodIntersection:return kur(t,r);case Me.ZodTuple:return tlr(t,r);case Me.ZodRecord:return Y0e(t,r);case Me.ZodLiteral:return qur(t,r);case Me.ZodEnum:return Fur(t);case Me.ZodNativeEnum:return zur(t);case Me.ZodNullable:return Wur(t,r);case Me.ZodOptional:return Xur(t,r);case Me.ZodMap:return Uur(t,r);case Me.ZodSet:return elr(t,r);case Me.ZodLazy:return hn(t.getter()._def,r);case Me.ZodPromise:return Qur(t,r);case Me.ZodNaN:case Me.ZodNever:return Hur();case Me.ZodEffects:return Lur(t,r,n);case Me.ZodAny:return Rur();case Me.ZodUnknown:return nlr();case Me.ZodDefault:return $ur(t,r);case Me.ZodBranded:return jur(t,r);case Me.ZodReadonly:return olr(t,r);case Me.ZodCatch:return Dur(t,r);case Me.ZodPipeline:return Yur(t,r);case Me.ZodFunction:case Me.ZodVoid:case Me.ZodSymbol:return;default:return(o=>{})(e)}},JQn=(t,e,r)=>(t.description&&(r.description=t.description,e.markdownDescription&&(r.markdownDescription=t.description)),r)});var DQe,$Qe=v(()=>{yd();oQe();nQe();DQe=(t,e)=>{let r=Mur(e),n=typeof e=="string"?e:e?.nameStrategy==="title"?void 0:e?.name,o=hn(t._def,n===void 0?r:{...r,currentPath:[...r.basePath,r.definitionPath,n]},!1)??{},i=typeof e=="object"&&e.name!==void 0&&e.nameStrategy==="title"?e.name:void 0;i!==void 0&&(o.title=i);let a=(()=>{if(Pur(r.definitions))return;let u={},l=new Set;for(let c=0;c<500;c++){let d=Object.entries(r.definitions).filter(([f])=>!l.has(f));if(d.length===0)break;for(let[f,p]of d)u[f]=hn(xoe(p),{...r,currentPath:[...r.basePath,r.definitionPath,f]},!0)??{},l.add(f)}return u})(),s=n===void 0?a?{...o,[r.definitionPath]:a}:o:r.nameStrategy==="duplicate-ref"?{...o,...a||r.seenRefs.size?{[r.definitionPath]:{...a,...r.seenRefs.size?{[n]:o}:void 0}}:void 0}:{$ref:[...r.$refStrategy==="relative"?[]:r.basePath,r.definitionPath,n].join("/"),[r.definitionPath]:{...a,[n]:o}};return r.target==="jsonSchema7"?s.$schema="http://json-schema.org/draft-07/schema#":r.target==="jsonSchema2019-09"&&(s.$schema="https://json-schema.org/draft/2019-09/schema#"),s}});var ilr=v(()=>{G0e();oQe();ok();yd();aQe();sQe();uQe();lQe();cQe();dQe();pQe();mQe();hQe();gQe();yQe();bQe();vQe();wQe();SQe();CQe();xQe();OQe();TQe();EQe();PQe();MQe();jQe();Q0e();RQe();X0e();AQe();IQe();eCe();NQe();$Qe();$Qe()});function alr(t,e){return!e||!WQn(e)?{...t,output_parsed:null,output:t.output.map(r=>r.type==="function_call"?{...r,parsed_arguments:null}:r.type==="message"?{...r,content:r.content.map(n=>({...n,parsed:null}))}:r)}:LQe(t,e)}function LQe(t,e){let r=t.output.map(o=>{if(o.type==="function_call")return{...o,parsed_arguments:XQn(e,o)};if(o.type==="message"){let i=o.content.map(a=>a.type==="output_text"?{...a,parsed:KQn(e,a.text)}:a);return{...o,content:i}}return o}),n=Object.assign({},t,{output:r});return Object.getOwnPropertyDescriptor(t,"output_text")||tCe(n),Object.defineProperty(n,"output_parsed",{enumerable:!0,get(){for(let o of n.output)if(o.type==="message"){for(let i of o.content)if(i.type==="output_text"&&i.parsed!==null)return i.parsed}return null}}),n}function KQn(t,e){return t.text?.format?.type!=="json_schema"?null:"$parseRaw"in t.text?.format?(t.text?.format).$parseRaw(e):JSON.parse(e)}function WQn(t){return!!Soe(t.text?.format)}function GQn(t){return t?.$brand==="auto-parseable-tool"}function ZQn(t,e){return t.find(r=>r.type==="function"&&r.name===e)}function XQn(t,e){let r=ZQn(t.tools??[],e.name);return{...e,...e,parsed_arguments:GQn(r)?r.$parseRaw(e.arguments):r?.strict?JSON.parse(e.arguments):null}}function tCe(t){let e=[];for(let r of t.output)if(r.type==="message")for(let n of r.content)n.type==="output_text"&&e.push(n.text);t.output_text=e.join("")}var rCe=v(()=>{RC();KW()});function YQn(t,e){return DQe(t,{openaiStrictMode:!0,name:e.name,nameStrategy:"duplicate-ref",$refStrategy:"extract-to-root",nullableStrategy:"property"})}function slr(t,e,r){return vur({type:"json_schema",json_schema:{...r,name:e,strict:!0,schema:YQn(t,{name:e})}},n=>t.parse(JSON.parse(n)))}var ulr=v(()=>{KW();ilr();rCe()});function clr(t,e){if(typeof e<"u"&&!llr.includes(e))throw new Error(`Invalid method: ${e}. Supported methods are: ${llr.join(", ")}`);let r=!t.startsWith("gpt-3")&&!t.startsWith("gpt-4-")&&t!=="gpt-4";if(r&&!e)return"jsonSchema";if(!r&&e==="jsonSchema")throw new Error(`JSON Schema is not supported for model "${t}". Please use a different method, e.g. "functionCalling" or "jsonMode".`);return e??"functionCalling"}function QQn(t,e){let r={...t};return Object.defineProperties(r,{$brand:{value:"auto-parseable-response-format",enumerable:!1},$parseRaw:{value:e,enumerable:!1}}),r}function dlr(t,e,r){if(Xl(t))return slr(t,e,r);if(el(t))return QQn({type:"json_schema",json_schema:{...r,name:e,strict:!0,schema:Y$(t,{cycles:"ref",reused:"ref",override(n){n.jsonSchema.title=e}})}},n=>pO(t,JSON.parse(n)));throw new Error("Unsupported schema response format")}function flr(t,e){if(e&&typeof e=="object"&&"images"in e&&Array.isArray(e.images)){let r=e.images.filter(n=>typeof n?.image_url?.url=="string").map(n=>({type:"image",url:n.image_url.url}));return[{type:"text",text:t},...r]}return t}function FQe(t){let e={...t?.input_tokens_details?.cached_tokens!=null&&{cache_read:t?.input_tokens_details?.cached_tokens}},r={...t?.output_tokens_details?.reasoning_tokens!=null&&{reasoning:t?.output_tokens_details?.reasoning_tokens}};return{input_tokens:t?.input_tokens??0,output_tokens:t?.output_tokens??0,total_tokens:t?.total_tokens??0,input_token_details:e,output_token_details:r}}var llr,nCe=v(()=>{Zv();ey();ulr();llr=["jsonSchema","functionCalling","jsonMode"]});function Fr(t,e,r,n,o){if(n==="m")throw new TypeError("Private method is not writable");if(n==="a"&&!o)throw new TypeError("Private accessor was defined without a setter");if(typeof e=="function"?t!==e||!o:!e.has(t))throw new TypeError("Cannot write private member to an object whose class did not declare it");return n==="a"?o.call(t,r):o?o.value=r:e.set(t,r),r}function Ce(t,e,r,n){if(r==="a"&&!n)throw new TypeError("Private accessor was defined without a getter");if(typeof e=="function"?t!==e||!n:!e.has(t))throw new TypeError("Cannot read private member from an object whose class did not declare it");return r==="m"?n:r==="a"?n.call(t):n?n.value:e.get(t)}var AS=v(()=>{});var kQe,qQe=v(()=>{kQe=function(){let{crypto:t}=globalThis;if(t?.randomUUID)return kQe=t.randomUUID.bind(t),t.randomUUID();let e=new Uint8Array(1),r=t?()=>t.getRandomValues(e)[0]:()=>Math.random()*255&255;return"10000000-1000-4000-8000-100000000000".replace(/[018]/g,n=>(+n^r()&15>>+n/4).toString(16))}});function UQe(t){return typeof t!="object"?{}:t??{}}function mlr(t){if(!t)return!0;for(let e in t)return!1;return!0}function hlr(t,e){return Object.prototype.hasOwnProperty.call(t,e)}function WW(t){return t!=null&&typeof t=="object"&&!Array.isArray(t)}var eeo,plr,Oy,BQe,glr,ylr,N1=v(()=>{pA();eeo=/^[a-z][a-z0-9+.-]*:/i,plr=t=>eeo.test(t),Oy=t=>(Oy=Array.isArray,Oy(t)),BQe=Oy;glr=(t,e)=>{if(typeof e!="number"||!Number.isInteger(e))throw new Ft(`${t} must be an integer`);if(e<0)throw new Ft(`${t} must be a positive integer`);return e},ylr=t=>{try{return JSON.parse(t)}catch{return}}});var mA,GW=v(()=>{mA=t=>new Promise(e=>setTimeout(e,t))});var ik,zQe=v(()=>{ik="6.5.0"});function teo(){return typeof Deno<"u"&&Deno.build!=null?"deno":typeof EdgeRuntime<"u"?"edge":Object.prototype.toString.call(typeof globalThis.process<"u"?globalThis.process:0)==="[object process]"?"node":"unknown"}function neo(){if(typeof navigator>"u"||!navigator)return null;let t=[{key:"edge",pattern:/Edge(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/MSIE(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"ie",pattern:/Trident(?:.*rv\:(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"chrome",pattern:/Chrome(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"firefox",pattern:/Firefox(?:\W+(\d+)\.(\d+)(?:\.(\d+))?)?/},{key:"safari",pattern:/(?:Version\W+(\d+)\.(\d+)(?:\.(\d+))?)?(?:\W+Mobile\S*)?\W+Safari/}];for(let{key:e,pattern:r}of t){let n=r.exec(navigator.userAgent);if(n){let o=n[1]||0,i=n[2]||0,a=n[3]||0;return{browser:e,version:`${o}.${i}.${a}`}}}return null}var wlr,reo,blr,_lr,vlr,Slr,HQe=v(()=>{zQe();wlr=()=>typeof window<"u"&&typeof window.document<"u"&&typeof navigator<"u";reo=()=>{let t=teo();if(t==="deno")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ik,"X-Stainless-OS":_lr(Deno.build.os),"X-Stainless-Arch":blr(Deno.build.arch),"X-Stainless-Runtime":"deno","X-Stainless-Runtime-Version":typeof Deno.version=="string"?Deno.version:Deno.version?.deno??"unknown"};if(typeof EdgeRuntime<"u")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ik,"X-Stainless-OS":"Unknown","X-Stainless-Arch":`other:${EdgeRuntime}`,"X-Stainless-Runtime":"edge","X-Stainless-Runtime-Version":globalThis.process.version};if(t==="node")return{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ik,"X-Stainless-OS":_lr(globalThis.process.platform??"unknown"),"X-Stainless-Arch":blr(globalThis.process.arch??"unknown"),"X-Stainless-Runtime":"node","X-Stainless-Runtime-Version":globalThis.process.version??"unknown"};let e=neo();return e?{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ik,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":`browser:${e.browser}`,"X-Stainless-Runtime-Version":e.version}:{"X-Stainless-Lang":"js","X-Stainless-Package-Version":ik,"X-Stainless-OS":"Unknown","X-Stainless-Arch":"unknown","X-Stainless-Runtime":"unknown","X-Stainless-Runtime-Version":"unknown"}};blr=t=>t==="x32"?"x32":t==="x86_64"||t==="x64"?"x64":t==="arm"?"arm":t==="aarch64"||t==="arm64"?"arm64":t?`other:${t}`:"unknown",_lr=t=>(t=t.toLowerCase(),t.includes("ios")?"iOS":t==="android"?"Android":t==="darwin"?"MacOS":t==="win32"?"Windows":t==="freebsd"?"FreeBSD":t==="openbsd"?"OpenBSD":t==="linux"?"Linux":t?`Other:${t}`:"Unknown"),Slr=()=>vlr??(vlr=reo())});function Clr(){if(typeof fetch<"u")return fetch;throw new Error("`fetch` is not defined as a global; Either pass `fetch` to the client, `new OpenAI({ fetch })` or polyfill the global, `globalThis.fetch = fetch`")}function VQe(...t){let e=globalThis.ReadableStream;if(typeof e>"u")throw new Error("`ReadableStream` is not defined as a global; You will need to polyfill it, `globalThis.ReadableStream = ReadableStream`");return new e(...t)}function oCe(t){let e=Symbol.asyncIterator in t?t[Symbol.asyncIterator]():t[Symbol.iterator]();return VQe({start(){},async pull(r){let{done:n,value:o}=await e.next();n?r.close():r.enqueue(o)},async cancel(){await e.return?.()}})}function JQe(t){if(t[Symbol.asyncIterator])return t;let e=t.getReader();return{async next(){try{let r=await e.read();return r?.done&&e.releaseLock(),r}catch(r){throw e.releaseLock(),r}},async return(){let r=e.cancel();return e.releaseLock(),await r,{done:!0,value:void 0}},[Symbol.asyncIterator](){return this}}}async function xlr(t){if(t===null||typeof t!="object")return;if(t[Symbol.asyncIterator]){await t[Symbol.asyncIterator]().return?.();return}let e=t.getReader(),r=e.cancel();e.releaseLock(),await r}var Toe=v(()=>{});var Olr,Tlr=v(()=>{Olr=({headers:t,body:e})=>({bodyHeaders:{"content-type":"application/json"},body:JSON.stringify(e)})});var iCe,KQe,aCe,WQe,sCe=v(()=>{iCe="RFC3986",KQe=t=>String(t),aCe={RFC1738:t=>String(t).replace(/%20/g,"+"),RFC3986:KQe},WQe="RFC1738"});function Plr(t){return!t||typeof t!="object"?!1:!!(t.constructor&&t.constructor.isBuffer&&t.constructor.isBuffer(t))}function ZQe(t,e){if(Oy(t)){let r=[];for(let n=0;n{sCe();N1();uCe=(t,e)=>(uCe=Object.hasOwn??Function.prototype.call.bind(Object.prototype.hasOwnProperty),uCe(t,e)),hA=(()=>{let t=[];for(let e=0;e<256;++e)t.push("%"+((e<16?"0":"")+e.toString(16)).toUpperCase());return t})(),GQe=1024,Elr=(t,e,r,n,o)=>{if(t.length===0)return t;let i=t;if(typeof t=="symbol"?i=Symbol.prototype.toString.call(t):typeof t!="string"&&(i=String(t)),r==="iso-8859-1")return escape(i).replace(/%u[0-9a-f]{4}/gi,function(s){return"%26%23"+parseInt(s.slice(2),16)+"%3B"});let a="";for(let s=0;s=GQe?i.slice(s,s+GQe):i,l=[];for(let c=0;c=48&&d<=57||d>=65&&d<=90||d>=97&&d<=122||o===WQe&&(d===40||d===41)){l[l.length]=u.charAt(c);continue}if(d<128){l[l.length]=hA[d];continue}if(d<2048){l[l.length]=hA[192|d>>6]+hA[128|d&63];continue}if(d<55296||d>=57344){l[l.length]=hA[224|d>>12]+hA[128|d>>6&63]+hA[128|d&63];continue}c+=1,d=65536+((d&1023)<<10|u.charCodeAt(c)&1023),l[l.length]=hA[240|d>>18]+hA[128|d>>12&63]+hA[128|d>>6&63]+hA[128|d&63]}a+=l.join("")}return a}});function aeo(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t=="symbol"||typeof t=="bigint"}function Nlr(t,e,r,n,o,i,a,s,u,l,c,d,f,p,m,h,g,y){let b=t,_=y,w=0,x=!1;for(;(_=_.get(XQe))!==void 0&&!x;){let I=_.get(t);if(w+=1,typeof I<"u"){if(I===w)throw new RangeError("Cyclic object value");x=!0}typeof _.get(XQe)>"u"&&(w=0)}if(typeof l=="function"?b=l(e,b):b instanceof Date?b=f?.(b):r==="comma"&&Oy(b)&&(b=ZQe(b,function(I){return I instanceof Date?f?.(I):I})),b===null){if(i)return u&&!h?u(e,Im.encoder,g,"key",p):e;b=""}if(aeo(b)||Plr(b)){if(u){let I=h?e:u(e,Im.encoder,g,"key",p);return[m?.(I)+"="+m?.(u(b,Im.encoder,g,"value",p))]}return[m?.(e)+"="+m?.(String(b))]}let O=[];if(typeof b>"u")return O;let E;if(r==="comma"&&Oy(b))h&&u&&(b=ZQe(b,u)),E=[{value:b.length>0?b.join(",")||null:void 0}];else if(Oy(l))E=l;else{let I=Object.keys(b);E=c?I.sort(c):I}let T=s?String(e).replace(/\./g,"%2E"):String(e),R=n&&Oy(b)&&b.length===1?T+"[]":T;if(o&&Oy(b)&&b.length===0)return R+"[]";for(let I=0;I"u"?t.encodeDotInKeys?!0:Im.allowDots:!!t.allowDots;return{addQueryPrefix:typeof t.addQueryPrefix=="boolean"?t.addQueryPrefix:Im.addQueryPrefix,allowDots:a,allowEmptyArrays:typeof t.allowEmptyArrays=="boolean"?!!t.allowEmptyArrays:Im.allowEmptyArrays,arrayFormat:i,charset:e,charsetSentinel:typeof t.charsetSentinel=="boolean"?t.charsetSentinel:Im.charsetSentinel,commaRoundTrip:!!t.commaRoundTrip,delimiter:typeof t.delimiter>"u"?Im.delimiter:t.delimiter,encode:typeof t.encode=="boolean"?t.encode:Im.encode,encodeDotInKeys:typeof t.encodeDotInKeys=="boolean"?t.encodeDotInKeys:Im.encodeDotInKeys,encoder:typeof t.encoder=="function"?t.encoder:Im.encoder,encodeValuesOnly:typeof t.encodeValuesOnly=="boolean"?t.encodeValuesOnly:Im.encodeValuesOnly,filter:o,format:r,formatter:n,serializeDate:typeof t.serializeDate=="function"?t.serializeDate:Im.serializeDate,skipNulls:typeof t.skipNulls=="boolean"?t.skipNulls:Im.skipNulls,sort:typeof t.sort=="function"?t.sort:null,strictNullHandling:typeof t.strictNullHandling=="boolean"?t.strictNullHandling:Im.strictNullHandling}}function YQe(t,e={}){let r=t,n=seo(e),o,i;typeof n.filter=="function"?(i=n.filter,r=i("",r)):Oy(n.filter)&&(i=n.filter,o=i);let a=[];if(typeof r!="object"||r===null)return"";let s=Alr[n.arrayFormat],u=s==="comma"&&n.commaRoundTrip;o||(o=Object.keys(r)),n.sort&&o.sort(n.sort);let l=new WeakMap;for(let f=0;f0?d+c:""}var Alr,Ilr,Rlr,Im,XQe,jlr=v(()=>{Mlr();sCe();N1();Alr={brackets(t){return String(t)+"[]"},comma:"comma",indices(t,e){return String(t)+"["+e+"]"},repeat(t){return String(t)}},Ilr=function(t,e){Array.prototype.push.apply(t,Oy(e)?e:[e])},Im={addQueryPrefix:!1,allowDots:!1,allowEmptyArrays:!1,arrayFormat:"indices",charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encodeDotInKeys:!1,encoder:Elr,encodeValuesOnly:!1,format:iCe,formatter:KQe,indices:!1,serializeDate(t){return(Rlr??(Rlr=Function.prototype.call.bind(Date.prototype.toISOString)))(t)},skipNulls:!1,strictNullHandling:!1};XQe={}});var Dlr=v(()=>{sCe();jlr()});function Flr(t){let e=0;for(let o of t)e+=o.length;let r=new Uint8Array(e),n=0;for(let o of t)r.set(o,n),n+=o.length;return r}function ZW(t){let e;return($lr??(e=new globalThis.TextEncoder,$lr=e.encode.bind(e)))(t)}function QQe(t){let e;return(Llr??(e=new globalThis.TextDecoder,Llr=e.decode.bind(e)))(t)}var $lr,Llr,lCe=v(()=>{});function leo(t,e){for(let o=e??0;o{AS();lCe();q2=class{constructor(){Xv.set(this,void 0),Yv.set(this,void 0),Fr(this,Xv,new Uint8Array,"f"),Fr(this,Yv,null,"f")}decode(e){if(e==null)return[];let r=e instanceof ArrayBuffer?new Uint8Array(e):typeof e=="string"?ZW(e):e;Fr(this,Xv,Flr([Ce(this,Xv,"f"),r]),"f");let n=[],o;for(;(o=leo(Ce(this,Xv,"f"),Ce(this,Yv,"f")))!=null;){if(o.carriage&&Ce(this,Yv,"f")==null){Fr(this,Yv,o.index,"f");continue}if(Ce(this,Yv,"f")!=null&&(o.index!==Ce(this,Yv,"f")+1||o.carriage)){n.push(QQe(Ce(this,Xv,"f").subarray(0,Ce(this,Yv,"f")-1))),Fr(this,Xv,Ce(this,Xv,"f").subarray(Ce(this,Yv,"f")),"f"),Fr(this,Yv,null,"f");continue}let i=Ce(this,Yv,"f")!==null?o.preceding-1:o.preceding,a=QQe(Ce(this,Xv,"f").subarray(0,i));n.push(a),Fr(this,Xv,Ce(this,Xv,"f").subarray(o.index),"f"),Fr(this,Yv,null,"f")}return n}flush(){return Ce(this,Xv,"f").length?this.decode(` +`):[]}};Xv=new WeakMap,Yv=new WeakMap;q2.NEWLINE_CHARS=new Set([` +`,"\r"]);q2.NEWLINE_REGEXP=/\r\n|[\n\r]/g});function Eoe(){}function cCe(t,e,r){return!e||dCe[t]>dCe[r]?Eoe:e[t].bind(e)}function Qc(t){let e=t.logger,r=t.logLevel??"off";if(!e)return ceo;let n=Blr.get(e);if(n&&n[0]===r)return n[1];let o={error:cCe("error",e,r),warn:cCe("warn",e,r),info:cCe("info",e,r),debug:cCe("debug",e,r)};return Blr.set(e,[r,o]),o}var dCe,eet,ceo,Blr,j1,Poe=v(()=>{N1();dCe={off:0,error:200,warn:300,info:400,debug:500},eet=(t,e,r)=>{if(t){if(hlr(dCe,t))return t;Qc(r).warn(`${e} was set to ${JSON.stringify(t)}, expected one of ${JSON.stringify(Object.keys(dCe))}`)}};ceo={error:Eoe,warn:Eoe,info:Eoe,debug:Eoe},Blr=new WeakMap;j1=t=>(t.options&&(t.options={...t.options},delete t.options.headers),t.headers&&(t.headers=Object.fromEntries((t.headers instanceof Headers?[...t.headers]:Object.entries(t.headers)).map(([e,r])=>[e,e.toLowerCase()==="authorization"||e.toLowerCase()==="cookie"||e.toLowerCase()==="set-cookie"?"***":r]))),"retryOfRequestLogID"in t&&(t.retryOfRequestLogID&&(t.retryOf=t.retryOfRequestLogID),delete t.retryOfRequestLogID),t)});async function*deo(t,e){if(!t.body)throw e.abort(),typeof globalThis.navigator<"u"&&globalThis.navigator.product==="ReactNative"?new Ft("The default react-native fetch implementation does not support streaming. Please use expo/fetch: https://docs.expo.dev/versions/latest/sdk/expo/#expofetch-api"):new Ft("Attempted to iterate over a response with no body");let r=new tet,n=new q2,o=JQe(t.body);for await(let i of feo(o))for(let a of n.decode(i)){let s=r.decode(a);s&&(yield s)}for(let i of n.flush()){let a=r.decode(i);a&&(yield a)}}async function*feo(t){let e=new Uint8Array;for await(let r of t){if(r==null)continue;let n=r instanceof ArrayBuffer?new Uint8Array(r):typeof r=="string"?ZW(r):r,o=new Uint8Array(e.length+n.length);o.set(e),o.set(n,e.length),e=o;let i;for(;(i=klr(e))!==-1;)yield e.slice(0,i),e=e.slice(i)}e.length>0&&(yield e)}function peo(t,e){let r=t.indexOf(e);return r!==-1?[t.substring(0,r),e,t.substring(r+e.length)]:[t,"",""]}var Moe,gA,tet,ret=v(()=>{AS();pA();Toe();qlr();Toe();W0e();lCe();Poe();pA();gA=class t{constructor(e,r,n){this.iterator=e,Moe.set(this,void 0),this.controller=r,Fr(this,Moe,n,"f")}static fromSSEResponse(e,r,n){let o=!1,i=n?Qc(n):console;async function*a(){if(o)throw new Ft("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let s=!1;try{for await(let u of deo(e,r))if(!s){if(u.data.startsWith("[DONE]")){s=!0;continue}if(u.event===null||!u.event.startsWith("thread.")){let l;try{l=JSON.parse(u.data)}catch(c){throw i.error("Could not parse message into JSON:",u.data),i.error("From chunk:",u.raw),c}if(l&&l.error)throw new Am(void 0,l.error,void 0,e.headers);yield l}else{let l;try{l=JSON.parse(u.data)}catch(c){throw console.error("Could not parse message into JSON:",u.data),console.error("From chunk:",u.raw),c}if(u.event=="error")throw new Am(void 0,l.error,l.message,void 0);yield{event:u.event,data:l}}}s=!0}catch(u){if(_oe(u))return;throw u}finally{s||r.abort()}}return new t(a,r,n)}static fromReadableStream(e,r,n){let o=!1;async function*i(){let s=new q2,u=JQe(e);for await(let l of u)for(let c of s.decode(l))yield c;for(let l of s.flush())yield l}async function*a(){if(o)throw new Ft("Cannot iterate over a consumed stream, use `.tee()` to split the stream.");o=!0;let s=!1;try{for await(let u of i())s||u&&(yield JSON.parse(u));s=!0}catch(u){if(_oe(u))return;throw u}finally{s||r.abort()}}return new t(a,r,n)}[(Moe=new WeakMap,Symbol.asyncIterator)](){return this.iterator()}tee(){let e=[],r=[],n=this.iterator(),o=i=>({next:()=>{if(i.length===0){let a=n.next();e.push(a),r.push(a)}return i.shift()}});return[new t(()=>o(e),this.controller,Ce(this,Moe,"f")),new t(()=>o(r),this.controller,Ce(this,Moe,"f"))]}toReadableStream(){let e=this,r;return VQe({async start(){r=e[Symbol.asyncIterator]()},async pull(n){try{let{value:o,done:i}=await r.next();if(i)return n.close();let a=ZW(JSON.stringify(o)+` +`);n.enqueue(a)}catch(o){n.error(o)}},async cancel(){await r.return?.()}})}};tet=class{constructor(){this.event=null,this.data=[],this.chunks=[]}decode(e){if(e.endsWith("\r")&&(e=e.substring(0,e.length-1)),!e){if(!this.event&&!this.data.length)return null;let i={event:this.event,data:this.data.join(` +`),raw:this.chunks};return this.event=null,this.data=[],this.chunks=[],i}if(this.chunks.push(e),e.startsWith(":"))return null;let[r,n,o]=peo(e,":");return o.startsWith(" ")&&(o=o.substring(1)),r==="event"?this.event=o:r==="data"&&this.data.push(o),null}}});async function fCe(t,e){let{response:r,requestLogID:n,retryOfRequestLogID:o,startTime:i}=e,a=await(async()=>{if(e.options.stream)return Qc(t).debug("response",r.status,r.url,r.headers,r.body),e.options.__streamClass?e.options.__streamClass.fromSSEResponse(r,e.controller,t):gA.fromSSEResponse(r,e.controller,t);if(r.status===204)return null;if(e.options.__binaryResponse)return r;let u=r.headers.get("content-type")?.split(";")[0]?.trim();if(u?.includes("application/json")||u?.endsWith("+json")){let d=await r.json();return net(d,r)}return await r.text()})();return Qc(t).debug(`[${n}] response parsed`,j1({retryOfRequestLogID:o,url:r.url,status:r.status,body:a,durationMs:Date.now()-i})),a}function net(t,e){return!t||typeof t!="object"||Array.isArray(t)?t:Object.defineProperty(t,"_request_id",{value:e.headers.get("x-request-id"),enumerable:!1})}var oet=v(()=>{ret();Poe()});var Roe,B2,pCe=v(()=>{AS();oet();B2=class t extends Promise{constructor(e,r,n=fCe){super(o=>{o(null)}),this.responsePromise=r,this.parseResponse=n,Roe.set(this,void 0),Fr(this,Roe,e,"f")}_thenUnwrap(e){return new t(Ce(this,Roe,"f"),this.responsePromise,async(r,n)=>net(e(await this.parseResponse(r,n),n),n.response))}asResponse(){return this.responsePromise.then(e=>e.response)}async withResponse(){let[e,r]=await Promise.all([this.parse(),this.asResponse()]);return{data:e,response:r,request_id:r.headers.get("x-request-id")}}parse(){return this.parsedPromise||(this.parsedPromise=this.responsePromise.then(e=>this.parseResponse(Ce(this,Roe,"f"),e))),this.parsedPromise}then(e,r){return this.parse().then(e,r)}catch(e){return this.parse().catch(e)}finally(e){return this.parse().finally(e)}};Roe=new WeakMap});var mCe,Aoe,Ioe,yA,Go,D1,xu=v(()=>{AS();pA();oet();pCe();N1();Aoe=class{constructor(e,r,n,o){mCe.set(this,void 0),Fr(this,mCe,e,"f"),this.options=o,this.response=r,this.body=n}hasNextPage(){return this.getPaginatedItems().length?this.nextPageRequestOptions()!=null:!1}async getNextPage(){let e=this.nextPageRequestOptions();if(!e)throw new Ft("No next page expected; please check `.hasNextPage()` before calling `.getNextPage()`.");return await Ce(this,mCe,"f").requestAPIList(this.constructor,e)}async*iterPages(){let e=this;for(yield e;e.hasNextPage();)e=await e.getNextPage(),yield e}async*[(mCe=new WeakMap,Symbol.asyncIterator)](){for await(let e of this.iterPages())for(let r of e.getPaginatedItems())yield r}},Ioe=class extends B2{constructor(e,r,n){super(e,r,async(o,i)=>new n(o,i.response,await fCe(o,i),i.options))}async*[Symbol.asyncIterator](){let e=await this;for await(let r of e)yield r}},yA=class extends Aoe{constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.object=n.object}getPaginatedItems(){return this.data??[]}nextPageRequestOptions(){return null}},Go=class extends Aoe{constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.has_more=n.has_more||!1}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){let e=this.getPaginatedItems(),r=e[e.length-1]?.id;return r?{...this.options,query:{...UQe(this.options.query),after:r}}:null}},D1=class extends Aoe{constructor(e,r,n,o){super(e,r,n,o),this.data=n.data||[],this.has_more=n.has_more||!1,this.last_id=n.last_id||""}getPaginatedItems(){return this.data??[]}hasNextPage(){return this.has_more===!1?!1:super.hasNextPage()}nextPageRequestOptions(){let e=this.last_id;return e?{...this.options,query:{...UQe(this.options.query),after:e}}:null}}});function XW(t,e,r){return set(),new File(t,e??"unknown_file",r)}function Noe(t){return(typeof t=="object"&&t!==null&&("name"in t&&t.name&&String(t.name)||"url"in t&&t.url&&String(t.url)||"filename"in t&&t.filename&&String(t.filename)||"path"in t&&t.path&&String(t.path))||"").split(/[\\/]/).pop()||void 0}function heo(t){let e=typeof t=="function"?t:t.fetch,r=Ulr.get(e);if(r)return r;let n=(async()=>{try{let o="Response"in e?e.Response:(await e("data:,")).constructor,i=new FormData;return i.toString()!==await new o(i).text()}catch{return!0}})();return Ulr.set(e,n),n}var set,hCe,uet,Qv,Ulr,zlr,Hlr,geo,iet,aet,bA=v(()=>{Toe();set=()=>{if(typeof File>"u"){let{process:t}=globalThis,e=typeof t?.versions?.node=="string"&&parseInt(t.versions.node.split("."))<20;throw new Error("`File` is not defined as a global, which is required for file uploads."+(e?" Update to Node 20 LTS or newer, or set `globalThis.File` to `import('node:buffer').File`.":""))}};hCe=t=>t!=null&&typeof t=="object"&&typeof t[Symbol.asyncIterator]=="function",uet=async(t,e)=>iet(t.body)?{...t,body:await zlr(t.body,e)}:t,Qv=async(t,e)=>({...t,body:await zlr(t.body,e)}),Ulr=new WeakMap;zlr=async(t,e)=>{if(!await heo(e))throw new TypeError("The provided fetch function does not support file uploads with the current global FormData class.");let r=new FormData;return await Promise.all(Object.entries(t||{}).map(([n,o])=>aet(r,n,o))),r},Hlr=t=>t instanceof Blob&&"name"in t,geo=t=>typeof t=="object"&&t!==null&&(t instanceof Response||hCe(t)||Hlr(t)),iet=t=>{if(geo(t))return!0;if(Array.isArray(t))return t.some(iet);if(t&&typeof t=="object"){for(let e in t)if(iet(t[e]))return!0}return!1},aet=async(t,e,r)=>{if(r!==void 0){if(r==null)throw new TypeError(`Received null for "${e}"; to pass null in FormData, you must use the string 'null'`);if(typeof r=="string"||typeof r=="number"||typeof r=="boolean")t.append(e,String(r));else if(r instanceof Response)t.append(e,XW([await r.blob()],Noe(r)));else if(hCe(r))t.append(e,XW([await new Response(oCe(r)).blob()],Noe(r)));else if(Hlr(r))t.append(e,r,Noe(r));else if(Array.isArray(r))await Promise.all(r.map(n=>aet(t,e+"[]",n)));else if(typeof r=="object")await Promise.all(Object.entries(r).map(([n,o])=>aet(t,`${e}[${n}]`,o)));else throw new TypeError(`Invalid value given to form, expected a string, number, boolean, object, Array, File or Blob but got ${r} instead`)}}});async function joe(t,e,r){if(set(),t=await t,yeo(t))return t instanceof File?t:XW([await t.arrayBuffer()],t.name);if(beo(t)){let o=await t.blob();return e||(e=new URL(t.url).pathname.split(/[\\/]/).pop()),XW(await cet(o),e,r)}let n=await cet(t);if(e||(e=Noe(t)),!r?.type){let o=n.find(i=>typeof i=="object"&&"type"in i&&i.type);typeof o=="string"&&(r={...r,type:o})}return XW(n,e,r)}async function cet(t){let e=[];if(typeof t=="string"||ArrayBuffer.isView(t)||t instanceof ArrayBuffer)e.push(t);else if(Vlr(t))e.push(t instanceof Blob?t:await t.arrayBuffer());else if(hCe(t))for await(let r of t)e.push(...await cet(r));else{let r=t?.constructor?.name;throw new Error(`Unexpected data type: ${typeof t}${r?`; constructor: ${r}`:""}${_eo(t)}`)}return e}function _eo(t){return typeof t!="object"||t===null?"":`; props: [${Object.getOwnPropertyNames(t).map(r=>`"${r}"`).join(", ")}]`}var Vlr,yeo,beo,Jlr=v(()=>{bA();bA();Vlr=t=>t!=null&&typeof t=="object"&&typeof t.size=="number"&&typeof t.type=="string"&&typeof t.text=="function"&&typeof t.slice=="function"&&typeof t.arrayBuffer=="function",yeo=t=>t!=null&&typeof t=="object"&&typeof t.name=="string"&&typeof t.lastModified=="number"&&Vlr(t),beo=t=>t!=null&&typeof t=="object"&&typeof t.url=="string"&&typeof t.blob=="function"});var det=v(()=>{Jlr()});var qe,kr=v(()=>{qe=class{constructor(e){this._client=e}}});function Wlr(t){return t.replace(/[^A-Za-z0-9\-._~!$&'()*+,;=:@]+/g,encodeURIComponent)}var Klr,weo,Ne,Ya=v(()=>{pA();Klr=Object.freeze(Object.create(null)),weo=(t=Wlr)=>function(r,...n){if(r.length===1)return r[0];let o=!1,i=[],a=r.reduce((c,d,f)=>{/[?#]/.test(d)&&(o=!0);let p=n[f],m=(o?encodeURIComponent:t)(""+p);return f!==n.length&&(p==null||typeof p=="object"&&p.toString===Object.getPrototypeOf(Object.getPrototypeOf(p.hasOwnProperty??Klr)??Klr)?.toString)&&(m=p+"",i.push({start:c.length+d.length,length:m.length,error:`Value of type ${Object.prototype.toString.call(p).slice(8,-1)} is not a valid path parameter`})),c+d+(f===n.length?"":m)},""),s=a.split(/[?#]/,1)[0],u=/(?<=^|\/)(?:\.|%2e){1,2}(?=\/|$)/gi,l;for(;(l=u.exec(s))!==null;)i.push({start:l.index,length:l[0].length,error:`Value "${l[0]}" can't be safely passed as a path parameter`});if(i.sort((c,d)=>c.start-d.start),i.length>0){let c=0,d=i.reduce((f,p)=>{let m=" ".repeat(p.start-c),h="^".repeat(p.length);return c=p.start+p.length,f+m+h},"");throw new Ft(`Path parameters result in path with invalid segments: +${i.map(f=>f.error).join(` +`)} +${a} +${d}`)}return a},Ne=weo(Wlr)});var U2,gCe=v(()=>{kr();xu();Ya();U2=class extends qe{list(e,r={},n){return this._client.getAPIList(Ne`/chat/completions/${e}/messages`,Go,{query:r,...n})}}});var YW,fet,pet=v(()=>{YW=t=>t?.role==="assistant",fet=t=>t?.role==="tool"});var met,yCe,bCe,Doe,$oe,_Ce,Loe,$1,Foe,vCe,wCe,QW,Glr,ak,SCe=v(()=>{AS();RC();ak=class{constructor(){met.add(this),this.controller=new AbortController,yCe.set(this,void 0),bCe.set(this,()=>{}),Doe.set(this,()=>{}),$oe.set(this,void 0),_Ce.set(this,()=>{}),Loe.set(this,()=>{}),$1.set(this,{}),Foe.set(this,!1),vCe.set(this,!1),wCe.set(this,!1),QW.set(this,!1),Fr(this,yCe,new Promise((e,r)=>{Fr(this,bCe,e,"f"),Fr(this,Doe,r,"f")}),"f"),Fr(this,$oe,new Promise((e,r)=>{Fr(this,_Ce,e,"f"),Fr(this,Loe,r,"f")}),"f"),Ce(this,yCe,"f").catch(()=>{}),Ce(this,$oe,"f").catch(()=>{})}_run(e){setTimeout(()=>{e().then(()=>{this._emitFinal(),this._emit("end")},Ce(this,met,"m",Glr).bind(this))},0)}_connected(){this.ended||(Ce(this,bCe,"f").call(this),this._emit("connect"))}get ended(){return Ce(this,Foe,"f")}get errored(){return Ce(this,vCe,"f")}get aborted(){return Ce(this,wCe,"f")}abort(){this.controller.abort()}on(e,r){return(Ce(this,$1,"f")[e]||(Ce(this,$1,"f")[e]=[])).push({listener:r}),this}off(e,r){let n=Ce(this,$1,"f")[e];if(!n)return this;let o=n.findIndex(i=>i.listener===r);return o>=0&&n.splice(o,1),this}once(e,r){return(Ce(this,$1,"f")[e]||(Ce(this,$1,"f")[e]=[])).push({listener:r,once:!0}),this}emitted(e){return new Promise((r,n)=>{Fr(this,QW,!0,"f"),e!=="error"&&this.once("error",n),this.once(e,r)})}async done(){Fr(this,QW,!0,"f"),await Ce(this,$oe,"f")}_emit(e,...r){if(Ce(this,Foe,"f"))return;e==="end"&&(Fr(this,Foe,!0,"f"),Ce(this,_Ce,"f").call(this));let n=Ce(this,$1,"f")[e];if(n&&(Ce(this,$1,"f")[e]=n.filter(o=>!o.once),n.forEach(({listener:o})=>o(...r))),e==="abort"){let o=r[0];!Ce(this,QW,"f")&&!n?.length&&Promise.reject(o),Ce(this,Doe,"f").call(this,o),Ce(this,Loe,"f").call(this,o),this._emit("end");return}if(e==="error"){let o=r[0];!Ce(this,QW,"f")&&!n?.length&&Promise.reject(o),Ce(this,Doe,"f").call(this,o),Ce(this,Loe,"f").call(this,o),this._emit("end")}}_emitFinal(){}};yCe=new WeakMap,bCe=new WeakMap,Doe=new WeakMap,$oe=new WeakMap,_Ce=new WeakMap,Loe=new WeakMap,$1=new WeakMap,Foe=new WeakMap,vCe=new WeakMap,wCe=new WeakMap,QW=new WeakMap,met=new WeakSet,Glr=function(e){if(Fr(this,vCe,!0,"f"),e instanceof Error&&e.name==="AbortError"&&(e=new Mc),e instanceof Mc)return Fr(this,wCe,!0,"f"),this._emit("abort",e);if(e instanceof Ft)return this._emit("error",e);if(e instanceof Error){let r=new Ft(e.message);return r.cause=e,this._emit("error",r)}return this._emit("error",new Ft(String(e)))}});function Zlr(t){return typeof t.parse=="function"}var het=v(()=>{});var _b,get,CCe,yet,bet,_et,Xlr,Ylr,Ceo,e8,vet=v(()=>{AS();RC();KW();pet();SCe();het();Ceo=10,e8=class extends ak{constructor(){super(...arguments),_b.add(this),this._chatCompletions=[],this.messages=[]}_addChatCompletion(e){this._chatCompletions.push(e),this._emit("chatCompletion",e);let r=e.choices[0]?.message;return r&&this._addMessage(r),e}_addMessage(e,r=!0){if("content"in e||(e.content=null),this.messages.push(e),r){if(this._emit("message",e),fet(e)&&e.content)this._emit("functionToolCallResult",e.content);else if(YW(e)&&e.tool_calls)for(let n of e.tool_calls)n.type==="function"&&this._emit("functionToolCall",n.function)}}async finalChatCompletion(){await this.done();let e=this._chatCompletions[this._chatCompletions.length-1];if(!e)throw new Ft("stream ended without producing a ChatCompletion");return e}async finalContent(){return await this.done(),Ce(this,_b,"m",get).call(this)}async finalMessage(){return await this.done(),Ce(this,_b,"m",CCe).call(this)}async finalFunctionToolCall(){return await this.done(),Ce(this,_b,"m",yet).call(this)}async finalFunctionToolCallResult(){return await this.done(),Ce(this,_b,"m",bet).call(this)}async totalUsage(){return await this.done(),Ce(this,_b,"m",_et).call(this)}allChatCompletions(){return[...this._chatCompletions]}_emitFinal(){let e=this._chatCompletions[this._chatCompletions.length-1];e&&this._emit("finalChatCompletion",e);let r=Ce(this,_b,"m",CCe).call(this);r&&this._emit("finalMessage",r);let n=Ce(this,_b,"m",get).call(this);n&&this._emit("finalContent",n);let o=Ce(this,_b,"m",yet).call(this);o&&this._emit("finalFunctionToolCall",o);let i=Ce(this,_b,"m",bet).call(this);i!=null&&this._emit("finalFunctionToolCallResult",i),this._chatCompletions.some(a=>a.usage)&&this._emit("totalUsage",Ce(this,_b,"m",_et).call(this))}async _createChatCompletion(e,r,n){let o=n?.signal;o&&(o.aborted&&this.controller.abort(),o.addEventListener("abort",()=>this.controller.abort())),Ce(this,_b,"m",Xlr).call(this,r);let i=await e.chat.completions.create({...r,stream:!1},{...n,signal:this.controller.signal});return this._connected(),this._addChatCompletion(Coe(i,r))}async _runChatCompletion(e,r,n){for(let o of r.messages)this._addMessage(o,!1);return await this._createChatCompletion(e,r,n)}async _runTools(e,r,n){let o="tool",{tool_choice:i="auto",stream:a,...s}=r,u=typeof i!="string"&&i.type==="function"&&i?.function?.name,{maxChatCompletions:l=Ceo}=n||{},c=r.tools.map(p=>{if(F2(p)){if(!p.$callback)throw new Ft("Tool given to `.runTools()` that does not have an associated function");return{type:"function",function:{function:p.$callback,name:p.function.name,description:p.function.description||"",parameters:p.function.parameters,parse:p.$parseRaw,strict:!0}}}return p}),d={};for(let p of c)p.type==="function"&&(d[p.function.name||p.function.function.name]=p.function);let f="tools"in r?c.map(p=>p.type==="function"?{type:"function",function:{name:p.function.name||p.function.function.name,parameters:p.function.parameters,description:p.function.description,strict:p.function.strict}}:p):void 0;for(let p of r.messages)this._addMessage(p,!1);for(let p=0;pJSON.stringify(R)).join(", ")}. Please try again`;this._addMessage({role:o,tool_call_id:y,content:T});continue}let x;try{x=Zlr(w)?await w.parse(_):_}catch(T){let R=T instanceof Error?T.message:String(T);this._addMessage({role:o,tool_call_id:y,content:R});continue}let O=await w.function(x,this),E=Ce(this,_b,"m",Ylr).call(this,O);if(this._addMessage({role:o,tool_call_id:y,content:E}),u)return}}}};_b=new WeakSet,get=function(){return Ce(this,_b,"m",CCe).call(this).content??null},CCe=function(){let e=this.messages.length;for(;e-- >0;){let r=this.messages[e];if(YW(r))return{...r,content:r.content??null,refusal:r.refusal??null}}throw new Ft("stream ended without producing a ChatCompletionMessage with role=assistant")},yet=function(){for(let e=this.messages.length-1;e>=0;e--){let r=this.messages[e];if(YW(r)&&r?.tool_calls?.length)return r.tool_calls.filter(n=>n.type==="function").at(-1)?.function}},bet=function(){for(let e=this.messages.length-1;e>=0;e--){let r=this.messages[e];if(fet(r)&&r.content!=null&&typeof r.content=="string"&&this.messages.some(n=>n.role==="assistant"&&n.tool_calls?.some(o=>o.type==="function"&&o.id===r.tool_call_id)))return r.content}},_et=function(){let e={completion_tokens:0,prompt_tokens:0,total_tokens:0};for(let{usage:r}of this._chatCompletions)r&&(e.completion_tokens+=r.completion_tokens,e.prompt_tokens+=r.prompt_tokens,e.total_tokens+=r.total_tokens);return e},Xlr=function(e){if(e.n!=null&&e.n>1)throw new Ft("ChatCompletion convenience helpers only support n=1 at this time. To use n>1, please use chat.completions.create() directly.")},Ylr=function(e){return typeof e=="string"?e:e===void 0?"undefined":JSON.stringify(e)}});var koe,wet=v(()=>{vet();pet();koe=class t extends e8{static runTools(e,r,n){let o=new t,i={...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"runTools"}};return o._run(()=>o._runTools(e,r,i)),o}_addMessage(e,r=!0){super._addMessage(e,r),YW(e)&&e.content&&this._emit("content",e.content)}}});function xeo(t,e=vh.ALL){if(typeof t!="string")throw new TypeError(`expecting str, got ${typeof t}`);if(!t.trim())throw new Error(`${t} is empty`);return Oeo(t.trim(),e)}var vh,Cet,xet,Oeo,Oet,Qlr=v(()=>{vh={STR:1,NUM:2,ARR:4,OBJ:8,NULL:16,BOOL:32,NAN:64,INFINITY:128,MINUS_INFINITY:256,INF:384,SPECIAL:496,ATOM:499,COLLECTION:12,ALL:511},Cet=class extends Error{},xet=class extends Error{};Oeo=(t,e)=>{let r=t.length,n=0,o=f=>{throw new Cet(`${f} at position ${n}`)},i=f=>{throw new xet(`${f} at position ${n}`)},a=()=>(d(),n>=r&&o("Unexpected end of input"),t[n]==='"'?s():t[n]==="{"?u():t[n]==="["?l():t.substring(n,n+4)==="null"||vh.NULL&e&&r-n<4&&"null".startsWith(t.substring(n))?(n+=4,null):t.substring(n,n+4)==="true"||vh.BOOL&e&&r-n<4&&"true".startsWith(t.substring(n))?(n+=4,!0):t.substring(n,n+5)==="false"||vh.BOOL&e&&r-n<5&&"false".startsWith(t.substring(n))?(n+=5,!1):t.substring(n,n+8)==="Infinity"||vh.INFINITY&e&&r-n<8&&"Infinity".startsWith(t.substring(n))?(n+=8,1/0):t.substring(n,n+9)==="-Infinity"||vh.MINUS_INFINITY&e&&1{let f=n,p=!1;for(n++;n{n++,d();let f={};try{for(;t[n]!=="}";){if(d(),n>=r&&vh.OBJ&e)return f;let p=s();d(),n++;try{let m=a();Object.defineProperty(f,p,{value:m,writable:!0,enumerable:!0,configurable:!0})}catch(m){if(vh.OBJ&e)return f;throw m}d(),t[n]===","&&n++}}catch{if(vh.OBJ&e)return f;o("Expected '}' at end of object")}return n++,f},l=()=>{n++;let f=[];try{for(;t[n]!=="]";)f.push(a()),d(),t[n]===","&&n++}catch{if(vh.ARR&e)return f;o("Expected ']' at end of array")}return n++,f},c=()=>{if(n===0){t==="-"&&vh.NUM&e&&o("Not sure what '-' is");try{return JSON.parse(t)}catch(p){if(vh.NUM&e)try{return t[t.length-1]==="."?JSON.parse(t.substring(0,t.lastIndexOf("."))):JSON.parse(t.substring(0,t.lastIndexOf("e")))}catch{}i(String(p))}}let f=n;for(t[n]==="-"&&n++;t[n]&&!",]}".includes(t[n]);)n++;n==r&&!(vh.NUM&e)&&o("Unterminated number literal");try{return JSON.parse(t.substring(f,n))}catch{t.substring(f,n)==="-"&&vh.NUM&e&&o("Not sure what '-' is");try{return JSON.parse(t.substring(f,t.lastIndexOf("e")))}catch(m){i(String(m))}}},d=()=>{for(;nxeo(t,vh.ALL^vh.NUM)});var Tet=v(()=>{ret()});function Teo(t,e){let{id:r,choices:n,created:o,model:i,system_fingerprint:a,...s}=t,u={...s,id:r,choices:n.map(({message:l,finish_reason:c,index:d,logprobs:f,...p})=>{if(!c)throw new Ft(`missing finish_reason for choice ${d}`);let{content:m=null,function_call:h,tool_calls:g,...y}=l,b=l.role;if(!b)throw new Ft(`missing role for choice ${d}`);if(h){let{arguments:_,name:w}=h;if(_==null)throw new Ft(`missing function_call.arguments for choice ${d}`);if(!w)throw new Ft(`missing function_call.name for choice ${d}`);return{...p,message:{content:m,function_call:{arguments:_,name:w},role:b,refusal:l.refusal??null},finish_reason:c,index:d,logprobs:f}}return g?{...p,index:d,finish_reason:c,logprobs:f,message:{...y,role:b,content:m,refusal:l.refusal??null,tool_calls:g.map((_,w)=>{let{function:x,type:O,id:E,...T}=_,{arguments:R,name:I,...j}=x||{};if(E==null)throw new Ft(`missing choices[${d}].tool_calls[${w}].id +${TCe(t)}`);if(O==null)throw new Ft(`missing choices[${d}].tool_calls[${w}].type +${TCe(t)}`);if(I==null)throw new Ft(`missing choices[${d}].tool_calls[${w}].function.name +${TCe(t)}`);if(R==null)throw new Ft(`missing choices[${d}].tool_calls[${w}].function.arguments +${TCe(t)}`);return{...T,id:E,type:O,function:{...j,name:I,arguments:R}}})}}:{...p,message:{...y,content:m,role:b,refusal:l.refusal??null},finish_reason:c,index:d,logprobs:f}}),created:o,model:i,object:"chat.completion",...a?{system_fingerprint:a}:{}};return wur(u,e)}function TCe(t){return JSON.stringify(t)}var Nm,L1,t8,sk,Eet,xCe,Pet,Met,Ret,OCe,Aet,ecr,z2,ECe=v(()=>{AS();Qlr();RC();KW();Tet();vet();z2=class t extends e8{constructor(e){super(),Nm.add(this),L1.set(this,void 0),t8.set(this,void 0),sk.set(this,void 0),Fr(this,L1,e,"f"),Fr(this,t8,[],"f")}get currentChatCompletionSnapshot(){return Ce(this,sk,"f")}static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static createChatCompletion(e,r,n){let o=new t(r);return o._run(()=>o._runChatCompletion(e,{...r,stream:!0},{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),o}async _createChatCompletion(e,r,n){super._createChatCompletion;let o=n?.signal;o&&(o.aborted&&this.controller.abort(),o.addEventListener("abort",()=>this.controller.abort())),Ce(this,Nm,"m",Eet).call(this);let i=await e.chat.completions.create({...r,stream:!0},{...n,signal:this.controller.signal});this._connected();for await(let a of i)Ce(this,Nm,"m",Pet).call(this,a);if(i.controller.signal?.aborted)throw new Mc;return this._addChatCompletion(Ce(this,Nm,"m",OCe).call(this))}async _fromReadableStream(e,r){let n=r?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort())),Ce(this,Nm,"m",Eet).call(this),this._connected();let o=gA.fromReadableStream(e,this.controller),i;for await(let a of o)i&&i!==a.id&&this._addChatCompletion(Ce(this,Nm,"m",OCe).call(this)),Ce(this,Nm,"m",Pet).call(this,a),i=a.id;if(o.controller.signal?.aborted)throw new Mc;return this._addChatCompletion(Ce(this,Nm,"m",OCe).call(this))}[(L1=new WeakMap,t8=new WeakMap,sk=new WeakMap,Nm=new WeakSet,Eet=function(){this.ended||Fr(this,sk,void 0,"f")},xCe=function(r){let n=Ce(this,t8,"f")[r.index];return n||(n={content_done:!1,refusal_done:!1,logprobs_content_done:!1,logprobs_refusal_done:!1,done_tool_calls:new Set,current_tool_call_index:null},Ce(this,t8,"f")[r.index]=n,n)},Pet=function(r){if(this.ended)return;let n=Ce(this,Nm,"m",ecr).call(this,r);this._emit("chunk",r,n);for(let o of r.choices){let i=n.choices[o.index];o.delta.content!=null&&i.message?.role==="assistant"&&i.message?.content&&(this._emit("content",o.delta.content,i.message.content),this._emit("content.delta",{delta:o.delta.content,snapshot:i.message.content,parsed:i.message.parsed})),o.delta.refusal!=null&&i.message?.role==="assistant"&&i.message?.refusal&&this._emit("refusal.delta",{delta:o.delta.refusal,snapshot:i.message.refusal}),o.logprobs?.content!=null&&i.message?.role==="assistant"&&this._emit("logprobs.content.delta",{content:o.logprobs?.content,snapshot:i.logprobs?.content??[]}),o.logprobs?.refusal!=null&&i.message?.role==="assistant"&&this._emit("logprobs.refusal.delta",{refusal:o.logprobs?.refusal,snapshot:i.logprobs?.refusal??[]});let a=Ce(this,Nm,"m",xCe).call(this,i);i.finish_reason&&(Ce(this,Nm,"m",Ret).call(this,i),a.current_tool_call_index!=null&&Ce(this,Nm,"m",Met).call(this,i,a.current_tool_call_index));for(let s of o.delta.tool_calls??[])a.current_tool_call_index!==s.index&&(Ce(this,Nm,"m",Ret).call(this,i),a.current_tool_call_index!=null&&Ce(this,Nm,"m",Met).call(this,i,a.current_tool_call_index)),a.current_tool_call_index=s.index;for(let s of o.delta.tool_calls??[]){let u=i.message.tool_calls?.[s.index];u?.type&&(u?.type==="function"?this._emit("tool_calls.function.arguments.delta",{name:u.function?.name,index:s.index,arguments:u.function.arguments,parsed_arguments:u.function.parsed_arguments,arguments_delta:s.function?.arguments??""}):(u?.type,void 0))}}},Met=function(r,n){if(Ce(this,Nm,"m",xCe).call(this,r).done_tool_calls.has(n))return;let i=r.message.tool_calls?.[n];if(!i)throw new Error("no tool call snapshot");if(!i.type)throw new Error("tool call snapshot missing `type`");if(i.type==="function"){let a=Ce(this,L1,"f")?.tools?.find(s=>woe(s)&&s.function.name===i.function.name);this._emit("tool_calls.function.arguments.done",{name:i.function.name,index:n,arguments:i.function.arguments,parsed_arguments:F2(a)?a.$parseRaw(i.function.arguments):a?.function.strict?JSON.parse(i.function.arguments):null})}else i.type},Ret=function(r){let n=Ce(this,Nm,"m",xCe).call(this,r);if(r.message.content&&!n.content_done){n.content_done=!0;let o=Ce(this,Nm,"m",Aet).call(this);this._emit("content.done",{content:r.message.content,parsed:o?o.$parseRaw(r.message.content):null})}r.message.refusal&&!n.refusal_done&&(n.refusal_done=!0,this._emit("refusal.done",{refusal:r.message.refusal})),r.logprobs?.content&&!n.logprobs_content_done&&(n.logprobs_content_done=!0,this._emit("logprobs.content.done",{content:r.logprobs.content})),r.logprobs?.refusal&&!n.logprobs_refusal_done&&(n.logprobs_refusal_done=!0,this._emit("logprobs.refusal.done",{refusal:r.logprobs.refusal}))},OCe=function(){if(this.ended)throw new Ft("stream has ended, this shouldn't happen");let r=Ce(this,sk,"f");if(!r)throw new Ft("request ended without sending any chunks");return Fr(this,sk,void 0,"f"),Fr(this,t8,[],"f"),Teo(r,Ce(this,L1,"f"))},Aet=function(){let r=Ce(this,L1,"f")?.response_format;return Soe(r)?r:null},ecr=function(r){var n,o,i,a;let s=Ce(this,sk,"f"),{choices:u,...l}=r;s?Object.assign(s,l):s=Fr(this,sk,{...l,choices:[]},"f");for(let{delta:c,finish_reason:d,index:f,logprobs:p=null,...m}of r.choices){let h=s.choices[f];if(h||(h=s.choices[f]={finish_reason:d,index:f,message:{},logprobs:p,...m}),p)if(!h.logprobs)h.logprobs=Object.assign({},p);else{let{content:O,refusal:E,...T}=p;Object.assign(h.logprobs,T),O&&((n=h.logprobs).content??(n.content=[]),h.logprobs.content.push(...O)),E&&((o=h.logprobs).refusal??(o.refusal=[]),h.logprobs.refusal.push(...E))}if(d&&(h.finish_reason=d,Ce(this,L1,"f")&&rQe(Ce(this,L1,"f")))){if(d==="length")throw new VW;if(d==="content_filter")throw new JW}if(Object.assign(h,m),!c)continue;let{content:g,refusal:y,function_call:b,role:_,tool_calls:w,...x}=c;if(Object.assign(h.message,x),y&&(h.message.refusal=(h.message.refusal||"")+y),_&&(h.message.role=_),b&&(h.message.function_call?(b.name&&(h.message.function_call.name=b.name),b.arguments&&((i=h.message.function_call).arguments??(i.arguments=""),h.message.function_call.arguments+=b.arguments)):h.message.function_call=b),g&&(h.message.content=(h.message.content||"")+g,!h.message.refusal&&Ce(this,Nm,"m",Aet).call(this)&&(h.message.parsed=Oet(h.message.content))),w){h.message.tool_calls||(h.message.tool_calls=[]);for(let{index:O,id:E,type:T,function:R,...I}of w){let j=(a=h.message.tool_calls)[O]??(a[O]={});Object.assign(j,I),E&&(j.id=E),T&&(j.type=T),R&&(j.function??(j.function={name:R.name??"",arguments:""})),R?.name&&(j.function.name=R.name),R?.arguments&&(j.function.arguments+=R.arguments,Sur(Ce(this,L1,"f"),j)&&(j.function.parsed_arguments=Oet(j.function.arguments)))}}}return s},Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("chunk",o=>{let i=r.shift();i?i.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let i of r)i.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let i of r)i.reject(o);r.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((i,a)=>r.push({resolve:i,reject:a})).then(i=>i?{value:i,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}toReadableStream(){return new gA(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}}});var qoe,Iet=v(()=>{ECe();qoe=class t extends z2{static fromReadableStream(e){let r=new t(null);return r._run(()=>r._fromReadableStream(e)),r}static runTools(e,r,n){let o=new t(r),i={...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"runTools"}};return o._run(()=>o._runTools(e,r,i)),o}}});var F1,Boe=v(()=>{kr();gCe();gCe();xu();Ya();wet();Iet();ECe();KW();Iet();het();ECe();wet();F1=class extends qe{constructor(){super(...arguments),this.messages=new U2(this._client)}create(e,r){return this._client.post("/chat/completions",{body:e,...r,stream:e.stream??!1})}retrieve(e,r){return this._client.get(Ne`/chat/completions/${e}`,r)}update(e,r,n){return this._client.post(Ne`/chat/completions/${e}`,{body:r,...n})}list(e={},r){return this._client.getAPIList("/chat/completions",Go,{query:e,...r})}delete(e,r){return this._client.delete(Ne`/chat/completions/${e}`,r)}parse(e,r){return xur(e.tools),this._client.chat.completions.create(e,{...r,headers:{...r?.headers,"X-Stainless-Helper-Method":"chat.completions.parse"}})._thenUnwrap(n=>Coe(n,e))}runTools(e,r){return e.stream?qoe.runTools(this._client,e,r):koe.runTools(this._client,e,r)}stream(e,r){return z2.createChatCompletion(this._client,e,r)}};F1.Messages=U2});var uk,Net=v(()=>{kr();Boe();Boe();uk=class extends qe{constructor(){super(...arguments),this.completions=new F1(this._client)}};uk.Completions=F1});var tcr=v(()=>{Boe();Boe();gCe()});var rcr=v(()=>{Net();tcr()});var ncr=v(()=>{});function*Peo(t){if(!t)return;if(ocr in t){let{values:n,nulls:o}=t;yield*n.entries();for(let i of o)yield[i,null];return}let e=!1,r;t instanceof Headers?r=t.entries():BQe(t)?r=t:(e=!0,r=Object.entries(t??{}));for(let n of r){let o=n[0];if(typeof o!="string")throw new TypeError("expected header name to be a string");let i=BQe(n[1])?n[1]:[n[1]],a=!1;for(let s of i)s!==void 0&&(e&&!a&&(a=!0,yield[o,null]),yield[o,s])}}var ocr,at,Dl=v(()=>{N1();ocr=Symbol("brand.privateNullableHeaders");at=t=>{let e=new Headers,r=new Set;for(let n of t){let o=new Set;for(let[i,a]of Peo(n)){let s=i.toLowerCase();o.has(s)||(e.delete(i),o.add(s)),a===null?(e.delete(i),r.add(s)):(e.append(i,a),r.delete(s))}}return{[ocr]:!0,values:e,nulls:r}}});var r8,jet=v(()=>{kr();Dl();r8=class extends qe{create(e,r){return this._client.post("/audio/speech",{body:e,...r,headers:at([{Accept:"application/octet-stream"},r?.headers]),__binaryResponse:!0})}}});var n8,Det=v(()=>{kr();bA();n8=class extends qe{create(e,r){return this._client.post("/audio/transcriptions",Qv({body:e,...r,stream:e.stream??!1,__metadata:{model:e.model}},this._client))}}});var o8,$et=v(()=>{kr();bA();o8=class extends qe{create(e,r){return this._client.post("/audio/translations",Qv({body:e,...r,__metadata:{model:e.model}},this._client))}}});var _A,Let=v(()=>{kr();jet();jet();Det();Det();$et();$et();_A=class extends qe{constructor(){super(...arguments),this.transcriptions=new n8(this._client),this.translations=new o8(this._client),this.speech=new r8(this._client)}};_A.Transcriptions=n8;_A.Translations=o8;_A.Speech=r8});var H2,Fet=v(()=>{kr();xu();Ya();H2=class extends qe{create(e,r){return this._client.post("/batches",{body:e,...r})}retrieve(e,r){return this._client.get(Ne`/batches/${e}`,r)}list(e={},r){return this._client.getAPIList("/batches",Go,{query:e,...r})}cancel(e,r){return this._client.post(Ne`/batches/${e}/cancel`,r)}}});var i8,ket=v(()=>{kr();xu();Dl();Ya();i8=class extends qe{create(e,r){return this._client.post("/assistants",{body:e,...r,headers:at([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}retrieve(e,r){return this._client.get(Ne`/assistants/${e}`,{...r,headers:at([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}update(e,r,n){return this._client.post(Ne`/assistants/${e}`,{body:r,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}list(e={},r){return this._client.getAPIList("/assistants",Go,{query:e,...r,headers:at([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}delete(e,r){return this._client.delete(Ne`/assistants/${e}`,{...r,headers:at([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}}});var a8,qet=v(()=>{kr();Dl();a8=class extends qe{create(e,r){return this._client.post("/realtime/sessions",{body:e,...r,headers:at([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}}});var s8,Bet=v(()=>{kr();Dl();s8=class extends qe{create(e,r){return this._client.post("/realtime/transcription_sessions",{body:e,...r,headers:at([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}}});var lk,Uet=v(()=>{kr();qet();qet();Bet();Bet();lk=class extends qe{constructor(){super(...arguments),this.sessions=new a8(this._client),this.transcriptionSessions=new s8(this._client)}};lk.Sessions=a8;lk.TranscriptionSessions=s8});var u8,zet=v(()=>{kr();Dl();Ya();u8=class extends qe{create(e,r){return this._client.post("/chatkit/sessions",{body:e,...r,headers:at([{"OpenAI-Beta":"chatkit_beta=v1"},r?.headers])})}cancel(e,r){return this._client.post(Ne`/chatkit/sessions/${e}/cancel`,{...r,headers:at([{"OpenAI-Beta":"chatkit_beta=v1"},r?.headers])})}}});var l8,Het=v(()=>{kr();xu();Dl();Ya();l8=class extends qe{retrieve(e,r){return this._client.get(Ne`/chatkit/threads/${e}`,{...r,headers:at([{"OpenAI-Beta":"chatkit_beta=v1"},r?.headers])})}list(e={},r){return this._client.getAPIList("/chatkit/threads",D1,{query:e,...r,headers:at([{"OpenAI-Beta":"chatkit_beta=v1"},r?.headers])})}delete(e,r){return this._client.delete(Ne`/chatkit/threads/${e}`,{...r,headers:at([{"OpenAI-Beta":"chatkit_beta=v1"},r?.headers])})}listItems(e,r={},n){return this._client.getAPIList(Ne`/chatkit/threads/${e}/items`,D1,{query:r,...n,headers:at([{"OpenAI-Beta":"chatkit_beta=v1"},n?.headers])})}}});var ck,Vet=v(()=>{kr();zet();zet();Het();Het();ck=class extends qe{constructor(){super(...arguments),this.sessions=new u8(this._client),this.threads=new l8(this._client)}};ck.Sessions=u8;ck.Threads=l8});var c8,Jet=v(()=>{kr();xu();Dl();Ya();c8=class extends qe{create(e,r,n){return this._client.post(Ne`/threads/${e}/messages`,{body:r,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}retrieve(e,r,n){let{thread_id:o}=r;return this._client.get(Ne`/threads/${o}/messages/${e}`,{...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}update(e,r,n){let{thread_id:o,...i}=r;return this._client.post(Ne`/threads/${o}/messages/${e}`,{body:i,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}list(e,r={},n){return this._client.getAPIList(Ne`/threads/${e}/messages`,Go,{query:r,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}delete(e,r,n){let{thread_id:o}=r;return this._client.delete(Ne`/threads/${o}/messages/${e}`,{...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}}});var d8,Ket=v(()=>{kr();xu();Dl();Ya();d8=class extends qe{retrieve(e,r,n){let{thread_id:o,run_id:i,...a}=r;return this._client.get(Ne`/threads/${o}/runs/${i}/steps/${e}`,{query:a,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}list(e,r,n){let{thread_id:o,...i}=r;return this._client.getAPIList(Ne`/threads/${o}/runs/${e}/steps`,Go,{query:i,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}}});var icr,acr=v(()=>{pA();lCe();icr=t=>{if(typeof Buffer<"u"){let e=Buffer.from(t,"base64");return Array.from(new Float32Array(e.buffer,e.byteOffset,e.length/Float32Array.BYTES_PER_ELEMENT))}else{let e=atob(t),r=e.length,n=new Uint8Array(r);for(let o=0;o{NC=t=>{if(typeof globalThis.process<"u")return globalThis.process.env?.[t]?.trim()??void 0;if(typeof globalThis.Deno<"u")return globalThis.Deno.env?.get?.(t)?.trim()}});var Uoe=v(()=>{N1();acr();Wet();Poe();qQe();GW()});var Sg,J2,Get,vA,PCe,jC,K2,f8,V2,ACe,ew,MCe,RCe,Voe,zoe,Hoe,scr,ucr,lcr,ccr,dcr,fcr,pcr,k1,Zet=v(()=>{AS();Tet();RC();SCe();Uoe();k1=class extends ak{constructor(){super(...arguments),Sg.add(this),Get.set(this,[]),vA.set(this,{}),PCe.set(this,{}),jC.set(this,void 0),K2.set(this,void 0),f8.set(this,void 0),V2.set(this,void 0),ACe.set(this,void 0),ew.set(this,void 0),MCe.set(this,void 0),RCe.set(this,void 0),Voe.set(this,void 0)}[(Get=new WeakMap,vA=new WeakMap,PCe=new WeakMap,jC=new WeakMap,K2=new WeakMap,f8=new WeakMap,V2=new WeakMap,ACe=new WeakMap,ew=new WeakMap,MCe=new WeakMap,RCe=new WeakMap,Voe=new WeakMap,Sg=new WeakSet,Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("event",o=>{let i=r.shift();i?i.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let i of r)i.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let i of r)i.reject(o);r.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((i,a)=>r.push({resolve:i,reject:a})).then(i=>i?{value:i,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}static fromReadableStream(e){let r=new J2;return r._run(()=>r._fromReadableStream(e)),r}async _fromReadableStream(e,r){let n=r?.signal;n&&(n.aborted&&this.controller.abort(),n.addEventListener("abort",()=>this.controller.abort())),this._connected();let o=gA.fromReadableStream(e,this.controller);for await(let i of o)Ce(this,Sg,"m",zoe).call(this,i);if(o.controller.signal?.aborted)throw new Mc;return this._addRun(Ce(this,Sg,"m",Hoe).call(this))}toReadableStream(){return new gA(this[Symbol.asyncIterator].bind(this),this.controller).toReadableStream()}static createToolAssistantStream(e,r,n,o){let i=new J2;return i._run(()=>i._runToolAssistantStream(e,r,n,{...o,headers:{...o?.headers,"X-Stainless-Helper-Method":"stream"}})),i}async _createToolAssistantStream(e,r,n,o){let i=o?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort()));let a={...n,stream:!0},s=await e.submitToolOutputs(r,a,{...o,signal:this.controller.signal});this._connected();for await(let u of s)Ce(this,Sg,"m",zoe).call(this,u);if(s.controller.signal?.aborted)throw new Mc;return this._addRun(Ce(this,Sg,"m",Hoe).call(this))}static createThreadAssistantStream(e,r,n){let o=new J2;return o._run(()=>o._threadAssistantStream(e,r,{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),o}static createAssistantStream(e,r,n,o){let i=new J2;return i._run(()=>i._runAssistantStream(e,r,n,{...o,headers:{...o?.headers,"X-Stainless-Helper-Method":"stream"}})),i}currentEvent(){return Ce(this,MCe,"f")}currentRun(){return Ce(this,RCe,"f")}currentMessageSnapshot(){return Ce(this,jC,"f")}currentRunStepSnapshot(){return Ce(this,Voe,"f")}async finalRunSteps(){return await this.done(),Object.values(Ce(this,vA,"f"))}async finalMessages(){return await this.done(),Object.values(Ce(this,PCe,"f"))}async finalRun(){if(await this.done(),!Ce(this,K2,"f"))throw Error("Final run was not received.");return Ce(this,K2,"f")}async _createThreadAssistantStream(e,r,n){let o=n?.signal;o&&(o.aborted&&this.controller.abort(),o.addEventListener("abort",()=>this.controller.abort()));let i={...r,stream:!0},a=await e.createAndRun(i,{...n,signal:this.controller.signal});this._connected();for await(let s of a)Ce(this,Sg,"m",zoe).call(this,s);if(a.controller.signal?.aborted)throw new Mc;return this._addRun(Ce(this,Sg,"m",Hoe).call(this))}async _createAssistantStream(e,r,n,o){let i=o?.signal;i&&(i.aborted&&this.controller.abort(),i.addEventListener("abort",()=>this.controller.abort()));let a={...n,stream:!0},s=await e.create(r,a,{...o,signal:this.controller.signal});this._connected();for await(let u of s)Ce(this,Sg,"m",zoe).call(this,u);if(s.controller.signal?.aborted)throw new Mc;return this._addRun(Ce(this,Sg,"m",Hoe).call(this))}static accumulateDelta(e,r){for(let[n,o]of Object.entries(r)){if(!e.hasOwnProperty(n)){e[n]=o;continue}let i=e[n];if(i==null){e[n]=o;continue}if(n==="index"||n==="type"){e[n]=o;continue}if(typeof i=="string"&&typeof o=="string")i+=o;else if(typeof i=="number"&&typeof o=="number")i+=o;else if(WW(i)&&WW(o))i=this.accumulateDelta(i,o);else if(Array.isArray(i)&&Array.isArray(o)){if(i.every(a=>typeof a=="string"||typeof a=="number")){i.push(...o);continue}for(let a of o){if(!WW(a))throw new Error(`Expected array delta entry to be an object but got: ${a}`);let s=a.index;if(s==null)throw console.error(a),new Error("Expected array delta entry to have an `index` property");if(typeof s!="number")throw new Error(`Expected array delta entry \`index\` property to be a number but got ${s}`);let u=i[s];u==null?i.push(a):i[s]=this.accumulateDelta(u,a)}continue}else throw Error(`Unhandled record type: ${n}, deltaValue: ${o}, accValue: ${i}`);e[n]=i}return e}_addRun(e){return e}async _threadAssistantStream(e,r,n){return await this._createThreadAssistantStream(r,e,n)}async _runAssistantStream(e,r,n,o){return await this._createAssistantStream(r,e,n,o)}async _runToolAssistantStream(e,r,n,o){return await this._createToolAssistantStream(r,e,n,o)}};J2=k1,zoe=function(e){if(!this.ended)switch(Fr(this,MCe,e,"f"),Ce(this,Sg,"m",lcr).call(this,e),e.event){case"thread.created":break;case"thread.run.created":case"thread.run.queued":case"thread.run.in_progress":case"thread.run.requires_action":case"thread.run.completed":case"thread.run.incomplete":case"thread.run.failed":case"thread.run.cancelling":case"thread.run.cancelled":case"thread.run.expired":Ce(this,Sg,"m",pcr).call(this,e);break;case"thread.run.step.created":case"thread.run.step.in_progress":case"thread.run.step.delta":case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":Ce(this,Sg,"m",ucr).call(this,e);break;case"thread.message.created":case"thread.message.in_progress":case"thread.message.delta":case"thread.message.completed":case"thread.message.incomplete":Ce(this,Sg,"m",scr).call(this,e);break;case"error":throw new Error("Encountered an error event in event processing - errors should be processed earlier");default:}},Hoe=function(){if(this.ended)throw new Ft("stream has ended, this shouldn't happen");if(!Ce(this,K2,"f"))throw Error("Final run has not been received");return Ce(this,K2,"f")},scr=function(e){let[r,n]=Ce(this,Sg,"m",dcr).call(this,e,Ce(this,jC,"f"));Fr(this,jC,r,"f"),Ce(this,PCe,"f")[r.id]=r;for(let o of n){let i=r.content[o.index];i?.type=="text"&&this._emit("textCreated",i.text)}switch(e.event){case"thread.message.created":this._emit("messageCreated",e.data);break;case"thread.message.in_progress":break;case"thread.message.delta":if(this._emit("messageDelta",e.data.delta,r),e.data.delta.content)for(let o of e.data.delta.content){if(o.type=="text"&&o.text){let i=o.text,a=r.content[o.index];if(a&&a.type=="text")this._emit("textDelta",i,a.text);else throw Error("The snapshot associated with this text delta is not text or missing")}if(o.index!=Ce(this,f8,"f")){if(Ce(this,V2,"f"))switch(Ce(this,V2,"f").type){case"text":this._emit("textDone",Ce(this,V2,"f").text,Ce(this,jC,"f"));break;case"image_file":this._emit("imageFileDone",Ce(this,V2,"f").image_file,Ce(this,jC,"f"));break}Fr(this,f8,o.index,"f")}Fr(this,V2,r.content[o.index],"f")}break;case"thread.message.completed":case"thread.message.incomplete":if(Ce(this,f8,"f")!==void 0){let o=e.data.content[Ce(this,f8,"f")];if(o)switch(o.type){case"image_file":this._emit("imageFileDone",o.image_file,Ce(this,jC,"f"));break;case"text":this._emit("textDone",o.text,Ce(this,jC,"f"));break}}Ce(this,jC,"f")&&this._emit("messageDone",e.data),Fr(this,jC,void 0,"f")}},ucr=function(e){let r=Ce(this,Sg,"m",ccr).call(this,e);switch(Fr(this,Voe,r,"f"),e.event){case"thread.run.step.created":this._emit("runStepCreated",e.data);break;case"thread.run.step.delta":let n=e.data.delta;if(n.step_details&&n.step_details.type=="tool_calls"&&n.step_details.tool_calls&&r.step_details.type=="tool_calls")for(let i of n.step_details.tool_calls)i.index==Ce(this,ACe,"f")?this._emit("toolCallDelta",i,r.step_details.tool_calls[i.index]):(Ce(this,ew,"f")&&this._emit("toolCallDone",Ce(this,ew,"f")),Fr(this,ACe,i.index,"f"),Fr(this,ew,r.step_details.tool_calls[i.index],"f"),Ce(this,ew,"f")&&this._emit("toolCallCreated",Ce(this,ew,"f")));this._emit("runStepDelta",e.data.delta,r);break;case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":Fr(this,Voe,void 0,"f"),e.data.step_details.type=="tool_calls"&&Ce(this,ew,"f")&&(this._emit("toolCallDone",Ce(this,ew,"f")),Fr(this,ew,void 0,"f")),this._emit("runStepDone",e.data,r);break;case"thread.run.step.in_progress":break}},lcr=function(e){Ce(this,Get,"f").push(e),this._emit("event",e)},ccr=function(e){switch(e.event){case"thread.run.step.created":return Ce(this,vA,"f")[e.data.id]=e.data,e.data;case"thread.run.step.delta":let r=Ce(this,vA,"f")[e.data.id];if(!r)throw Error("Received a RunStepDelta before creation of a snapshot");let n=e.data;if(n.delta){let o=J2.accumulateDelta(r,n.delta);Ce(this,vA,"f")[e.data.id]=o}return Ce(this,vA,"f")[e.data.id];case"thread.run.step.completed":case"thread.run.step.failed":case"thread.run.step.cancelled":case"thread.run.step.expired":case"thread.run.step.in_progress":Ce(this,vA,"f")[e.data.id]=e.data;break}if(Ce(this,vA,"f")[e.data.id])return Ce(this,vA,"f")[e.data.id];throw new Error("No snapshot available")},dcr=function(e,r){let n=[];switch(e.event){case"thread.message.created":return[e.data,n];case"thread.message.delta":if(!r)throw Error("Received a delta with no existing snapshot (there should be one from message creation)");let o=e.data;if(o.delta.content)for(let i of o.delta.content)if(i.index in r.content){let a=r.content[i.index];r.content[i.index]=Ce(this,Sg,"m",fcr).call(this,i,a)}else r.content[i.index]=i,n.push(i);return[r,n];case"thread.message.in_progress":case"thread.message.completed":case"thread.message.incomplete":if(r)return[r,n];throw Error("Received thread message event with no existing snapshot")}throw Error("Tried to accumulate a non-message event")},fcr=function(e,r){return J2.accumulateDelta(r,e)},pcr=function(e){switch(Fr(this,RCe,e.data,"f"),e.event){case"thread.run.created":break;case"thread.run.queued":break;case"thread.run.in_progress":break;case"thread.run.requires_action":case"thread.run.cancelled":case"thread.run.failed":case"thread.run.completed":case"thread.run.expired":case"thread.run.incomplete":Fr(this,K2,e.data,"f"),Ce(this,ew,"f")&&(this._emit("toolCallDone",Ce(this,ew,"f")),Fr(this,ew,void 0,"f"));break;case"thread.run.cancelling":break}}});var W2,Xet=v(()=>{kr();Ket();Ket();xu();Dl();Zet();GW();Ya();W2=class extends qe{constructor(){super(...arguments),this.steps=new d8(this._client)}create(e,r,n){let{include:o,...i}=r;return this._client.post(Ne`/threads/${e}/runs`,{query:{include:o},body:i,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers]),stream:r.stream??!1})}retrieve(e,r,n){let{thread_id:o}=r;return this._client.get(Ne`/threads/${o}/runs/${e}`,{...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}update(e,r,n){let{thread_id:o,...i}=r;return this._client.post(Ne`/threads/${o}/runs/${e}`,{body:i,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}list(e,r={},n){return this._client.getAPIList(Ne`/threads/${e}/runs`,Go,{query:r,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}cancel(e,r,n){let{thread_id:o}=r;return this._client.post(Ne`/threads/${o}/runs/${e}/cancel`,{...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}async createAndPoll(e,r,n){let o=await this.create(e,r,n);return await this.poll(o.id,{thread_id:e},n)}createAndStream(e,r,n){return k1.createAssistantStream(e,this._client.beta.threads.runs,r,n)}async poll(e,r,n){let o=at([n?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":n?.pollIntervalMs?.toString()??void 0}]);for(;;){let{data:i,response:a}=await this.retrieve(e,r,{...n,headers:{...n?.headers,...o}}).withResponse();switch(i.status){case"queued":case"in_progress":case"cancelling":let s=5e3;if(n?.pollIntervalMs)s=n.pollIntervalMs;else{let u=a.headers.get("openai-poll-after-ms");if(u){let l=parseInt(u);isNaN(l)||(s=l)}}await mA(s);break;case"requires_action":case"incomplete":case"cancelled":case"completed":case"failed":case"expired":return i}}}stream(e,r,n){return k1.createAssistantStream(e,this._client.beta.threads.runs,r,n)}submitToolOutputs(e,r,n){let{thread_id:o,...i}=r;return this._client.post(Ne`/threads/${o}/runs/${e}/submit_tool_outputs`,{body:i,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers]),stream:r.stream??!1})}async submitToolOutputsAndPoll(e,r,n){let o=await this.submitToolOutputs(e,r,n);return await this.poll(o.id,r,n)}submitToolOutputsStream(e,r,n){return k1.createToolAssistantStream(e,this._client.beta.threads.runs,r,n)}};W2.Steps=d8});var dk,Yet=v(()=>{kr();Jet();Jet();Xet();Xet();Dl();Zet();Ya();dk=class extends qe{constructor(){super(...arguments),this.runs=new W2(this._client),this.messages=new c8(this._client)}create(e={},r){return this._client.post("/threads",{body:e,...r,headers:at([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}retrieve(e,r){return this._client.get(Ne`/threads/${e}`,{...r,headers:at([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}update(e,r,n){return this._client.post(Ne`/threads/${e}`,{body:r,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}delete(e,r){return this._client.delete(Ne`/threads/${e}`,{...r,headers:at([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}createAndRun(e,r){return this._client.post("/threads/runs",{body:e,...r,headers:at([{"OpenAI-Beta":"assistants=v2"},r?.headers]),stream:e.stream??!1})}async createAndRunPoll(e,r){let n=await this.createAndRun(e,r);return await this.runs.poll(n.id,{thread_id:n.thread_id},r)}createAndRunStream(e,r){return k1.createThreadAssistantStream(e,this._client.beta.threads,r)}};dk.Runs=W2;dk.Messages=c8});var DC,Qet=v(()=>{kr();ket();ket();Uet();Uet();Vet();Vet();Yet();Yet();DC=class extends qe{constructor(){super(...arguments),this.realtime=new lk(this._client),this.chatkit=new ck(this._client),this.assistants=new i8(this._client),this.threads=new dk(this._client)}};DC.Realtime=lk;DC.ChatKit=ck;DC.Assistants=i8;DC.Threads=dk});var G2,ett=v(()=>{kr();G2=class extends qe{create(e,r){return this._client.post("/completions",{body:e,...r,stream:e.stream??!1})}}});var p8,ttt=v(()=>{kr();Dl();Ya();p8=class extends qe{retrieve(e,r,n){let{container_id:o}=r;return this._client.get(Ne`/containers/${o}/files/${e}/content`,{...n,headers:at([{Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}}});var Z2,rtt=v(()=>{kr();ttt();ttt();xu();Dl();bA();Ya();Z2=class extends qe{constructor(){super(...arguments),this.content=new p8(this._client)}create(e,r,n){return this._client.post(Ne`/containers/${e}/files`,Qv({body:r,...n},this._client))}retrieve(e,r,n){let{container_id:o}=r;return this._client.get(Ne`/containers/${o}/files/${e}`,n)}list(e,r={},n){return this._client.getAPIList(Ne`/containers/${e}/files`,Go,{query:r,...n})}delete(e,r,n){let{container_id:o}=r;return this._client.delete(Ne`/containers/${o}/files/${e}`,{...n,headers:at([{Accept:"*/*"},n?.headers])})}};Z2.Content=p8});var fk,ntt=v(()=>{kr();rtt();rtt();xu();Dl();Ya();fk=class extends qe{constructor(){super(...arguments),this.files=new Z2(this._client)}create(e,r){return this._client.post("/containers",{body:e,...r})}retrieve(e,r){return this._client.get(Ne`/containers/${e}`,r)}list(e={},r){return this._client.getAPIList("/containers",Go,{query:e,...r})}delete(e,r){return this._client.delete(Ne`/containers/${e}`,{...r,headers:at([{Accept:"*/*"},r?.headers])})}};fk.Files=Z2});var m8,ott=v(()=>{kr();xu();Ya();m8=class extends qe{create(e,r,n){let{include:o,...i}=r;return this._client.post(Ne`/conversations/${e}/items`,{query:{include:o},body:i,...n})}retrieve(e,r,n){let{conversation_id:o,...i}=r;return this._client.get(Ne`/conversations/${o}/items/${e}`,{query:i,...n})}list(e,r={},n){return this._client.getAPIList(Ne`/conversations/${e}/items`,D1,{query:r,...n})}delete(e,r,n){let{conversation_id:o}=r;return this._client.delete(Ne`/conversations/${o}/items/${e}`,n)}}});var pk,itt=v(()=>{kr();ott();ott();Ya();pk=class extends qe{constructor(){super(...arguments),this.items=new m8(this._client)}create(e={},r){return this._client.post("/conversations",{body:e,...r})}retrieve(e,r){return this._client.get(Ne`/conversations/${e}`,r)}update(e,r,n){return this._client.post(Ne`/conversations/${e}`,{body:r,...n})}delete(e,r){return this._client.delete(Ne`/conversations/${e}`,r)}};pk.Items=m8});var X2,att=v(()=>{kr();Uoe();X2=class extends qe{create(e,r){let n=!!e.encoding_format,o=n?e.encoding_format:"base64";n&&Qc(this._client).debug("embeddings/user defined encoding_format:",e.encoding_format);let i=this._client.post("/embeddings",{body:{...e,encoding_format:o},...r});return n?i:(Qc(this._client).debug("embeddings/decoding base64 embeddings from base64"),i._thenUnwrap(a=>(a&&a.data&&a.data.forEach(s=>{let u=s.embedding;s.embedding=icr(u)}),a)))}}});var h8,stt=v(()=>{kr();xu();Ya();h8=class extends qe{retrieve(e,r,n){let{eval_id:o,run_id:i}=r;return this._client.get(Ne`/evals/${o}/runs/${i}/output_items/${e}`,n)}list(e,r,n){let{eval_id:o,...i}=r;return this._client.getAPIList(Ne`/evals/${o}/runs/${e}/output_items`,Go,{query:i,...n})}}});var Y2,utt=v(()=>{kr();stt();stt();xu();Ya();Y2=class extends qe{constructor(){super(...arguments),this.outputItems=new h8(this._client)}create(e,r,n){return this._client.post(Ne`/evals/${e}/runs`,{body:r,...n})}retrieve(e,r,n){let{eval_id:o}=r;return this._client.get(Ne`/evals/${o}/runs/${e}`,n)}list(e,r={},n){return this._client.getAPIList(Ne`/evals/${e}/runs`,Go,{query:r,...n})}delete(e,r,n){let{eval_id:o}=r;return this._client.delete(Ne`/evals/${o}/runs/${e}`,n)}cancel(e,r,n){let{eval_id:o}=r;return this._client.post(Ne`/evals/${o}/runs/${e}`,n)}};Y2.OutputItems=h8});var mk,ltt=v(()=>{kr();utt();utt();xu();Ya();mk=class extends qe{constructor(){super(...arguments),this.runs=new Y2(this._client)}create(e,r){return this._client.post("/evals",{body:e,...r})}retrieve(e,r){return this._client.get(Ne`/evals/${e}`,r)}update(e,r,n){return this._client.post(Ne`/evals/${e}`,{body:r,...n})}list(e={},r){return this._client.getAPIList("/evals",Go,{query:e,...r})}delete(e,r){return this._client.delete(Ne`/evals/${e}`,r)}};mk.Runs=Y2});var Q2,ctt=v(()=>{kr();xu();Dl();GW();RC();bA();Ya();Q2=class extends qe{create(e,r){return this._client.post("/files",Qv({body:e,...r},this._client))}retrieve(e,r){return this._client.get(Ne`/files/${e}`,r)}list(e={},r){return this._client.getAPIList("/files",Go,{query:e,...r})}delete(e,r){return this._client.delete(Ne`/files/${e}`,r)}content(e,r){return this._client.get(Ne`/files/${e}/content`,{...r,headers:at([{Accept:"application/binary"},r?.headers]),__binaryResponse:!0})}async waitForProcessing(e,{pollInterval:r=5e3,maxWait:n=30*60*1e3}={}){let o=new Set(["processed","error","deleted"]),i=Date.now(),a=await this.retrieve(e);for(;!a.status||!o.has(a.status);)if(await mA(r),a=await this.retrieve(e),Date.now()-i>n)throw new dA({message:`Giving up on waiting for file ${e} to finish processing after ${n} milliseconds.`});return a}}});var g8,dtt=v(()=>{kr();g8=class extends qe{}});var y8,ftt=v(()=>{kr();y8=class extends qe{run(e,r){return this._client.post("/fine_tuning/alpha/graders/run",{body:e,...r})}validate(e,r){return this._client.post("/fine_tuning/alpha/graders/validate",{body:e,...r})}}});var eH,ptt=v(()=>{kr();ftt();ftt();eH=class extends qe{constructor(){super(...arguments),this.graders=new y8(this._client)}};eH.Graders=y8});var b8,mtt=v(()=>{kr();xu();Ya();b8=class extends qe{create(e,r,n){return this._client.getAPIList(Ne`/fine_tuning/checkpoints/${e}/permissions`,yA,{body:r,method:"post",...n})}retrieve(e,r={},n){return this._client.get(Ne`/fine_tuning/checkpoints/${e}/permissions`,{query:r,...n})}delete(e,r,n){let{fine_tuned_model_checkpoint:o}=r;return this._client.delete(Ne`/fine_tuning/checkpoints/${o}/permissions/${e}`,n)}}});var tH,htt=v(()=>{kr();mtt();mtt();tH=class extends qe{constructor(){super(...arguments),this.permissions=new b8(this._client)}};tH.Permissions=b8});var _8,gtt=v(()=>{kr();xu();Ya();_8=class extends qe{list(e,r={},n){return this._client.getAPIList(Ne`/fine_tuning/jobs/${e}/checkpoints`,Go,{query:r,...n})}}});var rH,ytt=v(()=>{kr();gtt();gtt();xu();Ya();rH=class extends qe{constructor(){super(...arguments),this.checkpoints=new _8(this._client)}create(e,r){return this._client.post("/fine_tuning/jobs",{body:e,...r})}retrieve(e,r){return this._client.get(Ne`/fine_tuning/jobs/${e}`,r)}list(e={},r){return this._client.getAPIList("/fine_tuning/jobs",Go,{query:e,...r})}cancel(e,r){return this._client.post(Ne`/fine_tuning/jobs/${e}/cancel`,r)}listEvents(e,r={},n){return this._client.getAPIList(Ne`/fine_tuning/jobs/${e}/events`,Go,{query:r,...n})}pause(e,r){return this._client.post(Ne`/fine_tuning/jobs/${e}/pause`,r)}resume(e,r){return this._client.post(Ne`/fine_tuning/jobs/${e}/resume`,r)}};rH.Checkpoints=_8});var $C,btt=v(()=>{kr();dtt();dtt();ptt();ptt();htt();htt();ytt();ytt();$C=class extends qe{constructor(){super(...arguments),this.methods=new g8(this._client),this.jobs=new rH(this._client),this.checkpoints=new tH(this._client),this.alpha=new eH(this._client)}};$C.Methods=g8;$C.Jobs=rH;$C.Checkpoints=tH;$C.Alpha=eH});var v8,_tt=v(()=>{kr();v8=class extends qe{}});var hk,vtt=v(()=>{kr();_tt();_tt();hk=class extends qe{constructor(){super(...arguments),this.graderModels=new v8(this._client)}};hk.GraderModels=v8});var nH,wtt=v(()=>{kr();bA();nH=class extends qe{createVariation(e,r){return this._client.post("/images/variations",Qv({body:e,...r},this._client))}edit(e,r){return this._client.post("/images/edits",Qv({body:e,...r,stream:e.stream??!1},this._client))}generate(e,r){return this._client.post("/images/generations",{body:e,...r,stream:e.stream??!1})}}});var oH,Stt=v(()=>{kr();xu();Ya();oH=class extends qe{retrieve(e,r){return this._client.get(Ne`/models/${e}`,r)}list(e){return this._client.getAPIList("/models",yA,e)}delete(e,r){return this._client.delete(Ne`/models/${e}`,r)}}});var iH,Ctt=v(()=>{kr();iH=class extends qe{create(e,r){return this._client.post("/moderations",{body:e,...r})}}});var w8,xtt=v(()=>{kr();Dl();Ya();w8=class extends qe{accept(e,r,n){return this._client.post(Ne`/realtime/calls/${e}/accept`,{body:r,...n,headers:at([{Accept:"*/*"},n?.headers])})}hangup(e,r){return this._client.post(Ne`/realtime/calls/${e}/hangup`,{...r,headers:at([{Accept:"*/*"},r?.headers])})}refer(e,r,n){return this._client.post(Ne`/realtime/calls/${e}/refer`,{body:r,...n,headers:at([{Accept:"*/*"},n?.headers])})}reject(e,r={},n){return this._client.post(Ne`/realtime/calls/${e}/reject`,{body:r,...n,headers:at([{Accept:"*/*"},n?.headers])})}}});var S8,Ott=v(()=>{kr();S8=class extends qe{create(e,r){return this._client.post("/realtime/client_secrets",{body:e,...r})}}});var q1,Ttt=v(()=>{kr();xtt();xtt();Ott();Ott();q1=class extends qe{constructor(){super(...arguments),this.clientSecrets=new S8(this._client),this.calls=new w8(this._client)}};q1.ClientSecrets=S8;q1.Calls=w8});function oto(t,e){return alr(t,e)}var C8,ICe,gk,NCe,mcr,hcr,gcr,ycr,jCe,bcr=v(()=>{AS();RC();SCe();rCe();jCe=class t extends ak{constructor(e){super(),C8.add(this),ICe.set(this,void 0),gk.set(this,void 0),NCe.set(this,void 0),Fr(this,ICe,e,"f")}static createResponse(e,r,n){let o=new t(r);return o._run(()=>o._createOrRetrieveResponse(e,r,{...n,headers:{...n?.headers,"X-Stainless-Helper-Method":"stream"}})),o}async _createOrRetrieveResponse(e,r,n){let o=n?.signal;o&&(o.aborted&&this.controller.abort(),o.addEventListener("abort",()=>this.controller.abort())),Ce(this,C8,"m",mcr).call(this);let i,a=null;"response_id"in r?(i=await e.responses.retrieve(r.response_id,{stream:!0},{...n,signal:this.controller.signal,stream:!0}),a=r.starting_after??null):i=await e.responses.create({...r,stream:!0},{...n,signal:this.controller.signal}),this._connected();for await(let s of i)Ce(this,C8,"m",hcr).call(this,s,a);if(i.controller.signal?.aborted)throw new Mc;return Ce(this,C8,"m",gcr).call(this)}[(ICe=new WeakMap,gk=new WeakMap,NCe=new WeakMap,C8=new WeakSet,mcr=function(){this.ended||Fr(this,gk,void 0,"f")},hcr=function(r,n){if(this.ended)return;let o=(a,s)=>{(n==null||s.sequence_number>n)&&this._emit(a,s)},i=Ce(this,C8,"m",ycr).call(this,r);switch(o("event",r),r.type){case"response.output_text.delta":{let a=i.output[r.output_index];if(!a)throw new Ft(`missing output at index ${r.output_index}`);if(a.type==="message"){let s=a.content[r.content_index];if(!s)throw new Ft(`missing content at index ${r.content_index}`);if(s.type!=="output_text")throw new Ft(`expected content to be 'output_text', got ${s.type}`);o("response.output_text.delta",{...r,snapshot:s.text})}break}case"response.function_call_arguments.delta":{let a=i.output[r.output_index];if(!a)throw new Ft(`missing output at index ${r.output_index}`);a.type==="function_call"&&o("response.function_call_arguments.delta",{...r,snapshot:a.arguments});break}default:o(r.type,r);break}},gcr=function(){if(this.ended)throw new Ft("stream has ended, this shouldn't happen");let r=Ce(this,gk,"f");if(!r)throw new Ft("request ended without sending any events");Fr(this,gk,void 0,"f");let n=oto(r,Ce(this,ICe,"f"));return Fr(this,NCe,n,"f"),n},ycr=function(r){let n=Ce(this,gk,"f");if(!n){if(r.type!=="response.created")throw new Ft(`When snapshot hasn't been set yet, expected 'response.created' event, got ${r.type}`);return n=Fr(this,gk,r.response,"f"),n}switch(r.type){case"response.output_item.added":{n.output.push(r.item);break}case"response.content_part.added":{let o=n.output[r.output_index];if(!o)throw new Ft(`missing output at index ${r.output_index}`);let i=o.type,a=r.part;i==="message"&&a.type!=="reasoning_text"?o.content.push(a):i==="reasoning"&&a.type==="reasoning_text"&&(o.content||(o.content=[]),o.content.push(a));break}case"response.output_text.delta":{let o=n.output[r.output_index];if(!o)throw new Ft(`missing output at index ${r.output_index}`);if(o.type==="message"){let i=o.content[r.content_index];if(!i)throw new Ft(`missing content at index ${r.content_index}`);if(i.type!=="output_text")throw new Ft(`expected content to be 'output_text', got ${i.type}`);i.text+=r.delta}break}case"response.function_call_arguments.delta":{let o=n.output[r.output_index];if(!o)throw new Ft(`missing output at index ${r.output_index}`);o.type==="function_call"&&(o.arguments+=r.delta);break}case"response.reasoning_text.delta":{let o=n.output[r.output_index];if(!o)throw new Ft(`missing output at index ${r.output_index}`);if(o.type==="reasoning"){let i=o.content?.[r.content_index];if(!i)throw new Ft(`missing content at index ${r.content_index}`);if(i.type!=="reasoning_text")throw new Ft(`expected content to be 'reasoning_text', got ${i.type}`);i.text+=r.delta}break}case"response.completed":{Fr(this,gk,r.response,"f");break}}return n},Symbol.asyncIterator)](){let e=[],r=[],n=!1;return this.on("event",o=>{let i=r.shift();i?i.resolve(o):e.push(o)}),this.on("end",()=>{n=!0;for(let o of r)o.resolve(void 0);r.length=0}),this.on("abort",o=>{n=!0;for(let i of r)i.reject(o);r.length=0}),this.on("error",o=>{n=!0;for(let i of r)i.reject(o);r.length=0}),{next:async()=>e.length?{value:e.shift(),done:!1}:n?{value:void 0,done:!0}:new Promise((i,a)=>r.push({resolve:i,reject:a})).then(i=>i?{value:i,done:!1}:{value:void 0,done:!0}),return:async()=>(this.abort(),{value:void 0,done:!0})}}async finalResponse(){await this.done();let e=Ce(this,NCe,"f");if(!e)throw new Ft("stream ended without producing a ChatCompletion");return e}}});var x8,Ett=v(()=>{kr();xu();Ya();x8=class extends qe{list(e,r={},n){return this._client.getAPIList(Ne`/responses/${e}/input_items`,Go,{query:r,...n})}}});var yk,Ptt=v(()=>{rCe();bcr();kr();Ett();Ett();Dl();Ya();yk=class extends qe{constructor(){super(...arguments),this.inputItems=new x8(this._client)}create(e,r){return this._client.post("/responses",{body:e,...r,stream:e.stream??!1})._thenUnwrap(n=>("object"in n&&n.object==="response"&&tCe(n),n))}retrieve(e,r={},n){return this._client.get(Ne`/responses/${e}`,{query:r,...n,stream:r?.stream??!1})._thenUnwrap(o=>("object"in o&&o.object==="response"&&tCe(o),o))}delete(e,r){return this._client.delete(Ne`/responses/${e}`,{...r,headers:at([{Accept:"*/*"},r?.headers])})}parse(e,r){return this._client.responses.create(e,r)._thenUnwrap(n=>LQe(n,e))}stream(e,r){return jCe.createResponse(this._client,e,r)}cancel(e,r){return this._client.post(Ne`/responses/${e}/cancel`,r)}};yk.InputItems=x8});var O8,Mtt=v(()=>{kr();bA();Ya();O8=class extends qe{create(e,r,n){return this._client.post(Ne`/uploads/${e}/parts`,Qv({body:r,...n},this._client))}}});var bk,Rtt=v(()=>{kr();Mtt();Mtt();Ya();bk=class extends qe{constructor(){super(...arguments),this.parts=new O8(this._client)}create(e,r){return this._client.post("/uploads",{body:e,...r})}cancel(e,r){return this._client.post(Ne`/uploads/${e}/cancel`,r)}complete(e,r,n){return this._client.post(Ne`/uploads/${e}/complete`,{body:r,...n})}};bk.Parts=O8});var _cr,vcr=v(()=>{_cr=async t=>{let e=await Promise.allSettled(t),r=e.filter(o=>o.status==="rejected");if(r.length){for(let o of r)console.error(o.reason);throw new Error(`${r.length} promise(s) failed - see the above errors`)}let n=[];for(let o of e)o.status==="fulfilled"&&n.push(o.value);return n}});var T8,Att=v(()=>{kr();xu();Dl();GW();vcr();Ya();T8=class extends qe{create(e,r,n){return this._client.post(Ne`/vector_stores/${e}/file_batches`,{body:r,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}retrieve(e,r,n){let{vector_store_id:o}=r;return this._client.get(Ne`/vector_stores/${o}/file_batches/${e}`,{...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}cancel(e,r,n){let{vector_store_id:o}=r;return this._client.post(Ne`/vector_stores/${o}/file_batches/${e}/cancel`,{...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}async createAndPoll(e,r,n){let o=await this.create(e,r);return await this.poll(e,o.id,n)}listFiles(e,r,n){let{vector_store_id:o,...i}=r;return this._client.getAPIList(Ne`/vector_stores/${o}/file_batches/${e}/files`,Go,{query:i,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}async poll(e,r,n){let o=at([n?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":n?.pollIntervalMs?.toString()??void 0}]);for(;;){let{data:i,response:a}=await this.retrieve(r,{vector_store_id:e},{...n,headers:o}).withResponse();switch(i.status){case"in_progress":let s=5e3;if(n?.pollIntervalMs)s=n.pollIntervalMs;else{let u=a.headers.get("openai-poll-after-ms");if(u){let l=parseInt(u);isNaN(l)||(s=l)}}await mA(s);break;case"failed":case"cancelled":case"completed":return i}}}async uploadAndPoll(e,{files:r,fileIds:n=[]},o){if(r==null||r.length==0)throw new Error("No `files` provided to process. If you've already uploaded files you should use `.createAndPoll()` instead");let i=o?.maxConcurrency??5,a=Math.min(i,r.length),s=this._client,u=r.values(),l=[...n];async function c(f){for(let p of f){let m=await s.files.create({file:p,purpose:"assistants"},o);l.push(m.id)}}let d=Array(a).fill(u).map(c);return await _cr(d),await this.createAndPoll(e,{file_ids:l})}}});var E8,Itt=v(()=>{kr();xu();Dl();Uoe();Ya();E8=class extends qe{create(e,r,n){return this._client.post(Ne`/vector_stores/${e}/files`,{body:r,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}retrieve(e,r,n){let{vector_store_id:o}=r;return this._client.get(Ne`/vector_stores/${o}/files/${e}`,{...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}update(e,r,n){let{vector_store_id:o,...i}=r;return this._client.post(Ne`/vector_stores/${o}/files/${e}`,{body:i,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}list(e,r={},n){return this._client.getAPIList(Ne`/vector_stores/${e}/files`,Go,{query:r,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}delete(e,r,n){let{vector_store_id:o}=r;return this._client.delete(Ne`/vector_stores/${o}/files/${e}`,{...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}async createAndPoll(e,r,n){let o=await this.create(e,r,n);return await this.poll(e,o.id,n)}async poll(e,r,n){let o=at([n?.headers,{"X-Stainless-Poll-Helper":"true","X-Stainless-Custom-Poll-Interval":n?.pollIntervalMs?.toString()??void 0}]);for(;;){let i=await this.retrieve(r,{vector_store_id:e},{...n,headers:o}).withResponse(),a=i.data;switch(a.status){case"in_progress":let s=5e3;if(n?.pollIntervalMs)s=n.pollIntervalMs;else{let u=i.response.headers.get("openai-poll-after-ms");if(u){let l=parseInt(u);isNaN(l)||(s=l)}}await mA(s);break;case"failed":case"completed":return a}}}async upload(e,r,n){let o=await this._client.files.create({file:r,purpose:"assistants"},n);return this.create(e,{file_id:o.id},n)}async uploadAndPoll(e,r,n){let o=await this.upload(e,r,n);return await this.poll(e,o.id,n)}content(e,r,n){let{vector_store_id:o}=r;return this._client.getAPIList(Ne`/vector_stores/${o}/files/${e}/content`,yA,{...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}}});var B1,Ntt=v(()=>{kr();Att();Att();Itt();Itt();xu();Dl();Ya();B1=class extends qe{constructor(){super(...arguments),this.files=new E8(this._client),this.fileBatches=new T8(this._client)}create(e,r){return this._client.post("/vector_stores",{body:e,...r,headers:at([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}retrieve(e,r){return this._client.get(Ne`/vector_stores/${e}`,{...r,headers:at([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}update(e,r,n){return this._client.post(Ne`/vector_stores/${e}`,{body:r,...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}list(e={},r){return this._client.getAPIList("/vector_stores",Go,{query:e,...r,headers:at([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}delete(e,r){return this._client.delete(Ne`/vector_stores/${e}`,{...r,headers:at([{"OpenAI-Beta":"assistants=v2"},r?.headers])})}search(e,r,n){return this._client.getAPIList(Ne`/vector_stores/${e}/search`,yA,{body:r,method:"post",...n,headers:at([{"OpenAI-Beta":"assistants=v2"},n?.headers])})}};B1.Files=E8;B1.FileBatches=T8});var aH,jtt=v(()=>{kr();xu();Dl();bA();Ya();aH=class extends qe{create(e,r){return this._client.post("/videos",uet({body:e,...r},this._client))}retrieve(e,r){return this._client.get(Ne`/videos/${e}`,r)}list(e={},r){return this._client.getAPIList("/videos",D1,{query:e,...r})}delete(e,r){return this._client.delete(Ne`/videos/${e}`,r)}downloadContent(e,r={},n){return this._client.get(Ne`/videos/${e}/content`,{query:r,...n,headers:at([{Accept:"application/binary"},n?.headers]),__binaryResponse:!0})}remix(e,r,n){return this._client.post(Ne`/videos/${e}/remix`,uet({body:r,...n},this._client))}}});var P8,wcr,DCe,sH,Dtt=v(()=>{AS();RC();kr();Dl();sH=class extends qe{constructor(){super(...arguments),P8.add(this)}async unwrap(e,r,n=this._client.webhookSecret,o=300){return await this.verifySignature(e,r,n,o),JSON.parse(e)}async verifySignature(e,r,n=this._client.webhookSecret,o=300){if(typeof crypto>"u"||typeof crypto.subtle.importKey!="function"||typeof crypto.subtle.verify!="function")throw new Error("Webhook signature verification is only supported when the `crypto` global is defined");Ce(this,P8,"m",wcr).call(this,n);let i=at([r]).values,a=Ce(this,P8,"m",DCe).call(this,i,"webhook-signature"),s=Ce(this,P8,"m",DCe).call(this,i,"webhook-timestamp"),u=Ce(this,P8,"m",DCe).call(this,i,"webhook-id"),l=parseInt(s,10);if(isNaN(l))throw new fA("Invalid webhook timestamp format");let c=Math.floor(Date.now()/1e3);if(c-l>o)throw new fA("Webhook timestamp is too old");if(l>c+o)throw new fA("Webhook timestamp is too new");let d=a.split(" ").map(h=>h.startsWith("v1,")?h.substring(3):h),f=n.startsWith("whsec_")?Buffer.from(n.replace("whsec_",""),"base64"):Buffer.from(n,"utf-8"),p=u?`${u}.${s}.${e}`:`${s}.${e}`,m=await crypto.subtle.importKey("raw",f,{name:"HMAC",hash:"SHA-256"},!1,["verify"]);for(let h of d)try{let g=Buffer.from(h,"base64");if(await crypto.subtle.verify("HMAC",m,g,new TextEncoder().encode(p)))return}catch{continue}throw new fA("The given webhook signature does not match the expected signature")}};P8=new WeakSet,wcr=function(e){if(typeof e!="string"||e.length===0)throw new Error("The webhook secret must either be set using the env var, OPENAI_WEBHOOK_SECRET, on the client class, OpenAI({ webhookSecret: '123' }), or passed to this function")},DCe=function(e,r){if(!e)throw new Error("Headers are required");let n=e.get(r);if(n==null)throw new Error(`Missing required header: ${r}`);return n}});var Scr=v(()=>{rcr();ncr();Let();Fet();Qet();ett();ntt();itt();att();ltt();ctt();btt();vtt();wtt();Stt();Ctt();Ttt();Ptt();Rtt();Ntt();jtt();Dtt()});var $tt,Ltt,$Ce,Ccr,un,LCe=v(()=>{AS();qQe();N1();GW();W0e();HQe();Toe();Tlr();Dlr();zQe();pA();xu();det();Scr();pCe();Fet();ett();att();ctt();wtt();Stt();Ctt();jtt();Dtt();Let();Qet();Net();ntt();itt();ltt();btt();vtt();Ttt();Ptt();Rtt();Ntt();HQe();Dl();Wet();Poe();N1();un=class{constructor({baseURL:e=NC("OPENAI_BASE_URL"),apiKey:r=NC("OPENAI_API_KEY"),organization:n=NC("OPENAI_ORG_ID")??null,project:o=NC("OPENAI_PROJECT_ID")??null,webhookSecret:i=NC("OPENAI_WEBHOOK_SECRET")??null,...a}={}){if($tt.add(this),$Ce.set(this,void 0),this.completions=new G2(this),this.chat=new uk(this),this.embeddings=new X2(this),this.files=new Q2(this),this.images=new nH(this),this.audio=new _A(this),this.moderations=new iH(this),this.models=new oH(this),this.fineTuning=new $C(this),this.graders=new hk(this),this.vectorStores=new B1(this),this.webhooks=new sH(this),this.beta=new DC(this),this.batches=new H2(this),this.uploads=new bk(this),this.responses=new yk(this),this.realtime=new q1(this),this.conversations=new pk(this),this.evals=new mk(this),this.containers=new fk(this),this.videos=new aH(this),r===void 0)throw new Ft("Missing credentials. Please pass an `apiKey`, or set the `OPENAI_API_KEY` environment variable.");let s={apiKey:r,organization:n,project:o,webhookSecret:i,...a,baseURL:e||"https://api.openai.com/v1"};if(!s.dangerouslyAllowBrowser&&wlr())throw new Ft(`It looks like you're running in a browser-like environment. + +This is disabled by default, as it risks exposing your secret API credentials to attackers. +If you understand the risks and have appropriate mitigations in place, +you can set the \`dangerouslyAllowBrowser\` option to \`true\`, e.g., + +new OpenAI({ apiKey, dangerouslyAllowBrowser: true }); + +https://help.openai.com/en/articles/5112595-best-practices-for-api-key-safety +`);this.baseURL=s.baseURL,this.timeout=s.timeout??Ltt.DEFAULT_TIMEOUT,this.logger=s.logger??console;let u="warn";this.logLevel=u,this.logLevel=eet(s.logLevel,"ClientOptions.logLevel",this)??eet(NC("OPENAI_LOG"),"process.env['OPENAI_LOG']",this)??u,this.fetchOptions=s.fetchOptions,this.maxRetries=s.maxRetries??2,this.fetch=s.fetch??Clr(),Fr(this,$Ce,Olr,"f"),this._options=s,this.apiKey=typeof r=="string"?r:"Missing Key",this.organization=n,this.project=o,this.webhookSecret=i}withOptions(e){return new this.constructor({...this._options,baseURL:this.baseURL,maxRetries:this.maxRetries,timeout:this.timeout,logger:this.logger,logLevel:this.logLevel,fetch:this.fetch,fetchOptions:this.fetchOptions,apiKey:this.apiKey,organization:this.organization,project:this.project,webhookSecret:this.webhookSecret,...e})}defaultQuery(){return this._options.defaultQuery}validateHeaders({values:e,nulls:r}){}async authHeaders(e){return at([{Authorization:`Bearer ${this.apiKey}`}])}stringifyQuery(e){return YQe(e,{arrayFormat:"brackets"})}getUserAgent(){return`${this.constructor.name}/JS ${ik}`}defaultIdempotencyKey(){return`stainless-node-retry-${kQe()}`}makeStatusError(e,r,n,o){return Am.generate(e,r,n,o)}async _callApiKey(){let e=this._options.apiKey;if(typeof e!="function")return!1;let r;try{r=await e()}catch(n){throw n instanceof Ft?n:new Ft(`Failed to get token from 'apiKey' function: ${n.message}`,{cause:n})}if(typeof r!="string"||!r)throw new Ft(`Expected 'apiKey' function argument to return a string but it returned ${r}`);return this.apiKey=r,!0}buildURL(e,r,n){let o=!Ce(this,$tt,"m",Ccr).call(this)&&n||this.baseURL,i=plr(e)?new URL(e):new URL(o+(o.endsWith("/")&&e.startsWith("/")?e.slice(1):e)),a=this.defaultQuery();return mlr(a)||(r={...a,...r}),typeof r=="object"&&r&&!Array.isArray(r)&&(i.search=this.stringifyQuery(r)),i.toString()}async prepareOptions(e){await this._callApiKey()}async prepareRequest(e,{url:r,options:n}){}get(e,r){return this.methodRequest("get",e,r)}post(e,r){return this.methodRequest("post",e,r)}patch(e,r){return this.methodRequest("patch",e,r)}put(e,r){return this.methodRequest("put",e,r)}delete(e,r){return this.methodRequest("delete",e,r)}methodRequest(e,r,n){return this.request(Promise.resolve(n).then(o=>({method:e,path:r,...o})))}request(e,r=null){return new B2(this,this.makeRequest(e,r,void 0))}async makeRequest(e,r,n){let o=await e,i=o.maxRetries??this.maxRetries;r==null&&(r=i),await this.prepareOptions(o);let{req:a,url:s,timeout:u}=await this.buildRequest(o,{retryCount:i-r});await this.prepareRequest(a,{url:s,options:o});let l="log_"+(Math.random()*(1<<24)|0).toString(16).padStart(6,"0"),c=n===void 0?"":`, retryOf: ${n}`,d=Date.now();if(Qc(this).debug(`[${l}] sending request`,j1({retryOfRequestLogID:n,method:o.method,url:s,options:o,headers:a.headers})),o.signal?.aborted)throw new Mc;let f=new AbortController,p=await this.fetchWithTimeout(s,a,u,f).catch(voe),m=Date.now();if(p instanceof globalThis.Error){let y=`retrying, ${r} attempts remaining`;if(o.signal?.aborted)throw new Mc;let b=_oe(p)||/timed? ?out/i.test(String(p)+("cause"in p?String(p.cause):""));if(r)return Qc(this).info(`[${l}] connection ${b?"timed out":"failed"} - ${y}`),Qc(this).debug(`[${l}] connection ${b?"timed out":"failed"} (${y})`,j1({retryOfRequestLogID:n,url:s,durationMs:m-d,message:p.message})),this.retryRequest(o,r,n??l);throw Qc(this).info(`[${l}] connection ${b?"timed out":"failed"} - error; no more retries left`),Qc(this).debug(`[${l}] connection ${b?"timed out":"failed"} (error; no more retries left)`,j1({retryOfRequestLogID:n,url:s,durationMs:m-d,message:p.message})),b?new dA:new nk({cause:p})}let h=[...p.headers.entries()].filter(([y])=>y==="x-request-id").map(([y,b])=>", "+y+": "+JSON.stringify(b)).join(""),g=`[${l}${c}${h}] ${a.method} ${s} ${p.ok?"succeeded":"failed"} with status ${p.status} in ${m-d}ms`;if(!p.ok){let y=await this.shouldRetry(p);if(r&&y){let E=`retrying, ${r} attempts remaining`;return await xlr(p.body),Qc(this).info(`${g} - ${E}`),Qc(this).debug(`[${l}] response error (${E})`,j1({retryOfRequestLogID:n,url:p.url,status:p.status,headers:p.headers,durationMs:m-d})),this.retryRequest(o,r,n??l,p.headers)}let b=y?"error; no more retries left":"error; not retryable";Qc(this).info(`${g} - ${b}`);let _=await p.text().catch(E=>voe(E).message),w=ylr(_),x=w?void 0:_;throw Qc(this).debug(`[${l}] response error (${b})`,j1({retryOfRequestLogID:n,url:p.url,status:p.status,headers:p.headers,message:x,durationMs:Date.now()-d})),this.makeStatusError(p.status,w,x,p.headers)}return Qc(this).info(g),Qc(this).debug(`[${l}] response start`,j1({retryOfRequestLogID:n,url:p.url,status:p.status,headers:p.headers,durationMs:m-d})),{response:p,options:o,controller:f,requestLogID:l,retryOfRequestLogID:n,startTime:d}}getAPIList(e,r,n){return this.requestAPIList(r,{method:"get",path:e,...n})}requestAPIList(e,r){let n=this.makeRequest(r,null,void 0);return new Ioe(this,n,e)}async fetchWithTimeout(e,r,n,o){let{signal:i,method:a,...s}=r||{};i&&i.addEventListener("abort",()=>o.abort());let u=setTimeout(()=>o.abort(),n),l=globalThis.ReadableStream&&s.body instanceof globalThis.ReadableStream||typeof s.body=="object"&&s.body!==null&&Symbol.asyncIterator in s.body,c={signal:o.signal,...l?{duplex:"half"}:{},method:"GET",...s};a&&(c.method=a.toUpperCase());try{return await this.fetch.call(void 0,e,c)}finally{clearTimeout(u)}}async shouldRetry(e){let r=e.headers.get("x-should-retry");return r==="true"?!0:r==="false"?!1:e.status===408||e.status===409||e.status===429||e.status>=500}async retryRequest(e,r,n,o){let i,a=o?.get("retry-after-ms");if(a){let u=parseFloat(a);Number.isNaN(u)||(i=u)}let s=o?.get("retry-after");if(s&&!i){let u=parseFloat(s);Number.isNaN(u)?i=Date.parse(s)-Date.now():i=u*1e3}if(!(i&&0<=i&&i<60*1e3)){let u=e.maxRetries??this.maxRetries;i=this.calculateDefaultRetryTimeoutMillis(r,u)}return await mA(i),this.makeRequest(e,r-1,n)}calculateDefaultRetryTimeoutMillis(e,r){let i=r-e,a=Math.min(.5*Math.pow(2,i),8),s=1-Math.random()*.25;return a*s*1e3}async buildRequest(e,{retryCount:r=0}={}){let n={...e},{method:o,path:i,query:a,defaultBaseURL:s}=n,u=this.buildURL(i,a,s);"timeout"in n&&glr("timeout",n.timeout),n.timeout=n.timeout??this.timeout;let{bodyHeaders:l,body:c}=this.buildBody({options:n}),d=await this.buildHeaders({options:e,method:o,bodyHeaders:l,retryCount:r});return{req:{method:o,headers:d,...n.signal&&{signal:n.signal},...globalThis.ReadableStream&&c instanceof globalThis.ReadableStream&&{duplex:"half"},...c&&{body:c},...this.fetchOptions??{},...n.fetchOptions??{}},url:u,timeout:n.timeout}}async buildHeaders({options:e,method:r,bodyHeaders:n,retryCount:o}){let i={};this.idempotencyHeader&&r!=="get"&&(e.idempotencyKey||(e.idempotencyKey=this.defaultIdempotencyKey()),i[this.idempotencyHeader]=e.idempotencyKey);let a=at([i,{Accept:"application/json","User-Agent":this.getUserAgent(),"X-Stainless-Retry-Count":String(o),...e.timeout?{"X-Stainless-Timeout":String(Math.trunc(e.timeout/1e3))}:{},...Slr(),"OpenAI-Organization":this.organization,"OpenAI-Project":this.project},await this.authHeaders(e),this._options.defaultHeaders,n,e.headers]);return this.validateHeaders(a),a.values}buildBody({options:{body:e,headers:r}}){if(!e)return{bodyHeaders:void 0,body:void 0};let n=at([r]);return ArrayBuffer.isView(e)||e instanceof ArrayBuffer||e instanceof DataView||typeof e=="string"&&n.values.has("content-type")||globalThis.Blob&&e instanceof globalThis.Blob||e instanceof FormData||e instanceof URLSearchParams||globalThis.ReadableStream&&e instanceof globalThis.ReadableStream?{bodyHeaders:void 0,body:e}:typeof e=="object"&&(Symbol.asyncIterator in e||Symbol.iterator in e&&"next"in e&&typeof e.next=="function")?{bodyHeaders:void 0,body:oCe(e)}:Ce(this,$Ce,"f").call(this,{body:e,headers:n})}};Ltt=un,$Ce=new WeakMap,$tt=new WeakSet,Ccr=function(){return this.baseURL!=="https://api.openai.com/v1"};un.OpenAI=Ltt;un.DEFAULT_TIMEOUT=6e5;un.OpenAIError=Ft;un.APIError=Am;un.APIConnectionError=nk;un.APIConnectionTimeoutError=dA;un.APIUserAbortError=Mc;un.NotFoundError=qW;un.ConflictError=BW;un.RateLimitError=zW;un.BadRequestError=LW;un.AuthenticationError=FW;un.InternalServerError=HW;un.PermissionDeniedError=kW;un.UnprocessableEntityError=UW;un.InvalidWebhookSignatureError=fA;un.toFile=joe;un.Completions=G2;un.Chat=uk;un.Embeddings=X2;un.Files=Q2;un.Images=nH;un.Audio=_A;un.Moderations=iH;un.Models=oH;un.FineTuning=$C;un.Graders=hk;un.VectorStores=B1;un.Webhooks=sH;un.Beta=DC;un.Batches=H2;un.Uploads=bk;un.Responses=yk;un.Realtime=q1;un.Conversations=pk;un.Evals=mk;un.Containers=fk;un.Videos=aH});var uH,cto,xcr=v(()=>{Dl();RC();Uoe();LCe();uH=class extends un{constructor({baseURL:e=NC("OPENAI_BASE_URL"),apiKey:r=NC("AZURE_OPENAI_API_KEY"),apiVersion:n=NC("OPENAI_API_VERSION"),endpoint:o,deployment:i,azureADTokenProvider:a,dangerouslyAllowBrowser:s,...u}={}){if(!n)throw new Ft("The OPENAI_API_VERSION environment variable is missing or empty; either provide it, or instantiate the AzureOpenAI client with an apiVersion option, like new AzureOpenAI({ apiVersion: 'My API Version' }).");if(typeof a=="function"&&(s=!0),!a&&!r)throw new Ft("Missing credentials. Please pass one of `apiKey` and `azureADTokenProvider`, or set the `AZURE_OPENAI_API_KEY` environment variable.");if(a&&r)throw new Ft("The `apiKey` and `azureADTokenProvider` arguments are mutually exclusive; only one can be passed at a time.");if(u.defaultQuery={...u.defaultQuery,"api-version":n},e){if(o)throw new Ft("baseURL and endpoint are mutually exclusive")}else{if(o||(o=process.env.AZURE_OPENAI_ENDPOINT),!o)throw new Ft("Must provide one of the `baseURL` or `endpoint` arguments, or the `AZURE_OPENAI_ENDPOINT` environment variable");e=`${o}/openai`}super({apiKey:a??r,baseURL:e,...u,...s!==void 0?{dangerouslyAllowBrowser:s}:{}}),this.apiVersion="",this.apiVersion=n,this.deploymentName=i}async buildRequest(e,r={}){if(cto.has(e.path)&&e.method==="post"&&e.body!==void 0){if(!WW(e.body))throw new Error("Expected request body to be an object");let n=this.deploymentName||e.body.model||e.__metadata?.model;n!==void 0&&!this.baseURL.includes("/deployments")&&(e.path=`/deployments/${n}${e.path}`)}return super.buildRequest(e,r)}async authHeaders(e){return typeof this._options.apiKey=="string"?at([{"api-key":this.apiKey}]):super.authHeaders(e)}},cto=new Set(["/completions","/chat/completions","/embeddings","/audio/transcriptions","/audio/translations","/audio/speech","/images/generations","/batches","/images/edits"])});var wA=v(()=>{LCe();det();pCe();LCe();xu();pA();xcr()});function LC(t,e){if(t.function===void 0)return;let r;if(e?.partial)try{r=qU(t.function.arguments??"{}")}catch{return}else try{r=JSON.parse(t.function.arguments)}catch(o){throw new nh([`Function "${t.function.name}" arguments:`,"",t.function.arguments,"","are not valid JSON.",`Error: ${o.message}`].join(` +`))}let n={name:t.function.name,args:r,type:"tool_call"};return e?.returnId&&(n.id=t.id),n}function _k(t){if(t.id===void 0)throw new Error('All OpenAI tool calls must have an "id" field.');return{id:t.id,type:"function",function:{name:t.name,arguments:JSON.stringify(t.args)}}}function FC(t,e){return{name:t.function?.name,args:t.function?.arguments,id:t.id,error:e,type:"invalid_tool_call"}}var Ftt,kC,Ocr=v(()=>{cY();z0();mN();E6();cL();z4e();Ftt=class extends lL{constructor(e){super(e);M(this,"returnId",!1);M(this,"lc_namespace",["langchain","output_parsers","openai_tools"]);M(this,"lc_serializable",!0);this.returnId=e?.returnId??this.returnId}static lc_name(){return"JsonOutputToolsParser"}_diff(){throw new Error("Not supported.")}async parse(){throw new Error("Not implemented.")}async parseResult(e){return await this.parsePartialResult(e,!1)}async parsePartialResult(e,r=!0){let n=e[0].message,o;if(qs(n)&&n.tool_calls?.length?o=n.tool_calls.map(a=>{let{id:s,...u}=a;return this.returnId?{id:s,...u}:u}):n.additional_kwargs.tool_calls!==void 0&&(o=JSON.parse(JSON.stringify(n.additional_kwargs.tool_calls)).map(s=>LC(s,{returnId:this.returnId,partial:r}))),!o)return[];let i=[];for(let a of o)if(a!==void 0){let s={type:a.name,args:a.args,id:a.id};i.push(s)}return i}},kC=class extends Ftt{constructor(e){super(e);M(this,"lc_namespace",["langchain","output_parsers","openai_tools"]);M(this,"lc_serializable",!0);M(this,"returnId",!1);M(this,"keyName");M(this,"returnSingle",!1);M(this,"zodSchema");this.keyName=e.keyName,this.returnSingle=e.returnSingle??this.returnSingle,this.zodSchema=e.zodSchema}static lc_name(){return"JsonOutputKeyToolsParser"}async _validateResult(e){if(this.zodSchema===void 0)return e;let r=await eL(this.zodSchema,e);if(r.success)return r.data;throw new nh(`Failed to parse. Text: "${JSON.stringify(e,null,2)}". Error: ${JSON.stringify(r.error?.issues)}`,JSON.stringify(e,null,2))}async parsePartialResult(e){let n=(await super.parsePartialResult(e)).filter(i=>i.type===this.keyName),o=n;if(n.length)return this.returnId||(o=n.map(i=>i.args)),this.returnSingle?o[0]:o}async parseResult(e){let n=(await super.parsePartialResult(e,!1)).filter(a=>a.type===this.keyName),o=n;return n.length?(this.returnId||(o=n.map(a=>a.args)),this.returnSingle?this._validateResult(o[0]):await Promise.all(o.map(a=>this._validateResult(a)))):void 0}}});var dto,lH=v(()=>{Do();Ocr();dto={};Tt(dto,{JsonOutputKeyToolsParser:()=>kC,JsonOutputToolsParser:()=>Ftt,convertLangChainToolCallToOpenAI:()=>_k,makeInvalidToolCall:()=>FC,parseToolCall:()=>LC})});var cH,Joe=v(()=>{tk();rk();boe();nCe();wA();Yu();A1();Gv();Ov();_O();lH();Zv();o_();cH=class extends bh{constructor(e){super(e??{});M(this,"temperature");M(this,"topP");M(this,"frequencyPenalty");M(this,"presencePenalty");M(this,"n");M(this,"logitBias");M(this,"model","gpt-3.5-turbo");M(this,"modelKwargs");M(this,"stop");M(this,"stopSequences");M(this,"user");M(this,"timeout");M(this,"streaming",!1);M(this,"streamUsage",!0);M(this,"maxTokens");M(this,"logprobs");M(this,"topLogprobs");M(this,"apiKey");M(this,"organization");M(this,"__includeRawResponse");M(this,"client");M(this,"clientConfig");M(this,"supportsStrictToolCalling");M(this,"audio");M(this,"modalities");M(this,"reasoning");M(this,"zdrEnabled");M(this,"service_tier");M(this,"promptCacheKey");M(this,"verbosity");M(this,"defaultOptions");M(this,"lc_serializable",!0);let r=typeof e?.configuration?.apiKey=="string"?e?.configuration?.apiKey:void 0;this.apiKey=e?.apiKey??r??dn("OPENAI_API_KEY"),this.organization=e?.configuration?.organization??dn("OPENAI_ORGANIZATION"),this.model=e?.model??e?.modelName??this.model,this.modelKwargs=e?.modelKwargs??{},this.timeout=e?.timeout,this.temperature=e?.temperature??this.temperature,this.topP=e?.topP??this.topP,this.frequencyPenalty=e?.frequencyPenalty??this.frequencyPenalty,this.presencePenalty=e?.presencePenalty??this.presencePenalty,this.logprobs=e?.logprobs,this.topLogprobs=e?.topLogprobs,this.n=e?.n??this.n,this.logitBias=e?.logitBias,this.stop=e?.stopSequences??e?.stop,this.stopSequences=this.stop,this.user=e?.user,this.__includeRawResponse=e?.__includeRawResponse,this.audio=e?.audio,this.modalities=e?.modalities,this.reasoning=e?.reasoning,this.maxTokens=e?.maxCompletionTokens??e?.maxTokens,this.promptCacheKey=e?.promptCacheKey??this.promptCacheKey,this.verbosity=e?.verbosity??this.verbosity,this.disableStreaming=e?.disableStreaming===!0,this.streaming=e?.streaming===!0,this.disableStreaming&&(this.streaming=!1),e?.streaming===!1&&(this.disableStreaming=!0),this.streamUsage=e?.streamUsage??this.streamUsage,this.disableStreaming&&(this.streamUsage=!1),this.clientConfig={apiKey:this.apiKey,organization:this.organization,dangerouslyAllowBrowser:!0,...e?.configuration},e?.supportsStrictToolCalling!==void 0&&(this.supportsStrictToolCalling=e.supportsStrictToolCalling),e?.service_tier!==void 0&&(this.service_tier=e.service_tier),this.zdrEnabled=e?.zdrEnabled??!1}_llmType(){return"openai"}static lc_name(){return"ChatOpenAI"}get callKeys(){return[...super.callKeys,"options","function_call","functions","tools","tool_choice","promptIndex","response_format","seed","reasoning","service_tier"]}get lc_secrets(){return{apiKey:"OPENAI_API_KEY",organization:"OPENAI_ORGANIZATION"}}get lc_aliases(){return{apiKey:"openai_api_key",modelName:"model"}}get lc_serializable_keys(){return["configuration","logprobs","topLogprobs","prefixMessages","supportsStrictToolCalling","modalities","audio","temperature","maxTokens","topP","frequencyPenalty","presencePenalty","n","logitBias","user","streaming","streamUsage","model","modelName","modelKwargs","stop","stopSequences","timeout","apiKey","cache","maxConcurrency","maxRetries","verbose","callbacks","tags","metadata","disableStreaming","zdrEnabled","reasoning","promptCacheKey","verbosity"]}getLsParams(e){let r=this.invocationParams(e);return{ls_provider:"openai",ls_model_name:this.model,ls_model_type:"chat",ls_temperature:r.temperature??void 0,ls_max_tokens:r.max_tokens??void 0,ls_stop:e.stop}}_identifyingParams(){return{model_name:this.model,...this.invocationParams(),...this.clientConfig}}identifyingParams(){return this._identifyingParams()}_getReasoningParams(e){if(!uA(this.model))return;let r;return this.reasoning!==void 0&&(r={...r,...this.reasoning}),e?.reasoning!==void 0&&(r={...r,...e.reasoning}),r}_getResponseFormat(e){return e&&e.type==="json_schema"&&e.json_schema.schema&&Ga(e.json_schema.schema)?dlr(e.json_schema.schema,e.json_schema.name,{description:e.json_schema.description}):e}_combineCallOptions(e){return{...this.defaultOptions,...e??{}}}_getClientOptions(e){if(!this.client){let n={baseURL:this.clientConfig.baseURL},o=cA(n),i={...this.clientConfig,baseURL:o,timeout:this.timeout,maxRetries:0};i.baseURL||delete i.baseURL,this.client=new un(i)}return{...this.clientConfig,...e}}_convertChatOpenAIToolToCompletionsTool(e,r){return L2(e)?_ur(e.metadata.customTool):Wv(e)?r?.strict!==void 0?{...e,function:{...e.function,strict:r.strict}}:e:fur(e,r)}bindTools(e,r){let n;return r?.strict!==void 0?n=r.strict:this.supportsStrictToolCalling!==void 0&&(n=this.supportsStrictToolCalling),this.withConfig({tools:e.map(o=>$W(o)||L2(o)?o:this._convertChatOpenAIToolToCompletionsTool(o,{strict:n})),...r})}async stream(e,r){return super.stream(e,this._combineCallOptions(r))}async invoke(e,r){return super.invoke(e,this._combineCallOptions(r))}_combineLLMOutput(...e){return e.reduce((r,n)=>(n&&n.tokenUsage&&(r.tokenUsage.completionTokens+=n.tokenUsage.completionTokens??0,r.tokenUsage.promptTokens+=n.tokenUsage.promptTokens??0,r.tokenUsage.totalTokens+=n.tokenUsage.totalTokens??0),r),{tokenUsage:{completionTokens:0,promptTokens:0,totalTokens:0}})}async getNumTokensFromMessages(e){let r=0,n=0,o=0;this.model==="gpt-3.5-turbo-0301"?(n=4,o=-1):(n=3,o=1);let i=await Promise.all(e.map(async a=>{let s=await this.getNumTokens(a.content),u=await this.getNumTokens(lA(a)),l=a.name!==void 0?o+await this.getNumTokens(a.name):0,c=s+n+u+l,d=a;if(d._getType()==="function"&&(c-=2),d.additional_kwargs?.function_call&&(c+=3),d?.additional_kwargs.function_call?.name&&(c+=await this.getNumTokens(d.additional_kwargs.function_call?.name)),d.additional_kwargs.function_call?.arguments)try{c+=await this.getNumTokens(JSON.stringify(JSON.parse(d.additional_kwargs.function_call?.arguments)))}catch(f){console.error("Error parsing function arguments",f,JSON.stringify(d.additional_kwargs.function_call)),c+=await this.getNumTokens(d.additional_kwargs.function_call?.arguments)}return r+=c,c}));return r+=3,{totalCount:r,countPerMessage:i}}async _getNumTokensFromGenerations(e){return(await Promise.all(e.map(async n=>n.message.additional_kwargs?.function_call?(await this.getNumTokensFromMessages([n.message])).countPerMessage[0]:await this.getNumTokens(n.message.content)))).reduce((n,o)=>n+o,0)}async _getEstimatedTokenCountFromPrompt(e,r,n){let o=(await this.getNumTokensFromMessages(e)).totalCount;if(r&&n!=="auto"){let i=pur(r);o+=await this.getNumTokens(i),o+=9}return r&&e.find(i=>i._getType()==="system")&&(o-=4),n==="none"?o+=1:typeof n=="object"&&(o+=await this.getNumTokens(n.name)+4),o}_getStructuredOutputMethod(e){let r={...e};if(!this.model.startsWith("gpt-3")&&!this.model.startsWith("gpt-4-")&&this.model!=="gpt-4"){if(r?.method===void 0)return"jsonSchema"}else r.method==="jsonSchema"&&console.warn(`[WARNING]: JSON Schema is not supported for model "${this.model}". Falling back to tool calling.`);return r.method}withStructuredOutput(e,r){let n,o,{schema:i,name:a,includeRaw:s}={...r,schema:e};if(r?.strict!==void 0&&r.method==="jsonMode")throw new Error("Argument `strict` is only supported for `method` = 'function_calling'");let u=clr(this.model,r?.method);if(u==="jsonMode"){Ga(i)?o=Kw.fromZodSchema(i):o=new Tv;let f=Hi(i);n=this.withConfig({outputVersion:"v0",response_format:{type:"json_object"},ls_structured_output_format:{kwargs:{method:"json_mode"},schema:{title:a??"extract",...f}}})}else if(u==="jsonSchema"){let f={name:a??"extract",description:rL(i),schema:i,strict:r?.strict},p=Hi(f.schema);if(n=this.withConfig({outputVersion:"v0",response_format:{type:"json_schema",json_schema:f},ls_structured_output_format:{kwargs:{method:"json_schema"},schema:{title:f.name,description:f.description,...p}}}),Ga(i)){let m=Kw.fromZodSchema(i);o=i_.from(h=>"parsed"in h.additional_kwargs?h.additional_kwargs.parsed:m)}else o=new Tv}else{let f=a??"extract";if(Ga(i)){let p=Hi(i);n=this.withConfig({outputVersion:"v0",tools:[{type:"function",function:{name:f,description:p.description,parameters:p}}],tool_choice:{type:"function",function:{name:f}},ls_structured_output_format:{kwargs:{method:"function_calling"},schema:{title:f,...p}},...r?.strict!==void 0?{strict:r.strict}:{}}),o=new kC({returnSingle:!0,keyName:f,zodSchema:i})}else{let p;typeof i.name=="string"&&typeof i.parameters=="object"&&i.parameters!=null?(p=i,f=i.name):(f=i.title??f,p={name:f,description:i.description??"",parameters:i});let m=Hi(i);n=this.withConfig({outputVersion:"v0",tools:[{type:"function",function:p}],tool_choice:{type:"function",function:{name:f}},ls_structured_output_format:{kwargs:{method:"function_calling"},schema:{title:f,...m}},...r?.strict!==void 0?{strict:r.strict}:{}}),o=new kC({returnSingle:!0,keyName:f})}}if(!s)return n.pipe(o);let l=wu.assign({parsed:(f,p)=>o.invoke(f.raw,p)}),c=wu.assign({parsed:()=>null}),d=l.withFallbacks({fallbacks:[c]});return Sl.from([{raw:n},d])}}});function Koe(t,e){return t.lc_error_code=e,t.message=`${t.message} + +Troubleshooting URL: https://js.langchain.com/docs/troubleshooting/errors/${e}/ +`,t}var Tcr=v(()=>{});function SA(t){if(!t||typeof t!="object")return t;let e;return t.constructor.name===dA.name&&"message"in t&&typeof t.message=="string"?(e=new Error(t.message),e.name="TimeoutError"):t.constructor.name===Mc.name&&"message"in t&&typeof t.message=="string"?(e=new Error(t.message),e.name="AbortError"):"status"in t&&t.status===400&&"message"in t&&typeof t.message=="string"&&t.message.includes("tool_calls")?e=Koe(t,"INVALID_TOOL_RESULTS"):"status"in t&&t.status===401?e=Koe(t,"MODEL_AUTHENTICATION"):"status"in t&&t.status===429?e=Koe(t,"MODEL_RATE_LIMIT"):"status"in t&&t.status===404?e=Koe(t,"MODEL_NOT_FOUND"):e=t,e}var dH=v(()=>{Tcr();wA()});function fto(t){if(t.type==="image"){if(t.url)return{type:"image_url",image_url:{url:t.url}};if(t.data)return{type:"image_url",image_url:{url:`data:${t.mimeType};base64,${t.data}`}}}if(t.type==="audio"&&t.data){let e=MC(()=>{let[,r]=t.mimeType.split("/");return r==="wav"||r==="mp3"?r:"wav"});return{type:"input_audio",input_audio:{data:t.data.toString(),format:e}}}if(t.type==="file"){if(t.data)return{type:"file",file:{file_data:t.data.toString()}};if(t.fileId)return{type:"file",file:{file_id:t.fileId}}}}function Ecr(t,e){let r=lA(t);if(r==="system"&&uA(e)&&(r="developer"),r==="developer")return{role:"developer",content:t.contentBlocks.filter(o=>o.type==="text")};if(r==="system")return{role:"system",content:t.contentBlocks.filter(o=>o.type==="text")};if(r==="assistant")return{role:"assistant",content:t.contentBlocks.filter(o=>o.type==="text")};if(r==="tool"&&Gb.isInstance(t))return{role:"tool",tool_call_id:t.tool_call_id,content:t.contentBlocks.filter(o=>o.type==="text")};if(r==="function")return{role:"function",name:t.name??"",content:t.contentBlocks.filter(o=>o.type==="text").join("")};function*n(o){for(let i of o){i.type==="text"&&(yield{type:"text",text:i.text});let a=fto(i);a&&(yield a)}}return{role:"user",content:Array.from(n(t.contentBlocks))}}function Pcr(t){let e=qs(t)&&t.response_metadata?.model_provider==="openai";function*r(){let n=MC(()=>{try{let y=lA(t);return y==="system"||y==="developer"||y==="assistant"||y==="user"?y:"assistant"}catch{return"assistant"}}),o,i=new Set,a=new Set,s=new Map,u=new Map;function*l(){if(!o)return;let y=o.content;(typeof y=="string"&&y.length>0||Array.isArray(y)&&y.length>0)&&(yield o),o=void 0}let c=y=>{o||(o={type:"message",role:n,content:[]}),typeof o.content=="string"?o.content=o.content.length>0?[{type:"input_text",text:o.content},...y]:[...y]:o.content.push(...y)},d=y=>{if(typeof y=="string")return y;try{return JSON.stringify(y??{})}catch{return"{}"}},f=y=>{let b=MC(()=>{let _=y.metadata?.detail;return _==="low"||_==="high"||_==="auto"?_:"auto"});if(y.fileId)return{type:"input_image",detail:b,file_id:y.fileId};if(y.url)return{type:"input_image",detail:b,image_url:y.url};if(y.data){let _=typeof y.data=="string"?y.data:Buffer.from(y.data).toString("base64"),w=y.mimeType??"image/png";return{type:"input_image",detail:b,image_url:`data:${w};base64,${_}`}}},p=y=>{let b=y.metadata?.filename??y.metadata?.name??y.metadata?.title;if(y.fileId&&typeof b=="string")return{type:"input_file",file_id:y.fileId,...b?{filename:b}:{}};if(y.url&&typeof b=="string")return{type:"input_file",file_url:y.url,...b?{filename:b}:{}};if(y.data&&typeof b=="string"){let _=typeof y.data=="string"?y.data:Buffer.from(y.data).toString("base64");return{type:"input_file",file_data:`data:${y.mimeType??"application/octet-stream"};base64,${_}`,...b?{filename:b}:{}}}},m=y=>{let b=MC(()=>{if(Array.isArray(y.summary)){let O=y.summary?.map(E=>E?.text).filter(E=>typeof E=="string")??[];if(O.length>0)return O}return y.reasoning?[y.reasoning]:[]}),_=b.length>0?b.map(x=>({type:"summary_text",text:x})):[{type:"summary_text",text:""}],w={type:"reasoning",id:y.id??"",summary:_};return y.reasoning&&(w.content=[{type:"reasoning_text",text:y.reasoning}]),w},h=y=>({type:"function_call",name:y.name??"",call_id:y.id??"",arguments:d(y.args)}),g=y=>{let b=d(y.output),_=y.status==="success"?"completed":y.status==="error"?"incomplete":void 0;return{type:"function_call_output",call_id:y.toolCallId??"",output:b,..._?{status:_}:{}}};for(let y of t.contentBlocks)if(y.type==="text")c([{type:"input_text",text:y.text}]);else if(y.type!=="invalid_tool_call"){if(y.type==="reasoning")yield*l(),yield m(y);else if(y.type==="tool_call"){yield*l();let b=y.id??"";b&&(i.add(b),s.delete(b)),yield h(y)}else if(y.type==="tool_call_chunk"){if(y.id){let b=s.get(y.id)??{name:y.name,args:[]};y.name&&(b.name=y.name),y.args&&b.args.push(y.args),s.set(y.id,b)}}else if(y.type==="server_tool_call"){yield*l();let b=y.id??"";b&&(a.add(b),u.delete(b)),yield h(y)}else if(y.type==="server_tool_call_chunk"){if(y.id){let b=u.get(y.id)??{name:y.name,args:[]};y.name&&(b.name=y.name),y.args&&b.args.push(y.args),u.set(y.id,b)}}else if(y.type==="server_tool_call_result")yield*l(),yield g(y);else if(y.type!=="audio")if(y.type==="file"){let b=p(y);b&&c([b])}else if(y.type==="image"){let b=f(y);b&&c([b])}else if(y.type==="video"){let b=p(y);b&&c([b])}else y.type==="text-plain"?y.text&&c([{type:"input_text",text:y.text}]):y.type==="non_standard"&&e&&(yield*l(),yield y.value)}yield*l();for(let[y,b]of s){if(!y||i.has(y))continue;let _=b.args.join("");!b.name&&!_||(yield{type:"function_call",call_id:y,name:b.name??"",arguments:_})}for(let[y,b]of u){if(!y||a.has(y))continue;let _=b.args.join("");!b.name&&!_||(yield{type:"function_call",call_id:y,name:b.name??"",arguments:_})}}return Array.from(r())}var ktt=v(()=>{tk();js()});function Woe(t,e){return t.flatMap(r=>{if("output_version"in r.response_metadata&&r.response_metadata?.output_version==="v1")return Ecr(r);let n=lA(r);n==="system"&&uA(e)&&(n="developer");let o=typeof r.content=="string"?r.content:r.content.map(a=>Qm(a)?oO(a,qtt):a),i={role:n,content:o};if(r.name!=null&&(i.name=r.name),r.additional_kwargs.function_call!=null&&(i.function_call=r.additional_kwargs.function_call,i.content=""),qs(r)&&r.tool_calls?.length?(i.tool_calls=r.tool_calls.map(_k),i.content=""):(r.additional_kwargs.tool_calls!=null&&(i.tool_calls=r.additional_kwargs.tool_calls),r.tool_call_id!=null&&(i.tool_call_id=r.tool_call_id)),r.additional_kwargs.audio&&typeof r.additional_kwargs.audio=="object"&&"id"in r.additional_kwargs.audio){let a={role:"assistant",audio:{id:r.additional_kwargs.audio.id}};return[i,a]}return i})}var qtt,Goe=v(()=>{tk();ktt();lH();js();qtt={providerName:"ChatOpenAI",fromStandardTextBlock(t){return{type:"text",text:t.text}},fromStandardImageBlock(t){if(t.source_type==="url")return{type:"image_url",image_url:{url:t.url,...t.metadata?.detail?{detail:t.metadata.detail}:{}}};if(t.source_type==="base64")return{type:"image_url",image_url:{url:`data:${t.mime_type??""};base64,${t.data}`,...t.metadata?.detail?{detail:t.metadata.detail}:{}}};throw new Error(`Image content blocks with source_type ${t.source_type} are not supported for ChatOpenAI`)},fromStandardAudioBlock(t){if(t.source_type==="url"){let e=Wg({dataUrl:t.url});if(!e)throw new Error(`URL audio blocks with source_type ${t.source_type} must be formatted as a data URL for ChatOpenAI`);let r=e.mime_type||t.mime_type||"",n;try{n=pY(r)}catch{throw new Error(`Audio blocks with source_type ${t.source_type} must have mime type of audio/wav or audio/mp3`)}if(n.type!=="audio"||n.subtype!=="wav"&&n.subtype!=="mp3")throw new Error(`Audio blocks with source_type ${t.source_type} must have mime type of audio/wav or audio/mp3`);return{type:"input_audio",input_audio:{format:n.subtype,data:e.data}}}if(t.source_type==="base64"){let e;try{e=pY(t.mime_type??"")}catch{throw new Error(`Audio blocks with source_type ${t.source_type} must have mime type of audio/wav or audio/mp3`)}if(e.type!=="audio"||e.subtype!=="wav"&&e.subtype!=="mp3")throw new Error(`Audio blocks with source_type ${t.source_type} must have mime type of audio/wav or audio/mp3`);return{type:"input_audio",input_audio:{format:e.subtype,data:t.data}}}throw new Error(`Audio content blocks with source_type ${t.source_type} are not supported for ChatOpenAI`)},fromStandardFileBlock(t){if(t.source_type==="url"){if(!Wg({dataUrl:t.url}))throw new Error(`URL file blocks with source_type ${t.source_type} must be formatted as a data URL for ChatOpenAI`);return{type:"file",file:{file_data:t.url,...t.metadata?.filename||t.metadata?.name?{filename:t.metadata?.filename||t.metadata?.name}:{}}}}if(t.source_type==="base64")return{type:"file",file:{file_data:`data:${t.mime_type??""};base64,${t.data}`,...t.metadata?.filename||t.metadata?.name||t.metadata?.title?{filename:t.metadata?.filename||t.metadata?.name||t.metadata?.title}:{}}};if(t.source_type==="id")return{type:"file",file:{file_id:t.id}};throw new Error(`File content blocks with source_type ${t.source_type} are not supported for ChatOpenAI`)}}});var M8,FCe,kCe=v(()=>{tk();boe();nCe();Joe();dH();ktt();Goe();Gv();lH();js();gm();M8="__openai_function_call_ids__",FCe=class extends cH{invocationParams(t){let e;t?.strict!==void 0?e=t.strict:this.supportsStrictToolCalling!==void 0&&(e=this.supportsStrictToolCalling);let r={model:this.model,temperature:this.temperature,top_p:this.topP,user:this.user,stream:this.streaming,previous_response_id:t?.previous_response_id,truncation:t?.truncation,include:t?.include,tools:t?.tools?.length?this._reduceChatOpenAITools(t.tools,{stream:this.streaming,strict:e}):void 0,tool_choice:hur(t?.tool_choice)?t?.tool_choice:(()=>{let o=J0e(t?.tool_choice);if(typeof o=="object"&&"type"in o){if(o.type==="function")return{type:"function",name:o.function.name};if(o.type==="allowed_tools")return{type:"allowed_tools",mode:o.allowed_tools.mode,tools:o.allowed_tools.tools};if(o.type==="custom")return{type:"custom",name:o.custom.name}}})(),text:(()=>{if(t?.text)return t.text;let o=this._getResponseFormat(t?.response_format);return o?.type==="json_schema"?o.json_schema.schema!=null?{format:{type:"json_schema",schema:o.json_schema.schema,description:o.json_schema.description,name:o.json_schema.name,strict:o.json_schema.strict},verbosity:t?.verbosity}:void 0:{format:o,verbosity:t?.verbosity}})(),parallel_tool_calls:t?.parallel_tool_calls,max_output_tokens:this.maxTokens===-1?void 0:this.maxTokens,prompt_cache_key:t?.promptCacheKey??this.promptCacheKey,...this.zdrEnabled?{store:!1}:{},...this.modelKwargs},n=this._getReasoningParams(t);return n!==void 0&&(r.reasoning=n),r}async _generate(t,e){let r=this.invocationParams(e);if(r.stream){let n=this._streamResponseChunks(t,e),o;for await(let i of n)i.message.response_metadata={...i.generationInfo,...i.message.response_metadata},o=o?.concat(i)??i;return{generations:o?[o]:[],llmOutput:{estimatedTokenUsage:o?.message?.usage_metadata}}}else{let n=this._convertMessagesToResponsesParams(t),o=await this.completionWithRetry({input:n,...r,stream:!1},{signal:e?.signal,...e?.options});return{generations:[{text:o.output_text,message:this._convertResponsesMessageToBaseMessage(o)}],llmOutput:{id:o.id,estimatedTokenUsage:o.usage?{promptTokens:o.usage.input_tokens,completionTokens:o.usage.output_tokens,totalTokens:o.usage.total_tokens}:void 0}}}}async*_streamResponseChunks(t,e,r){let n=await this.completionWithRetry({...this.invocationParams(e),input:this._convertMessagesToResponsesParams(t),stream:!0},e);for await(let o of n){let i=this._convertResponsesDeltaToBaseMessageChunk(o);i!=null&&(yield i,await r?.handleLLMNewToken(i.text||"",{prompt:e.promptIndex??0,completion:0},void 0,void 0,void 0,{chunk:i}))}}async completionWithRetry(t,e){return this.caller.call(async()=>{let r=this._getClientOptions(e);try{return t.text?.format?.type==="json_schema"&&!t.stream?await this.client.responses.parse(t,r):await this.client.responses.create(t,r)}catch(n){throw SA(n)}})}_convertResponsesMessageToBaseMessage(t){if(t.error){let s=new Error(t.error.message);throw s.name=t.error.code,s}let e,r=[],n=[],o=[],i={model_provider:"openai",model:t.model,created_at:t.created_at,id:t.id,incomplete_details:t.incomplete_details,metadata:t.metadata,object:t.object,status:t.status,user:t.user,service_tier:t.service_tier,model_name:t.model},a={};for(let s of t.output)if(s.type==="message")e=s.id,r.push(...s.content.flatMap(u=>u.type==="output_text"?("parsed"in u&&u.parsed!=null&&(a.parsed=u.parsed),{type:"text",text:u.text,annotations:u.annotations}):u.type==="refusal"?(a.refusal=u.refusal,[]):u));else if(s.type==="function_call"){let u={function:{name:s.name,arguments:s.arguments},id:s.call_id};try{n.push(LC(u,{returnId:!0}))}catch(l){let c;typeof l=="object"&&l!=null&&"message"in l&&typeof l.message=="string"&&(c=l.message),o.push(FC(u,c))}a[M8]??(a[M8]={}),s.id&&(a[M8][s.call_id]=s.id)}else if(s.type==="reasoning")a.reasoning=s;else if(s.type==="custom_tool_call"){let u=gur(s);u?n.push(u):o.push(FC(s,"Malformed custom tool call"))}else a.tool_outputs??(a.tool_outputs=[]),a.tool_outputs.push(s);return new li({id:e,content:r,tool_calls:n,invalid_tool_calls:o,usage_metadata:FQe(t.usage),additional_kwargs:a,response_metadata:i})}_convertResponsesDeltaToBaseMessageChunk(t){let e=[],r={},n,o=[],i={model_provider:"openai"},a={},s;if(t.type==="response.output_text.delta")e.push({type:"text",text:t.delta,index:t.content_index});else if(t.type==="response.output_text.annotation.added")e.push({type:"text",text:"",annotations:[t.annotation],index:t.content_index});else if(t.type==="response.output_item.added"&&t.item.type==="message")s=t.item.id;else if(t.type==="response.output_item.added"&&t.item.type==="function_call")o.push({type:"tool_call_chunk",name:t.item.name,args:t.item.arguments,id:t.item.call_id,index:t.output_index}),a[M8]={[t.item.call_id]:t.item.id};else if(t.type==="response.output_item.done"&&["web_search_call","file_search_call","computer_call","code_interpreter_call","mcp_call","mcp_list_tools","mcp_approval_request","image_generation_call","custom_tool_call"].includes(t.item.type))a.tool_outputs=[t.item];else if(t.type==="response.created")i.id=t.response.id,i.model_name=t.response.model,i.model=t.response.model;else if(t.type==="response.completed"){let u=this._convertResponsesMessageToBaseMessage(t.response);n=FQe(t.response.usage),t.response.text?.format?.type==="json_schema"&&(a.parsed??(a.parsed=JSON.parse(u.text)));for(let[l,c]of Object.entries(t.response))l!=="id"&&(i[l]=c)}else if(t.type==="response.function_call_arguments.delta"||t.type==="response.custom_tool_call_input.delta")o.push({type:"tool_call_chunk",args:t.delta,index:t.output_index});else if(t.type==="response.web_search_call.completed"||t.type==="response.file_search_call.completed")r={tool_outputs:{id:t.item_id,type:t.type.replace("response.","").replace(".completed",""),status:"completed"}};else if(t.type==="response.refusal.done")a.refusal=t.refusal;else if(t.type==="response.output_item.added"&&"item"in t&&t.item.type==="reasoning"){let u=t.item.summary?t.item.summary.map((l,c)=>({...l,index:c})):void 0;a.reasoning={id:t.item.id,type:t.item.type,...u?{summary:u}:{}}}else if(t.type==="response.reasoning_summary_part.added")a.reasoning={type:"reasoning",summary:[{...t.part,index:t.summary_index}]};else if(t.type==="response.reasoning_summary_text.delta")a.reasoning={type:"reasoning",summary:[{text:t.delta,type:"summary_text",index:t.summary_index}]};else return t.type==="response.image_generation_call.partial_image",null;return new Oi({text:e.map(u=>u.text).join(""),message:new Nr({id:s,content:e,tool_call_chunks:o,usage_metadata:n,additional_kwargs:a,response_metadata:i}),generationInfo:r})}_convertMessagesToResponsesParams(t){return t.flatMap(e=>{let r=e.response_metadata;if(r?.output_version==="v1")return Pcr(e);let n=e.additional_kwargs,o=lA(e);if(o==="system"&&uA(this.model)&&(o="developer"),o==="function")throw new Error("Function messages are not supported in Responses API");if(o==="tool"){let i=e;return n?.type==="computer_call_output"?{type:"computer_call_output",output:(()=>{if(typeof i.content=="string")return{type:"computer_screenshot",image_url:i.content};if(Array.isArray(i.content)){let s=i.content.find(l=>l.type==="computer_screenshot");if(s)return s;let u=i.content.find(l=>l.type==="image_url");if(u)return{type:"computer_screenshot",image_url:typeof u.image_url=="string"?u.image_url:u.image_url.url}}throw new Error("Invalid computer call output")})(),call_id:i.tool_call_id}:i.additional_kwargs?.customTool?{type:"custom_tool_call_output",call_id:i.tool_call_id,output:i.content}:{type:"function_call_output",call_id:i.tool_call_id,id:i.id?.startsWith("fc_")?i.id:void 0,output:typeof i.content!="string"?JSON.stringify(i.content):i.content}}if(o==="assistant"){if(!this.zdrEnabled&&r?.output!=null&&Array.isArray(r?.output)&&r?.output.length>0&&r?.output.every(c=>"type"in c))return r?.output;let i=[];if(n?.reasoning&&!this.zdrEnabled){let c=this._convertReasoningSummary(n.reasoning);i.push(c)}let{content:a}=e;n?.refusal&&(typeof a=="string"&&(a=[{type:"output_text",text:a,annotations:[]}]),a=[...a,{type:"refusal",refusal:n.refusal}]),(typeof a=="string"||a.length>0)&&i.push({type:"message",role:"assistant",...e.id&&!this.zdrEnabled&&e.id.startsWith("msg_")?{id:e.id}:{},content:MC(()=>typeof a=="string"?a:a.flatMap(c=>c.type==="text"?{type:"output_text",text:c.text,annotations:c.annotations??[]}:c.type==="output_text"||c.type==="refusal"?c:[]))});let s=n?.[M8];qs(e)&&e.tool_calls?.length?i.push(...e.tool_calls.map(c=>yur(c)?{type:"custom_tool_call",id:c.call_id,call_id:c.id??"",input:c.args.input,name:c.name}:{type:"function_call",name:c.name,arguments:JSON.stringify(c.args),call_id:c.id,...this.zdrEnabled?{id:s?.[c.id]}:{}})):n?.tool_calls&&i.push(...n.tool_calls.map(c=>({type:"function_call",name:c.function.name,call_id:c.id,arguments:c.function.arguments,...this.zdrEnabled?{id:s?.[c.id]}:{}})));let u=r?.output?.length?r?.output:n.tool_outputs,l=["computer_call","mcp_call","code_interpreter_call","image_generation_call"];if(u!=null){let d=u?.filter(f=>l.includes(f.type));d.length>0&&i.push(...d)}return i}if(o==="user"||o==="system"||o==="developer"){if(typeof e.content=="string")return{type:"message",role:o,content:e.content};let i=[],a=e.content.flatMap(s=>{if(s.type==="mcp_approval_response"&&i.push({type:"mcp_approval_response",approval_request_id:s.approval_request_id,approve:s.approve}),Qm(s))return oO(s,qtt);if(s.type==="text")return{type:"input_text",text:s.text};if(s.type==="image_url"){let u=MC(()=>{if(typeof s.image_url=="string")return s.image_url;if(typeof s.image_url=="object"&&s.image_url!==null&&"url"in s.image_url)return s.image_url.url}),l=MC(()=>{if(typeof s.image_url=="string")return"auto";if(typeof s.image_url=="object"&&s.image_url!==null&&"detail"in s.image_url)return s.image_url.detail});return{type:"input_image",image_url:u,detail:l}}return s.type==="input_text"||s.type==="input_image"||s.type==="input_file"?s:[]});return a.length>0&&i.push({type:"message",role:o,content:a}),i}return console.warn(`Unsupported role found when converting to OpenAI Responses API: ${o}`),[]})}_convertReasoningSummary(t){let e=(t.summary.length>1?t.summary.reduce((r,n)=>{let o=r[r.length-1];return o.index===n.index?o.text+=n.text:r.push(n),r},[{...t.summary[0]}]):t.summary).map(r=>Object.fromEntries(Object.entries(r).filter(([n])=>n!=="index")));return{...t,summary:e}}_reduceChatOpenAITools(t,e){let r=[];for(let n of t)if($W(n))n.type==="image_generation"&&e?.stream&&(n.partial_images=1),r.push(n);else if(L2(n)){let o=n.metadata.customTool;r.push({type:"custom",name:o.name,description:o.description,format:o.format})}else Wv(n)?r.push({type:"function",name:n.function.name,parameters:n.function.parameters,description:n.function.description,strict:e?.strict??null}):K0e(n)&&r.push(bur(n));return r}}});var vk,qCe=v(()=>{tk();boe();nCe();Joe();dH();Goe();lH();js();gm();vk=class extends cH{invocationParams(t,e){let r;t?.strict!==void 0?r=t.strict:this.supportsStrictToolCalling!==void 0&&(r=this.supportsStrictToolCalling);let n={};t?.stream_options!==void 0?n={stream_options:t.stream_options}:this.streamUsage&&(this.streaming||e?.streaming)&&(n={stream_options:{include_usage:!0}});let o={model:this.model,temperature:this.temperature,top_p:this.topP,frequency_penalty:this.frequencyPenalty,presence_penalty:this.presencePenalty,logprobs:this.logprobs,top_logprobs:this.topLogprobs,n:this.n,logit_bias:this.logitBias,stop:t?.stop??this.stopSequences,user:this.user,stream:this.streaming,functions:t?.functions,function_call:t?.function_call,tools:t?.tools?.length?t.tools.map(a=>this._convertChatOpenAIToolToCompletionsTool(a,{strict:r})):void 0,tool_choice:J0e(t?.tool_choice),response_format:this._getResponseFormat(t?.response_format),seed:t?.seed,...n,parallel_tool_calls:t?.parallel_tool_calls,...this.audio||t?.audio?{audio:this.audio||t?.audio}:{},...this.modalities||t?.modalities?{modalities:this.modalities||t?.modalities}:{},...this.modelKwargs,prompt_cache_key:t?.promptCacheKey??this.promptCacheKey,verbosity:t?.verbosity??this.verbosity};t?.prediction!==void 0&&(o.prediction=t.prediction),this.service_tier!==void 0&&(o.service_tier=this.service_tier),t?.service_tier!==void 0&&(o.service_tier=t.service_tier);let i=this._getReasoningParams(t);return i!==void 0&&i.effort!==void 0&&(o.reasoning_effort=i.effort),uA(o.model)?o.max_completion_tokens=this.maxTokens===-1?void 0:this.maxTokens:o.max_tokens=this.maxTokens===-1?void 0:this.maxTokens,o}async _generate(t,e,r){let n={},o=this.invocationParams(e),i=Woe(t,this.model);if(o.stream){let a=this._streamResponseChunks(t,e,r),s={};for await(let p of a){p.message.response_metadata={...p.generationInfo,...p.message.response_metadata};let m=p.generationInfo?.completion??0;s[m]===void 0?s[m]=p:s[m]=s[m].concat(p)}let u=Object.entries(s).sort(([p],[m])=>parseInt(p,10)-parseInt(m,10)).map(([p,m])=>m),{functions:l,function_call:c}=this.invocationParams(e),d=await this._getEstimatedTokenCountFromPrompt(t,l,c),f=await this._getNumTokensFromGenerations(u);return n.input_tokens=d,n.output_tokens=f,n.total_tokens=d+f,{generations:u,llmOutput:{estimatedTokenUsage:{promptTokens:n.input_tokens,completionTokens:n.output_tokens,totalTokens:n.total_tokens}}}}else{let a=await this.completionWithRetry({...o,stream:!1,messages:i},{signal:e?.signal,...e?.options}),{completion_tokens:s,prompt_tokens:u,total_tokens:l,prompt_tokens_details:c,completion_tokens_details:d}=a?.usage??{};s&&(n.output_tokens=(n.output_tokens??0)+s),u&&(n.input_tokens=(n.input_tokens??0)+u),l&&(n.total_tokens=(n.total_tokens??0)+l),(c?.audio_tokens!==null||c?.cached_tokens!==null)&&(n.input_token_details={...c?.audio_tokens!==null&&{audio:c?.audio_tokens},...c?.cached_tokens!==null&&{cache_read:c?.cached_tokens}}),(d?.audio_tokens!==null||d?.reasoning_tokens!==null)&&(n.output_token_details={...d?.audio_tokens!==null&&{audio:d?.audio_tokens},...d?.reasoning_tokens!==null&&{reasoning:d?.reasoning_tokens}});let f=[];for(let p of a?.choices??[]){let h={text:p.message?.content??"",message:this._convertCompletionsMessageToBaseMessage(p.message??{role:"assistant"},a)};h.generationInfo={...p.finish_reason?{finish_reason:p.finish_reason}:{},...p.logprobs?{logprobs:p.logprobs}:{}},qs(h.message)&&(h.message.usage_metadata=n),h.message=new li(Object.fromEntries(Object.entries(h.message).filter(([g])=>!g.startsWith("lc_")))),f.push(h)}return{generations:f,llmOutput:{tokenUsage:{promptTokens:n.input_tokens,completionTokens:n.output_tokens,totalTokens:n.total_tokens}}}}}async*_streamResponseChunks(t,e,r){let n=Woe(t,this.model),o={...this.invocationParams(e,{streaming:!0}),messages:n,stream:!0},i,a=await this.completionWithRetry(o,e),s;for await(let u of a){let l=u?.choices?.[0];if(u.usage&&(s=u.usage),!l)continue;let{delta:c}=l;if(!c)continue;let d=this._convertCompletionsDeltaToBaseMessageChunk(c,u,i);i=c.role??i;let f={prompt:e.promptIndex??0,completion:l.index??0};if(typeof d.content!="string"){console.log("[WARNING]: Received non-string content from OpenAI. This is currently not supported.");continue}let p={...f};l.finish_reason!=null&&(p.finish_reason=l.finish_reason,p.system_fingerprint=u.system_fingerprint,p.model_name=u.model,p.service_tier=u.service_tier),this.logprobs&&(p.logprobs=l.logprobs);let m=new Oi({message:d,text:d.content,generationInfo:p});yield m,await r?.handleLLMNewToken(m.text??"",f,void 0,void 0,void 0,{chunk:m})}if(s){let u={...s.prompt_tokens_details?.audio_tokens!==null&&{audio:s.prompt_tokens_details?.audio_tokens},...s.prompt_tokens_details?.cached_tokens!==null&&{cache_read:s.prompt_tokens_details?.cached_tokens}},l={...s.completion_tokens_details?.audio_tokens!==null&&{audio:s.completion_tokens_details?.audio_tokens},...s.completion_tokens_details?.reasoning_tokens!==null&&{reasoning:s.completion_tokens_details?.reasoning_tokens}};yield new Oi({message:new Nr({content:"",response_metadata:{usage:{...s}},usage_metadata:{input_tokens:s.prompt_tokens,output_tokens:s.completion_tokens,total_tokens:s.total_tokens,...Object.keys(u).length>0&&{input_token_details:u},...Object.keys(l).length>0&&{output_token_details:l}}}),text:""})}if(e.signal?.aborted)throw new Error("AbortError")}async completionWithRetry(t,e){let r=this._getClientOptions(e),n=t.response_format&&t.response_format.type==="json_schema";return this.caller.call(async()=>{try{return n&&!t.stream?await this.client.chat.completions.parse(t,r):await this.client.chat.completions.create(t,r)}catch(o){throw SA(o)}})}_convertCompletionsMessageToBaseMessage(t,e){let r=t.tool_calls;switch(t.role){case"assistant":{let n=[],o=[];for(let u of r??[])try{n.push(LC(u,{returnId:!0}))}catch(l){o.push(FC(u,l.message))}let i={function_call:t.function_call,tool_calls:r};this.__includeRawResponse!==void 0&&(i.__raw_response=e);let a={model_provider:"openai",model_name:e.model,...e.system_fingerprint?{usage:{...e.usage},system_fingerprint:e.system_fingerprint}:{}};t.audio&&(i.audio=t.audio);let s=flr(t.content||"",e.choices?.[0]?.message);return new li({content:s,tool_calls:n,invalid_tool_calls:o,additional_kwargs:i,response_metadata:a,id:e.id})}default:return new ud(t.content||"",t.role??"unknown")}}_convertCompletionsDeltaToBaseMessageChunk(t,e,r){let n=t.role??r,o=t.content??"",i;t.function_call?i={function_call:t.function_call}:t.tool_calls?i={tool_calls:t.tool_calls}:i={},this.__includeRawResponse&&(i.__raw_response=e),t.audio&&(i.audio={...t.audio,index:e.choices[0].index});let a={model_provider:"openai",usage:{...e.usage}};if(n==="user")return new vv({content:o,response_metadata:a});if(n==="assistant"){let s=[];if(Array.isArray(t.tool_calls))for(let u of t.tool_calls)s.push({name:u.function?.name,args:u.function?.arguments,id:u.id,index:u.index,type:"tool_call_chunk"});return new Nr({content:o,tool_call_chunks:s,additional_kwargs:i,id:e.id,response_metadata:a})}else return n==="system"?new Ky({content:o,response_metadata:a}):n==="developer"?new Ky({content:o,response_metadata:a,additional_kwargs:{__openai_role__:"developer"}}):n==="function"?new _v({content:o,additional_kwargs:i,name:t.name,response_metadata:a}):n==="tool"?new Iw({content:o,additional_kwargs:i,tool_call_id:t.tool_call_id,response_metadata:a}):new bv({content:o,role:n,response_metadata:a})}}});var qC,Btt=v(()=>{boe();Joe();kCe();qCe();qC=class Mcr extends cH{constructor(r){super(r);M(this,"useResponsesApi",!1);M(this,"responses");M(this,"completions");this.fields=r,this.useResponsesApi=r?.useResponsesApi??!1,this.responses=r?.responses??new FCe(r),this.completions=r?.completions??new vk(r)}get lc_serializable_keys(){return[...super.lc_serializable_keys,"useResponsesApi"]}get callKeys(){return[...super.callKeys,"useResponsesApi"]}_useResponsesApi(r){let n=r?.tools?.some($W),o=r?.previous_response_id!=null||r?.text!=null||r?.truncation!=null||r?.include!=null||r?.reasoning?.summary!=null||this.reasoning?.summary!=null,i=r?.tools?.some(K0e)||r?.tools?.some(L2);return this.useResponsesApi||n||o||i}getLsParams(r){let n=this._combineCallOptions(r);return this._useResponsesApi(r)?this.responses.getLsParams(n):this.completions.getLsParams(n)}invocationParams(r){let n=this._combineCallOptions(r);return this._useResponsesApi(r)?this.responses.invocationParams(n):this.completions.invocationParams(n)}async _generate(r,n,o){return this._useResponsesApi(n)?this.responses._generate(r,n):this.completions._generate(r,n,o)}async*_streamResponseChunks(r,n,o){if(this._useResponsesApi(n)){yield*this.responses._streamResponseChunks(r,this._combineCallOptions(n),o);return}yield*this.completions._streamResponseChunks(r,this._combineCallOptions(n),o)}withConfig(r){let n=new Mcr(this.fields);return n.defaultOptions={...this.defaultOptions,...r},n}}});var BCe=v(()=>{rk();wA();Yu()});var Utt=v(()=>{qCe();BCe()});var ztt=v(()=>{kCe();BCe()});var Dcr=v(()=>{Btt();BCe();Utt();ztt()});var Htt=v(()=>{rk();dH();wA();Yu();Gv();gm();doe();YF()});var $cr=v(()=>{rk();Htt();wA();Yu()});var wk,Vtt=v(()=>{rk();dH();wA();Yu();YF();A2();wk=class extends MS{constructor(e){let r={maxConcurrency:2,...e};super(r);M(this,"model","text-embedding-ada-002");M(this,"modelName");M(this,"batchSize",512);M(this,"stripNewLines",!0);M(this,"dimensions");M(this,"timeout");M(this,"organization");M(this,"encodingFormat");M(this,"client");M(this,"clientConfig");let n=r?.apiKey??r?.openAIApiKey??dn("OPENAI_API_KEY");this.organization=r?.configuration?.organization??dn("OPENAI_ORGANIZATION"),this.model=r?.model??r?.modelName??this.model,this.modelName=this.model,this.batchSize=r?.batchSize??this.batchSize,this.stripNewLines=r?.stripNewLines??this.stripNewLines,this.timeout=r?.timeout,this.dimensions=r?.dimensions,this.encodingFormat=r?.encodingFormat,this.clientConfig={apiKey:n,organization:this.organization,dangerouslyAllowBrowser:!0,...e?.configuration}}async embedDocuments(e){let r=RS(this.stripNewLines?e.map(a=>a.replace(/\n/g," ")):e,this.batchSize),n=r.map(a=>{let s={model:this.model,input:a};return this.dimensions&&(s.dimensions=this.dimensions),this.encodingFormat&&(s.encoding_format=this.encodingFormat),this.embeddingWithRetry(s)}),o=await Promise.all(n),i=[];for(let a=0;a{try{return await this.client.embeddings.create(e,r)}catch(n){throw SA(n)}})}}});var Jtt,Lcr=v(()=>{rk();dH();Vtt();wA();Yu();Jtt=class extends wk{constructor(e){super(e);M(this,"azureOpenAIApiVersion");M(this,"azureOpenAIApiKey");M(this,"azureADTokenProvider");M(this,"azureOpenAIApiInstanceName");M(this,"azureOpenAIApiDeploymentName");M(this,"azureOpenAIBasePath");this.batchSize=e?.batchSize??1,this.azureOpenAIApiKey=e?.azureOpenAIApiKey??e?.apiKey??dn("AZURE_OPENAI_API_KEY"),this.azureOpenAIApiVersion=e?.azureOpenAIApiVersion??e?.openAIApiVersion??dn("AZURE_OPENAI_API_VERSION"),this.azureOpenAIBasePath=e?.azureOpenAIBasePath??dn("AZURE_OPENAI_BASE_PATH"),this.azureOpenAIApiInstanceName=e?.azureOpenAIApiInstanceName??dn("AZURE_OPENAI_API_INSTANCE_NAME"),this.azureOpenAIApiDeploymentName=(e?.azureOpenAIApiEmbeddingsDeploymentName||e?.azureOpenAIApiDeploymentName)??(dn("AZURE_OPENAI_API_EMBEDDINGS_DEPLOYMENT_NAME")||dn("AZURE_OPENAI_API_DEPLOYMENT_NAME")),this.azureADTokenProvider=e?.azureADTokenProvider}async embeddingWithRetry(e){if(!this.client){let n={azureOpenAIApiDeploymentName:this.azureOpenAIApiDeploymentName,azureOpenAIApiInstanceName:this.azureOpenAIApiInstanceName,azureOpenAIApiKey:this.azureOpenAIApiKey,azureOpenAIBasePath:this.azureOpenAIBasePath,azureADTokenProvider:this.azureADTokenProvider,baseURL:this.clientConfig.baseURL},o=cA(n),i={...this.clientConfig,baseURL:o,timeout:this.timeout,maxRetries:0};this.azureADTokenProvider||(i.apiKey=n.azureOpenAIApiKey),i.baseURL||delete i.baseURL;let a=yoe(i.defaultHeaders);i.defaultHeaders={...i.defaultHeaders,"User-Agent":a["User-Agent"]?`${a["User-Agent"]}: langchainjs-azure-openai-v2`:"langchainjs-azure-openai-v2"},this.client=new uH({apiVersion:this.azureOpenAIApiVersion,azureADTokenProvider:this.azureADTokenProvider,deployment:this.azureOpenAIApiDeploymentName,...i})}let r={};return this.azureOpenAIApiKey&&(r.headers={"api-key":this.azureOpenAIApiKey,...r.headers},r.query={"api-version":this.azureOpenAIApiVersion,...r.query}),this.caller.call(async()=>{try{return await this.client.embeddings.create(e,r)}catch(n){throw SA(n)}})}}});var Ktt=v(()=>{ey()});var JCe={};Jn(JCe,{ZodISODate:()=>zCe,ZodISODateTime:()=>UCe,ZodISODuration:()=>VCe,ZodISOTime:()=>HCe,date:()=>Gtt,datetime:()=>Wtt,duration:()=>Xtt,time:()=>Ztt});function Wtt(t){return ize(UCe,t)}function Gtt(t){return aze(zCe,t)}function Ztt(t){return sze(HCe,t)}function Xtt(t){return uze(VCe,t)}var UCe,zCe,HCe,VCe,KCe=v(()=>{ey();WCe();UCe=ve("ZodISODateTime",(t,e)=>{uUe.init(t,e),ku.init(t,e)});zCe=ve("ZodISODate",(t,e)=>{lUe.init(t,e),ku.init(t,e)});HCe=ve("ZodISOTime",(t,e)=>{cUe.init(t,e),ku.init(t,e)});VCe=ve("ZodISODuration",(t,e)=>{dUe.init(t,e),ku.init(t,e)})});var kcr,bto,R8,Ytt=v(()=>{ey();ey();kcr=(t,e)=>{YY.init(t,e),t.name="ZodError",Object.defineProperties(t,{format:{value:r=>eQ(t,r)},flatten:{value:r=>QY(t,r)},addIssue:{value:r=>t.issues.push(r)},addIssues:{value:r=>t.issues.push(...r)},isEmpty:{get(){return t.issues.length===0}}})},bto=ve("ZodError",kcr),R8=ve("ZodError",kcr,{Parent:Error})});var Qtt,ert,trt,rrt,nrt=v(()=>{ey();Ytt();Qtt=eme(R8),ert=tme(R8),trt=rme(R8),rrt=nme(R8)});function ort(t){return rze(Xoe,t)}function vto(t){return yme(srt,t)}function wto(t){return lQ(GCe,t)}function Sto(t){return bme(U1,t)}function Cto(t){return _me(U1,t)}function xto(t){return vme(U1,t)}function Oto(t){return wme(U1,t)}function Tto(t){return Sme(urt,t)}function Eto(t){return Cme(lrt,t)}function Pto(t){return xme(crt,t)}function Mto(t){return Ome(drt,t)}function Rto(t){return Tme(frt,t)}function Ato(t){return Eme(prt,t)}function Ito(t){return Pme(mrt,t)}function Nto(t){return Mme(hrt,t)}function jto(t){return Rme(grt,t)}function Dto(t){return Ame(yrt,t)}function $to(t){return Ime(brt,t)}function Lto(t){return Nme(_rt,t)}function Fto(t){return jme(vrt,t)}function kto(t){return Dme(wrt,t)}function qto(t){return $me(Srt,t)}function Bto(t){return Lme(Crt,t)}function Uto(t,e,r={}){return qze(qcr,t,e,r)}function Bcr(t){return lze(Yoe,t)}function irt(t){return dze(A8,t)}function zto(t){return fze(A8,t)}function Hto(t){return pze(A8,t)}function Vto(t){return mze(A8,t)}function Jto(t){return hze(A8,t)}function Ucr(t){return gze(Qoe,t)}function Kto(t){return bze(eie,t)}function Wto(t){return vze(xrt,t)}function Gto(t){return wze(xrt,t)}function Zto(t){return Sze(zcr,t)}function Xto(t){return Cze(Hcr,t)}function Jcr(t){return xze(Vcr,t)}function Yto(){return Oze(Kcr)}function ZCe(){return Z$(Wcr)}function exe(t){return cQ(Gcr,t)}function Qto(t){return Tze(Zcr,t)}function ero(t){return Eze(txe,t)}function Ort(t,e){return CQ(Xcr,t,e)}function tro(t){let e=t._zod.def.shape;return sdr(Object.keys(e))}function rro(t,e){let r={type:"object",get shape(){return xt.assignProp(this,"shape",{...t}),this.shape},...xt.normalizeParams(e)};return new rxe(r)}function nro(t,e){return new rxe({type:"object",get shape(){return xt.assignProp(this,"shape",{...t}),this.shape},catchall:exe(),...xt.normalizeParams(e)})}function oro(t,e){return new rxe({type:"object",get shape(){return xt.assignProp(this,"shape",{...t}),this.shape},catchall:ZCe(),...xt.normalizeParams(e)})}function nxe(t,e){return new Trt({type:"union",options:t,...xt.normalizeParams(e)})}function iro(t,e,r){return new Ycr({type:"union",options:e,discriminator:t,...xt.normalizeParams(r)})}function edr(t,e){return new Qcr({type:"intersection",left:t,right:e})}function aro(t,e,r){let n=e instanceof Yn,o=n?r:e,i=n?e:null;return new tdr({type:"tuple",items:t,rest:i,...xt.normalizeParams(o)})}function rdr(t,e,r){return new Ert({type:"record",keyType:t,valueType:e,...xt.normalizeParams(r)})}function sro(t,e,r){return new Ert({type:"record",keyType:nxe([t,exe()]),valueType:e,...xt.normalizeParams(r)})}function uro(t,e,r){return new ndr({type:"map",keyType:t,valueType:e,...xt.normalizeParams(r)})}function lro(t,e){return new odr({type:"set",valueType:t,...xt.normalizeParams(e)})}function idr(t,e){let r=Array.isArray(t)?Object.fromEntries(t.map(n=>[n,n])):t;return new Zoe({type:"enum",entries:r,...xt.normalizeParams(e)})}function cro(t,e){return new Zoe({type:"enum",entries:t,...xt.normalizeParams(e)})}function sdr(t,e){return new adr({type:"literal",values:Array.isArray(t)?t:[t],...xt.normalizeParams(e)})}function dro(t){return $ze(udr,t)}function Mrt(t){return new Prt({type:"transform",transform:t})}function XCe(t){return new Rrt({type:"optional",innerType:t})}function YCe(t){return new ldr({type:"nullable",innerType:t})}function fro(t){return XCe(YCe(t))}function ddr(t,e){return new cdr({type:"default",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function pdr(t,e){return new fdr({type:"prefault",innerType:t,get defaultValue(){return typeof e=="function"?e():e}})}function mdr(t,e){return new Art({type:"nonoptional",innerType:t,...xt.normalizeParams(e)})}function pro(t){return new hdr({type:"success",innerType:t})}function ydr(t,e){return new gdr({type:"catch",innerType:t,catchValue:typeof e=="function"?e:()=>e})}function mro(t){return Mze(bdr,t)}function QCe(t,e){return new Irt({type:"pipe",in:t,out:e})}function vdr(t){return new _dr({type:"readonly",innerType:t})}function hro(t,e){return new wdr({type:"template_literal",parts:t,...xt.normalizeParams(e)})}function Cdr(t){return new Sdr({type:"lazy",getter:t})}function gro(t){return new xdr({type:"promise",innerType:t})}function Odr(t){let e=new Zl({check:"custom"});return e._zod.check=t,e}function yro(t,e){return Lze(oxe,t??(()=>!0),e)}function Tdr(t,e={}){return Fze(oxe,t,e)}function Edr(t){let e=Odr(r=>(r.addIssue=n=>{if(typeof n=="string")r.issues.push(xt.issue(n,r.value,e._zod.def));else{let o=n;o.fatal&&(o.continue=!1),o.code??(o.code="custom"),o.input??(o.input=r.value),o.inst??(o.inst=e),o.continue??(o.continue=!e._zod.def.abort),r.issues.push(xt.issue(o))}},t(r.value,r)));return e}function bro(t,e={error:`Input not instance of ${t.name}`}){let r=new oxe({type:"custom",check:"custom",fn:n=>n instanceof t,abort:!0,...xt.normalizeParams(e)});return r._zod.bag.Class=t,r}function vro(t){let e=Cdr(()=>nxe([ort(t),Bcr(),Ucr(),Jcr(),Ort(e),rdr(ort(),e)]));return e}function wro(t,e){return QCe(Mrt(t),e)}var di,art,Xoe,ku,srt,GCe,U1,urt,lrt,crt,drt,frt,prt,mrt,hrt,grt,yrt,brt,_rt,vrt,wrt,Srt,Crt,qcr,Yoe,A8,Qoe,eie,xrt,zcr,Hcr,Vcr,Kcr,Wcr,Gcr,Zcr,txe,Xcr,rxe,Trt,Ycr,Qcr,tdr,Ert,ndr,odr,Zoe,adr,udr,Prt,Rrt,ldr,cdr,fdr,Art,hdr,gdr,bdr,Irt,_dr,wdr,Sdr,xdr,oxe,_ro,WCe=v(()=>{ey();ey();Ktt();KCe();nrt();di=ve("ZodType",(t,e)=>(Yn.init(t,e),t.def=e,Object.defineProperty(t,"_def",{value:e}),t.check=(...r)=>t.clone({...e,checks:[...e.checks??[],...r.map(n=>typeof n=="function"?{_zod:{check:n,def:{check:"custom"},onattach:[]}}:n)]}),t.clone=(r,n)=>zc(t,r,n),t.brand=()=>t,t.register=(r,n)=>(r.add(t,n),t),t.parse=(r,n)=>Qtt(t,r,n,{callee:t.parse}),t.safeParse=(r,n)=>trt(t,r,n),t.parseAsync=async(r,n)=>ert(t,r,n,{callee:t.parseAsync}),t.safeParseAsync=async(r,n)=>rrt(t,r,n),t.spa=t.safeParseAsync,t.refine=(r,n)=>t.check(Tdr(r,n)),t.superRefine=r=>t.check(Edr(r)),t.overwrite=r=>t.check(fN(r)),t.optional=()=>XCe(t),t.nullable=()=>YCe(t),t.nullish=()=>XCe(YCe(t)),t.nonoptional=r=>mdr(t,r),t.array=()=>Ort(t),t.or=r=>nxe([t,r]),t.and=r=>edr(t,r),t.transform=r=>QCe(t,Mrt(r)),t.default=r=>ddr(t,r),t.prefault=r=>pdr(t,r),t.catch=r=>ydr(t,r),t.pipe=r=>QCe(t,r),t.readonly=()=>vdr(t),t.describe=r=>{let n=t.clone();return vl.add(n,{description:r}),n},Object.defineProperty(t,"description",{get(){return vl.get(t)?.description},configurable:!0}),t.meta=(...r)=>{if(r.length===0)return vl.get(t);let n=t.clone();return vl.add(n,r[0]),n},t.isOptional=()=>t.safeParse(void 0).success,t.isNullable=()=>t.safeParse(null).success,t)),art=ve("_ZodString",(t,e)=>{lz.init(t,e),di.init(t,e);let r=t._zod.bag;t.format=r.format??null,t.minLength=r.minimum??null,t.maxLength=r.maximum??null,t.regex=(...n)=>t.check(fQ(...n)),t.includes=(...n)=>t.check(hQ(...n)),t.startsWith=(...n)=>t.check(gQ(...n)),t.endsWith=(...n)=>t.check(yQ(...n)),t.min=(...n)=>t.check(X$(...n)),t.max=(...n)=>t.check(m6(...n)),t.length=(...n)=>t.check(h6(...n)),t.nonempty=(...n)=>t.check(X$(1,...n)),t.lowercase=n=>t.check(pQ(n)),t.uppercase=n=>t.check(mQ(n)),t.trim=()=>t.check(vQ()),t.normalize=(...n)=>t.check(_Q(...n)),t.toLowerCase=()=>t.check(wQ()),t.toUpperCase=()=>t.check(SQ())}),Xoe=ve("ZodString",(t,e)=>{lz.init(t,e),art.init(t,e),t.email=r=>t.check(yme(srt,r)),t.url=r=>t.check(Sme(urt,r)),t.jwt=r=>t.check(Lme(Crt,r)),t.emoji=r=>t.check(Cme(lrt,r)),t.guid=r=>t.check(lQ(GCe,r)),t.uuid=r=>t.check(bme(U1,r)),t.uuidv4=r=>t.check(_me(U1,r)),t.uuidv6=r=>t.check(vme(U1,r)),t.uuidv7=r=>t.check(wme(U1,r)),t.nanoid=r=>t.check(xme(crt,r)),t.guid=r=>t.check(lQ(GCe,r)),t.cuid=r=>t.check(Ome(drt,r)),t.cuid2=r=>t.check(Tme(frt,r)),t.ulid=r=>t.check(Eme(prt,r)),t.base64=r=>t.check(jme(vrt,r)),t.base64url=r=>t.check(Dme(wrt,r)),t.xid=r=>t.check(Pme(mrt,r)),t.ksuid=r=>t.check(Mme(hrt,r)),t.ipv4=r=>t.check(Rme(grt,r)),t.ipv6=r=>t.check(Ame(yrt,r)),t.cidrv4=r=>t.check(Ime(brt,r)),t.cidrv6=r=>t.check(Nme(_rt,r)),t.e164=r=>t.check($me(Srt,r)),t.datetime=r=>t.check(Wtt(r)),t.date=r=>t.check(Gtt(r)),t.time=r=>t.check(Ztt(r)),t.duration=r=>t.check(Xtt(r))});ku=ve("ZodStringFormat",(t,e)=>{vu.init(t,e),art.init(t,e)}),srt=ve("ZodEmail",(t,e)=>{QBe.init(t,e),ku.init(t,e)});GCe=ve("ZodGUID",(t,e)=>{XBe.init(t,e),ku.init(t,e)});U1=ve("ZodUUID",(t,e)=>{YBe.init(t,e),ku.init(t,e)});urt=ve("ZodURL",(t,e)=>{eUe.init(t,e),ku.init(t,e)});lrt=ve("ZodEmoji",(t,e)=>{tUe.init(t,e),ku.init(t,e)});crt=ve("ZodNanoID",(t,e)=>{rUe.init(t,e),ku.init(t,e)});drt=ve("ZodCUID",(t,e)=>{nUe.init(t,e),ku.init(t,e)});frt=ve("ZodCUID2",(t,e)=>{oUe.init(t,e),ku.init(t,e)});prt=ve("ZodULID",(t,e)=>{iUe.init(t,e),ku.init(t,e)});mrt=ve("ZodXID",(t,e)=>{aUe.init(t,e),ku.init(t,e)});hrt=ve("ZodKSUID",(t,e)=>{sUe.init(t,e),ku.init(t,e)});grt=ve("ZodIPv4",(t,e)=>{fUe.init(t,e),ku.init(t,e)});yrt=ve("ZodIPv6",(t,e)=>{pUe.init(t,e),ku.init(t,e)});brt=ve("ZodCIDRv4",(t,e)=>{mUe.init(t,e),ku.init(t,e)});_rt=ve("ZodCIDRv6",(t,e)=>{hUe.init(t,e),ku.init(t,e)});vrt=ve("ZodBase64",(t,e)=>{yUe.init(t,e),ku.init(t,e)});wrt=ve("ZodBase64URL",(t,e)=>{bUe.init(t,e),ku.init(t,e)});Srt=ve("ZodE164",(t,e)=>{_Ue.init(t,e),ku.init(t,e)});Crt=ve("ZodJWT",(t,e)=>{vUe.init(t,e),ku.init(t,e)});qcr=ve("ZodCustomStringFormat",(t,e)=>{wUe.init(t,e),ku.init(t,e)});Yoe=ve("ZodNumber",(t,e)=>{fme.init(t,e),di.init(t,e),t.gt=(n,o)=>t.check(dN(n,o)),t.gte=(n,o)=>t.check(e_(n,o)),t.min=(n,o)=>t.check(e_(n,o)),t.lt=(n,o)=>t.check(cN(n,o)),t.lte=(n,o)=>t.check(qw(n,o)),t.max=(n,o)=>t.check(qw(n,o)),t.int=n=>t.check(irt(n)),t.safe=n=>t.check(irt(n)),t.positive=n=>t.check(dN(0,n)),t.nonnegative=n=>t.check(e_(0,n)),t.negative=n=>t.check(cN(0,n)),t.nonpositive=n=>t.check(qw(0,n)),t.multipleOf=(n,o)=>t.check(dz(n,o)),t.step=(n,o)=>t.check(dz(n,o)),t.finite=()=>t;let r=t._zod.bag;t.minValue=Math.max(r.minimum??Number.NEGATIVE_INFINITY,r.exclusiveMinimum??Number.NEGATIVE_INFINITY)??null,t.maxValue=Math.min(r.maximum??Number.POSITIVE_INFINITY,r.exclusiveMaximum??Number.POSITIVE_INFINITY)??null,t.isInt=(r.format??"").includes("int")||Number.isSafeInteger(r.multipleOf??.5),t.isFinite=!0,t.format=r.format??null});A8=ve("ZodNumberFormat",(t,e)=>{SUe.init(t,e),Yoe.init(t,e)});Qoe=ve("ZodBoolean",(t,e)=>{rQ.init(t,e),di.init(t,e)});eie=ve("ZodBigInt",(t,e)=>{pme.init(t,e),di.init(t,e),t.gte=(n,o)=>t.check(e_(n,o)),t.min=(n,o)=>t.check(e_(n,o)),t.gt=(n,o)=>t.check(dN(n,o)),t.gte=(n,o)=>t.check(e_(n,o)),t.min=(n,o)=>t.check(e_(n,o)),t.lt=(n,o)=>t.check(cN(n,o)),t.lte=(n,o)=>t.check(qw(n,o)),t.max=(n,o)=>t.check(qw(n,o)),t.positive=n=>t.check(dN(BigInt(0),n)),t.negative=n=>t.check(cN(BigInt(0),n)),t.nonpositive=n=>t.check(qw(BigInt(0),n)),t.nonnegative=n=>t.check(e_(BigInt(0),n)),t.multipleOf=(n,o)=>t.check(dz(n,o));let r=t._zod.bag;t.minValue=r.minimum??null,t.maxValue=r.maximum??null,t.format=r.format??null});xrt=ve("ZodBigIntFormat",(t,e)=>{CUe.init(t,e),eie.init(t,e)});zcr=ve("ZodSymbol",(t,e)=>{xUe.init(t,e),di.init(t,e)});Hcr=ve("ZodUndefined",(t,e)=>{OUe.init(t,e),di.init(t,e)});Vcr=ve("ZodNull",(t,e)=>{TUe.init(t,e),di.init(t,e)});Kcr=ve("ZodAny",(t,e)=>{EUe.init(t,e),di.init(t,e)});Wcr=ve("ZodUnknown",(t,e)=>{G$.init(t,e),di.init(t,e)});Gcr=ve("ZodNever",(t,e)=>{nQ.init(t,e),di.init(t,e)});Zcr=ve("ZodVoid",(t,e)=>{PUe.init(t,e),di.init(t,e)});txe=ve("ZodDate",(t,e)=>{MUe.init(t,e),di.init(t,e),t.min=(n,o)=>t.check(e_(n,o)),t.max=(n,o)=>t.check(qw(n,o));let r=t._zod.bag;t.minDate=r.minimum?new Date(r.minimum):null,t.maxDate=r.maximum?new Date(r.maximum):null});Xcr=ve("ZodArray",(t,e)=>{oQ.init(t,e),di.init(t,e),t.element=e.element,t.min=(r,n)=>t.check(X$(r,n)),t.nonempty=r=>t.check(X$(1,r)),t.max=(r,n)=>t.check(m6(r,n)),t.length=(r,n)=>t.check(h6(r,n)),t.unwrap=()=>t.element});rxe=ve("ZodObject",(t,e)=>{RUe.init(t,e),di.init(t,e),xt.defineLazy(t,"shape",()=>e.shape),t.keyof=()=>idr(Object.keys(t._zod.def.shape)),t.catchall=r=>t.clone({...t._zod.def,catchall:r}),t.passthrough=()=>t.clone({...t._zod.def,catchall:ZCe()}),t.loose=()=>t.clone({...t._zod.def,catchall:ZCe()}),t.strict=()=>t.clone({...t._zod.def,catchall:exe()}),t.strip=()=>t.clone({...t._zod.def,catchall:void 0}),t.extend=r=>xt.extend(t,r),t.merge=r=>xt.merge(t,r),t.pick=r=>xt.pick(t,r),t.omit=r=>xt.omit(t,r),t.partial=(...r)=>xt.partial(Rrt,t,r[0]),t.required=(...r)=>xt.required(Art,t,r[0])});Trt=ve("ZodUnion",(t,e)=>{mme.init(t,e),di.init(t,e),t.options=e.options});Ycr=ve("ZodDiscriminatedUnion",(t,e)=>{Trt.init(t,e),AUe.init(t,e)});Qcr=ve("ZodIntersection",(t,e)=>{IUe.init(t,e),di.init(t,e)});tdr=ve("ZodTuple",(t,e)=>{cz.init(t,e),di.init(t,e),t.rest=r=>t.clone({...t._zod.def,rest:r})});Ert=ve("ZodRecord",(t,e)=>{NUe.init(t,e),di.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});ndr=ve("ZodMap",(t,e)=>{jUe.init(t,e),di.init(t,e),t.keyType=e.keyType,t.valueType=e.valueType});odr=ve("ZodSet",(t,e)=>{DUe.init(t,e),di.init(t,e),t.min=(...r)=>t.check(fz(...r)),t.nonempty=r=>t.check(fz(1,r)),t.max=(...r)=>t.check(p6(...r)),t.size=(...r)=>t.check(dQ(...r))});Zoe=ve("ZodEnum",(t,e)=>{$Ue.init(t,e),di.init(t,e),t.enum=e.entries,t.options=Object.values(e.entries);let r=new Set(Object.keys(e.entries));t.extract=(n,o)=>{let i={};for(let a of n)if(r.has(a))i[a]=e.entries[a];else throw new Error(`Key ${a} not found in enum`);return new Zoe({...e,checks:[],...xt.normalizeParams(o),entries:i})},t.exclude=(n,o)=>{let i={...e.entries};for(let a of n)if(r.has(a))delete i[a];else throw new Error(`Key ${a} not found in enum`);return new Zoe({...e,checks:[],...xt.normalizeParams(o),entries:i})}});adr=ve("ZodLiteral",(t,e)=>{LUe.init(t,e),di.init(t,e),t.values=new Set(e.values),Object.defineProperty(t,"value",{get(){if(e.values.length>1)throw new Error("This schema contains multiple valid literal values. Use `.values` instead.");return e.values[0]}})});udr=ve("ZodFile",(t,e)=>{FUe.init(t,e),di.init(t,e),t.min=(r,n)=>t.check(fz(r,n)),t.max=(r,n)=>t.check(p6(r,n)),t.mime=(r,n)=>t.check(bQ(Array.isArray(r)?r:[r],n))});Prt=ve("ZodTransform",(t,e)=>{iQ.init(t,e),di.init(t,e),t._zod.parse=(r,n)=>{r.addIssue=i=>{if(typeof i=="string")r.issues.push(xt.issue(i,r.value,e));else{let a=i;a.fatal&&(a.continue=!1),a.code??(a.code="custom"),a.input??(a.input=r.value),a.inst??(a.inst=t),a.continue??(a.continue=!0),r.issues.push(xt.issue(a))}};let o=e.transform(r.value,r);return o instanceof Promise?o.then(i=>(r.value=i,r)):(r.value=o,r)}});Rrt=ve("ZodOptional",(t,e)=>{d6.init(t,e),di.init(t,e),t.unwrap=()=>t._zod.def.innerType});ldr=ve("ZodNullable",(t,e)=>{kUe.init(t,e),di.init(t,e),t.unwrap=()=>t._zod.def.innerType});cdr=ve("ZodDefault",(t,e)=>{qUe.init(t,e),di.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeDefault=t.unwrap});fdr=ve("ZodPrefault",(t,e)=>{BUe.init(t,e),di.init(t,e),t.unwrap=()=>t._zod.def.innerType});Art=ve("ZodNonOptional",(t,e)=>{UUe.init(t,e),di.init(t,e),t.unwrap=()=>t._zod.def.innerType});hdr=ve("ZodSuccess",(t,e)=>{zUe.init(t,e),di.init(t,e),t.unwrap=()=>t._zod.def.innerType});gdr=ve("ZodCatch",(t,e)=>{HUe.init(t,e),di.init(t,e),t.unwrap=()=>t._zod.def.innerType,t.removeCatch=t.unwrap});bdr=ve("ZodNaN",(t,e)=>{VUe.init(t,e),di.init(t,e)});Irt=ve("ZodPipe",(t,e)=>{aQ.init(t,e),di.init(t,e),t.in=e.in,t.out=e.out});_dr=ve("ZodReadonly",(t,e)=>{JUe.init(t,e),di.init(t,e)});wdr=ve("ZodTemplateLiteral",(t,e)=>{KUe.init(t,e),di.init(t,e)});Sdr=ve("ZodLazy",(t,e)=>{GUe.init(t,e),di.init(t,e),t.unwrap=()=>t._zod.def.getter()});xdr=ve("ZodPromise",(t,e)=>{WUe.init(t,e),di.init(t,e),t.unwrap=()=>t._zod.def.innerType});oxe=ve("ZodCustom",(t,e)=>{ZUe.init(t,e),di.init(t,e)});_ro=(...t)=>kze({Pipe:Irt,Boolean:Qoe,String:Xoe,Transform:Prt},...t)});function Cro(t){cd({customError:t})}function xro(){return cd().customError}var Sro,Pdr=v(()=>{ey();Sro={invalid_type:"invalid_type",too_big:"too_big",too_small:"too_small",invalid_format:"invalid_format",not_multiple_of:"not_multiple_of",unrecognized_keys:"unrecognized_keys",invalid_union:"invalid_union",invalid_key:"invalid_key",invalid_element:"invalid_element",invalid_value:"invalid_value",custom:"custom"}});var Nrt={};Jn(Nrt,{bigint:()=>Pro,boolean:()=>Ero,date:()=>Mro,number:()=>Tro,string:()=>Oro});function Oro(t){return nze(Xoe,t)}function Tro(t){return cze(Yoe,t)}function Ero(t){return yze(Qoe,t)}function Pro(t){return _ze(eie,t)}function Mro(t){return Pze(txe,t)}var Mdr=v(()=>{ey();WCe()});var ixe={};Jn(ixe,{$brand:()=>Lqe,$input:()=>eze,$output:()=>QUe,NEVER:()=>$qe,TimePrecision:()=>oze,ZodAny:()=>Kcr,ZodArray:()=>Xcr,ZodBase64:()=>vrt,ZodBase64URL:()=>wrt,ZodBigInt:()=>eie,ZodBigIntFormat:()=>xrt,ZodBoolean:()=>Qoe,ZodCIDRv4:()=>brt,ZodCIDRv6:()=>_rt,ZodCUID:()=>drt,ZodCUID2:()=>frt,ZodCatch:()=>gdr,ZodCustom:()=>oxe,ZodCustomStringFormat:()=>qcr,ZodDate:()=>txe,ZodDefault:()=>cdr,ZodDiscriminatedUnion:()=>Ycr,ZodE164:()=>Srt,ZodEmail:()=>srt,ZodEmoji:()=>lrt,ZodEnum:()=>Zoe,ZodError:()=>bto,ZodFile:()=>udr,ZodGUID:()=>GCe,ZodIPv4:()=>grt,ZodIPv6:()=>yrt,ZodISODate:()=>zCe,ZodISODateTime:()=>UCe,ZodISODuration:()=>VCe,ZodISOTime:()=>HCe,ZodIntersection:()=>Qcr,ZodIssueCode:()=>Sro,ZodJWT:()=>Crt,ZodKSUID:()=>hrt,ZodLazy:()=>Sdr,ZodLiteral:()=>adr,ZodMap:()=>ndr,ZodNaN:()=>bdr,ZodNanoID:()=>crt,ZodNever:()=>Gcr,ZodNonOptional:()=>Art,ZodNull:()=>Vcr,ZodNullable:()=>ldr,ZodNumber:()=>Yoe,ZodNumberFormat:()=>A8,ZodObject:()=>rxe,ZodOptional:()=>Rrt,ZodPipe:()=>Irt,ZodPrefault:()=>fdr,ZodPromise:()=>xdr,ZodReadonly:()=>_dr,ZodRealError:()=>R8,ZodRecord:()=>Ert,ZodSet:()=>odr,ZodString:()=>Xoe,ZodStringFormat:()=>ku,ZodSuccess:()=>hdr,ZodSymbol:()=>zcr,ZodTemplateLiteral:()=>wdr,ZodTransform:()=>Prt,ZodTuple:()=>tdr,ZodType:()=>di,ZodULID:()=>prt,ZodURL:()=>urt,ZodUUID:()=>U1,ZodUndefined:()=>Hcr,ZodUnion:()=>Trt,ZodUnknown:()=>Wcr,ZodVoid:()=>Zcr,ZodXID:()=>mrt,_ZodString:()=>art,_default:()=>ddr,any:()=>Yto,array:()=>Ort,base64:()=>Fto,base64url:()=>kto,bigint:()=>Kto,boolean:()=>Ucr,catch:()=>ydr,check:()=>Odr,cidrv4:()=>$to,cidrv6:()=>Lto,clone:()=>zc,coerce:()=>Nrt,config:()=>cd,core:()=>pN,cuid:()=>Mto,cuid2:()=>Rto,custom:()=>yro,date:()=>ero,discriminatedUnion:()=>iro,e164:()=>qto,email:()=>vto,emoji:()=>Eto,endsWith:()=>yQ,enum:()=>idr,file:()=>dro,flattenError:()=>QY,float32:()=>zto,float64:()=>Hto,formatError:()=>eQ,function:()=>Uze,getErrorMap:()=>xro,globalRegistry:()=>vl,gt:()=>dN,gte:()=>e_,guid:()=>wto,includes:()=>hQ,instanceof:()=>bro,int:()=>irt,int32:()=>Vto,int64:()=>Wto,intersection:()=>edr,ipv4:()=>jto,ipv6:()=>Dto,iso:()=>JCe,json:()=>vro,jwt:()=>Bto,keyof:()=>tro,ksuid:()=>Nto,lazy:()=>Cdr,length:()=>h6,literal:()=>sdr,locales:()=>uQ,looseObject:()=>oro,lowercase:()=>pQ,lt:()=>cN,lte:()=>qw,map:()=>uro,maxLength:()=>m6,maxSize:()=>p6,mime:()=>bQ,minLength:()=>X$,minSize:()=>fz,multipleOf:()=>dz,nan:()=>mro,nanoid:()=>Pto,nativeEnum:()=>cro,negative:()=>Aze,never:()=>exe,nonnegative:()=>Nze,nonoptional:()=>mdr,nonpositive:()=>Ize,normalize:()=>_Q,null:()=>Jcr,nullable:()=>YCe,nullish:()=>fro,number:()=>Bcr,object:()=>rro,optional:()=>XCe,overwrite:()=>fN,parse:()=>Qtt,parseAsync:()=>ert,partialRecord:()=>sro,pipe:()=>QCe,positive:()=>Rze,prefault:()=>pdr,preprocess:()=>wro,prettifyError:()=>Zqe,promise:()=>gro,property:()=>jze,readonly:()=>vdr,record:()=>rdr,refine:()=>Tdr,regex:()=>fQ,regexes:()=>uz,registry:()=>gme,safeParse:()=>trt,safeParseAsync:()=>rrt,set:()=>lro,setErrorMap:()=>Cro,size:()=>dQ,startsWith:()=>gQ,strictObject:()=>nro,string:()=>ort,stringFormat:()=>Uto,stringbool:()=>_ro,success:()=>pro,superRefine:()=>Edr,symbol:()=>Zto,templateLiteral:()=>hro,toJSONSchema:()=>Y$,toLowerCase:()=>wQ,toUpperCase:()=>SQ,transform:()=>Mrt,treeifyError:()=>Gqe,trim:()=>vQ,tuple:()=>aro,uint32:()=>Jto,uint64:()=>Gto,ulid:()=>Ato,undefined:()=>Xto,union:()=>nxe,unknown:()=>ZCe,uppercase:()=>mQ,url:()=>Tto,uuid:()=>Sto,uuidv4:()=>Cto,uuidv6:()=>xto,uuidv7:()=>Oto,void:()=>Qto,xid:()=>Ito});var jrt=v(()=>{ey();WCe();Ktt();Ytt();nrt();Pdr();ey();XUe();ey();YUe();KCe();KCe();Mdr();cd(hme())});var Rdr=v(()=>{jrt();jrt()});var Adr=v(()=>{Rdr()});function Iro(t,e){let r=y6(e.schema),n=T6(e.schema);if(!e.schema||r||n)return new Lrt({...e,description:e.description??e.schema?.description??`${e.name} tool`,func:async(a,s,u)=>new Promise((l,c)=>{let d=Bs(u,{callbacks:s?.getChild()});rh.runWithConfig(Yy(d),async()=>{try{l(t(a,d))}catch(f){c(f)}})})});let o=e.schema,i=e.description??e.schema.description??`${e.name} tool`;return new Idr({...e,description:i,schema:o,func:async(a,s,u)=>new Promise((l,c)=>{u?.signal&&u.signal.addEventListener("abort",()=>c(V$(u.signal)));let d=Bs(u,{callbacks:s?.getChild()});rh.runWithConfig(Yy(d),async()=>{try{let f=await t(a,d);if(u?.signal?.aborted)return;l(f)}catch(f){c(f)}})})})}function Nro(t){let{content:e,artifact:r,toolCallId:n,metadata:o}=t;return n&&!hY(e)?typeof e=="string"||Array.isArray(e)&&e.every(i=>typeof i=="object")?new Gb({status:"success",content:e,artifact:r,tool_call_id:n,name:t.name,metadata:o}):new Gb({status:"success",content:jro(e),artifact:r,tool_call_id:n,name:t.name,metadata:o}):e}function jro(t){try{return JSON.stringify(t,null,2)??""}catch{return`${t}`}}var Rro,Drt,$rt,Lrt,Idr,Aro,Frt=v(()=>{Do();Q3();Afe();H$();QU();ez();uO();kY();mN();o_();Gv();bYe();yO();uhe();Adr();Rro={};Tt(Rro,{BaseToolkit:()=>Aro,DynamicStructuredTool:()=>Idr,DynamicTool:()=>Lrt,StructuredTool:()=>Drt,Tool:()=>$rt,ToolInputParsingException:()=>G3,isLangChainTool:()=>yg,isRunnableToolLike:()=>uoe,isStructuredTool:()=>soe,isStructuredToolParams:()=>loe,tool:()=>Iro});Drt=class extends IW{constructor(e){super(e??{});M(this,"returnDirect",!1);M(this,"verboseParsingErrors",!1);M(this,"responseFormat","content");M(this,"defaultConfig");this.verboseParsingErrors=e?.verboseParsingErrors??this.verboseParsingErrors,this.responseFormat=e?.responseFormat??this.responseFormat,this.defaultConfig=e?.defaultConfig??this.defaultConfig,this.metadata=e?.metadata??this.metadata}get lc_namespace(){return["langchain","tools"]}async invoke(e,r){let n,o=Jo(tz(this.defaultConfig,r));return k$(e)?(n=e.args,o={...o,toolCall:e}):n=e,this.call(n,o)}async call(e,r,n){let o=k$(e)?e.args:e,i;if(Ga(this.schema))try{i=await tL(this.schema,o)}catch(m){let h="Received tool input did not match expected schema";throw this.verboseParsingErrors&&(h=`${h} +Details: ${m.message}`),m instanceof Error&&m.constructor.name==="ZodError"&&(h=`${h} + +${ixe.prettifyError(m)}`),new G3(h,JSON.stringify(e))}else{let m=Nu(o,this.schema);if(!m.valid){let h="Received tool input did not match expected schema";throw this.verboseParsingErrors&&(h=`${h} +Details: ${m.errors.map(g=>`${g.keywordLocation}: ${g.error}`).join(` +`)}`),new G3(h,JSON.stringify(e))}i=o}let a=aN(r),u=await Gl.configure(a.callbacks,this.callbacks,a.tags||n,this.tags,a.metadata,this.metadata,{verbose:this.verbose})?.handleToolStart(this.toJSON(),typeof e=="string"?e:JSON.stringify(e),a.runId,void 0,void 0,void 0,a.runName);delete a.runId;let l;try{l=await this._call(i,u,a)}catch(m){throw await u?.handleToolError(m),m}let c,d;if(this.responseFormat==="content_and_artifact")if(Array.isArray(l)&&l.length===2)[c,d]=l;else throw new Error(`Tool response format is "content_and_artifact" but the output was not a two-tuple. +Result: ${JSON.stringify(l)}`);else c=l;let f;k$(e)&&(f=e.id),!f&&Twt(a)&&(f=a.toolCall.id);let p=Nro({content:c,artifact:d,toolCallId:f,name:this.name,metadata:this.metadata});return await u?.handleToolEnd(p),p}},$rt=class extends Drt{constructor(e){super(e);M(this,"schema",mt.object({input:mt.string().optional()}).transform(e=>e.input))}call(e,r){let n=typeof e=="string"||e==null?{input:e}:e;return super.call(n,r)}},Lrt=class extends $rt{constructor(e){super(e);M(this,"name");M(this,"description");M(this,"func");this.name=e.name,this.description=e.description,this.func=e.func,this.returnDirect=e.returnDirect??this.returnDirect}static lc_name(){return"DynamicTool"}async call(e,r){let n=aN(r);return n.runName===void 0&&(n.runName=this.name),super.call(e,n)}async _call(e,r,n){return this.func(e,r,n)}},Idr=class extends Drt{constructor(e){super(e);M(this,"name");M(this,"description");M(this,"func");M(this,"schema");this.name=e.name,this.description=e.description,this.func=e.func,this.returnDirect=e.returnDirect??this.returnDirect,this.schema=e.schema}static lc_name(){return"DynamicStructuredTool"}async call(e,r,n){let o=aN(r);return o.runName===void 0&&(o.runName=this.name),super.call(e,o,n)}_call(e,r,n){return this.func(e,r,n)}},Aro=class{getTools(){return this.tools}}});var krt=v(()=>{wA();Yu();Frt()});var Ndr=v(()=>{krt()});var jdr=v(()=>{Ov();Frt();ez()});var Ddr=v(()=>{Goe()});var fH=v(()=>{tk();rk();Joe();dH();Goe();kCe();qCe();Btt();Utt();ztt();Dcr();Htt();$cr();Vtt();Lcr();krt();Ndr();jdr();Ddr();wA()});var Ldr=S((JIa,$dr)=>{$dr.exports={createRequire:function(t){return typeof require<"u"?require:function(r){throw new Error('Dynamic require of "'+r+'" is not supported in this environment')}}}});var Dro,$ro,Fdr,kdr=v(()=>{Dro=L(Ldr(),1),$ro=Object.defineProperty,Fdr=(t,e)=>{for(var r in e)$ro(t,r,{get:e[r],enumerable:!0})}});var Lro,qrt,qdr=v(()=>{kdr();Yu();A2();YF();Lro={};Fdr(Lro,{JinaEmbeddings:()=>qrt});qrt=class extends MS{constructor(e){let r={maxConcurrency:2,...e};super(r);M(this,"model","jina-clip-v2");M(this,"batchSize",24);M(this,"baseUrl","https://api.jina.ai/v1/embeddings");M(this,"stripNewLines",!0);M(this,"dimensions",1024);M(this,"apiKey");M(this,"normalized",!0);let n=r?.apiKey||dn("JINA_API_KEY")||dn("JINA_AUTH_TOKEN");if(!n)throw new Error("Jina API key not found");this.apiKey=n,this.model=r?.model??this.model,this.dimensions=r?.dimensions??this.dimensions,this.batchSize=r?.batchSize??this.batchSize,this.stripNewLines=r?.stripNewLines??this.stripNewLines,this.normalized=r?.normalized??this.normalized}doStripNewLines(e){return this.stripNewLines?e.map(r=>typeof r=="string"?r.replace(/\n/g," "):r.text?{text:r.text.replace(/\n/g," ")}:r):e}async embedDocuments(e){let r=RS(this.doStripNewLines(e),this.batchSize),n=r.map(a=>{let s=this.getParams(a);return this.embeddingWithRetry(s)}),o=await Promise.all(n),i=[];for(let a=0;ao)}}});var axe,Bdr=v(()=>{qdr();axe=class extends qrt{constructor(e){super(e),e?.baseUrl&&(this.baseUrl=e.baseUrl)}}});var I8,Udr=v(()=>{fH();I8=class extends wk{constructor(e){super(e),this.customConfig=e}async embedQuery(e){return(await this.callEmbeddingAPI([e]))[0]}async embedDocuments(e){return await this.callEmbeddingAPI(e)}async callEmbeddingAPI(e){let r={model:this.customConfig.modelName,input:e,encoding_format:"float"},o=`${this.customConfig.configuration?.baseURL||"https://api.openai.com/v1"}/embeddings`,i=this.customConfig.apiKey,s=await(this.customConfig.configuration?.fetch||fetch)(o,{method:"POST",headers:{Authorization:`Bearer ${i}`,"Content-Type":"application/json"},body:JSON.stringify(r)});if(!s.ok){let l=await s.text();throw new Error(`Embedding API request failed: ${s.status} ${s.statusText} - ${l}`)}let u=await s.json();if(!u.data||!Array.isArray(u.data))throw new Error("Invalid API response format: missing or invalid data array");return u.data.map(l=>{if(!l.embedding||!Array.isArray(l.embedding))throw new Error("Invalid API response format: missing or invalid embedding array");return l.embedding})}}});var sxe,Fro,bd,pH=v(()=>{Zr();Jz();Yw();jt();yr();TYe();kYe();eQe();fH();sxe=require("obsidian");CA();Bdr();Udr();Fro={"copilot-plus":I8,"copilot-plus-jina":axe,openai:wk,cohereai:OYe,google:FYe,"azure openai":Jtt,ollama:QYe,"lm-studio":I8,"3rd party (openai-format)":wk,siliconflow:I8},bd=class t{constructor(){this.providerApiKeyMap={"copilot-plus":()=>ce().plusLicenseKey,"copilot-plus-jina":()=>ce().plusLicenseKey,openai:()=>ce().openAIApiKey,cohereai:()=>ce().cohereApiKey,google:()=>ce().googleApiKey,"azure openai":()=>ce().azureOpenAIApiKey,ollama:()=>"default-key","lm-studio":()=>"default-key","3rd party (openai-format)":()=>"default-key",siliconflow:()=>ce().siliconflowApiKey};this.initialize(),Yl(()=>this.initialize())}initialize(){let e=ce().activeEmbeddingModels;this.activeEmbeddingModels=e,this.buildModelMap(e)}static getInstance(){return t.instance||(t.instance=new t),t.instance}getProviderConstructor(e){let r=Fro[e.provider];if(!r)throw console.warn(`Unknown provider: ${e.provider} for model: ${e.name}`),new Error(`Unknown provider: ${e.provider} for model: ${e.name}`);return r}buildModelMap(e){t.modelMap={};let r=t.modelMap;e.forEach(n=>{if(n.enabled){if(!Object.values(pL).contains(n.provider)){console.warn(`Unknown provider: ${n.provider} for embedding model: ${n.name}`);return}let o=this.getProviderConstructor(n),i=n.apiKey||this.providerApiKeyMap[n.provider](),a=Qn(n);r[a]={hasApiKey:!!i,EmbeddingConstructor:o,vendor:n.provider}}})}static getModelName(e){let r=e;if("model"in r&&r.model)return r.model;if("modelName"in r&&r.modelName)return r.modelName;throw new Error(`Embeddings instance missing model or modelName properties: ${e}`)}getCustomModel(e){return this.activeEmbeddingModels.filter(r=>{let n=Qn(r);return e===n})[0]}async getEmbeddingsAPI(){let{embeddingModelKey:e}=ce();if(!t.modelMap.hasOwnProperty(e))throw new Ro(`No embedding model found for: ${e}`);let r=this.getCustomModel(e);if(r.plusExclusive&&!ce().isPlusUser)throw new sxe.Notice("Plus-only model, please consider upgrading to Plus to access it."),new Ro("Plus-only model selected but user is not on Plus plan");if(r.believerExclusive){let a=await cc.getInstance().validateLicenseKey();if(!a.plan||a.plan.toLowerCase()!=="believer")throw new sxe.Notice("Believer-only model, please consider upgrading to Believer to access it."),new Ro("Believer-only model selected but user is not on Believer plan")}let n=t.modelMap[e];if(!n.hasApiKey)throw new Ro(`API key is not provided for the embedding model: ${e}`);let o=await this.getEmbeddingConfig(r);try{return t.embeddingModel=new n.EmbeddingConstructor(o),t.embeddingModel}catch(i){throw new Ro(`Error creating embedding model: ${e}. ${i.message}`)}}async getEmbeddingConfig(e){let r=ce(),n=e.name,o={maxRetries:3,maxConcurrency:3},a={"copilot-plus":{modelName:n,apiKey:await wi(r.plusLicenseKey),timeout:1e4,batchSize:ce().embeddingBatchSize,configuration:{baseURL:Bz,fetch:e.enableCors?Ql:void 0}},"copilot-plus-jina":{model:n,apiKey:await wi(r.plusLicenseKey),timeout:1e4,batchSize:ce().embeddingBatchSize,dimensions:e.dimensions,baseUrl:Bz+"/embeddings",configuration:{fetch:e.enableCors?Ql:void 0}},openai:{modelName:n,apiKey:await wi(e.apiKey||r.openAIApiKey),timeout:1e4,batchSize:ce().embeddingBatchSize,configuration:{baseURL:e.baseUrl,fetch:e.enableCors?Ql:void 0}},cohereai:{model:n,apiKey:await wi(e.apiKey||r.cohereApiKey)},google:{modelName:n,apiKey:await wi(r.googleApiKey)},"azure openai":{modelName:n,azureOpenAIApiKey:await wi(e.apiKey||r.azureOpenAIApiKey),azureOpenAIApiInstanceName:e.azureOpenAIApiInstanceName||r.azureOpenAIApiInstanceName,azureOpenAIApiDeploymentName:e.azureOpenAIApiEmbeddingDeploymentName||r.azureOpenAIApiEmbeddingDeploymentName,azureOpenAIApiVersion:e.azureOpenAIApiVersion||r.azureOpenAIApiVersion},ollama:{baseUrl:e.baseUrl||"http://localhost:11434",model:n,truncate:!0,headers:{Authorization:`Bearer ${await wi(e.apiKey||"default-key")}`}},"lm-studio":{modelName:n,openAIApiKey:await wi(e.apiKey||"default-key"),configuration:{baseURL:e.baseUrl||"http://localhost:1234/v1",fetch:e.enableCors?Ql:void 0}},"3rd party (openai-format)":{modelName:n,openAIApiKey:await wi(e.apiKey||""),batchSize:ce().embeddingBatchSize,configuration:{baseURL:e.baseUrl,fetch:e.enableCors?Ql:void 0,dangerouslyAllowBrowser:!0}},siliconflow:{modelName:n,apiKey:await wi(e.apiKey||r.siliconflowApiKey),batchSize:ce().embeddingBatchSize,configuration:{baseURL:e.baseUrl||TN.siliconflow.host,fetch:e.enableCors?Ql:void 0}}}[e.provider]||{};return{...o,...a}}async ping(e){let r=async n=>{let o={...e,enableCors:n},i=await this.getEmbeddingConfig(o);await new(this.getProviderConstructor(o))(i).embedQuery("test")};try{return await r(!1),!0}catch(n){console.log("First ping attempt failed, trying with CORS...");try{return await r(!0),new sxe.Notice("Connection successful, but requires CORS to be enabled. Please enable CORS for this model once you add it above."),!0}catch(o){let i=` +without CORS Error: `+Mo(n)+` +with CORS Error: `+Mo(o);throw new Error(i)}}}}});function Vdr(t){return t!==void 0&&tie.includes(t)?zdr[t]:void 0}var zdr,Hdr,tie,uxe=v(()=>{zdr={arabic:"ar",armenian:"am",bulgarian:"bg",danish:"dk",dutch:"nl",english:"en",finnish:"fi",french:"fr",german:"de",greek:"gr",hungarian:"hu",indian:"in",indonesian:"id",irish:"ie",italian:"it",lithuanian:"lt",nepali:"np",norwegian:"no",portuguese:"pt",romanian:"ro",russian:"ru",serbian:"rs",slovenian:"ru",spanish:"es",swedish:"se",tamil:"ta",turkish:"tr",ukrainian:"uk",sanskrit:"sk"},Hdr={dutch:/[^A-Za-zàèéìòóù0-9_'-]+/gim,english:/[^A-Za-zàèéìòóù0-9_'-]+/gim,french:/[^a-z0-9äâàéèëêïîöôùüûœç-]+/gim,italian:/[^A-Za-zàèéìòóù0-9_'-]+/gim,norwegian:/[^a-z0-9_æøåÆØÅäÄöÖüÜ]+/gim,portuguese:/[^a-z0-9à-úÀ-Ú]/gim,russian:/[^a-z0-9а-яА-ЯёЁ]+/gim,spanish:/[^a-z0-9A-Zá-úÁ-ÚñÑüÜ]+/gim,swedish:/[^a-z0-9_åÅäÄöÖüÜ-]+/gim,german:/[^a-z0-9A-ZäöüÄÖÜß]+/gim,finnish:/[^a-z0-9äöÄÖ]+/gim,danish:/[^a-z0-9æøåÆØÅ]+/gim,hungarian:/[^a-z0-9áéíóöőúüűÁÉÍÓÖŐÚÜŰ]+/gim,romanian:/[^a-z0-9ăâîșțĂÂÎȘȚ]+/gim,serbian:/[^a-z0-9čćžšđČĆŽŠĐ]+/gim,turkish:/[^a-z0-9çÇğĞıİöÖşŞüÜ]+/gim,lithuanian:/[^a-z0-9ąčęėįšųūžĄČĘĖĮŠŲŪŽ]+/gim,arabic:/[^a-z0-9أ-ي]+/gim,nepali:/[^a-z0-9अ-ह]+/gim,irish:/[^a-z0-9áéíóúÁÉÍÓÚ]+/gim,indian:/[^a-z0-9अ-ह]+/gim,armenian:/[^a-z0-9ա-ֆ]+/gim,greek:/[^a-z0-9α-ωά-ώ]+/gim,indonesian:/[^a-z0-9]+/gim,ukrainian:/[^a-z0-9а-яА-ЯіїєІЇЄ]+/gim,slovenian:/[^a-z0-9螚ȎŠ]+/gim,bulgarian:/[^a-z0-9а-яА-Я]+/gim,tamil:/[^a-z0-9அ-ஹ]+/gim,sanskrit:/[^a-z0-9A-Zāīūṛḷṃṁḥśṣṭḍṇṅñḻḹṝ]+/gim},tie=Object.keys(zdr)});function Ou(t,e){if(e.length\d+)\$)?(?-?\d*\.?\d*)(?[dfs])/g,function(...r){let n=r[r.length-1],{width:o,type:i,position:a}=n,s=a?e[Number.parseInt(a)-1]:e.shift(),u=o===""?0:Number.parseInt(o);switch(i){case"d":return s.toString().padStart(u,"0");case"f":{let l=s,[c,d]=o.split(".").map(f=>Number.parseFloat(f));return typeof d=="number"&&d>=0&&(l=l.toFixed(d)),typeof c=="number"&&c>=0?l.toString().padStart(u,"0"):l.toString()}case"s":return u<0?s.toString().padEnd(-u," "):s.toString().padStart(u," ");default:return s}})}function Bro(){return typeof WorkerGlobalScope<"u"&&self instanceof WorkerGlobalScope}function Uro(){return typeof process<"u"&&process.release&&process.release.name==="node"}function Gdr(){return BigInt(Math.floor(performance.now()*1e6))}function mH(t){return typeof t=="number"&&(t=BigInt(t)),t{let n=e.get(r);return n!==void 0&&e.set(r,0),n===t.length})}function lxe(t,e){let r={},n=e.length;for(let o=0;o({...r,document:{...r.document,...e.reduce((n,o)=>{let i=o.split("."),a=i.pop(),s=n;for(let u of i)s[u]=s[u]??{},s=s[u];return s[a]=null,n},r.document)}}))}function _d(t){return t?.constructor?.name==="AsyncFunction"}var kro,qro,Jdr,Kdr,Wdr,Brt,zro,ed=v(()=>{wh();kro=Date.now().toString().slice(5),qro=0,Jdr=BigInt(1e3),Kdr=BigInt(1e6),Wdr=BigInt(1e9),Brt=65535;zro={cm:.01,m:1,km:1e3,ft:.3048,yd:.9144,mi:1609.344}});function Ir(t,...e){let r=new Error(Zdr(Vro[t]??`Unsupported Orama Error code: ${t}`,...e));return r.code=t,"captureStackTrace"in Error.prototype&&Error.captureStackTrace(r),r}var Hro,Vro,wh=v(()=>{uxe();ed();Hro=tie.join(` + - `),Vro={NO_LANGUAGE_WITH_CUSTOM_TOKENIZER:"Do not pass the language option to create when using a custom tokenizer.",LANGUAGE_NOT_SUPPORTED:`Language "%s" is not supported. +Supported languages are: + - ${Hro}`,INVALID_STEMMER_FUNCTION_TYPE:"config.stemmer property must be a function.",MISSING_STEMMER:'As of version 1.0.0 @orama/orama does not ship non English stemmers by default. To solve this, please explicitly import and specify the "%s" stemmer from the package @orama/stemmers. See https://docs.oramasearch.com/open-source/text-analysis/stemming for more information.',CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY:"Custom stop words array must only contain strings.",UNSUPPORTED_COMPONENT:'Unsupported component "%s".',COMPONENT_MUST_BE_FUNCTION:'The component "%s" must be a function.',COMPONENT_MUST_BE_FUNCTION_OR_ARRAY_FUNCTIONS:'The component "%s" must be a function or an array of functions.',INVALID_SCHEMA_TYPE:'Unsupported schema type "%s" at "%s". Expected "string", "boolean" or "number" or array of them.',DOCUMENT_ID_MUST_BE_STRING:'Document id must be of type "string". Got "%s" instead.',DOCUMENT_ALREADY_EXISTS:'A document with id "%s" already exists.',DOCUMENT_DOES_NOT_EXIST:'A document with id "%s" does not exists.',MISSING_DOCUMENT_PROPERTY:'Missing searchable property "%s".',INVALID_DOCUMENT_PROPERTY:'Invalid document property "%s": expected "%s", got "%s"',UNKNOWN_INDEX:'Invalid property name "%s". Expected a wildcard string ("*") or array containing one of the following properties: %s',INVALID_BOOST_VALUE:"Boost value must be a number greater than, or less than 0.",INVALID_FILTER_OPERATION:"You can only use one operation per filter, you requested %d.",SCHEMA_VALIDATION_FAILURE:'Cannot insert document due schema validation failure on "%s" property.',INVALID_SORT_SCHEMA_TYPE:'Unsupported sort schema type "%s" at "%s". Expected "string" or "number".',CANNOT_SORT_BY_ARRAY:'Cannot configure sort for "%s" because it is an array (%s).',UNABLE_TO_SORT_ON_UNKNOWN_FIELD:'Unable to sort on unknown field "%s". Allowed fields: %s',SORT_DISABLED:"Sort is disabled. Please read the documentation at https://docs.oramasearch for more information.",UNKNOWN_GROUP_BY_PROPERTY:'Unknown groupBy property "%s".',INVALID_GROUP_BY_PROPERTY:'Invalid groupBy property "%s". Allowed types: "%s", but given "%s".',UNKNOWN_FILTER_PROPERTY:'Unknown filter property "%s".',INVALID_VECTOR_SIZE:'Vector size must be a number greater than 0. Got "%s" instead.',INVALID_VECTOR_VALUE:'Vector value must be a number greater than 0. Got "%s" instead.',INVALID_INPUT_VECTOR:`Property "%s" was declared as a %s-dimensional vector, but got a %s-dimensional vector instead. +Input vectors must be of the size declared in the schema, as calculating similarity between vectors of different sizes can lead to unexpected results.`,WRONG_SEARCH_PROPERTY_TYPE:'Property "%s" is not searchable. Only "string" properties are searchable.',FACET_NOT_SUPPORTED:`Facet doens't support the type "%s".`,INVALID_DISTANCE_SUFFIX:'Invalid distance suffix "%s". Valid suffixes are: cm, m, km, mi, yd, ft.',INVALID_SEARCH_MODE:'Invalid search mode "%s". Valid modes are: "fulltext", "vector", "hybrid".',MISSING_VECTOR_AND_SECURE_PROXY:"No vector was provided and no secure proxy was configured. Please provide a vector or configure an Orama Secure Proxy to perform hybrid search.",MISSING_TERM:'"term" is a required parameter when performing hybrid search. Please provide a search term.',INVALID_VECTOR_INPUT:'Invalid "vector" property. Expected an object with "value" and "property" properties, but got "%s" instead.',PLUGIN_CRASHED:"A plugin crashed during initialization. Please check the error message for more information:",PLUGIN_SECURE_PROXY_NOT_FOUND:`Could not find '@orama/secure-proxy-plugin' installed in your Orama instance. +Please install it before proceeding with creating an answer session. +Read more at https://docs.orama.com/open-source/plugins/plugin-secure-proxy +`,PLUGIN_SECURE_PROXY_MISSING_CHAT_MODEL:`Could not find a chat model defined in the secure proxy plugin configuration. +Please provide a chat model before proceeding with creating an answer session. +Read more at https://docs.orama.com/open-source/plugins/plugin-secure-proxy +`,ANSWER_SESSION_LAST_MESSAGE_IS_NOT_ASSISTANT:"The last message in the session is not an assistant message. Cannot regenerate non-assistant messages."}});function Ydr(t){return{raw:Number(t),formatted:mH(t)}}function Qdr(t){if(t.id){if(typeof t.id!="string")throw Ir("DOCUMENT_ID_MUST_BE_STRING",typeof t.id);return t.id}return rie()}function zrt(t,e){for(let[r,n]of Object.entries(e)){let o=t[r];if(!(typeof o>"u")&&!(n==="geopoint"&&typeof o=="object"&&typeof o.lon=="number"&&typeof o.lat=="number")&&!(n==="enum"&&(typeof o=="string"||typeof o=="number"))){if(n==="enum[]"&&Array.isArray(o)){let i=o.length;for(let a=0;a{wh();ed();ed();Jro={string:!1,number:!1,boolean:!1,enum:!1,geopoint:!1,"string[]":!0,"number[]":!0,"boolean[]":!0,"enum[]":!0},Kro={"string[]":"string","number[]":"number","boolean[]":"boolean","enum[]":"enum"}});function tfr(){return{idToInternalId:new Map,internalIdToId:[],save:Wro,load:Gro}}function Wro(t){return{internalIdToId:t.internalIdToId}}function Gro(t,e){let{internalIdToId:r}=e;t.internalDocumentIDStore.idToInternalId.clear(),t.internalDocumentIDStore.internalIdToId=[];let n=r.length;for(let o=0;ot.internalIdToId.length?tu(t,e.toString()):e}function IS(t,e){if(t.internalIdToId.length{});function Xro(t,e){return{sharedInternalDocumentStore:e,docs:{},count:0}}function Yro(t,e){let r=tu(t.sharedInternalDocumentStore,e);return t.docs[r]}function Qro(t,e){let r=e.length,n=Array.from({length:r});for(let o=0;o"u"?!1:(delete t.docs[r],t.count--,!0)}function nno(t){return t.count}function ono(t,e){let r=e;return{docs:r.docs,count:r.count,sharedInternalDocumentStore:t}}function ino(t){return{docs:t.docs,count:t.count}}function rfr(){return{create:Xro,get:Yro,getMultiple:Qro,getAll:eno,store:tno,remove:rno,count:nno,load:ono,save:ino}}var Jrt=v(()=>{NS()});function ofr(t,e){let r=[],n=t.plugins?.length;if(!n)return r;for(let o=0;o{wh();nfr=["beforeInsert","afterInsert","beforeRemove","afterRemove","beforeUpdate","afterUpdate","beforeSearch","afterSearch","beforeInsertMultiple","afterInsertMultiple","beforeRemoveMultiple","afterRemoveMultiple","beforeUpdateMultiple","afterUpdateMultiple","beforeLoad","afterLoad","afterCreate"]});function UC(t,e,r,n){if(t.some(_d))return(async()=>{for(let i of t)await i(e,r,n)})();for(let i of t)i(e,r,n)}function hH(t,e,r){if(t.some(_d))return(async()=>{for(let o of t)await o(e,r)})();for(let o of t)o(e,r)}function L8(t,e,r,n,o){if(t.some(_d))return(async()=>{for(let a of t)await a(e,r,n,o)})();for(let a of t)a(e,r,n,o)}function F8(t,e,r,n){if(t.some(_d))return(async()=>{for(let i of t)await i(e,r,n)})();for(let i of t)i(e,r,n)}function sfr(t,e){if(t.some(_d))return(async()=>{for(let n of t)await n(e)})();for(let n of t)n(e)}var afr,Krt,Sk=v(()=>{ed();afr=["tokenizer","index","documentsStore","sorter"],Krt=["validateSchema","getDocumentIndexId","getDocumentProperties","formatElapsedTime"]});function Wrt(t){let e=t.r;return t.r=e.l,e.l=t,t.h=Math.max(jS(t.l),jS(t.r))+1,e.h=Math.max(jS(e.l),jS(e.r))+1,e}function Grt(t){let e=t.l;return t.l=e.r,e.r=t,t.h=Math.max(jS(t.l),jS(t.r))+1,e.h=Math.max(jS(e.l),jS(e.r))+1,e}function lfr(t,e,r){let n=[];function o(i){i!==null&&(e=e&&i.k<=r&&Ou(n,i.v),r>i.k&&o(i.r))}return o(t.root),n}function Zrt(t,e,r=!1){let n=[];if(t===null)return n;let o=[t.root];for(;o.length>0;){let i=o.pop();i&&(r&&i.k>=e&&Ou(n,i.v),!r&&i.k>e&&Ou(n,i.v),o.push(i.r),o.push(i.l))}return n}function Xrt(t,e,r=!1){let n=[];if(t===null)return n;let o=[t.root];for(;o.length>0;){let i=o.pop();i&&(r&&i.k<=e&&Ou(n,i.v),!r&&i.kt.k)t=t.r;else return t;return null}function dfr(t,e){return{root:{k:t,v:e,l:null,r:null,h:0}}}function ffr(t,e,r,n=500){function o(i,a,s){if(i===null)return ufr++,{k:a,v:s,l:null,r:null,h:0};if(ai.k)i.r=o(i.r,a,s);else return i.v.push(...s),i;return ufr%n===0?sno(i,a):i}t.root=o(t.root,e,r)}function sno(t,e){t.h=1+Math.max(jS(t.l),jS(t.r));let r=jS(t.l)-jS(t.r);return r>1&&et.r.k?Wrt(t):r>1&&e>t.l.k?(t.l=Wrt(t.l),Grt(t)):r<-1&&e{if(r.l===null&&r.r===null)n===null?t.root=null:n.l===r?n.l=null:n.r=null;else if(r.l!=null&&r.r!=null){let i=r.r,a=r;for(;i.l!=null;)a=i,i=i.l;r.k=i.k,a===r?a.r=i.r:a.l=i.r}else{let i=r.l!=null?r.l:r.r;n===null?t.root=i:n.l===r?n.l=i:n.r=i}})()}function mfr(t,e,r){let n=cfr(t.root,r);if(n){if(n.v.length===1){uno(t,r);return}n.v.splice(n.v.indexOf(e),1)}}var ufr,hfr=v(()=>{ed();ufr=0});function gfr(){return{numberToDocumentId:new Map}}function yfr(t,e,r){return t.numberToDocumentId.has(e)?(t.numberToDocumentId.get(e).push(r),t):(t.numberToDocumentId.set(e,[r]),t)}function bfr(t,e,r){t?.numberToDocumentId.set(r,t?.numberToDocumentId.get(r)?.filter(n=>n!==e)??[]),t?.numberToDocumentId.get(r)?.length===0&&t?.numberToDocumentId.delete(r)}function _fr(t,e){let r=Object.keys(e);if(r.length!==1)throw new Error("Invalid operation");let n=r[0];switch(n){case"eq":{let o=e[n];return t.numberToDocumentId.get(o)??[]}case"in":{let o=e[n],i=[];for(let a of o){let s=t.numberToDocumentId.get(a);s!=null&&Ou(i,s)}return i}case"nin":{let o=e[n],i=[],a=t.numberToDocumentId.keys();for(let s of a){if(o.includes(s))continue;let u=t.numberToDocumentId.get(s);u!=null&&Ou(i,u)}return i}}throw new Error("Invalid operation")}function vfr(t,e){let r=Object.keys(e);if(r.length!==1)throw new Error("Invalid operation");let n=r[0];switch(n){case"containsAll":{let i=e[n].map(a=>t.numberToDocumentId.get(a)??[]);return j8(i)}}throw new Error("Invalid operation")}var wfr=v(()=>{ed()});function lno(t,e,r){if(r<0)return-1;if(t===e)return 0;let n=t.length,o=e.length;if(n===0)return o<=r?o:-1;if(o===0)return n<=r?n:-1;if(t=t.toLowerCase(),e=e.toLowerCase(),e.startsWith(t)||t.startsWith(e))return 0;if(Math.abs(n-o)>r)return-1;let i=[];for(let a=0;a<=n;a++){i[a]=[a];for(let s=1;s<=o;s++)i[a][s]=a===0?s:0}for(let a=1;a<=n;a++){let s=1/0;for(let u=1;u<=o;u++)t[a-1]===e[u-1]?i[a][u]=i[a-1][u-1]:i[a][u]=Math.min(i[a-1][u]+1,i[a][u-1]+1,i[a-1][u-1]+1),s=Math.min(s,i[a][u]);if(s>r)return-1}return i[n][o]<=r?i[n][o]:-1}function Yrt(t,e,r){let n=lno(t,e,r);return{distance:n,isBounded:n>=0}}var Qrt=v(()=>{});function k8(t,e){t.w=e.w+t.s}function dxe(t,e){t.d.push(e)}function cno(t,e){let r=t.d.indexOf(e);return r===-1?!1:(t.d.splice(r,1),!0)}function tnt(t,e,r,n,o){if(t.e){let{w:i,d:a}=t;if(n&&i!==r)return{};if(N8(e,i)==null&&(o?Math.abs(r.length-i.length)<=o&&Yrt(r,i,o).isBounded&&(e[i]=[]):e[i]=[]),N8(e,i)!=null&&a.length>0){let s=new Set(e[i]),u=a.length;for(let l=0;l0)){let u=new Set(i[a]),l=s.length;for(let c=0;c=e.length)){e[r]in t.c&&oie(t.c[e[r]],e,r+1,n,o,i),oie(t,e,r+1,n-1,o,i);for(let a in t.c)oie(t.c[a],e,r,n-1,o,i);for(let a in t.c)a!==e[r]&&oie(t.c[a],e,r+1,n-1,o,i)}}}function rnt(t,{term:e,exact:r,tolerance:n}){if(n&&!r){let o={};return n=n||0,oie(t,e,0,n||0,n,o),o}else{let o=e.length;for(let a=0;a{Qrt();ed();ent=class{constructor(e,r,n){M(this,"k");M(this,"s");M(this,"c",{});M(this,"d",[]);M(this,"e");M(this,"w","");this.k=e,this.s=r,this.e=n}toJSON(){return{w:this.w,s:this.s,c:this.c,d:this.d,e:this.e}}}});function Tfr(){return{root:null}}function Efr(t,e,r){let n={point:e,docIDs:r};if(t.root==null){t.root=n;return}let o=t.root,i=0;for(;o!==null;){if(o.point.lon===e.lon&&o.point.lat===e.lat){let s=o.docIDs??[];o.docIDs=Array.from(new Set([...s,...r||[]]));return}if(i%2===0)if(e.lon-1){n.docIDs?.splice(u,1),(n.docIDs==null||n.docIDs.length===0)&&(i!=null?a==="left"?i.left=n.left!==null?n.left:n.right:a==="right"&&(i.right=n.right!==null?n.right:n.left):t.root=n.left!==null?n.left:n.right);return}}let s=o%2;i=n,s===0?e.lon0;){let{node:l,depth:c}=s.pop();if(l===null)continue;let d=a(e,l.point);(n?d<=r:d>r)&&u.push({point:l.point,docIDs:l.docIDs??[]}),l.left!=null&&s.push({node:l.left,depth:c+1}),l.right!=null&&s.push({node:l.right,depth:c+1})}return o&&u.sort((l,c)=>{let d=a(e,l.point),f=a(e,c.point);return o.toLowerCase()==="asc"?d-f:f-d}),u}function Rfr(t,e,r=!0,n=null,o=!1){let i=[{node:t,depth:0}],a=[];for(;i.length>0;){let u=i.pop();if(u==null||u.node==null)continue;let{node:l,depth:c}=u,d=c+1;l.left!=null&&i.push({node:l.left,depth:d}),l.right!=null&&i.push({node:l.right,depth:d});let f=fno(e,l.point);f&&r?a.push({point:l.point,docIDs:l.docIDs??[]}):!f&&!r&&a.push({point:l.point,docIDs:l.docIDs??[]})}let s=dno(e);if(n){let u=o?Ifr:Afr;a.sort((l,c)=>{let d=u(s,l.point),f=u(s,c.point);return n.toLowerCase()==="asc"?d-f:f-d})}return a}function dno(t){let e=0,r=0,n=0,o=t.length;for(let a=0,s=o-1;ao!=d>o&&n<(c-u)*(o-l)/(d-l)+u&&(r=!r)}return r}function Afr(t,e){let r=Math.PI/180,n=t.lat*r,o=e.lat*r,i=(e.lat-t.lat)*r,a=(e.lon-t.lon)*r,s=Math.sin(i/2)*Math.sin(i/2)+Math.cos(n)*Math.cos(o)*Math.sin(a/2)*Math.sin(a/2);return 6371e3*(2*Math.atan2(Math.sqrt(s),Math.sqrt(1-s)))}function Ifr(t,e){let n=.0033528106647474805,o=(1-n)*6378137,i=Math.PI/180,a=t.lat*i,s=e.lat*i,u=(e.lon-t.lon)*i,l=Math.atan((1-n)*Math.tan(a)),c=Math.atan((1-n)*Math.tan(s)),d=Math.sin(l),f=Math.cos(l),p=Math.sin(c),m=Math.cos(c),h=u,g,y=1e3,b,_,w,x,O;do{let F=Math.sin(h),B=Math.cos(h);w=Math.sqrt(m*F*(m*F)+(f*p-d*m*B)*(f*p-d*m*B)),x=d*p+f*m*B,O=Math.atan2(w,x),b=f*m*F/w,_=1-b*b;let U=x-2*d*p/_,J=n/16*_*(4+n*(4-3*_));g=h,h=u+(1-J)*n*b*(O+J*w*(U+J*x*(-1+2*U*U)))}while(Math.abs(h-g)>1e-12&&--y>0);let E=_*(6378137*6378137-o*o)/(o*o),T=1+E/16384*(4096+E*(-768+E*(320-175*E))),R=E/1024*(256+E*(-128+E*(74-47*E))),I=R*w*(x-2*d*p/_+R/4*(x*(-1+2*w*w)-R/6*O*(-3+4*w*w)*(-3+4*O*O)));return o*T*(O-I)}var Nfr=v(()=>{});function fxe(t,e,r=0,n){if(e===0)throw Ir("INVALID_BOOST_VALUE");let o=new Map,i=t.length;for(let h=0;hg[1]-h[1]);if(r===1)return s;let u=s.length,l=[];for(let h of o.entries())l.push([h[0],h[1][0],h[1][1]]);let c=l.sort((h,g)=>h[2]>g[2]?-1:h[2]g[1]?-1:h[1]"u"){if(r===0)return[];d=0}let f=c.length,p=new Array(f);for(let h=0;h{wh()});function ont(t,e){let r=0;for(let n=0;n=n&&i.push([a,c])}return i.sort((a,s)=>s[1]-a[1])}var mxe=v(()=>{});function pno(t,e,r,n,o){let i=tu(t.sharedInternalDocumentStore,r);t.avgFieldLength[e]=((t.avgFieldLength[e]??0)*(o-1)+n.length)/o,t.fieldLengths[e][i]=n.length,t.frequencies[e][i]={}}function mno(t,e,r,n,o){let i=0;for(let u of n)u===o&&i++;let a=tu(t.sharedInternalDocumentStore,r),s=i/n.length;t.frequencies[e][a][o]=s,o in t.tokenOccurrences[e]||(t.tokenOccurrences[e][o]=0),t.tokenOccurrences[e][o]=(t.tokenOccurrences[e][o]??0)+1}function hno(t,e,r,n){let o=tu(t.sharedInternalDocumentStore,r);n>1?t.avgFieldLength[e]=(t.avgFieldLength[e]*n-t.fieldLengths[e][o])/(n-1):t.avgFieldLength[e]=void 0,t.fieldLengths[e][o]=void 0,t.frequencies[e][o]=void 0}function gno(t,e,r){t.tokenOccurrences[e][r]--}function yno(t,e,r,n,o){let i=Array.from(o),a=e.avgFieldLength[r],s=e.fieldLengths[r],u=e.tokenOccurrences[r],l=e.frequencies[r],c=typeof u[n]=="number"?u[n]??0:0,d=[],f=i.length;for(let p=0;p{let l=tu(e.sharedInternalDocumentStore,n),{type:c,node:d}=e.indexes[r];switch(c){case"Bool":{d[u?"true":"false"].push(l);break}case"AVL":{let f=s?.avlRebalanceThreshold??1;ffr(d,u,[l],f);break}case"Radix":{let f=i.tokenize(u,o,r);t.insertDocumentScoreParameters(e,r,l,f,a);for(let p of f)t.insertTokenScoreParameters(e,r,l,f,p),Cfr(d,p,l);break}case"Flat":{yfr(d,u,l);break}case"BKD":{Efr(d,u,[l]);break}}}}function _no(t,e,r,n,o,i,a,s,u,l){if(z1(i))return vno(e,r,o,n);let c=bno(t,e,r,n,a,s,u,l);if(!$8(i))return c(o);let d=o,f=d.length;for(let p=0;p({[a]:[],...i}),{});for(let i of n){let a=r[i];if(typeof e.indexes[i]>"u")throw Ir("UNKNOWN_FILTER_PROPERTY",i);let{node:s,type:u,isArray:l}=e.indexes[i];if(u==="Bool"){let f=s[a.toString()];Ou(o[i],f);continue}if(u==="BKD"){let d;if("radius"in a)d="radius";else if("polygon"in a)d="polygon";else throw new Error(`Invalid operation ${a}`);if(d==="radius"){let{value:f,coordinates:p,unit:m="m",inside:h=!0,highPrecision:g=!1}=a[d],y=Urt(f,m),b=Mfr(s.root,p,y,h,void 0,g);Ou(o[i],b.flatMap(({docIDs:_})=>_))}else{let{coordinates:f,inside:p=!0,highPrecision:m=!1}=a[d],h=Rfr(s.root,f,p,void 0,m);Ou(o[i],h.flatMap(({docIDs:g})=>g))}continue}if(u==="Radix"&&(typeof a=="string"||Array.isArray(a))){for(let d of[a].flat()){let f=t.tokenizer.tokenize(d,t.language,i);for(let p of f){let m=rnt(s,{term:p,exact:!0});Ou(o[i],Object.values(m).flat())}}continue}let c=Object.keys(a);if(c.length>1)throw Ir("INVALID_FILTER_OPERATION",c.length);if(u==="Flat"){let d=l?vfr:_fr;Ou(o[i],d(s,a));continue}if(u==="AVL"){let d=c[0],f=a[d],p=[];switch(d){case"gt":{p=Zrt(s,f,!1);break}case"gte":{p=Zrt(s,f,!0);break}case"lt":{p=Xrt(s,f,!1);break}case"lte":{p=Xrt(s,f,!0);break}case"eq":{p=pfr(s,f)??[];break}case"between":{let[m,h]=f;p=lfr(s,m,h);break}}Ou(o[i],p)}}return j8(Object.values(o))}function xno(t){return t.searchableProperties}function Ono(t){return t.searchablePropertiesWithTypes}function $fr(t){let e=gH(t.e,t.s,t.k);e.d=t.d,e.w=t.w;for(let r of Object.keys(t.c))e.c[r]=$fr(t.c[r]);return e}function Tno(t){return{numberToDocumentId:new Map(t)}}function Eno(t){return Array.from(t.numberToDocumentId.entries())}function Pno(t,e){let{indexes:r,vectorIndexes:n,searchableProperties:o,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:s,avgFieldLength:u,fieldLengths:l}=e,c={},d={};for(let f of Object.keys(r)){let{node:p,type:m,isArray:h}=r[f];switch(m){case"Radix":c[f]={type:"Radix",node:$fr(p),isArray:h};break;case"Flat":c[f]={type:"Flat",node:Tno(p),isArray:h};break;default:c[f]=r[f]}}for(let f of Object.keys(n)){let p=n[f].vectors;for(let m in p)p[m]=[p[m][0],new Float32Array(p[m][1])];d[f]={size:n[f].size,vectors:p}}return{sharedInternalDocumentStore:t,indexes:c,vectorIndexes:d,searchableProperties:o,searchablePropertiesWithTypes:i,frequencies:a,tokenOccurrences:s,avgFieldLength:u,fieldLengths:l}}function Mno(t){let{indexes:e,vectorIndexes:r,searchableProperties:n,searchablePropertiesWithTypes:o,frequencies:i,tokenOccurrences:a,avgFieldLength:s,fieldLengths:u}=t,l={};for(let d of Object.keys(r)){let f=r[d].vectors;for(let p in f)f[p]=[f[p][0],Array.from(f[p][1])];l[d]={size:r[d].size,vectors:f}}let c={};for(let d of Object.keys(e)){let{type:f,node:p,isArray:m}=e[d];if(f!=="Flat"){c[d]=e[d];continue}c[d]={type:"Flat",node:Eno(p),isArray:m}}return{indexes:c,vectorIndexes:l,searchableProperties:n,searchablePropertiesWithTypes:o,frequencies:i,tokenOccurrences:a,avgFieldLength:s,fieldLengths:u}}function Lfr(){return{create:Dfr,insert:_no,remove:wno,insertDocumentScoreParameters:pno,insertTokenScoreParameters:mno,removeDocumentScoreParameters:hno,removeTokenScoreParameters:gno,calculateResultScores:yno,search:Sno,searchByWhereClause:Cno,getSearchableProperties:xno,getSearchablePropertiesWithTypes:Ono,load:Pno,save:Mno}}var int=v(()=>{wh();hfr();wfr();Ofr();Nfr();ed();iie();mxe();nie();NS()});function Ffr(t,e,r,n,o){let i={language:t.tokenizer.language,sharedInternalDocumentStore:e,enabled:!0,isSorted:!0,sortableProperties:[],sortablePropertiesWithTypes:{},sorts:{}};for(let[a,s]of Object.entries(r)){let u=`${o}${o?".":""}${a}`;if(!n.includes(u)){if(typeof s=="object"&&!Array.isArray(s)){let l=Ffr(t,e,s,n,u);Ou(i.sortableProperties,l.sortableProperties),i.sorts={...i.sorts,...l.sorts},i.sortablePropertiesWithTypes={...i.sortablePropertiesWithTypes,...l.sortablePropertiesWithTypes};continue}if(!z1(s))switch(s){case"boolean":case"number":case"string":i.sortableProperties.push(u),i.sortablePropertiesWithTypes[u]=s,i.sorts[u]={docs:new Map,orderedDocsToRemove:new Map,orderedDocs:[],type:s};break;case"geopoint":case"enum":continue;case"enum[]":case"boolean[]":case"number[]":case"string[]":continue;default:throw Ir("INVALID_SORT_SCHEMA_TYPE",Array.isArray(s)?"array":s,u)}}}return i}function Ano(t,e,r,n){return n?.enabled!==!1?Ffr(t,e,r,(n||{}).unsortableProperties||[],""):{disabled:!0}}function Ino(t,e,r,n){if(!t.enabled)return;t.isSorted=!1;let o=tu(t.sharedInternalDocumentStore,r),i=t.sorts[e];i.orderedDocsToRemove.has(o)&&ant(t,e),i.docs.set(o,i.orderedDocs.length),i.orderedDocs.push([o,n])}function kfr(t){if(t.isSorted||!t.enabled)return;let e=Object.keys(t.sorts);for(let r of e)$no(t,r);t.isSorted=!0}function Nno(t,e,r){return e[1].localeCompare(r[1],Vdr(t))}function jno(t,e){return t[1]-e[1]}function Dno(t,e){return e[1]?-1:1}function $no(t,e){let r=t.sorts[e],n;switch(r.type){case"string":n=Nno.bind(null,t.language);break;case"number":n=jno.bind(null);break;case"boolean":n=Dno.bind(null);break}r.orderedDocs.sort(n);let o=r.orderedDocs.length;for(let i=0;i!r.orderedDocsToRemove.has(n[0])),r.orderedDocsToRemove.clear())}function Fno(t,e,r){if(!t.enabled)return;let n=t.sorts[e],o=tu(t.sharedInternalDocumentStore,r);n.docs.get(o)&&(n.docs.delete(o),n.orderedDocsToRemove.set(o,!0))}function kno(t,e,r){if(!t.enabled)throw Ir("SORT_DISABLED");let n=r.property,o=r.order==="DESC",i=t.sorts[n];if(!i)throw Ir("UNABLE_TO_SORT_ON_UNKNOWN_FIELD",n,t.sortableProperties.join(", "));return ant(t,n),kfr(t),e.sort((a,s)=>{let u=i.docs.get(tu(t.sharedInternalDocumentStore,a[0])),l=i.docs.get(tu(t.sharedInternalDocumentStore,s[0])),c=typeof u<"u",d=typeof l<"u";return!c&&!d?0:c?d?o?l-u:u-l:-1:1}),e}function qno(t){return t.enabled?t.sortableProperties:[]}function Bno(t){return t.enabled?t.sortablePropertiesWithTypes:{}}function Uno(t,e){let r=e;if(!r.enabled)return{enabled:!1};let n=Object.keys(r.sorts).reduce((o,i)=>{let{docs:a,orderedDocs:s,type:u}=r.sorts[i];return o[i]={docs:new Map(Object.entries(a).map(([l,c])=>[+l,c])),orderedDocsToRemove:new Map,orderedDocs:s,type:u},o},{});return{sharedInternalDocumentStore:t,language:r.language,sortableProperties:r.sortableProperties,sortablePropertiesWithTypes:r.sortablePropertiesWithTypes,sorts:n,enabled:!0,isSorted:r.isSorted}}function zno(t){if(!t.enabled)return{enabled:!1};Lno(t),kfr(t);let e=Object.keys(t.sorts).reduce((r,n)=>{let{docs:o,orderedDocs:i,type:a}=t.sorts[n];return r[n]={docs:Object.fromEntries(o.entries()),orderedDocs:i,type:a},r},{});return{language:t.language,sortableProperties:t.sortableProperties,sortablePropertiesWithTypes:t.sortablePropertiesWithTypes,sorts:e,enabled:t.enabled,isSorted:t.isSorted}}function qfr(){return{create:Ano,insert:Ino,remove:Fno,save:zno,load:Uno,sortBy:kno,getSortableProperties:qno,getSortablePropertiesWithTypes:Bno}}var snt=v(()=>{wh();nie();NS();ed();uxe()});function Jno(t){return t<192||t>383?t:Vno[t-192]||t}function Bfr(t){let e=[];for(let r=0;r{Vno=[65,65,65,65,65,65,65,67,69,69,69,69,73,73,73,73,69,78,79,79,79,79,79,null,79,85,85,85,85,89,80,115,97,97,97,97,97,97,97,99,101,101,101,101,105,105,105,105,101,110,111,111,111,111,111,null,111,117,117,117,117,121,112,121,65,97,65,97,65,97,67,99,67,99,67,99,67,99,68,100,68,100,69,101,69,101,69,101,69,101,69,101,71,103,71,103,71,103,71,103,72,104,72,104,73,105,73,105,73,105,73,105,73,105,73,105,74,106,75,107,107,76,108,76,108,76,108,76,108,76,108,78,110,78,110,78,110,110,78,110,79,111,79,111,79,111,79,111,82,114,82,114,82,114,83,115,83,115,83,115,83,115,84,116,84,116,84,116,85,117,85,117,85,117,85,117,85,117,85,117,87,119,89,121,89,90,122,90,122,90,122,115]});function Hfr(t){let e,r,n,o,i,a;if(t.length<3)return t;let s=t.substring(0,1);if(s=="y"&&(t=s.toUpperCase()+t.substring(1)),n=/^(.+?)(ss|i)es$/,o=/^(.+?)([^s])s$/,n.test(t)?t=t.replace(n,"$1$2"):o.test(t)&&(t=t.replace(o,"$1$2")),n=/^(.+?)eed$/,o=/^(.+?)(ed|ing)$/,n.test(t)){let u=n.exec(t);n=new RegExp(unt),n.test(u[1])&&(n=/.$/,t=t.replace(n,""))}else o.test(t)&&(e=o.exec(t)[1],o=new RegExp(zfr),o.test(e)&&(t=e,o=/(at|bl|iz)$/,i=new RegExp("([^aeiouylsz])\\1$"),a=new RegExp("^"+xA+gxe+"[^aeiouwxy]$"),o.test(t)?t=t+"e":i.test(t)?(n=/.$/,t=t.replace(n,"")):a.test(t)&&(t=t+"e")));if(n=/^(.+?)y$/,n.test(t)&&(e=n.exec(t)?.[1],n=new RegExp(zfr),e&&n.test(e)&&(t=e+"i")),n=/^(.+?)(ational|tional|enci|anci|izer|bli|alli|entli|eli|ousli|ization|ation|ator|alism|iveness|fulness|ousness|aliti|iviti|biliti|logi)$/,n.test(t)){let u=n.exec(t);e=u?.[1],r=u?.[2],n=new RegExp(unt),e&&n.test(e)&&(t=e+Kno[r])}if(n=/^(.+?)(icate|ative|alize|iciti|ical|ful|ness)$/,n.test(t)){let u=n.exec(t);e=u?.[1],r=u?.[2],n=new RegExp(unt),e&&n.test(e)&&(t=e+Wno[r])}if(n=/^(.+?)(al|ance|ence|er|ic|able|ible|ant|ement|ment|ent|ou|ism|ate|iti|ous|ive|ize)$/,o=/^(.+?)(s|t)(ion)$/,n.test(t))e=n.exec(t)?.[1],n=new RegExp(hxe),e&&n.test(e)&&(t=e);else if(o.test(t)){let u=o.exec(t);e=u?.[1]??""+u?.[2]??"",o=new RegExp(hxe),o.test(e)&&(t=e)}return n=/^(.+?)e$/,n.test(t)&&(e=n.exec(t)?.[1],n=new RegExp(hxe),o=new RegExp(Zno),i=new RegExp("^"+xA+gxe+"[^aeiouwxy]$"),e&&(n.test(e)||o.test(e)&&!i.test(e))&&(t=e)),n=/ll$/,o=new RegExp(hxe),n.test(t)&&o.test(t)&&(n=/.$/,t=t.replace(n,"")),s=="y"&&(t=s.toLowerCase()+t.substring(1)),t}var Kno,Wno,Gno,gxe,xA,aie,unt,Zno,hxe,zfr,Vfr=v(()=>{Kno={ational:"ate",tional:"tion",enci:"ence",anci:"ance",izer:"ize",bli:"ble",alli:"al",entli:"ent",eli:"e",ousli:"ous",ization:"ize",ation:"ate",ator:"ate",alism:"al",iveness:"ive",fulness:"ful",ousness:"ous",aliti:"al",iviti:"ive",biliti:"ble",logi:"log"},Wno={icate:"ic",ative:"",alize:"al",iciti:"ic",ical:"ic",ful:"",ness:""},Gno="[^aeiou]",gxe="[aeiouy]",xA=Gno+"[^aeiouy]*",aie=gxe+"[aeiou]*",unt="^("+xA+")?"+aie+xA,Zno="^("+xA+")?"+aie+xA+"("+aie+")?$",hxe="^("+xA+")?"+aie+xA+aie+xA,zfr="^("+xA+")?"+gxe});function lnt(t,e){let r=`${this.language}:${t}:${e}`;return this.normalizationCache.has(r)?this.normalizationCache.get(r):this.stopWords?.includes(e)?(this.normalizationCache.set(r,""),""):(this.stemmer&&!this.stemmerSkipProperties.has(t)&&(e=this.stemmer(e)),e=Bfr(e),this.normalizationCache.set(r,e),e)}function Xno(t){for(;t[t.length-1]==="";)t.pop();for(;t[0]==="";)t.shift();return t}function Jfr(t,e,r){if(e&&e!==this.language)throw Ir("LANGUAGE_NOT_SUPPORTED",e);if(typeof t!="string")return[t];let n;if(r&&this.tokenizeSkipProperties.has(r))n=[this.normalizeToken.bind(this,r??"")(t)];else{let i=Hdr[this.language];n=t.toLowerCase().split(i).map(this.normalizeToken.bind(this,r??"")).filter(Boolean)}let o=Xno(n);return this.allowDuplicates?o:Array.from(new Set(o))}function cnt(t={}){if(!t.language)t.language="english";else if(!tie.includes(t.language))throw Ir("LANGUAGE_NOT_SUPPORTED",t.language);let e;if(t.stemming||t.stemmer&&!("stemming"in t))if(t.stemmer){if(typeof t.stemmer!="function")throw Ir("INVALID_STEMMER_FUNCTION_TYPE");e=t.stemmer}else if(t.language==="english")e=Hfr;else throw Ir("MISSING_STEMMER",t.language);let r;if(t.stopWords!==!1){if(r=[],Array.isArray(t.stopWords))r=t.stopWords;else if(typeof t.stopWords=="function")r=t.stopWords(r);else if(t.stopWords)throw Ir("CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY");if(!Array.isArray(r))throw Ir("CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY");for(let o of r)if(typeof o!="string")throw Ir("CUSTOM_STOP_WORDS_MUST_BE_FUNCTION_OR_ARRAY")}let n={tokenize:Jfr,language:t.language,stemmer:e,stemmerSkipProperties:new Set(t.stemmerSkipProperties?[t.stemmerSkipProperties].flat():[]),tokenizeSkipProperties:new Set(t.tokenizeSkipProperties?[t.tokenizeSkipProperties].flat():[]),stopWords:r,allowDuplicates:!!t.allowDuplicates,normalizeToken:lnt,normalizationCache:new Map};return n.tokenize=Jfr.bind(n),n.normalizeToken=lnt,n}var yxe=v(()=>{wh();Ufr();uxe();Vfr()});function Qno(t){let e={formatElapsedTime:Ydr,getDocumentIndexId:Qdr,getDocumentProperties:lxe,validateSchema:zrt};for(let r of Krt){let n=r;if(t[n]){if(typeof t[n]!="function")throw Ir("COMPONENT_MUST_BE_FUNCTION",n)}else t[n]=e[n]}for(let r of Object.keys(t))if(!afr.includes(r)&&!Krt.includes(r))throw Ir("UNSUPPORTED_COMPONENT",r)}function q8({schema:t,sort:e,language:r,components:n,id:o,plugins:i}){n||(n={}),o||(o=rie());let a=n.tokenizer,s=n.index,u=n.documentsStore,l=n.sorter;if(a?a.tokenize?a=a:a=cnt(a):a=cnt({language:r??"english"}),n.tokenizer&&r)throw Ir("NO_LANGUAGE_WITH_CUSTOM_TOKENIZER");let c=tfr();s||(s=Lfr()),l||(l=qfr()),u||(u=rfr()),Qno(n);let{getDocumentProperties:d,getDocumentIndexId:f,validateSchema:p,formatElapsedTime:m}=n,h={data:{},caches:{},schema:t,tokenizer:a,index:s,sorter:l,documentsStore:u,internalDocumentIDStore:c,getDocumentProperties:d,getDocumentIndexId:f,validateSchema:p,beforeInsert:[],afterInsert:[],beforeRemove:[],afterRemove:[],beforeUpdate:[],afterUpdate:[],beforeSearch:[],afterSearch:[],beforeInsertMultiple:[],afterInsertMultiple:[],beforeRemoveMultiple:[],afterRemoveMultiple:[],afterUpdateMultiple:[],beforeUpdateMultiple:[],afterCreate:[],formatElapsedTime:m,id:o,plugins:i,version:eoo()};h.data={index:h.index.create(h,c,t),docs:h.documentsStore.create(h,c),sorting:h.sorter.create(h,c,t,e)};for(let y of nfr)h[y]=(h[y]??[]).concat(ofr(h,y));let g=h.afterCreate;return g&&sfr(g,h),h}function eoo(){return"{{VERSION}}"}var Kfr=v(()=>{nie();Jrt();ifr();Sk();int();NS();snt();yxe();wh();ed()});var Wfr=v(()=>{});var dnt=v(()=>{nie();Jrt();int();yxe();snt();NS()});var bxe,fnt,pnt,mnt=v(()=>{bxe="fulltext",fnt="hybrid",pnt="vector"});var Ck,xk,hnt=v(()=>{mnt();Ck=Symbol("orama.insertions"),xk=Symbol("orama.removals")});function gnt(t){typeof t[Ck]!="number"&&(queueMicrotask(()=>{t[Ck]=void 0}),t[Ck]=0),t[Ck]>1e3?(Gfr("Orama's insert operation is synchronous. Please avoid inserting a large number of document in a single operation in order not to block the main thread or, in alternative, please use insertMultiple.",{code:"ORAMA0001"}),t[Ck]=-1):t[Ck]>=0&&t[Ck]++}function ynt(t){typeof t[xk]!="number"&&(queueMicrotask(()=>{t[xk]=void 0}),t[xk]=0),t[xk]>1e3?(Gfr("Orama's remove operation is synchronous. Please avoid removing a large number of document in a single operation in order not to block the main thread, in alternative, please use updateMultiple.",{code:"ORAMA0002"}),t[xk]=-1):t[xk]>=0&&t[xk]++}var Gfr,bnt=v(()=>{hnt();Gfr=globalThis.process?.emitWarning??function(e,r){console.warn(`[WARNING] [${r.code}] ${e}`)}});function sie(t,e,r,n,o){let i=t.validateSchema(e,t.schema);if(i)throw Ir("SCHEMA_VALIDATION_FAILURE",i);return _d(t.index.beforeInsert)||_d(t.index.insert)||_d(t.index.afterInsert)?ooo(t,e,r,n,o):ioo(t,e,r,n,o)}async function ooo(t,e,r,n,o){let{index:i,docs:a}=t.data,s=t.getDocumentIndexId(e);if(typeof s!="string")throw Ir("DOCUMENT_ID_MUST_BE_STRING",typeof s);if(!t.documentsStore.store(a,s,e))throw Ir("DOCUMENT_ALREADY_EXISTS",s);let u=t.documentsStore.count(a);n||await UC(t.beforeInsert,t,s,e);let l=t.index.getSearchableProperties(i),c=t.index.getSearchablePropertiesWithTypes(i),d=t.getDocumentProperties(e,l);for(let[f,p]of Object.entries(d)){if(typeof p>"u")continue;let m=typeof p,h=c[f];Zfr(m,h,f,p)}return await aoo(t,s,l,d,u,r,e,o),n||await UC(t.afterInsert,t,s,e),gnt(t),s}function ioo(t,e,r,n,o){let{index:i,docs:a}=t.data,s=t.getDocumentIndexId(e);if(typeof s!="string")throw Ir("DOCUMENT_ID_MUST_BE_STRING",typeof s);if(!t.documentsStore.store(a,s,e))throw Ir("DOCUMENT_ALREADY_EXISTS",s);let u=t.documentsStore.count(a);n||UC(t.beforeInsert,t,s,e);let l=t.index.getSearchableProperties(i),c=t.index.getSearchablePropertiesWithTypes(i),d=t.getDocumentProperties(e,l);for(let[f,p]of Object.entries(d)){if(typeof p>"u")continue;let m=typeof p,h=c[f];Zfr(m,h,f,p)}return soo(t,s,l,d,u,r,e,o),n||UC(t.afterInsert,t,s,e),gnt(t),s}function Zfr(t,e,r,n){if(!(efr(e)&&typeof n=="object"&&typeof n.lon=="number"&&typeof n.lat=="number")&&!(z1(e)&&Array.isArray(n))&&!($8(e)&&Array.isArray(n))&&!(roo.has(e)&&noo.has(t))&&t!==e)throw Ir("INVALID_DOCUMENT_PROPERTY",r,e,t)}async function aoo(t,e,r,n,o,i,a,s){for(let c of r){let d=n[c];if(typeof d>"u")continue;let f=t.index.getSearchablePropertiesWithTypes(t.data.index)[c];await t.index.beforeInsert?.(t.data.index,c,e,d,f,i,t.tokenizer,o),await t.index.insert(t.index,t.data.index,c,e,d,f,i,t.tokenizer,o,s),await t.index.afterInsert?.(t.data.index,c,e,d,f,i,t.tokenizer,o)}let u=t.sorter.getSortableProperties(t.data.sorting),l=t.getDocumentProperties(a,u);for(let c of u){let d=l[c];if(typeof d>"u")continue;let f=t.sorter.getSortablePropertiesWithTypes(t.data.sorting)[c];t.sorter.insert(t.data.sorting,c,e,d,f,i)}}function soo(t,e,r,n,o,i,a,s){for(let c of r){let d=n[c];if(typeof d>"u")continue;let f=t.index.getSearchablePropertiesWithTypes(t.data.index)[c];t.index.beforeInsert?.(t.data.index,c,e,d,f,i,t.tokenizer,o),t.index.insert(t.index,t.data.index,c,e,d,f,i,t.tokenizer,o,s),t.index.afterInsert?.(t.data.index,c,e,d,f,i,t.tokenizer,o)}let u=t.sorter.getSortableProperties(t.data.sorting),l=t.getDocumentProperties(a,u);for(let c of u){let d=l[c];if(typeof d>"u")continue;let f=t.sorter.getSortablePropertiesWithTypes(t.data.sorting)[c];t.sorter.insert(t.data.sorting,c,e,d,f,i)}}var roo,noo,_nt=v(()=>{dnt();ed();Sk();bnt();wh();roo=new Set(["enum","enum[]"]),noo=new Set(["string","number"])});function yH(t,e,r,n){return _d(t.index.beforeRemove)||_d(t.index.remove)||_d(t.index.afterRemove)?uoo(t,e,r,n):loo(t,e,r,n)}async function uoo(t,e,r,n){let o=!0,{index:i,docs:a}=t.data,s=t.documentsStore.get(a,e);if(!s)return!1;let u=IS(t.internalDocumentIDStore,tu(t.internalDocumentIDStore,e)),l=t.documentsStore.count(a);n||await UC(t.beforeRemove,t,u);let c=t.index.getSearchableProperties(i),d=t.index.getSearchablePropertiesWithTypes(i),f=t.getDocumentProperties(s,c);for(let h of c){let g=f[h];if(typeof g>"u")continue;let y=d[h];await t.index.beforeRemove?.(t.data.index,h,u,g,y,r,t.tokenizer,l),await t.index.remove(t.index,t.data.index,h,e,g,y,r,t.tokenizer,l)||(o=!1),await t.index.afterRemove?.(t.data.index,h,u,g,y,r,t.tokenizer,l)}let p=await t.sorter.getSortableProperties(t.data.sorting),m=await t.getDocumentProperties(s,p);for(let h of p)typeof m[h]>"u"||t.sorter.remove(t.data.sorting,h,e);return n||await UC(t.afterRemove,t,u),t.documentsStore.remove(t.data.docs,e),ynt(t),o}function loo(t,e,r,n){let o=!0,{index:i,docs:a}=t.data,s=t.documentsStore.get(a,e);if(!s)return!1;let u=IS(t.internalDocumentIDStore,tu(t.internalDocumentIDStore,e)),l=t.documentsStore.count(a);n||UC(t.beforeRemove,t,u);let c=t.index.getSearchableProperties(i),d=t.index.getSearchablePropertiesWithTypes(i),f=t.getDocumentProperties(s,c);for(let h of c){let g=f[h];if(typeof g>"u")continue;let y=d[h];t.index.beforeRemove?.(t.data.index,h,u,g,y,r,t.tokenizer,l),t.index.remove(t.index,t.data.index,h,e,g,y,r,t.tokenizer,l)||(o=!1),t.index.afterRemove?.(t.data.index,h,u,g,y,r,t.tokenizer,l)}let p=t.sorter.getSortableProperties(t.data.sorting),m=t.getDocumentProperties(s,p);for(let h of p)typeof m[h]>"u"||t.sorter.remove(t.data.sorting,h,e);return n||UC(t.afterRemove,t,u),t.documentsStore.remove(t.data.docs,e),ynt(t),o}function uie(t,e,r,n,o){return _d(t.index.beforeRemove)||_d(t.index.remove)||_d(t.index.afterRemove)||_d(t.beforeRemoveMultiple)||_d(t.afterRemoveMultiple)?coo(t,e,r,n,o):doo(t,e,r,n,o)}async function coo(t,e,r,n,o){let i=0;r||(r=1e3);let a=o?[]:e.map(s=>IS(t.internalDocumentIDStore,tu(t.internalDocumentIDStore,s)));return o||await hH(t.beforeRemoveMultiple,t,a),await new Promise((s,u)=>{let l=0;async function c(){let d=e.slice(l*r,++l*r);if(!d.length)return s();for(let f of d)try{await yH(t,f,n,o)&&i++}catch(p){u(p)}setTimeout(c,0)}setTimeout(c,0)}),o||await hH(t.afterRemoveMultiple,t,a),i}function doo(t,e,r,n,o){let i=0;r||(r=1e3);let a=o?[]:e.map(l=>IS(t.internalDocumentIDStore,tu(t.internalDocumentIDStore,l)));o||hH(t.beforeRemoveMultiple,t,a);let s=0;function u(){let l=e.slice(s*r,++s*r);if(l.length){for(let c of l)yH(t,c,n,o)&&i++;setTimeout(u,0)}}return u(),o||hH(t.afterRemoveMultiple,t,a),i}var vnt=v(()=>{Sk();NS();bnt();ed()});function foo(t,e){return t[1]-e[1]}function poo(t,e){return e[1]-t[1]}function moo(t="desc"){return t.toLowerCase()==="asc"?foo:poo}function B8(t,e,r){let n={},o=e.map(([l])=>l),i=t.documentsStore.getMultiple(t.data.docs,o),a=Object.keys(r),s=t.index.getSearchablePropertiesWithTypes(t.data.index);for(let l of a){let c;if(s[l]==="number"){let{ranges:d}=r[l],f=d.length,p=Array.from({length:f});for(let m=0;m{for(let o of t){let i=`${o.from}-${o.to}`;r?.has(i)||n>=o.from&&n<=o.to&&(e[i]===void 0?e[i]=1:(e[i]++,r?.add(i)))}}}function Yfr(t,e,r){let n=e==="boolean"?"false":"";return o=>{let i=o?.toString()??n;r?.has(i)||(t[i]=(t[i]??0)+1,r?.add(i))}}var _xe=v(()=>{wh();ed()});function U8(t,e){let r=new Map,n=[];for(let o of t)r.set(o,!0);for(let o of e){let[i]=o;r.has(i)&&(n.push(o),r.delete(i))}return n}var vxe=v(()=>{});function z8(t,e,r){let n=r.properties,o=n.length,i=t.index.getSearchablePropertiesWithTypes(t.data.index);for(let y=0;y"u")throw Ir("UNKNOWN_GROUP_BY_PROPERTY",b);if(!Qfr.includes(i[b]))throw Ir("INVALID_GROUP_BY_PROPERTY",b,Qfr.join(", "),i[b])}let a=e.map(([y])=>IS(t.internalDocumentIDStore,y)),s=t.documentsStore.getMultiple(t.data.docs,a),u=s.length,l=r.maxResult||Number.MAX_SAFE_INTEGER,c=[],d={};for(let y=0;y"u")continue;let T=typeof E!="boolean"?E:""+E,R=_.perValue[T]??{indexes:[],count:0};R.count>=l||(R.indexes.push(x),R.count++,_.perValue[T]=R,w.add(E))}c.push(Array.from(w)),d[b]=_}let f=epr(c),p=f.length,m=[];for(let y=0;yO-E),w.indexes.length!==0&&m.push(w)}let h=m.length,g=Array.from({length:h});for(let y=0;y({id:a[T],score:e[T][1],document:s[T]})),x=_.reducer.bind(null,b.values),O=_.getInitialValue(b.indexes.length),E=w.reduce(x,O);g[y]={values:b.values,result:E}}return g}function epr(t,e=0){if(e+1===t.length)return t[e].map(i=>[i]);let r=t[e],n=epr(t,e+1),o=[];for(let i of r)for(let a of n){let s=[i];Ou(s,a),o.push(s)}return o}var hoo,Qfr,wxe=v(()=>{wh();ed();NS();hoo={reducer:(t,e,r,n)=>(e[n]=r,e),getInitialValue:t=>Array.from({length:t})},Qfr=["string","number","boolean"]});function tpr(t,e,r){let n=BC(),o=t.beforeSearch?.length||t.afterSearch?.length;function i(){e.relevance=Object.assign(Sxe,e.relevance??{});let s=Object.keys(t.data.index.vectorIndexes),u=e.facets&&Object.keys(e.facets).length>0,{limit:l=10,offset:c=0,term:d,properties:f,threshold:p=0,distinctOn:m,includeVectors:h=!1}=e,g=e.preflight===!0,{index:y,docs:b}=t.data,_=t.tokenizer.tokenize(d??"",r),w=t.caches.propertiesToSearch;if(!w){let F=t.index.getSearchablePropertiesWithTypes(y);w=t.index.getSearchableProperties(y),w=w.filter(B=>F[B].startsWith("string")),t.caches.propertiesToSearch=w}if(f&&f!=="*"){for(let F of f)if(!w.includes(F))throw Ir("UNKNOWN_INDEX",F,w.join(", "));w=w.filter(F=>f.includes(F))}let x=bH(t.tokenizer,t.index,t.documentsStore,r,e,w,_,t.documentsStore.count(b),n),O=Object.keys(e.where??{}).length>0,E=[];O&&(E=t.index.searchByWhereClause(x,y,e.where));let T=_.length;if(T||f?.length){let F=w.length;for(let B=0;B[F,0]));let R=Object.entries(x.uniqueDocsIDs).map(([F,B])=>[+F,B]);if(O&&(R=U8(E,R)),e.sortBy)if(typeof e.sortBy=="function"){let F=R.map(([J])=>J),U=t.documentsStore.getMultiple(t.data.docs,F).map((J,G)=>[R[G][0],R[G][1],J]);U.sort(e.sortBy),R=U.map(([J,G])=>[J,G])}else R=t.sorter.sortBy(t.data.sorting,R,e.sortBy).map(([F,B])=>[tu(t.internalDocumentIDStore,F),B]);else R=R.sort(Xdr);let I;g||(I=m?npr(t,R,c,l,m):Cxe(t,R,c,l));let j={elapsed:{formatted:"",raw:0},hits:[],count:R.length};if(typeof I<"u"&&(j.hits=I.filter(Boolean),h||cxe(j,s)),u){let F=B8(t,R,e.facets);j.facets=F}return e.groupBy&&(j.groups=z8(t,R,e.groupBy)),j.elapsed=t.formatElapsedTime(BC()-x.timeStart),j}async function a(){t.beforeSearch&&await F8(t.beforeSearch,t,e,r);let s=i();return t.afterSearch&&await L8(t.afterSearch,t,e,r,s),s}return o?a():i()}var rpr=v(()=>{iie();_xe();vxe();wxe();Sk();NS();wh();ed();_H()});function wnt(t,e,r="english"){let n=BC(),o=t.beforeSearch?.length||t.afterSearch?.length;function i(){let{vector:s}=e;if(s&&(!("value"in s)||!("property"in s)))throw Ir("INVALID_VECTOR_INPUT",Object.keys(s).join(", "));let{limit:u=10,offset:l=0,includeVectors:c=!1}=e,d=t.data.index.vectorIndexes[s.property],f=d.size,p=d.vectors,m=e.facets&&Object.keys(e.facets).length>0,h=Object.keys(e.where??{}).length>0,{index:g,docs:y}=t.data;if(s?.value.length!==f)throw s?.property===void 0||s?.value.length===void 0?Ir("INVALID_INPUT_VECTOR","undefined",f,"undefined"):Ir("INVALID_INPUT_VECTOR",s.property,f,s.value.length);s instanceof Float32Array||(s.value=new Float32Array(s.value));let b=pxe(s.value,p,f,e.similarity).map(([F,B])=>[tu(t.internalDocumentIDStore,F),B]),_=t.caches.propertiesToSearch;if(!_){let F=t.index.getSearchablePropertiesWithTypes(g);_=t.index.getSearchableProperties(g),_=_.filter(B=>F[B].startsWith("string")),t.caches.propertiesToSearch=_}let w=[],x=bH(t.tokenizer,t.index,t.documentsStore,r,e,_,w,t.documentsStore.count(y),n),O=[];h&&(O=t.index.searchByWhereClause(x,g,e.where),b=U8(O,b));let E=[];m&&(E=B8(t,b,e.facets));let T=Array.from({length:u});for(let F=0;F{_H();ed();_xe();wh();mxe();vxe();wxe();NS();Sk()});function ipr(t,e,r){let n=BC(),o=t.beforeSearch?.length||t.afterSearch?.length;function i(){let{offset:s=0,limit:u=10,includeVectors:l=!1}=e,c=e.facets&&Object.keys(e.facets).length>0,d=goo(t,e,r),f=yoo(t,e),{index:p,docs:m}=t.data,h=e.hybridWeights,g=_oo(d,f,e.term??"",h),y=t.tokenizer.tokenize(e.term??"",r),b=t.caches.propertiesToSearch;if(!b){let j=t.index.getSearchablePropertiesWithTypes(p);b=t.index.getSearchableProperties(p),b=b.filter(F=>j[F].startsWith("string")),t.caches.propertiesToSearch=b}if(e.properties&&e.properties!=="*"){for(let j of e.properties)if(!b.includes(j))throw Ir("UNKNOWN_INDEX",j,b.join(", "));b=b.filter(j=>e.properties.includes(j))}let _=bH(t.tokenizer,t.index,t.documentsStore,r,e,b,y,t.documentsStore.count(m),n),w=Object.keys(e.where??{}).length>0,x=[];w&&(x=t.index.searchByWhereClause(_,p,e.where),g=U8(x,g));let O;c&&(O=B8(t,g,e.facets));let E;e.groupBy&&(E=z8(t,g,e.groupBy));let T=Cxe(t,g,s,u).filter(Boolean),R=BC(),I={count:g.length,elapsed:{raw:Number(R-n),formatted:mH(R-n)},hits:T,...O?{facets:O}:{},...E?{groups:E}:{}};if(!l){let j=Object.keys(t.data.index.vectorIndexes);cxe(I,j)}return I}async function a(){t.beforeSearch&&await F8(t.beforeSearch,t,e,r);let s=i();return t.afterSearch&&await L8(t.afterSearch,t,e,r,s),s}return o?a():i()}function goo(t,e,r){let n=BC();e.relevance=Object.assign(Sxe,e.relevance??{});let{term:o="",properties:i,threshold:a=0}=e,{index:s,docs:u}=t.data,l=t.tokenizer.tokenize(o,r),c=t.caches.propertiesToSearch;if(!c){let m=t.index.getSearchablePropertiesWithTypes(s);c=t.index.getSearchableProperties(s),c=c.filter(h=>m[h].startsWith("string")),t.caches.propertiesToSearch=c}if(i&&i!=="*"){let m=new Set(c),h=new Set(i);for(let g of i)if(!m.has(g))throw Ir("UNKNOWN_INDEX",g,c.join(", "));c=c.filter(g=>h.has(g))}let d=bH(t.tokenizer,t.index,t.documentsStore,r,e,c,l,t.documentsStore.count(u),n),f=l.length;if(f||i&&i.length>0){let m=c.length;for(let h=0;h[m,0]));let p=Object.entries(d.uniqueDocsIDs).map(([m,h])=>[+m,h]).sort((m,h)=>h[1]-m[1]);return apr(p)}function yoo(t,e){let r=e.vector,n=t.data.index.vectorIndexes[r?.property],o=n.size,i=n.vectors;if(r&&(!r.value||!r.property))throw Ir("INVALID_VECTOR_INPUT",Object.keys(r).join(", "));if(r.value.length!==o)throw Ir("INVALID_INPUT_VECTOR",r.property,o,r.value.length);r instanceof Float32Array||(r.value=new Float32Array(r.value));let a=pxe(r.value,i,o,e.similarity).map(([s,u])=>[tu(t.internalDocumentIDStore,s),u]);return apr(a)}function Cnt([,t]){return t}function apr(t){let e=Math.max.apply(Math,t.map(Cnt));return t.map(([r,n])=>[r,n/e])}function opr(t,e){return t/e}function boo(t,e){return(r,n)=>r*t+n*e}function _oo(t,e,r,n){let o=Math.max.apply(Math,t.map(Cnt)),i=Math.max.apply(Math,e.map(Cnt)),a=n&&n.text&&n.vector,{text:s,vector:u}=a?n:voo(r),l=new Map,c=t.length,d=boo(s,u);for(let p=0;pm[1]-p[1])}function voo(t){return{text:.5,vector:.5}}var spr=v(()=>{ed();vxe();iie();wh();_H();_xe();wxe();mxe();NS();_H();Sk()});function bH(t,e,r,n,o,i,a,s,u){let l={},c={};for(let d of i){let f={};for(let p of a)f[p]=[];l[d]=f,c[d]=[]}return{timeStart:u,tokenizer:t,index:e,documentsStore:r,language:n,params:o,docsCount:s,uniqueDocsIDs:{},indexMap:l,docsIntersection:c}}function P_(t,e,r){let n=e.mode??bxe;if(n===bxe)return tpr(t,e,r);if(n===pnt)return wnt(t,e);if(n===fnt)return ipr(t,e);throw Ir("INVALID_SEARCH_MODE",n)}function npr(t,e,r,n,o){let i=t.data.docs,a=new Map,s=[],u=new Set,l=e.length,c=0;for(let d=0;d"u")continue;let[p,m]=f;if(u.has(p))continue;let h=t.documentsStore.get(i,p),g=D8(h,o);if(!(typeof g>"u"||a.has(g))&&(a.set(g,!0),c++,!(c<=r)&&(s.push({id:IS(t.internalDocumentIDStore,p),score:m,document:h}),u.add(p),c>=r+n)))break}return s}function Cxe(t,e,r,n){let o=t.data.docs,i=Array.from({length:n}),a=new Set;for(let s=r;s"u")break;let[l,c]=u;if(!a.has(l)){let d=t.documentsStore.get(o,l);i[s]={id:IS(t.internalDocumentIDStore,l),score:c,document:d},a.add(l)}}return i}var Sxe,_H=v(()=>{NS();wh();ed();mnt();rpr();Snt();spr();Sxe={k:1.2,b:.75,d:.5}});function xxe(t,e){t.internalDocumentIDStore.load(t,e.internalDocumentIDStore),t.data.index=t.index.load(t.internalDocumentIDStore,e.index),t.data.docs=t.documentsStore.load(t.internalDocumentIDStore,e.docs),t.data.sorting=t.sorter.load(t.internalDocumentIDStore,e.sorting),t.tokenizer.language=e.language}function xnt(t){return{internalDocumentIDStore:t.internalDocumentIDStore.save(t.internalDocumentIDStore),index:t.index.save(t.data.index),docs:t.documentsStore.save(t.data.docs),sorting:t.sorter.save(t.data.sorting),language:t.tokenizer.language}}var upr=v(()=>{});var lpr=v(()=>{Sk();wh();_nt();vnt();ed()});var cpr=v(()=>{wh();_H()});var dpr=v(()=>{Qrt();ed();iie();yxe()});var Oxe=v(()=>{Kfr();Wfr();_nt();vnt();_H();Snt();upr();lpr();cpr();hnt();dnt();dpr()});function xoo(t,e){let r=fpr(t,n=>e.priority<=n.priority);t.splice(r+1,0,e)}function fpr(t,e){for(let r=t.length-1;r>=0;r--)if(e(t[r]))return r;return-1}var bDa,_Da,Soo,Coo,Ont,Ooo,vH,Tnt=v(()=>{bDa=new Error("timeout while waiting for mutex to become available"),_Da=new Error("mutex already locked"),Soo=new Error("request for lock canceled"),Coo=function(t,e,r,n){function o(i){return i instanceof r?i:new r(function(a){a(i)})}return new(r||(r=Promise))(function(i,a){function s(c){try{l(n.next(c))}catch(d){a(d)}}function u(c){try{l(n.throw(c))}catch(d){a(d)}}function l(c){c.done?i(c.value):o(c.value).then(s,u)}l((n=n.apply(t,e||[])).next())})},Ont=class{constructor(e,r=Soo){this._value=e,this._cancelError=r,this._queue=[],this._weightedWaiters=[]}acquire(e=1,r=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return new Promise((n,o)=>{let i={resolve:n,reject:o,weight:e,priority:r},a=fpr(this._queue,s=>r<=s.priority);a===-1&&e<=this._value?this._dispatchItem(i):this._queue.splice(a+1,0,i)})}runExclusive(e){return Coo(this,arguments,void 0,function*(r,n=1,o=0){let[i,a]=yield this.acquire(n,o);try{return yield r(i)}finally{a()}})}waitForUnlock(e=1,r=0){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);return this._couldLockImmediately(e,r)?Promise.resolve():new Promise(n=>{this._weightedWaiters[e-1]||(this._weightedWaiters[e-1]=[]),xoo(this._weightedWaiters[e-1],{resolve:n,priority:r})})}isLocked(){return this._value<=0}getValue(){return this._value}setValue(e){this._value=e,this._dispatchQueue()}release(e=1){if(e<=0)throw new Error(`invalid weight ${e}: must be positive`);this._value+=e,this._dispatchQueue()}cancel(){this._queue.forEach(e=>e.reject(this._cancelError)),this._queue=[]}_dispatchQueue(){for(this._drainUnlockWaiters();this._queue.length>0&&this._queue[0].weight<=this._value;)this._dispatchItem(this._queue.shift()),this._drainUnlockWaiters()}_dispatchItem(e){let r=this._value;this._value-=e.weight,e.resolve([r,this._newReleaser(e.weight)])}_newReleaser(e){let r=!1;return()=>{r||(r=!0,this.release(e))}}_drainUnlockWaiters(){if(this._queue.length===0)for(let e=this._value;e>0;e--){let r=this._weightedWaiters[e-1];r&&(r.forEach(n=>n.resolve()),this._weightedWaiters[e-1]=[])}else{let e=this._queue[0].priority;for(let r=this._value;r>0;r--){let n=this._weightedWaiters[r-1];if(!n)continue;let o=n.findIndex(i=>i.priority<=e);(o===-1?n:n.splice(0,o)).forEach(i=>i.resolve())}}}_couldLockImmediately(e,r){return(this._queue.length===0||this._queue[0].prioritye(),1,r)}isLocked(){return this._semaphore.isLocked()}waitForUnlock(e=0){return this._semaphore.waitForUnlock(1,e)}release(){this._semaphore.isLocked()&&this._semaphore.release()}cancel(){return this._semaphore.cancel()}}});var ppr=S(()=>{});var Mi=S((Txe,mpr)=>{(function(t,e){typeof Txe=="object"?mpr.exports=Txe=e():typeof define=="function"&&define.amd?define([],e):t.CryptoJS=e()})(Txe,function(){var t=t||function(e,r){var n;if(typeof window<"u"&&window.crypto&&(n=window.crypto),typeof self<"u"&&self.crypto&&(n=self.crypto),typeof globalThis<"u"&&globalThis.crypto&&(n=globalThis.crypto),!n&&typeof window<"u"&&window.msCrypto&&(n=window.msCrypto),!n&&typeof window<"u"&&window.crypto&&(n=window.crypto),!n&&typeof require=="function")try{n=ppr()}catch{}var o=function(){if(n){if(typeof n.getRandomValues=="function")try{return n.getRandomValues(new Uint32Array(1))[0]}catch{}if(typeof n.randomBytes=="function")try{return n.randomBytes(4).readInt32LE()}catch{}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function y(){}return function(b){var _;return y.prototype=b,_=new y,y.prototype=null,_}}(),a={},s=a.lib={},u=s.Base=function(){return{extend:function(y){var b=i(this);return y&&b.mixIn(y),(!b.hasOwnProperty("init")||this.init===b.init)&&(b.init=function(){b.$super.init.apply(this,arguments)}),b.init.prototype=b,b.$super=this,b},create:function(){var y=this.extend();return y.init.apply(y,arguments),y},init:function(){},mixIn:function(y){for(var b in y)y.hasOwnProperty(b)&&(this[b]=y[b]);y.hasOwnProperty("toString")&&(this.toString=y.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),l=s.WordArray=u.extend({init:function(y,b){y=this.words=y||[],b!=r?this.sigBytes=b:this.sigBytes=y.length*4},toString:function(y){return(y||d).stringify(this)},concat:function(y){var b=this.words,_=y.words,w=this.sigBytes,x=y.sigBytes;if(this.clamp(),w%4)for(var O=0;O>>2]>>>24-O%4*8&255;b[w+O>>>2]|=E<<24-(w+O)%4*8}else for(var T=0;T>>2]=_[T>>>2];return this.sigBytes+=x,this},clamp:function(){var y=this.words,b=this.sigBytes;y[b>>>2]&=4294967295<<32-b%4*8,y.length=e.ceil(b/4)},clone:function(){var y=u.clone.call(this);return y.words=this.words.slice(0),y},random:function(y){for(var b=[],_=0;_>>2]>>>24-x%4*8&255;w.push((O>>>4).toString(16)),w.push((O&15).toString(16))}return w.join("")},parse:function(y){for(var b=y.length,_=[],w=0;w>>3]|=parseInt(y.substr(w,2),16)<<24-w%8*4;return new l.init(_,b/2)}},f=c.Latin1={stringify:function(y){for(var b=y.words,_=y.sigBytes,w=[],x=0;x<_;x++){var O=b[x>>>2]>>>24-x%4*8&255;w.push(String.fromCharCode(O))}return w.join("")},parse:function(y){for(var b=y.length,_=[],w=0;w>>2]|=(y.charCodeAt(w)&255)<<24-w%4*8;return new l.init(_,b)}},p=c.Utf8={stringify:function(y){try{return decodeURIComponent(escape(f.stringify(y)))}catch{throw new Error("Malformed UTF-8 data")}},parse:function(y){return f.parse(unescape(encodeURIComponent(y)))}},m=s.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(y){typeof y=="string"&&(y=p.parse(y)),this._data.concat(y),this._nDataBytes+=y.sigBytes},_process:function(y){var b,_=this._data,w=_.words,x=_.sigBytes,O=this.blockSize,E=O*4,T=x/E;y?T=e.ceil(T):T=e.max((T|0)-this._minBufferSize,0);var R=T*O,I=e.min(R*4,x);if(R){for(var j=0;j{(function(t,e){typeof Exe=="object"?hpr.exports=Exe=e(Mi()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(Exe,function(t){return function(e){var r=t,n=r.lib,o=n.Base,i=n.WordArray,a=r.x64={},s=a.Word=o.extend({init:function(l,c){this.high=l,this.low=c}}),u=a.WordArray=o.extend({init:function(l,c){l=this.words=l||[],c!=e?this.sigBytes=c:this.sigBytes=l.length*8},toX32:function(){for(var l=this.words,c=l.length,d=[],f=0;f{(function(t,e){typeof Pxe=="object"?gpr.exports=Pxe=e(Mi()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(Pxe,function(t){return function(){if(typeof ArrayBuffer=="function"){var e=t,r=e.lib,n=r.WordArray,o=n.init,i=n.init=function(a){if(a instanceof ArrayBuffer&&(a=new Uint8Array(a)),(a instanceof Int8Array||typeof Uint8ClampedArray<"u"&&a instanceof Uint8ClampedArray||a instanceof Int16Array||a instanceof Uint16Array||a instanceof Int32Array||a instanceof Uint32Array||a instanceof Float32Array||a instanceof Float64Array)&&(a=new Uint8Array(a.buffer,a.byteOffset,a.byteLength)),a instanceof Uint8Array){for(var s=a.byteLength,u=[],l=0;l>>2]|=a[l]<<24-l%4*8;o.call(this,u,s)}else o.apply(this,arguments)};i.prototype=n}}(),t.lib.WordArray})});var _pr=S((Mxe,bpr)=>{(function(t,e){typeof Mxe=="object"?bpr.exports=Mxe=e(Mi()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(Mxe,function(t){return function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,i=o.Utf16=o.Utf16BE={stringify:function(s){for(var u=s.words,l=s.sigBytes,c=[],d=0;d>>2]>>>16-d%4*8&65535;c.push(String.fromCharCode(f))}return c.join("")},parse:function(s){for(var u=s.length,l=[],c=0;c>>1]|=s.charCodeAt(c)<<16-c%2*16;return n.create(l,u*2)}};o.Utf16LE={stringify:function(s){for(var u=s.words,l=s.sigBytes,c=[],d=0;d>>2]>>>16-d%4*8&65535);c.push(String.fromCharCode(f))}return c.join("")},parse:function(s){for(var u=s.length,l=[],c=0;c>>1]|=a(s.charCodeAt(c)<<16-c%2*16);return n.create(l,u*2)}};function a(s){return s<<8&4278255360|s>>>8&16711935}}(),t.enc.Utf16})});var Ok=S((Rxe,vpr)=>{(function(t,e){typeof Rxe=="object"?vpr.exports=Rxe=e(Mi()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(Rxe,function(t){return function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,i=o.Base64={stringify:function(s){var u=s.words,l=s.sigBytes,c=this._map;s.clamp();for(var d=[],f=0;f>>2]>>>24-f%4*8&255,m=u[f+1>>>2]>>>24-(f+1)%4*8&255,h=u[f+2>>>2]>>>24-(f+2)%4*8&255,g=p<<16|m<<8|h,y=0;y<4&&f+y*.75>>6*(3-y)&63));var b=c.charAt(64);if(b)for(;d.length%4;)d.push(b);return d.join("")},parse:function(s){var u=s.length,l=this._map,c=this._reverseMap;if(!c){c=this._reverseMap=[];for(var d=0;d>>6-f%4*2,h=p|m;c[d>>>2]|=h<<24-d%4*8,d++}return n.create(c,d)}}(),t.enc.Base64})});var Spr=S((Axe,wpr)=>{(function(t,e){typeof Axe=="object"?wpr.exports=Axe=e(Mi()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(Axe,function(t){return function(){var e=t,r=e.lib,n=r.WordArray,o=e.enc,i=o.Base64url={stringify:function(s,u){u===void 0&&(u=!0);var l=s.words,c=s.sigBytes,d=u?this._safe_map:this._map;s.clamp();for(var f=[],p=0;p>>2]>>>24-p%4*8&255,h=l[p+1>>>2]>>>24-(p+1)%4*8&255,g=l[p+2>>>2]>>>24-(p+2)%4*8&255,y=m<<16|h<<8|g,b=0;b<4&&p+b*.75>>6*(3-b)&63));var _=d.charAt(64);if(_)for(;f.length%4;)f.push(_);return f.join("")},parse:function(s,u){u===void 0&&(u=!0);var l=s.length,c=u?this._safe_map:this._map,d=this._reverseMap;if(!d){d=this._reverseMap=[];for(var f=0;f>>6-f%4*2,h=p|m;c[d>>>2]|=h<<24-d%4*8,d++}return n.create(c,d)}}(),t.enc.Base64url})});var Tk=S((Ixe,Cpr)=>{(function(t,e){typeof Ixe=="object"?Cpr.exports=Ixe=e(Mi()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(Ixe,function(t){return function(e){var r=t,n=r.lib,o=n.WordArray,i=n.Hasher,a=r.algo,s=[];(function(){for(var p=0;p<64;p++)s[p]=e.abs(e.sin(p+1))*4294967296|0})();var u=a.MD5=i.extend({_doReset:function(){this._hash=new o.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(p,m){for(var h=0;h<16;h++){var g=m+h,y=p[g];p[g]=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360}var b=this._hash.words,_=p[m+0],w=p[m+1],x=p[m+2],O=p[m+3],E=p[m+4],T=p[m+5],R=p[m+6],I=p[m+7],j=p[m+8],F=p[m+9],B=p[m+10],U=p[m+11],J=p[m+12],G=p[m+13],oe=p[m+14],ne=p[m+15],z=b[0],ee=b[1],ie=b[2],Z=b[3];z=l(z,ee,ie,Z,_,7,s[0]),Z=l(Z,z,ee,ie,w,12,s[1]),ie=l(ie,Z,z,ee,x,17,s[2]),ee=l(ee,ie,Z,z,O,22,s[3]),z=l(z,ee,ie,Z,E,7,s[4]),Z=l(Z,z,ee,ie,T,12,s[5]),ie=l(ie,Z,z,ee,R,17,s[6]),ee=l(ee,ie,Z,z,I,22,s[7]),z=l(z,ee,ie,Z,j,7,s[8]),Z=l(Z,z,ee,ie,F,12,s[9]),ie=l(ie,Z,z,ee,B,17,s[10]),ee=l(ee,ie,Z,z,U,22,s[11]),z=l(z,ee,ie,Z,J,7,s[12]),Z=l(Z,z,ee,ie,G,12,s[13]),ie=l(ie,Z,z,ee,oe,17,s[14]),ee=l(ee,ie,Z,z,ne,22,s[15]),z=c(z,ee,ie,Z,w,5,s[16]),Z=c(Z,z,ee,ie,R,9,s[17]),ie=c(ie,Z,z,ee,U,14,s[18]),ee=c(ee,ie,Z,z,_,20,s[19]),z=c(z,ee,ie,Z,T,5,s[20]),Z=c(Z,z,ee,ie,B,9,s[21]),ie=c(ie,Z,z,ee,ne,14,s[22]),ee=c(ee,ie,Z,z,E,20,s[23]),z=c(z,ee,ie,Z,F,5,s[24]),Z=c(Z,z,ee,ie,oe,9,s[25]),ie=c(ie,Z,z,ee,O,14,s[26]),ee=c(ee,ie,Z,z,j,20,s[27]),z=c(z,ee,ie,Z,G,5,s[28]),Z=c(Z,z,ee,ie,x,9,s[29]),ie=c(ie,Z,z,ee,I,14,s[30]),ee=c(ee,ie,Z,z,J,20,s[31]),z=d(z,ee,ie,Z,T,4,s[32]),Z=d(Z,z,ee,ie,j,11,s[33]),ie=d(ie,Z,z,ee,U,16,s[34]),ee=d(ee,ie,Z,z,oe,23,s[35]),z=d(z,ee,ie,Z,w,4,s[36]),Z=d(Z,z,ee,ie,E,11,s[37]),ie=d(ie,Z,z,ee,I,16,s[38]),ee=d(ee,ie,Z,z,B,23,s[39]),z=d(z,ee,ie,Z,G,4,s[40]),Z=d(Z,z,ee,ie,_,11,s[41]),ie=d(ie,Z,z,ee,O,16,s[42]),ee=d(ee,ie,Z,z,R,23,s[43]),z=d(z,ee,ie,Z,F,4,s[44]),Z=d(Z,z,ee,ie,J,11,s[45]),ie=d(ie,Z,z,ee,ne,16,s[46]),ee=d(ee,ie,Z,z,x,23,s[47]),z=f(z,ee,ie,Z,_,6,s[48]),Z=f(Z,z,ee,ie,I,10,s[49]),ie=f(ie,Z,z,ee,oe,15,s[50]),ee=f(ee,ie,Z,z,T,21,s[51]),z=f(z,ee,ie,Z,J,6,s[52]),Z=f(Z,z,ee,ie,O,10,s[53]),ie=f(ie,Z,z,ee,B,15,s[54]),ee=f(ee,ie,Z,z,w,21,s[55]),z=f(z,ee,ie,Z,j,6,s[56]),Z=f(Z,z,ee,ie,ne,10,s[57]),ie=f(ie,Z,z,ee,R,15,s[58]),ee=f(ee,ie,Z,z,G,21,s[59]),z=f(z,ee,ie,Z,E,6,s[60]),Z=f(Z,z,ee,ie,U,10,s[61]),ie=f(ie,Z,z,ee,x,15,s[62]),ee=f(ee,ie,Z,z,F,21,s[63]),b[0]=b[0]+z|0,b[1]=b[1]+ee|0,b[2]=b[2]+ie|0,b[3]=b[3]+Z|0},_doFinalize:function(){var p=this._data,m=p.words,h=this._nDataBytes*8,g=p.sigBytes*8;m[g>>>5]|=128<<24-g%32;var y=e.floor(h/4294967296),b=h;m[(g+64>>>9<<4)+15]=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,m[(g+64>>>9<<4)+14]=(b<<8|b>>>24)&16711935|(b<<24|b>>>8)&4278255360,p.sigBytes=(m.length+1)*4,this._process();for(var _=this._hash,w=_.words,x=0;x<4;x++){var O=w[x];w[x]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360}return _},clone:function(){var p=i.clone.call(this);return p._hash=this._hash.clone(),p}});function l(p,m,h,g,y,b,_){var w=p+(m&h|~m&g)+y+_;return(w<>>32-b)+m}function c(p,m,h,g,y,b,_){var w=p+(m&g|h&~g)+y+_;return(w<>>32-b)+m}function d(p,m,h,g,y,b,_){var w=p+(m^h^g)+y+_;return(w<>>32-b)+m}function f(p,m,h,g,y,b,_){var w=p+(h^(m|~g))+y+_;return(w<>>32-b)+m}r.MD5=i._createHelper(u),r.HmacMD5=i._createHmacHelper(u)}(Math),t.MD5})});var Ent=S((Nxe,xpr)=>{(function(t,e){typeof Nxe=="object"?xpr.exports=Nxe=e(Mi()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(Nxe,function(t){return function(){var e=t,r=e.lib,n=r.WordArray,o=r.Hasher,i=e.algo,a=[],s=i.SHA1=o.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(u,l){for(var c=this._hash.words,d=c[0],f=c[1],p=c[2],m=c[3],h=c[4],g=0;g<80;g++){if(g<16)a[g]=u[l+g]|0;else{var y=a[g-3]^a[g-8]^a[g-14]^a[g-16];a[g]=y<<1|y>>>31}var b=(d<<5|d>>>27)+h+a[g];g<20?b+=(f&p|~f&m)+1518500249:g<40?b+=(f^p^m)+1859775393:g<60?b+=(f&p|f&m|p&m)-1894007588:b+=(f^p^m)-899497514,h=m,m=p,p=f<<30|f>>>2,f=d,d=b}c[0]=c[0]+d|0,c[1]=c[1]+f|0,c[2]=c[2]+p|0,c[3]=c[3]+m|0,c[4]=c[4]+h|0},_doFinalize:function(){var u=this._data,l=u.words,c=this._nDataBytes*8,d=u.sigBytes*8;return l[d>>>5]|=128<<24-d%32,l[(d+64>>>9<<4)+14]=Math.floor(c/4294967296),l[(d+64>>>9<<4)+15]=c,u.sigBytes=l.length*4,this._process(),this._hash},clone:function(){var u=o.clone.call(this);return u._hash=this._hash.clone(),u}});e.SHA1=o._createHelper(s),e.HmacSHA1=o._createHmacHelper(s)}(),t.SHA1})});var Dxe=S((jxe,Opr)=>{(function(t,e){typeof jxe=="object"?Opr.exports=jxe=e(Mi()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(jxe,function(t){return function(e){var r=t,n=r.lib,o=n.WordArray,i=n.Hasher,a=r.algo,s=[],u=[];(function(){function d(h){for(var g=e.sqrt(h),y=2;y<=g;y++)if(!(h%y))return!1;return!0}function f(h){return(h-(h|0))*4294967296|0}for(var p=2,m=0;m<64;)d(p)&&(m<8&&(s[m]=f(e.pow(p,1/2))),u[m]=f(e.pow(p,1/3)),m++),p++})();var l=[],c=a.SHA256=i.extend({_doReset:function(){this._hash=new o.init(s.slice(0))},_doProcessBlock:function(d,f){for(var p=this._hash.words,m=p[0],h=p[1],g=p[2],y=p[3],b=p[4],_=p[5],w=p[6],x=p[7],O=0;O<64;O++){if(O<16)l[O]=d[f+O]|0;else{var E=l[O-15],T=(E<<25|E>>>7)^(E<<14|E>>>18)^E>>>3,R=l[O-2],I=(R<<15|R>>>17)^(R<<13|R>>>19)^R>>>10;l[O]=T+l[O-7]+I+l[O-16]}var j=b&_^~b&w,F=m&h^m&g^h&g,B=(m<<30|m>>>2)^(m<<19|m>>>13)^(m<<10|m>>>22),U=(b<<26|b>>>6)^(b<<21|b>>>11)^(b<<7|b>>>25),J=x+U+j+u[O]+l[O],G=B+F;x=w,w=_,_=b,b=y+J|0,y=g,g=h,h=m,m=J+G|0}p[0]=p[0]+m|0,p[1]=p[1]+h|0,p[2]=p[2]+g|0,p[3]=p[3]+y|0,p[4]=p[4]+b|0,p[5]=p[5]+_|0,p[6]=p[6]+w|0,p[7]=p[7]+x|0},_doFinalize:function(){var d=this._data,f=d.words,p=this._nDataBytes*8,m=d.sigBytes*8;return f[m>>>5]|=128<<24-m%32,f[(m+64>>>9<<4)+14]=e.floor(p/4294967296),f[(m+64>>>9<<4)+15]=p,d.sigBytes=f.length*4,this._process(),this._hash},clone:function(){var d=i.clone.call(this);return d._hash=this._hash.clone(),d}});r.SHA256=i._createHelper(c),r.HmacSHA256=i._createHmacHelper(c)}(Math),t.SHA256})});var Epr=S(($xe,Tpr)=>{(function(t,e,r){typeof $xe=="object"?Tpr.exports=$xe=e(Mi(),Dxe()):typeof define=="function"&&define.amd?define(["./core","./sha256"],e):e(t.CryptoJS)})($xe,function(t){return function(){var e=t,r=e.lib,n=r.WordArray,o=e.algo,i=o.SHA256,a=o.SHA224=i.extend({_doReset:function(){this._hash=new n.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var s=i._doFinalize.call(this);return s.sigBytes-=4,s}});e.SHA224=i._createHelper(a),e.HmacSHA224=i._createHmacHelper(a)}(),t.SHA224})});var Pnt=S((Lxe,Ppr)=>{(function(t,e,r){typeof Lxe=="object"?Ppr.exports=Lxe=e(Mi(),lie()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(Lxe,function(t){return function(){var e=t,r=e.lib,n=r.Hasher,o=e.x64,i=o.Word,a=o.WordArray,s=e.algo;function u(){return i.create.apply(i,arguments)}var l=[u(1116352408,3609767458),u(1899447441,602891725),u(3049323471,3964484399),u(3921009573,2173295548),u(961987163,4081628472),u(1508970993,3053834265),u(2453635748,2937671579),u(2870763221,3664609560),u(3624381080,2734883394),u(310598401,1164996542),u(607225278,1323610764),u(1426881987,3590304994),u(1925078388,4068182383),u(2162078206,991336113),u(2614888103,633803317),u(3248222580,3479774868),u(3835390401,2666613458),u(4022224774,944711139),u(264347078,2341262773),u(604807628,2007800933),u(770255983,1495990901),u(1249150122,1856431235),u(1555081692,3175218132),u(1996064986,2198950837),u(2554220882,3999719339),u(2821834349,766784016),u(2952996808,2566594879),u(3210313671,3203337956),u(3336571891,1034457026),u(3584528711,2466948901),u(113926993,3758326383),u(338241895,168717936),u(666307205,1188179964),u(773529912,1546045734),u(1294757372,1522805485),u(1396182291,2643833823),u(1695183700,2343527390),u(1986661051,1014477480),u(2177026350,1206759142),u(2456956037,344077627),u(2730485921,1290863460),u(2820302411,3158454273),u(3259730800,3505952657),u(3345764771,106217008),u(3516065817,3606008344),u(3600352804,1432725776),u(4094571909,1467031594),u(275423344,851169720),u(430227734,3100823752),u(506948616,1363258195),u(659060556,3750685593),u(883997877,3785050280),u(958139571,3318307427),u(1322822218,3812723403),u(1537002063,2003034995),u(1747873779,3602036899),u(1955562222,1575990012),u(2024104815,1125592928),u(2227730452,2716904306),u(2361852424,442776044),u(2428436474,593698344),u(2756734187,3733110249),u(3204031479,2999351573),u(3329325298,3815920427),u(3391569614,3928383900),u(3515267271,566280711),u(3940187606,3454069534),u(4118630271,4000239992),u(116418474,1914138554),u(174292421,2731055270),u(289380356,3203993006),u(460393269,320620315),u(685471733,587496836),u(852142971,1086792851),u(1017036298,365543100),u(1126000580,2618297676),u(1288033470,3409855158),u(1501505948,4234509866),u(1607167915,987167468),u(1816402316,1246189591)],c=[];(function(){for(var f=0;f<80;f++)c[f]=u()})();var d=s.SHA512=n.extend({_doReset:function(){this._hash=new a.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(f,p){for(var m=this._hash.words,h=m[0],g=m[1],y=m[2],b=m[3],_=m[4],w=m[5],x=m[6],O=m[7],E=h.high,T=h.low,R=g.high,I=g.low,j=y.high,F=y.low,B=b.high,U=b.low,J=_.high,G=_.low,oe=w.high,ne=w.low,z=x.high,ee=x.low,ie=O.high,Z=O.low,$=E,q=T,Y=R,D=I,A=j,V=F,K=B,se=U,be=J,xe=G,Pe=oe,pt=ne,Ht=z,Ze=ee,Yr=ie,Vt=Z,gt=0;gt<80;gt++){var Ie,_n,Ct=c[gt];if(gt<16)_n=Ct.high=f[p+gt*2]|0,Ie=Ct.low=f[p+gt*2+1]|0;else{var Fe=c[gt-15],At=Fe.high,ke=Fe.low,ze=(At>>>1|ke<<31)^(At>>>8|ke<<24)^At>>>7,$e=(ke>>>1|At<<31)^(ke>>>8|At<<24)^(ke>>>7|At<<25),Pt=c[gt-2],To=Pt.high,Wl=Pt.low,vn=(To>>>19|Wl<<13)^(To<<3|Wl>>>29)^To>>>6,si=(Wl>>>19|To<<13)^(Wl<<3|To>>>29)^(Wl>>>6|To<<26),Vb=c[gt-7],Ue=Vb.high,Rn=Vb.low,ui=c[gt-16],Xm=ui.high,We=ui.low;Ie=$e+Rn,_n=ze+Ue+(Ie>>>0<$e>>>0?1:0),Ie=Ie+si,_n=_n+vn+(Ie>>>0>>0?1:0),Ie=Ie+We,_n=_n+Xm+(Ie>>>0>>0?1:0),Ct.high=_n,Ct.low=Ie}var It=be&Pe^~be&Ht,Sr=xe&pt^~xe&Ze,Eo=$&Y^$&A^Y&A,xi=q&D^q&V^D&V,ks=($>>>28|q<<4)^($<<30|q>>>2)^($<<25|q>>>7),Gu=(q>>>28|$<<4)^(q<<30|$>>>2)^(q<<25|$>>>7),Jh=(be>>>14|xe<<18)^(be>>>18|xe<<14)^(be<<23|xe>>>9),fm=(xe>>>14|be<<18)^(xe>>>18|be<<14)^(xe<<23|be>>>9),Iu=l[gt],Ym=Iu.high,pm=Iu.low,pi=Vt+fm,wt=Yr+Jh+(pi>>>0>>0?1:0),pi=pi+Sr,wt=wt+It+(pi>>>0>>0?1:0),pi=pi+pm,wt=wt+Ym+(pi>>>0>>0?1:0),pi=pi+Ie,wt=wt+_n+(pi>>>0>>0?1:0),Vy=Gu+xi,hv=ks+Eo+(Vy>>>0>>0?1:0);Yr=Ht,Vt=Ze,Ht=Pe,Ze=pt,Pe=be,pt=xe,xe=se+pi|0,be=K+wt+(xe>>>0>>0?1:0)|0,K=A,se=V,A=Y,V=D,Y=$,D=q,q=pi+Vy|0,$=wt+hv+(q>>>0>>0?1:0)|0}T=h.low=T+q,h.high=E+$+(T>>>0>>0?1:0),I=g.low=I+D,g.high=R+Y+(I>>>0>>0?1:0),F=y.low=F+V,y.high=j+A+(F>>>0>>0?1:0),U=b.low=U+se,b.high=B+K+(U>>>0>>0?1:0),G=_.low=G+xe,_.high=J+be+(G>>>0>>0?1:0),ne=w.low=ne+pt,w.high=oe+Pe+(ne>>>0>>0?1:0),ee=x.low=ee+Ze,x.high=z+Ht+(ee>>>0>>0?1:0),Z=O.low=Z+Vt,O.high=ie+Yr+(Z>>>0>>0?1:0)},_doFinalize:function(){var f=this._data,p=f.words,m=this._nDataBytes*8,h=f.sigBytes*8;p[h>>>5]|=128<<24-h%32,p[(h+128>>>10<<5)+30]=Math.floor(m/4294967296),p[(h+128>>>10<<5)+31]=m,f.sigBytes=p.length*4,this._process();var g=this._hash.toX32();return g},clone:function(){var f=n.clone.call(this);return f._hash=this._hash.clone(),f},blockSize:1024/32});e.SHA512=n._createHelper(d),e.HmacSHA512=n._createHmacHelper(d)}(),t.SHA512})});var Rpr=S((Fxe,Mpr)=>{(function(t,e,r){typeof Fxe=="object"?Mpr.exports=Fxe=e(Mi(),lie(),Pnt()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./sha512"],e):e(t.CryptoJS)})(Fxe,function(t){return function(){var e=t,r=e.x64,n=r.Word,o=r.WordArray,i=e.algo,a=i.SHA512,s=i.SHA384=a.extend({_doReset:function(){this._hash=new o.init([new n.init(3418070365,3238371032),new n.init(1654270250,914150663),new n.init(2438529370,812702999),new n.init(355462360,4144912697),new n.init(1731405415,4290775857),new n.init(2394180231,1750603025),new n.init(3675008525,1694076839),new n.init(1203062813,3204075428)])},_doFinalize:function(){var u=a._doFinalize.call(this);return u.sigBytes-=16,u}});e.SHA384=a._createHelper(s),e.HmacSHA384=a._createHmacHelper(s)}(),t.SHA384})});var Ipr=S((kxe,Apr)=>{(function(t,e,r){typeof kxe=="object"?Apr.exports=kxe=e(Mi(),lie()):typeof define=="function"&&define.amd?define(["./core","./x64-core"],e):e(t.CryptoJS)})(kxe,function(t){return function(e){var r=t,n=r.lib,o=n.WordArray,i=n.Hasher,a=r.x64,s=a.Word,u=r.algo,l=[],c=[],d=[];(function(){for(var m=1,h=0,g=0;g<24;g++){l[m+5*h]=(g+1)*(g+2)/2%64;var y=h%5,b=(2*m+3*h)%5;m=y,h=b}for(var m=0;m<5;m++)for(var h=0;h<5;h++)c[m+5*h]=h+(2*m+3*h)%5*5;for(var _=1,w=0;w<24;w++){for(var x=0,O=0,E=0;E<7;E++){if(_&1){var T=(1<>>24)&16711935|(_<<24|_>>>8)&4278255360,w=(w<<8|w>>>24)&16711935|(w<<24|w>>>8)&4278255360;var x=g[b];x.high^=w,x.low^=_}for(var O=0;O<24;O++){for(var E=0;E<5;E++){for(var T=0,R=0,I=0;I<5;I++){var x=g[E+5*I];T^=x.high,R^=x.low}var j=f[E];j.high=T,j.low=R}for(var E=0;E<5;E++)for(var F=f[(E+4)%5],B=f[(E+1)%5],U=B.high,J=B.low,T=F.high^(U<<1|J>>>31),R=F.low^(J<<1|U>>>31),I=0;I<5;I++){var x=g[E+5*I];x.high^=T,x.low^=R}for(var G=1;G<25;G++){var T,R,x=g[G],oe=x.high,ne=x.low,z=l[G];z<32?(T=oe<>>32-z,R=ne<>>32-z):(T=ne<>>64-z,R=oe<>>64-z);var ee=f[c[G]];ee.high=T,ee.low=R}var ie=f[0],Z=g[0];ie.high=Z.high,ie.low=Z.low;for(var E=0;E<5;E++)for(var I=0;I<5;I++){var G=E+5*I,x=g[G],$=f[G],q=f[(E+1)%5+5*I],Y=f[(E+2)%5+5*I];x.high=$.high^~q.high&Y.high,x.low=$.low^~q.low&Y.low}var x=g[0],D=d[O];x.high^=D.high,x.low^=D.low}},_doFinalize:function(){var m=this._data,h=m.words,g=this._nDataBytes*8,y=m.sigBytes*8,b=this.blockSize*32;h[y>>>5]|=1<<24-y%32,h[(e.ceil((y+1)/b)*b>>>5)-1]|=128,m.sigBytes=h.length*4,this._process();for(var _=this._state,w=this.cfg.outputLength/8,x=w/8,O=[],E=0;E>>24)&16711935|(R<<24|R>>>8)&4278255360,I=(I<<8|I>>>24)&16711935|(I<<24|I>>>8)&4278255360,O.push(I),O.push(R)}return new o.init(O,w)},clone:function(){for(var m=i.clone.call(this),h=m._state=this._state.slice(0),g=0;g<25;g++)h[g]=h[g].clone();return m}});r.SHA3=i._createHelper(p),r.HmacSHA3=i._createHmacHelper(p)}(Math),t.SHA3})});var jpr=S((qxe,Npr)=>{(function(t,e){typeof qxe=="object"?Npr.exports=qxe=e(Mi()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(qxe,function(t){return function(e){var r=t,n=r.lib,o=n.WordArray,i=n.Hasher,a=r.algo,s=o.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),u=o.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),l=o.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),c=o.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),d=o.create([0,1518500249,1859775393,2400959708,2840853838]),f=o.create([1352829926,1548603684,1836072691,2053994217,0]),p=a.RIPEMD160=i.extend({_doReset:function(){this._hash=o.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(w,x){for(var O=0;O<16;O++){var E=x+O,T=w[E];w[E]=(T<<8|T>>>24)&16711935|(T<<24|T>>>8)&4278255360}var R=this._hash.words,I=d.words,j=f.words,F=s.words,B=u.words,U=l.words,J=c.words,G,oe,ne,z,ee,ie,Z,$,q,Y;ie=G=R[0],Z=oe=R[1],$=ne=R[2],q=z=R[3],Y=ee=R[4];for(var D,O=0;O<80;O+=1)D=G+w[x+F[O]]|0,O<16?D+=m(oe,ne,z)+I[0]:O<32?D+=h(oe,ne,z)+I[1]:O<48?D+=g(oe,ne,z)+I[2]:O<64?D+=y(oe,ne,z)+I[3]:D+=b(oe,ne,z)+I[4],D=D|0,D=_(D,U[O]),D=D+ee|0,G=ee,ee=z,z=_(ne,10),ne=oe,oe=D,D=ie+w[x+B[O]]|0,O<16?D+=b(Z,$,q)+j[0]:O<32?D+=y(Z,$,q)+j[1]:O<48?D+=g(Z,$,q)+j[2]:O<64?D+=h(Z,$,q)+j[3]:D+=m(Z,$,q)+j[4],D=D|0,D=_(D,J[O]),D=D+Y|0,ie=Y,Y=q,q=_($,10),$=Z,Z=D;D=R[1]+ne+q|0,R[1]=R[2]+z+Y|0,R[2]=R[3]+ee+ie|0,R[3]=R[4]+G+Z|0,R[4]=R[0]+oe+$|0,R[0]=D},_doFinalize:function(){var w=this._data,x=w.words,O=this._nDataBytes*8,E=w.sigBytes*8;x[E>>>5]|=128<<24-E%32,x[(E+64>>>9<<4)+14]=(O<<8|O>>>24)&16711935|(O<<24|O>>>8)&4278255360,w.sigBytes=(x.length+1)*4,this._process();for(var T=this._hash,R=T.words,I=0;I<5;I++){var j=R[I];R[I]=(j<<8|j>>>24)&16711935|(j<<24|j>>>8)&4278255360}return T},clone:function(){var w=i.clone.call(this);return w._hash=this._hash.clone(),w}});function m(w,x,O){return w^x^O}function h(w,x,O){return w&x|~w&O}function g(w,x,O){return(w|~x)^O}function y(w,x,O){return w&O|x&~O}function b(w,x,O){return w^(x|~O)}function _(w,x){return w<>>32-x}r.RIPEMD160=i._createHelper(p),r.HmacRIPEMD160=i._createHmacHelper(p)}(Math),t.RIPEMD160})});var Uxe=S((Bxe,Dpr)=>{(function(t,e){typeof Bxe=="object"?Dpr.exports=Bxe=e(Mi()):typeof define=="function"&&define.amd?define(["./core"],e):e(t.CryptoJS)})(Bxe,function(t){(function(){var e=t,r=e.lib,n=r.Base,o=e.enc,i=o.Utf8,a=e.algo,s=a.HMAC=n.extend({init:function(u,l){u=this._hasher=new u.init,typeof l=="string"&&(l=i.parse(l));var c=u.blockSize,d=c*4;l.sigBytes>d&&(l=u.finalize(l)),l.clamp();for(var f=this._oKey=l.clone(),p=this._iKey=l.clone(),m=f.words,h=p.words,g=0;g{(function(t,e,r){typeof zxe=="object"?$pr.exports=zxe=e(Mi(),Dxe(),Uxe()):typeof define=="function"&&define.amd?define(["./core","./sha256","./hmac"],e):e(t.CryptoJS)})(zxe,function(t){return function(){var e=t,r=e.lib,n=r.Base,o=r.WordArray,i=e.algo,a=i.SHA256,s=i.HMAC,u=i.PBKDF2=n.extend({cfg:n.extend({keySize:128/32,hasher:a,iterations:25e4}),init:function(l){this.cfg=this.cfg.extend(l)},compute:function(l,c){for(var d=this.cfg,f=s.create(d.hasher,l),p=o.create(),m=o.create([1]),h=p.words,g=m.words,y=d.keySize,b=d.iterations;h.length{(function(t,e,r){typeof Hxe=="object"?Fpr.exports=Hxe=e(Mi(),Ent(),Uxe()):typeof define=="function"&&define.amd?define(["./core","./sha1","./hmac"],e):e(t.CryptoJS)})(Hxe,function(t){return function(){var e=t,r=e.lib,n=r.Base,o=r.WordArray,i=e.algo,a=i.MD5,s=i.EvpKDF=n.extend({cfg:n.extend({keySize:128/32,hasher:a,iterations:1}),init:function(u){this.cfg=this.cfg.extend(u)},compute:function(u,l){for(var c,d=this.cfg,f=d.hasher.create(),p=o.create(),m=p.words,h=d.keySize,g=d.iterations;m.length{(function(t,e,r){typeof Vxe=="object"?kpr.exports=Vxe=e(Mi(),H1()):typeof define=="function"&&define.amd?define(["./core","./evpkdf"],e):e(t.CryptoJS)})(Vxe,function(t){t.lib.Cipher||function(e){var r=t,n=r.lib,o=n.Base,i=n.WordArray,a=n.BufferedBlockAlgorithm,s=r.enc,u=s.Utf8,l=s.Base64,c=r.algo,d=c.EvpKDF,f=n.Cipher=a.extend({cfg:o.extend(),createEncryptor:function(j,F){return this.create(this._ENC_XFORM_MODE,j,F)},createDecryptor:function(j,F){return this.create(this._DEC_XFORM_MODE,j,F)},init:function(j,F,B){this.cfg=this.cfg.extend(B),this._xformMode=j,this._key=F,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(j){return this._append(j),this._process()},finalize:function(j){j&&this._append(j);var F=this._doFinalize();return F},keySize:128/32,ivSize:128/32,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function j(F){return typeof F=="string"?I:E}return function(F){return{encrypt:function(B,U,J){return j(U).encrypt(F,B,U,J)},decrypt:function(B,U,J){return j(U).decrypt(F,B,U,J)}}}}()}),p=n.StreamCipher=f.extend({_doFinalize:function(){var j=this._process(!0);return j},blockSize:1}),m=r.mode={},h=n.BlockCipherMode=o.extend({createEncryptor:function(j,F){return this.Encryptor.create(j,F)},createDecryptor:function(j,F){return this.Decryptor.create(j,F)},init:function(j,F){this._cipher=j,this._iv=F}}),g=m.CBC=function(){var j=h.extend();j.Encryptor=j.extend({processBlock:function(B,U){var J=this._cipher,G=J.blockSize;F.call(this,B,U,G),J.encryptBlock(B,U),this._prevBlock=B.slice(U,U+G)}}),j.Decryptor=j.extend({processBlock:function(B,U){var J=this._cipher,G=J.blockSize,oe=B.slice(U,U+G);J.decryptBlock(B,U),F.call(this,B,U,G),this._prevBlock=oe}});function F(B,U,J){var G,oe=this._iv;oe?(G=oe,this._iv=e):G=this._prevBlock;for(var ne=0;ne>>2]&255;j.sigBytes-=F}},_=n.BlockCipher=f.extend({cfg:f.cfg.extend({mode:g,padding:b}),reset:function(){var j;f.reset.call(this);var F=this.cfg,B=F.iv,U=F.mode;this._xformMode==this._ENC_XFORM_MODE?j=U.createEncryptor:(j=U.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==j?this._mode.init(this,B&&B.words):(this._mode=j.call(U,this,B&&B.words),this._mode.__creator=j)},_doProcessBlock:function(j,F){this._mode.processBlock(j,F)},_doFinalize:function(){var j,F=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(F.pad(this._data,this.blockSize),j=this._process(!0)):(j=this._process(!0),F.unpad(j)),j},blockSize:128/32}),w=n.CipherParams=o.extend({init:function(j){this.mixIn(j)},toString:function(j){return(j||this.formatter).stringify(this)}}),x=r.format={},O=x.OpenSSL={stringify:function(j){var F,B=j.ciphertext,U=j.salt;return U?F=i.create([1398893684,1701076831]).concat(U).concat(B):F=B,F.toString(l)},parse:function(j){var F,B=l.parse(j),U=B.words;return U[0]==1398893684&&U[1]==1701076831&&(F=i.create(U.slice(2,4)),U.splice(0,4),B.sigBytes-=16),w.create({ciphertext:B,salt:F})}},E=n.SerializableCipher=o.extend({cfg:o.extend({format:O}),encrypt:function(j,F,B,U){U=this.cfg.extend(U);var J=j.createEncryptor(B,U),G=J.finalize(F),oe=J.cfg;return w.create({ciphertext:G,key:B,iv:oe.iv,algorithm:j,mode:oe.mode,padding:oe.padding,blockSize:j.blockSize,formatter:U.format})},decrypt:function(j,F,B,U){U=this.cfg.extend(U),F=this._parse(F,U.format);var J=j.createDecryptor(B,U).finalize(F.ciphertext);return J},_parse:function(j,F){return typeof j=="string"?F.parse(j,this):j}}),T=r.kdf={},R=T.OpenSSL={execute:function(j,F,B,U,J){if(U||(U=i.random(64/8)),J)var G=d.create({keySize:F+B,hasher:J}).compute(j,U);else var G=d.create({keySize:F+B}).compute(j,U);var oe=i.create(G.words.slice(F),B*4);return G.sigBytes=F*4,w.create({key:G,iv:oe,salt:U})}},I=n.PasswordBasedCipher=E.extend({cfg:E.cfg.extend({kdf:R}),encrypt:function(j,F,B,U){U=this.cfg.extend(U);var J=U.kdf.execute(B,j.keySize,j.ivSize,U.salt,U.hasher);U.iv=J.iv;var G=E.encrypt.call(this,j,F,J.key,U);return G.mixIn(J),G},decrypt:function(j,F,B,U){U=this.cfg.extend(U),F=this._parse(F,U.format);var J=U.kdf.execute(B,j.keySize,j.ivSize,F.salt,U.hasher);U.iv=J.iv;var G=E.decrypt.call(this,j,F,J.key,U);return G}})}()})});var Bpr=S((Jxe,qpr)=>{(function(t,e,r){typeof Jxe=="object"?qpr.exports=Jxe=e(Mi(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(Jxe,function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();e.Encryptor=e.extend({processBlock:function(n,o){var i=this._cipher,a=i.blockSize;r.call(this,n,o,a,i),this._prevBlock=n.slice(o,o+a)}}),e.Decryptor=e.extend({processBlock:function(n,o){var i=this._cipher,a=i.blockSize,s=n.slice(o,o+a);r.call(this,n,o,a,i),this._prevBlock=s}});function r(n,o,i,a){var s,u=this._iv;u?(s=u.slice(0),this._iv=void 0):s=this._prevBlock,a.encryptBlock(s,0);for(var l=0;l{(function(t,e,r){typeof Kxe=="object"?Upr.exports=Kxe=e(Mi(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(Kxe,function(t){return t.mode.CTR=function(){var e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:function(n,o){var i=this._cipher,a=i.blockSize,s=this._iv,u=this._counter;s&&(u=this._counter=s.slice(0),this._iv=void 0);var l=u.slice(0);i.encryptBlock(l,0),u[a-1]=u[a-1]+1|0;for(var c=0;c{(function(t,e,r){typeof Wxe=="object"?Hpr.exports=Wxe=e(Mi(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(Wxe,function(t){return t.mode.CTRGladman=function(){var e=t.lib.BlockCipherMode.extend();function r(i){if((i>>24&255)===255){var a=i>>16&255,s=i>>8&255,u=i&255;a===255?(a=0,s===255?(s=0,u===255?u=0:++u):++s):++a,i=0,i+=a<<16,i+=s<<8,i+=u}else i+=1<<24;return i}function n(i){return(i[0]=r(i[0]))===0&&(i[1]=r(i[1])),i}var o=e.Encryptor=e.extend({processBlock:function(i,a){var s=this._cipher,u=s.blockSize,l=this._iv,c=this._counter;l&&(c=this._counter=l.slice(0),this._iv=void 0),n(c);var d=c.slice(0);s.encryptBlock(d,0);for(var f=0;f{(function(t,e,r){typeof Gxe=="object"?Jpr.exports=Gxe=e(Mi(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(Gxe,function(t){return t.mode.OFB=function(){var e=t.lib.BlockCipherMode.extend(),r=e.Encryptor=e.extend({processBlock:function(n,o){var i=this._cipher,a=i.blockSize,s=this._iv,u=this._keystream;s&&(u=this._keystream=s.slice(0),this._iv=void 0),i.encryptBlock(u,0);for(var l=0;l{(function(t,e,r){typeof Zxe=="object"?Wpr.exports=Zxe=e(Mi(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(Zxe,function(t){return t.mode.ECB=function(){var e=t.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:function(r,n){this._cipher.encryptBlock(r,n)}}),e.Decryptor=e.extend({processBlock:function(r,n){this._cipher.decryptBlock(r,n)}}),e}(),t.mode.ECB})});var Xpr=S((Xxe,Zpr)=>{(function(t,e,r){typeof Xxe=="object"?Zpr.exports=Xxe=e(Mi(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(Xxe,function(t){return t.pad.AnsiX923={pad:function(e,r){var n=e.sigBytes,o=r*4,i=o-n%o,a=n+i-1;e.clamp(),e.words[a>>>2]|=i<<24-a%4*8,e.sigBytes+=i},unpad:function(e){var r=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=r}},t.pad.Ansix923})});var Qpr=S((Yxe,Ypr)=>{(function(t,e,r){typeof Yxe=="object"?Ypr.exports=Yxe=e(Mi(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(Yxe,function(t){return t.pad.Iso10126={pad:function(e,r){var n=r*4,o=n-e.sigBytes%n;e.concat(t.lib.WordArray.random(o-1)).concat(t.lib.WordArray.create([o<<24],1))},unpad:function(e){var r=e.words[e.sigBytes-1>>>2]&255;e.sigBytes-=r}},t.pad.Iso10126})});var tmr=S((Qxe,emr)=>{(function(t,e,r){typeof Qxe=="object"?emr.exports=Qxe=e(Mi(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(Qxe,function(t){return t.pad.Iso97971={pad:function(e,r){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,r)},unpad:function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--}},t.pad.Iso97971})});var nmr=S((eOe,rmr)=>{(function(t,e,r){typeof eOe=="object"?rmr.exports=eOe=e(Mi(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(eOe,function(t){return t.pad.ZeroPadding={pad:function(e,r){var n=r*4;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){for(var r=e.words,n=e.sigBytes-1,n=e.sigBytes-1;n>=0;n--)if(r[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},t.pad.ZeroPadding})});var imr=S((tOe,omr)=>{(function(t,e,r){typeof tOe=="object"?omr.exports=tOe=e(Mi(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(tOe,function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding})});var smr=S((rOe,amr)=>{(function(t,e,r){typeof rOe=="object"?amr.exports=rOe=e(Mi(),jm()):typeof define=="function"&&define.amd?define(["./core","./cipher-core"],e):e(t.CryptoJS)})(rOe,function(t){return function(e){var r=t,n=r.lib,o=n.CipherParams,i=r.enc,a=i.Hex,s=r.format,u=s.Hex={stringify:function(l){return l.ciphertext.toString(a)},parse:function(l){var c=a.parse(l);return o.create({ciphertext:c})}}}(),t.format.Hex})});var lmr=S((nOe,umr)=>{(function(t,e,r){typeof nOe=="object"?umr.exports=nOe=e(Mi(),Ok(),Tk(),H1(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(nOe,function(t){return function(){var e=t,r=e.lib,n=r.BlockCipher,o=e.algo,i=[],a=[],s=[],u=[],l=[],c=[],d=[],f=[],p=[],m=[];(function(){for(var y=[],b=0;b<256;b++)b<128?y[b]=b<<1:y[b]=b<<1^283;for(var _=0,w=0,b=0;b<256;b++){var x=w^w<<1^w<<2^w<<3^w<<4;x=x>>>8^x&255^99,i[_]=x,a[x]=_;var O=y[_],E=y[O],T=y[E],R=y[x]*257^x*16843008;s[_]=R<<24|R>>>8,u[_]=R<<16|R>>>16,l[_]=R<<8|R>>>24,c[_]=R;var R=T*16843009^E*65537^O*257^_*16843008;d[x]=R<<24|R>>>8,f[x]=R<<16|R>>>16,p[x]=R<<8|R>>>24,m[x]=R,_?(_=O^y[y[y[T^O]]],w^=y[y[w]]):_=w=1}})();var h=[0,1,2,4,8,16,32,64,128,27,54],g=o.AES=n.extend({_doReset:function(){var y;if(!(this._nRounds&&this._keyPriorReset===this._key)){for(var b=this._keyPriorReset=this._key,_=b.words,w=b.sigBytes/4,x=this._nRounds=w+6,O=(x+1)*4,E=this._keySchedule=[],T=0;T6&&T%w==4&&(y=i[y>>>24]<<24|i[y>>>16&255]<<16|i[y>>>8&255]<<8|i[y&255]):(y=y<<8|y>>>24,y=i[y>>>24]<<24|i[y>>>16&255]<<16|i[y>>>8&255]<<8|i[y&255],y^=h[T/w|0]<<24),E[T]=E[T-w]^y);for(var R=this._invKeySchedule=[],I=0;I>>24]]^f[i[y>>>16&255]]^p[i[y>>>8&255]]^m[i[y&255]]}}},encryptBlock:function(y,b){this._doCryptBlock(y,b,this._keySchedule,s,u,l,c,i)},decryptBlock:function(y,b){var _=y[b+1];y[b+1]=y[b+3],y[b+3]=_,this._doCryptBlock(y,b,this._invKeySchedule,d,f,p,m,a);var _=y[b+1];y[b+1]=y[b+3],y[b+3]=_},_doCryptBlock:function(y,b,_,w,x,O,E,T){for(var R=this._nRounds,I=y[b]^_[0],j=y[b+1]^_[1],F=y[b+2]^_[2],B=y[b+3]^_[3],U=4,J=1;J>>24]^x[j>>>16&255]^O[F>>>8&255]^E[B&255]^_[U++],oe=w[j>>>24]^x[F>>>16&255]^O[B>>>8&255]^E[I&255]^_[U++],ne=w[F>>>24]^x[B>>>16&255]^O[I>>>8&255]^E[j&255]^_[U++],z=w[B>>>24]^x[I>>>16&255]^O[j>>>8&255]^E[F&255]^_[U++];I=G,j=oe,F=ne,B=z}var G=(T[I>>>24]<<24|T[j>>>16&255]<<16|T[F>>>8&255]<<8|T[B&255])^_[U++],oe=(T[j>>>24]<<24|T[F>>>16&255]<<16|T[B>>>8&255]<<8|T[I&255])^_[U++],ne=(T[F>>>24]<<24|T[B>>>16&255]<<16|T[I>>>8&255]<<8|T[j&255])^_[U++],z=(T[B>>>24]<<24|T[I>>>16&255]<<16|T[j>>>8&255]<<8|T[F&255])^_[U++];y[b]=G,y[b+1]=oe,y[b+2]=ne,y[b+3]=z},keySize:256/32});e.AES=n._createHelper(g)}(),t.AES})});var dmr=S((oOe,cmr)=>{(function(t,e,r){typeof oOe=="object"?cmr.exports=oOe=e(Mi(),Ok(),Tk(),H1(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(oOe,function(t){return function(){var e=t,r=e.lib,n=r.WordArray,o=r.BlockCipher,i=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],s=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],l=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],c=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],d=i.DES=o.extend({_doReset:function(){for(var h=this._key,g=h.words,y=[],b=0;b<56;b++){var _=a[b]-1;y[b]=g[_>>>5]>>>31-_%32&1}for(var w=this._subKeys=[],x=0;x<16;x++){for(var O=w[x]=[],E=u[x],b=0;b<24;b++)O[b/6|0]|=y[(s[b]-1+E)%28]<<31-b%6,O[4+(b/6|0)]|=y[28+(s[b+24]-1+E)%28]<<31-b%6;O[0]=O[0]<<1|O[0]>>>31;for(var b=1;b<7;b++)O[b]=O[b]>>>(b-1)*4+3;O[7]=O[7]<<5|O[7]>>>27}for(var T=this._invSubKeys=[],b=0;b<16;b++)T[b]=w[15-b]},encryptBlock:function(h,g){this._doCryptBlock(h,g,this._subKeys)},decryptBlock:function(h,g){this._doCryptBlock(h,g,this._invSubKeys)},_doCryptBlock:function(h,g,y){this._lBlock=h[g],this._rBlock=h[g+1],f.call(this,4,252645135),f.call(this,16,65535),p.call(this,2,858993459),p.call(this,8,16711935),f.call(this,1,1431655765);for(var b=0;b<16;b++){for(var _=y[b],w=this._lBlock,x=this._rBlock,O=0,E=0;E<8;E++)O|=l[E][((x^_[E])&c[E])>>>0];this._lBlock=x,this._rBlock=w^O}var T=this._lBlock;this._lBlock=this._rBlock,this._rBlock=T,f.call(this,1,1431655765),p.call(this,8,16711935),p.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),h[g]=this._lBlock,h[g+1]=this._rBlock},keySize:64/32,ivSize:64/32,blockSize:64/32});function f(h,g){var y=(this._lBlock>>>h^this._rBlock)&g;this._rBlock^=y,this._lBlock^=y<>>h^this._lBlock)&g;this._lBlock^=y,this._rBlock^=y<192.");var y=g.slice(0,2),b=g.length<4?g.slice(0,2):g.slice(2,4),_=g.length<6?g.slice(0,2):g.slice(4,6);this._des1=d.createEncryptor(n.create(y)),this._des2=d.createEncryptor(n.create(b)),this._des3=d.createEncryptor(n.create(_))},encryptBlock:function(h,g){this._des1.encryptBlock(h,g),this._des2.decryptBlock(h,g),this._des3.encryptBlock(h,g)},decryptBlock:function(h,g){this._des3.decryptBlock(h,g),this._des2.encryptBlock(h,g),this._des1.decryptBlock(h,g)},keySize:192/32,ivSize:64/32,blockSize:64/32});e.TripleDES=o._createHelper(m)}(),t.TripleDES})});var pmr=S((iOe,fmr)=>{(function(t,e,r){typeof iOe=="object"?fmr.exports=iOe=e(Mi(),Ok(),Tk(),H1(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(iOe,function(t){return function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,i=o.RC4=n.extend({_doReset:function(){for(var u=this._key,l=u.words,c=u.sigBytes,d=this._S=[],f=0;f<256;f++)d[f]=f;for(var f=0,p=0;f<256;f++){var m=f%c,h=l[m>>>2]>>>24-m%4*8&255;p=(p+d[f]+h)%256;var g=d[f];d[f]=d[p],d[p]=g}this._i=this._j=0},_doProcessBlock:function(u,l){u[l]^=a.call(this)},keySize:256/32,ivSize:0});function a(){for(var u=this._S,l=this._i,c=this._j,d=0,f=0;f<4;f++){l=(l+1)%256,c=(c+u[l])%256;var p=u[l];u[l]=u[c],u[c]=p,d|=u[(u[l]+u[c])%256]<<24-f*8}return this._i=l,this._j=c,d}e.RC4=n._createHelper(i);var s=o.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var u=this.cfg.drop;u>0;u--)a.call(this)}});e.RC4Drop=n._createHelper(s)}(),t.RC4})});var hmr=S((aOe,mmr)=>{(function(t,e,r){typeof aOe=="object"?mmr.exports=aOe=e(Mi(),Ok(),Tk(),H1(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(aOe,function(t){return function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,i=[],a=[],s=[],u=o.Rabbit=n.extend({_doReset:function(){for(var c=this._key.words,d=this.cfg.iv,f=0;f<4;f++)c[f]=(c[f]<<8|c[f]>>>24)&16711935|(c[f]<<24|c[f]>>>8)&4278255360;var p=this._X=[c[0],c[3]<<16|c[2]>>>16,c[1],c[0]<<16|c[3]>>>16,c[2],c[1]<<16|c[0]>>>16,c[3],c[2]<<16|c[1]>>>16],m=this._C=[c[2]<<16|c[2]>>>16,c[0]&4294901760|c[1]&65535,c[3]<<16|c[3]>>>16,c[1]&4294901760|c[2]&65535,c[0]<<16|c[0]>>>16,c[2]&4294901760|c[3]&65535,c[1]<<16|c[1]>>>16,c[3]&4294901760|c[0]&65535];this._b=0;for(var f=0;f<4;f++)l.call(this);for(var f=0;f<8;f++)m[f]^=p[f+4&7];if(d){var h=d.words,g=h[0],y=h[1],b=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360,_=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,w=b>>>16|_&4294901760,x=_<<16|b&65535;m[0]^=b,m[1]^=w,m[2]^=_,m[3]^=x,m[4]^=b,m[5]^=w,m[6]^=_,m[7]^=x;for(var f=0;f<4;f++)l.call(this)}},_doProcessBlock:function(c,d){var f=this._X;l.call(this),i[0]=f[0]^f[5]>>>16^f[3]<<16,i[1]=f[2]^f[7]>>>16^f[5]<<16,i[2]=f[4]^f[1]>>>16^f[7]<<16,i[3]=f[6]^f[3]>>>16^f[1]<<16;for(var p=0;p<4;p++)i[p]=(i[p]<<8|i[p]>>>24)&16711935|(i[p]<<24|i[p]>>>8)&4278255360,c[d+p]^=i[p]},blockSize:128/32,ivSize:64/32});function l(){for(var c=this._X,d=this._C,f=0;f<8;f++)a[f]=d[f];d[0]=d[0]+1295307597+this._b|0,d[1]=d[1]+3545052371+(d[0]>>>0>>0?1:0)|0,d[2]=d[2]+886263092+(d[1]>>>0>>0?1:0)|0,d[3]=d[3]+1295307597+(d[2]>>>0>>0?1:0)|0,d[4]=d[4]+3545052371+(d[3]>>>0>>0?1:0)|0,d[5]=d[5]+886263092+(d[4]>>>0>>0?1:0)|0,d[6]=d[6]+1295307597+(d[5]>>>0>>0?1:0)|0,d[7]=d[7]+3545052371+(d[6]>>>0>>0?1:0)|0,this._b=d[7]>>>0>>0?1:0;for(var f=0;f<8;f++){var p=c[f]+d[f],m=p&65535,h=p>>>16,g=((m*m>>>17)+m*h>>>15)+h*h,y=((p&4294901760)*p|0)+((p&65535)*p|0);s[f]=g^y}c[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,c[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,c[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,c[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,c[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,c[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,c[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,c[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.Rabbit=n._createHelper(u)}(),t.Rabbit})});var ymr=S((sOe,gmr)=>{(function(t,e,r){typeof sOe=="object"?gmr.exports=sOe=e(Mi(),Ok(),Tk(),H1(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(sOe,function(t){return function(){var e=t,r=e.lib,n=r.StreamCipher,o=e.algo,i=[],a=[],s=[],u=o.RabbitLegacy=n.extend({_doReset:function(){var c=this._key.words,d=this.cfg.iv,f=this._X=[c[0],c[3]<<16|c[2]>>>16,c[1],c[0]<<16|c[3]>>>16,c[2],c[1]<<16|c[0]>>>16,c[3],c[2]<<16|c[1]>>>16],p=this._C=[c[2]<<16|c[2]>>>16,c[0]&4294901760|c[1]&65535,c[3]<<16|c[3]>>>16,c[1]&4294901760|c[2]&65535,c[0]<<16|c[0]>>>16,c[2]&4294901760|c[3]&65535,c[1]<<16|c[1]>>>16,c[3]&4294901760|c[0]&65535];this._b=0;for(var m=0;m<4;m++)l.call(this);for(var m=0;m<8;m++)p[m]^=f[m+4&7];if(d){var h=d.words,g=h[0],y=h[1],b=(g<<8|g>>>24)&16711935|(g<<24|g>>>8)&4278255360,_=(y<<8|y>>>24)&16711935|(y<<24|y>>>8)&4278255360,w=b>>>16|_&4294901760,x=_<<16|b&65535;p[0]^=b,p[1]^=w,p[2]^=_,p[3]^=x,p[4]^=b,p[5]^=w,p[6]^=_,p[7]^=x;for(var m=0;m<4;m++)l.call(this)}},_doProcessBlock:function(c,d){var f=this._X;l.call(this),i[0]=f[0]^f[5]>>>16^f[3]<<16,i[1]=f[2]^f[7]>>>16^f[5]<<16,i[2]=f[4]^f[1]>>>16^f[7]<<16,i[3]=f[6]^f[3]>>>16^f[1]<<16;for(var p=0;p<4;p++)i[p]=(i[p]<<8|i[p]>>>24)&16711935|(i[p]<<24|i[p]>>>8)&4278255360,c[d+p]^=i[p]},blockSize:128/32,ivSize:64/32});function l(){for(var c=this._X,d=this._C,f=0;f<8;f++)a[f]=d[f];d[0]=d[0]+1295307597+this._b|0,d[1]=d[1]+3545052371+(d[0]>>>0>>0?1:0)|0,d[2]=d[2]+886263092+(d[1]>>>0>>0?1:0)|0,d[3]=d[3]+1295307597+(d[2]>>>0>>0?1:0)|0,d[4]=d[4]+3545052371+(d[3]>>>0>>0?1:0)|0,d[5]=d[5]+886263092+(d[4]>>>0>>0?1:0)|0,d[6]=d[6]+1295307597+(d[5]>>>0>>0?1:0)|0,d[7]=d[7]+3545052371+(d[6]>>>0>>0?1:0)|0,this._b=d[7]>>>0>>0?1:0;for(var f=0;f<8;f++){var p=c[f]+d[f],m=p&65535,h=p>>>16,g=((m*m>>>17)+m*h>>>15)+h*h,y=((p&4294901760)*p|0)+((p&65535)*p|0);s[f]=g^y}c[0]=s[0]+(s[7]<<16|s[7]>>>16)+(s[6]<<16|s[6]>>>16)|0,c[1]=s[1]+(s[0]<<8|s[0]>>>24)+s[7]|0,c[2]=s[2]+(s[1]<<16|s[1]>>>16)+(s[0]<<16|s[0]>>>16)|0,c[3]=s[3]+(s[2]<<8|s[2]>>>24)+s[1]|0,c[4]=s[4]+(s[3]<<16|s[3]>>>16)+(s[2]<<16|s[2]>>>16)|0,c[5]=s[5]+(s[4]<<8|s[4]>>>24)+s[3]|0,c[6]=s[6]+(s[5]<<16|s[5]>>>16)+(s[4]<<16|s[4]>>>16)|0,c[7]=s[7]+(s[6]<<8|s[6]>>>24)+s[5]|0}e.RabbitLegacy=n._createHelper(u)}(),t.RabbitLegacy})});var _mr=S((uOe,bmr)=>{(function(t,e,r){typeof uOe=="object"?bmr.exports=uOe=e(Mi(),Ok(),Tk(),H1(),jm()):typeof define=="function"&&define.amd?define(["./core","./enc-base64","./md5","./evpkdf","./cipher-core"],e):e(t.CryptoJS)})(uOe,function(t){return function(){var e=t,r=e.lib,n=r.BlockCipher,o=e.algo;let i=16,a=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],s=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var u={pbox:[],sbox:[]};function l(m,h){let g=h>>24&255,y=h>>16&255,b=h>>8&255,_=h&255,w=m.sbox[0][g]+m.sbox[1][y];return w=w^m.sbox[2][b],w=w+m.sbox[3][_],w}function c(m,h,g){let y=h,b=g,_;for(let w=0;w1;--w)y=y^m.pbox[w],b=l(m,y)^b,_=y,y=b,b=_;return _=y,y=b,b=_,b=b^m.pbox[1],y=y^m.pbox[0],{left:y,right:b}}function f(m,h,g){for(let x=0;x<4;x++){m.sbox[x]=[];for(let O=0;O<256;O++)m.sbox[x][O]=s[x][O]}let y=0;for(let x=0;x=g&&(y=0);let b=0,_=0,w=0;for(let x=0;x{(function(t,e,r){typeof lOe=="object"?vmr.exports=lOe=e(Mi(),lie(),ypr(),_pr(),Ok(),Spr(),Tk(),Ent(),Dxe(),Epr(),Pnt(),Rpr(),Ipr(),jpr(),Uxe(),Lpr(),H1(),jm(),Bpr(),zpr(),Vpr(),Kpr(),Gpr(),Xpr(),Qpr(),tmr(),nmr(),imr(),smr(),lmr(),dmr(),pmr(),hmr(),ymr(),_mr()):typeof define=="function"&&define.amd?define(["./core","./x64-core","./lib-typedarrays","./enc-utf16","./enc-base64","./enc-base64url","./md5","./sha1","./sha256","./sha224","./sha512","./sha384","./sha3","./ripemd160","./hmac","./pbkdf2","./evpkdf","./cipher-core","./mode-cfb","./mode-ctr","./mode-ctr-gladman","./mode-ofb","./mode-ecb","./pad-ansix923","./pad-iso10126","./pad-iso97971","./pad-zeropadding","./pad-nopadding","./format-hex","./aes","./tripledes","./rc4","./rabbit","./rabbit-legacy","./blowfish"],e):t.CryptoJS=e(t.CryptoJS)})(lOe,function(t){return t})});var Mnt,Too,cOe,wmr=v(()=>{Yw();jt();Oxe();Mnt="copilot-index-chunk-",Too=".json",cOe=class{constructor(e,r,n){this.app=e;this.baseDir=r;this.identifier=n}getChunkPath(e){return`${this.baseDir}/${Mnt}${this.identifier}-${e}.json`}getMetadataPath(){return`${this.baseDir}/${Mnt}${this.identifier}-metadata.json`}getLegacyPath(){return`${this.baseDir}/copilot-index-${this.identifier}${Too}`}assignDocumentToPartition(e,r){let o=Array.from(e).reduce((i,a)=>(i<<5)-i+a.charCodeAt(0),0);return Math.abs(o)%r}distributeDocumentsToPartitions(e,r){let n=new Map,o={};for(let a=0;a{i+=a.length,ce().debug&&console.log(`Partition ${s+1}: ${a.length} documents`)}),ce().debug&&(console.log(`Total documents distributed: ${i}`),i!==e.length&&console.error(`Document count mismatch! Original: ${e.length}, Distributed: ${i}`)),n}async ensureDirectoryExists(e){let r=e.substring(0,e.lastIndexOf("/"));await this.app.vault.adapter.exists(r)||await this.app.vault.adapter.mkdir(r)}async saveDatabase(e){try{let r=await xnt(e),n=ce().numPartitions;if(n===1){let l=this.getLegacyPath();await this.ensureDirectoryExists(l),await this.app.vault.adapter.write(l,JSON.stringify({...r,schema:e.schema}));return}let o=r.docs?.docs,i=Array.isArray(o)?o:Object.values(o||{});if(ce().debug&&console.log(`Starting save with ${i.length??0} total documents`),!i||i.length===0){let l={numPartitions:n,vectorLength:e.schema.embedding.match(/\d+/)[0],schema:e.schema,lastModified:Date.now(),documentPartitions:{}},c=this.getMetadataPath();await this.ensureDirectoryExists(c),await this.app.vault.adapter.write(c,JSON.stringify(l)),ce().debug&&console.log("Saved empty database state");return}let a=this.distributeDocumentsToPartitions(i,n),s={numPartitions:n,vectorLength:e.schema.embedding.match(/\d+/)[0],schema:e.schema,lastModified:Date.now(),documentPartitions:Object.fromEntries(i.map(l=>[l.id,this.assignDocumentToPartition(l.id,n)]))};await this.saveMetadata(s);let u={...r,docs:{docs:{},count:0},index:{...r.index,vectorIndexes:void 0}};for(let[l,c]of a.entries()){let d={index:{vectorIndexes:{embedding:{size:r.index.vectorIndexes.embedding.size,vectors:Object.fromEntries(Object.entries(r.index.vectorIndexes.embedding.vectors).filter(([m])=>c.some(h=>h.id===m)))}}},docs:{docs:Object.fromEntries(c.map((m,h)=>[(h+1).toString(),m])),count:c.length}},f=l===0?{...u,docs:d.docs,index:{...u.index,vectorIndexes:d.index.vectorIndexes}}:d,p=this.getChunkPath(l);await this.ensureDirectoryExists(p),await this.app.vault.adapter.write(p,JSON.stringify(f)),ce().debug&&console.log(`Saved partition ${l+1}/${n}`)}ce().debug&&console.log("Saved all partitions")}catch(r){throw console.error("Error saving database:",r),new Ro(`Failed to save database: ${r.message}`)}}async loadDatabase(){try{let e=this.getLegacyPath();if(await this.app.vault.adapter.exists(e)){let u=JSON.parse(await this.app.vault.adapter.read(e));if(!u?.schema)throw new Ro("Invalid legacy database format");let l=await q8({schema:u.schema,components:{tokenizer:{stemmer:void 0,stopWords:void 0}}});return await xxe(l,u),l}let r=await this.loadMetadata(),n=await q8({schema:r.schema,components:{tokenizer:{stemmer:void 0,stopWords:void 0}}}),o=null,i=[];for(let u=0;uObject.values(c.docs.docs)).find(c=>c.id===u);l?(a[s.toString()]=l,s++):ce().debug&&console.warn(`Document ${u} not found in any chunk`)}return o.docs.docs=a,o.docs.count=Object.keys(a).length,o.index.vectorIndexes.embedding.vectors=Object.assign({},...i.map(u=>u.index?.vectorIndexes?.embedding?.vectors||{})),await xxe(n,o),n}catch(e){throw console.error("Error loading database:",e),new Ro(`Failed to load database: ${e.message}`)}}async clearStorage(){try{let e=this.getLegacyPath();await this.app.vault.adapter.exists(e)&&await this.app.vault.adapter.remove(e);let r=await this.app.vault.adapter.list(this.baseDir);for(let n of r.files)n.startsWith(`${this.baseDir}/${Mnt}${this.identifier}`)&&await this.app.vault.adapter.remove(n)}catch(e){throw console.error("Error clearing storage:",e),new Ro(`Failed to clear storage: ${e.message}`)}}async exists(){let e=this.getLegacyPath();if(ce().numPartitions===1)return await this.app.vault.adapter.exists(e);let r=this.getMetadataPath();return await this.app.vault.adapter.exists(r)||await this.app.vault.adapter.exists(e)}async loadMetadata(){let e=this.getMetadataPath();if(!await this.app.vault.adapter.exists(e))throw new Ro("No existing database found");let r=JSON.parse(await this.app.vault.adapter.read(e));if(!r?.schema)throw new Ro("Invalid metadata file: missing schema");return r}async saveMetadata(e){let r=this.getMetadataPath();await this.ensureDirectoryExists(r),await this.app.vault.adapter.write(r,JSON.stringify(e))}}});var Omr={};Jn(Omr,{categorizePatterns:()=>H8,createPatternSettingsValue:()=>V8,extractAppIgnoreSettings:()=>cie,getAllQAMarkdownContent:()=>Int,getDecodedPatterns:()=>M_,getExtensionPattern:()=>Nnt,getFilePattern:()=>J8,getInternalExcludePaths:()=>Cmr,getMatchingPatterns:()=>td,getTagPattern:()=>die,getVectorLength:()=>Ant,isInternalExcludedFile:()=>K8,isInternalExcludedPath:()=>xmr,previewPatternValue:()=>Moo,shouldIndexFile:()=>cl});async function Ant(t){if(!t)throw new Ro("Embedding instance not found.");try{let r=await t.embedQuery("Sample text for embedding");if(!r||r.length===0)throw new Ro("Failed to get valid embedding vector length");return console.log(`Detected vector length: ${r.length} for model: ${bd.getModelName(t)}`),r.length}catch(e){throw console.error("Error getting vector length:",e),new Ro("Failed to determine embedding vector length. Please check your embedding model settings.")}}async function Int(t){let e="",{inclusions:r,exclusions:n}=td(),o=t.vault.getMarkdownFiles().filter(i=>cl(i,r,n));return await Promise.all(o.map(i=>t.vault.cachedRead(i))).then(i=>i.map(a=>e+=a+" ")),e}function M_(t){let e=[];return e.push(...t.split(",").map(r=>decodeURIComponent(r.trim())).filter(r=>r.length>0)),e}function Eoo(){return ce().qaExclusions?M_(ce().qaExclusions):[]}function Poo(){return ce().qaInclusions?M_(ce().qaInclusions):[]}function td(t){let e=t?.inclusions?M_(t.inclusions):t?.isProject?[]:Poo(),r=t?.exclusions?M_(t.exclusions):t?.isProject?[]:Eoo();return{inclusions:e.length>0?H8(e):null,exclusions:r.length>0?H8(r):null}}function cl(t,e,r,n){return!(K8(t)||r&&Smr(t.path,r)||e&&!Smr(t.path,e)||n&&!e)}function H8(t){let e=[],r=[],n=[],o=[],i=/^#[^\s#]+$/,a=/^\*\.([a-zA-Z0-9.]+)$/,s=/^\[\[(.*?)\]\]$/;return t.forEach(u=>{i.test(u)?e.push(u):a.test(u)?r.push(u):s.test(u)?o.push(u):n.push(u)}),{tagPatterns:e,extensionPatterns:r,folderPatterns:n,notePatterns:o}}function Moo(t){return M_(t).join(", ")}function V8({tagPatterns:t,extensionPatterns:e,folderPatterns:r,notePatterns:n}){return[...t??[],...e??[],...n??[],...r??[]].map(i=>encodeURIComponent(i)).join(",")}function Roo(t,e){if(e.length===0)return!1;let r=app.vault.getAbstractFileByPath(t);if(r instanceof Rnt.TFile){let n=CO(r);if(e.some(o=>n.some(i=>i.toLowerCase()===q6(o).toLowerCase())))return!0}return!1}function Aoo(t,e){if(e.length===0)return!1;let r=t.toLowerCase();return e.some(n=>{let o=n.slice(1).toLowerCase();return r.endsWith(o)})}function Ioo(t,e){if(e.length===0)return!1;let r=t.replace(/\\/g,"/");return e.some(n=>{let o=n.replace(/\\/g,"/").replace(/\/$/,"");return r.startsWith(o)&&(r.length===o.length||r[o.length]==="/")})}function Noo(t,e){if(e.length===0)return!1;let r=app.vault.getAbstractFileByPath(t);return!!(r instanceof Rnt.TFile&&e.some(n=>n.slice(2,-2)===r.basename))}function Smr(t,e){if(!e)return!1;let{tagPatterns:r,extensionPatterns:n,folderPatterns:o,notePatterns:i}=e;return Roo(t,r??[])||Aoo(t,n??[])||Ioo(t,o??[])||Noo(t,i??[])}function cie(t){let e=[];try{if(typeof t.vault.getConfig=="function"){let r=t.vault.getConfig("userIgnoreFilters");r&&Array.isArray(r)&&r.forEach(n=>{typeof n=="string"&&e.push(n.endsWith("/")?n.slice(0,-1):n)})}}catch(r){console.warn("Error getting userIgnoreFilters from Obsidian config",r)}return e}function die(t){return`#${t}`}function J8(t){return`[[${t.basename}]]`}function Nnt(t){return`*.${t}`}function Cmr(){return[bm.getLogPath()]}function xmr(t){return new Set(Cmr()).has(t)}function K8(t){return xmr(t.path)}var Rnt,vb=v(()=>{Yw();pH();jt();$z();yr();Rnt=require("obsidian")});var Pmr={};Jn(Pmr,{DBOperations:()=>TA});var Emr,OA,Tmr,TA,fie=v(()=>{pH();Yw();Bt();jt();yr();Oxe();Tnt();Emr=L(wH()),OA=require("obsidian");wmr();vb();Tmr=25,TA=class t{constructor(e){this.app=e;this.isInitialized=!1;this.isIndexLoaded=!1;this.hasUnsavedChanges=!1;this.filesWithoutEmbeddings=new Set;this.upsertMutex=new vH;Yl(async()=>{let r=ce();OA.Platform.isMobile&&r.disableIndexOnMobile?(this.isIndexLoaded=!1,this.oramaDb=void 0):OA.Platform.isMobile&&!r.disableIndexOnMobile&&!this.oramaDb&&await this.initializeDB(await bd.getInstance().getEmbeddingsAPI());let n=await this.getDbPath();this.dbPath&&n!==this.dbPath&&(H("Path change detected, reinitializing database..."),this.dbPath=n,await this.initializeChunkedStorage(),await this.initializeDB(await bd.getInstance().getEmbeddingsAPI()),H("Database reinitialized with new path:",n))})}async initializeChunkedStorage(){if(!this.app.vault.adapter)throw new Ro("Vault adapter not available. Please try again later.");let e=await this.getDbPath();this.chunkedStorage=new cOe(this.app,e,this.getVaultIdentifier()),this.isInitialized=!0}async initializeDB(e){try{if(this.isInitialized||(this.dbPath=await this.getDbPath(),await this.initializeChunkedStorage()),OA.Platform.isMobile&&ce().disableIndexOnMobile){this.isIndexLoaded=!1,this.oramaDb=void 0;return}if(!this.chunkedStorage)throw new Ro("Storage not initialized properly");try{if(await this.chunkedStorage.exists())return this.oramaDb=await this.chunkedStorage.loadDatabase(),H("Loaded existing chunked semantic index database from disk."),this.oramaDb}catch(n){ue("Failed to load existing semantic index database, creating new one:",n)}let r=await this.createNewDb(e);return this.oramaDb=r,r}catch(r){ue("Error initializing semantic index database:",r),new OA.Notice("Failed to initialize Copilot database. Some features may be limited.");return}}async saveDB(){if(!(OA.Platform.isMobile&&ce().disableIndexOnMobile)){if(!this.oramaDb||!this.chunkedStorage)try{if(await this.initializeDB(await bd.getInstance().getEmbeddingsAPI()),!this.oramaDb||!this.chunkedStorage)throw new Ro("Semantic index database not found.")}catch(e){throw ue("Failed to initialize database during save:",e),new Ro("Failed to initialize and save database.")}try{await this.chunkedStorage.saveDatabase(this.oramaDb),this.hasUnsavedChanges=!1,ce().debug&&H("Semantic index database saved successfully at:",this.dbPath)}catch(e){throw ue("Error saving semantic index database:",e),e}}}async clearIndex(e){try{this.oramaDb||await this.initializeDB(e),await this.chunkedStorage?.clearStorage(),await new Promise(r=>setTimeout(r,100)),this.oramaDb=await this.createNewDb(e),await this.saveDB(),new OA.Notice("Local Copilot index cleared successfully."),H("Local Copilot index cleared successfully, new instance created.")}catch(r){throw ue("Error clearing the local Copilot index:",r),new OA.Notice("An error occurred while clearing the local Copilot index."),r}}async removeDocs(e){if(!this.oramaDb)throw new Ro("Semantic index database not found.");try{let r=await P_(this.oramaDb,{term:e,properties:["path"]});r.hits.length>0&&(await uie(this.oramaDb,r.hits.map(n=>n.id),500),ce().debug&&H(`Deleted document from local Copilot index: ${e}`)),this.markUnsavedChanges()}catch(r){ue("Error deleting document from local Copilotindex:",r)}}getDb(){return this.oramaDb||console.warn("Database not initialized. Some features may be limited."),this.oramaDb}async getIsIndexLoaded(){return this.isIndexLoaded}async waitForInitialization(){await this.initializationPromise}onunload(){this.hasUnsavedChanges&&this.saveDB()}getCurrentDbPath(){return this.dbPath}async getDbPath(){let e=this.app.vault.getRoot().path,r;if(ce().enableIndexSync)r=this.app.vault.configDir;else{let n=e==="/"?"":e;r=`${n===""||n.startsWith("/")?"":"/"}${n}/.copilot-index`,await this.app.vault.adapter.exists(r)||(await this.app.vault.adapter.mkdir(r),H("Created directory:",r))}return r}getVaultIdentifier(){let e=this.app.vault.getName();return(0,Emr.MD5)(e).toString()}markUnsavedChanges(){this.hasUnsavedChanges=!0}async createNewDb(e){if(!e)throw new Ro("Embedding instance not found.");let r=await Ant(e);if(!r||r===0)throw new Ro("Invalid vector length detected. Please check if your embedding model is working.");let n=this.createDynamicSchema(r),o=await q8({schema:n,components:{tokenizer:{stemmer:void 0,stopWords:void 0}}});return H(`Created new semantic index database for ${this.dbPath}. Embedding model: ${bd.getModelName(e)} with vector length ${r}.`),this.isIndexLoaded=!0,o}static async getDocsByPath(e,r){if(!e)throw new Error("DB not initialized");return r?(await t.getAllDocuments(e)).filter(i=>i.path===r).map(i=>({document:i,score:1})):void 0}static async getDocsByEmbedding(e,r,n){return(await P_(e,{mode:"vector",vector:{value:r,property:"embedding"},limit:n.limit,similarity:n.similarity,includeVectors:!0})).hits}static async getLatestFileMtime(e){if(!e)throw new Error("DB not initialized");try{let r=await P_(e,{term:"",limit:1,sortBy:{property:"mtime",order:"DESC"}});return r.hits.length>0?r.hits[0].document.mtime:0}catch(r){return ue("Error getting latest file mtime from VectorDB:",r),0}}createDynamicSchema(e){return{id:"string",title:"string",path:"string",content:"string",embedding:`vector[${e}]`,embeddingModel:"string",created_at:"number",ctime:"number",mtime:"number",tags:"string[]",extension:"string"}}async upsert(e){if(!this.oramaDb)throw new Error("DB not initialized");let r=this.oramaDb;return await this.upsertMutex.runExclusive(async()=>{try{let n=this.chunkedStorage?.assignDocumentToPartition(e.id,ce().numPartitions),o=await P_(r,{term:e.id,properties:["id"],limit:1});o.hits.length>0&&await yH(r,o.hits[0].id);try{return await sie(r,e),H(`${o.hits.length>0?"Updated":"Inserted"} document ${e.id} in partition ${n}`),this.markUnsavedChanges(),e}catch(i){if(ue(`Failed to ${o.hits.length>0?"update":"insert"} document ${e.id}:`,i),o.hits.length>0)try{await sie(r,o.hits[0].document)}catch(a){ue("Failed to restore previous document version:",a)}return}}catch(n){ue(`Error upserting document ${e.id}:`,n);return}})}async getLatestFileMtime(){if(!this.oramaDb)throw new Error("DB not initialized");try{let e=await P_(this.oramaDb,{term:"",limit:1,sortBy:{property:"mtime",order:"DESC"}});return e.hits.length>0?e.hits[0].document.mtime:0}catch(e){return ue("Error getting latest file mtime from VectorDB:",e),0}}async checkAndHandleEmbeddingModelChange(e){if(!this.oramaDb){H("Semantic index database not loaded in memory. Checking for existing index...");try{await this.initializeDB(e)}catch(o){throw ue("Failed to initialize database:",o),new Ro("Failed to initialize semantic index database. Please check your embedding model settings.")}if(!this.oramaDb)return H("No existing index found. Will create new index."),!1}let r=await P_(this.oramaDb,{term:"",limit:1}),n;if(r.hits.length>0){let o=r.hits[0];typeof o=="object"&&o!==null&&"document"in o&&(n=o.document.embeddingModel)}if(n){let o=bd.getModelName(e);if(!RRt(n,o))return new OA.Notice("New embedding model detected. Rebuilding Copilot index from scratch."),H(`Detected change in embedding model from "${n}" to "${o}". Rebuilding Copilot index from scratch.`),this.oramaDb=await this.createNewDb(e),await this.saveDB(),!0}else H("No previous embedding model found in the database.");return!1}static async getAllDocuments(e){return(await P_(e,{term:"",limit:1e5,includeVectors:!0})).hits.map(n=>n.document)}async garbageCollect(){if(!this.oramaDb){H("Semantic index database not found during garbage collection. Attempting to initialize...");try{let e=await bd.getInstance().getEmbeddingsAPI();if(!e)throw new Ro("No embedding model available.");if(await this.initializeDB(e),!this.oramaDb)throw new Ro("Failed to initialize database after attempt.")}catch(e){throw ue("Failed to initialize database during garbage collection:",e),new Ro("Failed to initialize database. Please check your embedding model settings.")}}try{let e=this.app.vault.getMarkdownFiles(),r=new Set(e.map(u=>u.path)),{inclusions:n,exclusions:o}=td(),i=new Set(e.filter(u=>cl(u,n,o)).map(u=>u.path)),s=(await t.getAllDocuments(this.oramaDb)).filter(u=>!r.has(u.path)||!i.has(u.path));return s.length===0?0:(H("Copilot index: Docs to remove during garbage collection:",Array.from(new Set(s.map(u=>u.path))).join(", ")),s.length===1?await yH(this.oramaDb,s[0].id):await uie(this.oramaDb,s.map(u=>u.id),500),await this.saveDB(),s.length)}catch(e){throw ue("Error garbage collecting the Copilot index:",e),new Ro("Failed to garbage collect the Copilot index.")}}async getIndexedFiles(){if(!this.oramaDb)throw new Ro("Semantic index database not found.");try{let e=await t.getAllDocuments(this.oramaDb),r=new Set;return e.forEach(n=>{r.add(n.path)}),Array.from(r).sort()}catch(e){throw ue("Error getting indexed files:",e),new Ro("Failed to retrieve indexed files.")}}async isIndexEmpty(){if(!this.oramaDb)return!0;try{return(await P_(this.oramaDb,{term:"",limit:1})).hits.length===0}catch(e){throw ue("Error checking if database is empty:",e),new Ro("Failed to check if database is empty.")}}async hasIndex(e){if(!this.oramaDb)return!1;let r=await t.getDocsByPath(this.oramaDb,e);return r!==void 0&&r.length>0}async hasEmbeddings(e){if(!this.oramaDb)return!1;let r=await t.getDocsByPath(this.oramaDb,e);return!r||r.length===0?!1:r.every(n=>n?.document?.embedding&&Array.isArray(n.document.embedding)&&n.document.embedding.length>0)}async getDocsJsonByPaths(e){if(!this.oramaDb)throw new Ro("Semantic index database not found.");let r={};for(let n of e){let o=await t.getDocsByPath(this.oramaDb,n);o&&o.length>0&&(r[n]=o.map(i=>({id:i.document.id,title:i.document.title,path:i.document.path,content:i.document.content,metadata:i.document.metadata,embedding:i.document.embedding,embeddingModel:i.document.embeddingModel,tags:i.document.tags,extension:i.document.extension,nchars:i.document.nchars})))}return r}markFileMissingEmbeddings(e){this.filesWithoutEmbeddings.add(e)}clearFilesMissingEmbeddings(){this.filesWithoutEmbeddings.clear()}getFilesMissingEmbeddings(){return Array.from(this.filesWithoutEmbeddings)}isFileMissingEmbeddings(e){return this.filesWithoutEmbeddings.has(e)}async checkIndexIntegrity(){if(!this.oramaDb)throw new Ro("Orama database not found.");try{let e=await this.getIndexedFiles();for(let n=0;n0?H("Files missing embeddings after integrity check:",r.join(", ")):H("Index integrity check completed. All documents have embeddings.")}catch(e){throw ue("Error checking index integrity:",e),new Ro("Failed to check index integrity.")}}async yieldToEventLoop(){await new Promise(e=>{if(typeof window<"u"){let r=window;if(r.requestIdleCallback){r.requestIdleCallback(()=>e());return}}setTimeout(e,0)})}}});var W8,joo,dOe,Mmr=v(()=>{Us();Hc();Bt();jt();W8=require("obsidian");vb();joo=5e3,dOe=class{constructor(e,r,n){this.app=e;this.indexOps=r;this.dbOps=n;this.debounceTimer=null;this.lastActiveFile=null;this.lastActiveFileMtime=null;this.listenersActive=!1;this.handleActiveLeafChange=async e=>{if(!this.shouldHandleEvents()||W8.Platform.isMobile&&ce().disableIndexOnMobile||RO()!=="copilot_plus")return;let n=this.lastActiveFile,o=this.lastActiveFileMtime,i=e?.view;if(this.lastActiveFile=i instanceof W8.MarkdownView?i.file:null,this.lastActiveFileMtime=this.lastActiveFile?.stat?.mtime??null,!(!n||n===this.lastActiveFile)&&!(!n?.stat?.mtime||o===null)&&n.extension==="md"){let{inclusions:a,exclusions:s}=td(),u=cl(n,a,s),l=o!==null&&n.stat.mtime>o;u&&l&&this.debouncedReindexFile(n)}};this.debouncedReindexFile=e=>{this.shouldHandleEvents()&&(this.debounceTimer!==null&&window.clearTimeout(this.debounceTimer),this.debounceTimer=window.setTimeout(()=>{ce().debug&&console.log("Copilot Plus: Triggering reindex for file ",e.path),this.indexOps.reindexFile(e),this.debounceTimer=null},joo))};this.handleFileDelete=async e=>{this.shouldHandleEvents()&&e instanceof W8.TFile&&await this.dbOps.removeDocs(e.path)};this.syncEventListeners(),Yl(()=>{this.syncEventListeners()})}shouldHandleEvents(){return ce().enableSemanticSearchV3}syncEventListeners(){let e=this.shouldHandleEvents();e&&!this.listenersActive?(H("Copilot Plus: Initializing semantic index event listeners"),this.app.workspace.on("active-leaf-change",this.handleActiveLeafChange),this.app.vault.on("delete",this.handleFileDelete),this.listenersActive=!0):!e&&this.listenersActive&&this.teardownEventListeners()}teardownEventListeners(){this.listenersActive&&(this.app.workspace.off("active-leaf-change",this.handleActiveLeafChange),this.app.vault.off("delete",this.handleFileDelete),this.debounceTimer!==null&&(window.clearTimeout(this.debounceTimer),this.debounceTimer=null),this.lastActiveFile=null,this.lastActiveFileMtime=null,this.listenersActive=!1)}cleanup(){this.teardownEventListeners()}unload(){this.teardownEventListeners()}}});var pie,Rmr=v(()=>{pie=class{constructor(e){this.lastRequestTime=0;this.requestsPerMin=e}setRequestsPerMin(e){this.requestsPerMin=e}getRequestsPerMin(){return this.requestsPerMin}async wait(){let r=Date.now()-this.lastRequestTime,n=Math.max(0,6e4/this.requestsPerMin-r);n>0&&await new Promise(o=>setTimeout(o,n)),this.lastRequestTime=Date.now()}}});var Dm,jnt=v(()=>{Dm=class{constructor(t){M(this,"pageContent");M(this,"metadata");M(this,"id");this.pageContent=t.pageContent!==void 0?t.pageContent.toString():"",this.metadata=t.metadata??{},this.id=t.id}}});var mie,Amr,Imr=v(()=>{Yh();mie=class extends Lo{constructor(){super(...arguments);M(this,"lc_namespace",["langchain_core","documents","transformers"])}invoke(e,r){return this.transformDocuments(e)}},Amr=class extends mie{async transformDocuments(t){let e=[];for(let r of t){let n=await this._transformDocument(r);e.push(n)}return e}}});var Doo,G8=v(()=>{Do();jnt();Imr();Doo={};Tt(Doo,{BaseDocumentTransformer:()=>mie,Document:()=>Dm,MappingDocumentTransformer:()=>Amr})});var Nmr,hie,jmr=v(()=>{G8();yYe();Nmr=class extends mie{constructor(e){super(e);M(this,"lc_namespace",["langchain","document_transformers","text_splitters"]);M(this,"chunkSize",1e3);M(this,"chunkOverlap",200);M(this,"keepSeparator",!1);M(this,"lengthFunction");if(this.chunkSize=e?.chunkSize??this.chunkSize,this.chunkOverlap=e?.chunkOverlap??this.chunkOverlap,this.keepSeparator=e?.keepSeparator??this.keepSeparator,this.lengthFunction=e?.lengthFunction??(r=>r.length),this.chunkOverlap>=this.chunkSize)throw new Error("Cannot have chunkOverlap >= chunkSize")}async transformDocuments(e,r={}){return this.splitDocuments(e,r)}splitOnSeparator(e,r){let n;if(r)if(this.keepSeparator){let o=r.replace(/[/\-\\^$*+?.()|[\]{}]/g,"\\$&");n=e.split(new RegExp(`(?=${o})`))}else n=e.split(r);else n=e.split("");return n.filter(o=>o!=="")}async createDocuments(e,r=[],n={}){let o=r.length>0?r:[...Array(e.length)].map(()=>({})),{chunkHeader:i="",chunkOverlapHeader:a="(cont'd) ",appendChunkOverlapHeader:s=!1}=n,u=new Array;for(let l=0;lg){let x=this.numberOfNewLines(c,g,w);d-=x}s&&(h+=a)}let y=this.numberOfNewLines(m),b=o[l].loc&&typeof o[l].loc=="object"?{...o[l].loc}:{};b.lines={from:d,to:d+y};let _={...o[l],loc:b};h+=m,u.push(new Dm({pageContent:h,metadata:_})),d+=y,f=m,p=g}}return u}numberOfNewLines(e,r,n){return(e.slice(r,n).match(/\n/g)||[]).length}async splitDocuments(e,r={}){let n=e.filter(a=>a.pageContent!==void 0),o=n.map(a=>a.pageContent),i=n.map(a=>a.metadata);return this.createDocuments(o,i,r)}joinDocs(e,r){let n=e.join(r).trim();return n===""?null:n}async mergeSplits(e,r){let n=[],o=[],i=0;for(let s of e){let u=await this.lengthFunction(s);if(i+u+o.length*r.length>this.chunkSize&&(i>this.chunkSize&&console.warn(`Created a chunk of size ${i}, + +which is longer than the specified ${this.chunkSize}`),o.length>0)){let l=this.joinDocs(o,r);for(l!==null&&n.push(l);i>this.chunkOverlap||i+u+o.length*r.length>this.chunkSize&&i>0;)i-=await this.lengthFunction(o[0]),o.shift()}o.push(s),i+=u}let a=this.joinDocs(o,r);return a!==null&&n.push(a),n}},hie=class Dnt extends Nmr{constructor(r){super(r);M(this,"separators",[` + +`,` +`," ",""]);this.separators=r?.separators??this.separators,this.keepSeparator=r?.keepSeparator??!0}static lc_name(){return"RecursiveCharacterTextSplitter"}async _splitText(r,n){let o=[],i=n[n.length-1],a;for(let c=0;c","
","

","
","

  • ","

    ","

    ","

    ","

    ","

    ","
    ","","","","
    ","","
      ","
        ","
        ","