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AU,GAAgB,MAAV,EAAE,KACxB,IACC,aAAa,EAAE,QAAQ,MACxB,CAAE,MAAO,GACR,IACC,MAAM,QAAa,EAAE,QAAQ,OACvB,EAAU,EAAK,OACrB,GAAuB,IAAnB,EAAQ,OAAc,OAAO,EACjC,GAAI,EAAQ,WAAW,MAAQ,EAAQ,WAAW,KAAM,IACvD,OAAO,KAAK,MAAM,EACnB,CAAE,MAAO,GACR,OAAO,CACR,CACA,OAAO,CACR,CAAE,MAAO,GACR,IACC,IAAI,EACJ,MAAM,EAAwC,QAA9B,EAAU,EAAE,QAAQ,YAA8B,IAAZ,EAAqB,EAAU,KACrF,IAAK,EAAQ,OACb,MAAM,EAAS,EAAO,YAChB,EAAU,IAAI,YACpB,IAAI,EAAM,GACV,OAAa,CACZ,MAAM,KAAE,EAAI,MAAE,SAAgB,EAAO,OACrC,GAAI,EAAM,MACqB,GAAV,iBAAV,EAA2B,EAC1B,EAAQ,OAAO,EAAO,CAAE,QAAQ,GAC7C,CACA,GAAO,EAAQ,SACf,MAAM,EAAU,EAAI,OACpB,GAAuB,IAAnB,EAAQ,OAAc,OAAO,EACjC,GAAI,EAAQ,WAAW,MAAQ,EAAQ,WAAW,KAAM,IACvD,OAAO,KAAK,MAAM,EACnB,CAAE,MAAO,GACR,OAAO,CACR,CACA,OAAO,CACR,CAAE,MAAO,GACR,MACD,CACD,CACD,CACD,EAwND,EAAQ,cAAgB,EACxB,EAAQ,OAlMP,SAAgB,EAAO,GACtB,OAAO,EAAM,QAAO,CAAC,EAAK,EAAM,EAAO,KACtC,IACC,EAAI,KAAK,EAAS,EAAM,EAAO,GAChC,CAAE,MAAO,GACR,QAAQ,MAAM,EACf,CACA,OAAO,CAAG,GACR,GACJ,CA0LD","file":"/npm/@copilotkit/shared@1.52.1/dist/index.umd.js","sourceRoot":"","sourcesContent":["/**\n * Minified by jsDelivr using Terser v5.39.0.\n * Original file: /npm/@copilotkit/shared@1.52.1/dist/index.umd.js\n *\n * Do NOT use SRI with dynamically generated files! More information: https://www.jsdelivr.com/using-sri-with-dynamic-files\n */\n","(function(global, factory) {\n  typeof exports === 'object' && typeof module !== 'undefined' ?  factory(exports, require('graphql'), require('zod'), require('uuid'), require('@segment/analytics-node'), require('chalk')) :\n  typeof define === 'function' && define.amd ? define(['exports', 'graphql', 'zod', 'uuid', '@segment/analytics-node', 'chalk'], factory) :\n  (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory((global.CopilotKitShared = {}), global.GraphQL,global.Zod,global.UUID,global.SegmentAnalyticsNode,global.chalk));\n})(this, function(exports, graphql, zod, uuid, _segment_analytics_node, chalk) {\nObject.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });\n//#region \\0rolldown/runtime.js\n\tvar __create = Object.create;\n\tvar __defProp = Object.defineProperty;\n\tvar __getOwnPropDesc = Object.getOwnPropertyDescriptor;\n\tvar __getOwnPropNames = Object.getOwnPropertyNames;\n\tvar __getProtoOf = Object.getPrototypeOf;\n\tvar __hasOwnProp = Object.prototype.hasOwnProperty;\n\tvar __copyProps = (to, from, except, desc) => {\n\t\tif (from && typeof from === \"object\" || typeof from === \"function\") {\n\t\t\tfor (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {\n\t\t\t\tkey = keys[i];\n\t\t\t\tif (!__hasOwnProp.call(to, key) && key !== except) {\n\t\t\t\t\t__defProp(to, key, {\n\t\t\t\t\t\tget: ((k) => from[k]).bind(null, key),\n\t\t\t\t\t\tenumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable\n\t\t\t\t\t});\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t\treturn to;\n\t};\n\tvar __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, \"default\", {\n\t\tvalue: mod,\n\t\tenumerable: true\n\t}) : target, mod));\n\n//#endregion\n\n//#region src/utils/conditions.ts\n\tfunction executeConditions({ conditions, value }) {\n\t\tif (!(conditions === null || conditions === void 0 ? void 0 : conditions.length)) return true;\n\t\treturn conditions.every((condition) => executeCondition(condition, value));\n\t}\n\tfunction executeCondition(condition, value) {\n\t\tconst targetValue = condition.path ? getValueFromPath(value, condition.path) : value;\n\t\tswitch (condition.rule) {\n\t\t\tcase \"AND\": return condition.conditions.every((c) => executeCondition(c, value));\n\t\t\tcase \"OR\": return condition.conditions.some((c) => executeCondition(c, value));\n\t\t\tcase \"NOT\": return !condition.conditions.every((c) => executeCondition(c, value));\n\t\t\tcase \"EQUALS\": return targetValue === condition.value;\n\t\t\tcase \"NOT_EQUALS\": return targetValue !== condition.value;\n\t\t\tcase \"GREATER_THAN\": return targetValue > condition.value;\n\t\t\tcase \"LESS_THAN\": return targetValue < condition.value;\n\t\t\tcase \"CONTAINS\": return Array.isArray(targetValue) && targetValue.includes(condition.value);\n\t\t\tcase \"NOT_CONTAINS\": return Array.isArray(targetValue) && !targetValue.includes(condition.value);\n\t\t\tcase \"MATCHES\": return new RegExp(condition.value).test(String(targetValue));\n\t\t\tcase \"STARTS_WITH\": return String(targetValue).startsWith(condition.value);\n\t\t\tcase \"ENDS_WITH\": return String(targetValue).endsWith(condition.value);\n\t\t\tcase \"EXISTS\": return targetValue !== void 0 && targetValue !== null;\n\t\t\tcase \"NOT_EXISTS\": return targetValue === void 0 || targetValue === null;\n\t\t}\n\t}\n\tfunction getValueFromPath(obj, path) {\n\t\treturn path.split(\".\").reduce((acc, part) => acc === null || acc === void 0 ? void 0 : acc[part], obj);\n\t}\n\n//#endregion\n//#region src/utils/console-styling.ts\n/**\n\t* Console styling utilities for CopilotKit branded messages\n\t* Provides consistent, readable colors across light and dark console themes\n\t*/\n\t/**\n\t* Color palette optimized for console readability\n\t*/\n\tconst ConsoleColors = {\n\t\tprimary: \"#007acc\",\n\t\tsuccess: \"#22c55e\",\n\t\tfeature: \"#a855f7\",\n\t\tcta: \"#ef4444\",\n\t\tinfo: \"#06b6d4\",\n\t\tinherit: \"inherit\",\n\t\twarning: \"#f59e0b\"\n\t};\n\t/**\n\t* Console style templates for common patterns\n\t*/\n\tconst ConsoleStyles = {\n\t\theader: `color: ${ConsoleColors.warning}; font-weight: bold; font-size: 16px;`,\n\t\tsection: `color: ${ConsoleColors.success}; font-weight: bold;`,\n\t\thighlight: `color: ${ConsoleColors.feature}; font-weight: bold;`,\n\t\tcta: `color: ${ConsoleColors.success}; font-weight: bold;`,\n\t\tinfo: `color: ${ConsoleColors.info}; font-weight: bold;`,\n\t\tlink: `color: ${ConsoleColors.primary}; text-decoration: underline;`,\n\t\tbody: `color: ${ConsoleColors.inherit};`,\n\t\twarning: `color: ${ConsoleColors.cta}; font-weight: bold;`\n\t};\n\t/**\n\t* Styled console message for CopilotKit Platform promotion\n\t* Displays a beautiful, branded advertisement in the console\n\t*/\n\tfunction logCopilotKitPlatformMessage() {\n\t\tconsole.log(`%cCopilotKit Warning%c\n\nuseCopilotChatHeadless_c provides full compatibility with CopilotKit's newly released Headless UI feature set. To enable this premium feature, add your public license key, available for free at:\n\n%chttps://cloud.copilotkit.ai%c\n\nAlternatively, useCopilotChat is available for basic programmatic control, and does not require an API key.\n\nTo learn more about premium features, read the documentation here:\n\n%chttps://docs.copilotkit.ai/premium%c`, ConsoleStyles.header, ConsoleStyles.body, ConsoleStyles.cta, ConsoleStyles.body, ConsoleStyles.link, ConsoleStyles.body);\n\t}\n\tfunction publicApiKeyRequired(feature) {\n\t\tconsole.log(`\n%cCopilotKit Warning%c \\n\nIn order to use ${feature}, you need to add your CopilotKit API key, available for free at https://cloud.copilotkit.ai.\n    `.trim(), ConsoleStyles.header, ConsoleStyles.body);\n\t}\n\t/**\n\t* Create a styled console message with custom content\n\t*\n\t* @param template - Template string with %c placeholders\n\t* @param styles - Array of style strings matching the %c placeholders\n\t*\n\t* @example\n\t* ```typescript\n\t* logStyled(\n\t*   '%cCopilotKit%c Welcome to the platform!',\n\t*   [ConsoleStyles.header, ConsoleStyles.body]\n\t* );\n\t* ```\n\t*/\n\tfunction logStyled(template, styles) {\n\t\tconsole.log(template, ...styles);\n\t}\n\t/**\n\t* Quick styled console methods for common use cases\n\t*/\n\tconst styledConsole = {\n\t\tsuccess: (message) => logStyled(`%c✅ ${message}`, [ConsoleStyles.section]),\n\t\tinfo: (message) => logStyled(`%cℹ️ ${message}`, [ConsoleStyles.info]),\n\t\tfeature: (message) => logStyled(`%c✨ ${message}`, [ConsoleStyles.highlight]),\n\t\tcta: (message) => logStyled(`%c🚀 ${message}`, [ConsoleStyles.cta]),\n\t\tlogCopilotKitPlatformMessage,\n\t\tpublicApiKeyRequired\n\t};\n\n//#endregion\n//#region src/utils/errors.ts\n\tlet Severity = /* @__PURE__ */ function(Severity) {\n\t\tSeverity[\"CRITICAL\"] = \"critical\";\n\t\tSeverity[\"WARNING\"] = \"warning\";\n\t\tSeverity[\"INFO\"] = \"info\";\n\t\treturn Severity;\n\t}({});\n\tlet ErrorVisibility = /* @__PURE__ */ function(ErrorVisibility) {\n\t\tErrorVisibility[\"BANNER\"] = \"banner\";\n\t\tErrorVisibility[\"TOAST\"] = \"toast\";\n\t\tErrorVisibility[\"SILENT\"] = \"silent\";\n\t\tErrorVisibility[\"DEV_ONLY\"] = \"dev_only\";\n\t\treturn ErrorVisibility;\n\t}({});\n\tconst ERROR_NAMES = {\n\t\tCOPILOT_ERROR: \"CopilotError\",\n\t\tCOPILOT_API_DISCOVERY_ERROR: \"CopilotApiDiscoveryError\",\n\t\tCOPILOT_REMOTE_ENDPOINT_DISCOVERY_ERROR: \"CopilotKitRemoteEndpointDiscoveryError\",\n\t\tCOPILOT_KIT_AGENT_DISCOVERY_ERROR: \"CopilotKitAgentDiscoveryError\",\n\t\tCOPILOT_KIT_LOW_LEVEL_ERROR: \"CopilotKitLowLevelError\",\n\t\tCOPILOT_KIT_VERSION_MISMATCH_ERROR: \"CopilotKitVersionMismatchError\",\n\t\tRESOLVED_COPILOT_KIT_ERROR: \"ResolvedCopilotKitError\",\n\t\tCONFIGURATION_ERROR: \"ConfigurationError\",\n\t\tMISSING_PUBLIC_API_KEY_ERROR: \"MissingPublicApiKeyError\",\n\t\tUPGRADE_REQUIRED_ERROR: \"UpgradeRequiredError\"\n\t};\n\tconst BANNER_ERROR_NAMES = [\n\t\tERROR_NAMES.CONFIGURATION_ERROR,\n\t\tERROR_NAMES.MISSING_PUBLIC_API_KEY_ERROR,\n\t\tERROR_NAMES.UPGRADE_REQUIRED_ERROR,\n\t\tERROR_NAMES.COPILOT_API_DISCOVERY_ERROR,\n\t\tERROR_NAMES.COPILOT_REMOTE_ENDPOINT_DISCOVERY_ERROR,\n\t\tERROR_NAMES.COPILOT_KIT_AGENT_DISCOVERY_ERROR\n\t];\n\tconst COPILOT_CLOUD_ERROR_NAMES = BANNER_ERROR_NAMES;\n\tlet CopilotKitErrorCode = /* @__PURE__ */ function(CopilotKitErrorCode) {\n\t\tCopilotKitErrorCode[\"NETWORK_ERROR\"] = \"NETWORK_ERROR\";\n\t\tCopilotKitErrorCode[\"NOT_FOUND\"] = \"NOT_FOUND\";\n\t\tCopilotKitErrorCode[\"AGENT_NOT_FOUND\"] = \"AGENT_NOT_FOUND\";\n\t\tCopilotKitErrorCode[\"API_NOT_FOUND\"] = \"API_NOT_FOUND\";\n\t\tCopilotKitErrorCode[\"REMOTE_ENDPOINT_NOT_FOUND\"] = \"REMOTE_ENDPOINT_NOT_FOUND\";\n\t\tCopilotKitErrorCode[\"AUTHENTICATION_ERROR\"] = \"AUTHENTICATION_ERROR\";\n\t\tCopilotKitErrorCode[\"MISUSE\"] = \"MISUSE\";\n\t\tCopilotKitErrorCode[\"UNKNOWN\"] = \"UNKNOWN\";\n\t\tCopilotKitErrorCode[\"VERSION_MISMATCH\"] = \"VERSION_MISMATCH\";\n\t\tCopilotKitErrorCode[\"CONFIGURATION_ERROR\"] = \"CONFIGURATION_ERROR\";\n\t\tCopilotKitErrorCode[\"MISSING_PUBLIC_API_KEY_ERROR\"] = \"MISSING_PUBLIC_API_KEY_ERROR\";\n\t\tCopilotKitErrorCode[\"UPGRADE_REQUIRED_ERROR\"] = \"UPGRADE_REQUIRED_ERROR\";\n\t\treturn CopilotKitErrorCode;\n\t}({});\n\tconst BASE_URL = \"https://docs.copilotkit.ai\";\n\tconst getSeeMoreMarkdown = (link) => `See more: [${link}](${link})`;\n\tconst ERROR_CONFIG = {\n\t\t[CopilotKitErrorCode.NETWORK_ERROR]: {\n\t\t\tstatusCode: 503,\n\t\t\ttroubleshootingUrl: `${BASE_URL}/troubleshooting/common-issues#i-am-getting-a-network-errors--api-not-found`,\n\t\t\tvisibility: ErrorVisibility.BANNER,\n\t\t\tseverity: Severity.CRITICAL\n\t\t},\n\t\t[CopilotKitErrorCode.NOT_FOUND]: {\n\t\t\tstatusCode: 404,\n\t\t\ttroubleshootingUrl: `${BASE_URL}/troubleshooting/common-issues#i-am-getting-a-network-errors--api-not-found`,\n\t\t\tvisibility: ErrorVisibility.BANNER,\n\t\t\tseverity: Severity.CRITICAL\n\t\t},\n\t\t[CopilotKitErrorCode.AGENT_NOT_FOUND]: {\n\t\t\tstatusCode: 500,\n\t\t\ttroubleshootingUrl: `${BASE_URL}/coagents/troubleshooting/common-issues#i-am-getting-agent-not-found-error`,\n\t\t\tvisibility: ErrorVisibility.BANNER,\n\t\t\tseverity: Severity.CRITICAL\n\t\t},\n\t\t[CopilotKitErrorCode.API_NOT_FOUND]: {\n\t\t\tstatusCode: 404,\n\t\t\ttroubleshootingUrl: `${BASE_URL}/troubleshooting/common-issues#i-am-getting-a-network-errors--api-not-found`,\n\t\t\tvisibility: ErrorVisibility.BANNER,\n\t\t\tseverity: Severity.CRITICAL\n\t\t},\n\t\t[CopilotKitErrorCode.REMOTE_ENDPOINT_NOT_FOUND]: {\n\t\t\tstatusCode: 404,\n\t\t\ttroubleshootingUrl: `${BASE_URL}/troubleshooting/common-issues#i-am-getting-copilotkits-remote-endpoint-not-found-error`,\n\t\t\tvisibility: ErrorVisibility.BANNER,\n\t\t\tseverity: Severity.CRITICAL\n\t\t},\n\t\t[CopilotKitErrorCode.AUTHENTICATION_ERROR]: {\n\t\t\tstatusCode: 401,\n\t\t\ttroubleshootingUrl: `${BASE_URL}/troubleshooting/common-issues#authentication-errors`,\n\t\t\tvisibility: ErrorVisibility.BANNER,\n\t\t\tseverity: Severity.CRITICAL\n\t\t},\n\t\t[CopilotKitErrorCode.MISUSE]: {\n\t\t\tstatusCode: 400,\n\t\t\ttroubleshootingUrl: null,\n\t\t\tvisibility: ErrorVisibility.DEV_ONLY,\n\t\t\tseverity: Severity.WARNING\n\t\t},\n\t\t[CopilotKitErrorCode.UNKNOWN]: {\n\t\t\tstatusCode: 500,\n\t\t\tvisibility: ErrorVisibility.TOAST,\n\t\t\tseverity: Severity.CRITICAL\n\t\t},\n\t\t[CopilotKitErrorCode.CONFIGURATION_ERROR]: {\n\t\t\tstatusCode: 400,\n\t\t\ttroubleshootingUrl: null,\n\t\t\tseverity: Severity.WARNING,\n\t\t\tvisibility: ErrorVisibility.BANNER\n\t\t},\n\t\t[CopilotKitErrorCode.MISSING_PUBLIC_API_KEY_ERROR]: {\n\t\t\tstatusCode: 400,\n\t\t\ttroubleshootingUrl: null,\n\t\t\tseverity: Severity.CRITICAL,\n\t\t\tvisibility: ErrorVisibility.BANNER\n\t\t},\n\t\t[CopilotKitErrorCode.UPGRADE_REQUIRED_ERROR]: {\n\t\t\tstatusCode: 402,\n\t\t\ttroubleshootingUrl: null,\n\t\t\tseverity: Severity.WARNING,\n\t\t\tvisibility: ErrorVisibility.BANNER\n\t\t},\n\t\t[CopilotKitErrorCode.VERSION_MISMATCH]: {\n\t\t\tstatusCode: 400,\n\t\t\ttroubleshootingUrl: null,\n\t\t\tvisibility: ErrorVisibility.DEV_ONLY,\n\t\t\tseverity: Severity.INFO\n\t\t}\n\t};\n\tvar CopilotKitError = class extends graphql.GraphQLError {\n\t\tconstructor({ message = \"Unknown error occurred\", code, severity, visibility }) {\n\t\t\tvar _ref;\n\t\t\tconst name = ERROR_NAMES.COPILOT_ERROR;\n\t\t\tconst config = ERROR_CONFIG[code];\n\t\t\tconst { statusCode } = config;\n\t\t\tconst resolvedVisibility = (_ref = visibility !== null && visibility !== void 0 ? visibility : config.visibility) !== null && _ref !== void 0 ? _ref : ErrorVisibility.TOAST;\n\t\t\tconst resolvedSeverity = severity !== null && severity !== void 0 ? severity : \"severity\" in config ? config.severity : void 0;\n\t\t\tsuper(message, { extensions: {\n\t\t\t\tname,\n\t\t\t\tstatusCode,\n\t\t\t\tcode,\n\t\t\t\tvisibility: resolvedVisibility,\n\t\t\t\tseverity: resolvedSeverity,\n\t\t\t\ttroubleshootingUrl: \"troubleshootingUrl\" in config ? config.troubleshootingUrl : null,\n\t\t\t\toriginalError: {\n\t\t\t\t\tmessage,\n\t\t\t\t\tstack: (/* @__PURE__ */ new Error()).stack\n\t\t\t\t}\n\t\t\t} });\n\t\t\tthis.code = code;\n\t\t\tthis.name = name;\n\t\t\tthis.statusCode = statusCode;\n\t\t\tthis.severity = resolvedSeverity;\n\t\t\tthis.visibility = resolvedVisibility;\n\t\t}\n\t};\n\t/**\n\t* Error thrown when we can identify wrong usage of our components.\n\t* This helps us notify the developer before real errors can happen\n\t*\n\t* @extends CopilotKitError\n\t*/\n\tvar CopilotKitMisuseError = class extends CopilotKitError {\n\t\tconstructor({ message, code = CopilotKitErrorCode.MISUSE }) {\n\t\t\tconst docsLink = \"troubleshootingUrl\" in ERROR_CONFIG[code] && ERROR_CONFIG[code].troubleshootingUrl ? getSeeMoreMarkdown(ERROR_CONFIG[code].troubleshootingUrl) : null;\n\t\t\tconst finalMessage = docsLink ? `${message}.\\n\\n${docsLink}` : message;\n\t\t\tsuper({\n\t\t\t\tmessage: finalMessage,\n\t\t\t\tcode\n\t\t\t});\n\t\t\tthis.name = ERROR_NAMES.COPILOT_API_DISCOVERY_ERROR;\n\t\t}\n\t};\n\tconst getVersionMismatchErrorMessage = ({ reactCoreVersion, runtimeVersion, runtimeClientGqlVersion }) => `Version mismatch detected: @copilotkit/runtime@${runtimeVersion !== null && runtimeVersion !== void 0 ? runtimeVersion : \"\"} is not compatible with @copilotkit/react-core@${reactCoreVersion} and @copilotkit/runtime-client-gql@${runtimeClientGqlVersion}. Please ensure all installed copilotkit packages are on the same version.`;\n\t/**\n\t* Error thrown when CPK versions does not match\n\t*\n\t* @extends CopilotKitError\n\t*/\n\tvar CopilotKitVersionMismatchError = class extends CopilotKitError {\n\t\tconstructor({ reactCoreVersion, runtimeVersion, runtimeClientGqlVersion }) {\n\t\t\tconst code = CopilotKitErrorCode.VERSION_MISMATCH;\n\t\t\tsuper({\n\t\t\t\tmessage: getVersionMismatchErrorMessage({\n\t\t\t\t\treactCoreVersion,\n\t\t\t\t\truntimeVersion,\n\t\t\t\t\truntimeClientGqlVersion\n\t\t\t\t}),\n\t\t\t\tcode\n\t\t\t});\n\t\t\tthis.name = ERROR_NAMES.COPILOT_KIT_VERSION_MISMATCH_ERROR;\n\t\t}\n\t};\n\t/**\n\t* Error thrown when the CopilotKit API endpoint cannot be discovered or accessed.\n\t* This typically occurs when:\n\t* - The API endpoint URL is invalid or misconfigured\n\t* - The API service is not running at the expected location\n\t* - There are network/firewall issues preventing access\n\t*\n\t* @extends CopilotKitError\n\t*/\n\tvar CopilotKitApiDiscoveryError = class extends CopilotKitError {\n\t\tconstructor(params = {}) {\n\t\t\tvar _params$url, _params$message, _params$code;\n\t\t\tconst url = (_params$url = params.url) !== null && _params$url !== void 0 ? _params$url : \"\";\n\t\t\tlet operationSuffix = \"\";\n\t\t\tif (url === null || url === void 0 ? void 0 : url.includes(\"/info\")) operationSuffix = `when fetching CopilotKit info`;\n\t\t\telse if (url.includes(\"/actions/execute\")) operationSuffix = `when attempting to execute actions.`;\n\t\t\telse if (url.includes(\"/agents/state\")) operationSuffix = `when attempting to get agent state.`;\n\t\t\telse if (url.includes(\"/agents/execute\")) operationSuffix = `when attempting to execute agent(s).`;\n\t\t\tconst message = (_params$message = params.message) !== null && _params$message !== void 0 ? _params$message : params.url ? `Failed to find CopilotKit API endpoint at url ${params.url} ${operationSuffix}` : `Failed to find CopilotKit API endpoint.`;\n\t\t\tconst code = (_params$code = params.code) !== null && _params$code !== void 0 ? _params$code : CopilotKitErrorCode.API_NOT_FOUND;\n\t\t\tconst errorMessage = `${message}.\\n\\n${getSeeMoreMarkdown(ERROR_CONFIG[code].troubleshootingUrl)}`;\n\t\t\tsuper({\n\t\t\t\tmessage: errorMessage,\n\t\t\t\tcode\n\t\t\t});\n\t\t\tthis.name = ERROR_NAMES.COPILOT_API_DISCOVERY_ERROR;\n\t\t}\n\t};\n\t/**\n\t* This error is used for endpoints specified in runtime's remote endpoints. If they cannot be contacted\n\t* This typically occurs when:\n\t* - The API endpoint URL is invalid or misconfigured\n\t* - The API service is not running at the expected location\n\t*\n\t* @extends CopilotKitApiDiscoveryError\n\t*/\n\tvar CopilotKitRemoteEndpointDiscoveryError = class extends CopilotKitApiDiscoveryError {\n\t\tconstructor(params) {\n\t\t\tvar _params$message2;\n\t\t\tconst message = (_params$message2 = params === null || params === void 0 ? void 0 : params.message) !== null && _params$message2 !== void 0 ? _params$message2 : (params === null || params === void 0 ? void 0 : params.url) ? `Failed to find or contact remote endpoint at url ${params.url}` : \"Failed to find or contact remote endpoint\";\n\t\t\tconst code = CopilotKitErrorCode.REMOTE_ENDPOINT_NOT_FOUND;\n\t\t\tsuper({\n\t\t\t\tmessage,\n\t\t\t\tcode\n\t\t\t});\n\t\t\tthis.name = ERROR_NAMES.COPILOT_REMOTE_ENDPOINT_DISCOVERY_ERROR;\n\t\t}\n\t};\n\t/**\n\t* Error thrown when a LangGraph agent cannot be found or accessed.\n\t* This typically occurs when:\n\t* - The specified agent name does not exist in the deployment\n\t* - The agent configuration is invalid or missing\n\t* - The agent service is not properly deployed or initialized\n\t*\n\t* @extends CopilotKitError\n\t*/\n\tvar CopilotKitAgentDiscoveryError = class extends CopilotKitError {\n\t\tconstructor(params) {\n\t\t\tconst { agentName, availableAgents } = params;\n\t\t\tconst code = CopilotKitErrorCode.AGENT_NOT_FOUND;\n\t\t\tconst seeMore = getSeeMoreMarkdown(ERROR_CONFIG[code].troubleshootingUrl);\n\t\t\tlet message;\n\t\t\tif (availableAgents.length) {\n\t\t\t\tconst agentList = availableAgents.map((agent) => agent.name).join(\", \");\n\t\t\t\tif (agentName) message = `Agent '${agentName}' was not found. Available agents are: ${agentList}. Please verify the agent name in your configuration and ensure it matches one of the available agents.\\n\\n${seeMore}`;\n\t\t\t\telse message = `The requested agent was not found. Available agents are: ${agentList}. Please verify the agent name in your configuration and ensure it matches one of the available agents.\\n\\n${seeMore}`;\n\t\t\t} else message = `${agentName ? `Agent '${agentName}'` : \"The requested agent\"} was not found. Please set up at least one agent before proceeding. ${seeMore}`;\n\t\t\tsuper({\n\t\t\t\tmessage,\n\t\t\t\tcode\n\t\t\t});\n\t\t\tthis.name = ERROR_NAMES.COPILOT_KIT_AGENT_DISCOVERY_ERROR;\n\t\t}\n\t};\n\t/**\n\t* Handles low-level networking errors that occur before a request reaches the server.\n\t* These errors arise from issues in the underlying communication infrastructure rather than\n\t* application-level logic or server responses. Typically used to handle \"fetch failed\" errors\n\t* where no HTTP status code is available.\n\t*\n\t* Common scenarios include:\n\t* - Connection failures (ECONNREFUSED) when server is down/unreachable\n\t* - DNS resolution failures (ENOTFOUND) when domain can't be resolved\n\t* - Timeouts (ETIMEDOUT) when request takes too long\n\t* - Protocol/transport layer errors like SSL/TLS issues\n\t*/\n\tvar CopilotKitLowLevelError = class extends CopilotKitError {\n\t\tconstructor({ error, url, message }) {\n\t\t\tlet code = CopilotKitErrorCode.NETWORK_ERROR;\n\t\t\tconst errorCode = error.code;\n\t\t\tconst errorMessage = message !== null && message !== void 0 ? message : resolveLowLevelErrorMessage({\n\t\t\t\terrorCode,\n\t\t\t\turl\n\t\t\t});\n\t\t\tsuper({\n\t\t\t\tmessage: errorMessage,\n\t\t\t\tcode\n\t\t\t});\n\t\t\tthis.name = ERROR_NAMES.COPILOT_KIT_LOW_LEVEL_ERROR;\n\t\t}\n\t};\n\t/**\n\t* Generic catch-all error handler for HTTP responses from the CopilotKit API where a status code is available.\n\t* Used when we receive an HTTP error status and wish to handle broad range of them\n\t*\n\t* This differs from CopilotKitLowLevelError in that:\n\t* - ResolvedCopilotKitError: Server was reached and returned an HTTP status\n\t* - CopilotKitLowLevelError: Error occurred before reaching server (e.g. network failure)\n\t*\n\t* @param status - The HTTP status code received from the API response\n\t* @param message - Optional error message to include\n\t* @param code - Optional specific CopilotKitErrorCode to override default behavior\n\t*\n\t* Default behavior:\n\t* - 400 Bad Request: Maps to CopilotKitApiDiscoveryError\n\t* - All other status codes: Maps to UNKNOWN error code if no specific code provided\n\t*/\n\tvar ResolvedCopilotKitError = class extends CopilotKitError {\n\t\tconstructor({ status, message, code, isRemoteEndpoint, url }) {\n\t\t\tlet resolvedCode = code;\n\t\t\tif (!resolvedCode) switch (status) {\n\t\t\t\tcase 400: throw new CopilotKitApiDiscoveryError({\n\t\t\t\t\tmessage,\n\t\t\t\t\turl\n\t\t\t\t});\n\t\t\t\tcase 404: throw isRemoteEndpoint ? new CopilotKitRemoteEndpointDiscoveryError({\n\t\t\t\t\tmessage,\n\t\t\t\t\turl\n\t\t\t\t}) : new CopilotKitApiDiscoveryError({\n\t\t\t\t\tmessage,\n\t\t\t\t\turl\n\t\t\t\t});\n\t\t\t\tdefault:\n\t\t\t\t\tresolvedCode = CopilotKitErrorCode.UNKNOWN;\n\t\t\t\t\tbreak;\n\t\t\t}\n\t\t\tsuper({\n\t\t\t\tmessage,\n\t\t\t\tcode: resolvedCode\n\t\t\t});\n\t\t\tthis.name = ERROR_NAMES.RESOLVED_COPILOT_KIT_ERROR;\n\t\t}\n\t};\n\tvar ConfigurationError = class extends CopilotKitError {\n\t\tconstructor(message) {\n\t\t\tsuper({\n\t\t\t\tmessage,\n\t\t\t\tcode: CopilotKitErrorCode.CONFIGURATION_ERROR\n\t\t\t});\n\t\t\tthis.name = ERROR_NAMES.CONFIGURATION_ERROR;\n\t\t\tthis.severity = Severity.WARNING;\n\t\t}\n\t};\n\tvar MissingPublicApiKeyError = class extends ConfigurationError {\n\t\tconstructor(message) {\n\t\t\tsuper(message);\n\t\t\tthis.name = ERROR_NAMES.MISSING_PUBLIC_API_KEY_ERROR;\n\t\t\tthis.severity = Severity.CRITICAL;\n\t\t}\n\t};\n\tvar UpgradeRequiredError = class extends ConfigurationError {\n\t\tconstructor(message) {\n\t\t\tsuper(message);\n\t\t\tthis.name = ERROR_NAMES.UPGRADE_REQUIRED_ERROR;\n\t\t\tthis.severity = Severity.WARNING;\n\t\t}\n\t};\n\t/**\n\t* Checks if an error is already a structured CopilotKit error.\n\t* This utility centralizes the logic for detecting structured errors across the codebase.\n\t*\n\t* @param error - The error to check\n\t* @returns true if the error is already structured, false otherwise\n\t*/\n\tfunction isStructuredCopilotKitError(error) {\n\t\tvar _error$extensions;\n\t\treturn error instanceof CopilotKitError || error instanceof CopilotKitLowLevelError || (error === null || error === void 0 ? void 0 : error.name) && error.name.includes(\"CopilotKit\") || (error === null || error === void 0 || (_error$extensions = error.extensions) === null || _error$extensions === void 0 ? void 0 : _error$extensions.code) !== void 0;\n\t}\n\t/**\n\t* Returns the error as-is if it's already structured, otherwise converts it using the provided converter function.\n\t* This utility centralizes the pattern of preserving structured errors while converting unstructured ones.\n\t*\n\t* @param error - The error to process\n\t* @param converter - Function to convert unstructured errors to structured ones\n\t* @returns The structured error\n\t*/\n\tfunction ensureStructuredError(error, converter) {\n\t\treturn isStructuredCopilotKitError(error) ? error : converter(error);\n\t}\n\tasync function getPossibleVersionMismatch({ runtimeVersion, runtimeClientGqlVersion }) {\n\t\tif (!runtimeVersion || runtimeVersion === \"\" || !runtimeClientGqlVersion) return;\n\t\tif (COPILOTKIT_VERSION !== runtimeVersion || COPILOTKIT_VERSION !== runtimeClientGqlVersion || runtimeVersion !== runtimeClientGqlVersion) return {\n\t\t\truntimeVersion,\n\t\t\truntimeClientGqlVersion,\n\t\t\treactCoreVersion: COPILOTKIT_VERSION,\n\t\t\tmessage: getVersionMismatchErrorMessage({\n\t\t\t\truntimeVersion,\n\t\t\t\truntimeClientGqlVersion,\n\t\t\t\treactCoreVersion: COPILOTKIT_VERSION\n\t\t\t})\n\t\t};\n\t}\n\tconst resolveLowLevelErrorMessage = ({ errorCode, url }) => {\n\t\tconst troubleshootingLink = ERROR_CONFIG[CopilotKitErrorCode.NETWORK_ERROR].troubleshootingUrl;\n\t\tconst genericMessage = (description = `Failed to fetch from url ${url}.`) => `${description}.\n\nPossible reasons:\n- -The server may have an error preventing it from returning a response (Check the server logs for more info).\n- -The server might be down or unreachable\n- -There might be a network issue (e.g., DNS failure, connection timeout) \n- -The URL might be incorrect\n- -The server is not running on the specified port\n\n${getSeeMoreMarkdown(troubleshootingLink)}`;\n\t\tif (url.includes(\"/info\")) return genericMessage(`Failed to fetch CopilotKit agents/action information from url ${url}.`);\n\t\tif (url.includes(\"/actions/execute\")) return genericMessage(`Fetch call to ${url} to execute actions failed.`);\n\t\tif (url.includes(\"/agents/state\")) return genericMessage(`Fetch call to ${url} to get agent state failed.`);\n\t\tif (url.includes(\"/agents/execute\")) return genericMessage(`Fetch call to ${url} to execute agent(s) failed.`);\n\t\tswitch (errorCode) {\n\t\t\tcase \"ECONNREFUSED\": return `Connection to ${url} was refused. Ensure the server is running and accessible.\\n\\n${getSeeMoreMarkdown(troubleshootingLink)}`;\n\t\t\tcase \"ENOTFOUND\": return `The server on ${url} could not be found. Check the URL or your network configuration.\\n\\n${getSeeMoreMarkdown(ERROR_CONFIG[CopilotKitErrorCode.NOT_FOUND].troubleshootingUrl)}`;\n\t\t\tcase \"ETIMEDOUT\": return `The connection to ${url} timed out. The server might be overloaded or taking too long to respond.\\n\\n${getSeeMoreMarkdown(troubleshootingLink)}`;\n\t\t\tdefault: return;\n\t\t}\n\t};\n\n//#endregion\n//#region src/utils/json-schema.ts\n\tfunction actionParametersToJsonSchema(actionParameters) {\n\t\tlet parameters = {};\n\t\tfor (let parameter of actionParameters || []) parameters[parameter.name] = convertAttribute(parameter);\n\t\tlet requiredParameterNames = [];\n\t\tfor (let arg of actionParameters || []) if (arg.required !== false) requiredParameterNames.push(arg.name);\n\t\treturn {\n\t\t\ttype: \"object\",\n\t\t\tproperties: parameters,\n\t\t\trequired: requiredParameterNames\n\t\t};\n\t}\n\tfunction jsonSchemaToActionParameters(jsonSchema) {\n\t\tif (jsonSchema.type !== \"object\" || !jsonSchema.properties) return [];\n\t\tconst parameters = [];\n\t\tconst requiredFields = jsonSchema.required || [];\n\t\tfor (const [name, schema] of Object.entries(jsonSchema.properties)) {\n\t\t\tconst parameter = convertJsonSchemaToParameter(name, schema, requiredFields.includes(name));\n\t\t\tparameters.push(parameter);\n\t\t}\n\t\treturn parameters;\n\t}\n\tfunction convertJsonSchemaToParameter(name, schema, isRequired) {\n\t\tconst baseParameter = {\n\t\t\tname,\n\t\t\tdescription: schema.description\n\t\t};\n\t\tif (!isRequired) baseParameter.required = false;\n\t\tswitch (schema.type) {\n\t\t\tcase \"string\": return {\n\t\t\t\t...baseParameter,\n\t\t\t\ttype: \"string\",\n\t\t\t\t...schema.enum && { enum: schema.enum }\n\t\t\t};\n\t\t\tcase \"number\":\n\t\t\tcase \"boolean\": return {\n\t\t\t\t...baseParameter,\n\t\t\t\ttype: schema.type\n\t\t\t};\n\t\t\tcase \"object\":\n\t\t\t\tif (schema.properties) {\n\t\t\t\t\tconst attributes = [];\n\t\t\t\t\tconst requiredFields = schema.required || [];\n\t\t\t\t\tfor (const [propName, propSchema] of Object.entries(schema.properties)) attributes.push(convertJsonSchemaToParameter(propName, propSchema, requiredFields.includes(propName)));\n\t\t\t\t\treturn {\n\t\t\t\t\t\t...baseParameter,\n\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\tattributes\n\t\t\t\t\t};\n\t\t\t\t}\n\t\t\t\treturn {\n\t\t\t\t\t...baseParameter,\n\t\t\t\t\ttype: \"object\"\n\t\t\t\t};\n\t\t\tcase \"array\": if (schema.items.type === \"object\" && \"properties\" in schema.items) {\n\t\t\t\tconst attributes = [];\n\t\t\t\tconst requiredFields = schema.items.required || [];\n\t\t\t\tfor (const [propName, propSchema] of Object.entries(schema.items.properties || {})) attributes.push(convertJsonSchemaToParameter(propName, propSchema, requiredFields.includes(propName)));\n\t\t\t\treturn {\n\t\t\t\t\t...baseParameter,\n\t\t\t\t\ttype: \"object[]\",\n\t\t\t\t\tattributes\n\t\t\t\t};\n\t\t\t} else if (schema.items.type === \"array\") throw new Error(\"Nested arrays are not supported\");\n\t\t\telse return {\n\t\t\t\t...baseParameter,\n\t\t\t\ttype: `${schema.items.type}[]`\n\t\t\t};\n\t\t\tdefault: return {\n\t\t\t\t...baseParameter,\n\t\t\t\ttype: \"string\"\n\t\t\t};\n\t\t}\n\t}\n\tfunction convertAttribute(attribute) {\n\t\tswitch (attribute.type) {\n\t\t\tcase \"string\": return {\n\t\t\t\ttype: \"string\",\n\t\t\t\tdescription: attribute.description,\n\t\t\t\t...attribute.enum && { enum: attribute.enum }\n\t\t\t};\n\t\t\tcase \"number\":\n\t\t\tcase \"boolean\": return {\n\t\t\t\ttype: attribute.type,\n\t\t\t\tdescription: attribute.description\n\t\t\t};\n\t\t\tcase \"object\":\n\t\t\tcase \"object[]\":\n\t\t\t\tvar _attribute$attributes, _attribute$attributes2;\n\t\t\t\tconst properties = (_attribute$attributes = attribute.attributes) === null || _attribute$attributes === void 0 ? void 0 : _attribute$attributes.reduce((acc, attr) => {\n\t\t\t\t\tacc[attr.name] = convertAttribute(attr);\n\t\t\t\t\treturn acc;\n\t\t\t\t}, {});\n\t\t\t\tconst required = (_attribute$attributes2 = attribute.attributes) === null || _attribute$attributes2 === void 0 ? void 0 : _attribute$attributes2.filter((attr) => attr.required !== false).map((attr) => attr.name);\n\t\t\t\tif (attribute.type === \"object[]\") return {\n\t\t\t\t\ttype: \"array\",\n\t\t\t\t\titems: {\n\t\t\t\t\t\ttype: \"object\",\n\t\t\t\t\t\t...properties && { properties },\n\t\t\t\t\t\t...required && required.length > 0 && { required }\n\t\t\t\t\t},\n\t\t\t\t\tdescription: attribute.description\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"object\",\n\t\t\t\t\tdescription: attribute.description,\n\t\t\t\t\t...properties && { properties },\n\t\t\t\t\t...required && required.length > 0 && { required }\n\t\t\t\t};\n\t\t\tdefault:\n\t\t\t\tvar _attribute$type;\n\t\t\t\tif ((_attribute$type = attribute.type) === null || _attribute$type === void 0 ? void 0 : _attribute$type.endsWith(\"[]\")) return {\n\t\t\t\t\ttype: \"array\",\n\t\t\t\t\titems: { type: attribute.type.slice(0, -2) },\n\t\t\t\t\tdescription: attribute.description\n\t\t\t\t};\n\t\t\t\treturn {\n\t\t\t\t\ttype: \"string\",\n\t\t\t\t\tdescription: attribute.description\n\t\t\t\t};\n\t\t}\n\t}\n\tfunction convertJsonSchemaToZodSchema(jsonSchema, required) {\n\t\tif (jsonSchema.type === \"object\") {\n\t\t\tconst spec = {};\n\t\t\tif (!jsonSchema.properties || !Object.keys(jsonSchema.properties).length) return !required ? zod.z.object(spec).optional() : zod.z.object(spec);\n\t\t\tfor (const [key, value] of Object.entries(jsonSchema.properties)) spec[key] = convertJsonSchemaToZodSchema(value, jsonSchema.required ? jsonSchema.required.includes(key) : false);\n\t\t\tlet schema = zod.z.object(spec).describe(jsonSchema.description);\n\t\t\treturn required ? schema : schema.optional();\n\t\t} else if (jsonSchema.type === \"string\") {\n\t\t\tlet schema = zod.z.string().describe(jsonSchema.description);\n\t\t\treturn required ? schema : schema.optional();\n\t\t} else if (jsonSchema.type === \"number\") {\n\t\t\tlet schema = zod.z.number().describe(jsonSchema.description);\n\t\t\treturn required ? schema : schema.optional();\n\t\t} else if (jsonSchema.type === \"boolean\") {\n\t\t\tlet schema = zod.z.boolean().describe(jsonSchema.description);\n\t\t\treturn required ? schema : schema.optional();\n\t\t} else if (jsonSchema.type === \"array\") {\n\t\t\tlet itemSchema = convertJsonSchemaToZodSchema(jsonSchema.items, true);\n\t\t\tlet schema = zod.z.array(itemSchema).describe(jsonSchema.description);\n\t\t\treturn required ? schema : schema.optional();\n\t\t}\n\t\tthrow new Error(\"Invalid JSON schema\");\n\t}\n\tfunction getZodParameters(parameters) {\n\t\tif (!parameters) return zod.z.object({});\n\t\treturn convertJsonSchemaToZodSchema(actionParametersToJsonSchema(parameters), true);\n\t}\n\n//#endregion\n//#region src/utils/random-id.ts\n\tfunction randomId() {\n\t\treturn \"ck-\" + (0, uuid.v4)();\n\t}\n\tfunction randomUUID() {\n\t\treturn (0, uuid.v4)();\n\t}\n\t/**\n\t* Recursively converts an object to a serializable form by converting functions to their string representation.\n\t*/\n\tfunction toSerializable(value) {\n\t\tif (typeof value === \"function\") return value.toString();\n\t\tif (Array.isArray(value)) return value.map(toSerializable);\n\t\tif (value !== null && typeof value === \"object\") {\n\t\t\tconst result = {};\n\t\t\tfor (const key of Object.keys(value)) result[key] = toSerializable(value[key]);\n\t\t\treturn result;\n\t\t}\n\t\treturn value;\n\t}\n\tfunction dataToUUID(input, namespace) {\n\t\tconst BASE_NAMESPACE = \"e4b01160-ff74-4c6e-9b27-d53cd930fe8e\";\n\t\tconst boundNamespace = namespace ? (0, uuid.v5)(namespace, BASE_NAMESPACE) : BASE_NAMESPACE;\n\t\treturn (0, uuid.v5)(typeof input === \"string\" ? input : JSON.stringify(toSerializable(input)), boundNamespace);\n\t}\n\tfunction isValidUUID(uuid$1) {\n\t\treturn (0, uuid.validate)(uuid$1);\n\t}\n\n//#endregion\n//#region src/utils/requests.ts\n/**\n\t* Safely read a Response/Request body with sensible defaults:\n\t* - clones the response/request to avoid consuming the original response/request\n\t* - Skips GET/HEAD\n\t* - Tries JSON first regardless of content-type\n\t* - Falls back to text and optionally parses when it \"looks\" like JSON\n\t*/\n\tasync function readBody(r) {\n\t\tconst method = \"method\" in r ? r.method.toUpperCase() : void 0;\n\t\tif (method === \"GET\" || method === \"HEAD\") return;\n\t\tif (!(\"body\" in r) || r.body == null) return;\n\t\ttry {\n\t\t\treturn await r.clone().json();\n\t\t} catch (_unused) {\n\t\t\ttry {\n\t\t\t\tconst text = await r.clone().text();\n\t\t\t\tconst trimmed = text.trim();\n\t\t\t\tif (trimmed.length === 0) return text;\n\t\t\t\tif (trimmed.startsWith(\"{\") || trimmed.startsWith(\"[\")) try {\n\t\t\t\t\treturn JSON.parse(trimmed);\n\t\t\t\t} catch (_unused2) {\n\t\t\t\t\treturn text;\n\t\t\t\t}\n\t\t\t\treturn text;\n\t\t\t} catch (_unused3) {\n\t\t\t\ttry {\n\t\t\t\t\tvar _c$body;\n\t\t\t\t\tconst stream = (_c$body = r.clone().body) !== null && _c$body !== void 0 ? _c$body : null;\n\t\t\t\t\tif (!stream) return void 0;\n\t\t\t\t\tconst reader = stream.getReader();\n\t\t\t\t\tconst decoder = new TextDecoder();\n\t\t\t\t\tlet out = \"\";\n\t\t\t\t\twhile (true) {\n\t\t\t\t\t\tconst { done, value } = await reader.read();\n\t\t\t\t\t\tif (done) break;\n\t\t\t\t\t\tif (typeof value === \"string\") out += value;\n\t\t\t\t\t\telse out += decoder.decode(value, { stream: true });\n\t\t\t\t\t}\n\t\t\t\t\tout += decoder.decode();\n\t\t\t\t\tconst trimmed = out.trim();\n\t\t\t\t\tif (trimmed.length === 0) return out;\n\t\t\t\t\tif (trimmed.startsWith(\"{\") || trimmed.startsWith(\"[\")) try {\n\t\t\t\t\t\treturn JSON.parse(trimmed);\n\t\t\t\t\t} catch (_unused4) {\n\t\t\t\t\t\treturn out;\n\t\t\t\t\t}\n\t\t\t\t\treturn out;\n\t\t\t\t} catch (_unused5) {\n\t\t\t\t\treturn;\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n\n//#endregion\n//#region src/utils/index.ts\n/**\n\t* Safely parses a JSON string into an object\n\t* @param json The JSON string to parse\n\t* @param fallback Optional fallback value to return if parsing fails. If not provided or set to \"unset\", returns null\n\t* @returns The parsed JSON object, or the fallback value (or null) if parsing fails\n\t*/\n\tfunction parseJson(json, fallback = \"unset\") {\n\t\ttry {\n\t\t\treturn JSON.parse(json);\n\t\t} catch (e) {\n\t\t\treturn fallback === \"unset\" ? null : fallback;\n\t\t}\n\t}\n\t/**\n\t* Maps an array of items to a new array, skipping items that throw errors during mapping\n\t* @param items The array to map\n\t* @param callback The mapping function to apply to each item\n\t* @returns A new array containing only the successfully mapped items\n\t*/\n\tfunction tryMap(items, callback) {\n\t\treturn items.reduce((acc, item, index, array) => {\n\t\t\ttry {\n\t\t\t\tacc.push(callback(item, index, array));\n\t\t\t} catch (error) {\n\t\t\t\tconsole.error(error);\n\t\t\t}\n\t\t\treturn acc;\n\t\t}, []);\n\t}\n\t/**\n\t* Checks if the current environment is macOS\n\t* @returns {boolean} True if running on macOS, false otherwise\n\t*/\n\tfunction isMacOS() {\n\t\treturn /Mac|iMac|Macintosh/i.test(navigator.userAgent);\n\t}\n\n//#endregion\n//#region src/constants/index.ts\n\tconst COPILOT_CLOUD_API_URL = \"https://api.cloud.copilotkit.ai\";\n\tconst COPILOT_CLOUD_VERSION = \"v1\";\n\tconst COPILOT_CLOUD_CHAT_URL = `${COPILOT_CLOUD_API_URL}/copilotkit/${COPILOT_CLOUD_VERSION}`;\n\tconst COPILOT_CLOUD_PUBLIC_API_KEY_HEADER = \"X-CopilotCloud-Public-Api-Key\";\n\n//#endregion\n//#region src/telemetry/utils.ts\n\tfunction flattenObject(obj, parentKey = \"\", res = {}) {\n\t\tfor (let key in obj) {\n\t\t\tconst propName = parentKey ? `${parentKey}.${key}` : key;\n\t\t\tif (typeof obj[key] === \"object\" && obj[key] !== null) flattenObject(obj[key], propName, res);\n\t\t\telse res[propName] = obj[key];\n\t\t}\n\t\treturn res;\n\t}\n\n//#endregion\n//#region package.json\n\tvar version = \"1.52.1\";\n\n//#endregion\n//#region src/telemetry/scarf-client.ts\n\tconst SCARF_BASE_URL = `https://copilotkit.gateway.scarf.sh/${version}`;\n\tvar ScarfClient = class {\n\t\tconstructor() {}\n\t\tasync logEvent(properties) {\n\t\t\ttry {\n\t\t\t\tconst controller = new AbortController();\n\t\t\t\tconst timeoutId = setTimeout(() => controller.abort(), 3e3);\n\t\t\t\tconst queryParams = new URLSearchParams();\n\t\t\t\tObject.entries(properties).forEach(([key, value]) => {\n\t\t\t\t\tif (value !== null && value !== void 0) queryParams.append(key, String(value));\n\t\t\t\t});\n\t\t\t\tconst url = `${SCARF_BASE_URL}?${queryParams.toString()}`;\n\t\t\t\tconst response = await fetch(url, {\n\t\t\t\t\tmethod: \"GET\",\n\t\t\t\t\tsignal: controller.signal\n\t\t\t\t});\n\t\t\t\tclearTimeout(timeoutId);\n\t\t\t\tif (!response.ok) throw new Error(`HTTP error! status: ${response.status}`);\n\t\t\t} catch (_unused) {}\n\t\t}\n\t};\n\tvar scarf_client_default = new ScarfClient();\n\n//#endregion\n//#region src/telemetry/telemetry-client.ts\n/**\n\t* Checks if telemetry is disabled via environment variables.\n\t* Users can opt out by setting:\n\t* - COPILOTKIT_TELEMETRY_DISABLED=true or COPILOTKIT_TELEMETRY_DISABLED=1\n\t* - DO_NOT_TRACK=true or DO_NOT_TRACK=1\n\t*/\n\tfunction isTelemetryDisabled() {\n\t\treturn process.env.COPILOTKIT_TELEMETRY_DISABLED === \"true\" || process.env.COPILOTKIT_TELEMETRY_DISABLED === \"1\" || process.env.DO_NOT_TRACK === \"true\" || process.env.DO_NOT_TRACK === \"1\";\n\t}\n\tvar TelemetryClient = class {\n\t\tconstructor({ packageName, packageVersion, telemetryDisabled, telemetryBaseUrl, sampleRate }) {\n\t\t\tthis.globalProperties = {};\n\t\t\tthis.cloudConfiguration = null;\n\t\t\tthis.telemetryDisabled = false;\n\t\t\tthis.sampleRate = .05;\n\t\t\tthis.anonymousId = `anon_${(0, uuid.v4)()}`;\n\t\t\tthis.packageName = packageName;\n\t\t\tthis.packageVersion = packageVersion;\n\t\t\tthis.telemetryDisabled = telemetryDisabled || isTelemetryDisabled();\n\t\t\tif (this.telemetryDisabled) return;\n\t\t\tthis.setSampleRate(sampleRate);\n\t\t\tthis.segment = new _segment_analytics_node.Analytics({ writeKey: process.env.COPILOTKIT_SEGMENT_WRITE_KEY || \"n7XAZtQCGS2v1vvBy3LgBCv2h3Y8whja\" });\n\t\t\tthis.setGlobalProperties({\n\t\t\t\t\"copilotkit.package.name\": packageName,\n\t\t\t\t\"copilotkit.package.version\": packageVersion\n\t\t\t});\n\t\t}\n\t\tshouldSendEvent() {\n\t\t\treturn Math.random() < this.sampleRate;\n\t\t}\n\t\tasync capture(event, properties) {\n\t\t\tif (!this.shouldSendEvent() || !this.segment) return;\n\t\t\tconst flattenedProperties = flattenObject(properties);\n\t\t\tconst propertiesWithGlobal = {\n\t\t\t\t...this.globalProperties,\n\t\t\t\t...flattenedProperties\n\t\t\t};\n\t\t\tconst orderedPropertiesWithGlobal = Object.keys(propertiesWithGlobal).sort().reduce((obj, key) => {\n\t\t\t\tobj[key] = propertiesWithGlobal[key];\n\t\t\t\treturn obj;\n\t\t\t}, {});\n\t\t\tthis.segment.track({\n\t\t\t\tanonymousId: this.anonymousId,\n\t\t\t\tevent,\n\t\t\t\tproperties: { ...orderedPropertiesWithGlobal }\n\t\t\t});\n\t\t\tawait scarf_client_default.logEvent({ event });\n\t\t}\n\t\tsetGlobalProperties(properties) {\n\t\t\tconst flattenedProperties = flattenObject(properties);\n\t\t\tthis.globalProperties = {\n\t\t\t\t...this.globalProperties,\n\t\t\t\t...flattenedProperties\n\t\t\t};\n\t\t}\n\t\tsetCloudConfiguration(properties) {\n\t\t\tthis.cloudConfiguration = properties;\n\t\t\tthis.setGlobalProperties({ cloud: {\n\t\t\t\tpublicApiKey: properties.publicApiKey,\n\t\t\t\tbaseUrl: properties.baseUrl\n\t\t\t} });\n\t\t}\n\t\tsetSampleRate(sampleRate) {\n\t\t\tlet _sampleRate;\n\t\t\t_sampleRate = sampleRate !== null && sampleRate !== void 0 ? sampleRate : .05;\n\t\t\tif (process.env.COPILOTKIT_TELEMETRY_SAMPLE_RATE) _sampleRate = parseFloat(process.env.COPILOTKIT_TELEMETRY_SAMPLE_RATE);\n\t\t\tif (_sampleRate < 0 || _sampleRate > 1) throw new Error(\"Sample rate must be between 0 and 1\");\n\t\t\tthis.sampleRate = _sampleRate;\n\t\t\tthis.setGlobalProperties({\n\t\t\t\tsampleRate: this.sampleRate,\n\t\t\t\tsampleRateAdjustmentFactor: 1 - this.sampleRate,\n\t\t\t\tsampleWeight: 1 / this.sampleRate\n\t\t\t});\n\t\t}\n\t};\n\n//#endregion\n//#region src/index.ts\n\tconst COPILOTKIT_VERSION = version;\n\n//#endregion\nexports.BANNER_ERROR_NAMES = BANNER_ERROR_NAMES;\nexports.COPILOTKIT_VERSION = COPILOTKIT_VERSION;\nexports.COPILOT_CLOUD_API_URL = COPILOT_CLOUD_API_URL;\nexports.COPILOT_CLOUD_CHAT_URL = COPILOT_CLOUD_CHAT_URL;\nexports.COPILOT_CLOUD_ERROR_NAMES = COPILOT_CLOUD_ERROR_NAMES;\nexports.COPILOT_CLOUD_PUBLIC_API_KEY_HEADER = COPILOT_CLOUD_PUBLIC_API_KEY_HEADER;\nexports.COPILOT_CLOUD_VERSION = COPILOT_CLOUD_VERSION;\nexports.ConfigurationError = ConfigurationError;\nexports.ConsoleColors = ConsoleColors;\nexports.ConsoleStyles = ConsoleStyles;\nexports.CopilotKitAgentDiscoveryError = CopilotKitAgentDiscoveryError;\nexports.CopilotKitApiDiscoveryError = CopilotKitApiDiscoveryError;\nexports.CopilotKitError = CopilotKitError;\nexports.CopilotKitErrorCode = CopilotKitErrorCode;\nexports.CopilotKitLowLevelError = CopilotKitLowLevelError;\nexports.CopilotKitMisuseError = CopilotKitMisuseError;\nexports.CopilotKitRemoteEndpointDiscoveryError = CopilotKitRemoteEndpointDiscoveryError;\nexports.CopilotKitVersionMismatchError = CopilotKitVersionMismatchError;\nexports.ERROR_CONFIG = ERROR_CONFIG;\nexports.ERROR_NAMES = ERROR_NAMES;\nexports.ErrorVisibility = ErrorVisibility;\nexports.MissingPublicApiKeyError = MissingPublicApiKeyError;\nexports.ResolvedCopilotKitError = ResolvedCopilotKitError;\nexports.Severity = Severity;\nexports.TelemetryClient = TelemetryClient;\nexports.UpgradeRequiredError = UpgradeRequiredError;\nexports.actionParametersToJsonSchema = actionParametersToJsonSchema;\nexports.convertJsonSchemaToZodSchema = convertJsonSchemaToZodSchema;\nexports.dataToUUID = dataToUUID;\nexports.ensureStructuredError = ensureStructuredError;\nexports.executeConditions = executeConditions;\nexports.getPossibleVersionMismatch = getPossibleVersionMismatch;\nexports.getZodParameters = getZodParameters;\nexports.isMacOS = isMacOS;\nexports.isStructuredCopilotKitError = isStructuredCopilotKitError;\nexports.isTelemetryDisabled = isTelemetryDisabled;\nexports.isValidUUID = isValidUUID;\nexports.jsonSchemaToActionParameters = jsonSchemaToActionParameters;\nexports.logCopilotKitPlatformMessage = logCopilotKitPlatformMessage;\nexports.logStyled = logStyled;\nexports.parseJson = parseJson;\nexports.publicApiKeyRequired = publicApiKeyRequired;\nexports.randomId = randomId;\nexports.randomUUID = randomUUID;\nexports.readBody = readBody;\nexports.styledConsole = styledConsole;\nexports.tryMap = tryMap;\n});\n"]}